173 lines
2.1 MiB
Plaintext
173 lines
2.1 MiB
Plaintext
var oP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L0e(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fd={exports:{}};/**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*/(function(r,e){(function(){var t,s="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",v=500,_="__lodash_placeholder__",A=1,O=2,N=4,L=1,j=2,z=1,q=2,ee=4,F=8,oe=16,te=32,se=64,X=128,we=256,ye=512,Te=30,_e="...",ge=800,nt=16,Je=1,ft=2,V=3,ut=1/0,et=9007199254740991,Et=17976931348623157e292,xt=0/0,He=4294967295,ct=He-1,an=He>>>1,kt=[["ary",X],["bind",z],["bindKey",q],["curry",F],["curryRight",oe],["flip",ye],["partial",te],["partialRight",se],["rearg",we]],bn="[object Arguments]",qe="[object Array]",gt="[object AsyncFunction]",de="[object Boolean]",No="[object Date]",Zn="[object DOMException]",Bn="[object Error]",ao="[object Function]",Wo="[object GeneratorFunction]",St="[object Map]",Xt="[object Number]",Tt="[object Null]",Be="[object Object]",Ut="[object Promise]",gn="[object Proxy]",wt="[object RegExp]",Yt="[object Set]",vn="[object String]",rs="[object Symbol]",eo="[object Undefined]",ds="[object WeakMap]",Or="[object WeakSet]",Rs="[object ArrayBuffer]",Js="[object DataView]",Zs="[object Float32Array]",ba="[object Float64Array]",ar="[object Int8Array]",Ns="[object Int16Array]",Zr="[object Int32Array]",Po="[object Uint8Array]",Mo="[object Uint8ClampedArray]",Mr="[object Uint16Array]",Ls="[object Uint32Array]",na=/\b__p \+= '';/g,gs=/\b(__p \+=) '' \+/g,va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ln=/&(?:amp|lt|gt|quot|#39);/g,ps=/[&<>"']/g,Li=RegExp(ln.source),ze=RegExp(ps.source),Qe=/<%-([\s\S]+?)%>/g,Dt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,qn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uo=/^\w*$/,po=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,ns=RegExp(un.source),_o=/^\s+/,cs=/\s/,Sr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ir=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fi=/[()=,{}\[\]\/\s]/,La=/\\(\\)?/g,mi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,Ge=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,jt=/^\[object .+?Constructor\]$/,fo=/^0o[0-7]+$/i,Lo=/^(?:0|[1-9]\d*)$/,Ko=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,it=/['\n\r\u2028\u2029\\]/g,Zo="\\ud800-\\udfff",Oi="\\u0300-\\u036f",oa="\\ufe20-\\ufe2f",ua="\\u20d0-\\u20ff",ur=Oi+oa+ua,Dc="\\u2700-\\u27bf",gc="a-z\\xdf-\\xf6\\xf8-\\xff",Ja="\\xac\\xb1\\xd7\\xf7",fa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qs="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ki="A-Z\\xc0-\\xd6\\xd8-\\xde",dl="\\ufe0e\\ufe0f",pc=Ja+fa+Qs+xr,Zc="['\u2019]",gu="["+Zo+"]",pr="["+pc+"]",Qa="["+ur+"]",pu="\\d+",qc="["+Dc+"]",Vl="["+gc+"]",Aa="[^"+Zo+pc+pu+Dc+gc+Ki+"]",Tr="\\ud83c[\\udffb-\\udfff]",Rm="(?:"+Qa+"|"+Tr+")",gf="[^"+Zo+"]",kr="(?:\\ud83c[\\udde6-\\uddff]){2}",Fa="[\\ud800-\\udbff][\\udc00-\\udfff]",sa="["+Ki+"]",Yi="\\u200d",bu="(?:"+Vl+"|"+Aa+")",Oc="(?:"+sa+"|"+Aa+")",Ha="(?:"+Zc+"(?:d|ll|m|re|s|t|ve))?",Mc="(?:"+Zc+"(?:D|LL|M|RE|S|T|VE))?",bc=Rm+"?",gd="["+dl+"]?",Bf="(?:"+Yi+"(?:"+[gf,kr,Fa].join("|")+")"+gd+bc+")*",vu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ul="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rc=gd+bc+Bf,pf="(?:"+[qc,kr,Fa].join("|")+")"+Rc,Gc="(?:"+[gf+Qa+"?",Qa,kr,Fa,gu].join("|")+")",pd=RegExp(Zc,"g"),xe=RegExp(Qa,"g"),tt=RegExp(Tr+"(?="+Tr+")|"+Gc+Rc,"g"),pt=RegExp([sa+"?"+Vl+"+"+Ha+"(?="+[pr,sa,"$"].join("|")+")",Oc+"+"+Mc+"(?="+[pr,sa+bu,"$"].join("|")+")",sa+"?"+bu+"+"+Ha,sa+"+"+Mc,Ul,vu,pu,pf].join("|"),"g"),Pt=RegExp("["+Yi+Zo+ur+dl+"]"),yn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ro=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rr=-1,ys={};ys[Zs]=ys[ba]=ys[ar]=ys[Ns]=ys[Zr]=ys[Po]=ys[Mo]=ys[Mr]=ys[Ls]=!0,ys[bn]=ys[qe]=ys[Rs]=ys[de]=ys[Js]=ys[No]=ys[Bn]=ys[ao]=ys[St]=ys[Xt]=ys[Be]=ys[wt]=ys[Yt]=ys[vn]=ys[ds]=!1;var is={};is[bn]=is[qe]=is[Rs]=is[Js]=is[de]=is[No]=is[Zs]=is[ba]=is[ar]=is[Ns]=is[Zr]=is[St]=is[Xt]=is[Be]=is[wt]=is[Yt]=is[vn]=is[rs]=is[Po]=is[Mo]=is[Mr]=is[Ls]=!0,is[Bn]=is[ao]=is[ds]=!1;var Ei={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},qs={"&":"&","<":"<",">":">",'"':""","'":"'"},Hi={"&":"&","<":"<",">":">",""":'"',"'":"'"},yu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bd=parseFloat,Xn=parseInt,Nm=typeof oP=="object"&&oP&&oP.Object===Object&&oP,$i=typeof self=="object"&&self&&self.Object===Object&&self,he=Nm||$i||Function("return this")(),Re=e&&!e.nodeType&&e,We=Re&&!0&&r&&!r.nodeType&&r,Bt=We&&We.exports===Re,Fn=Bt&&Nm.process,Jo=function(){try{var bt=We&&We.require&&We.require("util").types;return bt||Fn&&Fn.binding&&Fn.binding("util")}catch{}}(),so=Jo&&Jo.isArrayBuffer,gi=Jo&&Jo.isDate,hn=Jo&&Jo.isMap,qr=Jo&&Jo.isRegExp,Nl=Jo&&Jo.isSet,Xi=Jo&&Jo.isTypedArray;function ni(bt,cn,rn){switch(rn.length){case 0:return bt.call(cn);case 1:return bt.call(cn,rn[0]);case 2:return bt.call(cn,rn[0],rn[1]);case 3:return bt.call(cn,rn[0],rn[1],rn[2])}return bt.apply(cn,rn)}function bf(bt,cn,rn,To){for(var er=-1,Wr=bt==null?0:bt.length;++er<Wr;){var ai=bt[er];cn(To,ai,rn(ai),bt)}return To}function Ss(bt,cn){for(var rn=-1,To=bt==null?0:bt.length;++rn<To&&cn(bt[rn],rn,bt)!==!1;);return bt}function Kc(bt,cn){for(var rn=bt==null?0:bt.length;rn--&&cn(bt[rn],rn,bt)!==!1;);return bt}function Ai(bt,cn){for(var rn=-1,To=bt==null?0:bt.length;++rn<To;)if(!cn(bt[rn],rn,bt))return!1;return!0}function sc(bt,cn){for(var rn=-1,To=bt==null?0:bt.length,er=0,Wr=[];++rn<To;){var ai=bt[rn];cn(ai,rn,bt)&&(Wr[er++]=ai)}return Wr}function Mi(bt,cn){var rn=bt==null?0:bt.length;return!!rn&&$a(bt,cn,0)>-1}function Lf(bt,cn,rn){for(var To=-1,er=bt==null?0:bt.length;++To<er;)if(rn(cn,bt[To]))return!0;return!1}function da(bt,cn){for(var rn=-1,To=bt==null?0:bt.length,er=Array(To);++rn<To;)er[rn]=cn(bt[rn],rn,bt);return er}function Ff(bt,cn){for(var rn=-1,To=cn.length,er=bt.length;++rn<To;)bt[er+rn]=cn[rn];return bt}function fr(bt,cn,rn,To){var er=-1,Wr=bt==null?0:bt.length;for(To&&Wr&&(rn=bt[++er]);++er<Wr;)rn=cn(rn,bt[er],er,bt);return rn}function $u(bt,cn,rn,To){var er=bt==null?0:bt.length;for(To&&er&&(rn=bt[--er]);er--;)rn=cn(rn,bt[er],er,bt);return rn}function zu(bt,cn){for(var rn=-1,To=bt==null?0:bt.length;++rn<To;)if(cn(bt[rn],rn,bt))return!0;return!1}var vc=el("length");function Hf(bt){return bt.split("")}function jd(bt){return bt.match(Ur)||[]}function Xr(bt,cn,rn){var To;return rn(bt,function(er,Wr,ai){if(cn(er,Wr,ai))return To=Wr,!1}),To}function Ji(bt,cn,rn,To){for(var er=bt.length,Wr=rn+(To?1:-1);To?Wr--:++Wr<er;)if(cn(bt[Wr],Wr,bt))return Wr;return-1}function $a(bt,cn,rn){return cn===cn?Bp(bt,cn,rn):Ji(bt,xi,rn)}function U0(bt,cn,rn,To){for(var er=rn-1,Wr=bt.length;++er<Wr;)if(To(bt[er],cn))return er;return-1}function xi(bt){return bt!==bt}function _l(bt,cn){var rn=bt==null?0:bt.length;return rn?vf(bt,cn)/rn:xt}function el(bt){return function(cn){return cn==null?t:cn[bt]}}function Ng(bt){return function(cn){return bt==null?t:bt[cn]}}function $f(bt,cn,rn,To,er){return er(bt,function(Wr,ai,pi){rn=To?(To=!1,Wr):cn(rn,Wr,ai,pi)}),rn}function yc(bt,cn){var rn=bt.length;for(bt.sort(cn);rn--;)bt[rn]=bt[rn].value;return bt}function vf(bt,cn){for(var rn,To=-1,er=bt.length;++To<er;){var Wr=cn(bt[To]);Wr!==t&&(rn=rn===t?Wr:rn+Wr)}return rn}function Dr(bt,cn){for(var rn=-1,To=Array(bt);++rn<bt;)To[rn]=cn(rn);return To}function Vu(bt,cn){return da(cn,function(rn){return[rn,bt[rn]]})}function Pl(bt){return bt&&bt.slice(0,Ig(bt)+1).replace(_o,"")}function za(bt){return function(cn){return bt(cn)}}function qi(bt,cn){return da(cn,function(rn){return bt[rn]})}function zi(bt,cn){return bt.has(cn)}function rc(bt,cn){for(var rn=-1,To=bt.length;++rn<To&&$a(cn,bt[rn],0)>-1;);return rn}function zf(bt,cn){for(var rn=bt.length;rn--&&$a(cn,bt[rn],0)>-1;);return rn}function Zd(bt,cn){for(var rn=bt.length,To=0;rn--;)bt[rn]===cn&&++To;return To}var Pg=Ng(Ei),Pm=Ng(qs);function Il(bt){return"\\"+yu[bt]}function Im(bt,cn){return bt==null?t:bt[cn]}function tl(bt){return Pt.test(bt)}function yf(bt){return yn.test(bt)}function zh(bt){for(var cn,rn=[];!(cn=bt.next()).done;)rn.push(cn.value);return rn}function Uu(bt){var cn=-1,rn=Array(bt.size);return bt.forEach(function(To,er){rn[++cn]=[er,To]}),rn}function Vh(bt,cn){return function(rn){return bt(cn(rn))}}function Nc(bt,cn){for(var rn=-1,To=bt.length,er=0,Wr=[];++rn<To;){var ai=bt[rn];(ai===cn||ai===_)&&(bt[rn]=_,Wr[er++]=rn)}return Wr}function Uh(bt){var cn=-1,rn=Array(bt.size);return bt.forEach(function(To){rn[++cn]=To}),rn}function wf(bt){var cn=-1,rn=Array(bt.size);return bt.forEach(function(To){rn[++cn]=[To,To]}),rn}function Bp(bt,cn,rn){for(var To=rn-1,er=bt.length;++To<er;)if(bt[To]===cn)return To;return-1}function Bm(bt,cn,rn){for(var To=rn+1;To--;)if(bt[To]===cn)return To;return To}function Vf(bt){return tl(bt)?qd(bt):vc(bt)}function Wl(bt){return tl(bt)?wu(bt):Hf(bt)}function Ig(bt){for(var cn=bt.length;cn--&&cs.test(bt.charAt(cn)););return cn}var Ye=Ng(Hi);function qd(bt){for(var cn=tt.lastIndex=0;tt.test(bt);)++cn;return cn}function wu(bt){return bt.match(tt)||[]}function Bg(bt){return bt.match(pt)||[]}var L1=function bt(cn){cn=cn==null?he:Wh.defaults(he.Object(),cn,Wh.pick(he,Ro));var rn=cn.Array,To=cn.Date,er=cn.Error,Wr=cn.Function,ai=cn.Math,pi=cn.Object,Gd=cn.RegExp,W0=cn.String,ya=cn.TypeError,vd=rn.prototype,Lg=Wr.prototype,nl=pi.prototype,xa=cn["__core-js_shared__"],Wu=Lg.toString,oi=nl.hasOwnProperty,_u=0,ic=function(){var S=/[^.]+$/.exec(xa&&xa.keys&&xa.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),jh=nl.toString,F1=Wu.call(pi),Kd=he._,Fg=Gd("^"+Wu.call(oi).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yd=Bt?cn.Buffer:t,jl=cn.Symbol,Zh=cn.Uint8Array,H1=Yd?Yd.allocUnsafe:t,Lm=Vh(pi.getPrototypeOf,pi),Hg=pi.create,qh=nl.propertyIsEnumerable,Xd=vd.splice,yd=jl?jl.isConcatSpreadable:t,si=jl?jl.iterator:t,li=jl?jl.toStringTag:t,Bl=function(){try{var S=Kg(pi,"defineProperty");return S({},"",{}),S}catch{}}(),Lp=cn.clearTimeout!==he.clearTimeout&&cn.clearTimeout,Q=To&&To.now!==he.Date.now&&To.now,ce=cn.setTimeout!==he.setTimeout&&cn.setTimeout,Se=ai.ceil,Xe=ai.floor,rt=pi.getOwnPropertySymbols,On=Yd?Yd.isBuffer:t,Cn=cn.isFinite,Yo=vd.join,os=Vh(pi.keys,pi),ho=ai.max,Er=ai.min,Zl=To.now,ra=cn.parseInt,Ri=ai.random,Cu=vd.reverse,Ta=Kg(cn,"DataView"),Gh=Kg(cn,"Map"),Fm=Kg(cn,"Promise"),Vi=Kg(cn,"Set"),wa=Kg(cn,"WeakMap"),Yc=Kg(pi,"create"),Jd=wa&&new wa,Qi={},j0=tp(Ta),yv=tp(Gh),Jr=tp(Fm),wd=tp(Vi),br=tp(wa),ql=jl?jl.prototype:t,Uf=ql?ql.valueOf:t,Qd=ql?ql.toString:t;function Ae(S){if(xl(S)&&!yr(S)&&!(S instanceof ci)){if(S instanceof Su)return S;if(oi.call(S,"__wrapped__"))return Ov(S)}return new Su(S)}var _f=function(){function S(){}return function(T){if(!pl(T))return{};if(Hg)return Hg(T);S.prototype=T;var H=new S;return S.prototype=t,H}}();function $g(){}function Su(S,T){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!T,this.__index__=0,this.__values__=t}Ae.templateSettings={escape:Qe,evaluate:Dt,interpolate:Wt,variable:"",imports:{_:Ae}},Ae.prototype=$g.prototype,Ae.prototype.constructor=Ae,Su.prototype=_f($g.prototype),Su.prototype.constructor=Su;function ci(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function wv(){var S=new ci(this.__wrapped__);return S.__actions__=nu(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=nu(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=nu(this.__views__),S}function $1(){if(this.__filtered__){var S=new ci(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function Z0(){var S=this.__wrapped__.value(),T=this.__dir__,H=yr(S),le=T<0,ke=H?S.length:0,Ue=o3(0,ke,this.__views__),ht=Ue.start,Ct=Ue.end,zt=Ct-ht,pn=le?Ct:ht-1,$n=this.__iteratees__,Vn=$n.length,Fo=0,hs=Er(zt,this.__takeCount__);if(!H||!le&&ke==zt&&hs==zt)return Wg(S,this.__actions__);var Ps=[];e:for(;zt--&&Fo<hs;){pn+=T;for(var Hr=-1,$s=S[pn];++Hr<Vn;){var fi=$n[Hr],wi=fi.iteratee,cu=fi.type,Ou=wi($s);if(cu==ft)$s=Ou;else if(!Ou){if(cu==Je)continue e;break e}}Ps[Fo++]=$s}return Ps}ci.prototype=_f($g.prototype),ci.prototype.constructor=ci;function Wf(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var le=S[T];this.set(le[0],le[1])}}function Hm(){this.__data__=Yc?Yc(null):{},this.size=0}function zg(S){var T=this.has(S)&&delete this.__data__[S];return this.size-=T?1:0,T}function _v(S){var T=this.__data__;if(Yc){var H=T[S];return H===g?t:H}return oi.call(T,S)?T[S]:t}function Cf(S){var T=this.__data__;return Yc?T[S]!==t:oi.call(T,S)}function h2(S,T){var H=this.__data__;return this.size+=this.has(S)?0:1,H[S]=Yc&&T===t?g:T,this}Wf.prototype.clear=Hm,Wf.prototype.delete=zg,Wf.prototype.get=_v,Wf.prototype.has=Cf,Wf.prototype.set=h2;function ku(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var le=S[T];this.set(le[0],le[1])}}function ju(){this.__data__=[],this.size=0}function q0(S){var T=this.__data__,H=Sd(T,S);if(H<0)return!1;var le=T.length-1;return H==le?T.pop():Xd.call(T,H,1),--this.size,!0}function G0(S){var T=this.__data__,H=Sd(T,S);return H<0?t:T[H][1]}function K0(S){return Sd(this.__data__,S)>-1}function z1(S,T){var H=this.__data__,le=Sd(H,S);return le<0?(++this.size,H.push([S,T])):H[le][1]=T,this}ku.prototype.clear=ju,ku.prototype.delete=q0,ku.prototype.get=G0,ku.prototype.has=K0,ku.prototype.set=z1;function jf(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var le=S[T];this.set(le[0],le[1])}}function Y0(){this.size=0,this.__data__={hash:new Wf,map:new(Gh||ku),string:new Wf}}function X0(S){var T=Vp(this,S).delete(S);return this.size-=T?1:0,T}function hl(S){return Vp(this,S).get(S)}function m2(S){return Vp(this,S).has(S)}function bi(S,T){var H=Vp(this,S),le=H.size;return H.set(S,T),this.size+=H.size==le?0:1,this}jf.prototype.clear=Y0,jf.prototype.delete=X0,jf.prototype.get=hl,jf.prototype.has=m2,jf.prototype.set=bi;function lo(S){var T=-1,H=S==null?0:S.length;for(this.__data__=new jf;++T<H;)this.add(S[T])}function _d(S){return this.__data__.set(S,g),this}function Qn(S){return this.__data__.has(S)}lo.prototype.add=lo.prototype.push=_d,lo.prototype.has=Qn;function wc(S){var T=this.__data__=new ku(S);this.size=T.size}function Sf(){this.__data__=new ku,this.size=0}function eh(S){var T=this.__data__,H=T.delete(S);return this.size=T.size,H}function Pc(S){return this.__data__.get(S)}function Vg(S){return this.__data__.has(S)}function Cd(S,T){var H=this.__data__;if(H instanceof ku){var le=H.__data__;if(!Gh||le.length<a-1)return le.push([S,T]),this.size=++H.size,this;H=this.__data__=new jf(le)}return H.set(S,T),this.size=H.size,this}wc.prototype.clear=Sf,wc.prototype.delete=eh,wc.prototype.get=Pc,wc.prototype.has=Vg,wc.prototype.set=Cd;function ml(S,T){var H=yr(S),le=!H&&sm(S),ke=!H&&!le&&ag(S),Ue=!H&&!le&&!ke&&Md(S),ht=H||le||ke||Ue,Ct=ht?Dr(S.length,W0):[],zt=Ct.length;for(var pn in S)(T||oi.call(S,pn))&&!(ht&&(pn=="length"||ke&&(pn=="offset"||pn=="parent")||Ue&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||em(pn,zt)))&&Ct.push(pn);return Ct}function Eu(S){var T=S.length;return T?S[kf(0,T-1)]:t}function Fp(S,T){return Lc(nu(S),ha(T,0,S.length))}function V1(S){return Lc(nu(S))}function Sn(S,T,H){(H!==t&&!Fr(S[T],H)||H===t&&!(T in S))&&ui(S,T,H)}function $m(S,T,H){var le=S[T];(!(oi.call(S,T)&&Fr(le,H))||H===t&&!(T in S))&&ui(S,T,H)}function Sd(S,T){for(var H=S.length;H--;)if(Fr(S[H][0],T))return H;return-1}function th(S,T,H,le){return _a(S,function(ke,Ue,ht){T(le,ke,H(ke),ht)}),le}function Zu(S,T){return S&&Af(T,Jl(T),S)}function U1(S,T){return S&&Af(T,sf(T),S)}function ui(S,T,H){T=="__proto__"&&Bl?Bl(S,T,{configurable:!0,enumerable:!0,value:H,writable:!0}):S[T]=H}function Ui(S,T){for(var H=-1,le=T.length,ke=rn(le),Ue=S==null;++H<le;)ke[H]=Ue?t:Sc(S,T[H]);return ke}function ha(S,T,H){return S===S&&(H!==t&&(S=S<=H?S:H),T!==t&&(S=S>=T?S:T)),S}function As(S,T,H,le,ke,Ue){var ht,Ct=T&A,zt=T&O,pn=T&N;if(H&&(ht=ke?H(S,le,ke,Ue):H(S)),ht!==t)return ht;if(!pl(S))return S;var $n=yr(S);if($n){if(ht=b2(S),!Ct)return nu(S,ht)}else{var Vn=kl(S),Fo=Vn==ao||Vn==Wo;if(ag(S))return qm(S,Ct);if(Vn==Be||Vn==bn||Fo&&!ke){if(ht=zt||Fo?{}:ro(S),!Ct)return zt?ih(S,U1(ht,S)):Ym(S,Zu(ht,S))}else{if(!is[Vn])return ke?S:{};ht=v2(S,Vn,Ct)}}Ue||(Ue=new wc);var hs=Ue.get(S);if(hs)return hs;Ue.set(S,ht),Qp(S)?S.forEach(function($s){ht.add(As($s,T,H,$s,S,Ue))}):Tn(S)&&S.forEach(function($s,fi){ht.set(fi,As($s,T,H,fi,S,Ue))});var Ps=pn?zt?yi:eg:zt?sf:Jl,Hr=$n?t:Ps(S);return Ss(Hr||S,function($s,fi){Hr&&(fi=$s,$s=S[fi]),$m(ht,fi,As($s,T,H,fi,S,Ue))}),ht}function kd(S){var T=Jl(S);return function(H){return Cl(H,S,T)}}function Cl(S,T,H){var le=H.length;if(S==null)return!le;for(S=pi(S);le--;){var ke=H[le],Ue=T[ke],ht=S[ke];if(ht===t&&!(ke in S)||!Ue(ht))return!1}return!0}function qu(S,T,H){if(typeof S!="function")throw new ya(f);return ep(function(){S.apply(t,H)},T)}function Va(S,T,H,le){var ke=-1,Ue=Mi,ht=!0,Ct=S.length,zt=[],pn=T.length;if(!Ct)return zt;H&&(T=da(T,za(H))),le?(Ue=Lf,ht=!1):T.length>=a&&(Ue=zi,ht=!1,T=new lo(T));e:for(;++ke<Ct;){var $n=S[ke],Vn=H==null?$n:H($n);if($n=le||$n!==0?$n:0,ht&&Vn===Vn){for(var Fo=pn;Fo--;)if(T[Fo]===Vn)continue e;zt.push($n)}else Ue(T,Vn,le)||zt.push($n)}return zt}var _a=Xm(Zf),Hp=Xm(qf,!0);function Qt(S,T){var H=!0;return _a(S,function(le,ke,Ue){return H=!!T(le,ke,Ue),H}),H}function Gr(S,T,H){for(var le=-1,ke=S.length;++le<ke;){var Ue=S[le],ht=T(Ue);if(ht!=null&&(Ct===t?ht===ht&&!ol(ht):H(ht,Ct)))var Ct=ht,zt=Ue}return zt}function J0(S,T,H,le){var ke=S.length;for(H=jr(H),H<0&&(H=-H>ke?0:ke+H),le=le===t||le>ke?ke:jr(le),le<0&&(le+=ke),le=H>le?0:Vv(le);H<le;)S[H++]=T;return S}function Ca(S,T){var H=[];return _a(S,function(le,ke,Ue){T(le,ke,Ue)&&H.push(le)}),H}function Ua(S,T,H,le,ke){var Ue=-1,ht=S.length;for(H||(H=y2),ke||(ke=[]);++Ue<ht;){var Ct=S[Ue];T>0&&H(Ct)?T>1?Ua(Ct,T-1,H,le,ke):Ff(ke,Ct):le||(ke[ke.length]=Ct)}return ke}var Ug=ob(),Ic=ob(!0);function Zf(S,T){return S&&Ug(S,T,Jl)}function qf(S,T){return S&&Ic(S,T,Jl)}function $p(S,T){return sc(T,function(H){return rm(S[H])})}function Ll(S,T){T=Xh(T,S);for(var H=0,le=T.length;S!=null&&H<le;)S=S[Xu(T[H++])];return H&&H==le?S:t}function Ar(S,T,H){var le=T(S);return yr(S)?le:Ff(le,H(S))}function Wa(S){return S==null?S===t?eo:Tt:li&&li in pi(S)?Ok(S):Dv(S)}function nh(S,T){return S>T}function Gl(S,T){return S!=null&&oi.call(S,T)}function Q0(S,T){return S!=null&&T in pi(S)}function zm(S,T,H){return S>=Er(T,H)&&S<ho(T,H)}function W1(S,T,H){for(var le=H?Lf:Mi,ke=S[0].length,Ue=S.length,ht=Ue,Ct=rn(Ue),zt=1/0,pn=[];ht--;){var $n=S[ht];ht&&T&&($n=da($n,za(T))),zt=Er($n.length,zt),Ct[ht]=!H&&(T||ke>=120&&$n.length>=120)?new lo(ht&&$n):t}$n=S[0];var Vn=-1,Fo=Ct[0];e:for(;++Vn<ke&&pn.length<zt;){var hs=$n[Vn],Ps=T?T(hs):hs;if(hs=H||hs!==0?hs:0,!(Fo?zi(Fo,Ps):le(pn,Ps,H))){for(ht=Ue;--ht;){var Hr=Ct[ht];if(!(Hr?zi(Hr,Ps):le(S[ht],Ps,H)))continue e}Fo&&Fo.push(Ps),pn.push(hs)}}return pn}function ja(S,T,H,le){return Zf(S,function(ke,Ue,ht){T(le,H(ke),Ue,ht)}),le}function ac(S,T,H){T=Xh(T,S),S=C2(S,T);var le=S==null?S:S[Xu(hh(T))];return le==null?t:ni(le,S,H)}function At(S){return xl(S)&&Wa(S)==bn}function _c(S){return xl(S)&&Wa(S)==Rs}function Xc(S){return xl(S)&&Wa(S)==No}function lc(S,T,H,le,ke){return S===T?!0:S==null||T==null||!xl(S)&&!xl(T)?S!==S&&T!==T:Au(S,T,H,le,lc,ke)}function Au(S,T,H,le,ke,Ue){var ht=yr(S),Ct=yr(T),zt=ht?qe:kl(S),pn=Ct?qe:kl(T);zt=zt==bn?Be:zt,pn=pn==bn?Be:pn;var $n=zt==Be,Vn=pn==Be,Fo=zt==pn;if(Fo&&ag(S)){if(!ag(T))return!1;ht=!0,$n=!1}if(Fo&&!$n)return Ue||(Ue=new wc),ht||Md(S)?Qm(S,T,H,le,ke,Ue):p2(S,T,zt,H,le,ke,Ue);if(!(H&L)){var hs=$n&&oi.call(S,"__wrapped__"),Ps=Vn&&oi.call(T,"__wrapped__");if(hs||Ps){var Hr=hs?S.value():S,$s=Ps?T.value():T;return Ue||(Ue=new wc),ke(Hr,$s,H,le,Ue)}}return Fo?(Ue||(Ue=new wc),Qh(S,T,H,le,ke,Ue)):!1}function Za(S){return xl(S)&&kl(S)==St}function qa(S,T,H,le){var ke=H.length,Ue=ke,ht=!le;if(S==null)return!Ue;for(S=pi(S);ke--;){var Ct=H[ke];if(ht&&Ct[2]?Ct[1]!==S[Ct[0]]:!(Ct[0]in S))return!1}for(;++ke<Ue;){Ct=H[ke];var zt=Ct[0],pn=S[zt],$n=Ct[1];if(ht&&Ct[2]){if(pn===t&&!(zt in S))return!1}else{var Vn=new wc;if(le)var Fo=le(pn,$n,zt,S,T,Vn);if(!(Fo===t?lc($n,pn,L|j,le,Vn):Fo))return!1}}return!0}function Vm(S){if(!pl(S)||ib(S))return!1;var T=rm(S)?Fg:jt;return T.test(tp(S))}function Jc(S){return xl(S)&&Wa(S)==wt}function eb(S){return xl(S)&&kl(S)==Yt}function $o(S){return xl(S)&&Jp(S.length)&&!!ys[Wa(S)]}function $(S){return typeof S=="function"?S:S==null?rf:typeof S=="object"?yr(S)?kn(S[0],S[1]):Ft(S):u0(S)}function G(S){if(!Jg(S))return os(S);var T=[];for(var H in pi(S))oi.call(S,H)&&H!="constructor"&&T.push(H);return T}function ve(S){if(!pl(S))return dh(S);var T=Jg(S),H=[];for(var le in S)le=="constructor"&&(T||!oi.call(S,le))||H.push(le);return H}function De(S,T){return S<T}function at(S,T){var H=-1,le=au(S)?rn(S.length):[];return _a(S,function(ke,Ue,ht){le[++H]=T(ke,Ue,ht)}),le}function Ft(S){var T=ch(S);return T.length==1&&T[0][2]?Up(T[0][0],T[0][1]):function(H){return H===S||qa(H,S,T)}}function kn(S,T){return uh(S)&&w2(T)?Up(Xu(S),T):function(H){var le=Sc(H,S);return le===t&&le===T?sl(H,S):lc(T,le,L|j)}}function Ln(S,T,H,le,ke){S!==T&&Ug(T,function(Ue,ht){if(ke||(ke=new wc),pl(Ue))jo(S,T,ht,H,Ln,le,ke);else{var Ct=le?le(Tf(S,ht),Ue,ht+"",S,T,ke):t;Ct===t&&(Ct=Ue),Sn(S,ht,Ct)}},sf)}function jo(S,T,H,le,ke,Ue,ht){var Ct=Tf(S,H),zt=Tf(T,H),pn=ht.get(zt);if(pn){Sn(S,H,pn);return}var $n=Ue?Ue(Ct,zt,H+"",S,T,ht):t,Vn=$n===t;if(Vn){var Fo=yr(zt),hs=!Fo&&ag(zt),Ps=!Fo&&!hs&&Md(zt);$n=zt,Fo||hs||Ps?yr(Ct)?$n=Ct:Al(Ct)?$n=nu(Ct):hs?(Vn=!1,$n=qm(zt,!0)):Ps?(Vn=!1,$n=Z1(zt,!0)):$n=[]:n0(zt)||sm(zt)?($n=Ct,sm(Ct)?$n=lC(Ct):(!pl(Ct)||rm(Ct))&&($n=ro(zt))):Vn=!1}Vn&&(ht.set(zt,$n),ke($n,zt,le,Ue,ht),ht.delete(zt)),Sn(S,H,$n)}function Qo(S,T){var H=S.length;if(!!H)return T+=T<0?H:0,em(T,H)?S[T]:t}function vi(S,T,H){T.length?T=da(T,function(Ue){return yr(Ue)?function(ht){return Ll(ht,Ue.length===1?Ue[0]:Ue)}:Ue}):T=[rf];var le=-1;T=da(T,za(Hs()));var ke=at(S,function(Ue,ht,Ct){var zt=da(T,function(pn){return pn(Ue)});return{criteria:zt,index:++le,value:Ue}});return yc(ke,function(Ue,ht){return Ma(Ue,ht,H)})}function tr(S,T){return vr(S,T,function(H,le){return sl(S,le)})}function vr(S,T,H){for(var le=-1,ke=T.length,Ue={};++le<ke;){var ht=T[le],Ct=Ll(S,ht);H(Ct,ht)&&ea(Ue,Xh(ht,S),Ct)}return Ue}function Bc(S){return function(T){return Ll(T,S)}}function Qc(S,T,H,le){var ke=le?U0:$a,Ue=-1,ht=T.length,Ct=S;for(S===T&&(T=nu(T)),H&&(Ct=da(S,za(H)));++Ue<ht;)for(var zt=0,pn=T[Ue],$n=H?H(pn):pn;(zt=ke(Ct,$n,zt,le))>-1;)Ct!==S&&Xd.call(Ct,zt,1),Xd.call(S,zt,1);return S}function Gu(S,T){for(var H=S?T.length:0,le=H-1;H--;){var ke=T[H];if(H==le||ke!==Ue){var Ue=ke;em(ke)?Xd.call(S,ke,1):Ef(S,ke)}}return S}function kf(S,T){return S+Xe(Ri()*(T-S+1))}function oh(S,T,H,le){for(var ke=-1,Ue=ho(Se((T-S)/(H||1)),0),ht=rn(Ue);Ue--;)ht[le?Ue:++ke]=S,S+=H;return ht}function sh(S,T){var H="";if(!S||T<1||T>et)return H;do T%2&&(H+=S),T=Xe(T/2),T&&(S+=S);while(T);return H}function lr(S,T){return S2(z_(S,T,rf),S+"")}function Um(S){return Eu(a0(S))}function Wm(S,T){var H=a0(S);return Lc(H,ha(T,0,H.length))}function ea(S,T,H,le){if(!pl(S))return S;T=Xh(T,S);for(var ke=-1,Ue=T.length,ht=Ue-1,Ct=S;Ct!=null&&++ke<Ue;){var zt=Xu(T[ke]),pn=H;if(zt==="__proto__"||zt==="constructor"||zt==="prototype")return S;if(ke!=ht){var $n=Ct[zt];pn=le?le($n,zt,Ct):t,pn===t&&(pn=pl($n)?$n:em(T[ke+1])?[]:{})}$m(Ct,zt,pn),Ct=Ct[zt]}return S}var eu=Jd?function(S,T){return Jd.set(S,T),S}:rf,zp=Bl?function(S,T){return Bl(S,"toString",{configurable:!0,enumerable:!1,value:ey(T),writable:!0})}:rf;function jm(S){return Lc(a0(S))}function Os(S,T,H){var le=-1,ke=S.length;T<0&&(T=-T>ke?0:ke+T),H=H>ke?ke:H,H<0&&(H+=ke),ke=T>H?0:H-T>>>0,T>>>=0;for(var Ue=rn(ke);++le<ke;)Ue[le]=S[le+T];return Ue}function Br(S,T){var H;return _a(S,function(le,ke,Ue){return H=T(le,ke,Ue),!H}),!!H}function Da(S,T,H){var le=0,ke=S==null?le:S.length;if(typeof T=="number"&&T===T&&ke<=an){for(;le<ke;){var Ue=le+ke>>>1,ht=S[Ue];ht!==null&&!ol(ht)&&(H?ht<=T:ht<T)?le=Ue+1:ke=Ue}return ke}return cc(S,T,rf,H)}function cc(S,T,H,le){var ke=0,Ue=S==null?0:S.length;if(Ue===0)return 0;T=H(T);for(var ht=T!==T,Ct=T===null,zt=ol(T),pn=T===t;ke<Ue;){var $n=Xe((ke+Ue)/2),Vn=H(S[$n]),Fo=Vn!==t,hs=Vn===null,Ps=Vn===Vn,Hr=ol(Vn);if(ht)var $s=le||Ps;else pn?$s=Ps&&(le||Fo):Ct?$s=Ps&&Fo&&(le||!hs):zt?$s=Ps&&Fo&&!hs&&(le||!Hr):hs||Hr?$s=!1:$s=le?Vn<=T:Vn<T;$s?ke=$n+1:Ue=$n}return Er(Ue,ct)}function j1(S,T){for(var H=-1,le=S.length,ke=0,Ue=[];++H<le;){var ht=S[H],Ct=T?T(ht):ht;if(!H||!Fr(Ct,zt)){var zt=Ct;Ue[ke++]=ht===0?0:ht}}return Ue}function Sl(S){return typeof S=="number"?S:ol(S)?xt:+S}function Gi(S){if(typeof S=="string")return S;if(yr(S))return da(S,Gi)+"";if(ol(S))return Qd?Qd.call(S):"";var T=S+"";return T=="0"&&1/S==-ut?"-0":T}function tu(S,T,H){var le=-1,ke=Mi,Ue=S.length,ht=!0,Ct=[],zt=Ct;if(H)ht=!1,ke=Lf;else if(Ue>=a){var pn=T?null:g2(S);if(pn)return Uh(pn);ht=!1,ke=zi,zt=new lo}else zt=T?[]:Ct;e:for(;++le<Ue;){var $n=S[le],Vn=T?T($n):$n;if($n=H||$n!==0?$n:0,ht&&Vn===Vn){for(var Fo=zt.length;Fo--;)if(zt[Fo]===Vn)continue e;T&&zt.push(Vn),Ct.push($n)}else ke(zt,Vn,H)||(zt!==Ct&&zt.push(Vn),Ct.push($n))}return Ct}function Ef(S,T){return T=Xh(T,S),S=C2(S,T),S==null||delete S[Xu(hh(T))]}function F_(S,T,H,le){return ea(S,T,H(Ll(S,T)),le)}function Kh(S,T,H,le){for(var ke=S.length,Ue=le?ke:-1;(le?Ue--:++Ue<ke)&&T(S[Ue],Ue,S););return H?Os(S,le?0:Ue,le?Ue+1:ke):Os(S,le?Ue+1:0,le?ke:Ue)}function Wg(S,T){var H=S;return H instanceof ci&&(H=H.value()),fr(T,function(le,ke){return ke.func.apply(ke.thisArg,Ff([le],ke.args))},H)}function Yh(S,T,H){var le=S.length;if(le<2)return le?tu(S[0]):[];for(var ke=-1,Ue=rn(le);++ke<le;)for(var ht=S[ke],Ct=-1;++Ct<le;)Ct!=ke&&(Ue[ke]=Va(Ue[ke]||ht,S[Ct],T,H));return tu(Ua(Ue,1),T,H)}function Zm(S,T,H){for(var le=-1,ke=S.length,Ue=T.length,ht={};++le<ke;){var Ct=le<Ue?T[le]:t;H(ht,S[le],Ct)}return ht}function jg(S){return Al(S)?S:[]}function tb(S){return typeof S=="function"?S:rf}function Xh(S,T){return yr(S)?S:uh(S,T)?[S]:lb(ia(S))}var Oa=lr;function rh(S,T,H){var le=S.length;return H=H===t?le:H,!T&&H>=le?S:Os(S,T,H)}var Ed=Lp||function(S){return he.clearTimeout(S)};function qm(S,T){if(T)return S.slice();var H=S.length,le=H1?H1(H):new S.constructor(H);return S.copy(le),le}function Gm(S){var T=new S.constructor(S.byteLength);return new Zh(T).set(new Zh(S)),T}function Jh(S,T){var H=T?Gm(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.byteLength)}function Ku(S){var T=new S.constructor(S.source,Ke.exec(S));return T.lastIndex=S.lastIndex,T}function nb(S){return Uf?pi(Uf.call(S)):{}}function Z1(S,T){var H=T?Gm(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.length)}function H_(S,T){if(S!==T){var H=S!==t,le=S===null,ke=S===S,Ue=ol(S),ht=T!==t,Ct=T===null,zt=T===T,pn=ol(T);if(!Ct&&!pn&&!Ue&&S>T||Ue&&ht&&zt&&!Ct&&!pn||le&&ht&&zt||!H&&zt||!ke)return 1;if(!le&&!Ue&&!pn&&S<T||pn&&H&&ke&&!le&&!Ue||Ct&&H&&ke||!ht&&ke||!zt)return-1}return 0}function Ma(S,T,H){for(var le=-1,ke=S.criteria,Ue=T.criteria,ht=ke.length,Ct=H.length;++le<ht;){var zt=H_(ke[le],Ue[le]);if(zt){if(le>=Ct)return zt;var pn=H[le];return zt*(pn=="desc"?-1:1)}}return S.index-T.index}function Zg(S,T,H,le){for(var ke=-1,Ue=S.length,ht=H.length,Ct=-1,zt=T.length,pn=ho(Ue-ht,0),$n=rn(zt+pn),Vn=!le;++Ct<zt;)$n[Ct]=T[Ct];for(;++ke<ht;)(Vn||ke<Ue)&&($n[H[ke]]=S[ke]);for(;pn--;)$n[Ct++]=S[ke++];return $n}function Km(S,T,H,le){for(var ke=-1,Ue=S.length,ht=-1,Ct=H.length,zt=-1,pn=T.length,$n=ho(Ue-Ct,0),Vn=rn($n+pn),Fo=!le;++ke<$n;)Vn[ke]=S[ke];for(var hs=ke;++zt<pn;)Vn[hs+zt]=T[zt];for(;++ht<Ct;)(Fo||ke<Ue)&&(Vn[hs+H[ht]]=S[ke++]);return Vn}function nu(S,T){var H=-1,le=S.length;for(T||(T=rn(le));++H<le;)T[H]=S[H];return T}function Af(S,T,H,le){var ke=!H;H||(H={});for(var Ue=-1,ht=T.length;++Ue<ht;){var Ct=T[Ue],zt=le?le(H[Ct],S[Ct],Ct,H,S):t;zt===t&&(zt=S[Ct]),ke?ui(H,Ct,zt):$m(H,Ct,zt)}return H}function Ym(S,T){return Af(S,rb(S),T)}function ih(S,T){return Af(S,Tv(S),T)}function xu(S,T){return function(H,le){var ke=yr(H)?bf:th,Ue=T?T():{};return ke(H,S,Hs(le,2),Ue)}}function Ad(S){return lr(function(T,H){var le=-1,ke=H.length,Ue=ke>1?H[ke-1]:t,ht=ke>2?H[2]:t;for(Ue=S.length>3&&typeof Ue=="function"?(ke--,Ue):t,ht&&Yu(H[0],H[1],ht)&&(Ue=ke<3?t:Ue,ke=1),T=pi(T);++le<ke;){var Ct=H[le];Ct&&S(T,Ct,le,Ue)}return T})}function Xm(S,T){return function(H,le){if(H==null)return H;if(!au(H))return S(H,le);for(var ke=H.length,Ue=T?ke:-1,ht=pi(H);(T?Ue--:++Ue<ke)&&le(ht[Ue],Ue,ht)!==!1;);return H}}function ob(S){return function(T,H,le){for(var ke=-1,Ue=pi(T),ht=le(T),Ct=ht.length;Ct--;){var zt=ht[S?Ct:++ke];if(H(Ue[zt],zt,Ue)===!1)break}return T}}function Cv(S,T,H){var le=T&z,ke=qg(S);function Ue(){var ht=this&&this!==he&&this instanceof Ue?ke:S;return ht.apply(le?H:this,arguments)}return Ue}function Sv(S){return function(T){T=ia(T);var H=tl(T)?Wl(T):t,le=H?H[0]:T.charAt(0),ke=H?rh(H,1).join(""):T.slice(1);return le[S]()+ke}}function ah(S){return function(T){return fr(Qv(Eb(T).replace(pd,"")),S,"")}}function qg(S){return function(){var T=arguments;switch(T.length){case 0:return new S;case 1:return new S(T[0]);case 2:return new S(T[0],T[1]);case 3:return new S(T[0],T[1],T[2]);case 4:return new S(T[0],T[1],T[2],T[3]);case 5:return new S(T[0],T[1],T[2],T[3],T[4]);case 6:return new S(T[0],T[1],T[2],T[3],T[4],T[5]);case 7:return new S(T[0],T[1],T[2],T[3],T[4],T[5],T[6])}var H=_f(S.prototype),le=S.apply(H,T);return pl(le)?le:H}}function kv(S,T,H){var le=qg(S);function ke(){for(var Ue=arguments.length,ht=rn(Ue),Ct=Ue,zt=ou(ke);Ct--;)ht[Ct]=arguments[Ct];var pn=Ue<3&&ht[0]!==zt&&ht[Ue-1]!==zt?[]:Nc(ht,zt);if(Ue-=pn.length,Ue<H)return xv(S,T,nr,ke.placeholder,t,ht,pn,t,t,H-Ue);var $n=this&&this!==he&&this instanceof ke?le:S;return ni($n,this,ht)}return ke}function Jm(S){return function(T,H,le){var ke=pi(T);if(!au(T)){var Ue=Hs(H,3);T=Jl(T),H=function(Ct){return Ue(ke[Ct],Ct,ke)}}var ht=S(T,H,le);return ht>-1?ke[Ue?T[ht]:ht]:t}}function Ev(S){return Td(function(T){var H=T.length,le=H,ke=Su.prototype.thru;for(S&&T.reverse();le--;){var Ue=T[le];if(typeof Ue!="function")throw new ya(f);if(ke&&!ht&&Od(Ue)=="wrapper")var ht=new Su([],!0)}for(le=ht?le:H;++le<H;){Ue=T[le];var Ct=Od(Ue),zt=Ct=="wrapper"?Dd(Ue):t;zt&&fh(zt[0])&&zt[1]==(X|F|te|we)&&!zt[4].length&&zt[9]==1?ht=ht[Od(zt[0])].apply(ht,zt[3]):ht=Ue.length==1&&fh(Ue)?ht[Ct]():ht.thru(Ue)}return function(){var pn=arguments,$n=pn[0];if(ht&&pn.length==1&&yr($n))return ht.plant($n).value();for(var Vn=0,Fo=H?T[Vn].apply(this,pn):$n;++Vn<H;)Fo=T[Vn].call(this,Fo);return Fo}})}function nr(S,T,H,le,ke,Ue,ht,Ct,zt,pn){var $n=T&X,Vn=T&z,Fo=T&q,hs=T&(F|oe),Ps=T&ye,Hr=Fo?t:qg(S);function $s(){for(var fi=arguments.length,wi=rn(fi),cu=fi;cu--;)wi[cu]=arguments[cu];if(hs)var Ou=ou($s),Of=Zd(wi,Ou);if(le&&(wi=Zg(wi,le,ke,hs)),Ue&&(wi=Km(wi,Ue,ht,hs)),fi-=Of,hs&&fi<pn){var ka=Nc(wi,Ou);return xv(S,T,nr,$s.placeholder,H,wi,ka,Ct,zt,pn-fi)}var cm=Vn?H:this,ed=Fo?cm[S]:S;return fi=wi.length,Ct?wi=Qg(wi,Ct):Ps&&fi>1&&wi.reverse(),$n&&zt<fi&&(wi.length=zt),this&&this!==he&&this instanceof $s&&(ed=Hr||qg(ed)),ed.apply(cm,wi)}return $s}function Do(S,T){return function(H,le){return ja(H,S,T(le),{})}}function lh(S,T){return function(H,le){var ke;if(H===t&&le===t)return T;if(H!==t&&(ke=H),le!==t){if(ke===t)return le;typeof H=="string"||typeof le=="string"?(H=Gi(H),le=Gi(le)):(H=Sl(H),le=Sl(le)),ke=S(H,le)}return ke}}function q1(S){return Td(function(T){return T=da(T,za(Hs())),lr(function(H){var le=this;return S(T,function(ke){return ni(ke,le,H)})})})}function Gg(S,T){T=T===t?" ":Gi(T);var H=T.length;if(H<2)return H?sh(T,S):T;var le=sh(T,Se(S/Vf(T)));return tl(T)?rh(Wl(le),0,S).join(""):le.slice(0,S)}function Tk(S,T,H,le){var ke=T&z,Ue=qg(S);function ht(){for(var Ct=-1,zt=arguments.length,pn=-1,$n=le.length,Vn=rn($n+zt),Fo=this&&this!==he&&this instanceof ht?Ue:S;++pn<$n;)Vn[pn]=le[pn];for(;zt--;)Vn[pn++]=arguments[++Ct];return ni(Fo,ke?H:this,Vn)}return ht}function Av(S){return function(T,H,le){return le&&typeof le!="number"&&Yu(T,H,le)&&(H=le=t),T=bh(T),H===t?(H=T,T=0):H=bh(H),le=le===t?T<H?1:-1:bh(le),oh(T,H,le,S)}}function ri(S){return function(T,H){return typeof T=="string"&&typeof H=="string"||(T=Qf(T),H=Qf(H)),S(T,H)}}function xv(S,T,H,le,ke,Ue,ht,Ct,zt,pn){var $n=T&F,Vn=$n?ht:t,Fo=$n?t:ht,hs=$n?Ue:t,Ps=$n?t:Ue;T|=$n?te:se,T&=~($n?se:te),T&ee||(T&=~(z|q));var Hr=[S,T,ke,hs,Vn,Ps,Fo,Ct,zt,pn],$s=H.apply(t,Hr);return fh(S)&&su($s,Hr),$s.placeholder=le,V_($s,S,T)}function G1(S){var T=ai[S];return function(H,le){if(H=Qf(H),le=le==null?0:Er(jr(le),292),le&&Cn(H)){var ke=(ia(H)+"e").split("e"),Ue=T(ke[0]+"e"+(+ke[1]+le));return ke=(ia(Ue)+"e").split("e"),+(ke[0]+"e"+(+ke[1]-le))}return T(H)}}var g2=Vi&&1/Uh(new Vi([,-0]))[1]==ut?function(S){return new Vi(S)}:sy;function en(S){return function(T){var H=kl(T);return H==St?Uu(T):H==Yt?wf(T):Vu(T,S(T))}}function xd(S,T,H,le,ke,Ue,ht,Ct){var zt=T&q;if(!zt&&typeof S!="function")throw new ya(f);var pn=le?le.length:0;if(pn||(T&=~(te|se),le=ke=t),ht=ht===t?ht:ho(jr(ht),0),Ct=Ct===t?Ct:jr(Ct),pn-=ke?ke.length:0,T&se){var $n=le,Vn=ke;le=ke=t}var Fo=zt?t:Dd(S),hs=[S,T,H,le,ke,$n,Vn,Ue,ht,Ct];if(Fo&&_2(hs,Fo),S=hs[0],T=hs[1],H=hs[2],le=hs[3],ke=hs[4],Ct=hs[9]=hs[9]===t?zt?0:S.length:ho(hs[9]-pn,0),!Ct&&T&(F|oe)&&(T&=~(F|oe)),!T||T==z)var Ps=Cv(S,T,H);else T==F||T==oe?Ps=kv(S,T,Ct):(T==te||T==(z|te))&&!ke.length?Ps=Tk(S,T,H,le):Ps=nr.apply(t,hs);var Hr=Fo?eu:su;return V_(Hr(Ps,hs),S,T)}function $_(S,T,H,le){return S===t||Fr(S,nl[H])&&!oi.call(le,H)?T:S}function sb(S,T,H,le,ke,Ue){return pl(S)&&pl(T)&&(Ue.set(T,S),Ln(S,T,t,sb,Ue),Ue.delete(T)),S}function Dk(S){return n0(S)?t:S}function Qm(S,T,H,le,ke,Ue){var ht=H&L,Ct=S.length,zt=T.length;if(Ct!=zt&&!(ht&&zt>Ct))return!1;var pn=Ue.get(S),$n=Ue.get(T);if(pn&&$n)return pn==T&&$n==S;var Vn=-1,Fo=!0,hs=H&j?new lo:t;for(Ue.set(S,T),Ue.set(T,S);++Vn<Ct;){var Ps=S[Vn],Hr=T[Vn];if(le)var $s=ht?le(Hr,Ps,Vn,T,S,Ue):le(Ps,Hr,Vn,S,T,Ue);if($s!==t){if($s)continue;Fo=!1;break}if(hs){if(!zu(T,function(fi,wi){if(!zi(hs,wi)&&(Ps===fi||ke(Ps,fi,H,le,Ue)))return hs.push(wi)})){Fo=!1;break}}else if(!(Ps===Hr||ke(Ps,Hr,H,le,Ue))){Fo=!1;break}}return Ue.delete(S),Ue.delete(T),Fo}function p2(S,T,H,le,ke,Ue,ht){switch(H){case Js:if(S.byteLength!=T.byteLength||S.byteOffset!=T.byteOffset)return!1;S=S.buffer,T=T.buffer;case Rs:return!(S.byteLength!=T.byteLength||!Ue(new Zh(S),new Zh(T)));case de:case No:case Xt:return Fr(+S,+T);case Bn:return S.name==T.name&&S.message==T.message;case wt:case vn:return S==T+"";case St:var Ct=Uu;case Yt:var zt=le&L;if(Ct||(Ct=Uh),S.size!=T.size&&!zt)return!1;var pn=ht.get(S);if(pn)return pn==T;le|=j,ht.set(S,T);var $n=Qm(Ct(S),Ct(T),le,ke,Ue,ht);return ht.delete(S),$n;case rs:if(Uf)return Uf.call(S)==Uf.call(T)}return!1}function Qh(S,T,H,le,ke,Ue){var ht=H&L,Ct=eg(S),zt=Ct.length,pn=eg(T),$n=pn.length;if(zt!=$n&&!ht)return!1;for(var Vn=zt;Vn--;){var Fo=Ct[Vn];if(!(ht?Fo in T:oi.call(T,Fo)))return!1}var hs=Ue.get(S),Ps=Ue.get(T);if(hs&&Ps)return hs==T&&Ps==S;var Hr=!0;Ue.set(S,T),Ue.set(T,S);for(var $s=ht;++Vn<zt;){Fo=Ct[Vn];var fi=S[Fo],wi=T[Fo];if(le)var cu=ht?le(wi,fi,Fo,T,S,Ue):le(fi,wi,Fo,S,T,Ue);if(!(cu===t?fi===wi||ke(fi,wi,H,le,Ue):cu)){Hr=!1;break}$s||($s=Fo=="constructor")}if(Hr&&!$s){var Ou=S.constructor,Of=T.constructor;Ou!=Of&&"constructor"in S&&"constructor"in T&&!(typeof Ou=="function"&&Ou instanceof Ou&&typeof Of=="function"&&Of instanceof Of)&&(Hr=!1)}return Ue.delete(S),Ue.delete(T),Hr}function Td(S){return S2(z_(S,t,T2),S+"")}function eg(S){return Ar(S,Jl,rb)}function yi(S){return Ar(S,sf,Tv)}var Dd=Jd?function(S){return Jd.get(S)}:sy;function Od(S){for(var T=S.name+"",H=Qi[T],le=oi.call(Qi,T)?H.length:0;le--;){var ke=H[le],Ue=ke.func;if(Ue==null||Ue==S)return ke.name}return T}function ou(S){var T=oi.call(Ae,"placeholder")?Ae:S;return T.placeholder}function Hs(){var S=Ae.iteratee||ny;return S=S===ny?$:S,arguments.length?S(arguments[0],arguments[1]):S}function Vp(S,T){var H=S.__data__;return Xg(T)?H[typeof T=="string"?"string":"hash"]:H.map}function ch(S){for(var T=Jl(S),H=T.length;H--;){var le=T[H],ke=S[le];T[H]=[le,ke,w2(ke)]}return T}function Kg(S,T){var H=Im(S,T);return Vm(H)?H:t}function Ok(S){var T=oi.call(S,li),H=S[li];try{S[li]=t;var le=!0}catch{}var ke=jh.call(S);return le&&(T?S[li]=H:delete S[li]),ke}var rb=rt?function(S){return S==null?[]:(S=pi(S),sc(rt(S),function(T){return qh.call(S,T)}))}:Db,Tv=rt?function(S){for(var T=[];S;)Ff(T,rb(S)),S=Lm(S);return T}:Db,kl=Wa;(Ta&&kl(new Ta(new ArrayBuffer(1)))!=Js||Gh&&kl(new Gh)!=St||Fm&&kl(Fm.resolve())!=Ut||Vi&&kl(new Vi)!=Yt||wa&&kl(new wa)!=ds)&&(kl=function(S){var T=Wa(S),H=T==Be?S.constructor:t,le=H?tp(H):"";if(le)switch(le){case j0:return Js;case yv:return St;case Jr:return Ut;case wd:return Yt;case br:return ds}return T});function o3(S,T,H){for(var le=-1,ke=H.length;++le<ke;){var Ue=H[le],ht=Ue.size;switch(Ue.type){case"drop":S+=ht;break;case"dropRight":T-=ht;break;case"take":T=Er(T,S+ht);break;case"takeRight":S=ho(S,T-ht);break}}return{start:S,end:T}}function Yg(S){var T=S.match(Ir);return T?T[1].split(Vs):[]}function El(S,T,H){T=Xh(T,S);for(var le=-1,ke=T.length,Ue=!1;++le<ke;){var ht=Xu(T[le]);if(!(Ue=S!=null&&H(S,ht)))break;S=S[ht]}return Ue||++le!=ke?Ue:(ke=S==null?0:S.length,!!ke&&Jp(ke)&&em(ht,ke)&&(yr(S)||sm(S)))}function b2(S){var T=S.length,H=new S.constructor(T);return T&&typeof S[0]=="string"&&oi.call(S,"index")&&(H.index=S.index,H.input=S.input),H}function ro(S){return typeof S.constructor=="function"&&!Jg(S)?_f(Lm(S)):{}}function v2(S,T,H){var le=S.constructor;switch(T){case Rs:return Gm(S);case de:case No:return new le(+S);case Js:return Jh(S,H);case Zs:case ba:case ar:case Ns:case Zr:case Po:case Mo:case Mr:case Ls:return Z1(S,H);case St:return new le;case Xt:case vn:return new le(S);case wt:return Ku(S);case Yt:return new le;case rs:return nb(S)}}function Mk(S,T){var H=T.length;if(!H)return S;var le=H-1;return T[le]=(H>1?"& ":"")+T[le],T=T.join(H>2?", ":" "),S.replace(Sr,`{
|
|
/* [wrapped with `+T+`] */
|
|
`)}function y2(S){return yr(S)||sm(S)||!!(yd&&S&&S[yd])}function em(S,T){var H=typeof S;return T=T==null?et:T,!!T&&(H=="number"||H!="symbol"&&Lo.test(S))&&S>-1&&S%1==0&&S<T}function Yu(S,T,H){if(!pl(H))return!1;var le=typeof T;return(le=="number"?au(H)&&em(T,H.length):le=="string"&&T in H)?Fr(H[T],S):!1}function uh(S,T){if(yr(S))return!1;var H=typeof S;return H=="number"||H=="symbol"||H=="boolean"||S==null||ol(S)?!0:uo.test(S)||!qn.test(S)||T!=null&&S in pi(T)}function Xg(S){var T=typeof S;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?S!=="__proto__":S===null}function fh(S){var T=Od(S),H=Ae[T];if(typeof H!="function"||!(T in ci.prototype))return!1;if(S===H)return!0;var le=Dd(H);return!!le&&S===le[0]}function ib(S){return!!ic&&ic in S}var xf=xa?rm:am;function Jg(S){var T=S&&S.constructor,H=typeof T=="function"&&T.prototype||nl;return S===H}function w2(S){return S===S&&!pl(S)}function Up(S,T){return function(H){return H==null?!1:H[S]===T&&(T!==t||S in pi(H))}}function Gf(S){var T=wb(S,function(le){return H.size===v&&H.clear(),le}),H=T.cache;return T}function _2(S,T){var H=S[1],le=T[1],ke=H|le,Ue=ke<(z|q|X),ht=le==X&&H==F||le==X&&H==we&&S[7].length<=T[8]||le==(X|we)&&T[7].length<=T[8]&&H==F;if(!(Ue||ht))return S;le&z&&(S[2]=T[2],ke|=H&z?0:ee);var Ct=T[3];if(Ct){var zt=S[3];S[3]=zt?Zg(zt,Ct,T[4]):Ct,S[4]=zt?Nc(S[3],_):T[4]}return Ct=T[5],Ct&&(zt=S[5],S[5]=zt?Km(zt,Ct,T[6]):Ct,S[6]=zt?Nc(S[5],_):T[6]),Ct=T[7],Ct&&(S[7]=Ct),le&X&&(S[8]=S[8]==null?T[8]:Er(S[8],T[8])),S[9]==null&&(S[9]=T[9]),S[0]=T[0],S[1]=ke,S}function dh(S){var T=[];if(S!=null)for(var H in pi(S))T.push(H);return T}function Dv(S){return jh.call(S)}function z_(S,T,H){return T=ho(T===t?S.length-1:T,0),function(){for(var le=arguments,ke=-1,Ue=ho(le.length-T,0),ht=rn(Ue);++ke<Ue;)ht[ke]=le[T+ke];ke=-1;for(var Ct=rn(T+1);++ke<T;)Ct[ke]=le[ke];return Ct[T]=H(ht),ni(S,this,Ct)}}function C2(S,T){return T.length<2?S:Ll(S,Os(T,0,-1))}function Qg(S,T){for(var H=S.length,le=Er(T.length,H),ke=nu(S);le--;){var Ue=T[le];S[le]=em(Ue,H)?ke[Ue]:t}return S}function Tf(S,T){if(!(T==="constructor"&&typeof S[T]=="function")&&T!="__proto__")return S[T]}var su=ab(eu),ep=ce||function(S,T){return he.setTimeout(S,T)},S2=ab(zp);function V_(S,T,H){var le=T+"";return S2(S,Mk(le,tm(Yg(le),H)))}function ab(S){var T=0,H=0;return function(){var le=Zl(),ke=nt-(le-H);if(H=le,ke>0){if(++T>=ge)return arguments[0]}else T=0;return S.apply(t,arguments)}}function Lc(S,T){var H=-1,le=S.length,ke=le-1;for(T=T===t?le:T;++H<T;){var Ue=kf(H,ke),ht=S[Ue];S[Ue]=S[H],S[H]=ht}return S.length=T,S}var lb=Gf(function(S){var T=[];return S.charCodeAt(0)===46&&T.push(""),S.replace(po,function(H,le,ke,Ue){T.push(ke?Ue.replace(La,"$1"):le||H)}),T});function Xu(S){if(typeof S=="string"||ol(S))return S;var T=S+"";return T=="0"&&1/S==-ut?"-0":T}function tp(S){if(S!=null){try{return Wu.call(S)}catch{}try{return S+""}catch{}}return""}function tm(S,T){return Ss(kt,function(H){var le="_."+H[0];T&H[1]&&!Mi(S,le)&&S.push(le)}),S.sort()}function Ov(S){if(S instanceof ci)return S.clone();var T=new Su(S.__wrapped__,S.__chain__);return T.__actions__=nu(S.__actions__),T.__index__=S.__index__,T.__values__=S.__values__,T}function U_(S,T,H){(H?Yu(S,T,H):T===t)?T=1:T=ho(jr(T),0);var le=S==null?0:S.length;if(!le||T<1)return[];for(var ke=0,Ue=0,ht=rn(Se(le/T));ke<le;)ht[Ue++]=Os(S,ke,ke+=T);return ht}function Wp(S){for(var T=-1,H=S==null?0:S.length,le=0,ke=[];++T<H;){var Ue=S[T];Ue&&(ke[le++]=Ue)}return ke}function k2(){var S=arguments.length;if(!S)return[];for(var T=rn(S-1),H=arguments[0],le=S;le--;)T[le-1]=arguments[le];return Ff(yr(H)?nu(H):[H],Ua(T,1))}var np=lr(function(S,T){return Al(S)?Va(S,Ua(T,1,Al,!0)):[]}),cb=lr(function(S,T){var H=hh(T);return Al(H)&&(H=t),Al(S)?Va(S,Ua(T,1,Al,!0),Hs(H,2)):[]}),K1=lr(function(S,T){var H=hh(T);return Al(H)&&(H=t),Al(S)?Va(S,Ua(T,1,Al,!0),t,H):[]});function E2(S,T,H){var le=S==null?0:S.length;return le?(T=H||T===t?1:jr(T),Os(S,T<0?0:T,le)):[]}function A2(S,T,H){var le=S==null?0:S.length;return le?(T=H||T===t?1:jr(T),T=le-T,Os(S,0,T<0?0:T)):[]}function W_(S,T){return S&&S.length?Kh(S,Hs(T,3),!0,!0):[]}function Rk(S,T){return S&&S.length?Kh(S,Hs(T,3),!0):[]}function Lr(S,T,H,le){var ke=S==null?0:S.length;return ke?(H&&typeof H!="number"&&Yu(S,T,H)&&(H=0,le=ke),J0(S,T,H,le)):[]}function Mv(S,T,H){var le=S==null?0:S.length;if(!le)return-1;var ke=H==null?0:jr(H);return ke<0&&(ke=ho(le+ke,0)),Ji(S,Hs(T,3),ke)}function x2(S,T,H){var le=S==null?0:S.length;if(!le)return-1;var ke=le-1;return H!==t&&(ke=jr(H),ke=H<0?ho(le+ke,0):Er(ke,le-1)),Ji(S,Hs(T,3),ke,!0)}function T2(S){var T=S==null?0:S.length;return T?Ua(S,1):[]}function ub(S){var T=S==null?0:S.length;return T?Ua(S,ut):[]}function Nk(S,T){var H=S==null?0:S.length;return H?(T=T===t?1:jr(T),Ua(S,T)):[]}function nm(S){for(var T=-1,H=S==null?0:S.length,le={};++T<H;){var ke=S[T];le[ke[0]]=ke[1]}return le}function Ga(S){return S&&S.length?S[0]:t}function fb(S,T,H){var le=S==null?0:S.length;if(!le)return-1;var ke=H==null?0:jr(H);return ke<0&&(ke=ho(le+ke,0)),$a(S,T,ke)}function Y1(S){var T=S==null?0:S.length;return T?Os(S,0,-1):[]}var j_=lr(function(S){var T=da(S,jg);return T.length&&T[0]===S[0]?W1(T):[]}),db=lr(function(S){var T=hh(S),H=da(S,jg);return T===hh(H)?T=t:H.pop(),H.length&&H[0]===S[0]?W1(H,Hs(T,2)):[]}),D2=lr(function(S){var T=hh(S),H=da(S,jg);return T=typeof T=="function"?T:t,T&&H.pop(),H.length&&H[0]===S[0]?W1(H,t,T):[]});function Ra(S,T){return S==null?"":Yo.call(S,T)}function hh(S){var T=S==null?0:S.length;return T?S[T-1]:t}function ma(S,T,H){var le=S==null?0:S.length;if(!le)return-1;var ke=le;return H!==t&&(ke=jr(H),ke=ke<0?ho(le+ke,0):Er(ke,le-1)),T===T?Bm(S,T,ke):Ji(S,xi,ke,!0)}function Ju(S,T){return S&&S.length?Qo(S,jr(T)):t}var tg=lr(Fc);function Fc(S,T){return S&&S.length&&T&&T.length?Qc(S,T):S}function Pk(S,T,H){return S&&S.length&&T&&T.length?Qc(S,T,Hs(H,2)):S}function O2(S,T,H){return S&&S.length&&T&&T.length?Qc(S,T,t,H):S}var Kf=Td(function(S,T){var H=S==null?0:S.length,le=Ui(S,T);return Gu(S,da(T,function(ke){return em(ke,H)?+ke:ke}).sort(H_)),le});function Na(S,T){var H=[];if(!(S&&S.length))return H;var le=-1,ke=[],Ue=S.length;for(T=Hs(T,3);++le<Ue;){var ht=S[le];T(ht,le,S)&&(H.push(ht),ke.push(le))}return Gu(S,ke),H}function Sa(S){return S==null?S:Cu.call(S)}function Ik(S,T,H){var le=S==null?0:S.length;return le?(H&&typeof H!="number"&&Yu(S,T,H)?(T=0,H=le):(T=T==null?0:jr(T),H=H===t?le:jr(H)),Os(S,T,H)):[]}function mh(S,T){return Da(S,T)}function hb(S,T,H){return cc(S,T,Hs(H,2))}function Rv(S,T){var H=S==null?0:S.length;if(H){var le=Da(S,T);if(le<H&&Fr(S[le],T))return le}return-1}function Yf(S,T){return Da(S,T,!0)}function Qu(S,T,H){return cc(S,T,Hs(H,2),!0)}function jp(S,T){var H=S==null?0:S.length;if(H){var le=Da(S,T,!0)-1;if(Fr(S[le],T))return le}return-1}function X1(S){return S&&S.length?j1(S):[]}function mb(S,T){return S&&S.length?j1(S,Hs(T,2)):[]}function gb(S){var T=S==null?0:S.length;return T?Os(S,1,T):[]}function Z_(S,T,H){return S&&S.length?(T=H||T===t?1:jr(T),Os(S,0,T<0?0:T)):[]}function M2(S,T,H){var le=S==null?0:S.length;return le?(T=H||T===t?1:jr(T),T=le-T,Os(S,T<0?0:T,le)):[]}function Bk(S,T){return S&&S.length?Kh(S,Hs(T,3),!1,!0):[]}function q_(S,T){return S&&S.length?Kh(S,Hs(T,3)):[]}var G_=lr(function(S){return tu(Ua(S,1,Al,!0))}),R2=lr(function(S){var T=hh(S);return Al(T)&&(T=t),tu(Ua(S,1,Al,!0),Hs(T,2))}),K_=lr(function(S){var T=hh(S);return T=typeof T=="function"?T:t,tu(Ua(S,1,Al,!0),t,T)});function s3(S){return S&&S.length?tu(S):[]}function Nv(S,T){return S&&S.length?tu(S,Hs(T,2)):[]}function Y_(S,T){return T=typeof T=="function"?T:t,S&&S.length?tu(S,t,T):[]}function Ni(S){if(!(S&&S.length))return[];var T=0;return S=sc(S,function(H){if(Al(H))return T=ho(H.length,T),!0}),Dr(T,function(H){return da(S,el(H))})}function Pv(S,T){if(!(S&&S.length))return[];var H=Ni(S);return T==null?H:da(H,function(le){return ni(T,t,le)})}var N2=lr(function(S,T){return Al(S)?Va(S,T):[]}),X_=lr(function(S){return Yh(sc(S,Al))}),ng=lr(function(S){var T=hh(S);return Al(T)&&(T=t),Yh(sc(S,Al),Hs(T,2))}),uc=lr(function(S){var T=hh(S);return T=typeof T=="function"?T:t,Yh(sc(S,Al),t,T)}),ru=lr(Ni);function J_(S,T){return Zm(S||[],T||[],$m)}function P2(S,T){return Zm(S||[],T||[],ea)}var op=lr(function(S){var T=S.length,H=T>1?S[T-1]:t;return H=typeof H=="function"?(S.pop(),H):t,Pv(S,H)});function sp(S){var T=Ae(S);return T.__chain__=!0,T}function Zp(S,T){return T(S),S}function qp(S,T){return T(S)}var og=Td(function(S){var T=S.length,H=T?S[0]:0,le=this.__wrapped__,ke=function(Ue){return Ui(Ue,S)};return T>1||this.__actions__.length||!(le instanceof ci)||!em(H)?this.thru(ke):(le=le.slice(H,+H+(T?1:0)),le.__actions__.push({func:qp,args:[ke],thisArg:t}),new Su(le,this.__chain__).thru(function(Ue){return T&&!Ue.length&&Ue.push(t),Ue}))});function Iv(){return sp(this)}function ta(){return new Su(this.value(),this.__chain__)}function ef(){this.__values__===t&&(this.__values__=J2(this.value()));var S=this.__index__>=this.__values__.length,T=S?t:this.__values__[this.__index__++];return{done:S,value:T}}function J1(){return this}function Lk(S){for(var T,H=this;H instanceof $g;){var le=Ov(H);le.__index__=0,le.__values__=t,T?ke.__wrapped__=le:T=le;var ke=le;H=H.__wrapped__}return ke.__wrapped__=S,T}function I2(){var S=this.__wrapped__;if(S instanceof ci){var T=S;return this.__actions__.length&&(T=new ci(this)),T=T.reverse(),T.__actions__.push({func:qp,args:[Sa],thisArg:t}),new Su(T,this.__chain__)}return this.thru(Sa)}function Fk(){return Wg(this.__wrapped__,this.__actions__)}var Gp=xu(function(S,T,H){oi.call(S,H)?++S[H]:ui(S,H,1)});function Q1(S,T,H){var le=yr(S)?Ai:Qt;return H&&Yu(S,T,H)&&(T=t),le(S,Hs(T,3))}function Xf(S,T){var H=yr(S)?sc:Ca;return H(S,Hs(T,3))}var B2=Jm(Mv),Q_=Jm(x2);function eC(S,T){return Ua(Yp(S,T),1)}function Hk(S,T){return Ua(Yp(S,T),ut)}function tC(S,T,H){return H=H===t?1:jr(H),Ua(Yp(S,T),H)}function pb(S,T){var H=yr(S)?Ss:_a;return H(S,Hs(T,3))}function bb(S,T){var H=yr(S)?Kc:Hp;return H(S,Hs(T,3))}var nC=xu(function(S,T,H){oi.call(S,H)?S[H].push(T):ui(S,H,[T])});function L2(S,T,H,le){S=au(S)?S:a0(S),H=H&&!le?jr(H):0;var ke=S.length;return H<0&&(H=ho(ke+H,0)),Df(S)?H<=ke&&S.indexOf(T,H)>-1:!!ke&&$a(S,T,H)>-1}var Kp=lr(function(S,T,H){var le=-1,ke=typeof T=="function",Ue=au(S)?rn(S.length):[];return _a(S,function(ht){Ue[++le]=ke?ni(T,ht,H):ac(ht,T,H)}),Ue}),oC=xu(function(S,T,H){ui(S,H,T)});function Yp(S,T){var H=yr(S)?da:at;return H(S,Hs(T,3))}function sg(S,T,H,le){return S==null?[]:(yr(T)||(T=T==null?[]:[T]),H=le?t:H,yr(H)||(H=H==null?[]:[H]),vi(S,T,H))}var Bv=xu(function(S,T,H){S[H?0:1].push(T)},function(){return[[],[]]});function tf(S,T,H){var le=yr(S)?fr:$f,ke=arguments.length<3;return le(S,Hs(T,4),H,ke,_a)}function e0(S,T,H){var le=yr(S)?$u:$f,ke=arguments.length<3;return le(S,Hs(T,4),H,ke,Hp)}function Gs(S,T){var H=yr(S)?sc:Ca;return H(S,ph(Hs(T,3)))}function iu(S){var T=yr(S)?Eu:Um;return T(S)}function rg(S,T,H){(H?Yu(S,T,H):T===t)?T=1:T=jr(T);var le=yr(S)?Fp:Wm;return le(S,T)}function F2(S){var T=yr(S)?V1:jm;return T(S)}function Wi(S){if(S==null)return 0;if(au(S))return Df(S)?Vf(S):S.length;var T=kl(S);return T==St||T==Yt?S.size:G(S).length}function H2(S,T,H){var le=yr(S)?zu:Br;return H&&Yu(S,T,H)&&(T=t),le(S,Hs(T,3))}var ig=lr(function(S,T){if(S==null)return[];var H=T.length;return H>1&&Yu(S,T[0],T[1])?T=[]:H>2&&Yu(T[0],T[1],T[2])&&(T=[T[0]]),vi(S,Ua(T,1),[])}),ga=Q||function(){return he.Date.now()};function om(S,T){if(typeof T!="function")throw new ya(f);return S=jr(S),function(){if(--S<1)return T.apply(this,arguments)}}function Vt(S,T,H){return T=H?t:T,T=S&&T==null?S.length:T,xd(S,X,t,t,t,t,T)}function vb(S,T){var H;if(typeof T!="function")throw new ya(f);return S=jr(S),function(){return--S>0&&(H=T.apply(this,arguments)),S<=1&&(T=t),H}}var $2=lr(function(S,T,H){var le=z;if(H.length){var ke=Nc(H,ou($2));le|=te}return xd(S,le,T,H,ke)}),yb=lr(function(S,T,H){var le=z|q;if(H.length){var ke=Nc(H,ou(yb));le|=te}return xd(T,le,S,H,ke)});function gh(S,T,H){T=H?t:T;var le=xd(S,F,t,t,t,t,t,T);return le.placeholder=gh.placeholder,le}function nf(S,T,H){T=H?t:T;var le=xd(S,oe,t,t,t,t,t,T);return le.placeholder=nf.placeholder,le}function t0(S,T,H){var le,ke,Ue,ht,Ct,zt,pn=0,$n=!1,Vn=!1,Fo=!0;if(typeof S!="function")throw new ya(f);T=Qf(T)||0,pl(H)&&($n=!!H.leading,Vn="maxWait"in H,Ue=Vn?ho(Qf(H.maxWait)||0,T):Ue,Fo="trailing"in H?!!H.trailing:Fo);function hs(ka){var cm=le,ed=ke;return le=ke=t,pn=ka,ht=S.apply(ed,cm),ht}function Ps(ka){return pn=ka,Ct=ep(fi,T),$n?hs(ka):ht}function Hr(ka){var cm=ka-zt,ed=ka-pn,dw=T-cm;return Vn?Er(dw,Ue-ed):dw}function $s(ka){var cm=ka-zt,ed=ka-pn;return zt===t||cm>=T||cm<0||Vn&&ed>=Ue}function fi(){var ka=ga();if($s(ka))return wi(ka);Ct=ep(fi,Hr(ka))}function wi(ka){return Ct=t,Fo&&le?hs(ka):(le=ke=t,ht)}function cu(){Ct!==t&&Ed(Ct),pn=0,le=zt=ke=Ct=t}function Ou(){return Ct===t?ht:wi(ga())}function Of(){var ka=ga(),cm=$s(ka);if(le=arguments,ke=this,zt=ka,cm){if(Ct===t)return Ps(zt);if(Vn)return Ed(Ct),Ct=ep(fi,T),hs(zt)}return Ct===t&&(Ct=ep(fi,T)),ht}return Of.cancel=cu,Of.flush=Ou,Of}var Lv=lr(function(S,T){return qu(S,1,T)}),z2=lr(function(S,T,H){return qu(S,Qf(T)||0,H)});function Fv(S){return xd(S,ye)}function wb(S,T){if(typeof S!="function"||T!=null&&typeof T!="function")throw new ya(f);var H=function(){var le=arguments,ke=T?T.apply(this,le):le[0],Ue=H.cache;if(Ue.has(ke))return Ue.get(ke);var ht=S.apply(this,le);return H.cache=Ue.set(ke,ht)||Ue,ht};return H.cache=new(wb.Cache||jf),H}wb.Cache=jf;function ph(S){if(typeof S!="function")throw new ya(f);return function(){var T=arguments;switch(T.length){case 0:return!S.call(this);case 1:return!S.call(this,T[0]);case 2:return!S.call(this,T[0],T[1]);case 3:return!S.call(this,T[0],T[1],T[2])}return!S.apply(this,T)}}function Jf(S){return vb(2,S)}var Tu=Oa(function(S,T){T=T.length==1&&yr(T[0])?da(T[0],za(Hs())):da(Ua(T,1),za(Hs()));var H=T.length;return lr(function(le){for(var ke=-1,Ue=Er(le.length,H);++ke<Ue;)le[ke]=T[ke].call(this,le[ke]);return ni(S,this,le)})}),Fl=lr(function(S,T){var H=Nc(T,ou(Fl));return xd(S,te,t,T,H)}),V2=lr(function(S,T){var H=Nc(T,ou(V2));return xd(S,se,t,T,H)}),rp=Td(function(S,T){return xd(S,we,t,t,t,T)});function sC(S,T){if(typeof S!="function")throw new ya(f);return T=T===t?T:jr(T),lr(S,T)}function _b(S,T){if(typeof S!="function")throw new ya(f);return T=T==null?0:ho(jr(T),0),lr(function(H){var le=H[T],ke=rh(H,0,T);return le&&Ff(ke,le),ni(S,this,ke)})}function Xp(S,T,H){var le=!0,ke=!0;if(typeof S!="function")throw new ya(f);return pl(H)&&(le="leading"in H?!!H.leading:le,ke="trailing"in H?!!H.trailing:ke),t0(S,T,{leading:le,maxWait:T,trailing:ke})}function U2(S){return Vt(S,1)}function Hv(S,T){return Fl(tb(T),S)}function rC(){if(!arguments.length)return[];var S=arguments[0];return yr(S)?S:[S]}function $v(S){return As(S,N)}function W2(S,T){return T=typeof T=="function"?T:t,As(S,N,T)}function gl(S){return As(S,A|N)}function Kl(S,T){return T=typeof T=="function"?T:t,As(S,A|N,T)}function Du(S,T){return T==null||Cl(S,T,Jl(T))}function Fr(S,T){return S===T||S!==S&&T!==T}var Yl=ri(nh),Hl=ri(function(S,T){return S>=T}),sm=At(function(){return arguments}())?At:function(S){return xl(S)&&oi.call(S,"callee")&&!qh.call(S,"callee")},yr=rn.isArray,iC=so?za(so):_c;function au(S){return S!=null&&Jp(S.length)&&!rm(S)}function Al(S){return xl(S)&&au(S)}function j2(S){return S===!0||S===!1||xl(S)&&Wa(S)==de}var ag=On||am,fc=gi?za(gi):Xc;function r3(S){return xl(S)&&S.nodeType===1&&!n0(S)}function lg(S){if(S==null)return!0;if(au(S)&&(yr(S)||typeof S=="string"||typeof S.splice=="function"||ag(S)||Md(S)||sm(S)))return!S.length;var T=kl(S);if(T==St||T==Yt)return!S.size;if(Jg(S))return!G(S).length;for(var H in S)if(oi.call(S,H))return!1;return!0}function $k(S,T){return lc(S,T)}function zk(S,T,H){H=typeof H=="function"?H:t;var le=H?H(S,T):t;return le===t?lc(S,T,t,H):!!le}function Z2(S){if(!xl(S))return!1;var T=Wa(S);return T==Bn||T==Zn||typeof S.message=="string"&&typeof S.name=="string"&&!n0(S)}function q2(S){return typeof S=="number"&&Cn(S)}function rm(S){if(!pl(S))return!1;var T=Wa(S);return T==ao||T==Wo||T==gt||T==gn}function G2(S){return typeof S=="number"&&S==jr(S)}function Jp(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=et}function pl(S){var T=typeof S;return S!=null&&(T=="object"||T=="function")}function xl(S){return S!=null&&typeof S=="object"}var Tn=hn?za(hn):Za;function Vk(S,T){return S===T||qa(S,T,ch(T))}function Xl(S,T,H){return H=typeof H=="function"?H:t,qa(S,T,ch(T),H)}function Uk(S){return Y2(S)&&S!=+S}function K2(S){if(xf(S))throw new er(u);return Vm(S)}function oo(S){return S===null}function Cc(S){return S==null}function Y2(S){return typeof S=="number"||xl(S)&&Wa(S)==Xt}function n0(S){if(!xl(S)||Wa(S)!=Be)return!1;var T=Lm(S);if(T===null)return!0;var H=oi.call(T,"constructor")&&T.constructor;return typeof H=="function"&&H instanceof H&&Wu.call(H)==F1}var of=qr?za(qr):Jc;function zv(S){return G2(S)&&S>=-et&&S<=et}var Qp=Nl?za(Nl):eb;function Df(S){return typeof S=="string"||!yr(S)&&xl(S)&&Wa(S)==vn}function ol(S){return typeof S=="symbol"||xl(S)&&Wa(S)==rs}var Md=Xi?za(Xi):$o;function Rd(S){return S===t}function Hc(S){return xl(S)&&kl(S)==ds}function o0(S){return xl(S)&&Wa(S)==Or}var X2=ri(De),aC=ri(function(S,T){return S<=T});function J2(S){if(!S)return[];if(au(S))return Df(S)?Wl(S):nu(S);if(si&&S[si])return zh(S[si]());var T=kl(S),H=T==St?Uu:T==Yt?Uh:a0;return H(S)}function bh(S){if(!S)return S===0?S:0;if(S=Qf(S),S===ut||S===-ut){var T=S<0?-1:1;return T*Et}return S===S?S:0}function jr(S){var T=bh(S),H=T%1;return T===T?H?T-H:T:0}function Vv(S){return S?ha(jr(S),0,He):0}function Qf(S){if(typeof S=="number")return S;if(ol(S))return xt;if(pl(S)){var T=typeof S.valueOf=="function"?S.valueOf():S;S=pl(T)?T+"":T}if(typeof S!="string")return S===0?S:+S;S=Pl(S);var H=It.test(S);return H||fo.test(S)?Xn(S.slice(2),H?2:8):Ge.test(S)?xt:+S}function lC(S){return Af(S,sf(S))}function cC(S){return S?ha(jr(S),-et,et):S===0?S:0}function ia(S){return S==null?"":Gi(S)}var Wk=Ad(function(S,T){if(Jg(T)||au(T)){Af(T,Jl(T),S);return}for(var H in T)oi.call(T,H)&&$m(S,H,T[H])}),Uv=Ad(function(S,T){Af(T,sf(T),S)}),Wv=Ad(function(S,T,H,le){Af(T,sf(T),S,le)}),uC=Ad(function(S,T,H,le){Af(T,Jl(T),S,le)}),jk=Td(Ui);function s0(S,T){var H=_f(S);return T==null?H:Zu(H,T)}var fC=lr(function(S,T){S=pi(S);var H=-1,le=T.length,ke=le>2?T[2]:t;for(ke&&Yu(T[0],T[1],ke)&&(le=1);++H<le;)for(var Ue=T[H],ht=sf(Ue),Ct=-1,zt=ht.length;++Ct<zt;){var pn=ht[Ct],$n=S[pn];($n===t||Fr($n,nl[pn])&&!oi.call(S,pn))&&(S[pn]=Ue[pn])}return S}),Zk=lr(function(S){return S.push(t,sb),ni(gC,t,S)});function dC(S,T){return Xr(S,Hs(T,3),Zf)}function qk(S,T){return Xr(S,Hs(T,3),qf)}function hC(S,T){return S==null?S:Ug(S,Hs(T,3),sf)}function jv(S,T){return S==null?S:Ic(S,Hs(T,3),sf)}function ip(S,T){return S&&Zf(S,Hs(T,3))}function r0(S,T){return S&&qf(S,Hs(T,3))}function ji(S){return S==null?[]:$p(S,Jl(S))}function Q2(S){return S==null?[]:$p(S,sf(S))}function Sc(S,T,H){var le=S==null?t:Ll(S,T);return le===t?H:le}function i0(S,T){return S!=null&&El(S,T,Gl)}function sl(S,T){return S!=null&&El(S,T,Q0)}var mC=Do(function(S,T,H){T!=null&&typeof T.toString!="function"&&(T=jh.call(T)),S[T]=H},ey(rf)),im=Do(function(S,T,H){T!=null&&typeof T.toString!="function"&&(T=jh.call(T)),oi.call(S,T)?S[T].push(H):S[T]=[H]},Hs),Gk=lr(ac);function Jl(S){return au(S)?ml(S):G(S)}function sf(S){return au(S)?ml(S,!0):ve(S)}function Cb(S,T){var H={};return T=Hs(T,3),Zf(S,function(le,ke,Ue){ui(H,T(le,ke,Ue),le)}),H}function Kk(S,T){var H={};return T=Hs(T,3),Zf(S,function(le,ke,Ue){ui(H,ke,T(le,ke,Ue))}),H}var Yk=Ad(function(S,T,H){Ln(S,T,H)}),gC=Ad(function(S,T,H,le){Ln(S,T,H,le)}),Sb=Td(function(S,T){var H={};if(S==null)return H;var le=!1;T=da(T,function(Ue){return Ue=Xh(Ue,S),le||(le=Ue.length>1),Ue}),Af(S,yi(S),H),le&&(H=As(H,A|O|N,Dk));for(var ke=T.length;ke--;)Ef(H,T[ke]);return H});function pC(S,T){return ap(S,ph(Hs(T)))}var bC=Td(function(S,T){return S==null?{}:tr(S,T)});function ap(S,T){if(S==null)return{};var H=da(yi(S),function(le){return[le]});return T=Hs(T),vr(S,H,function(le,ke){return T(le,ke[0])})}function Xk(S,T,H){T=Xh(T,S);var le=-1,ke=T.length;for(ke||(ke=1,S=t);++le<ke;){var Ue=S==null?t:S[Xu(T[le])];Ue===t&&(le=ke,Ue=H),S=rm(Ue)?Ue.call(S):Ue}return S}function Jk(S,T,H){return S==null?S:ea(S,T,H)}function Qk(S,T,H,le){return le=typeof le=="function"?le:t,S==null?S:ea(S,T,H,le)}var ew=en(Jl),Zv=en(sf);function cg(S,T,H){var le=yr(S),ke=le||ag(S)||Md(S);if(T=Hs(T,4),H==null){var Ue=S&&S.constructor;ke?H=le?new Ue:[]:pl(S)?H=rm(Ue)?_f(Lm(S)):{}:H={}}return(ke?Ss:Zf)(S,function(ht,Ct,zt){return T(H,ht,Ct,zt)}),H}function vC(S,T){return S==null?!0:Ef(S,T)}function yC(S,T,H){return S==null?S:F_(S,T,tb(H))}function qv(S,T,H,le){return le=typeof le=="function"?le:t,S==null?S:F_(S,T,tb(H),le)}function a0(S){return S==null?[]:qi(S,Jl(S))}function ug(S){return S==null?[]:qi(S,sf(S))}function Gv(S,T,H){return H===t&&(H=T,T=t),H!==t&&(H=Qf(H),H=H===H?H:0),T!==t&&(T=Qf(T),T=T===T?T:0),ha(Qf(S),T,H)}function Kv(S,T,H){return T=bh(T),H===t?(H=T,T=0):H=bh(H),S=Qf(S),zm(S,T,H)}function kb(S,T,H){if(H&&typeof H!="boolean"&&Yu(S,T,H)&&(T=H=t),H===t&&(typeof T=="boolean"?(H=T,T=t):typeof S=="boolean"&&(H=S,S=t)),S===t&&T===t?(S=0,T=1):(S=bh(S),T===t?(T=S,S=0):T=bh(T)),S>T){var le=S;S=T,T=le}if(H||S%1||T%1){var ke=Ri();return Er(S+ke*(T-S+bd("1e-"+((ke+"").length-1))),T)}return kf(S,T)}var wC=ah(function(S,T,H){return T=T.toLowerCase(),S+(H?vh(T):T)});function vh(S){return l0(ia(S).toLowerCase())}function Eb(S){return S=ia(S),S&&S.replace(Ko,Pg).replace(xe,"")}function _C(S,T,H){S=ia(S),T=Gi(T);var le=S.length;H=H===t?le:ha(jr(H),0,le);var ke=H;return H-=T.length,H>=0&&S.slice(H,ke)==T}function yh(S){return S=ia(S),S&&ze.test(S)?S.replace(ps,Pm):S}function lp(S){return S=ia(S),S&&ns.test(S)?S.replace(un,"\\$&"):S}var tw=ah(function(S,T,H){return S+(H?"-":"")+T.toLowerCase()}),CC=ah(function(S,T,H){return S+(H?" ":"")+T.toLowerCase()}),Yv=Sv("toLowerCase");function eE(S,T,H){S=ia(S),T=jr(T);var le=T?Vf(S):0;if(!T||le>=T)return S;var ke=(T-le)/2;return Gg(Xe(ke),H)+S+Gg(Se(ke),H)}function SC(S,T,H){S=ia(S),T=jr(T);var le=T?Vf(S):0;return T&&le<T?S+Gg(T-le,H):S}function tE(S,T,H){S=ia(S),T=jr(T);var le=T?Vf(S):0;return T&&le<T?Gg(T-le,H)+S:S}function nE(S,T,H){return H||T==null?T=0:T&&(T=+T),ra(ia(S).replace(_o,""),T||0)}function kC(S,T,H){return(H?Yu(S,T,H):T===t)?T=1:T=jr(T),sh(ia(S),T)}function EC(){var S=arguments,T=ia(S[0]);return S.length<3?T:T.replace(S[1],S[2])}var AC=ah(function(S,T,H){return S+(H?"_":"")+T.toLowerCase()});function oE(S,T,H){return H&&typeof H!="number"&&Yu(S,T,H)&&(T=H=t),H=H===t?He:H>>>0,H?(S=ia(S),S&&(typeof T=="string"||T!=null&&!of(T))&&(T=Gi(T),!T&&tl(S))?rh(Wl(S),0,H):S.split(T,H)):[]}var sE=ah(function(S,T,H){return S+(H?" ":"")+l0(T)});function rE(S,T,H){return S=ia(S),H=H==null?0:ha(jr(H),0,S.length),T=Gi(T),S.slice(H,H+T.length)==T}function xC(S,T,H){var le=Ae.templateSettings;H&&Yu(S,T,H)&&(T=t),S=ia(S),T=Wv({},T,le,$_);var ke=Wv({},T.imports,le.imports,$_),Ue=Jl(ke),ht=qi(ke,Ue),Ct,zt,pn=0,$n=T.interpolate||Yr,Vn="__p += '",Fo=Gd((T.escape||Yr).source+"|"+$n.source+"|"+($n===Wt?mi:Yr).source+"|"+(T.evaluate||Yr).source+"|$","g"),hs="//# sourceURL="+(oi.call(T,"sourceURL")?(T.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rr+"]")+`
|
|
`;S.replace(Fo,function($s,fi,wi,cu,Ou,Of){return wi||(wi=cu),Vn+=S.slice(pn,Of).replace(it,Il),fi&&(Ct=!0,Vn+=`' +
|
|
__e(`+fi+`) +
|
|
'`),Ou&&(zt=!0,Vn+=`';
|
|
`+Ou+`;
|
|
__p += '`),wi&&(Vn+=`' +
|
|
((__t = (`+wi+`)) == null ? '' : __t) +
|
|
'`),pn=Of+$s.length,$s}),Vn+=`';
|
|
`;var Ps=oi.call(T,"variable")&&T.variable;if(!Ps)Vn=`with (obj) {
|
|
`+Vn+`
|
|
}
|
|
`;else if(Fi.test(Ps))throw new er(h);Vn=(zt?Vn.replace(na,""):Vn).replace(gs,"$1").replace(va,"$1;"),Vn="function("+(Ps||"obj")+`) {
|
|
`+(Ps?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(Ct?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+Vn+`return __p
|
|
}`;var Hr=sw(function(){return Wr(Ue,hs+"return "+Vn).apply(t,ht)});if(Hr.source=Vn,Z2(Hr))throw Hr;return Hr}function nw(S){return ia(S).toLowerCase()}function ow(S){return ia(S).toUpperCase()}function iE(S,T,H){if(S=ia(S),S&&(H||T===t))return Pl(S);if(!S||!(T=Gi(T)))return S;var le=Wl(S),ke=Wl(T),Ue=rc(le,ke),ht=zf(le,ke)+1;return rh(le,Ue,ht).join("")}function aE(S,T,H){if(S=ia(S),S&&(H||T===t))return S.slice(0,Ig(S)+1);if(!S||!(T=Gi(T)))return S;var le=Wl(S),ke=zf(le,Wl(T))+1;return rh(le,0,ke).join("")}function Xv(S,T,H){if(S=ia(S),S&&(H||T===t))return S.replace(_o,"");if(!S||!(T=Gi(T)))return S;var le=Wl(S),ke=rc(le,Wl(T));return rh(le,ke).join("")}function TC(S,T){var H=Te,le=_e;if(pl(T)){var ke="separator"in T?T.separator:ke;H="length"in T?jr(T.length):H,le="omission"in T?Gi(T.omission):le}S=ia(S);var Ue=S.length;if(tl(S)){var ht=Wl(S);Ue=ht.length}if(H>=Ue)return S;var Ct=H-Vf(le);if(Ct<1)return le;var zt=ht?rh(ht,0,Ct).join(""):S.slice(0,Ct);if(ke===t)return zt+le;if(ht&&(Ct+=zt.length-Ct),of(ke)){if(S.slice(Ct).search(ke)){var pn,$n=zt;for(ke.global||(ke=Gd(ke.source,ia(Ke.exec(ke))+"g")),ke.lastIndex=0;pn=ke.exec($n);)var Vn=pn.index;zt=zt.slice(0,Vn===t?Ct:Vn)}}else if(S.indexOf(Gi(ke),Ct)!=Ct){var Fo=zt.lastIndexOf(ke);Fo>-1&&(zt=zt.slice(0,Fo))}return zt+le}function Jv(S){return S=ia(S),S&&Li.test(S)?S.replace(ln,Ye):S}var Ab=ah(function(S,T,H){return S+(H?" ":"")+T.toUpperCase()}),l0=Sv("toUpperCase");function Qv(S,T,H){return S=ia(S),T=H?t:T,T===t?yf(S)?Bg(S):jd(S):S.match(T)||[]}var sw=lr(function(S,T){try{return ni(S,t,T)}catch(H){return Z2(H)?H:new er(H)}}),DC=Td(function(S,T){return Ss(T,function(H){H=Xu(H),ui(S,H,$2(S[H],S))}),S});function rw(S){var T=S==null?0:S.length,H=Hs();return S=T?da(S,function(le){if(typeof le[1]!="function")throw new ya(f);return[H(le[0]),le[1]]}):[],lr(function(le){for(var ke=-1;++ke<T;){var Ue=S[ke];if(ni(Ue[0],this,le))return ni(Ue[1],this,le)}})}function lE(S){return kd(As(S,A))}function ey(S){return function(){return S}}function xb(S,T){return S==null||S!==S?T:S}var cE=Ev(),ty=Ev(!0);function rf(S){return S}function ny(S){return $(typeof S=="function"?S:As(S,A))}function OC(S){return Ft(As(S,A))}function oy(S,T){return kn(S,As(T,A))}var uE=lr(function(S,T){return function(H){return ac(H,S,T)}}),Tb=lr(function(S,T){return function(H){return ac(S,H,T)}});function iw(S,T,H){var le=Jl(T),ke=$p(T,le);H==null&&!(pl(T)&&(ke.length||!le.length))&&(H=T,T=S,S=this,ke=$p(T,Jl(T)));var Ue=!(pl(H)&&"chain"in H)||!!H.chain,ht=rm(S);return Ss(ke,function(Ct){var zt=T[Ct];S[Ct]=zt,ht&&(S.prototype[Ct]=function(){var pn=this.__chain__;if(Ue||pn){var $n=S(this.__wrapped__),Vn=$n.__actions__=nu(this.__actions__);return Vn.push({func:zt,args:arguments,thisArg:S}),$n.__chain__=pn,$n}return zt.apply(S,Ff([this.value()],arguments))})}),S}function fE(){return he._===this&&(he._=Kd),this}function sy(){}function bl(S){return S=jr(S),lr(function(T){return Qo(T,S)})}var dE=q1(da),c0=q1(Ai),hE=q1(zu);function u0(S){return uh(S)?el(Xu(S)):Bc(S)}function aw(S){return function(T){return S==null?t:Ll(S,T)}}var mE=Av(),gE=Av(!0);function Db(){return[]}function am(){return!1}function f0(){return{}}function lu(){return""}function e1(){return!0}function MC(S,T){if(S=jr(S),S<1||S>et)return[];var H=He,le=Er(S,He);T=Hs(T),S-=He;for(var ke=Dr(le,T);++H<S;)T(H);return ke}function RC(S){return yr(S)?da(S,Xu):ol(S)?[S]:nu(lb(ia(S)))}function lw(S){var T=++_u;return ia(S)+T}var cw=lh(function(S,T){return S+T},0),uw=G1("ceil"),pE=lh(function(S,T){return S/T},1),Ob=G1("floor");function ry(S){return S&&S.length?Gr(S,rf,nh):t}function cp(S,T){return S&&S.length?Gr(S,Hs(T,2),nh):t}function Mb(S){return _l(S,rf)}function wh(S,T){return _l(S,Hs(T,2))}function bE(S){return S&&S.length?Gr(S,rf,De):t}function lm(S,T){return S&&S.length?Gr(S,Hs(T,2),De):t}var Nd=lh(function(S,T){return S*T},1),d0=G1("round"),fw=lh(function(S,T){return S-T},0);function h0(S){return S&&S.length?vf(S,rf):0}function fg(S,T){return S&&S.length?vf(S,Hs(T,2)):0}return Ae.after=om,Ae.ary=Vt,Ae.assign=Wk,Ae.assignIn=Uv,Ae.assignInWith=Wv,Ae.assignWith=uC,Ae.at=jk,Ae.before=vb,Ae.bind=$2,Ae.bindAll=DC,Ae.bindKey=yb,Ae.castArray=rC,Ae.chain=sp,Ae.chunk=U_,Ae.compact=Wp,Ae.concat=k2,Ae.cond=rw,Ae.conforms=lE,Ae.constant=ey,Ae.countBy=Gp,Ae.create=s0,Ae.curry=gh,Ae.curryRight=nf,Ae.debounce=t0,Ae.defaults=fC,Ae.defaultsDeep=Zk,Ae.defer=Lv,Ae.delay=z2,Ae.difference=np,Ae.differenceBy=cb,Ae.differenceWith=K1,Ae.drop=E2,Ae.dropRight=A2,Ae.dropRightWhile=W_,Ae.dropWhile=Rk,Ae.fill=Lr,Ae.filter=Xf,Ae.flatMap=eC,Ae.flatMapDeep=Hk,Ae.flatMapDepth=tC,Ae.flatten=T2,Ae.flattenDeep=ub,Ae.flattenDepth=Nk,Ae.flip=Fv,Ae.flow=cE,Ae.flowRight=ty,Ae.fromPairs=nm,Ae.functions=ji,Ae.functionsIn=Q2,Ae.groupBy=nC,Ae.initial=Y1,Ae.intersection=j_,Ae.intersectionBy=db,Ae.intersectionWith=D2,Ae.invert=mC,Ae.invertBy=im,Ae.invokeMap=Kp,Ae.iteratee=ny,Ae.keyBy=oC,Ae.keys=Jl,Ae.keysIn=sf,Ae.map=Yp,Ae.mapKeys=Cb,Ae.mapValues=Kk,Ae.matches=OC,Ae.matchesProperty=oy,Ae.memoize=wb,Ae.merge=Yk,Ae.mergeWith=gC,Ae.method=uE,Ae.methodOf=Tb,Ae.mixin=iw,Ae.negate=ph,Ae.nthArg=bl,Ae.omit=Sb,Ae.omitBy=pC,Ae.once=Jf,Ae.orderBy=sg,Ae.over=dE,Ae.overArgs=Tu,Ae.overEvery=c0,Ae.overSome=hE,Ae.partial=Fl,Ae.partialRight=V2,Ae.partition=Bv,Ae.pick=bC,Ae.pickBy=ap,Ae.property=u0,Ae.propertyOf=aw,Ae.pull=tg,Ae.pullAll=Fc,Ae.pullAllBy=Pk,Ae.pullAllWith=O2,Ae.pullAt=Kf,Ae.range=mE,Ae.rangeRight=gE,Ae.rearg=rp,Ae.reject=Gs,Ae.remove=Na,Ae.rest=sC,Ae.reverse=Sa,Ae.sampleSize=rg,Ae.set=Jk,Ae.setWith=Qk,Ae.shuffle=F2,Ae.slice=Ik,Ae.sortBy=ig,Ae.sortedUniq=X1,Ae.sortedUniqBy=mb,Ae.split=oE,Ae.spread=_b,Ae.tail=gb,Ae.take=Z_,Ae.takeRight=M2,Ae.takeRightWhile=Bk,Ae.takeWhile=q_,Ae.tap=Zp,Ae.throttle=Xp,Ae.thru=qp,Ae.toArray=J2,Ae.toPairs=ew,Ae.toPairsIn=Zv,Ae.toPath=RC,Ae.toPlainObject=lC,Ae.transform=cg,Ae.unary=U2,Ae.union=G_,Ae.unionBy=R2,Ae.unionWith=K_,Ae.uniq=s3,Ae.uniqBy=Nv,Ae.uniqWith=Y_,Ae.unset=vC,Ae.unzip=Ni,Ae.unzipWith=Pv,Ae.update=yC,Ae.updateWith=qv,Ae.values=a0,Ae.valuesIn=ug,Ae.without=N2,Ae.words=Qv,Ae.wrap=Hv,Ae.xor=X_,Ae.xorBy=ng,Ae.xorWith=uc,Ae.zip=ru,Ae.zipObject=J_,Ae.zipObjectDeep=P2,Ae.zipWith=op,Ae.entries=ew,Ae.entriesIn=Zv,Ae.extend=Uv,Ae.extendWith=Wv,iw(Ae,Ae),Ae.add=cw,Ae.attempt=sw,Ae.camelCase=wC,Ae.capitalize=vh,Ae.ceil=uw,Ae.clamp=Gv,Ae.clone=$v,Ae.cloneDeep=gl,Ae.cloneDeepWith=Kl,Ae.cloneWith=W2,Ae.conformsTo=Du,Ae.deburr=Eb,Ae.defaultTo=xb,Ae.divide=pE,Ae.endsWith=_C,Ae.eq=Fr,Ae.escape=yh,Ae.escapeRegExp=lp,Ae.every=Q1,Ae.find=B2,Ae.findIndex=Mv,Ae.findKey=dC,Ae.findLast=Q_,Ae.findLastIndex=x2,Ae.findLastKey=qk,Ae.floor=Ob,Ae.forEach=pb,Ae.forEachRight=bb,Ae.forIn=hC,Ae.forInRight=jv,Ae.forOwn=ip,Ae.forOwnRight=r0,Ae.get=Sc,Ae.gt=Yl,Ae.gte=Hl,Ae.has=i0,Ae.hasIn=sl,Ae.head=Ga,Ae.identity=rf,Ae.includes=L2,Ae.indexOf=fb,Ae.inRange=Kv,Ae.invoke=Gk,Ae.isArguments=sm,Ae.isArray=yr,Ae.isArrayBuffer=iC,Ae.isArrayLike=au,Ae.isArrayLikeObject=Al,Ae.isBoolean=j2,Ae.isBuffer=ag,Ae.isDate=fc,Ae.isElement=r3,Ae.isEmpty=lg,Ae.isEqual=$k,Ae.isEqualWith=zk,Ae.isError=Z2,Ae.isFinite=q2,Ae.isFunction=rm,Ae.isInteger=G2,Ae.isLength=Jp,Ae.isMap=Tn,Ae.isMatch=Vk,Ae.isMatchWith=Xl,Ae.isNaN=Uk,Ae.isNative=K2,Ae.isNil=Cc,Ae.isNull=oo,Ae.isNumber=Y2,Ae.isObject=pl,Ae.isObjectLike=xl,Ae.isPlainObject=n0,Ae.isRegExp=of,Ae.isSafeInteger=zv,Ae.isSet=Qp,Ae.isString=Df,Ae.isSymbol=ol,Ae.isTypedArray=Md,Ae.isUndefined=Rd,Ae.isWeakMap=Hc,Ae.isWeakSet=o0,Ae.join=Ra,Ae.kebabCase=tw,Ae.last=hh,Ae.lastIndexOf=ma,Ae.lowerCase=CC,Ae.lowerFirst=Yv,Ae.lt=X2,Ae.lte=aC,Ae.max=ry,Ae.maxBy=cp,Ae.mean=Mb,Ae.meanBy=wh,Ae.min=bE,Ae.minBy=lm,Ae.stubArray=Db,Ae.stubFalse=am,Ae.stubObject=f0,Ae.stubString=lu,Ae.stubTrue=e1,Ae.multiply=Nd,Ae.nth=Ju,Ae.noConflict=fE,Ae.noop=sy,Ae.now=ga,Ae.pad=eE,Ae.padEnd=SC,Ae.padStart=tE,Ae.parseInt=nE,Ae.random=kb,Ae.reduce=tf,Ae.reduceRight=e0,Ae.repeat=kC,Ae.replace=EC,Ae.result=Xk,Ae.round=d0,Ae.runInContext=bt,Ae.sample=iu,Ae.size=Wi,Ae.snakeCase=AC,Ae.some=H2,Ae.sortedIndex=mh,Ae.sortedIndexBy=hb,Ae.sortedIndexOf=Rv,Ae.sortedLastIndex=Yf,Ae.sortedLastIndexBy=Qu,Ae.sortedLastIndexOf=jp,Ae.startCase=sE,Ae.startsWith=rE,Ae.subtract=fw,Ae.sum=h0,Ae.sumBy=fg,Ae.template=xC,Ae.times=MC,Ae.toFinite=bh,Ae.toInteger=jr,Ae.toLength=Vv,Ae.toLower=nw,Ae.toNumber=Qf,Ae.toSafeInteger=cC,Ae.toString=ia,Ae.toUpper=ow,Ae.trim=iE,Ae.trimEnd=aE,Ae.trimStart=Xv,Ae.truncate=TC,Ae.unescape=Jv,Ae.uniqueId=lw,Ae.upperCase=Ab,Ae.upperFirst=l0,Ae.each=pb,Ae.eachRight=bb,Ae.first=Ga,iw(Ae,function(){var S={};return Zf(Ae,function(T,H){oi.call(Ae.prototype,H)||(S[H]=T)}),S}(),{chain:!1}),Ae.VERSION=s,Ss(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){Ae[S].placeholder=Ae}),Ss(["drop","take"],function(S,T){ci.prototype[S]=function(H){H=H===t?1:ho(jr(H),0);var le=this.__filtered__&&!T?new ci(this):this.clone();return le.__filtered__?le.__takeCount__=Er(H,le.__takeCount__):le.__views__.push({size:Er(H,He),type:S+(le.__dir__<0?"Right":"")}),le},ci.prototype[S+"Right"]=function(H){return this.reverse()[S](H).reverse()}}),Ss(["filter","map","takeWhile"],function(S,T){var H=T+1,le=H==Je||H==V;ci.prototype[S]=function(ke){var Ue=this.clone();return Ue.__iteratees__.push({iteratee:Hs(ke,3),type:H}),Ue.__filtered__=Ue.__filtered__||le,Ue}}),Ss(["head","last"],function(S,T){var H="take"+(T?"Right":"");ci.prototype[S]=function(){return this[H](1).value()[0]}}),Ss(["initial","tail"],function(S,T){var H="drop"+(T?"":"Right");ci.prototype[S]=function(){return this.__filtered__?new ci(this):this[H](1)}}),ci.prototype.compact=function(){return this.filter(rf)},ci.prototype.find=function(S){return this.filter(S).head()},ci.prototype.findLast=function(S){return this.reverse().find(S)},ci.prototype.invokeMap=lr(function(S,T){return typeof S=="function"?new ci(this):this.map(function(H){return ac(H,S,T)})}),ci.prototype.reject=function(S){return this.filter(ph(Hs(S)))},ci.prototype.slice=function(S,T){S=jr(S);var H=this;return H.__filtered__&&(S>0||T<0)?new ci(H):(S<0?H=H.takeRight(-S):S&&(H=H.drop(S)),T!==t&&(T=jr(T),H=T<0?H.dropRight(-T):H.take(T-S)),H)},ci.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},ci.prototype.toArray=function(){return this.take(He)},Zf(ci.prototype,function(S,T){var H=/^(?:filter|find|map|reject)|While$/.test(T),le=/^(?:head|last)$/.test(T),ke=Ae[le?"take"+(T=="last"?"Right":""):T],Ue=le||/^find/.test(T);!ke||(Ae.prototype[T]=function(){var ht=this.__wrapped__,Ct=le?[1]:arguments,zt=ht instanceof ci,pn=Ct[0],$n=zt||yr(ht),Vn=function(fi){var wi=ke.apply(Ae,Ff([fi],Ct));return le&&Fo?wi[0]:wi};$n&&H&&typeof pn=="function"&&pn.length!=1&&(zt=$n=!1);var Fo=this.__chain__,hs=!!this.__actions__.length,Ps=Ue&&!Fo,Hr=zt&&!hs;if(!Ue&&$n){ht=Hr?ht:new ci(this);var $s=S.apply(ht,Ct);return $s.__actions__.push({func:qp,args:[Vn],thisArg:t}),new Su($s,Fo)}return Ps&&Hr?S.apply(this,Ct):($s=this.thru(Vn),Ps?le?$s.value()[0]:$s.value():$s)})}),Ss(["pop","push","shift","sort","splice","unshift"],function(S){var T=vd[S],H=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",le=/^(?:pop|shift)$/.test(S);Ae.prototype[S]=function(){var ke=arguments;if(le&&!this.__chain__){var Ue=this.value();return T.apply(yr(Ue)?Ue:[],ke)}return this[H](function(ht){return T.apply(yr(ht)?ht:[],ke)})}}),Zf(ci.prototype,function(S,T){var H=Ae[T];if(H){var le=H.name+"";oi.call(Qi,le)||(Qi[le]=[]),Qi[le].push({name:T,func:H})}}),Qi[nr(t,q).name]=[{name:"wrapper",func:t}],ci.prototype.clone=wv,ci.prototype.reverse=$1,ci.prototype.value=Z0,Ae.prototype.at=og,Ae.prototype.chain=Iv,Ae.prototype.commit=ta,Ae.prototype.next=ef,Ae.prototype.plant=Lk,Ae.prototype.reverse=I2,Ae.prototype.toJSON=Ae.prototype.valueOf=Ae.prototype.value=Fk,Ae.prototype.first=Ae.prototype.head,si&&(Ae.prototype[si]=J1),Ae},Wh=L1();We?((We.exports=Wh)._=Wh,Re._=Wh):he._=Wh}).call(oP)})(fd,fd.exports);const F0e=fd.exports;var Yde={exports:{}},Soe={exports:{}},Xde=function(e,t){return function(){for(var a=new Array(arguments.length),u=0;u<a.length;u++)a[u]=arguments[u];return e.apply(t,a)}},H0e=Xde,Ck=Object.prototype.toString;function koe(r){return Array.isArray(r)}function dne(r){return typeof r>"u"}function $0e(r){return r!==null&&!dne(r)&&r.constructor!==null&&!dne(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Jde(r){return Ck.call(r)==="[object ArrayBuffer]"}function z0e(r){return Ck.call(r)==="[object FormData]"}function V0e(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Jde(r.buffer),e}function U0e(r){return typeof r=="string"}function W0e(r){return typeof r=="number"}function Qde(r){return r!==null&&typeof r=="object"}function Az(r){if(Ck.call(r)!=="[object Object]")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function j0e(r){return Ck.call(r)==="[object Date]"}function Z0e(r){return Ck.call(r)==="[object File]"}function q0e(r){return Ck.call(r)==="[object Blob]"}function ehe(r){return Ck.call(r)==="[object Function]"}function G0e(r){return Qde(r)&&ehe(r.pipe)}function K0e(r){return Ck.call(r)==="[object URLSearchParams]"}function Y0e(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function X0e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Eoe(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),koe(r))for(var t=0,s=r.length;t<s;t++)e.call(null,r[t],t,r);else for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.call(null,r[a],a,r)}function hne(){var r={};function e(a,u){Az(r[u])&&Az(a)?r[u]=hne(r[u],a):Az(a)?r[u]=hne({},a):koe(a)?r[u]=a.slice():r[u]=a}for(var t=0,s=arguments.length;t<s;t++)Eoe(arguments[t],e);return r}function J0e(r,e,t){return Eoe(e,function(a,u){t&&typeof a=="function"?r[u]=H0e(a,t):r[u]=a}),r}function Q0e(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}var Pp={isArray:koe,isArrayBuffer:Jde,isBuffer:$0e,isFormData:z0e,isArrayBufferView:V0e,isString:U0e,isNumber:W0e,isObject:Qde,isPlainObject:Az,isUndefined:dne,isDate:j0e,isFile:Z0e,isBlob:q0e,isFunction:ehe,isStream:G0e,isURLSearchParams:K0e,isStandardBrowserEnv:X0e,forEach:Eoe,merge:hne,extend:J0e,trim:Y0e,stripBOM:Q0e},AD=Pp;function eie(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var the=function(e,t,s){if(!t)return e;var a;if(s)a=s(t);else if(AD.isURLSearchParams(t))a=t.toString();else{var u=[];AD.forEach(t,function(g,v){g===null||typeof g>"u"||(AD.isArray(g)?v=v+"[]":g=[g],AD.forEach(g,function(A){AD.isDate(A)?A=A.toISOString():AD.isObject(A)&&(A=JSON.stringify(A)),u.push(eie(v)+"="+eie(A))}))}),a=u.join("&")}if(a){var f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},ebe=Pp;function HV(){this.handlers=[]}HV.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};HV.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};HV.prototype.forEach=function(e){ebe.forEach(this.handlers,function(s){s!==null&&e(s)})};var tbe=HV,nbe=Pp,obe=function(e,t){nbe.forEach(e,function(a,u){u!==t&&u.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[u])})},nhe=function(e,t,s,a,u){return e.config=t,s&&(e.code=s),e.request=a,e.response=u,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},zee,tie;function ohe(){if(tie)return zee;tie=1;var r=nhe;return zee=function(t,s,a,u,f){var h=new Error(t);return r(h,s,a,u,f)},zee}var Vee,nie;function sbe(){if(nie)return Vee;nie=1;var r=ohe();return Vee=function(t,s,a){var u=a.config.validateStatus;!a.status||!u||u(a.status)?t(a):s(r("Request failed with status code "+a.status,a.config,null,a.request,a))},Vee}var Uee,oie;function rbe(){if(oie)return Uee;oie=1;var r=Pp;return Uee=r.isStandardBrowserEnv()?function(){return{write:function(s,a,u,f,h,g){var v=[];v.push(s+"="+encodeURIComponent(a)),r.isNumber(u)&&v.push("expires="+new Date(u).toGMTString()),r.isString(f)&&v.push("path="+f),r.isString(h)&&v.push("domain="+h),g===!0&&v.push("secure"),document.cookie=v.join("; ")},read:function(s){var a=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Uee}var Wee,sie;function ibe(){return sie||(sie=1,Wee=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Wee}var jee,rie;function abe(){return rie||(rie=1,jee=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),jee}var Zee,iie;function lbe(){if(iie)return Zee;iie=1;var r=ibe(),e=abe();return Zee=function(s,a){return s&&!r(a)?e(s,a):a},Zee}var qee,aie;function cbe(){if(aie)return qee;aie=1;var r=Pp,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return qee=function(s){var a={},u,f,h;return s&&r.forEach(s.split(`
|
|
`),function(v){if(h=v.indexOf(":"),u=r.trim(v.substr(0,h)).toLowerCase(),f=r.trim(v.substr(h+1)),u){if(a[u]&&e.indexOf(u)>=0)return;u==="set-cookie"?a[u]=(a[u]?a[u]:[]).concat([f]):a[u]=a[u]?a[u]+", "+f:f}}),a},qee}var Gee,lie;function ube(){if(lie)return Gee;lie=1;var r=Pp;return Gee=r.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),a;function u(f){var h=f;return t&&(s.setAttribute("href",h),h=s.href),s.setAttribute("href",h),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=u(window.location.href),function(h){var g=r.isString(h)?u(h):h;return g.protocol===a.protocol&&g.host===a.host}}():function(){return function(){return!0}}(),Gee}var Kee,cie;function $V(){if(cie)return Kee;cie=1;function r(e){this.message=e}return r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,Kee=r,Kee}var Yee,uie;function fie(){if(uie)return Yee;uie=1;var r=Pp,e=sbe(),t=rbe(),s=the,a=lbe(),u=cbe(),f=ube(),h=ohe(),g=zV(),v=$V();return Yee=function(A){return new Promise(function(N,L){var j=A.data,z=A.headers,q=A.responseType,ee;function F(){A.cancelToken&&A.cancelToken.unsubscribe(ee),A.signal&&A.signal.removeEventListener("abort",ee)}r.isFormData(j)&&delete z["Content-Type"];var oe=new XMLHttpRequest;if(A.auth){var te=A.auth.username||"",se=A.auth.password?unescape(encodeURIComponent(A.auth.password)):"";z.Authorization="Basic "+btoa(te+":"+se)}var X=a(A.baseURL,A.url);oe.open(A.method.toUpperCase(),s(X,A.params,A.paramsSerializer),!0),oe.timeout=A.timeout;function we(){if(!!oe){var Te="getAllResponseHeaders"in oe?u(oe.getAllResponseHeaders()):null,_e=!q||q==="text"||q==="json"?oe.responseText:oe.response,ge={data:_e,status:oe.status,statusText:oe.statusText,headers:Te,config:A,request:oe};e(function(Je){N(Je),F()},function(Je){L(Je),F()},ge),oe=null}}if("onloadend"in oe?oe.onloadend=we:oe.onreadystatechange=function(){!oe||oe.readyState!==4||oe.status===0&&!(oe.responseURL&&oe.responseURL.indexOf("file:")===0)||setTimeout(we)},oe.onabort=function(){!oe||(L(h("Request aborted",A,"ECONNABORTED",oe)),oe=null)},oe.onerror=function(){L(h("Network Error",A,null,oe)),oe=null},oe.ontimeout=function(){var _e=A.timeout?"timeout of "+A.timeout+"ms exceeded":"timeout exceeded",ge=A.transitional||g.transitional;A.timeoutErrorMessage&&(_e=A.timeoutErrorMessage),L(h(_e,A,ge.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",oe)),oe=null},r.isStandardBrowserEnv()){var ye=(A.withCredentials||f(X))&&A.xsrfCookieName?t.read(A.xsrfCookieName):void 0;ye&&(z[A.xsrfHeaderName]=ye)}"setRequestHeader"in oe&&r.forEach(z,function(_e,ge){typeof j>"u"&&ge.toLowerCase()==="content-type"?delete z[ge]:oe.setRequestHeader(ge,_e)}),r.isUndefined(A.withCredentials)||(oe.withCredentials=!!A.withCredentials),q&&q!=="json"&&(oe.responseType=A.responseType),typeof A.onDownloadProgress=="function"&&oe.addEventListener("progress",A.onDownloadProgress),typeof A.onUploadProgress=="function"&&oe.upload&&oe.upload.addEventListener("progress",A.onUploadProgress),(A.cancelToken||A.signal)&&(ee=function(Te){!oe||(L(!Te||Te&&Te.type?new v("canceled"):Te),oe.abort(),oe=null)},A.cancelToken&&A.cancelToken.subscribe(ee),A.signal&&(A.signal.aborted?ee():A.signal.addEventListener("abort",ee))),j||(j=null),oe.send(j)})},Yee}var Xee,die;function zV(){if(die)return Xee;die=1;var r=Pp,e=obe,t=nhe,s={"Content-Type":"application/x-www-form-urlencoded"};function a(g,v){!r.isUndefined(g)&&r.isUndefined(g["Content-Type"])&&(g["Content-Type"]=v)}function u(){var g;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(g=fie()),g}function f(g,v,_){if(r.isString(g))try{return(v||JSON.parse)(g),r.trim(g)}catch(A){if(A.name!=="SyntaxError")throw A}return(_||JSON.stringify)(g)}var h={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:u(),transformRequest:[function(v,_){return e(_,"Accept"),e(_,"Content-Type"),r.isFormData(v)||r.isArrayBuffer(v)||r.isBuffer(v)||r.isStream(v)||r.isFile(v)||r.isBlob(v)?v:r.isArrayBufferView(v)?v.buffer:r.isURLSearchParams(v)?(a(_,"application/x-www-form-urlencoded;charset=utf-8"),v.toString()):r.isObject(v)||_&&_["Content-Type"]==="application/json"?(a(_,"application/json"),f(v)):v}],transformResponse:[function(v){var _=this.transitional||h.transitional,A=_&&_.silentJSONParsing,O=_&&_.forcedJSONParsing,N=!A&&this.responseType==="json";if(N||O&&r.isString(v)&&v.length)try{return JSON.parse(v)}catch(L){if(N)throw L.name==="SyntaxError"?t(L,this,"E_JSON_PARSE"):L}return v}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(v){return v>=200&&v<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return r.forEach(["delete","get","head"],function(v){h.headers[v]={}}),r.forEach(["post","put","patch"],function(v){h.headers[v]=r.merge(s)}),Xee=h,Xee}var fbe=Pp,dbe=zV(),hbe=function(e,t,s){var a=this||dbe;return fbe.forEach(s,function(f){e=f.call(a,e,t)}),e},Jee,hie;function she(){return hie||(hie=1,Jee=function(e){return!!(e&&e.__CANCEL__)}),Jee}var mie=Pp,Qee=hbe,mbe=she(),gbe=zV(),pbe=$V();function ete(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new pbe("canceled")}var bbe=function(e){ete(e),e.headers=e.headers||{},e.data=Qee.call(e,e.data,e.headers,e.transformRequest),e.headers=mie.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),mie.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||gbe.adapter;return t(e).then(function(a){return ete(e),a.data=Qee.call(e,a.data,a.headers,e.transformResponse),a},function(a){return mbe(a)||(ete(e),a&&a.response&&(a.response.data=Qee.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},C1=Pp,rhe=function(e,t){t=t||{};var s={};function a(_,A){return C1.isPlainObject(_)&&C1.isPlainObject(A)?C1.merge(_,A):C1.isPlainObject(A)?C1.merge({},A):C1.isArray(A)?A.slice():A}function u(_){if(C1.isUndefined(t[_])){if(!C1.isUndefined(e[_]))return a(void 0,e[_])}else return a(e[_],t[_])}function f(_){if(!C1.isUndefined(t[_]))return a(void 0,t[_])}function h(_){if(C1.isUndefined(t[_])){if(!C1.isUndefined(e[_]))return a(void 0,e[_])}else return a(void 0,t[_])}function g(_){if(_ in t)return a(e[_],t[_]);if(_ in e)return a(void 0,e[_])}var v={url:f,method:f,data:f,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,transport:h,httpAgent:h,httpsAgent:h,cancelToken:h,socketPath:h,responseEncoding:h,validateStatus:g};return C1.forEach(Object.keys(e).concat(Object.keys(t)),function(A){var O=v[A]||u,N=O(A);C1.isUndefined(N)&&O!==g||(s[A]=N)}),s},tte,gie;function ihe(){return gie||(gie=1,tte={version:"0.25.0"}),tte}var vbe=ihe().version,Aoe={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){Aoe[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var pie={};Aoe.transitional=function(e,t,s){function a(u,f){return"[Axios v"+vbe+"] Transitional option '"+u+"'"+f+(s?". "+s:"")}return function(u,f,h){if(e===!1)throw new Error(a(f," has been removed"+(t?" in "+t:"")));return t&&!pie[f]&&(pie[f]=!0,console.warn(a(f," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(u,f,h):!0}};function ybe(r,e,t){if(typeof r!="object")throw new TypeError("options must be an object");for(var s=Object.keys(r),a=s.length;a-- >0;){var u=s[a],f=e[u];if(f){var h=r[u],g=h===void 0||f(h,u,r);if(g!==!0)throw new TypeError("option "+u+" must be "+g);continue}if(t!==!0)throw Error("Unknown option "+u)}}var wbe={assertOptions:ybe,validators:Aoe},ahe=Pp,_be=the,bie=tbe,vie=bbe,VV=rhe,lhe=wbe,xD=lhe.validators;function tI(r){this.defaults=r,this.interceptors={request:new bie,response:new bie}}tI.prototype.request=function(e,t){if(typeof e=="string"?(t=t||{},t.url=e):t=e||{},!t.url)throw new Error("Provided config url is not valid");t=VV(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&lhe.assertOptions(s,{silentJSONParsing:xD.transitional(xD.boolean),forcedJSONParsing:xD.transitional(xD.boolean),clarifyTimeoutError:xD.transitional(xD.boolean)},!1);var a=[],u=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(t)===!1||(u=u&&N.synchronous,a.unshift(N.fulfilled,N.rejected))});var f=[];this.interceptors.response.forEach(function(N){f.push(N.fulfilled,N.rejected)});var h;if(!u){var g=[vie,void 0];for(Array.prototype.unshift.apply(g,a),g=g.concat(f),h=Promise.resolve(t);g.length;)h=h.then(g.shift(),g.shift());return h}for(var v=t;a.length;){var _=a.shift(),A=a.shift();try{v=_(v)}catch(O){A(O);break}}try{h=vie(v)}catch(O){return Promise.reject(O)}for(;f.length;)h=h.then(f.shift(),f.shift());return h};tI.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=VV(this.defaults,e),_be(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};ahe.forEach(["delete","get","head","options"],function(e){tI.prototype[e]=function(t,s){return this.request(VV(s||{},{method:e,url:t,data:(s||{}).data}))}});ahe.forEach(["post","put","patch"],function(e){tI.prototype[e]=function(t,s,a){return this.request(VV(a||{},{method:e,url:t,data:s}))}});var Cbe=tI,nte,yie;function Sbe(){if(yie)return nte;yie=1;var r=$V();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(f){s=f});var a=this;this.promise.then(function(u){if(!!a._listeners){var f,h=a._listeners.length;for(f=0;f<h;f++)a._listeners[f](u);a._listeners=null}}),this.promise.then=function(u){var f,h=new Promise(function(g){a.subscribe(g),f=g}).then(u);return h.cancel=function(){a.unsubscribe(f)},h},t(function(f){a.reason||(a.reason=new r(f),s(a.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]},e.prototype.unsubscribe=function(s){if(!!this._listeners){var a=this._listeners.indexOf(s);a!==-1&&this._listeners.splice(a,1)}},e.source=function(){var s,a=new e(function(f){s=f});return{token:a,cancel:s}},nte=e,nte}var ote,wie;function kbe(){return wie||(wie=1,ote=function(e){return function(s){return e.apply(null,s)}}),ote}var ste,_ie;function Ebe(){if(_ie)return ste;_ie=1;var r=Pp;return ste=function(t){return r.isObject(t)&&t.isAxiosError===!0},ste}var Cie=Pp,Abe=Xde,xz=Cbe,xbe=rhe,Tbe=zV();function che(r){var e=new xz(r),t=Abe(xz.prototype.request,e);return Cie.extend(t,xz.prototype,e),Cie.extend(t,e),t.create=function(a){return che(xbe(r,a))},t}var f2=che(Tbe);f2.Axios=xz;f2.Cancel=$V();f2.CancelToken=Sbe();f2.isCancel=she();f2.VERSION=ihe().version;f2.all=function(e){return Promise.all(e)};f2.spread=kbe();f2.isAxiosError=Ebe();Soe.exports=f2;Soe.exports.default=f2;(function(r){r.exports=Soe.exports})(Yde);const Dbe=L0e(Yde.exports);window._=F0e;window.axios=Dbe;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.interceptors.request.use(function(r){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.add("spinner-on"),e[t].disabled=!0;return r},function(r){return Promise.reject(r)});window.axios.interceptors.response.use(function(r){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return r},function(r){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return Promise.reject(r)});function _n(){}const uhe=r=>r;function nI(r,e){for(const t in e)r[t]=e[t];return r}function fhe(r){return r()}function Sie(){return Object.create(null)}function Bi(r){r.forEach(fhe)}function B0(r){return typeof r=="function"}function Eo(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}let z$;function kie(r,e){return z$||(z$=document.createElement("a")),z$.href=e,r===z$.href}function Obe(r){return Object.keys(r).length===0}function dhe(r,e,t,s){if(r){const a=hhe(r,e,t,s);return r[0](a)}}function hhe(r,e,t,s){return r[1]&&s?nI(t.ctx.slice(),r[1](s(e))):t.ctx}function mhe(r,e,t,s){if(r[2]&&s){const a=r[2](s(t));if(e.dirty===void 0)return a;if(typeof a=="object"){const u=[],f=Math.max(e.dirty.length,a.length);for(let h=0;h<f;h+=1)u[h]=e.dirty[h]|a[h];return u}return e.dirty|a}return e.dirty}function ghe(r,e,t,s,a,u){if(a){const f=hhe(e,t,s,u);r.p(f,a)}}function phe(r){if(r.ctx.length>32){const e=[],t=r.ctx.length/32;for(let s=0;s<t;s++)e[s]=-1;return e}return-1}function Eie(r){const e=typeof r=="string"&&r.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[r,"px"]}const bhe=typeof window<"u";let vhe=bhe?()=>window.performance.now():()=>Date.now(),xoe=bhe?r=>requestAnimationFrame(r):_n;const ZD=new Set;function yhe(r){ZD.forEach(e=>{e.c(r)||(ZD.delete(e),e.f())}),ZD.size!==0&&xoe(yhe)}function whe(r){let e;return ZD.size===0&&xoe(yhe),{promise:new Promise(t=>{ZD.add(e={c:r,f:t})}),abort(){ZD.delete(e)}}}const Mbe=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Y(r,e){r.appendChild(e)}function _he(r){if(!r)return document;const e=r.getRootNode?r.getRootNode():r.ownerDocument;return e&&e.host?e:r.ownerDocument}function Rbe(r){const e=ae("style");return Nbe(_he(r),e),e.sheet}function Nbe(r,e){return Y(r.head||r,e),e.sheet}function Ie(r,e,t){r.insertBefore(e,t||null)}function Pe(r){r.parentNode&&r.parentNode.removeChild(r)}function Ba(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function ae(r){return document.createElement(r)}function Che(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Kt(r){return document.createTextNode(r)}function Ze(){return Kt(" ")}function Bs(){return Kt("")}function En(r,e,t,s){return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}function Hu(r){return function(e){return e.preventDefault(),r.call(this,e)}}function U(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Toe(r){let e;return{p(...t){e=t,e.forEach(s=>r.push(s))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function Yz(r){return r===""?null:+r}function Pbe(r){return Array.from(r.childNodes)}function jn(r,e){e=""+e,r.data!==e&&(r.data=e)}function _r(r,e){r.value=e==null?"":e}function ss(r,e,t,s){t==null?r.style.removeProperty(e):r.style.setProperty(e,t,s?"important":"")}function V$(r,e,t){for(let s=0;s<r.options.length;s+=1){const a=r.options[s];if(a.__value===e){a.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Aie(r){const e=r.querySelector(":checked");return e&&e.__value}function vs(r,e,t){r.classList[t?"add":"remove"](e)}function She(r,e,{bubbles:t=!1,cancelable:s=!1}={}){const a=document.createEvent("CustomEvent");return a.initCustomEvent(r,t,s,e),a}class Ibe{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,s=null){this.e||(this.is_svg?this.e=Che(t.nodeName):this.e=ae(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(s)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Ie(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Pe)}}function dk(r,e){return new r(e)}const Xz=new Map;let Jz=0;function Bbe(r){let e=5381,t=r.length;for(;t--;)e=(e<<5)-e^r.charCodeAt(t);return e>>>0}function Lbe(r,e){const t={stylesheet:Rbe(e),rules:{}};return Xz.set(r,t),t}function mne(r,e,t,s,a,u,f,h=0){const g=16.666/s;let v=`{
|
|
`;for(let z=0;z<=1;z+=g){const q=e+(t-e)*u(z);v+=z*100+`%{${f(q,1-q)}}
|
|
`}const _=v+`100% {${f(t,1-t)}}
|
|
}`,A=`__svelte_${Bbe(_)}_${h}`,O=_he(r),{stylesheet:N,rules:L}=Xz.get(O)||Lbe(O,r);L[A]||(L[A]=!0,N.insertRule(`@keyframes ${A} ${_}`,N.cssRules.length));const j=r.style.animation||"";return r.style.animation=`${j?`${j}, `:""}${A} ${s}ms linear ${a}ms 1 both`,Jz+=1,A}function khe(r,e){const t=(r.style.animation||"").split(", "),s=t.filter(e?u=>u.indexOf(e)<0:u=>u.indexOf("__svelte")===-1),a=t.length-s.length;a&&(r.style.animation=s.join(", "),Jz-=a,Jz||Fbe())}function Fbe(){xoe(()=>{Jz||(Xz.forEach(r=>{const{ownerNode:e}=r.stylesheet;e&&Pe(e)}),Xz.clear())})}function Ehe(r,e,t,s){if(!e)return _n;const a=r.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return _n;const{delay:u=0,duration:f=300,easing:h=uhe,start:g=vhe()+u,end:v=g+f,tick:_=_n,css:A}=t(r,{from:e,to:a},s);let O=!0,N=!1,L;function j(){A&&(L=mne(r,0,1,f,u,h,A)),u||(N=!0)}function z(){A&&khe(r,L),O=!1}return whe(q=>{if(!N&&q>=g&&(N=!0),N&&q>=v&&(_(1,0),z()),!O)return!1;if(N){const ee=q-g,F=0+1*h(ee/f);_(F,1-F)}return!0}),j(),_(0,1),z}function Ahe(r){const e=getComputedStyle(r);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:s}=e,a=r.getBoundingClientRect();r.style.position="absolute",r.style.width=t,r.style.height=s,Hbe(r,a)}}function Hbe(r,e){const t=r.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const s=getComputedStyle(r),a=s.transform==="none"?"":s.transform;r.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let IP;function CP(r){IP=r}function bO(){if(!IP)throw new Error("Function called outside component initialization");return IP}function H0(r){bO().$$.on_mount.push(r)}function xhe(r){bO().$$.after_update.push(r)}function The(r){bO().$$.on_destroy.push(r)}function Ip(){const r=bO();return(e,t,{cancelable:s=!1}={})=>{const a=r.$$.callbacks[e];if(a){const u=She(e,t,{cancelable:s});return a.slice().forEach(f=>{f.call(r,u)}),!u.defaultPrevented}return!0}}function Qz(r,e){return bO().$$.context.set(r,e),e}function hi(r){return bO().$$.context.get(r)}function Tz(r,e){const t=r.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const PD=[],ts=[];let qD=[];const gne=[],$be=Promise.resolve();let pne=!1;function zbe(){pne||(pne=!0,$be.then(Dhe))}function hk(r){qD.push(r)}function Cr(r){gne.push(r)}const rte=new Set;let TD=0;function Dhe(){if(TD!==0)return;const r=IP;do{try{for(;TD<PD.length;){const e=PD[TD];TD++,CP(e),Vbe(e.$$)}}catch(e){throw PD.length=0,TD=0,e}for(CP(null),PD.length=0,TD=0;ts.length;)ts.pop()();for(let e=0;e<qD.length;e+=1){const t=qD[e];rte.has(t)||(rte.add(t),t())}qD.length=0}while(PD.length);for(;gne.length;)gne.pop()();pne=!1,rte.clear(),CP(r)}function Vbe(r){if(r.fragment!==null){r.update(),Bi(r.before_update);const e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(hk)}}function Ube(r){const e=[],t=[];qD.forEach(s=>r.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),qD=e}let sP;function Wbe(){return sP||(sP=Promise.resolve(),sP.then(()=>{sP=null})),sP}function ite(r,e,t){r.dispatchEvent(She(`${e?"intro":"outro"}${t}`))}const Dz=new Set;let E_;function So(){E_={r:0,c:[],p:E_}}function ko(){E_.r||Bi(E_.c),E_=E_.p}function Oe(r,e){r&&r.i&&(Dz.delete(r),r.i(e))}function $e(r,e,t,s){if(r&&r.o){if(Dz.has(r))return;Dz.add(r),E_.c.push(()=>{Dz.delete(r),s&&(t&&r.d(1),s())}),r.o(e)}else s&&s()}const jbe={duration:0};function eV(r,e,t,s){const a={direction:"both"};let u=e(r,t,a),f=s?0:1,h=null,g=null,v=null;function _(){v&&khe(r,v)}function A(N,L){const j=N.b-f;return L*=Math.abs(j),{a:f,b:N.b,d:j,duration:L,start:N.start,end:N.start+L,group:N.group}}function O(N){const{delay:L=0,duration:j=300,easing:z=uhe,tick:q=_n,css:ee}=u||jbe,F={start:vhe()+L,b:N};N||(F.group=E_,E_.r+=1),h||g?g=F:(ee&&(_(),v=mne(r,f,N,j,L,z,ee)),N&&q(0,1),h=A(F,j),hk(()=>ite(r,N,"start")),whe(oe=>{if(g&&oe>g.start&&(h=A(g,j),g=null,ite(r,h.b,"start"),ee&&(_(),v=mne(r,f,h.b,h.duration,0,z,u.css))),h){if(oe>=h.end)q(f=h.b,1-f),ite(r,h.b,"end"),g||(h.b?_():--h.group.r||Bi(h.group.c)),h=null;else if(oe>=h.start){const te=oe-h.start;f=h.a+h.d*z(te/h.duration),q(f,1-f)}}return!!(h||g)}))}return{run(N){B0(u)?Wbe().then(()=>{u=u(a),O(N)}):O(N)},end(){_(),h=g=null}}}function oI(r,e){r.d(1),e.delete(r.key)}function gv(r,e){$e(r,1,1,()=>{e.delete(r.key)})}function Ohe(r,e){r.f(),gv(r,e)}function $h(r,e,t,s,a,u,f,h,g,v,_,A){let O=r.length,N=u.length,L=O;const j={};for(;L--;)j[r[L].key]=L;const z=[],q=new Map,ee=new Map,F=[];for(L=N;L--;){const X=A(a,u,L),we=t(X);let ye=f.get(we);ye?s&&F.push(()=>ye.p(X,e)):(ye=v(we,X),ye.c()),q.set(we,z[L]=ye),we in j&&ee.set(we,Math.abs(L-j[we]))}const oe=new Set,te=new Set;function se(X){Oe(X,1),X.m(h,_),f.set(X.key,X),_=X.first,N--}for(;O&&N;){const X=z[N-1],we=r[O-1],ye=X.key,Te=we.key;X===we?(_=X.first,O--,N--):q.has(Te)?!f.has(ye)||oe.has(ye)?se(X):te.has(Te)?O--:ee.get(ye)>ee.get(Te)?(te.add(ye),se(X)):(oe.add(Te),O--):(g(we,f),O--)}for(;O--;){const X=r[O];q.has(X.key)||g(X,f)}for(;N;)se(z[N-1]);return Bi(F),z}function UV(r,e){const t={},s={},a={$$scope:1};let u=r.length;for(;u--;){const f=r[u],h=e[u];if(h){for(const g in f)g in h||(s[g]=1);for(const g in h)a[g]||(t[g]=h[g],a[g]=1);r[u]=h}else for(const g in f)a[g]=1}for(const f in s)f in t||(t[f]=void 0);return t}function WV(r){return typeof r=="object"&&r!==null?r:{}}function gr(r,e,t){const s=r.$$.props[e];s!==void 0&&(r.$$.bound[s]=t,t(r.$$.ctx[s]))}function sn(r){r&&r.c()}function nn(r,e,t,s){const{fragment:a,after_update:u}=r.$$;a&&a.m(e,t),s||hk(()=>{const f=r.$$.on_mount.map(fhe).filter(B0);r.$$.on_destroy?r.$$.on_destroy.push(...f):Bi(f),r.$$.on_mount=[]}),u.forEach(hk)}function on(r,e){const t=r.$$;t.fragment!==null&&(Ube(t.after_update),Bi(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Zbe(r,e){r.$$.dirty[0]===-1&&(PD.push(r),zbe(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function Ao(r,e,t,s,a,u,f,h=[-1]){const g=IP;CP(r);const v=r.$$={fragment:null,ctx:[],props:u,update:_n,not_equal:a,bound:Sie(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:Sie(),dirty:h,skip_bound:!1,root:e.target||g.$$.root};f&&f(v.root);let _=!1;if(v.ctx=t?t(r,e.props||{},(A,O,...N)=>{const L=N.length?N[0]:O;return v.ctx&&a(v.ctx[A],v.ctx[A]=L)&&(!v.skip_bound&&v.bound[A]&&v.bound[A](L),_&&Zbe(r,A)),O}):[],v.update(),_=!0,Bi(v.before_update),v.fragment=s?s(v.ctx):!1,e.target){if(e.hydrate){const A=Pbe(e.target);v.fragment&&v.fragment.l(A),A.forEach(Pe)}else v.fragment&&v.fragment.c();e.intro&&Oe(r.$$.fragment),nn(r,e.target,e.anchor,e.customElement),Dhe()}CP(g)}class xo{$destroy(){on(this,1),this.$destroy=_n}$on(e,t){if(!B0(t))return _n;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(t),()=>{const a=s.indexOf(t);a!==-1&&s.splice(a,1)}}$set(e){this.$$set&&!Obe(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function xie(r){let e,t;return{c(){e=ae("div"),t=Kt(r[0]),U(e,"class","alert alert-danger"),U(e,"role","alert")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&1&&jn(t,s[0])},d(s){s&&Pe(e)}}}function qbe(r){let e,t=r[0]&&xie(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=xie(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function Gbe(r,e,t){let{message:s=""}=e;return r.$$set=a=>{"message"in a&&t(0,s=a.message)},[s]}class sI extends xo{constructor(e){super(),Ao(this,e,Gbe,qbe,Eo,{message:0})}}function Kbe(r){let e,t,s,a;return{c(){e=ae("button"),t=ae("span"),s=Ze(),a=Kt(r[0]),U(t,"class","spinner-border spinner-border-sm"),U(t,"role","status"),U(t,"aria-hidden","true"),U(e,"type","submit"),U(e,"class","btn btn-primary btn-spinner"),e.disabled=r[1]},m(u,f){Ie(u,e,f),Y(e,t),Y(e,s),Y(e,a)},p(u,[f]){f&1&&jn(a,u[0]),f&2&&(e.disabled=u[1])},i:_n,o:_n,d(u){u&&Pe(e)}}}function Ybe(r,e,t){let{label:s=""}=e,{disabled:a=!1}=e;return r.$$set=u=>{"label"in u&&t(0,s=u.label),"disabled"in u&&t(1,a=u.disabled)},[s,a]}class rI extends xo{constructor(e){super(),Ao(this,e,Ybe,Kbe,Eo,{label:0,disabled:1})}}function Xbe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F;return t=new sI({props:{message:r[2]}}),z=new rI({props:{label:"Register"}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),a=ae("form"),u=ae("div"),f=ae("label"),f.textContent="Name",h=Ze(),g=ae("input"),v=Ze(),_=ae("div"),A=ae("label"),A.textContent="Email address",O=Ze(),N=ae("input"),L=Ze(),j=ae("div"),sn(z.$$.fragment),U(f,"for","name"),U(f,"class","form-label"),U(g,"type","text"),U(g,"class","form-control"),U(g,"id","name"),U(u,"class","mb-3"),U(A,"for","email"),U(A,"class","form-label"),U(N,"type","email"),U(N,"class","form-control"),U(N,"id","email"),U(_,"class","mb-3"),U(j,"class","text-center mt-5 d-block"),U(e,"class","wrapper-tiny")},m(oe,te){Ie(oe,e,te),nn(t,e,null),Y(e,s),Y(e,a),Y(a,u),Y(u,f),Y(u,h),Y(u,g),_r(g,r[1]),Y(a,v),Y(a,_),Y(_,A),Y(_,O),Y(_,N),_r(N,r[0]),Y(a,L),Y(a,j),nn(z,j,null),q=!0,ee||(F=[En(g,"input",r[4]),En(N,"input",r[5]),En(a,"submit",r[3])],ee=!0)},p(oe,[te]){const se={};te&4&&(se.message=oe[2]),t.$set(se),te&2&&g.value!==oe[1]&&_r(g,oe[1]),te&1&&N.value!==oe[0]&&_r(N,oe[0])},i(oe){q||(Oe(t.$$.fragment,oe),Oe(z.$$.fragment,oe),q=!0)},o(oe){$e(t.$$.fragment,oe),$e(z.$$.fragment,oe),q=!1},d(oe){oe&&Pe(e),on(t),on(z),ee=!1,Bi(F)}}}function Jbe(r,e,t){const s=hi("channel");let a="",{email:u=""}=e,f="";function h(_){_.preventDefault(),t(2,f=""),axios.post(s.lucentUrl+"/register",{name:a,email:u}).then(()=>{window.location=s.lucentUrl+"/login"}).catch(A=>{var O;t(2,f=(O=A.response)==null?void 0:O.data.error),console.log({errorMessage:f})})}function g(){a=this.value,t(1,a)}function v(){u=this.value,t(0,u)}return r.$$set=_=>{"email"in _&&t(0,u=_.email)},[u,a,f,h,g,v]}class Qbe extends xo{constructor(e){super(),Ao(this,e,Jbe,Xbe,Eo,{email:0})}}function Mhe(r){const e=r-1;return e*e*e+1}function Rhe(r){return--r*r*r*r*r+1}function tV(r,{delay:e=0,duration:t=400,easing:s=Mhe,x:a=0,y:u=0,opacity:f=0}={}){const h=getComputedStyle(r),g=+h.opacity,v=h.transform==="none"?"":h.transform,_=g*(1-f),[A,O]=Eie(a),[N,L]=Eie(u);return{delay:e,duration:t,easing:s,css:(j,z)=>`
|
|
transform: ${v} translate(${(1-j)*A}${O}, ${(1-j)*N}${L});
|
|
opacity: ${g-_*z}`}}function Tie(r){let e,t,s,a;return{c(){e=ae("div"),t=Kt(r[1]),U(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),U(e,"role","alert")},m(u,f){Ie(u,e,f),Y(e,t),a=!0},p(u,f){(!a||f&2)&&jn(t,u[1])},i(u){a||(hk(()=>{!a||(s||(s=eV(e,tV,{duration:500},!0)),s.run(1))}),a=!0)},o(u){s||(s=eV(e,tV,{duration:500},!1)),s.run(0),a=!1},d(u){u&&Pe(e),u&&s&&s.end()}}}function eve(r){let e,t,s=r[0]&&Tie(r);return{c(){s&&s.c(),e=Bs()},m(a,u){s&&s.m(a,u),Ie(a,e,u),t=!0},p(a,[u]){a[0]?s?(s.p(a,u),u&1&&Oe(s,1)):(s=Tie(a),s.c(),Oe(s,1),s.m(e.parentNode,e)):s&&(So(),$e(s,1,1,()=>{s=null}),ko())},i(a){t||(Oe(s),t=!0)},o(a){$e(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function tve(r,e,t){let s,a;function u(f="Saved"){t(1,s=f),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,s="Saved"),t(0,a=!1),[a,s,u]}class Nhe extends xo{constructor(e){super(),Ao(this,e,tve,eve,Eo,{show:2})}get show(){return this.$$.ctx[2]}}function nve(r){let e,t,s,a,u,f,h,g,v,_,A;return g=new rI({props:{label:"Login"}}),{c(){e=ae("form"),t=ae("div"),s=ae("label"),s.textContent="Email address",a=Ze(),u=ae("input"),f=Ze(),h=ae("div"),sn(g.$$.fragment),U(s,"for","emailaddress"),U(s,"class","form-label"),U(u,"type","email"),U(u,"class","form-control"),U(u,"id","emailaddress"),u.required=!0,U(t,"class","mb-3"),U(h,"class","text-center mt-5 d-block")},m(O,N){Ie(O,e,N),Y(e,t),Y(t,s),Y(t,a),Y(t,u),_r(u,r[0]),Y(e,f),Y(e,h),nn(g,h,null),v=!0,_||(A=[En(u,"input",r[3]),En(e,"submit",r[2])],_=!0)},p(O,N){N&1&&u.value!==O[0]&&_r(u,O[0])},i(O){v||(Oe(g.$$.fragment,O),v=!0)},o(O){$e(g.$$.fragment,O),v=!1},d(O){O&&Pe(e),on(g),_=!1,Bi(A)}}}function ove(r){let e,t;return{c(){e=ae("div"),t=Kt(r[1]),U(e,"class","alert alert-info"),U(e,"role","alert")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&2&&jn(t,s[1])},i:_n,o:_n,d(s){s&&Pe(e)}}}function sve(r){let e,t,s,a;const u=[ove,nve],f=[];function h(g,v){return g[1]?0:1}return t=h(r),s=f[t]=u[t](r),{c(){e=ae("div"),s.c(),U(e,"class","wrapper-tiny")},m(g,v){Ie(g,e,v),f[t].m(e,null),a=!0},p(g,[v]){let _=t;t=h(g),t===_?f[t].p(g,v):(So(),$e(f[_],1,1,()=>{f[_]=null}),ko(),s=f[t],s?s.p(g,v):(s=f[t]=u[t](g),s.c()),Oe(s,1),s.m(e,null))},i(g){a||(Oe(s),a=!0)},o(g){$e(s),a=!1},d(g){g&&Pe(e),f[t].d()}}}function rve(r,e,t){const s=hi("channel");let a="",u="";function f(g){g.preventDefault(),axios.post(s.lucentUrl+"/login",{email:a}).then(v=>{console.log(v),t(1,u="You will receive an email with a login link")}).catch(v=>{})}function h(){a=this.value,t(0,a)}return[a,u,f,h]}class ive extends xo{constructor(e){super(),Ao(this,e,rve,sve,Eo,{})}}function ave(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j={};return e=new Nhe({props:j}),r[4](e),A=new rI({props:{label:"Enter"}}),{c(){sn(e.$$.fragment),t=Ze(),s=ae("div"),a=ae("form"),u=ae("div"),f=ae("h3"),h=Kt("Login as "),g=Kt(r[0]),v=Ze(),_=ae("div"),sn(A.$$.fragment),U(u,"class","mb-3 text-center"),U(_,"class","text-center mt-5 d-block"),U(s,"class","wrapper-tiny")},m(z,q){nn(e,z,q),Ie(z,t,q),Ie(z,s,q),Y(s,a),Y(a,u),Y(u,f),Y(f,h),Y(f,g),Y(a,v),Y(a,_),nn(A,_,null),O=!0,N||(L=En(a,"submit",r[2]),N=!0)},p(z,[q]){const ee={};e.$set(ee),(!O||q&1)&&jn(g,z[0])},i(z){O||(Oe(e.$$.fragment,z),Oe(A.$$.fragment,z),O=!0)},o(z){$e(e.$$.fragment,z),$e(A.$$.fragment,z),O=!1},d(z){r[4](null),on(e,z),z&&Pe(t),z&&Pe(s),on(A),N=!1,L()}}}function lve(r,e,t){const s=hi("channel");let{email:a}=e,{token:u}=e,f;function h(v){v.preventDefault(),axios.post(s.lucentUrl+"/verify",{email:a,token:u}).then(_=>{window.location=s.lucentUrl}).catch(_=>{})}function g(v){ts[v?"unshift":"push"](()=>{f=v,t(1,f)})}return r.$$set=v=>{"email"in v&&t(0,a=v.email),"token"in v&&t(3,u=v.token)},[a,f,h,u,g]}class cve extends xo{constructor(e){super(),Ao(this,e,lve,ave,Eo,{email:0,token:3})}}function uve(r){let e,t,s;return{c(){e=ae("div"),t=ae("div"),s=Kt(r[2]),U(t,"class","avatar__letters"),U(e,"class","avatar"),U(e,"title",r[0]),ss(e,"background-color",r[3][r[4]]),ss(e,"height",r[1]+"px"),ss(e,"width",r[1]+"px"),ss(e,"font-size",r[1]/2+"px")},m(a,u){Ie(a,e,u),Y(e,t),Y(t,s)},p(a,[u]){u&4&&jn(s,a[2]),u&1&&U(e,"title",a[0]),u&2&&ss(e,"height",a[1]+"px"),u&2&&ss(e,"width",a[1]+"px"),u&2&&ss(e,"font-size",a[1]/2+"px")},i:_n,o:_n,d(a){a&&Pe(e)}}}function fve(r,e,t){let{name:s}=e,{side:a="48"}=e;const u=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let f="";s.split(" ").length>1?f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[1].charAt(0).toUpperCase():f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[0].charAt(1).toUpperCase();let g=(s.charCodeAt(1)+s.length)%19;return r.$$set=v=>{"name"in v&&t(0,s=v.name),"side"in v&&t(1,a=v.side)},[s,a,f,u,g]}class i2 extends xo{constructor(e){super(),Ao(this,e,fve,uve,Eo,{name:0,side:1})}}function dve(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee;return t=new sI({props:{message:r[1]}}),u=new i2({props:{name:r[2].name}}),A=new rI({props:{label:"Update"}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),a=ae("h3"),sn(u.$$.fragment),f=Ze(),h=ae("form"),g=ae("div"),v=ae("input"),_=Ze(),sn(A.$$.fragment),O=Ze(),N=ae("div"),L=ae("a"),j=Kt("Logout from this device"),U(a,"class","header-small mb-5"),U(v,"type","text"),U(v,"class","form-control"),U(v,"placeholder","Name"),U(g,"class","input-group mb-3"),U(L,"class","list-group-item list-group-item-action"),U(L,"href",r[3].lucentUrl+"/logout"),U(N,"class","list-group"),U(e,"class","wrapper-tiny")},m(F,oe){Ie(F,e,oe),nn(t,e,null),Y(e,s),Y(e,a),nn(u,a,null),Y(e,f),Y(e,h),Y(h,g),Y(g,v),_r(v,r[0]),Y(g,_),nn(A,g,null),Y(e,O),Y(e,N),Y(N,L),Y(L,j),z=!0,q||(ee=[En(v,"input",r[5]),En(h,"submit",r[4])],q=!0)},p(F,[oe]){const te={};oe&2&&(te.message=F[1]),t.$set(te),oe&1&&v.value!==F[0]&&_r(v,F[0])},i(F){z||(Oe(t.$$.fragment,F),Oe(u.$$.fragment,F),Oe(A.$$.fragment,F),z=!0)},o(F){$e(t.$$.fragment,F),$e(u.$$.fragment,F),$e(A.$$.fragment,F),z=!1},d(F){F&&Pe(e),on(t),on(u),on(A),q=!1,Bi(ee)}}}function hve(r,e,t){const s=hi("user"),a=hi("channel");let u=s.name;s.email;let f="";function h(v){v.preventDefault(),t(1,f=""),axios.post("/account/update-name",{name:u}).then(_=>{}).catch(_=>{var A;t(1,f=(A=_.response)==null?void 0:A.data.error),console.log({errorMessage:f})})}function g(){u=this.value,t(0,u)}return[u,f,s,a,h,g]}class mve extends xo{constructor(e){super(),Ao(this,e,hve,dve,Eo,{})}}function gve(r){let e,t,s;const a=[{title:r[0]},r[2]];var u=r[3][r[1]];function f(h){let g={};for(let v=0;v<a.length;v+=1)g=nI(g,a[v]);return{props:g}}return u&&(e=dk(u,f())),{c(){e&&sn(e.$$.fragment),t=Bs()},m(h,g){e&&nn(e,h,g),Ie(h,t,g),s=!0},p(h,[g]){const v=g&5?UV(a,[g&1&&{title:h[0]},g&4&&WV(h[2])]):{};if(g&2&&u!==(u=h[3][h[1]])){if(e){So();const _=e;$e(_.$$.fragment,1,0,()=>{on(_,1)}),ko()}u?(e=dk(u,f()),sn(e.$$.fragment),Oe(e.$$.fragment,1),nn(e,t.parentNode,t)):e=null}else u&&e.$set(v)},i(h){s||(e&&Oe(e.$$.fragment,h),s=!0)},o(h){e&&$e(e.$$.fragment,h),s=!1},d(h){h&&Pe(t),e&&on(e,h)}}}function pve(r,e,t){const s={register:Qbe,login:ive,verify:cve,profile:mve};let{title:a}=e,{view:u}=e,{user:f}=e,{data:h}=e,{channel:g}=e;return Qz("channel",g),Qz("user",f),r.$$set=v=>{"title"in v&&t(0,a=v.title),"view"in v&&t(1,u=v.view),"user"in v&&t(4,f=v.user),"data"in v&&t(2,h=v.data),"channel"in v&&t(5,g=v.channel)},[a,u,h,s,f,g]}class bve extends xo{constructor(e){super(),Ao(this,e,pve,gve,Eo,{title:0,view:1,user:4,data:2,channel:5})}}function Die(r){let e,t;return{c(){e=ae("span"),t=Kt(r[4]),U(e,"class","text-muted")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&16&&jn(t,s[4])},d(s){s&&Pe(e)}}}function vve(r){let e,t,s=!1,a,u,f,h,g,v,_,A=r[4]&&Die(r);return g=Toe(r[7][0]),{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("label"),f=Kt(r[1]),h=Ze(),A&&A.c(),U(t,"class","form-check-input"),U(t,"type","radio"),t.__value=r[3],t.value=t.__value,U(t,"name",r[2]),U(t,"id",r[5]),U(u,"class","form-check-label"),U(u,"for",r[5]),U(e,"class","form-check"),g.p(t)},m(O,N){Ie(O,e,N),Y(e,t),t.checked=t.__value===r[0],Y(e,a),Y(e,u),Y(u,f),Y(e,h),A&&A.m(e,null),v||(_=En(t,"change",r[6]),v=!0)},p(O,[N]){N&8&&(t.__value=O[3],t.value=t.__value,s=!0),N&4&&U(t,"name",O[2]),(s||N&1)&&(t.checked=t.__value===O[0]),N&2&&jn(f,O[1]),O[4]?A?A.p(O,N):(A=Die(O),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i:_n,o:_n,d(O){O&&Pe(e),A&&A.d(),g.r(),v=!1,_()}}}function yve(r,e,t){let{label:s}=e,{name:a}=e,{group:u}=e,{value:f}=e,{help:h}=e,g=fd.exports.uniqueId();const v=[[]];function _(){u=this.__value,t(0,u)}return r.$$set=A=>{"label"in A&&t(1,s=A.label),"name"in A&&t(2,a=A.name),"group"in A&&t(0,u=A.group),"value"in A&&t(3,f=A.value),"help"in A&&t(4,h=A.help)},[u,s,a,f,h,g,_,v]}class wve extends xo{constructor(e){super(),Ao(this,e,yve,vve,Eo,{label:1,name:2,group:0,value:3,help:4})}}function Oie(r,e,t){const s=r.slice();return s[5]=e[t],s}function Mie(r){let e,t,s=r[5]+"",a,u,f,h;function g(...v){return r[3](r[5],...v)}return{c(){e=ae("button"),t=Kt("Convert to "),a=Kt(s),u=Ze(),U(e,"class","dropdown-item")},m(v,_){Ie(v,e,_),Y(e,t),Y(e,a),Y(e,u),f||(h=En(e,"click",g),f=!0)},p(v,_){r=v,_&2&&s!==(s=r[5]+"")&&jn(a,s)},d(v){v&&Pe(e),f=!1,h()}}}function Rie(r){let e,t=r[0].role!==r[5]&&Mie(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,a){s[0].role!==s[5]?t?t.p(s,a):(t=Mie(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Pe(e)}}}function _ve(r){var Te;let e,t,s,a,u,f,h,g=r[0].name+"",v,_,A=r[0].email+"",O,N,L,j,z,q,ee=r[0].role+"",F,oe,te,se,X;s=new i2({props:{name:(Te=r[0].name)!=null?Te:"",side:"32"}});let we=r[1],ye=[];for(let _e=0;_e<we.length;_e+=1)ye[_e]=Rie(Oie(r,we,_e));return{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),a=Ze(),u=ae("div"),f=ae("div"),h=ae("span"),v=Kt(g),_=Ze(),O=Kt(A),L=Ze(),j=ae("div"),z=ae("div"),q=ae("button"),F=Kt(ee),oe=Ze(),te=ae("div");for(let _e=0;_e<ye.length;_e+=1)ye[_e].c();U(h,"class","fs-5"),U(u,"class","ms-3 "),U(t,"class",N="d-flex align-items-center status-"+r[0].role+" svelte-1jo1k1d"),U(q,"class","dropdown-toggle btn btn-light"),U(q,"type","button"),U(q,"data-bs-toggle","dropdown"),U(q,"aria-expanded","false"),U(te,"class","dropdown-menu"),U(z,"class","dropdown dropdown-center"),U(e,"class","d-flex justify-content-between align-items-center mb-3 ")},m(_e,ge){Ie(_e,e,ge),Y(e,t),nn(s,t,null),Y(t,a),Y(t,u),Y(u,f),Y(f,h),Y(h,v),Y(u,_),Y(u,O),Y(e,L),Y(e,j),Y(j,z),Y(z,q),Y(q,F),Y(z,oe),Y(z,te);for(let nt=0;nt<ye.length;nt+=1)ye[nt]&&ye[nt].m(te,null);X=!0},p(_e,[ge]){var Je;const nt={};if(ge&1&&(nt.name=(Je=_e[0].name)!=null?Je:""),s.$set(nt),(!X||ge&1)&&g!==(g=_e[0].name+"")&&jn(v,g),(!X||ge&1)&&A!==(A=_e[0].email+"")&&jn(O,A),(!X||ge&1&&N!==(N="d-flex align-items-center status-"+_e[0].role+" svelte-1jo1k1d"))&&U(t,"class",N),(!X||ge&1)&&ee!==(ee=_e[0].role+"")&&jn(F,ee),ge&7){we=_e[1];let ft;for(ft=0;ft<we.length;ft+=1){const V=Oie(_e,we,ft);ye[ft]?ye[ft].p(V,ge):(ye[ft]=Rie(V),ye[ft].c(),ye[ft].m(te,null))}for(;ft<ye.length;ft+=1)ye[ft].d(1);ye.length=we.length}},i(_e){X||(Oe(s.$$.fragment,_e),hk(()=>{!X||(se||(se=eV(e,tV,{duration:200},!0)),se.run(1))}),X=!0)},o(_e){$e(s.$$.fragment,_e),se||(se=eV(e,tV,{duration:200},!1)),se.run(0),X=!1},d(_e){_e&&Pe(e),on(s),Ba(ye,_e),_e&&se&&se.end()}}}function Cve(r,e,t){const s=Ip();let{member:a}=e,{roles:u}=e;function f(g,v){g.preventDefault(),s("update",{user:a.id,role:v})}const h=(g,v)=>f(v,g);return r.$$set=g=>{"member"in g&&t(0,a=g.member),"roles"in g&&t(1,u=g.roles)},[a,u,f,h]}class Sve extends xo{constructor(e){super(),Ao(this,e,Cve,_ve,Eo,{member:0,roles:1})}}function Nie(r,e,t){const s=r.slice();return s[16]=e[t],s}function Pie(r,e,t){const s=r.slice();return s[19]=e[t],s}function Iie(r){let e,t,s;function a(f){r[13](f)}let u={value:r[19],name:"role",label:r[19]};return r[4]!==void 0&&(u.group=r[4]),e=new wve({props:u}),ts.push(()=>gr(e,"group",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&2&&(g.value=f[19]),h&2&&(g.label=f[19]),!t&&h&16&&(t=!0,g.group=f[4],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function Bie(r){let e,t;return e=new Sve({props:{member:r[16],roles:r[1]}}),e.$on("update",r[9]),e.$on("reinvite",r[14]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.member=s[16]),a&2&&(u.roles=s[1]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function kve(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye,Te,_e,ge,nt,Je;u=new sI({props:{message:r[5]}});let ft={};h=new Nhe({props:ft}),r[10](h);let V=r[1].filter(Lie),ut=[];for(let ct=0;ct<V.length;ct+=1)ut[ct]=Iie(Pie(r,V,ct));const et=ct=>$e(ut[ct],1,1,()=>{ut[ct]=null});X=new rI({props:{label:"Invite"}});let Et=r[0],xt=[];for(let ct=0;ct<Et.length;ct+=1)xt[ct]=Bie(Nie(r,Et,ct));const He=ct=>$e(xt[ct],1,1,()=>{xt[ct]=null});return{c(){e=ae("div"),t=ae("div"),s=ae("h3"),s.textContent="Invite people",a=Ze(),sn(u.$$.fragment),f=Ze(),sn(h.$$.fragment),g=Ze(),v=ae("form"),_=ae("div"),A=ae("label"),A.textContent="Invitee Name",O=Ze(),N=ae("input"),L=Ze(),j=ae("div"),z=ae("label"),z.textContent="Invitee Email Address",q=Ze(),ee=ae("input"),F=Ze(),oe=ae("div");for(let ct=0;ct<ut.length;ct+=1)ut[ct].c();te=Ze(),se=ae("div"),sn(X.$$.fragment),we=Ze(),ye=ae("div"),Te=ae("h3"),Te.textContent="Members",_e=Ze();for(let ct=0;ct<xt.length;ct+=1)xt[ct].c();U(s,"class","header-small mb-5"),U(A,"for","inviteeName"),U(A,"class","form-label"),U(N,"type","text"),U(N,"class","form-control"),U(N,"id","inviteeName"),U(N,"placeholder","Member name"),N.required=!0,U(_,"class","mb-3"),U(z,"for","inviteeEmail"),U(z,"class","form-label"),U(ee,"type","email"),U(ee,"class","form-control"),U(ee,"id","inviteeEmail"),U(ee,"placeholder","Member email"),ee.required=!0,U(j,"class","mb-3"),U(oe,"class","me-3"),U(se,"class","mt-5 d-block text-center"),U(t,"class","lx-card mt-5"),U(Te,"class","header-small mb-5"),U(ye,"class","lx-card mt-3"),U(e,"class","wrapper-tiny transparent mb-5")},m(ct,an){Ie(ct,e,an),Y(e,t),Y(t,s),Y(t,a),nn(u,t,null),Y(t,f),nn(h,t,null),Y(t,g),Y(t,v),Y(v,_),Y(_,A),Y(_,O),Y(_,N),_r(N,r[2]),Y(v,L),Y(v,j),Y(j,z),Y(j,q),Y(j,ee),_r(ee,r[3]),Y(v,F),Y(v,oe);for(let kt=0;kt<ut.length;kt+=1)ut[kt]&&ut[kt].m(oe,null);Y(v,te),Y(v,se),nn(X,se,null),Y(e,we),Y(e,ye),Y(ye,Te),Y(ye,_e);for(let kt=0;kt<xt.length;kt+=1)xt[kt]&&xt[kt].m(ye,null);ge=!0,nt||(Je=[En(N,"input",r[11]),En(ee,"input",r[12]),En(v,"submit",r[7])],nt=!0)},p(ct,[an]){const kt={};an&32&&(kt.message=ct[5]),u.$set(kt);const bn={};if(h.$set(bn),an&4&&N.value!==ct[2]&&_r(N,ct[2]),an&8&&ee.value!==ct[3]&&_r(ee,ct[3]),an&18){V=ct[1].filter(Lie);let qe;for(qe=0;qe<V.length;qe+=1){const gt=Pie(ct,V,qe);ut[qe]?(ut[qe].p(gt,an),Oe(ut[qe],1)):(ut[qe]=Iie(gt),ut[qe].c(),Oe(ut[qe],1),ut[qe].m(oe,null))}for(So(),qe=V.length;qe<ut.length;qe+=1)et(qe);ko()}if(an&771){Et=ct[0];let qe;for(qe=0;qe<Et.length;qe+=1){const gt=Nie(ct,Et,qe);xt[qe]?(xt[qe].p(gt,an),Oe(xt[qe],1)):(xt[qe]=Bie(gt),xt[qe].c(),Oe(xt[qe],1),xt[qe].m(ye,null))}for(So(),qe=Et.length;qe<xt.length;qe+=1)He(qe);ko()}},i(ct){if(!ge){Oe(u.$$.fragment,ct),Oe(h.$$.fragment,ct);for(let an=0;an<V.length;an+=1)Oe(ut[an]);Oe(X.$$.fragment,ct);for(let an=0;an<Et.length;an+=1)Oe(xt[an]);ge=!0}},o(ct){$e(u.$$.fragment,ct),$e(h.$$.fragment,ct),ut=ut.filter(Boolean);for(let an=0;an<ut.length;an+=1)$e(ut[an]);$e(X.$$.fragment,ct),xt=xt.filter(Boolean);for(let an=0;an<xt.length;an+=1)$e(xt[an]);ge=!1},d(ct){ct&&Pe(e),on(u),r[10](null),on(h),Ba(ut,ct),on(X),Ba(xt,ct),nt=!1,Bi(Je)}}}const Lie=r=>r!=="removed";function Eve(r,e,t){const s=hi("channel");let{users:a}=e,{roles:u}=e,f,h,g,v="",_;function A(F){F.preventDefault(),O(f,h,g)}function O(F,oe,te){t(5,v=""),axios.post(s.lucentUrl+"/members/invite",{name:F,email:oe,role:te}).then(se=>{_.show("User was invited"),t(0,a=[...a,se.data.user]),t(2,f=null),t(3,h=null),t(4,g=null)}).catch(se=>{var X,we,ye;t(5,v=(ye=(we=(X=se.response)==null?void 0:X.data)==null?void 0:we.error)!=null?ye:"")})}function N(F){F.preventDefault(),t(5,v=""),axios.post(s.lucentUrl+"/members/update",{id:F.detail.user,role:F.detail.role}).then(oe=>{_.show("Users updated"),t(0,a=oe.data.users)}).catch(oe=>{var te,se,X;t(5,v=(X=(se=(te=oe.response)==null?void 0:te.data)==null?void 0:se.error)!=null?X:"")})}function L(F){ts[F?"unshift":"push"](()=>{_=F,t(6,_)})}function j(){f=this.value,t(2,f)}function z(){h=this.value,t(3,h)}function q(F){g=F,t(4,g)}const ee=F=>O(F.detail.email,F.detail.role);return r.$$set=F=>{"users"in F&&t(0,a=F.users),"roles"in F&&t(1,u=F.roles)},[a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee]}class Ave extends xo{constructor(e){super(),Ao(this,e,Eve,kve,Eo,{users:0,roles:1})}}function xve(r){let e;return{c(){e=ae("div"),e.innerHTML='<div class="header-normal">Record Not Found</div>',U(e,"class","wrapper-normal ")},m(t,s){Ie(t,e,s)},p:_n,i:_n,o:_n,d(t){t&&Pe(e)}}}class Tve extends xo{constructor(e){super(),Ao(this,e,null,xve,Eo,{})}}function Dve(r){let e,t=r[5].path+"";return{c(){e=Che("svg"),U(e,"class","bi svelte-1coky4l"),U(e,"xmlns","http://www.w3.org/2000/svg"),U(e,"width",r[0]),U(e,"height",r[1]),U(e,"viewBox",r[5].viewBox),U(e,"aria-labelledby",r[2]),U(e,"role","presentation"),U(e,"stroke",r[4]),U(e,"fill",r[3])},m(s,a){Ie(s,e,a),e.innerHTML=t},p(s,[a]){a&1&&U(e,"width",s[0]),a&2&&U(e,"height",s[1]),a&4&&U(e,"aria-labelledby",s[2]),a&16&&U(e,"stroke",s[4]),a&8&&U(e,"fill",s[3])},i:_n,o:_n,d(s){s&&Pe(e)}}}function Ove(r,e,t){const s={"trash-can":{path:'<path d="M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"/>',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 246.6l-112 112C272.4 364.9 264.2 368 256 368s-16.38-3.125-22.62-9.375l-112-112c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L256 290.8l89.38-89.38c12.5-12.5 32.75-12.5 45.25 0S403.1 234.1 390.6 246.6z"/>',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 310.6c-12.5 12.5-32.75 12.5-45.25 0L256 221.3L166.6 310.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l112-112C239.6 147.1 247.8 144 256 144s16.38 3.125 22.62 9.375l112 112C403.1 277.9 403.1 298.1 390.6 310.6z"/>',viewBox:"0 0 512 512"},ellipsis:{path:'<path d="M120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200C94.93 200 120 225.1 120 256zM280 256C280 286.9 254.9 312 224 312C193.1 312 168 286.9 168 256C168 225.1 193.1 200 224 200C254.9 200 280 225.1 280 256zM328 256C328 225.1 353.1 200 384 200C414.9 200 440 225.1 440 256C440 286.9 414.9 312 384 312C353.1 312 328 286.9 328 256z"/>',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'<path d="M64 360C94.93 360 120 385.1 120 416C120 446.9 94.93 472 64 472C33.07 472 8 446.9 8 416C8 385.1 33.07 360 64 360zM64 200C94.93 200 120 225.1 120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200zM64 152C33.07 152 8 126.9 8 96C8 65.07 33.07 40 64 40C94.93 40 120 65.07 120 96C120 126.9 94.93 152 64 152z"/>',viewBox:"0 0 128 512"},"angles-down":{path:'<path d="M169.4 278.6C175.6 284.9 183.8 288 192 288s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25s-32.75-12.5-45.25 0L192 210.8L54.63 73.38c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25L169.4 278.6zM329.4 265.4L192 402.8L54.63 265.4c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25l160 160C175.6 476.9 183.8 480 192 480s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25S341.9 252.9 329.4 265.4z"/>',viewBox:"0 0 384 512"},"angle-right":{path:'<path d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"/>',viewBox:"0 0 256 512"},"photo-film":{path:'<path d="M352 432c0 8.836-7.164 16-16 16H176c-8.838 0-16-7.164-16-16L160 128H48C21.49 128 .0003 149.5 .0003 176v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48L512 384h-160L352 432zM104 439c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V439zM104 335c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V335zM104 231c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30C56 196 60.03 192 65 192h30c4.969 0 9 4.031 9 9V231zM408 409c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9v30c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9V409zM591.1 0H239.1C213.5 0 191.1 21.49 191.1 48v256c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48v-256C640 21.49 618.5 0 591.1 0zM303.1 64c17.68 0 32 14.33 32 32s-14.32 32-32 32C286.3 128 271.1 113.7 271.1 96S286.3 64 303.1 64zM574.1 279.6C571.3 284.8 565.9 288 560 288H271.1C265.1 288 260.5 284.6 257.7 279.3C255 273.9 255.5 267.4 259.1 262.6l70-96C332.1 162.4 336.9 160 341.1 160c5.11 0 9.914 2.441 12.93 6.574l22.35 30.66l62.74-94.11C442.1 98.67 447.1 96 453.3 96c5.348 0 10.34 2.672 13.31 7.125l106.7 160C576.6 268 576.9 274.3 574.1 279.6z"/>',viewBox:"0 0 640 512"},file:{path:'<path d="M0 64C0 28.65 28.65 0 64 0H224V128C224 145.7 238.3 160 256 160H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM256 128V0L384 128H256z"/>',viewBox:"0 0 384 512"},"circle-info":{path:'<path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"/>',viewBox:"0 0 512 512"},"table-columns":{path:'<path d="M0 96C0 60.65 28.65 32 64 32H448C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96zM64 416H224V160H64V416zM448 160H288V416H448V160z"/>',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'<path d="M239.6 373.1c11.94-13.05 11.06-33.31-1.969-45.27c-13.55-12.42-33.76-10.52-45.22 1.973L160 366.1V64.03c0-17.7-14.33-32.03-32-32.03S96 46.33 96 64.03v302l-32.4-35.39C51.64 317.7 31.39 316.7 18.38 328.7c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0L239.6 373.1zM448 416h-50.75l73.38-73.38c9.156-9.156 11.89-22.91 6.938-34.88S460.9 288 447.1 288H319.1C302.3 288 288 302.3 288 320s14.33 32 32 32h50.75l-73.38 73.38c-9.156 9.156-11.89 22.91-6.938 34.88S307.1 480 319.1 480h127.1C465.7 480 480 465.7 480 448S465.7 416 448 416zM492.6 209.3l-79.99-160.1c-10.84-21.81-46.4-21.81-57.24 0L275.4 209.3c-7.906 15.91-1.5 35.24 14.31 43.19c15.87 7.922 35.04 1.477 42.93-14.4l7.154-14.39h88.43l7.154 14.39c6.174 12.43 23.97 23.87 42.93 14.4C494.1 244.6 500.5 225.2 492.6 209.3zM367.8 167.4L384 134.7l16.22 32.63H367.8z"/>',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'<path d="M544 416h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 416 544 416zM320 96h32c17.67 0 31.1-14.33 31.1-32s-14.33-32-31.1-32h-32c-17.67 0-32 14.33-32 32S302.3 96 320 96zM320 224H416c17.67 0 32-14.33 32-32s-14.33-32-32-32h-95.1c-17.67 0-32 14.33-32 32S302.3 224 320 224zM320 352H480c17.67 0 32-14.33 32-32s-14.33-32-32-32h-159.1c-17.67 0-32 14.33-32 32S302.3 352 320 352zM151.6 41.95c-12.12-13.26-35.06-13.26-47.19 0l-87.1 96.09C4.475 151.1 5.35 171.4 18.38 183.3c6.141 5.629 13.89 8.414 21.61 8.414c8.672 0 17.3-3.504 23.61-10.39L96 145.9v302C96 465.7 110.3 480 128 480s32-14.33 32-32.03V145.9L192.4 181.3C204.4 194.3 224.6 195.3 237.6 183.3c13.03-11.95 13.9-32.22 1.969-45.27L151.6 41.95z"/>',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'<path d="M416 288h-95.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H416c17.67 0 32-14.33 32-32S433.7 288 416 288zM544 32h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 32 544 32zM352 416h-32c-17.67 0-32 14.33-32 32s14.33 32 32 32h32c17.67 0 31.1-14.33 31.1-32S369.7 416 352 416zM480 160h-159.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H480c17.67 0 32-14.33 32-32S497.7 160 480 160zM192.4 330.7L160 366.1V64.03C160 46.33 145.7 32 128 32S96 46.33 96 64.03v302L63.6 330.7c-6.312-6.883-14.94-10.38-23.61-10.38c-7.719 0-15.47 2.781-21.61 8.414c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0l87.1-96.09c11.94-13.05 11.06-33.31-1.969-45.27C224.6 316.8 204.4 317.7 192.4 330.7z"/>',viewBox:"0 0 576 512"},filter:{path:'<path d="M3.853 54.87C10.47 40.9 24.54 32 40 32H472C487.5 32 501.5 40.9 508.1 54.87C514.8 68.84 512.7 85.37 502.1 97.33L320 320.9V448C320 460.1 313.2 471.2 302.3 476.6C291.5 482 278.5 480.9 268.8 473.6L204.8 425.6C196.7 419.6 192 410.1 192 400V320.9L9.042 97.33C-.745 85.37-2.765 68.84 3.854 54.87L3.853 54.87z"/>',viewBox:"0 0 512 512"},calendar:{path:'<path d="M96 32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32zM448 464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192H448V464z"/>',viewBox:"0 0 448 512"},pencil:{path:'<path d="M421.7 220.3L188.5 453.4L154.6 419.5L158.1 416H112C103.2 416 96 408.8 96 400V353.9L92.51 357.4C87.78 362.2 84.31 368 82.42 374.4L59.44 452.6L137.6 429.6C143.1 427.7 149.8 424.2 154.6 419.5L188.5 453.4C178.1 463.8 165.2 471.5 151.1 475.6L30.77 511C22.35 513.5 13.24 511.2 7.03 504.1C.8198 498.8-1.502 489.7 .976 481.2L36.37 360.9C40.53 346.8 48.16 333.9 58.57 323.5L291.7 90.34L421.7 220.3zM492.7 58.75C517.7 83.74 517.7 124.3 492.7 149.3L444.3 197.7L314.3 67.72L362.7 19.32C387.7-5.678 428.3-5.678 453.3 19.32L492.7 58.75z"/>',viewBox:"0 0 512 512"},database:{path:'<path d="M448 80V128C448 172.2 347.7 208 224 208C100.3 208 0 172.2 0 128V80C0 35.82 100.3 0 224 0C347.7 0 448 35.82 448 80zM393.2 214.7C413.1 207.3 433.1 197.8 448 186.1V288C448 332.2 347.7 368 224 368C100.3 368 0 332.2 0 288V186.1C14.93 197.8 34.02 207.3 54.85 214.7C99.66 230.7 159.5 240 224 240C288.5 240 348.3 230.7 393.2 214.7V214.7zM54.85 374.7C99.66 390.7 159.5 400 224 400C288.5 400 348.3 390.7 393.2 374.7C413.1 367.3 433.1 357.8 448 346.1V432C448 476.2 347.7 512 224 512C100.3 512 0 476.2 0 432V346.1C14.93 357.8 34.02 367.3 54.85 374.7z"/>',viewBox:"0 0 448 512"},dice:{path:'<path d="M447.1 224c0-12.56-4.781-25.13-14.35-34.76l-174.9-174.9C249.1 4.786 236.5 0 223.1 0C211.4 0 198.9 4.786 189.2 14.35L14.35 189.2C4.783 198.9-.0011 211.4-.0011 223.1c0 12.56 4.785 25.17 14.35 34.8l174.9 174.9c9.625 9.562 22.19 14.35 34.75 14.35s25.13-4.783 34.75-14.35l174.9-174.9C443.2 249.1 447.1 236.6 447.1 224zM96 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S120 210.8 120 224S109.3 248 96 248zM224 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 376 224 376zM224 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S248 210.8 248 224S237.3 248 224 248zM224 120c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 120 224 120zM352 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S365.3 248 352 248zM591.1 192l-118.7 0c4.418 10.27 6.604 21.25 6.604 32.23c0 20.7-7.865 41.38-23.63 57.14l-136.2 136.2v46.37C320 490.5 341.5 512 368 512h223.1c26.5 0 47.1-21.5 47.1-47.1V240C639.1 213.5 618.5 192 591.1 192zM479.1 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S493.2 376 479.1 376z"/>',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'<path d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z"/>',viewBox:"0 0 512 512"},eye:{path:'<path d="M279.6 160.4C282.4 160.1 285.2 160 288 160C341 160 384 202.1 384 256C384 309 341 352 288 352C234.1 352 192 309 192 256C192 253.2 192.1 250.4 192.4 247.6C201.7 252.1 212.5 256 224 256C259.3 256 288 227.3 288 192C288 180.5 284.1 169.7 279.6 160.4zM480.6 112.6C527.4 156 558.7 207.1 573.5 243.7C576.8 251.6 576.8 260.4 573.5 268.3C558.7 304 527.4 355.1 480.6 399.4C433.5 443.2 368.8 480 288 480C207.2 480 142.5 443.2 95.42 399.4C48.62 355.1 17.34 304 2.461 268.3C-.8205 260.4-.8205 251.6 2.461 243.7C17.34 207.1 48.62 156 95.42 112.6C142.5 68.84 207.2 32 288 32C368.8 32 433.5 68.84 480.6 112.6V112.6zM288 112C208.5 112 144 176.5 144 256C144 335.5 208.5 400 288 400C367.5 400 432 335.5 432 256C432 176.5 367.5 112 288 112z"/>',viewBox:"0 0 576 512"},"circle-plus":{path:'<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/>',viewBox:"0 0 512 512"},"magnifying-glass":{path:'<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/>',viewBox:"0 0 512 512"},expand:{path:'<path d="M128 32H32C14.31 32 0 46.31 0 64v96c0 17.69 14.31 32 32 32s32-14.31 32-32V96h64c17.69 0 32-14.31 32-32S145.7 32 128 32zM416 32h-96c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32V64C448 46.31 433.7 32 416 32zM128 416H64v-64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96c0 17.69 14.31 32 32 32h96c17.69 0 32-14.31 32-32S145.7 416 128 416zM416 320c-17.69 0-32 14.31-32 32v64h-64c-17.69 0-32 14.31-32 32s14.31 32 32 32h96c17.69 0 32-14.31 32-32v-96C448 334.3 433.7 320 416 320z"/>',viewBox:"0 0 448 512"},compress:{path:'<path d="M128 320H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32v-96C160 334.3 145.7 320 128 320zM416 320h-96c-17.69 0-32 14.31-32 32v96c0 17.69 14.31 32 32 32s32-14.31 32-32v-64h64c17.69 0 32-14.31 32-32S433.7 320 416 320zM320 192h96c17.69 0 32-14.31 32-32s-14.31-32-32-32h-64V64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96C288 177.7 302.3 192 320 192zM128 32C110.3 32 96 46.31 96 64v64H32C14.31 128 0 142.3 0 160s14.31 32 32 32h96c17.69 0 32-14.31 32-32V64C160 46.31 145.7 32 128 32z"/>',viewBox:"0 0 448 512"},check:{path:'<path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/>',viewBox:"0 0 448 512"}};let{width:a=16}=e,{height:u=16}=e,{icon:f=""}=e,{fill:h="currentColor"}=e,{stroke:g="currentColor"}=e,v=s[f];return r.$$set=_=>{"width"in _&&t(0,a=_.width),"height"in _&&t(1,u=_.height),"icon"in _&&t(2,f=_.icon),"fill"in _&&t(3,h=_.fill),"stroke"in _&&t(4,g=_.stroke)},[a,u,f,h,g,v]}class fl extends xo{constructor(e){super(),Ao(this,e,Ove,Dve,Eo,{width:0,height:1,icon:2,fill:3,stroke:4})}}/*!
|
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
* http://github.com/janl/mustache.js
|
|
*/var Mve=Object.prototype.toString,vO=Array.isArray||function(e){return Mve.call(e)==="[object Array]"};function Doe(r){return typeof r=="function"}function Rve(r){return vO(r)?"array":typeof r}function ate(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Fie(r,e){return r!=null&&typeof r=="object"&&e in r}function Nve(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var Pve=RegExp.prototype.test;function Ive(r,e){return Pve.call(r,e)}var Bve=/\S/;function Lve(r){return!Ive(Bve,r)}var Fve={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Hve(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return Fve[t]})}var $ve=/\s*/,zve=/\s+/,Hie=/\s*=/,Vve=/\s*\}/,Uve=/#|\^|\/|>|\{|&|=|!/;function Wve(r,e){if(!r)return[];var t=!1,s=[],a=[],u=[],f=!1,h=!1,g="",v=0;function _(){if(f&&!h)for(;u.length;)delete a[u.pop()];else u=[];f=!1,h=!1}var A,O,N;function L(we){if(typeof we=="string"&&(we=we.split(zve,2)),!vO(we)||we.length!==2)throw new Error("Invalid tags: "+we);A=new RegExp(ate(we[0])+"\\s*"),O=new RegExp("\\s*"+ate(we[1])),N=new RegExp("\\s*"+ate("}"+we[1]))}L(e||Rp.tags);for(var j=new iI(r),z,q,ee,F,oe,te;!j.eos();){if(z=j.pos,ee=j.scanUntil(A),ee)for(var se=0,X=ee.length;se<X;++se)F=ee.charAt(se),Lve(F)?(u.push(a.length),g+=F):(h=!0,t=!0,g+=" "),a.push(["text",F,z,z+1]),z+=1,F===`
|
|
`&&(_(),g="",v=0,t=!1);if(!j.scan(A))break;if(f=!0,q=j.scan(Uve)||"name",j.scan($ve),q==="="?(ee=j.scanUntil(Hie),j.scan(Hie),j.scanUntil(O)):q==="{"?(ee=j.scanUntil(N),j.scan(Vve),j.scanUntil(O),q="&"):ee=j.scanUntil(O),!j.scan(O))throw new Error("Unclosed tag at "+j.pos);if(q==">"?oe=[q,ee,z,j.pos,g,v,t]:oe=[q,ee,z,j.pos],v++,a.push(oe),q==="#"||q==="^")s.push(oe);else if(q==="/"){if(te=s.pop(),!te)throw new Error('Unopened section "'+ee+'" at '+z);if(te[1]!==ee)throw new Error('Unclosed section "'+te[1]+'" at '+z)}else q==="name"||q==="{"||q==="&"?h=!0:q==="="&&L(ee)}if(_(),te=s.pop(),te)throw new Error('Unclosed section "'+te[1]+'" at '+j.pos);return Zve(jve(a))}function jve(r){for(var e=[],t,s,a=0,u=r.length;a<u;++a)t=r[a],t&&(t[0]==="text"&&s&&s[0]==="text"?(s[1]+=t[1],s[3]=t[3]):(e.push(t),s=t));return e}function Zve(r){for(var e=[],t=e,s=[],a,u,f=0,h=r.length;f<h;++f)switch(a=r[f],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":u=s.pop(),u[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function iI(r){this.string=r,this.tail=r,this.pos=0}iI.prototype.eos=function(){return this.tail===""};iI.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};iI.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function oO(r,e){this.view=r,this.cache={".":this.view},this.parent=e}oO.prototype.push=function(e){return new oO(e,this)};oO.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,u,f,h,g=!1;a;){if(e.indexOf(".")>0)for(u=a.view,f=e.split("."),h=0;u!=null&&h<f.length;)h===f.length-1&&(g=Fie(u,f[h])||Nve(u,f[h])),u=u[f[h++]];else u=a.view[e],g=Fie(a.view,e);if(g){s=u;break}a=a.parent}t[e]=s}return Doe(s)&&(s=s.call(this.view)),s};function Mg(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Mg.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Mg.prototype.parse=function(e,t){var s=this.templateCache,a=e+":"+(t||Rp.tags).join(":"),u=typeof s<"u",f=u?s.get(a):void 0;return f==null&&(f=Wve(e,t),u&&s.set(a,f)),f};Mg.prototype.render=function(e,t,s,a){var u=this.getConfigTags(a),f=this.parse(e,u),h=t instanceof oO?t:new oO(t,void 0);return this.renderTokens(f,h,s,e,a)};Mg.prototype.renderTokens=function(e,t,s,a,u){for(var f="",h,g,v,_=0,A=e.length;_<A;++_)v=void 0,h=e[_],g=h[0],g==="#"?v=this.renderSection(h,t,s,a,u):g==="^"?v=this.renderInverted(h,t,s,a,u):g===">"?v=this.renderPartial(h,t,s,u):g==="&"?v=this.unescapedValue(h,t):g==="name"?v=this.escapedValue(h,t,u):g==="text"&&(v=this.rawValue(h)),v!==void 0&&(f+=v);return f};Mg.prototype.renderSection=function(e,t,s,a,u){var f=this,h="",g=t.lookup(e[1]);function v(O){return f.render(O,t,s,u)}if(!!g){if(vO(g))for(var _=0,A=g.length;_<A;++_)h+=this.renderTokens(e[4],t.push(g[_]),s,a,u);else if(typeof g=="object"||typeof g=="string"||typeof g=="number")h+=this.renderTokens(e[4],t.push(g),s,a,u);else if(Doe(g)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");g=g.call(t.view,a.slice(e[3],e[5]),v),g!=null&&(h+=g)}else h+=this.renderTokens(e[4],t,s,a,u);return h}};Mg.prototype.renderInverted=function(e,t,s,a,u){var f=t.lookup(e[1]);if(!f||vO(f)&&f.length===0)return this.renderTokens(e[4],t,s,a,u)};Mg.prototype.indentPartial=function(e,t,s){for(var a=t.replace(/[^ \t]/g,""),u=e.split(`
|
|
`),f=0;f<u.length;f++)u[f].length&&(f>0||!s)&&(u[f]=a+u[f]);return u.join(`
|
|
`)};Mg.prototype.renderPartial=function(e,t,s,a){if(!!s){var u=this.getConfigTags(a),f=Doe(s)?s(e[1]):s[e[1]];if(f!=null){var h=e[6],g=e[5],v=e[4],_=f;g==0&&v&&(_=this.indentPartial(f,v,h));var A=this.parse(_,u);return this.renderTokens(A,t,s,_,a)}}};Mg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Mg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Rp.escape,u=t.lookup(e[1]);if(u!=null)return typeof u=="number"&&a===Rp.escape?String(u):a(u)};Mg.prototype.rawValue=function(e){return e[1]};Mg.prototype.getConfigTags=function(e){return vO(e)?e:e&&typeof e=="object"?e.tags:void 0};Mg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!vO(e))return e.escape};var Rp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){BP.templateCache=r},get templateCache(){return BP.templateCache}},BP=new Mg;Rp.clearCache=function(){return BP.clearCache()};Rp.parse=function(e,t){return BP.parse(e,t)};Rp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Rve(e)+'" was given as the first argument for mustache#render(template, view, partials)');return BP.render(e,t,s,a)};Rp.escape=Hve;Rp.Scanner=iI;Rp.Context=oO;Rp.Writer=Mg;function bne(r){return bne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bne(r)}function $0(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}function Hh(r){$0(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||bne(r)==="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var qve={};function Gve(){return qve}function $ie(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}function Oz(r,e){$0(2,arguments);var t=Hh(r),s=Hh(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function Kve(r,e){$0(2,arguments);var t=Hh(r),s=Hh(e),a=t.getFullYear()-s.getFullYear(),u=t.getMonth()-s.getMonth();return a*12+u}function Yve(r,e){return $0(2,arguments),Hh(r).getTime()-Hh(e).getTime()}var zie={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Xve="trunc";function Jve(r){return r?zie[r]:zie[Xve]}function Qve(r){$0(1,arguments);var e=Hh(r);return e.setHours(23,59,59,999),e}function eye(r){$0(1,arguments);var e=Hh(r),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function tye(r){$0(1,arguments);var e=Hh(r);return Qve(e).getTime()===eye(e).getTime()}function nye(r,e){$0(2,arguments);var t=Hh(r),s=Hh(e),a=Oz(t,s),u=Math.abs(Kve(t,s)),f;if(u<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*u);var h=Oz(t,s)===-a;tye(Hh(r))&&u===1&&Oz(r,s)===1&&(h=!1),f=a*(u-Number(h))}return f===0?0:f}function oye(r,e,t){$0(2,arguments);var s=Yve(r,e)/1e3;return Jve(t==null?void 0:t.roundingMethod)(s)}var sye={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rye=function(e,t,s){var a,u=sye[e];return typeof u=="string"?a=u:t===1?a=u.one:a=u.other.replace("{{count}}",t.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+a:a+" ago":a};const iye=rye;function lte(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,s=r.formats[t]||r.formats[r.defaultWidth];return s}}var aye={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lye={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uye={date:lte({formats:aye,defaultWidth:"full"}),time:lte({formats:lye,defaultWidth:"full"}),dateTime:lte({formats:cye,defaultWidth:"full"})};const fye=uye;var dye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hye=function(e,t,s,a){return dye[e]};const mye=hye;function rP(r){return function(e,t){var s=t!=null&&t.context?String(t.context):"standalone",a;if(s==="formatting"&&r.formattingValues){var u=r.defaultFormattingWidth||r.defaultWidth,f=t!=null&&t.width?String(t.width):u;a=r.formattingValues[f]||r.formattingValues[u]}else{var h=r.defaultWidth,g=t!=null&&t.width?String(t.width):r.defaultWidth;a=r.values[g]||r.values[h]}var v=r.argumentCallback?r.argumentCallback(e):e;return a[v]}}var gye={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pye={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bye={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vye={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yye={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wye={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},_ye=function(e,t){var s=Number(e),a=s%100;if(a>20||a<10)switch(a%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Cye={ordinalNumber:_ye,era:rP({values:gye,defaultWidth:"wide"}),quarter:rP({values:pye,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:rP({values:bye,defaultWidth:"wide"}),day:rP({values:vye,defaultWidth:"wide"}),dayPeriod:rP({values:yye,defaultWidth:"wide",formattingValues:wye,defaultFormattingWidth:"wide"})};const Sye=Cye;function iP(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.width,a=s&&r.matchPatterns[s]||r.matchPatterns[r.defaultMatchWidth],u=e.match(a);if(!u)return null;var f=u[0],h=s&&r.parsePatterns[s]||r.parsePatterns[r.defaultParseWidth],g=Array.isArray(h)?Eye(h,function(A){return A.test(f)}):kye(h,function(A){return A.test(f)}),v;v=r.valueCallback?r.valueCallback(g):g,v=t.valueCallback?t.valueCallback(v):v;var _=e.slice(f.length);return{value:v,rest:_}}}function kye(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}function Eye(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}function Aye(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=e.match(r.matchPattern);if(!s)return null;var a=s[0],u=e.match(r.parsePattern);if(!u)return null;var f=r.valueCallback?r.valueCallback(u[0]):u[0];f=t.valueCallback?t.valueCallback(f):f;var h=e.slice(a.length);return{value:f,rest:h}}}var xye=/^(\d+)(th|st|nd|rd)?/i,Tye=/\d+/i,Dye={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Oye={any:[/^b/i,/^(a|c)/i]},Mye={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rye={any:[/1/i,/2/i,/3/i,/4/i]},Nye={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Pye={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Iye={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Bye={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Lye={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Fye={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Hye={ordinalNumber:Aye({matchPattern:xye,parsePattern:Tye,valueCallback:function(e){return parseInt(e,10)}}),era:iP({matchPatterns:Dye,defaultMatchWidth:"wide",parsePatterns:Oye,defaultParseWidth:"any"}),quarter:iP({matchPatterns:Mye,defaultMatchWidth:"wide",parsePatterns:Rye,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:iP({matchPatterns:Nye,defaultMatchWidth:"wide",parsePatterns:Pye,defaultParseWidth:"any"}),day:iP({matchPatterns:Iye,defaultMatchWidth:"wide",parsePatterns:Bye,defaultParseWidth:"any"}),dayPeriod:iP({matchPatterns:Lye,defaultMatchWidth:"any",parsePatterns:Fye,defaultParseWidth:"any"})};const $ye=Hye;var zye={code:"en-US",formatDistance:iye,formatLong:fye,formatRelative:mye,localize:Sye,match:$ye,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Vye=zye;function Phe(r,e){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}function Uye(r){return Phe({},r)}var Vie=1440,Wye=2520,cte=43200,jye=86400;function Zye(r,e,t){var s,a;$0(2,arguments);var u=Gve(),f=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:u.locale)!==null&&s!==void 0?s:Vye;if(!f.formatDistance)throw new RangeError("locale must contain formatDistance property");var h=Oz(r,e);if(isNaN(h))throw new RangeError("Invalid time value");var g=Phe(Uye(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:h}),v,_;h>0?(v=Hh(e),_=Hh(r)):(v=Hh(r),_=Hh(e));var A=oye(_,v),O=($ie(_)-$ie(v))/1e3,N=Math.round((A-O)/60),L;if(N<2)return t!=null&&t.includeSeconds?A<5?f.formatDistance("lessThanXSeconds",5,g):A<10?f.formatDistance("lessThanXSeconds",10,g):A<20?f.formatDistance("lessThanXSeconds",20,g):A<40?f.formatDistance("halfAMinute",0,g):A<60?f.formatDistance("lessThanXMinutes",1,g):f.formatDistance("xMinutes",1,g):N===0?f.formatDistance("lessThanXMinutes",1,g):f.formatDistance("xMinutes",N,g);if(N<45)return f.formatDistance("xMinutes",N,g);if(N<90)return f.formatDistance("aboutXHours",1,g);if(N<Vie){var j=Math.round(N/60);return f.formatDistance("aboutXHours",j,g)}else{if(N<Wye)return f.formatDistance("xDays",1,g);if(N<cte){var z=Math.round(N/Vie);return f.formatDistance("xDays",z,g)}else if(N<jye)return L=Math.round(N/cte),f.formatDistance("aboutXMonths",L,g)}if(L=nye(_,v),L<12){var q=Math.round(N/cte);return f.formatDistance("xMonths",q,g)}else{var ee=L%12,F=Math.floor(L/12);return ee<3?f.formatDistance("aboutXYears",F,g):ee<9?f.formatDistance("overXYears",F,g):f.formatDistance("almostXYears",F+1,g)}}function Ihe(r,e){return $0(1,arguments),Zye(r,Date.now(),e)}function Bhe(r){if($0(1,arguments),typeof r=="string"){var e=r.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return e?new Date(Date.UTC(+e[1],+e[2]-1,+e[3],+e[4]-(+e[9]||0)*(e[8]=="-"?-1:1),+e[5]-(+e[10]||0)*(e[8]=="-"?-1:1),+e[6],+((e[7]||"0")+"00").substring(0,3))):new Date(NaN)}return Hh(r)}function Qy(r){return Ihe(Bhe(r),{addSuffix:!0})}function Lhe(r=""){let e=document.createElement("div");return e.innerHTML=r,e.textContent||e.innerText||""}function Uie(r=10){return Math.random().toString(36).substring(2,r+2)}function dd(r,e,t){let s=r.find(g=>g.name===(e==null?void 0:e.schema));if(!(s!=null&&s.titleTemplate))return Wie(s,e);let a=e.data,f=Rp.parse(s.titleTemplate).filter(g=>g[0]=="name").map(g=>g[1]).filter(g=>{let v=s.fields.find(_=>_.name===g);return(v==null?void 0:v.info.name)==="reference"}).reduce((g,v)=>{let _=t.edges.find(O=>O.source===e.id&&O.field===v),A=t.records.find(O=>O.id===(_==null?void 0:_.target));return g[v]=dd(r,A,t),g},{});a={...a,...f};let h=Rp.render(s.titleTemplate,a);return!h||h===""?Wie(s,e):Lhe(h.slice(0,300))}function Wie(r,e){var t;return(r==null?void 0:r.type)==="files"?e._file.path:Lhe(e==null?void 0:e.data[(t=r.fields.filter(s=>s.info.name==="text")[0])==null?void 0:t.name]).slice(0,300)}function jie(r){let e,t,s;return{c(){e=ae("a"),t=Kt(r[1]),U(e,"href",s=r[3].lucentUrl+"/records/"+r[0].id),U(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),U(e,"title",r[1]),ss(e,"border","2px solid "+(r[2].color?r[2].color:"#999"),1),ss(e,"white-space","nowrap")},m(a,u){Ie(a,e,u),Y(e,t)},p(a,u){u&2&&jn(t,a[1]),u&1&&s!==(s=a[3].lucentUrl+"/records/"+a[0].id)&&U(e,"href",s),u&2&&U(e,"title",a[1]),u&4&&ss(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&Pe(e)}}}function qye(r){var s;let e,t=((s=r[0])==null?void 0:s.data)&&jie(r);return{c(){t&&t.c(),e=Bs()},m(a,u){t&&t.m(a,u),Ie(a,e,u)},p(a,[u]){var f;(f=a[0])!=null&&f.data?t?t.p(a,u):(t=jie(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(a){t&&t.d(a),a&&Pe(e)}}}function Gye(r,e,t){let s,a;const u=hi("channel");let{record:f}=e,{graph:h}=e;return r.$$set=g=>{"record"in g&&t(0,f=g.record),"graph"in g&&t(4,h=g.graph)},r.$$.update=()=>{r.$$.dirty&1&&t(2,s=u.schemas.find(g=>g.name===f.schema)),r.$$.dirty&17&&t(1,a=dd(u.schemas,f,h))},[f,a,s,u,h]}class aI extends xo{constructor(e){super(),Ao(this,e,Gye,qye,Eo,{record:0,graph:4})}}function Zie(r,e,t){const s=r.slice();return s[2]=e[t],s[4]=t,s}function qie(r){let e,t,s=r[0].reverse(),a=[];for(let f=0;f<s.length;f+=1)a[f]=Gie(Zie(r,s,f));const u=f=>$e(a[f],1,1,()=>{a[f]=null});return{c(){e=ae("div");for(let f=0;f<a.length;f+=1)a[f].c();U(e,"class","record-history d-flex justify-content-center align-items-center w-100 mb-4 mt-4 svelte-eatzsz")},m(f,h){Ie(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&3){s=f[0].reverse();let g;for(g=0;g<s.length;g+=1){const v=Zie(f,s,g);a[g]?(a[g].p(v,h),Oe(a[g],1)):(a[g]=Gie(v),a[g].c(),Oe(a[g],1),a[g].m(e,null))}for(So(),g=s.length;g<a.length;g+=1)u(g);ko()}},i(f){if(!t){for(let h=0;h<s.length;h+=1)Oe(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)$e(a[h]);t=!1},d(f){f&&Pe(e),Ba(a,f)}}}function Kye(r){let e,t;return e=new fl({props:{icon:"angle-right"}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Gie(r){let e,t,s,a,u,f=r[4]!==0&&Kye();return s=new aI({props:{record:r[2],graph:r[1]}}),{c(){f&&f.c(),e=Ze(),t=ae("div"),sn(s.$$.fragment),a=Ze(),U(t,"class","mx-3 p-0 my-0")},m(h,g){f&&f.m(h,g),Ie(h,e,g),Ie(h,t,g),nn(s,t,null),Y(t,a),u=!0},p(h,g){const v={};g&1&&(v.record=h[2]),g&2&&(v.graph=h[1]),s.$set(v)},i(h){u||(Oe(f),Oe(s.$$.fragment,h),u=!0)},o(h){$e(f),$e(s.$$.fragment,h),u=!1},d(h){f&&f.d(h),h&&Pe(e),h&&Pe(t),on(s)}}}function Yye(r){let e,t,s=r[0].length>0&&qie(r);return{c(){s&&s.c(),e=Bs()},m(a,u){s&&s.m(a,u),Ie(a,e,u),t=!0},p(a,[u]){a[0].length>0?s?(s.p(a,u),u&1&&Oe(s,1)):(s=qie(a),s.c(),Oe(s,1),s.m(e.parentNode,e)):s&&(So(),$e(s,1,1,()=>{s=null}),ko())},i(a){t||(Oe(s),t=!0)},o(a){$e(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function Xye(r,e,t){let{managerRecords:s}=e,{graph:a}=e;return r.$$set=u=>{"managerRecords"in u&&t(0,s=u.managerRecords),"graph"in u&&t(1,a=u.graph)},[s,a]}class Jye extends xo{constructor(e){super(),Ao(this,e,Xye,Yye,Eo,{managerRecords:0,graph:1})}}function Qye(r){let e;return{c(){e=Kt("New Record")},m(t,s){Ie(t,e,s)},p:_n,d(t){t&&Pe(e)}}}function e2e(r){let e=dd(r[5].schemas,r[3],r[2])+"",t;return{c(){t=Kt(e)},m(s,a){Ie(s,t,a)},p(s,a){a&12&&e!==(e=dd(s[5].schemas,s[3],s[2])+"")&&jn(t,e)},d(s){s&&Pe(t)}}}function Kie(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q;s=new fl({props:{icon:"ellipsis"}});let ee=!r[4]&&Yie(r);return{c(){e=ae("div"),t=ae("button"),sn(s.$$.fragment),a=Ze(),u=ae("div"),f=ae("h6"),f.textContent="Record Actions",h=Ze(),g=ae("a"),v=Kt("Create new"),A=Ze(),ee&&ee.c(),O=Ze(),N=ae("a"),L=Kt("Revisions"),U(t,"class","btn btn-link btn-sm"),U(t,"type","button"),U(t,"data-bs-toggle","dropdown"),U(t,"aria-expanded","false"),U(f,"class","dropdown-header"),U(g,"class","dropdown-item"),U(g,"href",_=r[5].lucentUrl+"/records/new?schema="+r[1].name),U(N,"class","dropdown-item"),U(N,"href",r[5].lucentUrl),U(u,"class","dropdown-menu"),U(e,"class","dropdown d-inline-block")},m(F,oe){Ie(F,e,oe),Y(e,t),nn(s,t,null),Y(e,a),Y(e,u),Y(u,f),Y(u,h),Y(u,g),Y(g,v),Y(u,A),ee&&ee.m(u,null),Y(u,O),Y(u,N),Y(N,L),j=!0,z||(q=En(N,"click",Hu(r[7])),z=!0)},p(F,oe){(!j||oe&2&&_!==(_=F[5].lucentUrl+"/records/new?schema="+F[1].name))&&U(g,"href",_),F[4]?ee&&(ee.d(1),ee=null):ee?ee.p(F,oe):(ee=Yie(F),ee.c(),ee.m(u,O))},i(F){j||(Oe(s.$$.fragment,F),j=!0)},o(F){$e(s.$$.fragment,F),j=!1},d(F){F&&Pe(e),on(s),ee&&ee.d(),z=!1,q()}}}function Yie(r){let e,t,s,a;return{c(){e=ae("a"),t=Kt("Clone"),U(e,"class","dropdown-item"),U(e,"href",r[5].lucentUrl)},m(u,f){Ie(u,e,f),Y(e,t),s||(a=En(e,"click",r[6]),s=!0)},p:_n,d(u){u&&Pe(e),s=!1,a()}}}function t2e(r){let e,t,s=r[1].label.toUpperCase()+"",a,u,f,h,g,v;function _(L,j){return L[4]?Qye:e2e}let A=_(r),O=A(r),N=!r[4]&&Kie(r);return{c(){e=ae("h3"),t=ae("a"),a=Kt(s),f=Ze(),h=ae("span"),O.c(),g=Ze(),N&&N.c(),U(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),U(t,"href",u=r[5].lucentUrl+"/content/"+r[1].name),U(h,"class","text-dark d-block"),U(e,"class","header-normal mt-5 mb-0")},m(L,j){Ie(L,e,j),Y(e,t),Y(t,a),Y(e,f),Y(e,h),O.m(h,null),Y(e,g),N&&N.m(e,null),v=!0},p(L,[j]){(!v||j&2)&&s!==(s=L[1].label.toUpperCase()+"")&&jn(a,s),(!v||j&2&&u!==(u=L[5].lucentUrl+"/content/"+L[1].name))&&U(t,"href",u),A===(A=_(L))&&O?O.p(L,j):(O.d(1),O=A(L),O&&(O.c(),O.m(h,null))),L[4]?N&&(So(),$e(N,1,1,()=>{N=null}),ko()):N?(N.p(L,j),j&16&&Oe(N,1)):(N=Kie(L),N.c(),Oe(N,1),N.m(e,null))},i(L){v||(Oe(N),v=!0)},o(L){$e(N),v=!1},d(L){L&&Pe(e),O.d(),N&&N.d()}}}function n2e(r,e,t){const s=hi("channel");let{schema:a}=e,{graph:u}=e,{record:f}=e,{isCreateMode:h}=e,{activeContentTab:g}=e;function v(A){A.preventDefault(),axios.post(s.lucentUrl+"/records/clone/"+f.id).then(O=>{window.location=s.lucentUrl+"/records/"+O.data.id}).catch(O=>{})}const _=A=>t(0,g="_info");return r.$$set=A=>{"schema"in A&&t(1,a=A.schema),"graph"in A&&t(2,u=A.graph),"record"in A&&t(3,f=A.record),"isCreateMode"in A&&t(4,h=A.isCreateMode),"activeContentTab"in A&&t(0,g=A.activeContentTab)},[g,a,u,f,h,s,v,_]}class o2e extends xo{constructor(e){super(),Ao(this,e,n2e,t2e,Eo,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function Fhe(r){return Hhe()[r]}function Hhe(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function s2e(r){let e,t=r[0].text+"",s;return{c(){e=ae("span"),s=Kt(t),U(e,"class","badge text-bg-"+r[0].bg),ss(e,"max-width","84px")},m(a,u){Ie(a,e,u),Y(e,s)},p:_n,i:_n,o:_n,d(a){a&&Pe(e)}}}function r2e(r,e,t){let{status:s}=e,a=Fhe(s);return r.$$set=u=>{"status"in u&&t(1,s=u.status)},[a,s]}class jV extends xo{constructor(e){super(),Ao(this,e,r2e,s2e,Eo,{status:1})}}function Xie(r,e,t){const s=r.slice();return s[10]=e[t],s}function Jie(r){let e,t=r[10].text+"",s,a,u,f;function h(...g){return r[9](r[10],...g)}return{c(){e=ae("button"),s=Kt(t),a=Ze(),U(e,"type","button"),U(e,"class","dropdown-item my-2 rounded w-100 bg-"+r[10].bg+" text-"+r[10].color)},m(g,v){Ie(g,e,v),Y(e,s),Y(e,a),u||(f=En(e,"click",h),u=!0)},p(g,v){r=g},d(g){g&&Pe(e),u=!1,f()}}}function Qie(r){let e,t=r[10].value!==r[0]&&Jie(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,a){s[10].value!==s[0]?t?t.p(s,a):(t=Jie(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Pe(e)}}}function i2e(r){let e,t,s;return{c(){e=ae("a"),t=Kt("Preview"),U(e,"href",s=r[5].previewTargetUrl+"?schema="+r[2].name+"&id="+r[1].id),U(e,"target","_blank"),U(e,"class","btn btn-info ms-3")},m(a,u){Ie(a,e,u),Y(e,t)},p(a,u){u&6&&s!==(s=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&U(e,"href",s)},d(a){a&&Pe(e)}}}function a2e(r){let e,t,s,a=r[4].text+"",u,f,h,g,v,_,A,O,N,L,j,z=r[6],q=[];for(let F=0;F<z.length;F+=1)q[F]=Qie(Xie(r,z,F));let ee=r[5].previewTarget&&i2e(r);return{c(){e=ae("div"),t=ae("div"),s=ae("button"),u=Kt(a),h=Ze(),g=ae("button"),v=ae("span"),v.textContent="Toggle Dropdown",A=Ze(),O=ae("div"),N=ae("div"),N.textContent="Change status to",L=Ze();for(let F=0;F<q.length;F+=1)q[F].c();j=Ze(),ee&&ee.c(),U(s,"type","button"),U(s,"class",f="btn btn-"+r[4].bg),U(v,"class","visually-hidden"),U(g,"type","button"),U(g,"class",_="btn btn-"+r[4].bg+" dropdown-toggle dropdown-toggle-split"),U(g,"data-bs-toggle","dropdown"),U(g,"aria-expanded","false"),U(N,"class","dropdown-header"),U(O,"class","dropdown-menu"),U(t,"class","btn-group dropup"),U(e,"class","d-flex justify-content-between")},m(F,oe){Ie(F,e,oe),Y(e,t),Y(t,s),Y(s,u),Y(t,h),Y(t,g),Y(g,v),r[8](g),Y(t,A),Y(t,O),Y(O,N),Y(O,L);for(let te=0;te<q.length;te+=1)q[te]&&q[te].m(O,null);Y(e,j),ee&&ee.m(e,null)},p(F,[oe]){if(oe&16&&a!==(a=F[4].text+"")&&jn(u,a),oe&16&&f!==(f="btn btn-"+F[4].bg)&&U(s,"class",f),oe&16&&_!==(_="btn btn-"+F[4].bg+" dropdown-toggle dropdown-toggle-split")&&U(g,"class",_),oe&193){z=F[6];let te;for(te=0;te<z.length;te+=1){const se=Xie(F,z,te);q[te]?q[te].p(se,oe):(q[te]=Qie(se),q[te].c(),q[te].m(O,null))}for(;te<q.length;te+=1)q[te].d(1);q.length=z.length}F[5].previewTarget&&ee.p(F,oe)},i:_n,o:_n,d(F){F&&Pe(e),r[8](null),Ba(q,F),ee&&ee.d()}}}function l2e(r,e,t){let s;const a=hi("channel");let{status:u="draft"}=e,{record:f}=e,{schema:h}=e,g;const v=Object.values(Hhe());function _(N,L){t(0,u=L),g.click()}function A(N){ts[N?"unshift":"push"](()=>{g=N,t(3,g)})}const O=(N,L)=>_(L,N.value);return r.$$set=N=>{"status"in N&&t(0,u=N.status),"record"in N&&t(1,f=N.record),"schema"in N&&t(2,h=N.schema)},r.$$.update=()=>{r.$$.dirty&1&&t(4,s=Fhe(u))},[u,f,h,g,s,a,v,_,A,O]}class $he extends xo{constructor(e){super(),Ao(this,e,l2e,a2e,Eo,{status:0,record:1,schema:2})}}function eae(r,e="",t="",s=""){return hi("channel").filesUrl+`/thumbs/${r._file.path}`}function tae(r){return hi("channel").filesUrl+`/${r._file.path}`}function nae(r){let e,t,s,a,u;const f=[u2e,c2e],h=[];function g(v,_){return _&1&&(e=null),e==null&&(e=!!v[0]._file.mime.startsWith("image")),e?0:1}return t=g(r,-1),s=h[t]=f[t](r),{c(){s.c(),a=Bs()},m(v,_){h[t].m(v,_),Ie(v,a,_),u=!0},p(v,_){let A=t;t=g(v,_),t===A?h[t].p(v,_):(So(),$e(h[A],1,1,()=>{h[A]=null}),ko(),s=h[t],s?s.p(v,_):(s=h[t]=f[t](v),s.c()),Oe(s,1),s.m(a.parentNode,a))},i(v){u||(Oe(s),u=!0)},o(v){$e(s),u=!1},d(v){h[t].d(v),v&&Pe(a)}}}function c2e(r){let e,t,s,a,u,f=r[0]._file.path.split(".").pop()+"",h,g,v,_;return t=new fl({props:{icon:"file",width:r[3],height:r[3]}}),{c(){e=ae("a"),sn(t.$$.fragment),s=Ze(),a=ae("span"),u=Kt("."),h=Kt(f),U(a,"class","ms-2"),ss(a,"font-size",r[4]+"px"),U(e,"href",g=r[5].lucentUrl+"/records/"+r[0].id),U(e,"title",v=r[0]._file.path),U(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),ss(e,"width",r[2]+"px"),ss(e,"height",r[2]+"px")},m(A,O){Ie(A,e,O),nn(t,e,null),Y(e,s),Y(e,a),Y(a,u),Y(a,h),_=!0},p(A,O){const N={};O&8&&(N.width=A[3]),O&8&&(N.height=A[3]),t.$set(N),(!_||O&1)&&f!==(f=A[0]._file.path.split(".").pop()+"")&&jn(h,f),(!_||O&16)&&ss(a,"font-size",A[4]+"px"),(!_||O&1&&g!==(g=A[5].lucentUrl+"/records/"+A[0].id))&&U(e,"href",g),(!_||O&1&&v!==(v=A[0]._file.path))&&U(e,"title",v),(!_||O&4)&&ss(e,"width",A[2]+"px"),(!_||O&4)&&ss(e,"height",A[2]+"px")},i(A){_||(Oe(t.$$.fragment,A),_=!0)},o(A){$e(t.$$.fragment,A),_=!1},d(A){A&&Pe(e),on(t)}}}function u2e(r){let e,t,s,a,u,f;return{c(){e=ae("a"),t=ae("img"),U(t,"class","rounded w-100"),kie(t.src,s=eae(r[0],r[2],r[2],"crop"))||U(t,"src",s),U(t,"alt",a=r[0]._file.path),U(e,"href",u=r[5].lucentUrl+"/records/"+r[0].id),U(e,"title",f=r[0]._file.path),U(e,"class","d-flex align-items-center justify-content-center "),ss(e,"width",r[2]+"px"),ss(e,"height",r[2]+"px")},m(h,g){Ie(h,e,g),Y(e,t)},p(h,g){g&5&&!kie(t.src,s=eae(h[0],h[2],h[2],"crop"))&&U(t,"src",s),g&1&&a!==(a=h[0]._file.path)&&U(t,"alt",a),g&1&&u!==(u=h[5].lucentUrl+"/records/"+h[0].id)&&U(e,"href",u),g&1&&f!==(f=h[0]._file.path)&&U(e,"title",f),g&4&&ss(e,"width",h[2]+"px"),g&4&&ss(e,"height",h[2]+"px")},i:_n,o:_n,d(h){h&&Pe(e)}}}function oae(r){let e,t=r[0]._file.path+"",s,a,u;return{c(){e=ae("a"),s=Kt(t),U(e,"href",a=r[5].lucentUrl+"/records/"+r[0].id),U(e,"title",u=r[0]._file.path),U(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(f,h){Ie(f,e,h),Y(e,s)},p(f,h){h&1&&t!==(t=f[0]._file.path+"")&&jn(s,t),h&1&&a!==(a=f[5].lucentUrl+"/records/"+f[0].id)&&U(e,"href",a),h&1&&u!==(u=f[0]._file.path)&&U(e,"title",u)},d(f){f&&Pe(e)}}}function f2e(r){let e,t,s,a=r[0]&&nae(r),u=r[1]&&oae(r);return{c(){a&&a.c(),e=Ze(),u&&u.c(),t=Bs()},m(f,h){a&&a.m(f,h),Ie(f,e,h),u&&u.m(f,h),Ie(f,t,h),s=!0},p(f,[h]){f[0]?a?(a.p(f,h),h&1&&Oe(a,1)):(a=nae(f),a.c(),Oe(a,1),a.m(e.parentNode,e)):a&&(So(),$e(a,1,1,()=>{a=null}),ko()),f[1]?u?u.p(f,h):(u=oae(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},i(f){s||(Oe(a),s=!0)},o(f){$e(a),s=!1},d(f){a&&a.d(f),f&&Pe(e),u&&u.d(f),f&&Pe(t)}}}function d2e(r,e,t){let{record:s}=e;const a=hi("channel");let{size:u="small"}=e,{showFilename:f=!1}=e,h,g,v;return u=="large"?(h=256,g=32,v="20"):u=="medium"?(h=128,g=12,v="17"):u=="small"?(h=64,g=12,v="15"):u=="tiny"&&(h=42,g=12,v="13"),r.$$set=_=>{"record"in _&&t(0,s=_.record),"size"in _&&t(6,u=_.size),"showFilename"in _&&t(1,f=_.showFilename)},[s,f,h,g,v,a,u]}class P_ extends xo{constructor(e){super(),Ao(this,e,d2e,f2e,Eo,{record:0,size:6,showFilename:1})}}function sae(r){let e,t,s,a,u,f,h,g,v,_,A=r[0]._file.path+"",O,N,L,j,z,q,ee=r[0]._file.originalName+"",F,oe,te,se,X,we,ye=r[0]._file.mime+"",Te,_e,ge,nt,Je,ft,V,ut=(r[0]._file.size/1024).toFixed(1)+"",et,Et,xt,He,ct,an,kt,bn=r[0]._file.checksum+"",qe,gt,de,No,Zn,Bn,ao=r[0]._file.path+"",Wo,St,Xt;s=new P_({props:{record:r[0],size:"large"}});let Tt=r[0]._file.width&&rae(r);return{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),a=Ze(),u=ae("div"),f=ae("ul"),h=ae("li"),g=ae("span"),g.textContent="Filename",v=Ze(),_=ae("span"),O=Kt(A),N=Ze(),L=ae("li"),j=ae("span"),j.textContent="Original name",z=Ze(),q=ae("span"),F=Kt(ee),oe=Ze(),te=ae("li"),se=ae("span"),se.textContent="Mime type",X=Ze(),we=ae("span"),Te=Kt(ye),_e=Ze(),Tt&&Tt.c(),ge=Ze(),nt=ae("li"),Je=ae("span"),Je.textContent="File size",ft=Ze(),V=ae("span"),et=Kt(ut),Et=Kt("kB"),xt=Ze(),He=ae("li"),ct=ae("span"),ct.textContent="Checksum",an=Ze(),kt=ae("span"),qe=Kt(bn),gt=Ze(),de=ae("li"),No=ae("span"),No.textContent="Download",Zn=Ze(),Bn=ae("a"),Wo=Kt(ao),U(t,"class","col"),ss(t,"max-width","276px"),U(g,"class","text-muted"),U(h,"class","list-group-item border-primary"),U(j,"class","text-muted"),U(L,"class","list-group-item border-primary"),U(se,"class","text-muted"),U(te,"class","list-group-item border-primary"),U(Je,"class","text-muted"),U(nt,"class","list-group-item border-primary"),U(ct,"class","text-muted"),U(He,"class","list-group-item border-primary"),U(No,"class","text-muted"),U(Bn,"href",St=tae(r[0])),U(de,"class","list-group-item border-primary"),U(f,"class","list-group svelte-1qb90xc"),U(u,"class","col"),U(e,"class","row mb-4")},m(Be,Ut){Ie(Be,e,Ut),Y(e,t),nn(s,t,null),Y(e,a),Y(e,u),Y(u,f),Y(f,h),Y(h,g),Y(h,v),Y(h,_),Y(_,O),Y(f,N),Y(f,L),Y(L,j),Y(L,z),Y(L,q),Y(q,F),Y(f,oe),Y(f,te),Y(te,se),Y(te,X),Y(te,we),Y(we,Te),Y(f,_e),Tt&&Tt.m(f,null),Y(f,ge),Y(f,nt),Y(nt,Je),Y(nt,ft),Y(nt,V),Y(V,et),Y(V,Et),Y(f,xt),Y(f,He),Y(He,ct),Y(He,an),Y(He,kt),Y(kt,qe),Y(f,gt),Y(f,de),Y(de,No),Y(de,Zn),Y(de,Bn),Y(Bn,Wo),Xt=!0},p(Be,Ut){const gn={};Ut&1&&(gn.record=Be[0]),s.$set(gn),(!Xt||Ut&1)&&A!==(A=Be[0]._file.path+"")&&jn(O,A),(!Xt||Ut&1)&&ee!==(ee=Be[0]._file.originalName+"")&&jn(F,ee),(!Xt||Ut&1)&&ye!==(ye=Be[0]._file.mime+"")&&jn(Te,ye),Be[0]._file.width?Tt?Tt.p(Be,Ut):(Tt=rae(Be),Tt.c(),Tt.m(f,ge)):Tt&&(Tt.d(1),Tt=null),(!Xt||Ut&1)&&ut!==(ut=(Be[0]._file.size/1024).toFixed(1)+"")&&jn(et,ut),(!Xt||Ut&1)&&bn!==(bn=Be[0]._file.checksum+"")&&jn(qe,bn),(!Xt||Ut&1)&&ao!==(ao=Be[0]._file.path+"")&&jn(Wo,ao),(!Xt||Ut&1&&St!==(St=tae(Be[0])))&&U(Bn,"href",St)},i(Be){Xt||(Oe(s.$$.fragment,Be),Xt=!0)},o(Be){$e(s.$$.fragment,Be),Xt=!1},d(Be){Be&&Pe(e),on(s),Tt&&Tt.d()}}}function rae(r){let e,t,s,a,u=r[0]._file.width+"",f,h,g=r[0]._file.height+"",v;return{c(){e=ae("li"),t=ae("span"),t.textContent="Dimensions",s=Ze(),a=ae("span"),f=Kt(u),h=Kt("x"),v=Kt(g),U(t,"class","text-muted"),U(e,"class","list-group-item border-primary")},m(_,A){Ie(_,e,A),Y(e,t),Y(e,s),Y(e,a),Y(a,f),Y(a,h),Y(a,v)},p(_,A){A&1&&u!==(u=_[0]._file.width+"")&&jn(f,u),A&1&&g!==(g=_[0]._file.height+"")&&jn(v,g)},d(_){_&&Pe(e)}}}function h2e(r){let e,t,s=r[1].type==="files"&&sae(r);return{c(){s&&s.c(),e=Bs()},m(a,u){s&&s.m(a,u),Ie(a,e,u),t=!0},p(a,[u]){a[1].type==="files"?s?(s.p(a,u),u&2&&Oe(s,1)):(s=sae(a),s.c(),Oe(s,1),s.m(e.parentNode,e)):s&&(So(),$e(s,1,1,()=>{s=null}),ko())},i(a){t||(Oe(s),t=!0)},o(a){$e(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function m2e(r,e,t){let{record:s}=e,{schema:a}=e;return r.$$set=u=>{"record"in u&&t(0,s=u.record),"schema"in u&&t(1,a=u.schema)},[s,a]}class zhe extends xo{constructor(e){super(),Ao(this,e,m2e,h2e,Eo,{record:0,schema:1})}}function iae(r,e,t){const s=r.slice();return s[9]=e[t],s}function aae(r){let e,t=r[1],s=[];for(let a=0;a<t.length;a+=1)s[a]=lae(iae(r,t,a));return{c(){e=ae("ul");for(let a=0;a<s.length;a+=1)s[a].c();U(e,"class","nav nav-pills mb-4 justify-content-center")},m(a,u){Ie(a,e,u);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(a,u){if(u&7){t=a[1];let f;for(f=0;f<t.length;f+=1){const h=iae(a,t,f);s[f]?s[f].p(h,u):(s[f]=lae(h),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=t.length}},d(a){a&&Pe(e),Ba(s,a)}}}function lae(r){let e,t,s=r[9].label+"",a,u,f,h;function g(...v){return r[5](r[9],...v)}return{c(){e=ae("li"),t=ae("button"),a=Kt(s),u=Ze(),U(t,"class","nav-link"),U(t,"aria-current","page"),vs(t,"active",r[0]===r[9].name),U(e,"class","nav-item")},m(v,_){Ie(v,e,_),Y(e,t),Y(t,a),Y(e,u),f||(h=En(t,"click",g),f=!0)},p(v,_){r=v,_&2&&s!==(s=r[9].label+"")&&jn(a,s),_&3&&vs(t,"active",r[0]===r[9].name)},d(v){v&&Pe(e),f=!1,h()}}}function g2e(r){let e,t=r[1].length>1&&aae(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,[a]){s[1].length>1?t?t.p(s,a):(t=aae(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function p2e(r,e,t){var O,N;let{schema:s}=e,{isCreateMode:a}=e,{active:u=""}=e,f=(N=(O=s.groups)==null?void 0:O.map(L=>({label:L,name:L})))!=null?N:[],h={label:"Main",name:""},g={label:"Graph",name:"_graph"};a?f=[h,...f]:f=[h,...f,g];function v(L){L.preventDefault(),t(0,u="_graph")}function _(L,j){L.preventDefault(),j=="_graph"?v(L):t(0,u=j)}const A=(L,j)=>_(j,L.name);return r.$$set=L=>{"schema"in L&&t(3,s=L.schema),"isCreateMode"in L&&t(4,a=L.isCreateMode),"active"in L&&t(0,u=L.active)},[u,f,_,s,a,A]}class Vhe extends xo{constructor(e){super(),Ao(this,e,p2e,g2e,Eo,{schema:3,isCreateMode:4,active:0})}}function cae(r,e,t){const s=r.slice();return s[11]=e[t],s}function uae(r){let e=[],t=new Map,s,a=r[3];const u=h=>h[11].id;for(let h=0;h<a.length;h+=1){let g=cae(r,a,h),v=u(g);t.set(v,e[h]=dae(v,g))}let f=null;return a.length||(f=fae(r)),{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs(),f&&f.c()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),f&&f.m(h,g)},p(h,g){g&63&&(a=h[3],e=$h(e,g,u,1,h,a,t,s.parentNode,oI,dae,s,cae),!a.length&&f?f.p(h,g):a.length?f&&(f.d(1),f=null):(f=fae(h),f.c(),f.m(s.parentNode,s)))},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s),f&&f.d(h)}}}function fae(r){let e;function t(u,f){return u[1]&&u[2].optionsSuggest?v2e:b2e}let s=t(r),a=s(r);return{c(){a.c(),e=Bs()},m(u,f){a.m(u,f),Ie(u,e,f)},p(u,f){s===(s=t(u))&&a?a.p(u,f):(a.d(1),a=s(u),a&&(a.c(),a.m(e.parentNode,e)))},d(u){a.d(u),u&&Pe(e)}}}function b2e(r){let e;return{c(){e=Kt("No results")},m(t,s){Ie(t,e,s)},p:_n,d(t){t&&Pe(e)}}}function v2e(r){let e,t,s,a,u,f,h,g;return{c(){e=ae("div"),t=ae("span"),s=Kt('Add "'),a=Kt(r[1]),u=Kt('"'),f=Ze(),U(t,"class","dropdown-item")},m(v,_){Ie(v,e,_),Y(e,t),Y(t,s),Y(t,a),Y(t,u),Y(e,f),h||(g=[En(e,"click",r[9]),En(e,"keypress",r[10])],h=!0)},p(v,_){_&2&&jn(a,v[1])},d(v){v&&Pe(e),h=!1,Bi(g)}}}function dae(r,e){let t,s,a=dd(e[4].schemas,e[11])+"",u,f,h,g=e[11].data[e[2].optionsField]+"",v,_,A,O;function N(...j){return e[7](e[11],...j)}function L(...j){return e[8](e[11],...j)}return{key:r,first:null,c(){t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),h=ae("small"),v=Kt(g),_=Ze(),U(h,"class","text-muted "),U(s,"class","dropdown-item"),this.first=t},m(j,z){Ie(j,t,z),Y(t,s),Y(s,u),Y(s,f),Y(s,h),Y(h,v),Y(t,_),A||(O=[En(t,"click",N),En(t,"keypress",L)],A=!0)},p(j,z){e=j,z&8&&a!==(a=dd(e[4].schemas,e[11])+"")&&jn(u,a),z&12&&g!==(g=e[11].data[e[2].optionsField]+"")&&jn(v,g)},d(j){j&&Pe(t),A=!1,Bi(O)}}}function y2e(r){let e,t=r[2].optionsFrom&&uae(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,[a]){s[2].optionsFrom?t?t.p(s,a):(t=uae(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function w2e(r,e,t){let s;const a=hi("channel");let{field:u}=e,{value:f}=e,{search:h}=e;const g=fd.exports.debounce(L=>{axios.get("/records/suggestions",{params:{schema:u.optionsFrom,field:u.optionsField,value:h,ui:u.ui}}).then(j=>{t(3,s=j.data)}).catch(j=>{console.log(j)})},500);function v(L,j){L.preventDefault(),t(0,f=j.data[u.optionsField]),t(1,h="")}const _=(L,j)=>v(j,L),A=(L,j)=>v(j,L),O=L=>{t(0,f=h),t(1,h="")},N=L=>{t(0,f=h),t(1,h="")};return r.$$set=L=>{"field"in L&&t(2,u=L.field),"value"in L&&t(0,f=L.value),"search"in L&&t(1,h=L.search)},t(3,s=[]),[f,h,u,s,a,v,g,_,A,O,N]}class ZV extends xo{constructor(e){super(),Ao(this,e,w2e,y2e,Eo,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function hae(r,e,t){const s=r.slice();return s[11]=e[t][0],s[12]=e[t][1],s}function mae(r,e,t){const s=r.slice();return s[8]=e[t],s}function gae(r){let e,t;function s(f,h){return h&1&&(e=null),e==null&&(e=!!Array.isArray(f[0].selectOptions)),e?C2e:_2e}let a=s(r,-1),u=a(r);return{c(){u.c(),t=Bs()},m(f,h){u.m(f,h),Ie(f,t,h)},p(f,h){a===(a=s(f,h))&&u?u.p(f,h):(u.d(1),u=a(f),u&&(u.c(),u.m(t.parentNode,t)))},d(f){u.d(f),f&&Pe(t)}}}function _2e(r){let e=[],t=new Map,s,a=Object.entries(r[0].selectOptions);const u=f=>f[11];for(let f=0;f<a.length;f+=1){let h=hae(r,a,f),g=u(h);t.set(g,e[f]=pae(g,h))}return{c(){for(let f=0;f<e.length;f+=1)e[f].c();s=Bs()},m(f,h){for(let g=0;g<e.length;g+=1)e[g]&&e[g].m(f,h);Ie(f,s,h)},p(f,h){h&3&&(a=Object.entries(f[0].selectOptions),e=$h(e,h,u,1,f,a,t,s.parentNode,oI,pae,s,hae))},d(f){for(let h=0;h<e.length;h+=1)e[h].d(f);f&&Pe(s)}}}function C2e(r){let e=[],t=new Map,s,a=r[0].selectOptions;const u=f=>f[8];for(let f=0;f<a.length;f+=1){let h=mae(r,a,f),g=u(h);t.set(g,e[f]=bae(g,h))}return{c(){for(let f=0;f<e.length;f+=1)e[f].c();s=Bs()},m(f,h){for(let g=0;g<e.length;g+=1)e[g]&&e[g].m(f,h);Ie(f,s,h)},p(f,h){h&3&&(a=f[0].selectOptions,e=$h(e,h,u,1,f,a,t,s.parentNode,oI,bae,s,mae))},d(f){for(let h=0;h<e.length;h+=1)e[h].d(f);f&&Pe(s)}}}function pae(r,e){let t,s,a=e[12]+"",u,f,h,g;function v(...A){return e[6](e[11],...A)}function _(...A){return e[7](e[11],...A)}return{key:r,first:null,c(){t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),U(s,"class","dropdown-item"),this.first=t},m(A,O){Ie(A,t,O),Y(t,s),Y(s,u),Y(t,f),h||(g=[En(t,"click",v),En(t,"keypress",_)],h=!0)},p(A,O){e=A,O&1&&a!==(a=e[12]+"")&&jn(u,a)},d(A){A&&Pe(t),h=!1,Bi(g)}}}function bae(r,e){let t,s,a=e[8]+"",u,f,h,g;function v(...A){return e[4](e[8],...A)}function _(...A){return e[5](e[8],...A)}return{key:r,first:null,c(){t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),U(s,"class","dropdown-item"),this.first=t},m(A,O){Ie(A,t,O),Y(t,s),Y(s,u),Y(t,f),h||(g=[En(t,"click",v),En(t,"keypress",_)],h=!0)},p(A,O){e=A,O&1&&a!==(a=e[8]+"")&&jn(u,a)},d(A){A&&Pe(t),h=!1,Bi(g)}}}function S2e(r){let e,t=r[0].selectOptions&&gae(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,[a]){s[0].selectOptions?t?t.p(s,a):(t=gae(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function k2e(r,e,t){let{field:s}=e,{value:a}=e,{search:u}=e;function f(A,O){A.preventDefault(),t(2,a=O),t(3,u="")}const h=(A,O)=>f(O,A),g=(A,O)=>f(O,A),v=(A,O)=>f(O,A),_=(A,O)=>f(O,A);return r.$$set=A=>{"field"in A&&t(0,s=A.field),"value"in A&&t(2,a=A.value),"search"in A&&t(3,u=A.search)},[s,f,a,u,h,g,v,_]}class E2e extends xo{constructor(e){super(),Ao(this,e,k2e,S2e,Eo,{field:0,value:2,search:3})}}function Rg(r,e){return r&&r[e]?r[e].message:null}function A2e(r){let e,t,s,a;return{c(){e=ae("input"),U(e,"type","text"),U(e,"id",r[3]),U(e,"class","form-control"),U(e,"autocomplete","off"),e.readOnly=t=r[1].readonly&&!r[2],vs(e,"is-invalid",r[7])},m(u,f){Ie(u,e,f),_r(e,r[0]),s||(a=En(e,"input",r[18]),s=!0)},p(u,f){f&8&&U(e,"id",u[3]),f&6&&t!==(t=u[1].readonly&&!u[2])&&(e.readOnly=t),f&1&&e.value!==u[0]&&_r(e,u[0]),f&128&&vs(e,"is-invalid",u[7])},i:_n,o:_n,d(u){u&&Pe(e),s=!1,a()}}}function x2e(r){let e,t,s,a,u,f,h,g,v,_,A,O,N;function L(ee){r[15](ee)}function j(ee){r[16](ee)}let z={field:r[1]};r[0]!==void 0&&(z.value=r[0]),r[6]!==void 0&&(z.search=r[6]),f=new E2e({props:z}),ts.push(()=>gr(f,"value",L)),ts.push(()=>gr(f,"search",j));let q=r[0]&&vae(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("div"),sn(f.$$.fragment),v=Ze(),q&&q.c(),_=Bs(),U(t,"type","search"),U(t,"id",r[3]),U(t,"class","form-control dropdown-toggle"),U(t,"placeholder","Search for options"),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[2],vs(t,"is-invalid",r[7]),U(u,"class","dropdown-menu w-100"),U(e,"class","dropdown")},m(ee,F){Ie(ee,e,F),Y(e,t),_r(t,r[6]),Y(e,a),Y(e,u),nn(f,u,null),Ie(ee,v,F),q&&q.m(ee,F),Ie(ee,_,F),A=!0,O||(N=En(t,"input",r[14]),O=!0)},p(ee,F){(!A||F&8)&&U(t,"id",ee[3]),(!A||F&6&&s!==(s=ee[1].readonly&&!ee[2]))&&(t.readOnly=s),F&64&&t.value!==ee[6]&&_r(t,ee[6]),(!A||F&128)&&vs(t,"is-invalid",ee[7]);const oe={};F&2&&(oe.field=ee[1]),!h&&F&1&&(h=!0,oe.value=ee[0],Cr(()=>h=!1)),!g&&F&64&&(g=!0,oe.search=ee[6],Cr(()=>g=!1)),f.$set(oe),ee[0]?q?q.p(ee,F):(q=vae(ee),q.c(),q.m(_.parentNode,_)):q&&(q.d(1),q=null)},i(ee){A||(Oe(f.$$.fragment,ee),A=!0)},o(ee){$e(f.$$.fragment,ee),A=!1},d(ee){ee&&Pe(e),on(f),ee&&Pe(v),q&&q.d(ee),ee&&Pe(_),O=!1,N()}}}function T2e(r){let e,t,s,a,u,f,h,g,v,_,A=r[1].optionsFrom&&yae(r),O=r[0]&&wae(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("div"),A&&A.c(),f=Ze(),O&&O.c(),h=Bs(),U(t,"type","search"),U(t,"id",r[3]),U(t,"class","form-control dropdown-toggle"),U(t,"placeholder","Search for options"),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[2],vs(t,"is-invalid",r[7]),U(u,"class","dropdown-menu w-100"),U(e,"class","dropdown")},m(N,L){Ie(N,e,L),Y(e,t),_r(t,r[6]),Y(e,a),Y(e,u),A&&A.m(u,null),Ie(N,f,L),O&&O.m(N,L),Ie(N,h,L),g=!0,v||(_=[En(t,"keyup",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"focus",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"input",r[9])],v=!0)},p(N,L){r=N,(!g||L&8)&&U(t,"id",r[3]),(!g||L&6&&s!==(s=r[1].readonly&&!r[2]))&&(t.readOnly=s),L&64&&t.value!==r[6]&&_r(t,r[6]),(!g||L&128)&&vs(t,"is-invalid",r[7]),r[1].optionsFrom?A?(A.p(r,L),L&2&&Oe(A,1)):(A=yae(r),A.c(),Oe(A,1),A.m(u,null)):A&&(So(),$e(A,1,1,()=>{A=null}),ko()),r[0]?O?O.p(r,L):(O=wae(r),O.c(),O.m(h.parentNode,h)):O&&(O.d(1),O=null)},i(N){g||(Oe(A),g=!0)},o(N){$e(A),g=!1},d(N){N&&Pe(e),A&&A.d(),N&&Pe(f),O&&O.d(N),N&&Pe(h),v=!1,Bi(_)}}}function vae(r){let e,t,s,a,u,f,h;function g(A,O){return O&2&&(s=null),s==null&&(s=!!Array.isArray(A[1].selectOptions)),s?O2e:D2e}let v=g(r,-1),_=v(r);return{c(){e=ae("span"),t=ae("div"),_.c(),a=Ze(),u=ae("button"),U(u,"type","button"),U(u,"class","btn-close btn-sm ms-1"),ss(u,"font-size","10px"),U(u,"aria-label","Close"),U(t,"class","d-flex align-items-center "),U(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(A,O){Ie(A,e,O),Y(e,t),_.m(t,null),Y(t,a),Y(t,u),f||(h=En(u,"click",Hu(r[17])),f=!0)},p(A,O){v===(v=g(A,O))&&_?_.p(A,O):(_.d(1),_=v(A),_&&(_.c(),_.m(t,a)))},d(A){A&&Pe(e),_.d(),f=!1,h()}}}function D2e(r){let e=r[1].selectOptions[r[0]]+"",t;return{c(){t=Kt(e)},m(s,a){Ie(s,t,a)},p(s,a){a&3&&e!==(e=s[1].selectOptions[s[0]]+"")&&jn(t,e)},d(s){s&&Pe(t)}}}function O2e(r){let e;return{c(){e=Kt(r[0])},m(t,s){Ie(t,e,s)},p(t,s){s&1&&jn(e,t[0])},d(t){t&&Pe(e)}}}function yae(r){let e,t,s,a;function u(g){r[11](g)}function f(g){r[12](g)}let h={field:r[1]};return r[0]!==void 0&&(h.value=r[0]),r[6]!==void 0&&(h.search=r[6]),e=new ZV({props:h}),r[10](e),ts.push(()=>gr(e,"value",u)),ts.push(()=>gr(e,"search",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&2&&(_.field=g[1]),!t&&v&1&&(t=!0,_.value=g[0],Cr(()=>t=!1)),!s&&v&64&&(s=!0,_.search=g[6],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){r[10](null),on(e,g)}}}function wae(r){let e,t,s,a,u,f,h;return{c(){e=ae("span"),t=ae("div"),s=Kt(r[0]),a=Ze(),u=ae("button"),U(u,"type","button"),U(u,"class","btn-close btn-sm ms-1"),ss(u,"font-size","10px"),U(u,"aria-label","Close"),U(t,"class","d-flex align-items-center "),U(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,v){Ie(g,e,v),Y(e,t),Y(t,s),Y(t,a),Y(t,u),f||(h=En(u,"click",Hu(r[13])),f=!0)},p(g,v){v&1&&jn(s,g[0])},d(g){g&&Pe(e),f=!1,h()}}}function _ae(r){let e,t;return{c(){e=ae("div"),t=Kt(r[7]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&128&&jn(t,s[7])},d(s){s&&Pe(e)}}}function M2e(r){let e,t,s,a,u;const f=[T2e,x2e,A2e],h=[];function g(_,A){return _[5]?0:_[1].selectOptions?1:2}t=g(r),s=h[t]=f[t](r);let v=r[7]&&_ae(r);return{c(){e=ae("div"),s.c(),a=Ze(),v&&v.c(),U(e,"class","mb-0")},m(_,A){Ie(_,e,A),h[t].m(e,null),Y(e,a),v&&v.m(e,null),u=!0},p(_,[A]){let O=t;t=g(_),t===O?h[t].p(_,A):(So(),$e(h[O],1,1,()=>{h[O]=null}),ko(),s=h[t],s?s.p(_,A):(s=h[t]=f[t](_),s.c()),Oe(s,1),s.m(e,a)),_[7]?v?v.p(_,A):(v=_ae(_),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(_){u||(Oe(s),u=!0)},o(_){$e(s),u=!1},d(_){_&&Pe(e),h[t].d(),v&&v.d()}}}function R2e(r,e,t){let s,a,u,{field:f}=e,{value:h}=e,{isCreateMode:g}=e,{validationErrors:v}=e,{id:_}=e,A;function O(){a=this.value,t(6,a)}function N(se){ts[se?"unshift":"push"](()=>{A=se,t(4,A)})}function L(se){h=se,t(0,h)}function j(se){a=se,t(6,a)}const z=se=>t(0,h="");function q(){a=this.value,t(6,a)}function ee(se){h=se,t(0,h)}function F(se){a=se,t(6,a)}const oe=se=>t(0,h="");function te(){h=this.value,t(0,h)}return r.$$set=se=>{"field"in se&&t(1,f=se.field),"value"in se&&t(0,h=se.value),"isCreateMode"in se&&t(2,g=se.isCreateMode),"validationErrors"in se&&t(8,v=se.validationErrors),"id"in se&&t(3,_=se.id)},r.$$.update=()=>{r.$$.dirty&258&&t(7,s=Rg(v,f.name)),r.$$.dirty&6&&t(5,u=f.optionsFrom&&!(f.readonly&&!g))},t(6,a=""),[h,f,g,_,A,u,a,s,v,O,N,L,j,z,q,ee,F,oe,te]}class Uhe extends xo{constructor(e){super(),Ao(this,e,R2e,M2e,Eo,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function Cae(r){let e,t;return{c(){e=ae("div"),t=Kt(r[4]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&16&&jn(t,s[4])},d(s){s&&Pe(e)}}}function N2e(r){let e,t,s,a,u,f,h=r[4]&&Cae(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),h&&h.c(),U(t,"type","text"),U(t,"id",r[3]),U(t,"class","form-control"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[2],vs(t,"is-invalid",r[4]),U(e,"class","mb-0")},m(g,v){Ie(g,e,v),Y(e,t),_r(t,r[0]),Y(e,a),h&&h.m(e,null),u||(f=En(t,"input",r[6]),u=!0)},p(g,[v]){v&8&&U(t,"id",g[3]),v&6&&s!==(s=g[1].readonly&&!g[2])&&(t.readOnly=s),v&1&&t.value!==g[0]&&_r(t,g[0]),v&16&&vs(t,"is-invalid",g[4]),g[4]?h?h.p(g,v):(h=Cae(g),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:_n,o:_n,d(g){g&&Pe(e),h&&h.d(),u=!1,f()}}}function P2e(r,e,t){let s,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,{id:g}=e;function v(){u=this.value,t(0,u)}return r.$$set=_=>{"field"in _&&t(1,a=_.field),"value"in _&&t(0,u=_.value),"isCreateMode"in _&&t(2,f=_.isCreateMode),"validationErrors"in _&&t(5,h=_.validationErrors),"id"in _&&t(3,g=_.id)},r.$$.update=()=>{r.$$.dirty&34&&t(4,s=Rg(h,a.name))},[u,a,f,g,s,h,v]}class Whe extends xo{constructor(e){super(),Ao(this,e,P2e,N2e,Eo,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function lI(r,e,t,s,a=""){let u=t.map(h=>({target:h.id,source:e.id,sourceSchema:e.schema,targetSchema:h.schema,field:s,rank:""})),f=r.edges;return a==="replace"&&(f=f.filter(h=>h.field!==field.name)),r.records=fd.exports.uniqBy([...r.records,...t],h=>h.id),r.edges=fd.exports.uniqBy([...f,...u],h=>h.source+h.target+h.field),r}function I2e(r){let e,t,s;return t=new P_({props:{record:r[0],size:"small"}}),{c(){e=ae("div"),sn(t.$$.fragment),ss(e,"max-width","94px"),ss(e,"margin-right","15px")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&1&&(f.record=a[0]),t.$set(f)},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function Sae(r){let e,t;return e=new jV({props:{status:r[0].status}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.status=s[0].status),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function kae(r){let e,t,s,a,u,f;return s=new fl({props:{icon:"trash-can"}}),{c(){e=ae("div"),t=ae("button"),sn(s.$$.fragment),U(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),U(e,"class","position-absolute end-0"),ss(e,"top","5px")},m(h,g){Ie(h,e,g),Y(e,t),nn(s,t,null),a=!0,u||(f=En(t,"click",r[6]),u=!0)},p:_n,i(h){a||(Oe(s.$$.fragment,h),a=!0)},o(h){$e(s.$$.fragment,h),a=!1},d(h){h&&Pe(e),on(s),u=!1,f()}}}function B2e(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j=r[4].type==="files"&&I2e(r),z=r[0].status==="draft"&&Sae(r),q=r[2]&&kae(r);return{c(){var ee;e=ae("div"),t=ae("div"),j&&j.c(),s=Ze(),a=ae("div"),u=ae("a"),f=Kt(r[5]),g=Ze(),v=ae("small"),v.textContent=`${r[4].label}`,_=Ze(),A=ae("small"),z&&z.c(),O=Ze(),q&&q.c(),U(u,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),U(u,"href",h=r[3].lucentUrl+"/records/"+r[0].id),U(u,"title",r[5]),U(v,"class","text-muted"),U(A,"class","text-muted"),U(a,"class","overflow-hidden"),U(t,"class","card-body d-flex"),U(e,"class",N="card mb-2 bg-light "+r[1]+" svelte-dof9cm"),ss(e,"border-color",(ee=r[4].color)!=null?ee:"#ccc"),ss(e,"border-width","1px")},m(ee,F){Ie(ee,e,F),Y(e,t),j&&j.m(t,null),Y(t,s),Y(t,a),Y(a,u),Y(u,f),Y(a,g),Y(a,v),Y(a,_),Y(a,A),z&&z.m(A,null),Y(e,O),q&&q.m(e,null),L=!0},p(ee,[F]){ee[4].type==="files"&&j.p(ee,F),(!L||F&1&&h!==(h=ee[3].lucentUrl+"/records/"+ee[0].id))&&U(u,"href",h),ee[0].status==="draft"?z?(z.p(ee,F),F&1&&Oe(z,1)):(z=Sae(ee),z.c(),Oe(z,1),z.m(A,null)):z&&(So(),$e(z,1,1,()=>{z=null}),ko()),ee[2]?q?(q.p(ee,F),F&4&&Oe(q,1)):(q=kae(ee),q.c(),Oe(q,1),q.m(e,null)):q&&(So(),$e(q,1,1,()=>{q=null}),ko()),(!L||F&2&&N!==(N="card mb-2 bg-light "+ee[1]+" svelte-dof9cm"))&&U(e,"class",N)},i(ee){L||(Oe(j),Oe(z),Oe(q),L=!0)},o(ee){$e(j),$e(z),$e(q),L=!1},d(ee){ee&&Pe(e),j&&j.d(),z&&z.d(),q&&q.d()}}}function L2e(r,e,t){const s=Ip(),a=hi("channel");let{graph:u}=e,{record:f}=e,{classes:h=""}=e,{hasDelete:g=!1}=e,v=a.schemas.find(O=>O.name===f.schema),_=dd(a.schemas,f,u);function A(O){O.preventDefault(),s("remove",f.id)}return r.$$set=O=>{"graph"in O&&t(7,u=O.graph),"record"in O&&t(0,f=O.record),"classes"in O&&t(1,h=O.classes),"hasDelete"in O&&t(2,g=O.hasDelete)},[f,h,g,a,v,_,A,u]}class cI extends xo{constructor(e){super(),Ao(this,e,L2e,B2e,Eo,{graph:7,record:0,classes:1,hasDelete:2})}}function yO(r,e,t,s){var h,g;if(console.log(r),console.log(e),r===e)return t;let a=(h=t==null?void 0:t.filter(v=>v.field===s))!=null?h:[],u=(g=t==null?void 0:t.filter(v=>v.field!==s))!=null?g:[],f=a.splice(r,1)[0];return a.splice(e,0,f),[...u,...a]}function Eae(r,e,t){const s=r.slice();return s[23]=e[t],s}function Aae(r){let e,t,s,a;function u(g){r[13](g)}function f(g){r[14](g)}let h={field:r[23],schema:r[2],record:r[0],validationErrors:r[4],isCreateMode:r[3]};return r[0].data!==void 0&&(h.data=r[0].data),r[1]!==void 0&&(h.graph=r[1]),e=new y1e({props:h}),ts.push(()=>gr(e,"data",u)),ts.push(()=>gr(e,"graph",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&4&&(_.schema=g[2]),v&1&&(_.record=g[0]),v&16&&(_.validationErrors=g[4]),v&8&&(_.isCreateMode=g[3]),!t&&v&1&&(t=!0,_.data=g[0].data,Cr(()=>t=!1)),!s&&v&2&&(s=!0,_.graph=g[1],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function xae(r,e){let t,s,a,u=e[5]===e[23].group&&Aae(e);return{key:r,first:null,c(){t=Bs(),u&&u.c(),s=Bs(),this.first=t},m(f,h){Ie(f,t,h),u&&u.m(f,h),Ie(f,s,h),a=!0},p(f,h){e=f,e[5]===e[23].group?u?(u.p(e,h),h&32&&Oe(u,1)):(u=Aae(e),u.c(),Oe(u,1),u.m(s.parentNode,s)):u&&(So(),$e(u,1,1,()=>{u=null}),ko())},i(f){a||(Oe(u),a=!0)},o(f){$e(u),a=!1},d(f){f&&Pe(t),u&&u.d(f),f&&Pe(s)}}}function Tae(r){let e,t,s;function a(f){r[15](f)}let u={schema:r[2]};return r[0].status!==void 0&&(u.status=r[0].status),e=new $he({props:u}),ts.push(()=>gr(e,"status",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&4&&(g.schema=f[2]),!t&&h&1&&(t=!0,g.status=f[0].status,Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function F2e(r){let e,t,s,a,u,f;return{c(){e=ae("button"),t=ae("span"),s=Kt(`
|
|
Save`),U(t,"class","spinner-border spinner-border-sm"),U(t,"role","status"),U(t,"aria-hidden","true"),e.disabled=a=!r[6],U(e,"class","ms-2 btn btn-primary btn-spinner")},m(h,g){Ie(h,e,g),Y(e,t),Y(e,s),u||(f=En(e,"click",r[11]),u=!0)},p(h,g){g&64&&a!==(a=!h[6])&&(e.disabled=a)},d(h){h&&Pe(e),u=!1,f()}}}function H2e(r){let e,t,s;return{c(){e=ae("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Add`,U(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",r[11]),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function $2e(r){let e,t,s,a,u,f,h,g,v,_=[],A=new Map,O,N,L,j,z,q,ee,F,oe;t=new sI({props:{message:r[7]}});function te(nt){r[12](nt)}let se={schema:r[2],isCreateMode:r[3],record:r[0]};r[5]!==void 0&&(se.active=r[5]),u=new Vhe({props:se}),ts.push(()=>gr(u,"active",te)),g=new zhe({props:{record:r[0],schema:r[2]}});let X=r[8];const we=nt=>nt[23].name;for(let nt=0;nt<X.length;nt+=1){let Je=Eae(r,X,nt),ft=we(Je);A.set(ft,_[nt]=xae(ft,Je))}let ye=r[2].hasDrafts&&Tae(r);function Te(nt,Je){return nt[3]?H2e:F2e}let _e=Te(r),ge=_e(r);return{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),a=ae("div"),sn(u.$$.fragment),h=Ze(),sn(g.$$.fragment),v=Ze();for(let nt=0;nt<_.length;nt+=1)_[nt].c();O=Ze(),N=ae("div"),L=ae("div"),ye&&ye.c(),j=Ze(),ge.c(),z=Ze(),q=ae("button"),q.textContent="cancel",U(a,"class","mt-1"),U(q,"class","ms-2 btn btn-link"),U(L,"class","d-flex mt-3 align-items-center justify-content-center"),U(e,"class","inline-edit my-4 svelte-sl11hx")},m(nt,Je){Ie(nt,e,Je),nn(t,e,null),Y(e,s),Y(e,a),nn(u,a,null),Y(a,h),nn(g,a,null),Y(a,v);for(let ft=0;ft<_.length;ft+=1)_[ft]&&_[ft].m(a,null);Y(e,O),Y(e,N),Y(N,L),ye&&ye.m(L,null),Y(L,j),ge.m(L,null),Y(L,z),Y(L,q),ee=!0,F||(oe=[En(window,"beforeunload",r[9]),En(q,"click",r[10])],F=!0)},p(nt,[Je]){const ft={};Je&128&&(ft.message=nt[7]),t.$set(ft);const V={};Je&4&&(V.schema=nt[2]),Je&8&&(V.isCreateMode=nt[3]),Je&1&&(V.record=nt[0]),!f&&Je&32&&(f=!0,V.active=nt[5],Cr(()=>f=!1)),u.$set(V);const ut={};Je&1&&(ut.record=nt[0]),Je&4&&(ut.schema=nt[2]),g.$set(ut),Je&319&&(X=nt[8],So(),_=$h(_,Je,we,1,nt,X,A,a,gv,xae,null,Eae),ko()),nt[2].hasDrafts?ye?(ye.p(nt,Je),Je&4&&Oe(ye,1)):(ye=Tae(nt),ye.c(),Oe(ye,1),ye.m(L,j)):ye&&(So(),$e(ye,1,1,()=>{ye=null}),ko()),_e===(_e=Te(nt))&&ge?ge.p(nt,Je):(ge.d(1),ge=_e(nt),ge&&(ge.c(),ge.m(L,z)))},i(nt){if(!ee){Oe(t.$$.fragment,nt),Oe(u.$$.fragment,nt),Oe(g.$$.fragment,nt);for(let Je=0;Je<X.length;Je+=1)Oe(_[Je]);Oe(ye),ee=!0}},o(nt){$e(t.$$.fragment,nt),$e(u.$$.fragment,nt),$e(g.$$.fragment,nt);for(let Je=0;Je<_.length;Je+=1)$e(_[Je]);$e(ye),ee=!1},d(nt){nt&&Pe(e),on(t),on(u),on(g);for(let Je=0;Je<_.length;Je+=1)_[Je].d();ye&&ye.d(),ge.d(),F=!1,Bi(oe)}}}function z2e(r,e,t){let s,a;const u=hi("channel"),f=Ip();let{schema:h}=e,{record:g}=e,{graph:v={records:[],edges:[]}}=e,{isCreateMode:_}=e,A,O="",N=!1,L=h.fields.filter(ye=>ye.name!=="id"),j="_default";h.fields.reduce((ye,Te)=>{var _e;return Te.ui==="tab"?(j=Te.name,ye):(ye[j]=[...(_e=ye[j])!=null?_e:[],Te.name],ye)},[]),H0(()=>{z()});function z(){A={data:JSON.parse(JSON.stringify(g.data)),schema:g.schema,status:g.status,_sys:JSON.parse(JSON.stringify(g._sys)),_file:JSON.parse(JSON.stringify(g._file)),edges:JSON.parse(JSON.stringify(v.edges))}}xhe(()=>{t(6,N=ee())});function q(ye){return N?ye.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete ye.returnValue,"...")}function ee(){return _?!1:!fd.exports.isEqual(A,{data:g.data,schema:g.schema,status:g.status,_sys:g._sys,_file:g._file,edges:v.edges})}function F(ye){ye.preventDefault(),f("cancel")}function oe(ye){return ye.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Te,_e){var ge,nt;if(!N&&!_){Te(null);return}if(!g){Te(null);return}t(1,v.edges=(nt=(ge=v.edges)==null?void 0:ge.filter(Je=>!Je._isTrashed&&Je.source===g.id))!=null?nt:[],v),axios.post(u.lucentUrl+"/records",{record:g,edges:v.edges,isCreateMode:_}).then(function(Je){console.log("SAVE: SAVED INLINE"),t(0,g=Je.data.records[0]),t(1,v=Je.data),_||z(),f("inlinesaved",{records:[g]}),Te(null)}).catch(function(Je){Je.response&&(typeof Je.response.data.error=="string"?t(7,a=Je.response.data.error):t(4,s=Je.response.data.error)),Te(null)})})}function te(ye){O=ye,t(5,O)}function se(ye){r.$$.not_equal(g.data,ye)&&(g.data=ye,t(0,g))}function X(ye){v=ye,t(1,v)}function we(ye){r.$$.not_equal(g.status,ye)&&(g.status=ye,t(0,g))}return r.$$set=ye=>{"schema"in ye&&t(2,h=ye.schema),"record"in ye&&t(0,g=ye.record),"graph"in ye&&t(1,v=ye.graph),"isCreateMode"in ye&&t(3,_=ye.isCreateMode)},r.$$.update=()=>{r.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[g,v,h,_,s,O,N,a,L,q,F,oe,te,se,X,we]}class jhe extends xo{constructor(e){super(),Ao(this,e,z2e,$2e,Eo,{schema:2,record:0,graph:1,isCreateMode:3})}}function Dae(r,e,t){const s=r.slice();return s[19]=e[t],s}function Oae(r,e,t){const s=r.slice();return s[22]=e[t],s}function Mae(r){let e,t=r[22].label+"",s;return{c(){e=ae("option"),s=Kt(t),e.__value=r[22],e.value=e.__value},m(a,u){Ie(a,e,u),Y(e,s)},p:_n,d(a){a&&Pe(e)}}}function Rae(r){let e,t=r[19].label+"",s,a;return{c(){e=ae("option"),s=Kt(t),e.__value=a=r[19],e.value=e.__value},m(u,f){Ie(u,e,f),Y(e,s)},p(u,f){f&2&&t!==(t=u[19].label+"")&&jn(s,t),f&2&&a!==(a=u[19])&&(e.__value=a,e.value=e.__value)},d(u){u&&Pe(e)}}}function V2e(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye,Te,_e,ge,nt,Je;a=new fl({props:{icon:"filter"}});let ft=r[5],V=[];for(let Et=0;Et<ft.length;Et+=1)V[Et]=Mae(Oae(r,ft,Et));let ut=r[1],et=[];for(let Et=0;Et<ut.length;Et+=1)et[Et]=Rae(Dae(r,ut,Et));return{c(){e=ae("div"),t=ae("div"),s=ae("button"),sn(a.$$.fragment),u=Ze(),f=ae("span"),f.textContent="Filter",h=Ze(),g=ae("div"),v=ae("div"),_=ae("select");for(let Et=0;Et<V.length;Et+=1)V[Et].c();A=Ze(),O=ae("div"),N=ae("select");for(let Et=0;Et<et.length;Et+=1)et[Et].c();L=Ze(),j=ae("div"),z=ae("input"),q=Ze(),ee=ae("div"),F=ae("button"),F.textContent="Add filter",oe=Ze(),te=ae("hr"),se=Ze(),X=ae("div"),X.innerHTML='<h6 class="dropdown-header">Advanced filters</h6>',we=Ze(),ye=ae("form"),Te=ae("div"),_e=ae("input"),U(f,"class","ms-1"),U(s,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),U(s,"type","button"),U(s,"data-bs-toggle","dropdown"),U(s,"data-bs-auto-close","outside"),U(s,"aria-expanded","false"),U(_,"class","form-select"),r[0]===void 0&&hk(()=>r[13].call(_)),U(v,"class","px-3 py-1 d-flex align-items-center"),U(N,"class","form-select"),r[4]===void 0&&hk(()=>r[14].call(N)),U(O,"class","px-3 py-1 d-flex align-items-center"),U(z,"type","text"),U(z,"class","form-control"),U(j,"class","px-3 py-1 d-flex align-items-center"),U(F,"class","btn btn-outline-primary"),U(F,"type","button"),U(ee,"class","px-3 py-1 d-flex align-items-center"),U(_e,"type","search"),U(_e,"class","form-control"),U(_e,"placeholder","Advanced filters"),_e.required=!0,U(Te,"class","px-3 py-1 d-flex align-items-center"),U(g,"class","dropdown-menu"),ss(g,"width","300px"),U(t,"class","btn-group"),U(e,"class","mx-2 d-flex align-items-center")},m(Et,xt){Ie(Et,e,xt),Y(e,t),Y(t,s),nn(a,s,null),Y(s,u),Y(s,f),Y(t,h),Y(t,g),Y(g,v),Y(v,_);for(let He=0;He<V.length;He+=1)V[He]&&V[He].m(_,null);V$(_,r[0],!0),Y(g,A),Y(g,O),Y(O,N);for(let He=0;He<et.length;He+=1)et[He]&&et[He].m(N,null);V$(N,r[4],!0),Y(g,L),Y(g,j),Y(j,z),_r(z,r[3]),Y(g,q),Y(g,ee),Y(ee,F),Y(g,oe),Y(g,te),Y(g,se),Y(g,X),Y(g,we),Y(g,ye),Y(ye,Te),Y(Te,_e),_r(_e,r[2]),ge=!0,nt||(Je=[En(_,"change",r[13]),En(N,"change",r[14]),En(z,"input",r[15]),En(F,"click",r[6]),En(_e,"input",r[16]),En(ye,"submit",r[7])],nt=!0)},p(Et,[xt]){if(xt&32){ft=Et[5];let He;for(He=0;He<ft.length;He+=1){const ct=Oae(Et,ft,He);V[He]?V[He].p(ct,xt):(V[He]=Mae(ct),V[He].c(),V[He].m(_,null))}for(;He<V.length;He+=1)V[He].d(1);V.length=ft.length}if(xt&33&&V$(_,Et[0]),xt&2){ut=Et[1];let He;for(He=0;He<ut.length;He+=1){const ct=Dae(Et,ut,He);et[He]?et[He].p(ct,xt):(et[He]=Rae(ct),et[He].c(),et[He].m(N,null))}for(;He<et.length;He+=1)et[He].d(1);et.length=ut.length}xt&18&&V$(N,Et[4]),xt&8&&z.value!==Et[3]&&_r(z,Et[3]),xt&4&&_e.value!==Et[2]&&_r(_e,Et[2])},i(Et){ge||(Oe(a.$$.fragment,Et),ge=!0)},o(Et){$e(a.$$.fragment,Et),ge=!1},d(Et){Et&&Pe(e),on(a),Ba(V,Et),Ba(et,Et),nt=!1,Bi(Je)}}}function U2e(r,e,t){let s,a;const u=Ip();let{schema:f}=e,{systemFields:h=[]}=e,{operators:g}=e,{inModal:v}=e,{modalUrl:_}=e,A="",O=h;f.type=="collection"&&(O=h.filter(se=>se.files===!1));let N=[...f.fields,...O].filter(se=>!["file","json","tab"].includes(se.ui)),L,j="";function z(se){se.preventDefault();let X="";f.fields.find(Te=>Te.name===L.name)&&(X="data.");let we=`filter[${X+L.name}_${a.name}]`;const ye=new URL(_!=null?_:window.location.href);ye.searchParams.set("skip","0"),ye.searchParams.set(we,j),v?u("refresh",ye):window.location=ye}function q(se){var _e,ge;se.preventDefault();let X=(_e=A.split("=")[0])!=null?_e:"";if(!X)return;let we=`filter[${X}]`,ye=(ge=A.split("=")[1])!=null?ge:"";if(!ye)return;const Te=new URL(_!=null?_:window.location.href);Te.searchParams.set("skip","0"),Te.searchParams.set(we,ye),v?u("refresh",Te):window.location=Te}function ee(){L=Aie(this),t(0,L),t(5,N)}function F(){a=Aie(this),t(4,a),t(1,s),t(10,g),t(0,L),t(1,s),t(10,g),t(0,L)}function oe(){j=this.value,t(3,j)}function te(){A=this.value,t(2,A)}return r.$$set=se=>{"schema"in se&&t(8,f=se.schema),"systemFields"in se&&t(9,h=se.systemFields),"operators"in se&&t(10,g=se.operators),"inModal"in se&&t(11,v=se.inModal),"modalUrl"in se&&t(12,_=se.modalUrl)},r.$$.update=()=>{r.$$.dirty&1025&&t(1,s=g.filter(se=>se.uis.includes(L==null?void 0:L.ui)||se.uis[0]=="*")),r.$$.dirty&2&&t(4,a=s[0])},[L,s,A,j,a,N,z,q,f,h,g,v,_,ee,F,oe,te]}class W2e extends xo{constructor(e){super(),Ao(this,e,U2e,V2e,Eo,{schema:8,systemFields:9,operators:10,inModal:11,modalUrl:12})}}function j2e(r){let e,t,s,a,u,f,h,g;return{c(){e=ae("fieldset"),t=ae("label"),s=Kt(`Upload file
|
|
`),a=ae("span"),a.innerHTML='<span class="visually-hidden">Loading...</span>',u=Ze(),f=ae("input"),U(a,"class","spinner-border spinner-border-sm"),U(a,"role","status"),U(a,"aria-hidden","true"),U(f,"class","form-control"),U(f,"type","file"),U(f,"id","formFile"),f.multiple=!0,U(f,"accept",Z2e),f.disabled=r[0],f.hidden=!0,U(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=r[0]},m(v,_){Ie(v,e,_),Y(e,t),Y(t,s),Y(t,a),Y(t,u),Y(t,f),h||(g=En(f,"input",r[1]),h=!0)},p(v,[_]){_&1&&(f.disabled=v[0]),_&1&&(e.disabled=v[0])},i:_n,o:_n,d(v){v&&Pe(e),h=!1,g()}}}let Z2e="";function q2e(r,e,t){const s=Ip(),a=hi("channel");let{schema:u}=e,f=[],h=!1;function g(v){t(0,h=!0),f=v.target.files?[...v.target.files]:[];let _=new FormData;_.append("schema",u.name),Array.from(f).forEach(function(A){_.append("files[]",A)}),s("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",_,{headers:{"Content-Type":"multipart/form-data"}}).then(A=>{A.data.error?s("uploadError",A.data.error):s("uploadComplete",A.data),t(0,h=!1)}).catch(A=>{t(0,h=!1),console.log(A.response.data)})}return r.$$set=v=>{"schema"in v&&t(2,u=v.schema)},[h,g,u]}class G2e extends xo{constructor(e){super(),Ao(this,e,q2e,j2e,Eo,{schema:2})}}function Nae(r,e,t){const s=r.slice();return s[18]=e[t],s}function Pae(r,e,t){const s=r.slice();return s[18]=e[t],s}function K2e(r){let e,t;return e=new fl({props:{icon:"arrow-up-short-wide"}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Y2e(r){let e,t;return e=new fl({props:{icon:"arrow-down-wide-short"}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Iae(r){let e,t,s,a,u,f,h,g,v,_,A,O=r[18].label+"",N,L,j,z,q;a=new fl({props:{icon:"arrow-up-short-wide"}});function ee(...te){return r[10](r[18],...te)}g=new fl({props:{icon:"arrow-down-wide-short"}});function F(...te){return r[11](r[18],...te)}function oe(...te){return r[12](r[18],...te)}return{c(){e=ae("div"),t=ae("div"),s=ae("button"),sn(a.$$.fragment),f=Ze(),h=ae("button"),sn(g.$$.fragment),_=Ze(),A=ae("button"),N=Kt(O),L=Ze(),U(s,"title","Sort Ascending"),U(s,"class",u="btn btn-sm "+(r[18].name==r[0]?"btn-primary":"btn-outline-primary")),U(h,"title","Sort Descending"),U(h,"class",v="btn btn-sm "+("-"+r[18].name==r[0]?"btn-primary":"btn-outline-primary")),U(A,"title","Sort Ascending"),U(A,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(A,"overflow","hidden"),U(t,"class","btn-group w-100"),U(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(te,se){Ie(te,e,se),Y(e,t),Y(t,s),nn(a,s,null),Y(t,f),Y(t,h),nn(g,h,null),Y(t,_),Y(t,A),Y(A,N),Y(e,L),j=!0,z||(q=[En(s,"click",ee),En(h,"click",F),En(A,"click",oe)],z=!0)},p(te,se){r=te,(!j||se&5&&u!==(u="btn btn-sm "+(r[18].name==r[0]?"btn-primary":"btn-outline-primary")))&&U(s,"class",u),(!j||se&5&&v!==(v="btn btn-sm "+("-"+r[18].name==r[0]?"btn-primary":"btn-outline-primary")))&&U(h,"class",v),(!j||se&4)&&O!==(O=r[18].label+"")&&jn(N,O)},i(te){j||(Oe(a.$$.fragment,te),Oe(g.$$.fragment,te),j=!0)},o(te){$e(a.$$.fragment,te),$e(g.$$.fragment,te),j=!1},d(te){te&&Pe(e),on(a),on(g),z=!1,Bi(q)}}}function Bae(r){let e,t,s,a,u,f,h,g,v,_,A,O=r[18].label+"",N,L,j,z,q;a=new fl({props:{icon:"arrow-up-short-wide"}});function ee(...te){return r[13](r[18],...te)}g=new fl({props:{icon:"arrow-down-wide-short"}});function F(...te){return r[14](r[18],...te)}function oe(...te){return r[15](r[18],...te)}return{c(){e=ae("div"),t=ae("div"),s=ae("button"),sn(a.$$.fragment),f=Ze(),h=ae("button"),sn(g.$$.fragment),_=Ze(),A=ae("button"),N=Kt(O),L=Ze(),U(s,"title","Sort Ascending"),U(s,"class",u="btn btn-sm "+(r[18].name==r[0]?"btn-primary":"btn-outline-primary")),U(h,"title","Sort Descending"),U(h,"class",v="btn btn-sm "+("-"+r[18].name==r[0]?"btn-primary":"btn-outline-primary")),U(A,"title","Sort Ascending"),U(A,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(A,"overflow","hidden"),U(t,"class","btn-group w-100"),U(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(te,se){Ie(te,e,se),Y(e,t),Y(t,s),nn(a,s,null),Y(t,f),Y(t,h),nn(g,h,null),Y(t,_),Y(t,A),Y(A,N),Y(e,L),j=!0,z||(q=[En(s,"click",ee),En(h,"click",F),En(A,"click",oe)],z=!0)},p(te,se){r=te,(!j||se&3&&u!==(u="btn btn-sm "+(r[18].name==r[0]?"btn-primary":"btn-outline-primary")))&&U(s,"class",u),(!j||se&3&&v!==(v="btn btn-sm "+("-"+r[18].name==r[0]?"btn-primary":"btn-outline-primary")))&&U(h,"class",v),(!j||se&2)&&O!==(O=r[18].label+"")&&jn(N,O)},i(te){j||(Oe(a.$$.fragment,te),Oe(g.$$.fragment,te),j=!0)},o(te){$e(a.$$.fragment,te),$e(g.$$.fragment,te),j=!1},d(te){te&&Pe(e),on(a),on(g),z=!1,Bi(q)}}}function X2e(r){let e,t,s,a,u,f,h,g=r[3].label+"",v,_,A,O,N,L,j,z,q;const ee=[Y2e,K2e],F=[];function oe(_e,ge){return ge&1&&(s=null),s==null&&(s=!!_e[0].startsWith("-")),s?0:1}a=oe(r,-1),u=F[a]=ee[a](r);let te=r[2],se=[];for(let _e=0;_e<te.length;_e+=1)se[_e]=Iae(Pae(r,te,_e));const X=_e=>$e(se[_e],1,1,()=>{se[_e]=null});let we=r[1],ye=[];for(let _e=0;_e<we.length;_e+=1)ye[_e]=Bae(Nae(r,we,_e));const Te=_e=>$e(ye[_e],1,1,()=>{ye[_e]=null});return{c(){e=ae("div"),t=ae("button"),u.c(),f=Ze(),h=ae("span"),v=Kt(g),_=Ze(),A=ae("div"),O=ae("div");for(let _e=0;_e<se.length;_e+=1)se[_e].c();N=Ze(),L=ae("h6"),L.textContent="System",j=Ze(),z=ae("div");for(let _e=0;_e<ye.length;_e+=1)ye[_e].c();U(h,"class","ms-1"),U(t,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),U(t,"type","button"),U(t,"data-bs-toggle","dropdown"),U(t,"data-bs-auto-close","outside"),U(t,"aria-expanded","false"),U(O,"class","row"),U(L,"class","dropdown-header px-0"),U(z,"class","row"),U(A,"class","dropdown-menu"),ss(A,"width","auto"),ss(A,"max-width","800px"),U(e,"class","")},m(_e,ge){Ie(_e,e,ge),Y(e,t),F[a].m(t,null),Y(t,f),Y(t,h),Y(h,v),Y(e,_),Y(e,A),Y(A,O);for(let nt=0;nt<se.length;nt+=1)se[nt]&&se[nt].m(O,null);Y(A,N),Y(A,L),Y(A,j),Y(A,z);for(let nt=0;nt<ye.length;nt+=1)ye[nt]&&ye[nt].m(z,null);q=!0},p(_e,[ge]){let nt=a;if(a=oe(_e,ge),a!==nt&&(So(),$e(F[nt],1,1,()=>{F[nt]=null}),ko(),u=F[a],u||(u=F[a]=ee[a](_e),u.c()),Oe(u,1),u.m(t,f)),(!q||ge&8)&&g!==(g=_e[3].label+"")&&jn(v,g),ge&53){te=_e[2];let Je;for(Je=0;Je<te.length;Je+=1){const ft=Pae(_e,te,Je);se[Je]?(se[Je].p(ft,ge),Oe(se[Je],1)):(se[Je]=Iae(ft),se[Je].c(),Oe(se[Je],1),se[Je].m(O,null))}for(So(),Je=te.length;Je<se.length;Je+=1)X(Je);ko()}if(ge&51){we=_e[1];let Je;for(Je=0;Je<we.length;Je+=1){const ft=Nae(_e,we,Je);ye[Je]?(ye[Je].p(ft,ge),Oe(ye[Je],1)):(ye[Je]=Bae(ft),ye[Je].c(),Oe(ye[Je],1),ye[Je].m(z,null))}for(So(),Je=we.length;Je<ye.length;Je+=1)Te(Je);ko()}},i(_e){if(!q){Oe(u);for(let ge=0;ge<te.length;ge+=1)Oe(se[ge]);for(let ge=0;ge<we.length;ge+=1)Oe(ye[ge]);q=!0}},o(_e){$e(u),se=se.filter(Boolean);for(let ge=0;ge<se.length;ge+=1)$e(se[ge]);ye=ye.filter(Boolean);for(let ge=0;ge<ye.length;ge+=1)$e(ye[ge]);q=!1},d(_e){_e&&Pe(e),F[a].d(),Ba(se,_e),Ba(ye,_e)}}}function J2e(r,e,t){let s,a,u;const f=Ip();let{schema:h}=e,{sort:g}=e,{inModal:v}=e,{modalUrl:_}=e,{systemFields:A=[]}=e;function O(te){const se=new URL(_!=null?_:window.location.href);se.searchParams.set("sort",te),v?f("refresh",se):window.location=se}function N(te,se){te.preventDefault();let X=A.includes(we=>we.name===se.name)?"":"data.";return O(X+se.name)}function L(te,se){te.preventDefault();let X=A.includes(we=>we.name===se.name)?"":"data.";return O("-"+X+se.name)}const j=(te,se)=>N(se,te),z=(te,se)=>L(se,te),q=(te,se)=>N(se,te),ee=(te,se)=>N(se,te),F=(te,se)=>L(se,te),oe=(te,se)=>N(se,te);return r.$$set=te=>{"schema"in te&&t(6,h=te.schema),"sort"in te&&t(0,g=te.sort),"inModal"in te&&t(7,v=te.inModal),"modalUrl"in te&&t(8,_=te.modalUrl),"systemFields"in te&&t(9,A=te.systemFields)},r.$$.update=()=>{r.$$.dirty&577&&t(3,s=[...h.fields,...A].find(te=>te.name===g||"-"+te.name===g||"data."+te.name===g||"-data."+te.name===g)),r.$$.dirty&64&&t(2,a=h.fields.filter(te=>!["reference","file","json","id","tab"].includes(te.ui))),r.$$.dirty&512&&t(1,u=A),r.$$.dirty&576&&h.type==="collection"&&t(1,u=A.filter(te=>te.files===!1))},[g,u,a,s,N,L,h,v,_,A,j,z,q,ee,F,oe]}class Q2e extends xo{constructor(e){super(),Ao(this,e,J2e,X2e,Eo,{schema:6,sort:0,inModal:7,modalUrl:8,systemFields:9})}}function ewe(r){var N,L;let e,t,s,a,u=((L=(N=r[0].find(r[9]))==null?void 0:N.symbol)!=null?L:"")+"",f,h,g,v,_,A,O;return{c(){e=ae("span"),t=ae("div"),s=Kt(r[4]),a=Ze(),f=Kt(u),h=Ze(),g=Kt(r[2]),v=Ze(),_=ae("button"),U(_,"type","button"),U(_,"class","btn-close btn-close ms-1"),U(_,"aria-label","Close"),U(t,"class","d-flex align-items-center justify-content-center"),U(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-6qi3g8"),ss(e,"line-height","22px ")},m(j,z){Ie(j,e,z),Y(e,t),Y(t,s),Y(t,a),Y(t,f),Y(t,h),Y(t,g),Y(t,v),Y(t,_),A||(O=En(_,"click",r[10]),A=!0)},p(j,[z]){var q,ee;z&1&&u!==(u=((ee=(q=j[0].find(j[9]))==null?void 0:q.symbol)!=null?ee:"")+"")&&jn(f,u),z&4&&jn(g,j[2])},i:_n,o:_n,d(j){j&&Pe(e),A=!1,O()}}}function twe(r,e,t){var ee,F;const s=Ip();let{schema:a}=e,{operators:u}=e,{key:f}=e,{value:h}=e,{inModal:g}=e,{modalUrl:v}=e,_=f.split("_"),A=(ee=_[_.length-1])!=null?ee:"eq",O=f.replace("_"+A,""),N=a.fields.find(oe=>oe.name===O),L=(F=N==null?void 0:N.label)!=null?F:O;function j(oe,te){oe.preventDefault();let se=`filter[${te}]`;const X=new URL(v!=null?v:window.location.href);X.searchParams.set("skip","0"),X.searchParams.delete(se),g?s("refresh",X):window.location=X}const z=oe=>oe.name===A,q=oe=>j(oe,f);return r.$$set=oe=>{"schema"in oe&&t(6,a=oe.schema),"operators"in oe&&t(0,u=oe.operators),"key"in oe&&t(1,f=oe.key),"value"in oe&&t(2,h=oe.value),"inModal"in oe&&t(7,g=oe.inModal),"modalUrl"in oe&&t(8,v=oe.modalUrl)},[u,f,h,A,L,j,a,g,v,z,q]}class nwe extends xo{constructor(e){super(),Ao(this,e,twe,ewe,Eo,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8})}}function Lae(r,e,t){const s=r.slice();return s[18]=e[t][0],s[19]=e[t][1],s}function owe(r){let e;return{c(){e=ae("input"),U(e,"type","search"),U(e,"name","filter[_file.originalName_regex]"),U(e,"placeholder","Search"),U(e,"class","form-control"),e.required=!0},m(t,s){Ie(t,e,s)},p:_n,d(t){t&&Pe(e)}}}function swe(r){let e,t;return{c(){e=ae("input"),U(e,"type","search"),U(e,"name",t="filter[data."+r[0].fields[0].name+"_regex]"),U(e,"placeholder","Search"),U(e,"class","form-control"),e.required=!0},m(s,a){Ie(s,e,a)},p(s,a){a&1&&t!==(t="filter[data."+s[0].fields[0].name+"_regex]")&&U(e,"name",t)},d(s){s&&Pe(e)}}}function rwe(r){let e,t,s;return t=new G2e({props:{schema:r[0]}}),t.$on("uploadComplete",r[10]),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","d-inline-block ms-1")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&1&&(f.schema=a[0]),t.$set(f)},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function iwe(r){let e,t=!r[4]&&Fae(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,a){s[4]?t&&(t.d(1),t=null):t?t.p(s,a):(t=Fae(s),t.c(),t.m(e.parentNode,e))},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function Fae(r){let e,t,s;return{c(){e=ae("a"),t=Kt("New Record"),U(e,"href",s=r[7].lucentUrl+"/records/new?schema="+r[0].name),U(e,"class","btn btn-sm btn-primary")},m(a,u){Ie(a,e,u),Y(e,t)},p(a,u){u&1&&s!==(s=a[7].lucentUrl+"/records/new?schema="+a[0].name)&&U(e,"href",s)},d(a){a&&Pe(e)}}}function Hae(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L;return s=new fl({props:{icon:"ellipsis-vertical"}}),{c(){e=ae("div"),t=ae("button"),sn(s.$$.fragment),a=Ze(),u=ae("ul"),f=ae("li"),h=ae("a"),g=Kt("Export to CSV"),v=Ze(),_=ae("li"),A=ae("a"),O=Kt("View trashed records"),U(t,"class","btn btn-link btn-sm"),U(t,"type","button"),U(t,"data-bs-toggle","dropdown"),U(t,"aria-expanded","false"),U(h,"class","dropdown-item"),U(h,"href",r[8]),U(A,"class","dropdown-item"),U(A,"href",N=r[7].lucentUrl+"/content/"+r[0].name+"?filter[status_in]=trashed"),U(u,"class","dropdown-menu"),U(e,"class","dropdown d-inline-block")},m(j,z){Ie(j,e,z),Y(e,t),nn(s,t,null),Y(e,a),Y(e,u),Y(u,f),Y(f,h),Y(h,g),Y(u,v),Y(u,_),Y(_,A),Y(A,O),L=!0},p(j,z){(!L||z&1&&N!==(N=j[7].lucentUrl+"/content/"+j[0].name+"?filter[status_in]=trashed"))&&U(A,"href",N)},i(j){L||(Oe(s.$$.fragment,j),L=!0)},o(j){$e(s.$$.fragment,j),L=!1},d(j){j&&Pe(e),on(s)}}}function $ae(r){let e,t,s=Object.entries(r[3]),a=[];for(let f=0;f<s.length;f+=1)a[f]=zae(Lae(r,s,f));const u=f=>$e(a[f],1,1,()=>{a[f]=null});return{c(){e=ae("div");for(let f=0;f<a.length;f+=1)a[f].c();U(e,"class","d-flex mb-3")},m(f,h){Ie(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&125){s=Object.entries(f[3]);let g;for(g=0;g<s.length;g+=1){const v=Lae(f,s,g);a[g]?(a[g].p(v,h),Oe(a[g],1)):(a[g]=zae(v),a[g].c(),Oe(a[g],1),a[g].m(e,null))}for(So(),g=s.length;g<a.length;g+=1)u(g);ko()}},i(f){if(!t){for(let h=0;h<s.length;h+=1)Oe(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)$e(a[h]);t=!1},d(f){f&&Pe(e),Ba(a,f)}}}function zae(r){let e,t;return e=new nwe({props:{schema:r[0],operators:r[2],key:r[18],value:r[19],inModal:r[4],modalUrl:r[5],systemFields:r[6]}}),e.$on("refresh",r[15]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.schema=s[0]),a&4&&(u.operators=s[2]),a&8&&(u.key=s[18]),a&8&&(u.value=s[19]),a&16&&(u.inModal=s[4]),a&32&&(u.modalUrl=s[5]),a&64&&(u.systemFields=s[6]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function awe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j=Object.entries(r[3]).length>0,z,q,ee,F;s=new Q2e({props:{schema:r[0],sort:r[1],systemFields:r[6],inModal:r[4],modalUrl:r[5]}}),s.$on("refresh",r[12]);function oe(Je){r[13](Je)}let te={systemFields:r[6],operators:r[2],filter:r[3],inModal:r[4],modalUrl:r[5]};r[0]!==void 0&&(te.schema=r[0]),u=new W2e({props:te}),ts.push(()=>gr(u,"schema",oe)),u.$on("refresh",r[14]);function se(Je,ft){var V;return(V=Je[0].fields[0])!=null&&V.name?swe:owe}let X=se(r),we=X(r);const ye=[iwe,rwe],Te=[];function _e(Je,ft){return Je[0].type==="collection"?0:1}A=_e(r),O=Te[A]=ye[A](r);let ge=!r[4]&&Hae(r),nt=j&&$ae(r);return{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),a=Ze(),sn(u.$$.fragment),h=Ze(),g=ae("form"),we.c(),v=Ze(),_=ae("div"),O.c(),N=Ze(),ge&&ge.c(),L=Ze(),nt&&nt.c(),z=Bs(),U(g,"method","GET"),U(t,"class","d-flex align-items-center"),U(_,"class","d-flex align-items-center "),U(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(Je,ft){Ie(Je,e,ft),Y(e,t),nn(s,t,null),Y(t,a),nn(u,t,null),Y(t,h),Y(t,g),we.m(g,null),Y(e,v),Y(e,_),Te[A].m(_,null),Y(_,N),ge&&ge.m(_,null),Ie(Je,L,ft),nt&&nt.m(Je,ft),Ie(Je,z,ft),q=!0,ee||(F=En(g,"submit",r[9]),ee=!0)},p(Je,[ft]){const V={};ft&1&&(V.schema=Je[0]),ft&2&&(V.sort=Je[1]),ft&64&&(V.systemFields=Je[6]),ft&16&&(V.inModal=Je[4]),ft&32&&(V.modalUrl=Je[5]),s.$set(V);const ut={};ft&64&&(ut.systemFields=Je[6]),ft&4&&(ut.operators=Je[2]),ft&8&&(ut.filter=Je[3]),ft&16&&(ut.inModal=Je[4]),ft&32&&(ut.modalUrl=Je[5]),!f&&ft&1&&(f=!0,ut.schema=Je[0],Cr(()=>f=!1)),u.$set(ut),X===(X=se(Je))&&we?we.p(Je,ft):(we.d(1),we=X(Je),we&&(we.c(),we.m(g,null)));let et=A;A=_e(Je),A===et?Te[A].p(Je,ft):(So(),$e(Te[et],1,1,()=>{Te[et]=null}),ko(),O=Te[A],O?O.p(Je,ft):(O=Te[A]=ye[A](Je),O.c()),Oe(O,1),O.m(_,N)),Je[4]?ge&&(So(),$e(ge,1,1,()=>{ge=null}),ko()):ge?(ge.p(Je,ft),ft&16&&Oe(ge,1)):(ge=Hae(Je),ge.c(),Oe(ge,1),ge.m(_,null)),ft&8&&(j=Object.entries(Je[3]).length>0),j?nt?(nt.p(Je,ft),ft&8&&Oe(nt,1)):(nt=$ae(Je),nt.c(),Oe(nt,1),nt.m(z.parentNode,z)):nt&&(So(),$e(nt,1,1,()=>{nt=null}),ko())},i(Je){q||(Oe(s.$$.fragment,Je),Oe(u.$$.fragment,Je),Oe(O),Oe(ge),Oe(nt),q=!0)},o(Je){$e(s.$$.fragment,Je),$e(u.$$.fragment,Je),$e(O),$e(ge),$e(nt),q=!1},d(Je){Je&&Pe(e),on(s),on(u),we.d(),Te[A].d(),ge&&ge.d(),Je&&Pe(L),nt&&nt.d(Je),Je&&Pe(z),ee=!1,F()}}}function lwe(r,e,t){const s=hi("channel"),a=Ip();let{sort:u}=e,{schema:f}=e,{operators:h}=e,{filter:g}=e,{inModal:v}=e,{modalUrl:_}=e,{records:A}=e,{systemFields:O=[]}=e,N=new URL(window.location.href),L=N.pathname+"/csv?"+N.searchParams.toString();function j(te){te.preventDefault();const se=new FormData(te.target);let X=se.keys().next().value,we=se.values().next().value;const ye=new URL(_!=null?_:window.location.href);ye.searchParams.set("skip","0"),ye.searchParams.set(X,we),v?a("refresh",ye):window.location=ye}function z(te){t(11,A=te.detail)}function q(te){Tz.call(this,r,te)}function ee(te){f=te,t(0,f)}function F(te){Tz.call(this,r,te)}function oe(te){Tz.call(this,r,te)}return r.$$set=te=>{"sort"in te&&t(1,u=te.sort),"schema"in te&&t(0,f=te.schema),"operators"in te&&t(2,h=te.operators),"filter"in te&&t(3,g=te.filter),"inModal"in te&&t(4,v=te.inModal),"modalUrl"in te&&t(5,_=te.modalUrl),"records"in te&&t(11,A=te.records),"systemFields"in te&&t(6,O=te.systemFields)},[f,u,h,g,v,_,O,s,L,j,z,A,q,ee,F,oe]}class cwe extends xo{constructor(e){super(),Ao(this,e,lwe,awe,Eo,{sort:1,schema:0,operators:2,filter:3,inModal:4,modalUrl:5,records:11,systemFields:6})}}function Vae(r,e,t){const s=r.slice();return s[9]=e[t],s}function uwe(r){let e,t=r[9]+"",s,a,u,f;function h(...g){return r[7](r[9],...g)}return{c(){e=ae("a"),s=Kt(t),U(e,"class","page-link"),U(e,"href",a=r[2](r[9]))},m(g,v){Ie(g,e,v),Y(e,s),u||(f=En(e,"click",h),u=!0)},p(g,v){r=g,v&1&&t!==(t=r[9]+"")&&jn(s,t),v&1&&a!==(a=r[2](r[9]))&&U(e,"href",a)},d(g){g&&Pe(e),u=!1,f()}}}function fwe(r){let e,t=r[9]+"",s;return{c(){e=ae("span"),s=Kt(t),U(e,"class","page-link active")},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&1&&t!==(t=a[9]+"")&&jn(s,t)},d(a){a&&Pe(e)}}}function Uae(r){let e,t;function s(f,h){return f[1]==f[9]?fwe:uwe}let a=s(r),u=a(r);return{c(){e=ae("li"),u.c(),t=Ze(),U(e,"class","page-item")},m(f,h){Ie(f,e,h),u.m(e,null),Y(e,t)},p(f,h){a===(a=s(f))&&u?u.p(f,h):(u.d(1),u=a(f),u&&(u.c(),u.m(e,t)))},d(f){f&&Pe(e),u.d()}}}function dwe(r){let e,t=r[0],s=[];for(let a=0;a<t.length;a+=1)s[a]=Uae(Vae(r,t,a));return{c(){for(let a=0;a<s.length;a+=1)s[a].c();e=Bs()},m(a,u){for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(a,u);Ie(a,e,u)},p(a,[u]){if(u&15){t=a[0];let f;for(f=0;f<t.length;f+=1){const h=Vae(a,t,f);s[f]?s[f].p(h,u):(s[f]=Uae(h),s[f].c(),s[f].m(e.parentNode,e))}for(;f<s.length;f+=1)s[f].d(1);s.length=t.length}},i:_n,o:_n,d(a){Ba(s,a),a&&Pe(e)}}}function hwe(r,e,t){const s=Ip();let{pages:a}=e,{limit:u}=e,{currentPage:f}=e,{inModal:h}=e,{modalUrl:g}=e;function v(O){const N=new URL(g!=null?g:window.location.href);let L=O*u-u;return N.searchParams.set("skip",L),N}function _(O,N){O.preventDefault();const L=new URL(g!=null?g:window.location.href);let j=N*u-u;L.searchParams.set("skip",j),h?s("refresh",L):window.location=L}const A=(O,N)=>_(N,O);return r.$$set=O=>{"pages"in O&&t(0,a=O.pages),"limit"in O&&t(4,u=O.limit),"currentPage"in O&&t(1,f=O.currentPage),"inModal"in O&&t(5,h=O.inModal),"modalUrl"in O&&t(6,g=O.modalUrl)},[a,f,v,_,u,h,g,A]}class mwe extends xo{constructor(e){super(),Ao(this,e,hwe,dwe,Eo,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function Wae(r){let e,t,s,a,u,f,h,g,v,_;return a=new mwe({props:{pages:r[7],currentPage:r[6],limit:r[2],inModal:r[0],modalUrl:r[1]}}),a.$on("refresh",r[10]),{c(){e=ae("li"),t=ae("a"),t.textContent="First",s=Ze(),sn(a.$$.fragment),u=Ze(),f=ae("li"),h=ae("a"),h.textContent="Last",U(t,"href","/"),U(t,"class","page-link"),U(e,"class","page-item disabled"),vs(e,"disabled",r[6]===1),U(h,"class","page-link"),U(h,"href","/"),vs(h,"disabled",r[6]===r[5]),U(f,"class","page-item")},m(A,O){Ie(A,e,O),Y(e,t),Ie(A,s,O),nn(a,A,O),Ie(A,u,O),Ie(A,f,O),Y(f,h),g=!0,v||(_=[En(t,"click",r[9]),En(h,"click",r[8])],v=!0)},p(A,O){(!g||O&64)&&vs(e,"disabled",A[6]===1);const N={};O&128&&(N.pages=A[7]),O&64&&(N.currentPage=A[6]),O&4&&(N.limit=A[2]),O&1&&(N.inModal=A[0]),O&2&&(N.modalUrl=A[1]),a.$set(N),(!g||O&96)&&vs(h,"disabled",A[6]===A[5])},i(A){g||(Oe(a.$$.fragment,A),g=!0)},o(A){$e(a.$$.fragment,A),g=!1},d(A){A&&Pe(e),A&&Pe(s),on(a,A),A&&Pe(u),A&&Pe(f),v=!1,Bi(_)}}}function gwe(r){let e,t,s,a,u,f,h=+r[3]+1+"",g,v,_,A=(+r[3]+r[2]>r[4]?r[4]:+r[3]+r[2])+"",O,N,L,j,z,q,ee=r[5]>1&&Wae(r);return{c(){e=ae("nav"),t=ae("ul"),ee&&ee.c(),s=Ze(),a=ae("p"),u=Kt(`Showing
|
|
`),f=ae("span"),g=Kt(h),v=Kt(`
|
|
to
|
|
`),_=ae("span"),O=Kt(A),N=Kt(`
|
|
of
|
|
`),L=ae("span"),j=Kt(r[4]),z=Kt(`
|
|
total`),U(t,"class","pagination justify-content-center"),U(f,"class","font-medium"),U(_,"class","font-medium"),U(L,"class","font-medium"),U(a,"class","text-muted text-center")},m(F,oe){Ie(F,e,oe),Y(e,t),ee&&ee.m(t,null),Ie(F,s,oe),Ie(F,a,oe),Y(a,u),Y(a,f),Y(f,g),Y(a,v),Y(a,_),Y(_,O),Y(a,N),Y(a,L),Y(L,j),Y(a,z),q=!0},p(F,[oe]){F[5]>1?ee?(ee.p(F,oe),oe&32&&Oe(ee,1)):(ee=Wae(F),ee.c(),Oe(ee,1),ee.m(t,null)):ee&&(So(),$e(ee,1,1,()=>{ee=null}),ko()),(!q||oe&8)&&h!==(h=+F[3]+1+"")&&jn(g,h),(!q||oe&28)&&A!==(A=(+F[3]+F[2]>F[4]?F[4]:+F[3]+F[2])+"")&&jn(O,A),(!q||oe&16)&&jn(j,F[4])},i(F){q||(Oe(ee),q=!0)},o(F){$e(ee),q=!1},d(F){F&&Pe(e),ee&&ee.d(),F&&Pe(s),F&&Pe(a)}}}function pwe(r,e,t){let s,a,u;const f=Ip();let{inModal:h}=e,{modalUrl:g}=e,{limit:v}=e,{skip:_}=e,{total:A}=e;function O(z){z.preventDefault(),L(s)}function N(z){z.preventDefault(),L(1)}function L(z){const q=new URL(g!=null?g:window.location.href);let ee=z*v-v;q.searchParams.set("skip",ee),h?f("refresh",q):window.location=q}function j(z){Tz.call(this,r,z)}return r.$$set=z=>{"inModal"in z&&t(0,h=z.inModal),"modalUrl"in z&&t(1,g=z.modalUrl),"limit"in z&&t(2,v=z.limit),"skip"in z&&t(3,_=z.skip),"total"in z&&t(4,A=z.total)},r.$$.update=()=>{r.$$.dirty&20&&t(5,s=Math.ceil(A/v)),r.$$.dirty&12&&t(6,a=Math.ceil((_-1)/v)+1),r.$$.dirty&96&&t(7,u=fd.exports.range(a-3,a+4).filter(z=>z>0&&z<=s))},[h,g,v,_,A,s,a,u,O,N,j]}class bwe extends xo{constructor(e){super(),Ao(this,e,pwe,gwe,Eo,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function vwe(r){let e,t,s;return{c(){e=ae("button"),e.textContent="Move to trash",U(e,"type","button"),U(e,"class","btn btn-sm btn-outline-primary")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",Hu(r[9])),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function ywe(r){let e,t,s,a,u,f,h=r[1].hasDrafts&&jae(r);return{c(){e=ae("button"),e.textContent="Publish",t=Ze(),h&&h.c(),s=Ze(),a=ae("button"),a.textContent="Delete forever",U(e,"type","button"),U(e,"class","btn btn-sm btn-outline-primary"),U(a,"type","button"),U(a,"class","btn btn-sm btn-outline-primary")},m(g,v){Ie(g,e,v),Ie(g,t,v),h&&h.m(g,v),Ie(g,s,v),Ie(g,a,v),u||(f=[En(e,"click",Hu(r[7])),En(a,"click",Hu(r[3]))],u=!0)},p(g,v){g[1].hasDrafts?h?h.p(g,v):(h=jae(g),h.c(),h.m(s.parentNode,s)):h&&(h.d(1),h=null)},d(g){g&&Pe(e),g&&Pe(t),h&&h.d(g),g&&Pe(s),g&&Pe(a),u=!1,Bi(f)}}}function jae(r){let e,t,s;return{c(){e=ae("button"),e.textContent="Make Draft",U(e,"type","button"),U(e,"class","btn btn-sm btn-outline-primary")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",Hu(r[8])),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function wwe(r){let e,t,s=r[0].length+"",a,u,f,h,g,v,_,A,O,N;function L(q,ee){return q[2].status_in==="trashed"?ywe:vwe}let j=L(r),z=j(r);return{c(){e=ae("div"),t=ae("span"),a=Kt(s),u=Kt(" records selected"),f=Ze(),h=ae("div"),g=ae("button"),g.textContent="Publish",v=Ze(),_=ae("button"),_.textContent="Make Draft",A=Ze(),z.c(),U(t,"class","me-2"),U(g,"type","button"),U(g,"class","btn btn-sm btn-outline-primary"),U(_,"type","button"),U(_,"class","btn btn-sm btn-outline-primary"),U(h,"class","btn-group "),U(h,"role","group"),U(h,"aria-label","Basic example"),U(e,"class","d-flex align-items-center mb-3")},m(q,ee){Ie(q,e,ee),Y(e,t),Y(t,a),Y(t,u),Y(e,f),Y(e,h),Y(h,g),Y(h,v),Y(h,_),Y(h,A),z.m(h,null),O||(N=[En(g,"click",Hu(r[5])),En(_,"click",Hu(r[6]))],O=!0)},p(q,[ee]){ee&1&&s!==(s=q[0].length+"")&&jn(a,s),j===(j=L(q))&&z?z.p(q,ee):(z.d(1),z=j(q),z&&(z.c(),z.m(h,null)))},i:_n,o:_n,d(q){q&&Pe(e),z.d(),O=!1,Bi(N)}}}function _we(r,e,t){const s=hi("channel");let{selected:a}=e,{schema:u}=e,{filter:f}=e;function h(L){L.preventDefault(),axios.post(s.lucentUrl+"/records/delete",{ids:a.map(j=>j.id)}).then(j=>{window.location.reload()}).catch(j=>{console.log(j)})}function g(L,j){axios.post(s.lucentUrl+"/records/status/"+j,{schemaName:u.name,records:a}).then(z=>{window.location.reload()}).catch(z=>{console.log(z)})}const v=L=>g(L,"published"),_=L=>g(L,"draft"),A=L=>g(L,"published"),O=L=>g(L,"draft"),N=L=>g(L,"trashed");return r.$$set=L=>{"selected"in L&&t(0,a=L.selected),"schema"in L&&t(1,u=L.schema),"filter"in L&&t(2,f=L.filter)},[a,u,f,h,g,v,_,A,O,N]}class Cwe extends xo{constructor(e){super(),Ao(this,e,_we,wwe,Eo,{selected:0,schema:1,filter:2})}}function Swe(r){let e;return{c(){e=Kt(r[0])},m(t,s){Ie(t,e,s)},p(t,[s]){s&1&&jn(e,t[0])},i:_n,o:_n,d(t){t&&Pe(e)}}}function kwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Ewe extends xo{constructor(e){super(),Ao(this,e,kwe,Swe,Eo,{value:0})}}function Zae(r){let e,t,s,a;return{c(){e=ae("div"),t=ae("span"),s=Ze(),a=Kt(r[0]),U(t,"class","color border border-2 svelte-78o2k4"),ss(t,"background",r[0]),U(e,"class","d-inline-flex")},m(u,f){Ie(u,e,f),Y(e,t),Y(e,s),Y(e,a)},p(u,f){f&1&&ss(t,"background",u[0]),f&1&&jn(a,u[0])},d(u){u&&Pe(e)}}}function Awe(r){let e,t=r[0]&&Zae(r);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Ie(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Zae(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_n,o:_n,d(s){t&&t.d(s),s&&Pe(e)}}}function xwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Twe extends xo{constructor(e){super(),Ao(this,e,xwe,Awe,Eo,{value:0})}}function qae(r,e,t){const s=r.slice();return s[5]=e[t],s}function Gae(r){let e,t,s,a;return t=new aI({props:{schemas:r[0],graph:r[1],record:r[5]}}),{c(){e=ae("span"),sn(t.$$.fragment),s=Ze(),U(e,"class","mr-3")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p(u,f){const h={};f&1&&(h.schemas=u[0]),f&2&&(h.graph=u[1]),f&4&&(h.record=u[5]),t.$set(h)},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function Dwe(r){let e,t,s=r[2],a=[];for(let f=0;f<s.length;f+=1)a[f]=Gae(qae(r,s,f));const u=f=>$e(a[f],1,1,()=>{a[f]=null});return{c(){e=ae("div");for(let f=0;f<a.length;f+=1)a[f].c();U(e,"class","references svelte-15ilpfz")},m(f,h){Ie(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,[h]){if(h&7){s=f[2];let g;for(g=0;g<s.length;g+=1){const v=qae(f,s,g);a[g]?(a[g].p(v,h),Oe(a[g],1)):(a[g]=Gae(v),a[g].c(),Oe(a[g],1),a[g].m(e,null))}for(So(),g=s.length;g<a.length;g+=1)u(g);ko()}},i(f){if(!t){for(let h=0;h<s.length;h+=1)Oe(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)$e(a[h]);t=!1},d(f){f&&Pe(e),Ba(a,f)}}}function Owe(r,e,t){let s,{record:a}=e,{field:u}=e,{schemas:f}=e,{graph:h}=e;return r.$$set=g=>{"record"in g&&t(3,a=g.record),"field"in g&&t(4,u=g.field),"schemas"in g&&t(0,f=g.schemas),"graph"in g&&t(1,h=g.graph)},r.$$.update=()=>{var g,v;r.$$.dirty&26&&t(2,s=(v=(g=h.edges)==null?void 0:g.filter(_=>_.field===u.name&&_.source===a.id).map(_=>h.records.find(A=>A.id===_.target)).filter(_=>!!_))!=null?v:[])},[f,h,s,a,u]}class Zhe extends xo{constructor(e){super(),Ao(this,e,Owe,Dwe,Eo,{record:3,field:4,schemas:0,graph:1})}}function Mwe(r){let e;return{c(){e=Kt(r[0])},m(t,s){Ie(t,e,s)},p(t,[s]){s&1&&jn(e,t[0])},i:_n,o:_n,d(t){t&&Pe(e)}}}function Rwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Nwe extends xo{constructor(e){super(),Ao(this,e,Rwe,Mwe,Eo,{value:0})}}function Pwe(r){let e,t;return{c(){e=ae("div"),t=Kt(r[0]),U(e,"title",r[0]),U(e,"data-bs-toggle","tooltip"),U(e,"data-bs-placement","top"),U(e,"class","svelte-1ft053t")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,[a]){a&1&&jn(t,s[0]),a&1&&U(e,"title",s[0])},i:_n,o:_n,d(s){s&&Pe(e)}}}function Iwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class ute extends xo{constructor(e){super(),Ao(this,e,Iwe,Pwe,Eo,{value:0})}}function Bwe(r){let e,t;return{c(){e=ae("a"),t=Kt(r[0]),U(e,"href",r[0]),U(e,"target","_blank")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,[a]){a&1&&jn(t,s[0]),a&1&&U(e,"href",s[0])},i:_n,o:_n,d(s){s&&Pe(e)}}}function Lwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Fwe extends xo{constructor(e){super(),Ao(this,e,Lwe,Bwe,Eo,{value:0})}}function Hwe(r){let e;return{c(){e=Kt(r[0])},m(t,s){Ie(t,e,s)},p(t,[s]){s&1&&jn(e,t[0])},i:_n,o:_n,d(t){t&&Pe(e)}}}function $we(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Kae extends xo{constructor(e){super(),Ao(this,e,$we,Hwe,Eo,{value:0})}}function Yae(r,e,t){const s=r.slice();return s[4]=e[t],s}function Xae(r){let e,t,s,a;return t=new P_({props:{record:r[4],size:"tiny"}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),U(e,"class","me-1")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p:_n,i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function zwe(r){let e,t,s=r[0],a=[];for(let f=0;f<s.length;f+=1)a[f]=Xae(Yae(r,s,f));const u=f=>$e(a[f],1,1,()=>{a[f]=null});return{c(){e=ae("div");for(let f=0;f<a.length;f+=1)a[f].c();U(e,"class","d-flex me-1")},m(f,h){Ie(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,[h]){if(h&1){s=f[0];let g;for(g=0;g<s.length;g+=1){const v=Yae(f,s,g);a[g]?(a[g].p(v,h),Oe(a[g],1)):(a[g]=Xae(v),a[g].c(),Oe(a[g],1),a[g].m(e,null))}for(So(),g=s.length;g<a.length;g+=1)u(g);ko()}},i(f){if(!t){for(let h=0;h<s.length;h+=1)Oe(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)$e(a[h]);t=!1},d(f){f&&Pe(e),Ba(a,f)}}}function Vwe(r,e,t){var h;let{record:s}=e,{field:a}=e,{graph:u}=e,f=(h=u.edges)==null?void 0:h.filter(g=>g.field===a.name&&g.source===s.id).map(g=>u.records.find(v=>v.id===g.target));return console.log(f),r.$$set=g=>{"record"in g&&t(1,s=g.record),"field"in g&&t(2,a=g.field),"graph"in g&&t(3,u=g.graph)},[f,s,a,u]}class qhe extends xo{constructor(e){super(),Ao(this,e,Vwe,zwe,Eo,{record:1,field:2,graph:3})}}function Uwe(r){let e,t;return{c(){e=ae("span"),t=Kt(r[0]),U(e,"class","badge rounded-pill bg-primary bg-opacity-75"),ss(e,"max-width","64px"),ss(e,"overflow","hidden"),ss(e,"white-space","nowrap"),ss(e,"text-overflow","ellipsis"),U(e,"title",r[0]),U(e,"data-bs-toggle","tooltip")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,[a]){a&1&&jn(t,s[0]),a&1&&U(e,"title",s[0])},i:_n,o:_n,d(s){s&&Pe(e)}}}function Wwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class jwe extends xo{constructor(e){super(),Ao(this,e,Wwe,Uwe,Eo,{value:0})}}function Zwe(r){let e,t;return{c(){e=ae("div"),t=Kt(r[0]),U(e,"class","svelte-1ft053t")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,[a]){a&1&&jn(t,s[0])},i:_n,o:_n,d(s){s&&Pe(e)}}}function qwe(r,e,t){let{value:s}=e;return r.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Gwe extends xo{constructor(e){super(),Ao(this,e,qwe,Zwe,Eo,{value:0})}}function Kwe(r){let e,t,s;var a=r[4][r[0].info.name];function u(f){return{props:{value:f[2].data[f[0].name],record:f[2],graph:f[3],schema:f[1],field:f[0]}}}return a&&(e=dk(a,u(r))),{c(){e&&sn(e.$$.fragment),t=Bs()},m(f,h){e&&nn(e,f,h),Ie(f,t,h),s=!0},p(f,[h]){const g={};if(h&5&&(g.value=f[2].data[f[0].name]),h&4&&(g.record=f[2]),h&8&&(g.graph=f[3]),h&2&&(g.schema=f[1]),h&1&&(g.field=f[0]),h&1&&a!==(a=f[4][f[0].info.name])){if(e){So();const v=e;$e(v.$$.fragment,1,0,()=>{on(v,1)}),ko()}a?(e=dk(a,u(f)),sn(e.$$.fragment),Oe(e.$$.fragment,1),nn(e,t.parentNode,t)):e=null}else a&&e.$set(g)},i(f){s||(e&&Oe(e.$$.fragment,f),s=!0)},o(f){e&&$e(e.$$.fragment,f),s=!1},d(f){f&&Pe(t),e&&on(e,f)}}}function Ywe(r,e,t){const s={text:ute,slug:ute,rich:Gwe,textarea:ute,color:Twe,checkbox:Ewe,reference:Zhe,number:Nwe,url:Fwe,date:Kae,datetime:Kae,uuid:jwe,file:qhe};let{field:a}=e,{schema:u}=e,{record:f}=e,{graph:h}=e;return r.$$set=g=>{"field"in g&&t(0,a=g.field),"schema"in g&&t(1,u=g.schema),"record"in g&&t(2,f=g.record),"graph"in g&&t(3,h=g.graph)},[a,u,f,h,s]}class Ghe extends xo{constructor(e){super(),Ao(this,e,Ywe,Kwe,Eo,{field:0,schema:1,record:2,graph:3})}}function Dp(r,e){var t,s;return r&&(s=(t=r.find(a=>a.id===e))==null?void 0:t.name)!=null?s:e}function Jae(r,e,t){const s=r.slice();return s[6]=e[t],s[8]=t,s}function Qae(r){let e,t,s,a;return t=new Ghe({props:{record:r[3],schema:r[0],graph:r[2],field:r[6]}}),{c(){e=ae("td"),sn(t.$$.fragment),U(e,"class",s="field-ui-"+r[6].info.name),vs(e,"is-sort","-"+r[6].name==r[4]||r[6].name==r[4])},m(u,f){Ie(u,e,f),nn(t,e,null),a=!0},p(u,f){const h={};f&8&&(h.record=u[3]),f&1&&(h.schema=u[0]),f&4&&(h.graph=u[2]),f&32&&(h.field=u[6]),t.$set(h),(!a||f&32&&s!==(s="field-ui-"+u[6].info.name))&&U(e,"class",s),(!a||f&48)&&vs(e,"is-sort","-"+u[6].name==u[4]||u[6].name==u[4])},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function ele(r){let e,t,s;return t=new jV({props:{status:r[3].status}}),{c(){e=ae("td"),sn(t.$$.fragment),U(e,"class","text-center"),vs(e,"is-sort",r[4]=="-status"||r[4]=="status")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&8&&(f.status=a[3].status),t.$set(f),(!s||u&16)&&vs(e,"is-sort",a[4]=="-status"||a[4]=="status")},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function tle(r){let e,t,s;return t=new i2({props:{name:Dp(r[1],r[3]._sys.createdBy),side:24}}),{c(){e=ae("td"),sn(t.$$.fragment),U(e,"class","text-center"),vs(e,"is-sort",r[4]=="-_sys.createdBy"||r[4]=="_sys.createdBy")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&10&&(f.name=Dp(a[1],a[3]._sys.createdBy)),t.$set(f),(!s||u&16)&&vs(e,"is-sort",a[4]=="-_sys.createdBy"||a[4]=="_sys.createdBy")},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function nle(r){let e,t,s;return t=new i2({props:{name:Dp(r[1],r[3]._sys.updatedBy),side:24}}),{c(){e=ae("td"),sn(t.$$.fragment),U(e,"class","text-center"),vs(e,"is-sort",r[4]=="-_sys.updatedBy"||r[4]=="_sys.updatedBy")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&10&&(f.name=Dp(a[1],a[3]._sys.updatedBy)),t.$set(f),(!s||u&16)&&vs(e,"is-sort",a[4]=="-_sys.updatedBy"||a[4]=="_sys.updatedBy")},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function ole(r){let e,t=Qy(r[3]._sys.createdAt)+"",s;return{c(){e=ae("td"),s=Kt(t),vs(e,"is-sort",r[4]=="-_sys.createdAt"||r[4]=="_sys.createdAt")},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&8&&t!==(t=Qy(a[3]._sys.createdAt)+"")&&jn(s,t),u&16&&vs(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&Pe(e)}}}function sle(r){let e,t=Qy(r[3]._sys.updatedAt)+"",s;return{c(){e=ae("td"),s=Kt(t),vs(e,"is-sort",r[4]=="-_sys.updatedAt"||r[4]=="_sys.updatedAt")},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&8&&t!==(t=Qy(a[3]._sys.updatedAt)+"")&&jn(s,t),u&16&&vs(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&Pe(e)}}}function Xwe(r){let e,t=r[0].visible.includes("status"),s,a=r[0].visible.includes("_sys.createdBy"),u,f=r[0].visible.includes("_sys.updatedBy"),h,g=r[0].visible.includes("_sys.createdAt"),v,_=r[0].visible.includes("_sys.updatedAt"),A,O,N=r[5],L=[];for(let te=0;te<N.length;te+=1)L[te]=Qae(Jae(r,N,te));const j=te=>$e(L[te],1,1,()=>{L[te]=null});let z=t&&ele(r),q=a&&tle(r),ee=f&&nle(r),F=g&&ole(r),oe=_&&sle(r);return{c(){for(let te=0;te<L.length;te+=1)L[te].c();e=Ze(),z&&z.c(),s=Ze(),q&&q.c(),u=Ze(),ee&&ee.c(),h=Ze(),F&&F.c(),v=Ze(),oe&&oe.c(),A=Bs()},m(te,se){for(let X=0;X<L.length;X+=1)L[X]&&L[X].m(te,se);Ie(te,e,se),z&&z.m(te,se),Ie(te,s,se),q&&q.m(te,se),Ie(te,u,se),ee&&ee.m(te,se),Ie(te,h,se),F&&F.m(te,se),Ie(te,v,se),oe&&oe.m(te,se),Ie(te,A,se),O=!0},p(te,[se]){if(se&61){N=te[5];let X;for(X=0;X<N.length;X+=1){const we=Jae(te,N,X);L[X]?(L[X].p(we,se),Oe(L[X],1)):(L[X]=Qae(we),L[X].c(),Oe(L[X],1),L[X].m(e.parentNode,e))}for(So(),X=N.length;X<L.length;X+=1)j(X);ko()}se&1&&(t=te[0].visible.includes("status")),t?z?(z.p(te,se),se&1&&Oe(z,1)):(z=ele(te),z.c(),Oe(z,1),z.m(s.parentNode,s)):z&&(So(),$e(z,1,1,()=>{z=null}),ko()),se&1&&(a=te[0].visible.includes("_sys.createdBy")),a?q?(q.p(te,se),se&1&&Oe(q,1)):(q=tle(te),q.c(),Oe(q,1),q.m(u.parentNode,u)):q&&(So(),$e(q,1,1,()=>{q=null}),ko()),se&1&&(f=te[0].visible.includes("_sys.updatedBy")),f?ee?(ee.p(te,se),se&1&&Oe(ee,1)):(ee=nle(te),ee.c(),Oe(ee,1),ee.m(h.parentNode,h)):ee&&(So(),$e(ee,1,1,()=>{ee=null}),ko()),se&1&&(g=te[0].visible.includes("_sys.createdAt")),g?F?F.p(te,se):(F=ole(te),F.c(),F.m(v.parentNode,v)):F&&(F.d(1),F=null),se&1&&(_=te[0].visible.includes("_sys.updatedAt")),_?oe?oe.p(te,se):(oe=sle(te),oe.c(),oe.m(A.parentNode,A)):oe&&(oe.d(1),oe=null)},i(te){if(!O){for(let se=0;se<N.length;se+=1)Oe(L[se]);Oe(z),Oe(q),Oe(ee),O=!0}},o(te){L=L.filter(Boolean);for(let se=0;se<L.length;se+=1)$e(L[se]);$e(z),$e(q),$e(ee),O=!1},d(te){Ba(L,te),te&&Pe(e),z&&z.d(te),te&&Pe(s),q&&q.d(te),te&&Pe(u),ee&&ee.d(te),te&&Pe(h),F&&F.d(te),te&&Pe(v),oe&&oe.d(te),te&&Pe(A)}}}function Jwe(r,e,t){let{schema:s}=e,{users:a}=e,{graph:u}=e,{record:f}=e,{sort:h}=e,{visibleColumns:g}=e;return r.$$set=v=>{"schema"in v&&t(0,s=v.schema),"users"in v&&t(1,a=v.users),"graph"in v&&t(2,u=v.graph),"record"in v&&t(3,f=v.record),"sort"in v&&t(4,h=v.sort),"visibleColumns"in v&&t(5,g=v.visibleColumns)},[s,a,u,f,h,g]}class Qwe extends xo{constructor(e){super(),Ao(this,e,Jwe,Xwe,Eo,{schema:0,users:1,graph:2,record:3,sort:4,visibleColumns:5})}}function rle(r,e,t){const s=r.slice();return s[15]=e[t],s}function ile(r,e,t){const s=r.slice();return s[18]=e[t],s}function ale(r,e,t){const s=r.slice();return s[21]=e[t],s}function lle(r){let e,t=r[21].label+"",s,a,u;return{c(){e=ae("th"),s=Kt(t),U(e,"class",a="field-ui-"+r[21].ui),U(e,"scope","col"),U(e,"title",u=r[21].help),U(e,"data-bs-toggle","tooltip"),U(e,"data-bs-placement","top"),vs(e,"is-sort","-"+r[21].name==r[6]||r[21].name==r[6])},m(f,h){Ie(f,e,h),Y(e,s)},p(f,h){h&256&&t!==(t=f[21].label+"")&&jn(s,t),h&256&&a!==(a="field-ui-"+f[21].ui)&&U(e,"class",a),h&256&&u!==(u=f[21].help)&&U(e,"title",u),h&320&&vs(e,"is-sort","-"+f[21].name==f[6]||f[21].name==f[6])},d(f){f&&Pe(e)}}}function cle(r){let e,t=r[18].label+"",s;return{c(){e=ae("th"),s=Kt(t)},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&34&&t!==(t=a[18].label+"")&&jn(s,t)},d(a){a&&Pe(e)}}}function ule(r,e){let t,s,a,u,f,h,g,v,_,A,O=dd(e[9].schemas,e[15],e[4])+"",N,L,j,z,q,ee,F,oe,te,se,X,we,ye;function Te(...ge){return e[13](e[15],...ge)}function _e(...ge){return e[14](e[15],...ge)}return F=new i2({props:{name:Dp(e[2],e[15]._sys.updatedBy),side:24}}),te=new Qwe({props:{record:e[15],graph:e[4],schema:e[1],visibleColumns:e[8],sort:e[6],systemFields:e[5],inModal:e[7],users:e[2]}}),{key:r,first:null,c(){t=ae("tr"),s=ae("td"),a=ae("div"),u=ae("div"),f=ae("div"),h=ae("input"),_=Ze(),A=ae("a"),N=Kt(O),q=Ze(),ee=ae("div"),sn(F.$$.fragment),oe=Ze(),sn(te.$$.fragment),se=Ze(),U(h,"class","form-check-input "),U(h,"type","checkbox"),h.checked=g=e[0].find(Te),h.value=v=e[15],U(f,"class","form-check"),U(A,"class","me-2 text-decoration-none text-dark fs-6"),U(A,"href",L=e[9].lucentUrl+"/records/"+e[15].id),U(A,"target",j=e[7]?"_blank":"_self"),U(A,"title",z=dd(e[9].schemas,e[15],e[4])),U(A,"data-bs-toggle","tooltip"),U(A,"data-bs-placement","left"),U(u,"class","d-flex align-items-center "),U(a,"class","title-td-contents d-inline-flex justify-content-between w-100 align-items-center"),U(s,"class","title-td"),this.first=t},m(ge,nt){Ie(ge,t,nt),Y(t,s),Y(s,a),Y(a,u),Y(u,f),Y(f,h),Y(u,_),Y(u,A),Y(A,N),Y(a,q),Y(a,ee),nn(F,ee,null),Y(t,oe),nn(te,t,null),Y(t,se),X=!0,we||(ye=En(h,"change",_e),we=!0)},p(ge,nt){e=ge,(!X||nt&9&&g!==(g=e[0].find(Te)))&&(h.checked=g),(!X||nt&8&&v!==(v=e[15]))&&(h.value=v),(!X||nt&24)&&O!==(O=dd(e[9].schemas,e[15],e[4])+"")&&jn(N,O),(!X||nt&8&&L!==(L=e[9].lucentUrl+"/records/"+e[15].id))&&U(A,"href",L),(!X||nt&128&&j!==(j=e[7]?"_blank":"_self"))&&U(A,"target",j),(!X||nt&24&&z!==(z=dd(e[9].schemas,e[15],e[4])))&&U(A,"title",z);const Je={};nt&12&&(Je.name=Dp(e[2],e[15]._sys.updatedBy)),F.$set(Je);const ft={};nt&8&&(ft.record=e[15]),nt&16&&(ft.graph=e[4]),nt&2&&(ft.schema=e[1]),nt&256&&(ft.visibleColumns=e[8]),nt&64&&(ft.sort=e[6]),nt&32&&(ft.systemFields=e[5]),nt&128&&(ft.inModal=e[7]),nt&4&&(ft.users=e[2]),te.$set(ft)},i(ge){X||(Oe(F.$$.fragment,ge),Oe(te.$$.fragment,ge),X=!0)},o(ge){$e(F.$$.fragment,ge),$e(te.$$.fragment,ge),X=!1},d(ge){ge&&Pe(t),on(F),on(te),we=!1,ye()}}}function e_e(r){let e,t,s,a,u,f,h,g,v,_,A,O,N=[],L=new Map,j,z,q,ee=r[8],F=[];for(let we=0;we<ee.length;we+=1)F[we]=lle(ale(r,ee,we));let oe=r[5].filter(r[12]),te=[];for(let we=0;we<oe.length;we+=1)te[we]=cle(ile(r,oe,we));let se=r[3];const X=we=>we[15].id;for(let we=0;we<se.length;we+=1){let ye=rle(r,se,we),Te=X(ye);L.set(Te,N[we]=ule(Te,ye))}return{c(){e=ae("div"),t=ae("table"),s=ae("thead"),a=ae("tr"),u=ae("th"),f=ae("input"),v=Ze();for(let we=0;we<F.length;we+=1)F[we].c();_=Ze();for(let we=0;we<te.length;we+=1)te[we].c();A=Ze(),O=ae("tbody");for(let we=0;we<N.length;we+=1)N[we].c();f.indeterminate=h=r[0].length>0&&r[0].length<r[3].length,f.checked=g=r[0].length==r[3].length,U(f,"class","form-check-input"),U(f,"type","checkbox"),U(s,"class","table-light"),U(t,"class",""),U(e,"class","lx-table rounded")},m(we,ye){Ie(we,e,ye),Y(e,t),Y(t,s),Y(s,a),Y(a,u),Y(u,f),Y(a,v);for(let Te=0;Te<F.length;Te+=1)F[Te]&&F[Te].m(a,null);Y(a,_);for(let Te=0;Te<te.length;Te+=1)te[Te]&&te[Te].m(a,null);Y(t,A),Y(t,O);for(let Te=0;Te<N.length;Te+=1)N[Te]&&N[Te].m(O,null);j=!0,z||(q=En(f,"change",Hu(r[10])),z=!0)},p(we,[ye]){if((!j||ye&9&&h!==(h=we[0].length>0&&we[0].length<we[3].length))&&(f.indeterminate=h),(!j||ye&9&&g!==(g=we[0].length==we[3].length))&&(f.checked=g),ye&320){ee=we[8];let Te;for(Te=0;Te<ee.length;Te+=1){const _e=ale(we,ee,Te);F[Te]?F[Te].p(_e,ye):(F[Te]=lle(_e),F[Te].c(),F[Te].m(a,_))}for(;Te<F.length;Te+=1)F[Te].d(1);F.length=ee.length}if(ye&34){oe=we[5].filter(we[12]);let Te;for(Te=0;Te<oe.length;Te+=1){const _e=ile(we,oe,Te);te[Te]?te[Te].p(_e,ye):(te[Te]=cle(_e),te[Te].c(),te[Te].m(a,null))}for(;Te<te.length;Te+=1)te[Te].d(1);te.length=oe.length}ye&3071&&(se=we[3],So(),N=$h(N,ye,X,1,we,se,L,O,gv,ule,null,rle),ko())},i(we){if(!j){for(let ye=0;ye<se.length;ye+=1)Oe(N[ye]);j=!0}},o(we){for(let ye=0;ye<N.length;ye+=1)$e(N[ye]);j=!1},d(we){we&&Pe(e),Ba(F,we),Ba(te,we);for(let ye=0;ye<N.length;ye+=1)N[ye].d();z=!1,q()}}}function t_e(r,e,t){let s;const a=hi("channel");let{schema:u}=e,{users:f}=e,{records:h}=e,{graph:g}=e,{systemFields:v}=e,{sort:_}=e,{inModal:A}=e,{selected:O=[]}=e;function N(ee){O.length===h.length?t(0,O=[]):t(0,O=h),ee.currentTarget.checked=O.length>0}function L(ee,F){O.find(te=>te.id==F.id)?t(0,O=O.filter(te=>te.id!==F.id)):t(0,O=[...O,F])}const j=ee=>u.visible.includes(ee.name),z=(ee,F)=>F.id===ee.id,q=(ee,F)=>L(F,ee);return r.$$set=ee=>{"schema"in ee&&t(1,u=ee.schema),"users"in ee&&t(2,f=ee.users),"records"in ee&&t(3,h=ee.records),"graph"in ee&&t(4,g=ee.graph),"systemFields"in ee&&t(5,v=ee.systemFields),"sort"in ee&&t(6,_=ee.sort),"inModal"in ee&&t(7,A=ee.inModal),"selected"in ee&&t(0,O=ee.selected)},r.$$.update=()=>{r.$$.dirty&2&&t(8,s=u.fields.filter(ee=>u.visible.includes(ee.name)))},[O,u,f,h,g,v,_,A,s,a,N,L,j,z,q]}class n_e extends xo{constructor(e){super(),Ao(this,e,t_e,e_e,Eo,{schema:1,users:2,records:3,graph:4,systemFields:5,sort:6,inModal:7,selected:0})}}function fle(r,e,t){const s=r.slice();return s[22]=e[t],s}function o_e(r){let e,t,s,a;function u(g){r[17](g)}function f(g){r[18](g)}let h={systemFields:r[12],sort:r[2],operators:r[3],filter:r[4],inModal:r[13],modalUrl:r[8]};return r[0]!==void 0&&(h.schema=r[0]),r[1]!==void 0&&(h.records=r[1]),e=new cwe({props:h}),ts.push(()=>gr(e,"schema",u)),ts.push(()=>gr(e,"records",f)),e.$on("refresh",r[16]),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&4096&&(_.systemFields=g[12]),v&4&&(_.sort=g[2]),v&8&&(_.operators=g[3]),v&16&&(_.filter=g[4]),v&8192&&(_.inModal=g[13]),v&256&&(_.modalUrl=g[8]),!t&&v&1&&(t=!0,_.schema=g[0],Cr(()=>t=!1)),!s&&v&2&&(s=!0,_.records=g[1],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function s_e(r){let e,t;return e=new Cwe({props:{schema:r[0],selected:r[9],inModal:r[13],filter:r[4]}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.schema=s[0]),a&512&&(u.selected=s[9]),a&8192&&(u.inModal=s[13]),a&16&&(u.filter=s[4]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function r_e(r){let e,t=[],s=new Map,a,u=r[1];const f=h=>h[22].id;for(let h=0;h<u.length;h+=1){let g=fle(r,u,h),v=f(g);s.set(v,t[h]=dle(v,g))}return{c(){e=ae("div");for(let h=0;h<t.length;h+=1)t[h].c();U(e,"class","row"),ss(e,"max-width","1000px")},m(h,g){Ie(h,e,g);for(let v=0;v<t.length;v+=1)t[v]&&t[v].m(e,null);a=!0},p(h,g){g&49666&&(u=h[1],So(),t=$h(t,g,f,1,h,u,s,e,gv,dle,null,fle),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(t[g]);a=!0}},o(h){for(let g=0;g<t.length;g+=1)$e(t[g]);a=!1},d(h){h&&Pe(e);for(let g=0;g<t.length;g+=1)t[g].d()}}}function i_e(r){let e,t,s;function a(f){r[19](f)}let u={records:r[1],graph:r[11],schema:r[0],sort:r[2],systemFields:r[12],inModal:r[13],users:r[10]};return r[9]!==void 0&&(u.selected=r[9]),e=new n_e({props:u}),ts.push(()=>gr(e,"selected",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&2&&(g.records=f[1]),h&2048&&(g.graph=f[11]),h&1&&(g.schema=f[0]),h&4&&(g.sort=f[2]),h&4096&&(g.systemFields=f[12]),h&8192&&(g.inModal=f[13]),h&1024&&(g.users=f[10]),!t&&h&512&&(t=!0,g.selected=f[9],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function dle(r,e){let t,s,a,u,f,h,g,v,_,A,O,N=e[22]._file.path+"",L,j,z,q,ee,F=e[22]._file.mime+"",oe,te,se,X,we;function ye(..._e){return e[20](e[22],..._e)}function Te(..._e){return e[21](e[22],..._e)}return _=new P_({props:{record:e[22],size:"medium"}}),{key:r,first:null,c(){t=ae("div"),s=ae("div"),a=ae("div"),u=ae("input"),g=Ze(),v=ae("div"),sn(_.$$.fragment),A=Ze(),O=ae("a"),L=Kt(N),q=Ze(),ee=ae("span"),oe=Kt(F),te=Ze(),U(u,"class","form-check-input "),U(u,"type","checkbox"),u.checked=f=e[9].find(ye),u.value=h=e[22],U(a,"class","form-check svelte-1xyvs2b"),U(v,"class","d-flex justify-content-center"),U(O,"href",j=e[14].lucentUrl+"/records/"+e[22].id),U(O,"title",z=e[22]._file.path),U(O,"class","d-block text-center overflow-hidden text-nowrap my-2 "),ss(O,"text-overflow","ellipsis"),ss(O,"font-size","13px"),ss(O,"color","#333"),U(ee,"class","lx-small-text text-muted d-block text-center"),U(s,"class","file-wrapper rounded p-2 mb-4 bg-light"),vs(s,"selected",e[9].includes(e[22])),U(t,"class","col-6 col-md-4"),this.first=t},m(_e,ge){Ie(_e,t,ge),Y(t,s),Y(s,a),Y(a,u),Y(s,g),Y(s,v),nn(_,v,null),Y(s,A),Y(s,O),Y(O,L),Y(s,q),Y(s,ee),Y(ee,oe),Y(t,te),se=!0,X||(we=En(u,"change",Te),X=!0)},p(_e,ge){e=_e,(!se||ge&514&&f!==(f=e[9].find(ye)))&&(u.checked=f),(!se||ge&2&&h!==(h=e[22]))&&(u.value=h);const nt={};ge&2&&(nt.record=e[22]),_.$set(nt),(!se||ge&2)&&N!==(N=e[22]._file.path+"")&&jn(L,N),(!se||ge&2&&j!==(j=e[14].lucentUrl+"/records/"+e[22].id))&&U(O,"href",j),(!se||ge&2&&z!==(z=e[22]._file.path))&&U(O,"title",z),(!se||ge&2)&&F!==(F=e[22]._file.mime+"")&&jn(oe,F),(!se||ge&514)&&vs(s,"selected",e[9].includes(e[22]))},i(_e){se||(Oe(_.$$.fragment,_e),se=!0)},o(_e){$e(_.$$.fragment,_e),se=!1},d(_e){_e&&Pe(t),on(_),X=!1,we()}}}function a_e(r){let e,t,s,a=r[0].label+"",u,f,h,g,v,_,A,O,N,L,j;const z=[s_e,o_e],q=[];function ee(se,X){return se[9].length>0&&!se[13]?0:1}h=ee(r),g=q[h]=z[h](r);const F=[i_e,r_e],oe=[];function te(se,X){return se[0].type==="collection"?0:1}return _=te(r),A=oe[_]=F[_](r),L=new bwe({props:{limit:r[5],skip:r[6],total:r[7],inModal:r[13],modalUrl:r[8]}}),L.$on("refresh",r[16]),{c(){e=ae("div"),t=ae("div"),s=ae("h3"),u=Kt(a),f=Ze(),g.c(),v=Ze(),A.c(),N=Ze(),sn(L.$$.fragment),U(s,"class","header-normal mb-5 "),U(t,"class",O="lx-card mb-4 "+(r[13]?"mt-0":"mt-5")),U(e,"class","wrapper-large transparent ")},m(se,X){Ie(se,e,X),Y(e,t),Y(t,s),Y(s,u),Y(t,f),q[h].m(t,null),Y(t,v),oe[_].m(t,null),Y(e,N),nn(L,e,null),j=!0},p(se,[X]){(!j||X&1)&&a!==(a=se[0].label+"")&&jn(u,a);let we=h;h=ee(se),h===we?q[h].p(se,X):(So(),$e(q[we],1,1,()=>{q[we]=null}),ko(),g=q[h],g?g.p(se,X):(g=q[h]=z[h](se),g.c()),Oe(g,1),g.m(t,v));let ye=_;_=te(se),_===ye?oe[_].p(se,X):(So(),$e(oe[ye],1,1,()=>{oe[ye]=null}),ko(),A=oe[_],A?A.p(se,X):(A=oe[_]=F[_](se),A.c()),Oe(A,1),A.m(t,null)),(!j||X&8192&&O!==(O="lx-card mb-4 "+(se[13]?"mt-0":"mt-5")))&&U(t,"class",O);const Te={};X&32&&(Te.limit=se[5]),X&64&&(Te.skip=se[6]),X&128&&(Te.total=se[7]),X&8192&&(Te.inModal=se[13]),X&256&&(Te.modalUrl=se[8]),L.$set(Te)},i(se){j||(Oe(g),Oe(A),Oe(L.$$.fragment,se),j=!0)},o(se){$e(g),$e(A),$e(L.$$.fragment,se),j=!1},d(se){se&&Pe(e),q[h].d(),oe[_].d(),on(L)}}}function l_e(r,e,t){const s=hi("channel");let{schema:a}=e,{users:u}=e,{records:f}=e,{graph:h}=e,{systemFields:g}=e,{sort:v}=e,{operators:_}=e,{filter:A}=e,{limit:O}=e,{skip:N}=e,{total:L}=e,{inModal:j}=e,{modalUrl:z}=e,{selected:q=[]}=e;function ee(ye,Te){q.find(ge=>ge.id===Te.id)?t(9,q=q.filter(ge=>ge.id!==Te.id)):t(9,q=[...q,Te])}function F(ye){const Te=ye.detail;axios.get(Te).then(_e=>{t(1,f=_e.data.records),t(2,v=_e.data.sort),t(3,_=_e.data.operators),t(4,A=_e.data.filter),t(6,N=_e.data.skip),t(5,O=_e.data.limit),t(7,L=_e.data.total),t(8,z=_e.data.modalUrl)}).catch(_e=>{console.log(_e)})}function oe(ye){a=ye,t(0,a)}function te(ye){f=ye,t(1,f)}function se(ye){q=ye,t(9,q)}const X=(ye,Te)=>Te.id===ye.id,we=(ye,Te)=>ee(Te,ye);return r.$$set=ye=>{"schema"in ye&&t(0,a=ye.schema),"users"in ye&&t(10,u=ye.users),"records"in ye&&t(1,f=ye.records),"graph"in ye&&t(11,h=ye.graph),"systemFields"in ye&&t(12,g=ye.systemFields),"sort"in ye&&t(2,v=ye.sort),"operators"in ye&&t(3,_=ye.operators),"filter"in ye&&t(4,A=ye.filter),"limit"in ye&&t(5,O=ye.limit),"skip"in ye&&t(6,N=ye.skip),"total"in ye&&t(7,L=ye.total),"inModal"in ye&&t(13,j=ye.inModal),"modalUrl"in ye&&t(8,z=ye.modalUrl),"selected"in ye&&t(9,q=ye.selected)},[a,f,v,_,A,O,N,L,z,q,u,h,g,j,s,ee,F,oe,te,se,X,we]}class Khe extends xo{constructor(e){super(),Ao(this,e,l_e,a_e,Eo,{schema:0,users:10,records:1,graph:11,systemFields:12,sort:2,operators:3,filter:4,limit:5,skip:6,total:7,inModal:13,modalUrl:8,selected:9})}}function hle(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X=r[1].length>0&&mle(r);const we=[r[2]];function ye(_e){r[8](_e)}let Te={};for(let _e=0;_e<we.length;_e+=1)Te=nI(Te,we[_e]);return r[1]!==void 0&&(Te.selected=r[1]),ee=new Khe({props:Te}),ts.push(()=>gr(ee,"selected",ye)),{c(){e=ae("div"),t=ae("div"),s=ae("div"),a=ae("div"),u=ae("div"),f=ae("button"),h=Kt("Insert"),v=Ze(),_=ae("button"),A=Kt("Replace"),N=Ze(),X&&X.c(),L=Ze(),j=ae("button"),z=Ze(),q=ae("div"),sn(ee.$$.fragment),U(f,"type","button"),U(f,"class","btn btn-primary me-1"),f.disabled=g=r[1].length===0,U(_,"type","button"),U(_,"class","btn btn-outline-primary me-3"),_.disabled=O=r[1].length===0,U(u,"class","d-flex align-items-center"),U(j,"type","button"),U(j,"class","btn-close"),U(j,"data-bs-dismiss","modal"),U(j,"aria-label","Close"),U(a,"class","modal-header"),U(q,"class","modal-body"),U(s,"class","modal-content svelte-1mf5922"),U(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-1mf5922"),U(e,"class","modal fade show"),U(e,"tabindex","-1"),U(e,"aria-modal","true"),U(e,"role","dialog"),ss(e,"background","rgba(100,100,100,.6)"),vs(e,"d-block",r[0])},m(_e,ge){Ie(_e,e,ge),Y(e,t),Y(t,s),Y(s,a),Y(a,u),Y(u,f),Y(f,h),Y(u,v),Y(u,_),Y(_,A),Y(u,N),X&&X.m(u,null),Y(a,L),Y(a,j),Y(s,z),Y(s,q),nn(ee,q,null),oe=!0,te||(se=[En(f,"click",r[3]),En(_,"click",r[4]),En(j,"click",Hu(r[7]))],te=!0)},p(_e,ge){(!oe||ge&2&&g!==(g=_e[1].length===0))&&(f.disabled=g),(!oe||ge&2&&O!==(O=_e[1].length===0))&&(_.disabled=O),_e[1].length>0?X?X.p(_e,ge):(X=mle(_e),X.c(),X.m(u,null)):X&&(X.d(1),X=null);const nt=ge&4?UV(we,[WV(_e[2])]):{};!F&&ge&2&&(F=!0,nt.selected=_e[1],Cr(()=>F=!1)),ee.$set(nt),(!oe||ge&1)&&vs(e,"d-block",_e[0])},i(_e){oe||(Oe(ee.$$.fragment,_e),oe=!0)},o(_e){$e(ee.$$.fragment,_e),oe=!1},d(_e){_e&&Pe(e),X&&X.d(),on(ee),te=!1,Bi(se)}}}function mle(r){let e,t=r[1].length+"",s,a;return{c(){e=ae("span"),s=Kt(t),a=Kt(" records selected"),U(e,"class","")},m(u,f){Ie(u,e,f),Y(e,s),Y(e,a)},p(u,f){f&2&&t!==(t=u[1].length+"")&&jn(s,t)},d(u){u&&Pe(e)}}}function c_e(r){let e,t,s=r[2].schema&&hle(r);return{c(){s&&s.c(),e=Bs()},m(a,u){s&&s.m(a,u),Ie(a,e,u),t=!0},p(a,[u]){a[2].schema?s?(s.p(a,u),u&4&&Oe(s,1)):(s=hle(a),s.c(),Oe(s,1),s.m(e.parentNode,e)):s&&(So(),$e(s,1,1,()=>{s=null}),ko())},i(a){t||(Oe(s),t=!0)},o(a){$e(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function u_e(r,e,t){let s;const a=Ip(),u=hi("channel");let f=!1,h=[];function g(j){t(0,f=!0),_(j)}function v(){t(0,f=!1),t(1,h=[])}function _(j){axios.get(u.lucentUrl+"/content/"+j).then(z=>{t(2,s=z.data)}).catch(z=>console.log(z))}function A(j){j.preventDefault(),a("insert",{records:h,action:"insert"})}function O(j){j.preventDefault(),a("insert",{records:h,action:"replace"})}const N=j=>t(0,f=!1);function L(j){h=j,t(1,h)}return t(2,s={}),[f,h,s,A,O,g,v,N,L]}class Ooe extends xo{constructor(e){super(),Ao(this,e,u_e,c_e,Eo,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function gle(r,e,t){const s=r.slice();return s[18]=e[t],s}function f_e(r){let e,t,s,a,u,f,h,g,v;return f=new fl({props:{icon:"magnifying-glass"}}),{c(){e=ae("div"),t=ae("div"),s=ae("button"),s.textContent="New",a=Ze(),u=ae("button"),sn(f.$$.fragment),U(s,"class","btn btn-sm btn-primary"),U(u,"class","btn btn-sm btn-outline-primary"),U(t,"class","mb-2"),U(e,"class","pb-2 text-start")},m(_,A){Ie(_,e,A),Y(e,t),Y(t,s),Y(t,a),Y(t,u),nn(f,u,null),h=!0,g||(v=[En(s,"click",r[12]),En(u,"click",r[13])],g=!0)},p:_n,i(_){h||(Oe(f.$$.fragment,_),h=!0)},o(_){$e(f.$$.fragment,_),h=!1},d(_){_&&Pe(e),on(f),g=!1,Bi(v)}}}function d_e(r){let e,t,s,a,u,f,h;t=new fl({props:{width:24,height:24,icon:"circle-plus"}});let g=r[4]&&ple(r);return{c(){e=ae("button"),sn(t.$$.fragment),s=Ze(),g&&g.c(),a=Bs(),U(e,"type","button"),U(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),vs(e,"is-first",!r[1])},m(v,_){Ie(v,e,_),nn(t,e,null),Ie(v,s,_),g&&g.m(v,_),Ie(v,a,_),u=!0,f||(h=En(e,"click",Hu(r[9])),f=!0)},p(v,_){(!u||_&2)&&vs(e,"is-first",!v[1]),v[4]?g?(g.p(v,_),_&16&&Oe(g,1)):(g=ple(v),g.c(),Oe(g,1),g.m(a.parentNode,a)):g&&(So(),$e(g,1,1,()=>{g=null}),ko())},i(v){u||(Oe(t.$$.fragment,v),Oe(g),u=!0)},o(v){$e(t.$$.fragment,v),$e(g),u=!1},d(v){v&&Pe(e),on(t),v&&Pe(s),g&&g.d(v),v&&Pe(a),f=!1,h()}}}function ple(r){let e,t,s=r[0],a=[];for(let f=0;f<s.length;f+=1)a[f]=ble(gle(r,s,f));const u=f=>$e(a[f],1,1,()=>{a[f]=null});return{c(){e=ae("div");for(let f=0;f<a.length;f+=1)a[f].c();U(e,"class","bg-light lx-card d-flex")},m(f,h){Ie(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&289){s=f[0];let g;for(g=0;g<s.length;g+=1){const v=gle(f,s,g);a[g]?(a[g].p(v,h),Oe(a[g],1)):(a[g]=ble(v),a[g].c(),Oe(a[g],1),a[g].m(e,null))}for(So(),g=s.length;g<a.length;g+=1)u(g);ko()}},i(f){if(!t){for(let h=0;h<s.length;h+=1)Oe(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)$e(a[h]);t=!1},d(f){f&&Pe(e),Ba(a,f)}}}function ble(r){let e,t,s=r[18].label+"",a,u,f,h,g,v,_,A,O,N,L;function j(...q){return r[10](r[18],...q)}_=new fl({props:{icon:"magnifying-glass"}});function z(...q){return r[11](r[18],...q)}return{c(){e=ae("div"),t=ae("p"),a=Kt(s),u=Ze(),f=ae("div"),h=ae("button"),h.textContent="New",g=Ze(),v=ae("button"),sn(_.$$.fragment),A=Ze(),U(h,"class","btn btn-sm btn-primary"),U(v,"class","btn btn-sm btn-outline-primary"),U(f,"class","mb-2"),U(e,"class","lx-card p-4 text-center me-4"),ss(e,"max-width","250px")},m(q,ee){Ie(q,e,ee),Y(e,t),Y(t,a),Y(e,u),Y(e,f),Y(f,h),Y(f,g),Y(f,v),nn(_,v,null),Y(e,A),O=!0,N||(L=[En(h,"click",j),En(v,"click",z)],N=!0)},p(q,ee){r=q,(!O||ee&1)&&s!==(s=r[18].label+"")&&jn(a,s)},i(q){O||(Oe(_.$$.fragment,q),O=!0)},o(q){$e(_.$$.fragment,q),O=!1},d(q){q&&Pe(e),on(_),N=!1,Bi(L)}}}function vle(r){let e,t;const s=[r[3]];let a={};for(let u=0;u<s.length;u+=1)a=nI(a,s[u]);return e=new jhe({props:a}),e.$on("cancel",r[14]),e.$on("inlinesaved",r[6]),{c(){sn(e.$$.fragment)},m(u,f){nn(e,u,f),t=!0},p(u,f){const h=f&8?UV(s,[WV(u[3])]):{};e.$set(h)},i(u){t||(Oe(e.$$.fragment,u),t=!0)},o(u){$e(e.$$.fragment,u),t=!1},d(u){on(e,u)}}}function h_e(r){let e,t,s,a,u,f;const h=[d_e,f_e],g=[];function v(O,N){return O[0].length>1?0:1}e=v(r),t=g[e]=h[e](r);let _=r[3]&&vle(r),A={};return u=new Ooe({props:A}),r[15](u),u.$on("insert",r[7]),{c(){t.c(),s=Ze(),_&&_.c(),a=Ze(),sn(u.$$.fragment)},m(O,N){g[e].m(O,N),Ie(O,s,N),_&&_.m(O,N),Ie(O,a,N),nn(u,O,N),f=!0},p(O,[N]){let L=e;e=v(O),e===L?g[e].p(O,N):(So(),$e(g[L],1,1,()=>{g[L]=null}),ko(),t=g[e],t?t.p(O,N):(t=g[e]=h[e](O),t.c()),Oe(t,1),t.m(s.parentNode,s)),O[3]?_?(_.p(O,N),N&8&&Oe(_,1)):(_=vle(O),_.c(),Oe(_,1),_.m(a.parentNode,a)):_&&(So(),$e(_,1,1,()=>{_=null}),ko());const j={};u.$set(j)},i(O){f||(Oe(t),Oe(_),Oe(u.$$.fragment,O),f=!0)},o(O){$e(t),$e(_),$e(u.$$.fragment,O),f=!1},d(O){g[e].d(O),O&&Pe(s),_&&_.d(O),O&&Pe(a),r[15](null),on(u,O)}}}function m_e(r,e,t){let s;const a=Ip(),u=hi("channel");let{schemas:f}=e,{recordId:h}=e,g,v;function _(te,se){te.preventDefault(),g.open(se)}function A(te){te.preventDefault(),console.log("Save inline"),t(3,v=null),a("save",{records:te.detail.records,after:h})}function O(te){te.preventDefault(),g.close(),t(4,s=!1),a("insert",{records:te.detail.records,after:h})}function N(te,se){te.preventDefault(),axios.get(u.lucentUrl+"/records/newInline?schema="+se).then(X=>{t(3,v=X.data),t(4,s=!1)}).catch(X=>{console.log(X)})}const L=te=>t(4,s=!s),j=(te,se)=>N(se,te.name),z=(te,se)=>_(se,te.name),q=te=>N(te,f[0].name),ee=te=>_(te,f[0].name),F=te=>t(3,v=null);function oe(te){ts[te?"unshift":"push"](()=>{g=te,t(2,g)})}return r.$$set=te=>{"schemas"in te&&t(0,f=te.schemas),"recordId"in te&&t(1,h=te.recordId)},t(4,s=!1),[f,h,g,v,s,_,A,O,N,L,j,z,q,ee,F,oe]}class uI extends xo{constructor(e){super(),Ao(this,e,m_e,h_e,Eo,{schemas:0,recordId:1})}}/**!
|
|
* Sortable 1.15.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function yle(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,s)}return t}function a2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yle(Object(t),!0).forEach(function(s){g_e(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):yle(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function Mz(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mz=function(e){return typeof e}:Mz=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mz(r)}function g_e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function D_(){return D_=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}return r},D_.apply(this,arguments)}function p_e(r,e){if(r==null)return{};var t={},s=Object.keys(r),a,u;for(u=0;u<s.length;u++)a=s[u],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function b_e(r,e){if(r==null)return{};var t=p_e(r,e),s,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(a=0;a<u.length;a++)s=u[a],!(e.indexOf(s)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,s)||(t[s]=r[s]))}return t}var v_e="1.15.0";function A_(r){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(r)}var I_=A_(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fI=A_(/Edge/i),wle=A_(/firefox/i),SP=A_(/safari/i)&&!A_(/chrome/i)&&!A_(/android/i),Yhe=A_(/iP(ad|od|hone)/i),Xhe=A_(/chrome/i)&&A_(/android/i),Jhe={capture:!1,passive:!1};function cl(r,e,t){r.addEventListener(e,t,!I_&&Jhe)}function Ia(r,e,t){r.removeEventListener(e,t,!I_&&Jhe)}function nV(r,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),r)try{if(r.matches)return r.matches(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e)}catch{return!1}return!1}}function y_e(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function Ky(r,e,t,s){if(r){t=t||document;do{if(e!=null&&(e[0]===">"?r.parentNode===t&&nV(r,e):nV(r,e))||s&&r===t)return r;if(r===t)break}while(r=y_e(r))}return null}var _le=/\s+/g;function A1(r,e,t){if(r&&e)if(r.classList)r.classList[t?"add":"remove"](e);else{var s=(" "+r.className+" ").replace(_le," ").replace(" "+e+" "," ");r.className=(s+(t?" "+e:"")).replace(_le," ")}}function zr(r,e,t){var s=r&&r.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(t=r.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function GD(r,e){var t="";if(typeof r=="string")t=r;else do{var s=zr(r,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(r=r.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function Qhe(r,e,t){if(r){var s=r.getElementsByTagName(e),a=0,u=s.length;if(t)for(;a<u;a++)t(s[a],a);return s}return[]}function n2(){var r=document.scrollingElement;return r||document.documentElement}function cd(r,e,t,s,a){if(!(!r.getBoundingClientRect&&r!==window)){var u,f,h,g,v,_,A;if(r!==window&&r.parentNode&&r!==n2()?(u=r.getBoundingClientRect(),f=u.top,h=u.left,g=u.bottom,v=u.right,_=u.height,A=u.width):(f=0,h=0,g=window.innerHeight,v=window.innerWidth,_=window.innerHeight,A=window.innerWidth),(e||t)&&r!==window&&(a=a||r.parentNode,!I_))do if(a&&a.getBoundingClientRect&&(zr(a,"transform")!=="none"||t&&zr(a,"position")!=="static")){var O=a.getBoundingClientRect();f-=O.top+parseInt(zr(a,"border-top-width")),h-=O.left+parseInt(zr(a,"border-left-width")),g=f+u.height,v=h+u.width;break}while(a=a.parentNode);if(s&&r!==window){var N=GD(a||r),L=N&&N.a,j=N&&N.d;N&&(f/=j,h/=L,A/=L,_/=j,g=f+_,v=h+A)}return{top:f,left:h,bottom:g,right:v,width:A,height:_}}}function Cle(r,e,t){for(var s=rk(r,!0),a=cd(r)[e];s;){var u=cd(s)[t],f=void 0;if(t==="top"||t==="left"?f=a>=u:f=a<=u,!f)return s;if(s===n2())break;s=rk(s,!1)}return!1}function sO(r,e,t,s){for(var a=0,u=0,f=r.children;u<f.length;){if(f[u].style.display!=="none"&&f[u]!==Vr.ghost&&(s||f[u]!==Vr.dragged)&&Ky(f[u],t.draggable,r,!1)){if(a===e)return f[u];a++}u++}return null}function Moe(r,e){for(var t=r.lastElementChild;t&&(t===Vr.ghost||zr(t,"display")==="none"||e&&!nV(t,e));)t=t.previousElementSibling;return t||null}function D0(r,e){var t=0;if(!r||!r.parentNode)return-1;for(;r=r.previousElementSibling;)r.nodeName.toUpperCase()!=="TEMPLATE"&&r!==Vr.clone&&(!e||nV(r,e))&&t++;return t}function Sle(r){var e=0,t=0,s=n2();if(r)do{var a=GD(r),u=a.a,f=a.d;e+=r.scrollLeft*u,t+=r.scrollTop*f}while(r!==s&&(r=r.parentNode));return[e,t]}function w_e(r,e){for(var t in r)if(!!r.hasOwnProperty(t)){for(var s in e)if(e.hasOwnProperty(s)&&e[s]===r[t][s])return Number(t)}return-1}function rk(r,e){if(!r||!r.getBoundingClientRect)return n2();var t=r,s=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var a=zr(t);if(t.clientWidth<t.scrollWidth&&(a.overflowX=="auto"||a.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(a.overflowY=="auto"||a.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return n2();if(s||e)return t;s=!0}}while(t=t.parentNode);return n2()}function __e(r,e){if(r&&e)for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function fte(r,e){return Math.round(r.top)===Math.round(e.top)&&Math.round(r.left)===Math.round(e.left)&&Math.round(r.height)===Math.round(e.height)&&Math.round(r.width)===Math.round(e.width)}var kP;function eme(r,e){return function(){if(!kP){var t=arguments,s=this;t.length===1?r.call(s,t[0]):r.apply(s,t),kP=setTimeout(function(){kP=void 0},e)}}}function C_e(){clearTimeout(kP),kP=void 0}function tme(r,e,t){r.scrollLeft+=e,r.scrollTop+=t}function nme(r){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(r).cloneNode(!0):t?t(r).clone(!0)[0]:r.cloneNode(!0)}var M1="Sortable"+new Date().getTime();function S_e(){var r=[],e;return{captureAnimationState:function(){if(r=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(a){if(!(zr(a,"display")==="none"||a===Vr.ghost)){r.push({target:a,rect:cd(a)});var u=a2({},r[r.length-1].rect);if(a.thisAnimationDuration){var f=GD(a,!0);f&&(u.top-=f.f,u.left-=f.e)}a.fromRect=u}})}},addAnimationState:function(s){r.push(s)},removeAnimationState:function(s){r.splice(w_e(r,{target:s}),1)},animateAll:function(s){var a=this;if(!this.options.animation){clearTimeout(e),typeof s=="function"&&s();return}var u=!1,f=0;r.forEach(function(h){var g=0,v=h.target,_=v.fromRect,A=cd(v),O=v.prevFromRect,N=v.prevToRect,L=h.rect,j=GD(v,!0);j&&(A.top-=j.f,A.left-=j.e),v.toRect=A,v.thisAnimationDuration&&fte(O,A)&&!fte(_,A)&&(L.top-A.top)/(L.left-A.left)===(_.top-A.top)/(_.left-A.left)&&(g=E_e(L,O,N,a.options)),fte(A,_)||(v.prevFromRect=_,v.prevToRect=A,g||(g=a.options.animation),a.animate(v,L,A,g)),g&&(u=!0,f=Math.max(f,g),clearTimeout(v.animationResetTimer),v.animationResetTimer=setTimeout(function(){v.animationTime=0,v.prevFromRect=null,v.fromRect=null,v.prevToRect=null,v.thisAnimationDuration=null},g),v.thisAnimationDuration=g)}),clearTimeout(e),u?e=setTimeout(function(){typeof s=="function"&&s()},f):typeof s=="function"&&s(),r=[]},animate:function(s,a,u,f){if(f){zr(s,"transition",""),zr(s,"transform","");var h=GD(this.el),g=h&&h.a,v=h&&h.d,_=(a.left-u.left)/(g||1),A=(a.top-u.top)/(v||1);s.animatingX=!!_,s.animatingY=!!A,zr(s,"transform","translate3d("+_+"px,"+A+"px,0)"),this.forRepaintDummy=k_e(s),zr(s,"transition","transform "+f+"ms"+(this.options.easing?" "+this.options.easing:"")),zr(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){zr(s,"transition",""),zr(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},f)}}}}function k_e(r){return r.offsetWidth}function E_e(r,e,t,s){return Math.sqrt(Math.pow(e.top-r.top,2)+Math.pow(e.left-r.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*s.animation}var DD=[],dte={initializeByDefault:!0},dI={mount:function(e){for(var t in dte)dte.hasOwnProperty(t)&&!(t in e)&&(e[t]=dte[t]);DD.forEach(function(s){if(s.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),DD.push(e)},pluginEvent:function(e,t,s){var a=this;this.eventCanceled=!1,s.cancel=function(){a.eventCanceled=!0};var u=e+"Global";DD.forEach(function(f){!t[f.pluginName]||(t[f.pluginName][u]&&t[f.pluginName][u](a2({sortable:t},s)),t.options[f.pluginName]&&t[f.pluginName][e]&&t[f.pluginName][e](a2({sortable:t},s)))})},initializePlugins:function(e,t,s,a){DD.forEach(function(h){var g=h.pluginName;if(!(!e.options[g]&&!h.initializeByDefault)){var v=new h(e,t,e.options);v.sortable=e,v.options=e.options,e[g]=v,D_(s,v.defaults)}});for(var u in e.options)if(!!e.options.hasOwnProperty(u)){var f=this.modifyOption(e,u,e.options[u]);typeof f<"u"&&(e.options[u]=f)}},getEventProperties:function(e,t){var s={};return DD.forEach(function(a){typeof a.eventProperties=="function"&&D_(s,a.eventProperties.call(t[a.pluginName],e))}),s},modifyOption:function(e,t,s){var a;return DD.forEach(function(u){!e[u.pluginName]||u.optionListeners&&typeof u.optionListeners[t]=="function"&&(a=u.optionListeners[t].call(e[u.pluginName],s))}),a}};function A_e(r){var e=r.sortable,t=r.rootEl,s=r.name,a=r.targetEl,u=r.cloneEl,f=r.toEl,h=r.fromEl,g=r.oldIndex,v=r.newIndex,_=r.oldDraggableIndex,A=r.newDraggableIndex,O=r.originalEvent,N=r.putSortable,L=r.extraEventProperties;if(e=e||t&&t[M1],!!e){var j,z=e.options,q="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!I_&&!fI?j=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(j=document.createEvent("Event"),j.initEvent(s,!0,!0)),j.to=f||t,j.from=h||t,j.item=a||t,j.clone=u,j.oldIndex=g,j.newIndex=v,j.oldDraggableIndex=_,j.newDraggableIndex=A,j.originalEvent=O,j.pullMode=N?N.lastPutMode:void 0;var ee=a2(a2({},L),dI.getEventProperties(s,e));for(var F in ee)j[F]=ee[F];t&&t.dispatchEvent(j),z[q]&&z[q].call(e,j)}}var x_e=["evt"],Ep=function(e,t){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,u=b_e(s,x_e);dI.pluginEvent.bind(Vr)(e,t,a2({dragEl:zo,parentEl:Fu,ghostEl:ki,rootEl:Wc,nextEl:Bx,lastDownEl:Rz,cloneEl:hu,cloneHidden:ok,dragStarted:mP,putSortable:Ih,activeSortable:Vr.active,originalEvent:a,oldIndex:zD,oldDraggableIndex:EP,newIndex:T1,newDraggableIndex:ek,hideGhostForTarget:ime,unhideGhostForTarget:ame,cloneNowHidden:function(){ok=!0},cloneNowShown:function(){ok=!1},dispatchSortableEvent:function(h){Eg({sortable:t,name:h,originalEvent:a})}},u))};function Eg(r){A_e(a2({putSortable:Ih,cloneEl:hu,targetEl:zo,rootEl:Wc,oldIndex:zD,oldDraggableIndex:EP,newIndex:T1,newDraggableIndex:ek},r))}var zo,Fu,ki,Wc,Bx,Rz,hu,ok,zD,T1,EP,ek,U$,Ih,ID=!1,oV=!1,sV=[],Nx,dv,hte,mte,kle,Ele,mP,OD,AP,xP=!1,W$=!1,Nz,Em,gte=[],vne=!1,rV=[],qV=typeof document<"u",j$=Yhe,Ale=fI||I_?"cssFloat":"float",T_e=qV&&!Xhe&&!Yhe&&"draggable"in document.createElement("div"),ome=function(){if(!!qV){if(I_)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),sme=function(e,t){var s=zr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),u=sO(e,0,t),f=sO(e,1,t),h=u&&zr(u),g=f&&zr(f),v=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+cd(u).width,_=g&&parseInt(g.marginLeft)+parseInt(g.marginRight)+cd(f).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(u&&h.float&&h.float!=="none"){var A=h.float==="left"?"left":"right";return f&&(g.clear==="both"||g.clear===A)?"vertical":"horizontal"}return u&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||v>=a&&s[Ale]==="none"||f&&s[Ale]==="none"&&v+_>a)?"vertical":"horizontal"},D_e=function(e,t,s){var a=s?e.left:e.top,u=s?e.right:e.bottom,f=s?e.width:e.height,h=s?t.left:t.top,g=s?t.right:t.bottom,v=s?t.width:t.height;return a===h||u===g||a+f/2===h+v/2},O_e=function(e,t){var s;return sV.some(function(a){var u=a[M1].options.emptyInsertThreshold;if(!(!u||Moe(a))){var f=cd(a),h=e>=f.left-u&&e<=f.right+u,g=t>=f.top-u&&t<=f.bottom+u;if(h&&g)return s=a}}),s},rme=function(e){function t(u,f){return function(h,g,v,_){var A=h.options.group.name&&g.options.group.name&&h.options.group.name===g.options.group.name;if(u==null&&(f||A))return!0;if(u==null||u===!1)return!1;if(f&&u==="clone")return u;if(typeof u=="function")return t(u(h,g,v,_),f)(h,g,v,_);var O=(f?h:g).options.group.name;return u===!0||typeof u=="string"&&u===O||u.join&&u.indexOf(O)>-1}}var s={},a=e.group;(!a||Mz(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=t(a.pull,!0),s.checkPut=t(a.put),s.revertClone=a.revertClone,e.group=s},ime=function(){!ome&&ki&&zr(ki,"display","none")},ame=function(){!ome&&ki&&zr(ki,"display","")};qV&&!Xhe&&document.addEventListener("click",function(r){if(oV)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),oV=!1,!1},!0);var Px=function(e){if(zo){e=e.touches?e.touches[0]:e;var t=O_e(e.clientX,e.clientY);if(t){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=e[a]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[M1]._onDragOver(s)}}},M_e=function(e){zo&&zo.parentNode[M1]._isOutsideThisEl(e.target)};function Vr(r,e){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=e=D_({},e),r[M1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return sme(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,h){f.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Vr.supportPointer!==!1&&"PointerEvent"in window&&!SP,emptyInsertThreshold:5};dI.initializePlugins(this,r,t);for(var s in t)!(s in e)&&(e[s]=t[s]);rme(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:T_e,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?cl(r,"pointerdown",this._onTapStart):(cl(r,"mousedown",this._onTapStart),cl(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(cl(r,"dragover",this),cl(r,"dragenter",this)),sV.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),D_(this,S_e())}Vr.prototype={constructor:Vr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(OD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,zo):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,s=this.el,a=this.options,u=a.preventOnFilter,f=e.type,h=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,g=(h||e).target,v=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||g,_=a.filter;if(H_e(s),!zo&&!(/mousedown|pointerdown/.test(f)&&e.button!==0||a.disabled)&&!v.isContentEditable&&!(!this.nativeDraggable&&SP&&g&&g.tagName.toUpperCase()==="SELECT")&&(g=Ky(g,a.draggable,s,!1),!(g&&g.animated)&&Rz!==g)){if(zD=D0(g),EP=D0(g,a.draggable),typeof _=="function"){if(_.call(this,e,g,this)){Eg({sortable:t,rootEl:v,name:"filter",targetEl:g,toEl:s,fromEl:s}),Ep("filter",t,{evt:e}),u&&e.cancelable&&e.preventDefault();return}}else if(_&&(_=_.split(",").some(function(A){if(A=Ky(v,A.trim(),s,!1),A)return Eg({sortable:t,rootEl:A,name:"filter",targetEl:g,fromEl:s,toEl:s}),Ep("filter",t,{evt:e}),!0}),_)){u&&e.cancelable&&e.preventDefault();return}a.handle&&!Ky(v,a.handle,s,!1)||this._prepareDragStart(e,h,g)}}},_prepareDragStart:function(e,t,s){var a=this,u=a.el,f=a.options,h=u.ownerDocument,g;if(s&&!zo&&s.parentNode===u){var v=cd(s);if(Wc=u,zo=s,Fu=zo.parentNode,Bx=zo.nextSibling,Rz=s,U$=f.group,Vr.dragged=zo,Nx={target:zo,clientX:(t||e).clientX,clientY:(t||e).clientY},kle=Nx.clientX-v.left,Ele=Nx.clientY-v.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,zo.style["will-change"]="all",g=function(){if(Ep("delayEnded",a,{evt:e}),Vr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!wle&&a.nativeDraggable&&(zo.draggable=!0),a._triggerDragStart(e,t),Eg({sortable:a,name:"choose",originalEvent:e}),A1(zo,f.chosenClass,!0)},f.ignore.split(",").forEach(function(_){Qhe(zo,_.trim(),pte)}),cl(h,"dragover",Px),cl(h,"mousemove",Px),cl(h,"touchmove",Px),cl(h,"mouseup",a._onDrop),cl(h,"touchend",a._onDrop),cl(h,"touchcancel",a._onDrop),wle&&this.nativeDraggable&&(this.options.touchStartThreshold=4,zo.draggable=!0),Ep("delayStart",this,{evt:e}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(fI||I_))){if(Vr.eventCanceled){this._onDrop();return}cl(h,"mouseup",a._disableDelayedDrag),cl(h,"touchend",a._disableDelayedDrag),cl(h,"touchcancel",a._disableDelayedDrag),cl(h,"mousemove",a._delayedDragTouchMoveHandler),cl(h,"touchmove",a._delayedDragTouchMoveHandler),f.supportPointer&&cl(h,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(g,f.delay)}else g()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){zo&&pte(zo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ia(e,"mouseup",this._disableDelayedDrag),Ia(e,"touchend",this._disableDelayedDrag),Ia(e,"touchcancel",this._disableDelayedDrag),Ia(e,"mousemove",this._delayedDragTouchMoveHandler),Ia(e,"touchmove",this._delayedDragTouchMoveHandler),Ia(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?cl(document,"pointermove",this._onTouchMove):t?cl(document,"touchmove",this._onTouchMove):cl(document,"mousemove",this._onTouchMove):(cl(zo,"dragend",this),cl(Wc,"dragstart",this._onDragStart));try{document.selection?Pz(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ID=!1,Wc&&zo){Ep("dragStarted",this,{evt:t}),this.nativeDraggable&&cl(document,"dragover",M_e);var s=this.options;!e&&A1(zo,s.dragClass,!1),A1(zo,s.ghostClass,!0),Vr.active=this,e&&this._appendGhost(),Eg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(dv){this._lastX=dv.clientX,this._lastY=dv.clientY,ime();for(var e=document.elementFromPoint(dv.clientX,dv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(dv.clientX,dv.clientY),e!==t);)t=e;if(zo.parentNode[M1]._isOutsideThisEl(e),t)do{if(t[M1]){var s=void 0;if(s=t[M1]._onDragOver({clientX:dv.clientX,clientY:dv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ame()}},_onTouchMove:function(e){if(Nx){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,u=e.touches?e.touches[0]:e,f=ki&&GD(ki,!0),h=ki&&f&&f.a,g=ki&&f&&f.d,v=j$&&Em&&Sle(Em),_=(u.clientX-Nx.clientX+a.x)/(h||1)+(v?v[0]-gte[0]:0)/(h||1),A=(u.clientY-Nx.clientY+a.y)/(g||1)+(v?v[1]-gte[1]:0)/(g||1);if(!Vr.active&&!ID){if(s&&Math.max(Math.abs(u.clientX-this._lastX),Math.abs(u.clientY-this._lastY))<s)return;this._onDragStart(e,!0)}if(ki){f?(f.e+=_-(hte||0),f.f+=A-(mte||0)):f={a:1,b:0,c:0,d:1,e:_,f:A};var O="matrix(".concat(f.a,",").concat(f.b,",").concat(f.c,",").concat(f.d,",").concat(f.e,",").concat(f.f,")");zr(ki,"webkitTransform",O),zr(ki,"mozTransform",O),zr(ki,"msTransform",O),zr(ki,"transform",O),hte=_,mte=A,dv=u}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ki){var e=this.options.fallbackOnBody?document.body:Wc,t=cd(zo,!0,j$,!0,e),s=this.options;if(j$){for(Em=e;zr(Em,"position")==="static"&&zr(Em,"transform")==="none"&&Em!==document;)Em=Em.parentNode;Em!==document.body&&Em!==document.documentElement?(Em===document&&(Em=n2()),t.top+=Em.scrollTop,t.left+=Em.scrollLeft):Em=n2(),gte=Sle(Em)}ki=zo.cloneNode(!0),A1(ki,s.ghostClass,!1),A1(ki,s.fallbackClass,!0),A1(ki,s.dragClass,!0),zr(ki,"transition",""),zr(ki,"transform",""),zr(ki,"box-sizing","border-box"),zr(ki,"margin",0),zr(ki,"top",t.top),zr(ki,"left",t.left),zr(ki,"width",t.width),zr(ki,"height",t.height),zr(ki,"opacity","0.8"),zr(ki,"position",j$?"absolute":"fixed"),zr(ki,"zIndex","100000"),zr(ki,"pointerEvents","none"),Vr.ghost=ki,e.appendChild(ki),zr(ki,"transform-origin",kle/parseInt(ki.style.width)*100+"% "+Ele/parseInt(ki.style.height)*100+"%")}},_onDragStart:function(e,t){var s=this,a=e.dataTransfer,u=s.options;if(Ep("dragStart",this,{evt:e}),Vr.eventCanceled){this._onDrop();return}Ep("setupClone",this),Vr.eventCanceled||(hu=nme(zo),hu.removeAttribute("id"),hu.draggable=!1,hu.style["will-change"]="",this._hideClone(),A1(hu,this.options.chosenClass,!1),Vr.clone=hu),s.cloneId=Pz(function(){Ep("clone",s),!Vr.eventCanceled&&(s.options.removeCloneOnHide||Wc.insertBefore(hu,zo),s._hideClone(),Eg({sortable:s,name:"clone"}))}),!t&&A1(zo,u.dragClass,!0),t?(oV=!0,s._loopId=setInterval(s._emulateDragOver,50)):(Ia(document,"mouseup",s._onDrop),Ia(document,"touchend",s._onDrop),Ia(document,"touchcancel",s._onDrop),a&&(a.effectAllowed="move",u.setData&&u.setData.call(s,a,zo)),cl(document,"drop",s),zr(zo,"transform","translateZ(0)")),ID=!0,s._dragStartId=Pz(s._dragStarted.bind(s,t,e)),cl(document,"selectstart",s),mP=!0,SP&&zr(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,s=e.target,a,u,f,h=this.options,g=h.group,v=Vr.active,_=U$===g,A=h.sort,O=Ih||v,N,L=this,j=!1;if(vne)return;function z(et,Et){Ep(et,L,a2({evt:e,isOwner:_,axis:N?"vertical":"horizontal",revert:f,dragRect:a,targetRect:u,canSort:A,fromSortable:O,target:s,completed:ee,onMove:function(He,ct){return Z$(Wc,t,zo,a,He,cd(He),e,ct)},changed:F},Et))}function q(){z("dragOverAnimationCapture"),L.captureAnimationState(),L!==O&&O.captureAnimationState()}function ee(et){return z("dragOverCompleted",{insertion:et}),et&&(_?v._hideClone():v._showClone(L),L!==O&&(A1(zo,Ih?Ih.options.ghostClass:v.options.ghostClass,!1),A1(zo,h.ghostClass,!0)),Ih!==L&&L!==Vr.active?Ih=L:L===Vr.active&&Ih&&(Ih=null),O===L&&(L._ignoreWhileAnimating=s),L.animateAll(function(){z("dragOverAnimationComplete"),L._ignoreWhileAnimating=null}),L!==O&&(O.animateAll(),O._ignoreWhileAnimating=null)),(s===zo&&!zo.animated||s===t&&!s.animated)&&(OD=null),!h.dragoverBubble&&!e.rootEl&&s!==document&&(zo.parentNode[M1]._isOutsideThisEl(e.target),!et&&Px(e)),!h.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),j=!0}function F(){T1=D0(zo),ek=D0(zo,h.draggable),Eg({sortable:L,name:"change",toEl:t,newIndex:T1,newDraggableIndex:ek,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),s=Ky(s,h.draggable,t,!0),z("dragOver"),Vr.eventCanceled)return j;if(zo.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||L._ignoreWhileAnimating===s)return ee(!1);if(oV=!1,v&&!h.disabled&&(_?A||(f=Fu!==Wc):Ih===this||(this.lastPutMode=U$.checkPull(this,v,zo,e))&&g.checkPut(this,v,zo,e))){if(N=this._getDirection(e,s)==="vertical",a=cd(zo),z("dragOverValid"),Vr.eventCanceled)return j;if(f)return Fu=Wc,q(),this._hideClone(),z("revert"),Vr.eventCanceled||(Bx?Wc.insertBefore(zo,Bx):Wc.appendChild(zo)),ee(!0);var oe=Moe(t,h.draggable);if(!oe||I_e(e,N,this)&&!oe.animated){if(oe===zo)return ee(!1);if(oe&&t===e.target&&(s=oe),s&&(u=cd(s)),Z$(Wc,t,zo,a,s,u,e,!!s)!==!1)return q(),oe&&oe.nextSibling?t.insertBefore(zo,oe.nextSibling):t.appendChild(zo),Fu=t,F(),ee(!0)}else if(oe&&P_e(e,N,this)){var te=sO(t,0,h,!0);if(te===zo)return ee(!1);if(s=te,u=cd(s),Z$(Wc,t,zo,a,s,u,e,!1)!==!1)return q(),t.insertBefore(zo,te),Fu=t,F(),ee(!0)}else if(s.parentNode===t){u=cd(s);var se=0,X,we=zo.parentNode!==t,ye=!D_e(zo.animated&&zo.toRect||a,s.animated&&s.toRect||u,N),Te=N?"top":"left",_e=Cle(s,"top","top")||Cle(zo,"top","top"),ge=_e?_e.scrollTop:void 0;OD!==s&&(X=u[Te],xP=!1,W$=!ye&&h.invertSwap||we),se=B_e(e,s,u,N,ye?1:h.swapThreshold,h.invertedSwapThreshold==null?h.swapThreshold:h.invertedSwapThreshold,W$,OD===s);var nt;if(se!==0){var Je=D0(zo);do Je-=se,nt=Fu.children[Je];while(nt&&(zr(nt,"display")==="none"||nt===ki))}if(se===0||nt===s)return ee(!1);OD=s,AP=se;var ft=s.nextElementSibling,V=!1;V=se===1;var ut=Z$(Wc,t,zo,a,s,u,e,V);if(ut!==!1)return(ut===1||ut===-1)&&(V=ut===1),vne=!0,setTimeout(N_e,30),q(),V&&!ft?t.appendChild(zo):s.parentNode.insertBefore(zo,V?ft:s),_e&&tme(_e,0,ge-_e.scrollTop),Fu=zo.parentNode,X!==void 0&&!W$&&(Nz=Math.abs(X-cd(s)[Te])),F(),ee(!0)}if(t.contains(zo))return ee(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ia(document,"mousemove",this._onTouchMove),Ia(document,"touchmove",this._onTouchMove),Ia(document,"pointermove",this._onTouchMove),Ia(document,"dragover",Px),Ia(document,"mousemove",Px),Ia(document,"touchmove",Px)},_offUpEvents:function(){var e=this.el.ownerDocument;Ia(e,"mouseup",this._onDrop),Ia(e,"touchend",this._onDrop),Ia(e,"pointerup",this._onDrop),Ia(e,"touchcancel",this._onDrop),Ia(document,"selectstart",this)},_onDrop:function(e){var t=this.el,s=this.options;if(T1=D0(zo),ek=D0(zo,s.draggable),Ep("drop",this,{evt:e}),Fu=zo&&zo.parentNode,T1=D0(zo),ek=D0(zo,s.draggable),Vr.eventCanceled){this._nulling();return}ID=!1,W$=!1,xP=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),yne(this.cloneId),yne(this._dragStartId),this.nativeDraggable&&(Ia(document,"drop",this),Ia(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),SP&&zr(document.body,"user-select",""),zr(zo,"transform",""),e&&(mP&&(e.cancelable&&e.preventDefault(),!s.dropBubble&&e.stopPropagation()),ki&&ki.parentNode&&ki.parentNode.removeChild(ki),(Wc===Fu||Ih&&Ih.lastPutMode!=="clone")&&hu&&hu.parentNode&&hu.parentNode.removeChild(hu),zo&&(this.nativeDraggable&&Ia(zo,"dragend",this),pte(zo),zo.style["will-change"]="",mP&&!ID&&A1(zo,Ih?Ih.options.ghostClass:this.options.ghostClass,!1),A1(zo,this.options.chosenClass,!1),Eg({sortable:this,name:"unchoose",toEl:Fu,newIndex:null,newDraggableIndex:null,originalEvent:e}),Wc!==Fu?(T1>=0&&(Eg({rootEl:Fu,name:"add",toEl:Fu,fromEl:Wc,originalEvent:e}),Eg({sortable:this,name:"remove",toEl:Fu,originalEvent:e}),Eg({rootEl:Fu,name:"sort",toEl:Fu,fromEl:Wc,originalEvent:e}),Eg({sortable:this,name:"sort",toEl:Fu,originalEvent:e})),Ih&&Ih.save()):T1!==zD&&T1>=0&&(Eg({sortable:this,name:"update",toEl:Fu,originalEvent:e}),Eg({sortable:this,name:"sort",toEl:Fu,originalEvent:e})),Vr.active&&((T1==null||T1===-1)&&(T1=zD,ek=EP),Eg({sortable:this,name:"end",toEl:Fu,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ep("nulling",this),Wc=zo=Fu=ki=Bx=hu=Rz=ok=Nx=dv=mP=T1=ek=zD=EP=OD=AP=Ih=U$=Vr.dragged=Vr.ghost=Vr.clone=Vr.active=null,rV.forEach(function(e){e.checked=!0}),rV.length=hte=mte=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":zo&&(this._onDragOver(e),R_e(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,u=s.length,f=this.options;a<u;a++)t=s[a],Ky(t,f.draggable,this.el,!1)&&e.push(t.getAttribute(f.dataIdAttr)||F_e(t));return e},sort:function(e,t){var s={},a=this.el;this.toArray().forEach(function(u,f){var h=a.children[f];Ky(h,this.options.draggable,a,!1)&&(s[u]=h)},this),t&&this.captureAnimationState(),e.forEach(function(u){s[u]&&(a.removeChild(s[u]),a.appendChild(s[u]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ky(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var s=this.options;if(t===void 0)return s[e];var a=dI.modifyOption(this,e,t);typeof a<"u"?s[e]=a:s[e]=t,e==="group"&&rme(s)},destroy:function(){Ep("destroy",this);var e=this.el;e[M1]=null,Ia(e,"mousedown",this._onTapStart),Ia(e,"touchstart",this._onTapStart),Ia(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ia(e,"dragover",this),Ia(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),sV.splice(sV.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ok){if(Ep("hideClone",this),Vr.eventCanceled)return;zr(hu,"display","none"),this.options.removeCloneOnHide&&hu.parentNode&&hu.parentNode.removeChild(hu),ok=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ok){if(Ep("showClone",this),Vr.eventCanceled)return;zo.parentNode==Wc&&!this.options.group.revertClone?Wc.insertBefore(hu,zo):Bx?Wc.insertBefore(hu,Bx):Wc.appendChild(hu),this.options.group.revertClone&&this.animate(zo,hu),zr(hu,"display",""),ok=!1}}};function R_e(r){r.dataTransfer&&(r.dataTransfer.dropEffect="move"),r.cancelable&&r.preventDefault()}function Z$(r,e,t,s,a,u,f,h){var g,v=r[M1],_=v.options.onMove,A;return window.CustomEvent&&!I_&&!fI?g=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent("move",!0,!0)),g.to=e,g.from=r,g.dragged=t,g.draggedRect=s,g.related=a||e,g.relatedRect=u||cd(e),g.willInsertAfter=h,g.originalEvent=f,r.dispatchEvent(g),_&&(A=_.call(v,g,f)),A}function pte(r){r.draggable=!1}function N_e(){vne=!1}function P_e(r,e,t){var s=cd(sO(t.el,0,t.options,!0)),a=10;return e?r.clientX<s.left-a||r.clientY<s.top&&r.clientX<s.right:r.clientY<s.top-a||r.clientY<s.bottom&&r.clientX<s.left}function I_e(r,e,t){var s=cd(Moe(t.el,t.options.draggable)),a=10;return e?r.clientX>s.right+a||r.clientX<=s.right&&r.clientY>s.bottom&&r.clientX>=s.left:r.clientX>s.right&&r.clientY>s.top||r.clientX<=s.right&&r.clientY>s.bottom+a}function B_e(r,e,t,s,a,u,f,h){var g=s?r.clientY:r.clientX,v=s?t.height:t.width,_=s?t.top:t.left,A=s?t.bottom:t.right,O=!1;if(!f){if(h&&Nz<v*a){if(!xP&&(AP===1?g>_+v*u/2:g<A-v*u/2)&&(xP=!0),xP)O=!0;else if(AP===1?g<_+Nz:g>A-Nz)return-AP}else if(g>_+v*(1-a)/2&&g<A-v*(1-a)/2)return L_e(e)}return O=O||f,O&&(g<_+v*u/2||g>A-v*u/2)?g>_+v/2?1:-1:0}function L_e(r){return D0(zo)<D0(r)?1:-1}function F_e(r){for(var e=r.tagName+r.className+r.src+r.href+r.textContent,t=e.length,s=0;t--;)s+=e.charCodeAt(t);return s.toString(36)}function H_e(r){rV.length=0;for(var e=r.getElementsByTagName("input"),t=e.length;t--;){var s=e[t];s.checked&&rV.push(s)}}function Pz(r){return setTimeout(r,0)}function yne(r){return clearTimeout(r)}qV&&cl(document,"touchmove",function(r){(Vr.active||ID)&&r.cancelable&&r.preventDefault()});Vr.utils={on:cl,off:Ia,css:zr,find:Qhe,is:function(e,t){return!!Ky(e,t,e,!1)},extend:__e,throttle:eme,closest:Ky,toggleClass:A1,clone:nme,index:D0,nextTick:Pz,cancelNextTick:yne,detectDirection:sme,getChild:sO};Vr.get=function(r){return r[M1]};Vr.mount=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Vr.utils=a2(a2({},Vr.utils),s.utils)),dI.mount(s)})};Vr.create=function(r,e){return new Vr(r,e)};Vr.version=v_e;var Pf=[],gP,wne,_ne=!1,bte,vte,iV,pP;function $_e(){function r(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return r.prototype={dragStarted:function(t){var s=t.originalEvent;this.sortable.nativeDraggable?cl(document,"dragover",this._handleAutoScroll):this.options.supportPointer?cl(document,"pointermove",this._handleFallbackAutoScroll):s.touches?cl(document,"touchmove",this._handleFallbackAutoScroll):cl(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var s=t.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?Ia(document,"dragover",this._handleAutoScroll):(Ia(document,"pointermove",this._handleFallbackAutoScroll),Ia(document,"touchmove",this._handleFallbackAutoScroll),Ia(document,"mousemove",this._handleFallbackAutoScroll)),xle(),Iz(),C_e()},nulling:function(){iV=wne=gP=_ne=pP=bte=vte=null,Pf.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,s){var a=this,u=(t.touches?t.touches[0]:t).clientX,f=(t.touches?t.touches[0]:t).clientY,h=document.elementFromPoint(u,f);if(iV=t,s||this.options.forceAutoScrollFallback||fI||I_||SP){yte(t,this.options,h,s);var g=rk(h,!0);_ne&&(!pP||u!==bte||f!==vte)&&(pP&&xle(),pP=setInterval(function(){var v=rk(document.elementFromPoint(u,f),!0);v!==g&&(g=v,Iz()),yte(t,a.options,v,s)},10),bte=u,vte=f)}else{if(!this.options.bubbleScroll||rk(h,!0)===n2()){Iz();return}yte(t,this.options,rk(h,!1),!1)}}},D_(r,{pluginName:"scroll",initializeByDefault:!0})}function Iz(){Pf.forEach(function(r){clearInterval(r.pid)}),Pf=[]}function xle(){clearInterval(pP)}var yte=eme(function(r,e,t,s){if(!!e.scroll){var a=(r.touches?r.touches[0]:r).clientX,u=(r.touches?r.touches[0]:r).clientY,f=e.scrollSensitivity,h=e.scrollSpeed,g=n2(),v=!1,_;wne!==t&&(wne=t,Iz(),gP=e.scroll,_=e.scrollFn,gP===!0&&(gP=rk(t,!0)));var A=0,O=gP;do{var N=O,L=cd(N),j=L.top,z=L.bottom,q=L.left,ee=L.right,F=L.width,oe=L.height,te=void 0,se=void 0,X=N.scrollWidth,we=N.scrollHeight,ye=zr(N),Te=N.scrollLeft,_e=N.scrollTop;N===g?(te=F<X&&(ye.overflowX==="auto"||ye.overflowX==="scroll"||ye.overflowX==="visible"),se=oe<we&&(ye.overflowY==="auto"||ye.overflowY==="scroll"||ye.overflowY==="visible")):(te=F<X&&(ye.overflowX==="auto"||ye.overflowX==="scroll"),se=oe<we&&(ye.overflowY==="auto"||ye.overflowY==="scroll"));var ge=te&&(Math.abs(ee-a)<=f&&Te+F<X)-(Math.abs(q-a)<=f&&!!Te),nt=se&&(Math.abs(z-u)<=f&&_e+oe<we)-(Math.abs(j-u)<=f&&!!_e);if(!Pf[A])for(var Je=0;Je<=A;Je++)Pf[Je]||(Pf[Je]={});(Pf[A].vx!=ge||Pf[A].vy!=nt||Pf[A].el!==N)&&(Pf[A].el=N,Pf[A].vx=ge,Pf[A].vy=nt,clearInterval(Pf[A].pid),(ge!=0||nt!=0)&&(v=!0,Pf[A].pid=setInterval(function(){s&&this.layer===0&&Vr.active._onTouchMove(iV);var ft=Pf[this.layer].vy?Pf[this.layer].vy*h:0,V=Pf[this.layer].vx?Pf[this.layer].vx*h:0;typeof _=="function"&&_.call(Vr.dragged.parentNode[M1],V,ft,r,iV,Pf[this.layer].el)!=="continue"||tme(Pf[this.layer].el,V,ft)}.bind({layer:A}),24))),A++}while(e.bubbleScroll&&O!==g&&(O=rk(O,!1)));_ne=v}},30),lme=function(e){var t=e.originalEvent,s=e.putSortable,a=e.dragEl,u=e.activeSortable,f=e.dispatchSortableEvent,h=e.hideGhostForTarget,g=e.unhideGhostForTarget;if(!!t){var v=s||u;h();var _=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,A=document.elementFromPoint(_.clientX,_.clientY);g(),v&&!v.el.contains(A)&&(f("spill"),this.onSpill({dragEl:a,putSortable:s}))}};function Roe(){}Roe.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,s=e.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var a=sO(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),s&&s.animateAll()},drop:lme};D_(Roe,{pluginName:"revertOnSpill"});function Noe(){}Noe.prototype={onSpill:function(e){var t=e.dragEl,s=e.putSortable,a=s||this.sortable;a.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),a.animateAll()},drop:lme};D_(Noe,{pluginName:"removeOnSpill"});Vr.mount(new $_e);Vr.mount(Noe,Roe);function z_e(r){let e,t,s;const a=r[5].default,u=dhe(a,r,r[4],null);return{c(){e=ae("div"),u&&u.c(),U(e,"class",t="sortable-container "+r[0])},m(f,h){Ie(f,e,h),u&&u.m(e,null),r[7](e),s=!0},p(f,h){u&&u.p&&(!s||h&16)&&ghe(u,a,f,f[4],s?mhe(a,f[4],h,null):phe(f[4]),null),(!s||h&1&&t!==(t="sortable-container "+f[0]))&&U(e,"class",t)},i(f){s||(Oe(u,f),s=!0)},o(f){$e(u,f),s=!1},d(f){f&&Pe(e),u&&u.d(f),r[7](null)}}}function V_e(r){let e,t,s;const a=r[5].default,u=dhe(a,r,r[4],null);return{c(){e=ae("tbody"),u&&u.c(),U(e,"class",t="sortable-container "+r[0])},m(f,h){Ie(f,e,h),u&&u.m(e,null),r[6](e),s=!0},p(f,h){u&&u.p&&(!s||h&16)&&ghe(u,a,f,f[4],s?mhe(a,f[4],h,null):phe(f[4]),null),(!s||h&1&&t!==(t="sortable-container "+f[0]))&&U(e,"class",t)},i(f){s||(Oe(u,f),s=!0)},o(f){$e(u,f),s=!1},d(f){f&&Pe(e),u&&u.d(f),r[6](null)}}}function U_e(r){let e,t,s,a;const u=[V_e,z_e],f=[];function h(g,v){return g[1]?0:1}return e=h(r),t=f[e]=u[e](r),{c(){t.c(),s=Bs()},m(g,v){f[e].m(g,v),Ie(g,s,v),a=!0},p(g,[v]){let _=e;e=h(g),e===_?f[e].p(g,v):(So(),$e(f[_],1,1,()=>{f[_]=null}),ko(),t=f[e],t?t.p(g,v):(t=f[e]=u[e](g),t.c()),Oe(t,1),t.m(s.parentNode,s))},i(g){a||(Oe(t),a=!0)},o(g){$e(t),a=!1},d(g){f[e].d(g),g&&Pe(s)}}}function W_e(r,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:u}=e,{isTable:f=!1}=e,{sortableInstance:h}=e;const g=Ip();let v;H0(()=>{let O={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(N){g("update",{source:N.oldIndex,target:N.newIndex})},onMove(N){}};t(3,h=Vr.create(v,O))});function _(O){ts[O?"unshift":"push"](()=>{v=O,t(2,v)})}function A(O){ts[O?"unshift":"push"](()=>{v=O,t(2,v)})}return r.$$set=O=>{"sortableClass"in O&&t(0,u=O.sortableClass),"isTable"in O&&t(1,f=O.isTable),"sortableInstance"in O&&t(3,h=O.sortableInstance),"$$scope"in O&&t(4,a=O.$$scope)},[u,f,v,h,a,s,_,A]}class hI extends xo{constructor(e){super(),Ao(this,e,W_e,U_e,Eo,{sortableClass:0,isTable:1,sortableInstance:3})}}function Tle(r,e,t){const s=r.slice();return s[11]=e[t],s}function Dle(r){let e,t;return{c(){e=ae("div"),t=Kt(r[1]),U(e,"class","invalid-feedback d-block mb-3")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&2&&jn(t,s[1])},d(s){s&&Pe(e)}}}function Ole(r){let e,t;return e=new hI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[j_e]},$$scope:{ctx:r}}}),e.$on("update",r[4]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&16385&&(u.$$scope={dirty:a,ctx:s}),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Mle(r,e){let t,s,a,u;return s=new cI({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),a=Ze(),U(t,"class","col mb-3"),this.first=t},m(f,h){Ie(f,t,h),nn(s,t,null),Y(t,a),u=!0},p(f,h){e=f;const g={};h&1&&(g.record=e[11]),s.$set(g)},i(f){u||(Oe(s.$$.fragment,f),u=!0)},o(f){$e(s.$$.fragment,f),u=!1},d(f){f&&Pe(t),on(s)}}}function j_e(r){let e=[],t=new Map,s,a,u=r[0];const f=h=>h[11].id;for(let h=0;h<u.length;h+=1){let g=Tle(r,u,h),v=f(g);t.set(v,e[h]=Mle(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){g&9&&(u=h[0],So(),e=$h(e,g,f,1,h,u,t,s.parentNode,gv,Mle,s,Tle),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function Z_e(r){let e,t,s,a,u,f,h=r[1]&&Dle(r);s=new uI({props:{buttonClass:"mt-2",recordId:null,schemas:r[2]}}),s.$on("insert",r[5]),s.$on("save",r[5]);let g=r[0].length>0&&Ole(r);return{c(){h&&h.c(),e=Ze(),t=ae("div"),sn(s.$$.fragment),a=Ze(),g&&g.c(),u=Bs(),U(t,"class","inline-card-wrapper")},m(v,_){h&&h.m(v,_),Ie(v,e,_),Ie(v,t,_),nn(s,t,null),Ie(v,a,_),g&&g.m(v,_),Ie(v,u,_),f=!0},p(v,[_]){v[1]?h?h.p(v,_):(h=Dle(v),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null),v[0].length>0?g?(g.p(v,_),_&1&&Oe(g,1)):(g=Ole(v),g.c(),Oe(g,1),g.m(u.parentNode,u)):g&&(So(),$e(g,1,1,()=>{g=null}),ko())},i(v){f||(Oe(s.$$.fragment,v),Oe(g),f=!0)},o(v){$e(s.$$.fragment,v),$e(g),f=!1},d(v){h&&h.d(v),v&&Pe(e),v&&Pe(t),on(s),v&&Pe(a),g&&g.d(v),v&&Pe(u)}}}function q_e(r,e,t){let s,a;const u=hi("channel");let{record:f}=e,{field:h}=e,{graph:g}=e,{validationErrors:v}=e,_=u.schemas.filter(L=>h.collections.includes(L.name));function A(L){L.preventDefault(),t(6,g.edges=g.edges.filter(j=>!(j.target===L.detail&&j.field===h.name)),g)}function O(L){t(6,g.edges=yO(L.detail.source,L.detail.target,g.edges,h.name),g)}function N(L){L.preventDefault(),t(6,g=lI(g,f,L.detail.records,h.name,L.detail.action))}return r.$$set=L=>{"record"in L&&t(7,f=L.record),"field"in L&&t(8,h=L.field),"graph"in L&&t(6,g=L.graph),"validationErrors"in L&&t(9,v=L.validationErrors)},r.$$.update=()=>{var L;r.$$.dirty&768&&t(1,s=Rg(v,h.name)),r.$$.dirty&448&&t(0,a=(L=g.edges.filter(j=>j.field===h.name).map(j=>g.records.find(z=>z.id==j.target&&f.id==j.source)).filter(j=>!!(j!=null&&j.id)))!=null?L:[])},[a,s,_,A,O,N,g,f,h,v]}class G_e extends xo{constructor(e){super(),Ao(this,e,q_e,Z_e,Eo,{record:7,field:8,graph:6,validationErrors:9})}}function Rle(r,e,t){const s=r.slice();return s[21]=e[t],s}function K_e(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye,Te,_e,ge,nt,Je;f=new fl({props:{icon:"pencil",width:12,height:12}});const ft=[Q_e,J_e],V=[];function ut(kt,bn){return kt[7]?0:1}v=ut(r),_=V[v]=ft[v](r),L=new fl({props:{icon:"ellipsis"}});let et=!r[1]&&Nle(r),Et=!r[2]&&Ple(r),xt=r[8].type==="files"&&eCe(r),He=r[8].fields.filter(Ble),ct=[];for(let kt=0;kt<He.length;kt+=1)ct[kt]=Ile(Rle(r,He,kt));const an=kt=>$e(ct[kt],1,1,()=>{ct[kt]=null});return{c(){e=ae("div"),t=ae("div"),s=ae("small"),s.textContent=`${r[8].label}`,a=Ze(),u=ae("button"),sn(f.$$.fragment),h=Ze(),g=ae("button"),_.c(),A=Ze(),O=ae("div"),N=ae("button"),sn(L.$$.fragment),j=Ze(),z=ae("div"),q=ae("a"),ee=Kt("Edit in new tab"),oe=Ze(),te=ae("button"),te.textContent="Remove",se=Ze(),X=ae("div"),et&&et.c(),we=Ze(),Et&&Et.c(),ye=Ze(),Te=ae("div"),xt&&xt.c(),_e=Ze();for(let kt=0;kt<ct.length;kt+=1)ct[kt].c();U(s,"class","text-muted"),U(u,"class","btn btn-sm btn-link"),U(g,"class","btn btn-sm btn-link"),U(N,"class","btn btn-link btn-sm"),U(N,"type","button"),U(N,"data-bs-toggle","dropdown"),U(N,"aria-expanded","false"),U(q,"class","dropdown-item"),U(q,"href",F="/records/"+r[0].id),U(q,"target","_blank"),U(te,"class","dropdown-item"),U(X,"class","text-center mt-3"),U(z,"class","dropdown-menu"),U(O,"class","dropdown d-inline-block"),U(t,"class","actions svelte-4ewolk"),U(Te,"class","inline-preview svelte-4ewolk"),vs(Te,"expanded",r[7]),U(e,"class","lx-card mt-4 bg-primary bg-opacity-10 svelte-4ewolk")},m(kt,bn){Ie(kt,e,bn),Y(e,t),Y(t,s),Y(t,a),Y(t,u),nn(f,u,null),Y(t,h),Y(t,g),V[v].m(g,null),Y(t,A),Y(t,O),Y(O,N),nn(L,N,null),Y(O,j),Y(O,z),Y(z,q),Y(q,ee),Y(z,oe),Y(z,te),Y(z,se),Y(z,X),et&&et.m(X,null),Y(X,we),Et&&Et.m(X,null),Y(e,ye),Y(e,Te),xt&&xt.m(Te,null),Y(Te,_e);for(let qe=0;qe<ct.length;qe+=1)ct[qe]&&ct[qe].m(Te,null);ge=!0,nt||(Je=[En(u,"click",Hu(r[9])),En(g,"click",r[18]),En(te,"click",r[14])],nt=!0)},p(kt,bn){let qe=v;if(v=ut(kt),v!==qe&&(So(),$e(V[qe],1,1,()=>{V[qe]=null}),ko(),_=V[v],_||(_=V[v]=ft[v](kt),_.c()),Oe(_,1),_.m(g,null)),(!ge||bn&1&&F!==(F="/records/"+kt[0].id))&&U(q,"href",F),kt[1]?et&&(So(),$e(et,1,1,()=>{et=null}),ko()):et?(et.p(kt,bn),bn&2&&Oe(et,1)):(et=Nle(kt),et.c(),Oe(et,1),et.m(X,we)),kt[2]?Et&&(So(),$e(Et,1,1,()=>{Et=null}),ko()):Et?(Et.p(kt,bn),bn&4&&Oe(Et,1)):(Et=Ple(kt),Et.c(),Oe(Et,1),Et.m(X,null)),kt[8].type==="files"&&xt.p(kt,bn),bn&257){He=kt[8].fields.filter(Ble);let gt;for(gt=0;gt<He.length;gt+=1){const de=Rle(kt,He,gt);ct[gt]?(ct[gt].p(de,bn),Oe(ct[gt],1)):(ct[gt]=Ile(de),ct[gt].c(),Oe(ct[gt],1),ct[gt].m(Te,null))}for(So(),gt=He.length;gt<ct.length;gt+=1)an(gt);ko()}(!ge||bn&128)&&vs(Te,"expanded",kt[7])},i(kt){if(!ge){Oe(f.$$.fragment,kt),Oe(_),Oe(L.$$.fragment,kt),Oe(et),Oe(Et),Oe(xt);for(let bn=0;bn<He.length;bn+=1)Oe(ct[bn]);ge=!0}},o(kt){$e(f.$$.fragment,kt),$e(_),$e(L.$$.fragment,kt),$e(et),$e(Et),$e(xt),ct=ct.filter(Boolean);for(let bn=0;bn<ct.length;bn+=1)$e(ct[bn]);ge=!1},d(kt){kt&&Pe(e),on(f),V[v].d(),on(L),et&&et.d(),Et&&Et.d(),xt&&xt.d(),Ba(ct,kt),nt=!1,Bi(Je)}}}function Y_e(r){let e,t;return e=new jhe({props:{schema:r[8],record:r[4],graph:r[5],isCreateMode:!1}}),e.$on("cancel",r[16]),e.$on("inlinesaved",r[12]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&16&&(u.record=s[4]),a&32&&(u.graph=s[5]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function X_e(r){let e,t,s,a,u,f,h,g,v,_,A;return{c(){e=ae("div"),t=ae("p"),t.textContent="Item was removed from the current record.",s=Ze(),a=ae("p"),u=ae("button"),u.textContent="Undo",f=Ze(),h=ae("button"),h.textContent="Delete completely from channel",g=Ze(),v=ae("button"),v.textContent="Dismiss Message",U(u,"class","btn btn-sm btn-outline border border-1 border-dark"),U(h,"class","btn btn-sm btn-danger "),U(v,"class","btn btn-sm btn-link"),U(e,"class","lx-card bg-danger bg-opacity-10 text-center svelte-4ewolk")},m(O,N){Ie(O,e,N),Y(e,t),Y(e,s),Y(e,a),Y(a,u),Y(a,f),Y(a,h),Y(e,g),Y(e,v),_||(A=[En(u,"click",r[15]),En(h,"click",r[17]),En(v,"click",r[13])],_=!0)},p:_n,i:_n,o:_n,d(O){O&&Pe(e),_=!1,Bi(A)}}}function J_e(r){let e,t;return e=new fl({props:{icon:"expand",width:12,height:12}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Q_e(r){let e,t;return e=new fl({props:{icon:"compress",width:12,height:12}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Nle(r){let e,t,s,a,u;return t=new fl({props:{icon:"circle-chevron-up"}}),{c(){e=ae("button"),sn(t.$$.fragment),U(e,"class","btn btn-sm btn-outline-primary border-0")},m(f,h){Ie(f,e,h),nn(t,e,null),s=!0,a||(u=En(e,"click",Hu(r[10])),a=!0)},p:_n,i(f){s||(Oe(t.$$.fragment,f),s=!0)},o(f){$e(t.$$.fragment,f),s=!1},d(f){f&&Pe(e),on(t),a=!1,u()}}}function Ple(r){let e,t,s,a,u;return t=new fl({props:{icon:"circle-chevron-down"}}),{c(){e=ae("button"),sn(t.$$.fragment),U(e,"class","btn btn-sm btn-outline-primary border-0")},m(f,h){Ie(f,e,h),nn(t,e,null),s=!0,a||(u=En(e,"click",Hu(r[11])),a=!0)},p:_n,i(f){s||(Oe(t.$$.fragment,f),s=!0)},o(f){$e(t.$$.fragment,f),s=!1},d(f){f&&Pe(e),on(t),a=!1,u()}}}function eCe(r){let e,t;return e=new P_({props:{record:r[0],size:"small"}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.record=s[0]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function tCe(r){let e,t=r[0].data[r[21].name]+"",s;return{c(){e=new Ibe(!1),s=Bs(),e.a=s},m(a,u){e.m(t,a,u),Ie(a,s,u)},p(a,u){u&1&&t!==(t=a[0].data[a[21].name]+"")&&e.p(t)},i:_n,o:_n,d(a){a&&Pe(s),a&&e.d()}}}function nCe(r){let e,t;return e=new qhe({props:{record:r[0],field:r[21]}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.record=s[0]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function oCe(r){let e,t;return e=new Zhe({props:{record:r[0],field:r[21]}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1&&(u.record=s[0]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Ile(r){let e,t=r[21].label+"",s,a,u,f,h,g;const v=[oCe,nCe,tCe],_=[];function A(O,N){return O[21].ui==="reference"?0:O[21].ui==="file"?1:2}return u=A(r),f=_[u]=v[u](r),{c(){e=ae("span"),s=Kt(t),a=Ze(),f.c(),h=Bs(),U(e,"class","text-muted d-block mt-2"),ss(e,"font-size","13px")},m(O,N){Ie(O,e,N),Y(e,s),Ie(O,a,N),_[u].m(O,N),Ie(O,h,N),g=!0},p(O,N){f.p(O,N)},i(O){g||(Oe(f),g=!0)},o(O){$e(f),g=!1},d(O){O&&Pe(e),O&&Pe(a),_[u].d(O),O&&Pe(h)}}}function sCe(r){let e,t,s,a;const u=[X_e,Y_e,K_e],f=[];function h(g,v){return g[3]?0:g[6]===!0?1:2}return t=h(r),s=f[t]=u[t](r),{c(){e=ae("div"),s.c()},m(g,v){Ie(g,e,v),f[t].m(e,null),a=!0},p(g,[v]){let _=t;t=h(g),t===_?f[t].p(g,v):(So(),$e(f[_],1,1,()=>{f[_]=null}),ko(),s=f[t],s?s.p(g,v):(s=f[t]=u[t](g),s.c()),Oe(s,1),s.m(e,null))},i(g){a||(Oe(s),a=!0)},o(g){$e(s),a=!1},d(g){g&&Pe(e),f[t].d()}}}const Ble=r=>!(r.trashed||["tab"].includes(r.ui)||["id"].includes(r.name));function rCe(r,e,t){let s,a;const u=hi("channel"),f=Ip();let{isFirst:h}=e,{isLast:g}=e,{toDelete:v=!1}=e,{record:_}=e,A,O,N=u.schemas.find(we=>we.name===_.schema);function L(we){we.preventDefault(),axios.get(u.lucentUrl+"/records/editInline/"+_.id).then(ye=>{t(0,_=ye.data),t(4,A=ye.data.record),t(5,O=ye.data.graph),t(6,s=!0)}).catch(ye=>{console.log(ye)})}function j(we){we.preventDefault(),f("moveup")}function z(we){we.preventDefault(),f("movedn")}function q(we){we.preventDefault(),f("inlinesaved",we.detail),t(6,s=!1)}function ee(we){we.preventDefault(),f("remove",_.id)}function F(we){we.preventDefault(),f("trash",_.id)}function oe(we){we.preventDefault(),f("undoremove",_.id)}function te(we){we.preventDefault(),t(6,s=!1)}H0(()=>{t(6,s=!1)});function se(we){we.preventDefault(),axios.post(u.lucentUrl+"/records/status/trashed",[_]).then(ye=>{f("remove",_.id)}).catch(ye=>{console.log(ye)})}const X=we=>t(7,a=!a);return r.$$set=we=>{"isFirst"in we&&t(1,h=we.isFirst),"isLast"in we&&t(2,g=we.isLast),"toDelete"in we&&t(3,v=we.toDelete),"record"in we&&t(0,_=we.record)},t(6,s=!1),t(7,a=!1),[_,h,g,v,A,O,s,a,N,L,j,z,q,ee,F,oe,te,se,X]}class iCe extends xo{constructor(e){super(),Ao(this,e,rCe,sCe,Eo,{isFirst:1,isLast:2,toDelete:3,record:0})}}function cme(r,{from:e,to:t},s={}){const a=getComputedStyle(r),u=a.transform==="none"?"":a.transform,[f,h]=a.transformOrigin.split(" ").map(parseFloat),g=e.left+e.width*f/t.width-(t.left+f),v=e.top+e.height*h/t.height-(t.top+h),{delay:_=0,duration:A=N=>Math.sqrt(N)*120,easing:O=Mhe}=s;return{delay:_,duration:B0(A)?A(Math.sqrt(g*g+v*v)):A,easing:O,css:(N,L)=>{const j=L*g,z=L*v,q=N+L*e.width/t.width,ee=N+L*e.height/t.height;return`transform: ${u} translate(${j}px, ${z}px) scale(${q}, ${ee});`}}}function Lle(r,e,t){const s=r.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Fle(r){let e,t;return{c(){e=ae("div"),t=Kt(r[3]),U(e,"class","invalid-feedback d-block mb-3")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&8&&jn(t,s[3])},d(s){s&&Pe(e)}}}function Hle(r){let e=[],t=new Map,s,a,u=r[2];const f=h=>h[18].id;for(let h=0;h<u.length;h+=1){let g=Lle(r,u,h),v=f(g);t.set(v,e[h]=$le(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){if(g&2039){u=h[2],So();for(let v=0;v<e.length;v+=1)e[v].r();e=$h(e,g,f,1,h,u,t,s.parentNode,Ohe,$le,s,Lle);for(let v=0;v<e.length;v+=1)e[v].a();ko()}},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function $le(r,e){let t,s,a,u,f,h,g,v=_n,_;function A(...z){return e[13](e[18],...z)}function O(z){e[14](z,e[18],e[19],e[20])}function N(...z){return e[15](e[20],...z)}function L(...z){return e[16](e[20],...z)}let j={isFirst:e[20]===0,isLast:e[20]+1===e[2].length,toDelete:e[0].edges.find(A)._isTrashed};return e[18]!==void 0&&(j.record=e[18]),s=new iCe({props:j}),ts.push(()=>gr(s,"record",O)),s.$on("inlinesaved",e[5]),s.$on("moveup",N),s.$on("movedn",L),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),f=new uI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),f.$on("insert",e[9]),f.$on("save",e[9]),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),u=Ze(),sn(f.$$.fragment),h=Ze(),U(t,"class","inline-card-wrapper"),this.first=t},m(z,q){Ie(z,t,q),nn(s,t,null),Y(t,u),nn(f,t,null),Y(t,h),_=!0},p(z,q){e=z;const ee={};q&4&&(ee.isFirst=e[20]===0),q&4&&(ee.isLast=e[20]+1===e[2].length),q&7&&(ee.toDelete=e[0].edges.find(A)._isTrashed),!a&&q&4&&(a=!0,ee.record=e[18],Cr(()=>a=!1)),s.$set(ee);const F={};q&2&&(F.field=e[1]),q&4&&(F.recordId=e[18].id),f.$set(F)},r(){g=t.getBoundingClientRect()},f(){Ahe(t),v()},a(){v(),v=Ehe(t,g,cme,{delay:250,duration:250,easing:Rhe})},i(z){_||(Oe(s.$$.fragment,z),Oe(f.$$.fragment,z),_=!0)},o(z){$e(s.$$.fragment,z),$e(f.$$.fragment,z),_=!1},d(z){z&&Pe(t),on(s),on(f)}}}function aCe(r){let e,t,s,a,u,f,h=r[3]&&Fle(r);s=new uI({props:{field:r[1],recordId:null,schemas:r[4]}}),s.$on("insert",r[9]),s.$on("save",r[9]);let g=r[2].length>0&&Hle(r);return{c(){h&&h.c(),e=Ze(),t=ae("div"),sn(s.$$.fragment),a=Ze(),g&&g.c(),u=Bs(),U(t,"class","inline-card-wrapper")},m(v,_){h&&h.m(v,_),Ie(v,e,_),Ie(v,t,_),nn(s,t,null),Ie(v,a,_),g&&g.m(v,_),Ie(v,u,_),f=!0},p(v,[_]){v[3]?h?h.p(v,_):(h=Fle(v),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null);const A={};_&2&&(A.field=v[1]),s.$set(A),v[2].length>0?g?(g.p(v,_),_&4&&Oe(g,1)):(g=Hle(v),g.c(),Oe(g,1),g.m(u.parentNode,u)):g&&(So(),$e(g,1,1,()=>{g=null}),ko())},i(v){f||(Oe(s.$$.fragment,v),Oe(g),f=!0)},o(v){$e(s.$$.fragment,v),$e(g),f=!1},d(v){h&&h.d(v),v&&Pe(e),v&&Pe(t),on(s),v&&Pe(a),g&&g.d(v),v&&Pe(u)}}}function lCe(r,e,t){let s,a;const u=hi("channel");let{field:f}=e,{record:h}=e,{graph:g}=e,{validationErrors:v}=e,_=u.schemas.filter(te=>f.collections.includes(te.name));function A(te){const se=te.detail.records[0];t(0,g.edges=g.edges.map(X=>X.source===se.id?se:X),g)}function O(te){te.preventDefault(),t(0,g.edges=g.edges.filter(se=>!(se.target===te.detail&&se.field===f.name)),g)}function N(te){te.preventDefault(),t(0,g.edges=g.edges.map(se=>(se.target===te.detail&&se.field===f.name&&(se._isTrashed=!0),se)),g)}function L(te){te.preventDefault(),t(0,g.edges=g.edges.map(se=>(se.target===te.detail&&se.field===f.name&&delete se._isTrashed,se)),g)}function j(te){var _e;te.preventDefault();const se=te.detail.records,X=(_e=te.detail.after)!=null?_e:null,we=te.detail.action;let ye=se.map(ge=>({target:ge.id,source:h.id,sourceSchema:h.schema,targetSchema:ge.schema,field:f.name,rank:""})),Te=g.edges;if(we==="replace"&&(Te=Te.filter(ge=>ge.field!==f.name)),t(0,g.records=fd.exports.uniqBy([...g.records,...se],ge=>ge.id),g),t(0,g.edges=fd.exports.uniqBy([...Te,...ye],ge=>ge.target+ge.field),g),!X)t(0,g.edges=fd.exports.uniqBy([...ye,...Te],ge=>ge.target+ge.field),g);else{let ge=!1,nt=Te.reduce((Je,ft)=>(ge?Je.after.push(ft):Je.before.push(ft),ge===!1&&ft.target===X&&(ge=!0),Je),{before:[],after:[]});t(0,g.edges=fd.exports.uniqBy([...nt.before,...ye,...nt.after],Je=>Je.target+Je.field),g)}}function z(te,se,X){t(0,g.edges=yO(se,X,g.edges,f.name),g)}const q=(te,se)=>se.field===f.name&&se.target===te.id;function ee(te,se,X,we){X[we]=te,t(2,a),t(0,g),t(1,f),t(11,h)}const F=(te,se)=>z(se,te,te-1),oe=(te,se)=>z(se,te,te+1);return r.$$set=te=>{"field"in te&&t(1,f=te.field),"record"in te&&t(11,h=te.record),"graph"in te&&t(0,g=te.graph),"validationErrors"in te&&t(12,v=te.validationErrors)},r.$$.update=()=>{var te;r.$$.dirty&4098&&t(3,s=Rg(v,f.name)),r.$$.dirty&2051&&t(2,a=(te=g.edges.filter(se=>se.field===f.name).map(se=>g.records.find(X=>X.id==se.target&&h.id==se.source)).filter(se=>!!(se!=null&&se.id)))!=null?te:[])},[g,f,a,s,_,A,O,N,L,j,z,h,v,q,ee,F,oe]}class cCe extends xo{constructor(e){super(),Ao(this,e,lCe,aCe,Eo,{field:1,record:11,graph:0,validationErrors:12})}}function ume(r,e,t=null){return t?r.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:Uie(),value:null}),s),[]):[{meta:e,id:Uie(),value:null},...r]}function zle(r,e,t){const s=r.slice();return s[8]=e[t],s}function Vle(r){let e,t=r[1].fields,s=[];for(let a=0;a<t.length;a+=1)s[a]=Ule(zle(r,t,a));return{c(){e=ae("div");for(let a=0;a<s.length;a+=1)s[a].c();U(e,"class","d-flex ")},m(a,u){Ie(a,e,u);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(a,u){if(u&10){t=a[1].fields;let f;for(f=0;f<t.length;f+=1){const h=zle(a,t,f);s[f]?s[f].p(h,u):(s[f]=Ule(h),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=t.length}},d(a){a&&Pe(e),Ba(s,a)}}}function Ule(r){let e,t,s=r[8].label+"",a,u,f,h;function g(...v){return r[6](r[8],...v)}return{c(){e=ae("div"),t=ae("button"),a=Kt(s),u=Ze(),U(t,"class","btn btn-sm btn-primary"),U(e,"class","ms-2")},m(v,_){Ie(v,e,_),Y(e,t),Y(t,a),Y(e,u),f||(h=En(t,"click",g),f=!0)},p(v,_){r=v,_&2&&s!==(s=r[8].label+"")&&jn(a,s)},d(v){v&&Pe(e),f=!1,h()}}}function uCe(r){let e,t,s,a,u,f,h;s=new fl({props:{width:24,height:24,icon:"circle-plus"}});let g=r[2]&&Vle(r);return{c(){e=ae("div"),t=ae("button"),sn(s.$$.fragment),a=Ze(),g&&g.c(),U(t,"type","button"),U(t,"class","btn btn-lg btn-link text-decoration-none block-buttons svelte-1u8jpgc"),vs(t,"is-first",!r[0]),U(e,"class","d-flex justify-content-left mb-2 ")},m(v,_){Ie(v,e,_),Y(e,t),nn(s,t,null),Y(e,a),g&&g.m(e,null),u=!0,f||(h=En(t,"click",Hu(r[5])),f=!0)},p(v,[_]){(!u||_&1)&&vs(t,"is-first",!v[0]),v[2]?g?g.p(v,_):(g=Vle(v),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(v){u||(Oe(s.$$.fragment,v),u=!0)},o(v){$e(s.$$.fragment,v),u=!1},d(v){v&&Pe(e),on(s),g&&g.d(),f=!1,h()}}}function fCe(r,e,t){let s,{blockId:a}=e,{blockData:u}=e,{blockSchema:f}=e;function h(_,A){_.preventDefault(),t(4,u=ume(u,A)),t(2,s=!1)}const g=_=>t(2,s=!s),v=(_,A)=>h(A,_);return r.$$set=_=>{"blockId"in _&&t(0,a=_.blockId),"blockData"in _&&t(4,u=_.blockData),"blockSchema"in _&&t(1,f=_.blockSchema)},t(2,s=!1),[a,f,s,h,u,g,v]}class dCe extends xo{constructor(e){super(),Ao(this,e,fCe,uCe,Eo,{blockId:0,blockData:4,blockSchema:1})}}function hCe(r){let e,t,s,a,u;return{c(){e=ae("div"),t=ae("input"),U(t,"type","text"),U(t,"id",s=r[0].id),U(t,"class","form-control"),U(t,"autocomplete","off"),U(e,"class","mb-0")},m(f,h){Ie(f,e,h),Y(e,t),_r(t,r[0].value),a||(u=En(t,"input",r[1]),a=!0)},p(f,[h]){h&1&&s!==(s=f[0].id)&&U(t,"id",s),h&1&&t.value!==f[0].value&&_r(t,f[0].value)},i:_n,o:_n,d(f){f&&Pe(e),a=!1,u()}}}function mCe(r,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return r.$$set=u=>{"block"in u&&t(0,s=u.block)},[s,a]}class gCe extends xo{constructor(e){super(),Ao(this,e,mCe,hCe,Eo,{block:0})}}function pCe(r){let e,t,s,a,u;return{c(){e=ae("div"),t=ae("textarea"),U(t,"id",s=r[0].id),U(t,"class","form-control svelte-1er4ovm"),U(t,"autocomplete","off"),U(e,"class","mb-0")},m(f,h){Ie(f,e,h),Y(e,t),_r(t,r[0].value),r[3](t),a||(u=[En(t,"input",r[2]),En(t,"input",fme)],a=!0)},p(f,[h]){h&1&&s!==(s=f[0].id)&&U(t,"id",s),h&1&&_r(t,f[0].value)},i:_n,o:_n,d(f){f&&Pe(e),r[3](null),a=!1,Bi(u)}}}function fme(r){let e;r.target?e=r.target:e=r,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function bCe(r,e,t){let{block:s}=e,a;H0(()=>{fme(a)});function u(){s.value=this.value,t(0,s)}function f(h){ts[h?"unshift":"push"](()=>{a=h,t(1,a)})}return r.$$set=h=>{"block"in h&&t(0,s=h.block)},[s,a,u,f]}class vCe extends xo{constructor(e){super(),Ao(this,e,bCe,pCe,Eo,{block:0})}}var dme={exports:{}};(function(r){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},s=function(n,i){var l=Array.prototype.slice.call(n);return l.sort(i)},a=function(n,i){return u(function(l,d){return n.eq(i(l),i(d))})},u=function(n){return{eq:n}},f=u(function(n,i){return n===i}),h=f,g=function(n){return u(function(i,l){if(i.length!==l.length)return!1;for(var d=i.length,p=0;p<d;p++)if(!n.eq(i[p],l[p]))return!1;return!0})},v=function(n,i){return a(g(n),function(l){return s(l,i)})},_=function(n){return u(function(i,l){var d=Object.keys(i),p=Object.keys(l);if(!v(h).eq(d,p))return!1;for(var w=d.length,E=0;E<w;E++){var R=d[E];if(!n.eq(i[R],l[R]))return!1}return!0})},A=u(function(n,i){if(n===i)return!0;var l=e(n),d=e(i);return l!==d?!1:t(l)?n===i:l==="array"?g(A).eq(n,i):l==="object"?_(A).eq(n,i):!1});const O=Object.getPrototypeOf,N=(n,i,l)=>{var d;return l(n,i.prototype)?!0:((d=n.constructor)===null||d===void 0?void 0:d.name)===i.name},L=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&N(n,String,(l,d)=>d.isPrototypeOf(l))?"string":i},j=n=>i=>L(i)===n,z=n=>i=>typeof i===n,q=n=>i=>n===i,ee=(n,i)=>oe(n)&&N(n,i,(l,d)=>O(l)===d),F=j("string"),oe=j("object"),te=n=>ee(n,Object),se=j("array"),X=q(null),we=z("boolean"),ye=q(void 0),Te=n=>n==null,_e=n=>!Te(n),ge=z("function"),nt=z("number"),Je=(n,i)=>{if(se(n)){for(let l=0,d=n.length;l<d;++l)if(!i(n[l]))return!1;return!0}return!1},ft=()=>{},V=(n,i)=>(...l)=>n(i.apply(null,l)),ut=(n,i)=>l=>n(i(l)),et=n=>()=>n,Et=n=>n,xt=(n,i)=>n===i;function He(n,...i){return(...l)=>{const d=i.concat(l);return n.apply(null,d)}}const ct=n=>i=>!n(i),an=n=>()=>{throw new Error(n)},kt=n=>n(),bn=n=>{n()},qe=et(!1),gt=et(!0);class de{constructor(i,l){this.tag=i,this.value=l}static some(i){return new de(!0,i)}static none(){return de.singletonNone}fold(i,l){return this.tag?l(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?de.some(i(this.value)):de.none()}bind(i){return this.tag?i(this.value):de.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:de.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return _e(i)?de.some(i):de.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}de.singletonNone=new de(!1);const No=Array.prototype.slice,Zn=Array.prototype.indexOf,Bn=Array.prototype.push,ao=(n,i)=>Zn.call(n,i),Wo=(n,i)=>{const l=ao(n,i);return l===-1?de.none():de.some(l)},St=(n,i)=>ao(n,i)>-1,Xt=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];if(i(p,l))return!0}return!1},Tt=(n,i)=>{const l=n.length,d=new Array(l);for(let p=0;p<l;p++){const w=n[p];d[p]=i(w,p)}return d},Be=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];i(p,l)}},Ut=(n,i)=>{for(let l=n.length-1;l>=0;l--){const d=n[l];i(d,l)}},gn=(n,i)=>{const l=[],d=[];for(let p=0,w=n.length;p<w;p++){const E=n[p];(i(E,p)?l:d).push(E)}return{pass:l,fail:d}},wt=(n,i)=>{const l=[];for(let d=0,p=n.length;d<p;d++){const w=n[d];i(w,d)&&l.push(w)}return l},Yt=(n,i,l)=>(Ut(n,(d,p)=>{l=i(l,d,p)}),l),vn=(n,i,l)=>(Be(n,(d,p)=>{l=i(l,d,p)}),l),rs=(n,i,l)=>{for(let d=0,p=n.length;d<p;d++){const w=n[d];if(i(w,d))return de.some(w);if(l(w,d))break}return de.none()},eo=(n,i)=>rs(n,i,qe),ds=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];if(i(p,l))return de.some(l)}return de.none()},Or=n=>{const i=[];for(let l=0,d=n.length;l<d;++l){if(!se(n[l]))throw new Error("Arr.flatten item "+l+" was not an array, input: "+n);Bn.apply(i,n[l])}return i},Rs=(n,i)=>Or(Tt(n,i)),Js=(n,i)=>{for(let l=0,d=n.length;l<d;++l){const p=n[l];if(i(p,l)!==!0)return!1}return!0},Zs=n=>{const i=No.call(n,0);return i.reverse(),i},ba=(n,i)=>wt(n,l=>!St(i,l)),ar=(n,i)=>{const l={};for(let d=0,p=n.length;d<p;d++){const w=n[d];l[String(w)]=i(w,d)}return l},Ns=(n,i)=>{const l=No.call(n,0);return l.sort(i),l},Zr=(n,i)=>i>=0&&i<n.length?de.some(n[i]):de.none(),Po=n=>Zr(n,0),Mo=n=>Zr(n,n.length-1),Mr=ge(Array.from)?Array.from:n=>No.call(n),Ls=(n,i)=>{for(let l=0;l<n.length;l++){const d=i(n[l],l);if(d.isSome())return d}return de.none()},na=(n,i)=>{const l=[],d=ge(i)?p=>Xt(l,w=>i(w,p)):p=>St(l,p);for(let p=0,w=n.length;p<w;p++){const E=n[p];d(E)||l.push(E)}return l},gs=Object.keys,va=Object.hasOwnProperty,ln=(n,i)=>{const l=gs(n);for(let d=0,p=l.length;d<p;d++){const w=l[d],E=n[w];i(E,w)}},ps=(n,i)=>Li(n,(l,d)=>({k:d,v:i(l,d)})),Li=(n,i)=>{const l={};return ln(n,(d,p)=>{const w=i(d,p);l[w.k]=w.v}),l},ze=n=>(i,l)=>{n[l]=i},Qe=(n,i,l,d)=>{ln(n,(p,w)=>{(i(p,w)?l:d)(p,w)})},Dt=(n,i)=>{const l={},d={};return Qe(n,i,ze(l),ze(d)),{t:l,f:d}},Wt=(n,i)=>{const l={};return Qe(n,i,ze(l),ft),l},qn=(n,i)=>{const l=[];return ln(n,(d,p)=>{l.push(i(d,p))}),l},uo=n=>qn(n,Et),po=(n,i)=>un(n,i)?de.from(n[i]):de.none(),un=(n,i)=>va.call(n,i),ns=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,_o=(n,i,l=A)=>_(l).eq(n,i),cs=n=>{const i={};return Be(n,l=>{i[l]={}}),gs(i)},Sr=n=>n.length!==void 0,Ir=Array.isArray,Vs=n=>{if(Ir(n))return n;{const i=[];for(let l=0,d=n.length;l<d;l++)i[l]=n[l];return i}},Ur=(n,i,l)=>{if(!n)return!1;if(l=l||n,Sr(n)){for(let d=0,p=n.length;d<p;d++)if(i.call(l,n[d],d,n)===!1)return!1}else for(const d in n)if(un(n,d)&&i.call(l,n[d],d,n)===!1)return!1;return!0},Fi=(n,i)=>{const l=[];return Ur(n,(d,p)=>{l.push(i(d,p,n))}),l},La=(n,i)=>{const l=[];return Ur(n,(d,p)=>{(!i||i(d,p,n))&&l.push(d)}),l},mi=(n,i)=>{if(n){for(let l=0,d=n.length;l<d;l++)if(n[l]===i)return l}return-1},Ke=(n,i,l,d)=>{let p=ye(l)?n[0]:l;for(let w=0;w<n.length;w++)p=i.call(d,p,n[w],w);return p},Ge=(n,i,l)=>{for(let d=0,p=n.length;d<p;d++)if(i.call(l,n[d],d,n))return d;return-1},It=n=>n[n.length-1],jt=n=>{let i=!1,l;return(...d)=>(i||(i=!0,l=n.apply(null,d)),l)},fo=(n,i,l,d)=>{const p=n.isiOS()&&/ipad/i.test(l)===!0,w=n.isiOS()&&!p,E=n.isiOS()||n.isAndroid(),R=E||d("(pointer:coarse)"),B=p||!w&&E&&d("(min-device-width:768px)"),K=w||E&&!B,ie=i.isSafari()&&n.isiOS()&&/safari/i.test(l)===!1,ue=!K&&!B&&!ie;return{isiPad:et(p),isiPhone:et(w),isTablet:et(B),isPhone:et(K),isTouch:et(R),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:et(ie),isDesktop:et(ue)}},Lo=(n,i)=>{for(let l=0;l<n.length;l++){const d=n[l];if(d.test(i))return d}},Ko=(n,i)=>{const l=Lo(n,i);if(!l)return{major:0,minor:0};const d=p=>Number(i.replace(l,"$"+p));return Zo(d(1),d(2))},Yr=(n,i)=>{const l=String(i).toLowerCase();return n.length===0?it():Ko(n,l)},it=()=>Zo(0,0),Zo=(n,i)=>({major:n,minor:i}),Oi={nu:Zo,detect:Yr,unknown:it},oa=(n,i)=>Ls(i.brands,l=>{const d=l.brand.toLowerCase();return eo(n,p=>{var w;return d===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Oi.nu(parseInt(l.version,10),0)}))}),ua=(n,i)=>{const l=String(i).toLowerCase();return eo(n,d=>d.search(l))},ur=(n,i)=>ua(n,i).map(l=>{const d=Oi.detect(l.versionRegexes,i);return{current:l.name,version:d}}),Dc=(n,i)=>ua(n,i).map(l=>{const d=Oi.detect(l.versionRegexes,i);return{current:l.name,version:d}}),gc=(n,i)=>n.substring(i),Ja=(n,i,l)=>i===""||n.length>=i.length&&n.substr(l,l+i.length)===i,fa=(n,i)=>xr(n,i)?gc(n,i.length):n,Qs=(n,i,l=0,d)=>{const p=n.indexOf(i,l);return p!==-1?ye(d)?!0:p+i.length<=d:!1},xr=(n,i)=>Ja(n,i,0),Ki=(n,i)=>Ja(n,i,n.length-i.length),dl=n=>i=>i.replace(n,""),pc=dl(/^\s+|\s+$/g),Zc=dl(/^\s+/g),gu=dl(/\s+$/g),pr=n=>n.length>0,Qa=n=>!pr(n),pu=(n,i)=>i<=0?"":new Array(i+1).join(n),qc=(n,i=10)=>{const l=parseInt(n,i);return isNaN(l)?de.none():de.some(l)},Vl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>Qs(i,n),Tr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>Qs(n,"edge/")&&Qs(n,"chrome")&&Qs(n,"safari")&&Qs(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Vl],search:n=>Qs(n,"chrome")&&!Qs(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>Qs(n,"msie")||Qs(n,"trident")},{name:"Opera",versionRegexes:[Vl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Vl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(Qs(n,"safari")||Qs(n,"mobile/"))&&Qs(n,"applewebkit")}],Rm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>Qs(n,"iphone")||Qs(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Aa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Aa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Aa("linux"),versionRegexes:[]},{name:"Solaris",search:Aa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Aa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Aa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],gf={browsers:et(Tr),oses:et(Rm)},kr="Edge",Fa="Chromium",sa="IE",Yi="Opera",bu="Firefox",Oc="Safari",Ha=()=>Mc({current:void 0,version:Oi.unknown()}),Mc=n=>{const i=n.current,l=n.version,d=p=>()=>i===p;return{current:i,version:l,isEdge:d(kr),isChromium:d(Fa),isIE:d(sa),isOpera:d(Yi),isFirefox:d(bu),isSafari:d(Oc)}},bc={unknown:Ha,nu:Mc,edge:et(kr),chromium:et(Fa),ie:et(sa),opera:et(Yi),firefox:et(bu),safari:et(Oc)},gd="Windows",Bf="iOS",vu="Android",Ul="Linux",Rc="macOS",pf="Solaris",Gc="FreeBSD",pd="ChromeOS",xe=()=>tt({current:void 0,version:Oi.unknown()}),tt=n=>{const i=n.current,l=n.version,d=p=>()=>i===p;return{current:i,version:l,isWindows:d(gd),isiOS:d(Bf),isAndroid:d(vu),isMacOS:d(Rc),isLinux:d(Ul),isSolaris:d(pf),isFreeBSD:d(Gc),isChromeOS:d(pd)}},pt={unknown:xe,nu:tt,windows:et(gd),ios:et(Bf),android:et(vu),linux:et(Ul),macos:et(Rc),solaris:et(pf),freebsd:et(Gc),chromeos:et(pd)},yn={detect:(n,i,l)=>{const d=gf.browsers(),p=gf.oses(),w=i.bind(B=>oa(d,B)).orThunk(()=>ur(d,n)).fold(bc.unknown,bc.nu),E=Dc(p,n).fold(pt.unknown,pt.nu),R=fo(E,w,n,l);return{browser:w,os:E,deviceType:R}}},Ro=n=>window.matchMedia(n).matches;let Rr=jt(()=>yn.detect(navigator.userAgent,de.from(navigator.userAgentData),Ro));const ys=()=>Rr(),is=navigator.userAgent,Ei=ys(),qs=Ei.browser,Hi=Ei.os,yu=Ei.deviceType,bd=is.indexOf("Windows Phone")!==-1,Xn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:qs.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!qs.isIE(),windowsPhone:bd,browser:{current:qs.current,version:qs.version,isChromium:qs.isChromium,isEdge:qs.isEdge,isFirefox:qs.isFirefox,isIE:qs.isIE,isOpera:qs.isOpera,isSafari:qs.isSafari},os:{current:Hi.current,version:Hi.version,isAndroid:Hi.isAndroid,isChromeOS:Hi.isChromeOS,isFreeBSD:Hi.isFreeBSD,isiOS:Hi.isiOS,isLinux:Hi.isLinux,isMacOS:Hi.isMacOS,isSolaris:Hi.isSolaris,isWindows:Hi.isWindows},deviceType:{isDesktop:yu.isDesktop,isiPad:yu.isiPad,isiPhone:yu.isiPhone,isPhone:yu.isPhone,isTablet:yu.isTablet,isTouch:yu.isTouch,isWebView:yu.isWebView}},Nm=/^\s*|\s*$/g,$i=n=>Te(n)?"":(""+n).replace(Nm,""),he=(n,i)=>i?i==="array"&&Ir(n)?!0:typeof n===i:n!==void 0,Re=(n,i,l={})=>{const d=F(n)?n.split(i||","):n||[];let p=d.length;for(;p--;)l[d[p]]={};return l},We=un,Bt=(n,...i)=>{for(let l=0;l<i.length;l++){const d=i[l];for(const p in d)if(un(d,p)){const w=d[p];w!==void 0&&(n[p]=w)}}return n},Fn=function(n,i,l,d){d=d||this,n&&(l&&(n=n[l]),Ur(n,(p,w)=>i.call(d,p,w,l)===!1?!1:(Fn(p,i,l,d),!0)))},hn={trim:$i,isArray:Ir,is:he,toArray:Vs,makeMap:Re,each:Ur,map:Fi,grep:La,inArray:mi,hasOwn:We,extend:Bt,walk:Fn,resolve:(n,i=window)=>{const l=n.split(".");for(let d=0,p=l.length;d<p&&(i=i[l[d]],!!i);d++);return i},explode:(n,i)=>se(n)?n:n===""?[]:Fi(n.split(i||","),$i),_addCacheSuffix:n=>{const i=Xn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},qr=(n,i,l=xt)=>n.exists(d=>l(d,i)),Nl=(n,i,l=xt)=>ni(n,i,l).getOr(n.isNone()&&i.isNone()),Xi=n=>{const i=[],l=d=>{i.push(d)};for(let d=0;d<n.length;d++)n[d].each(l);return i},ni=(n,i,l)=>n.isSome()&&i.isSome()?de.some(l(n.getOrDie(),i.getOrDie())):de.none(),bf=(n,i,l,d)=>n.isSome()&&i.isSome()&&l.isSome()?de.some(d(n.getOrDie(),i.getOrDie(),l.getOrDie())):de.none(),Ss=(n,i)=>n?de.some(i):de.none(),Kc=typeof window<"u"?window:Function("return this;")(),Ai=(n,i)=>{let l=i!=null?i:Kc;for(let d=0;d<n.length&&l!==void 0&&l!==null;++d)l=l[n[d]];return l},sc=(n,i)=>{const l=n.split(".");return Ai(l,i)},Mi=(n,i)=>sc(n,i),Lf=(n,i)=>{const l=Mi(n,i);if(l==null)throw new Error(n+" not available on this browser");return l},da=Object.getPrototypeOf,Ff=n=>Lf("HTMLElement",n),fr=n=>{const i=sc("ownerDocument.defaultView",n);return oe(n)&&(Ff(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(da(n).constructor.name))},$u=8,zu=9,vc=11,Hf=1,jd=3,Xr=n=>n.dom.nodeName.toLowerCase(),Ji=n=>n.dom.nodeType,$a=n=>i=>Ji(i)===n,U0=n=>Ji(n)===$u||Xr(n)==="#comment",xi=n=>_l(n)&&fr(n.dom),_l=$a(Hf),el=$a(jd),Ng=$a(zu),$f=$a(vc),yc=n=>i=>_l(i)&&Xr(i)===n,vf=(n,i,l)=>{if(F(l)||we(l)||nt(l))n.setAttribute(i,l+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",l,":: Element ",n),new Error("Attribute value was not simple")},Dr=(n,i,l)=>{vf(n.dom,i,l)},Vu=(n,i)=>{const l=n.dom;ln(i,(d,p)=>{vf(l,p,d)})},Pl=(n,i)=>{const l=n.dom.getAttribute(i);return l===null?void 0:l},za=(n,i)=>de.from(Pl(n,i)),qi=(n,i)=>{const l=n.dom;return l&&l.hasAttribute?l.hasAttribute(i):!1},zi=(n,i)=>{n.dom.removeAttribute(i)},rc=n=>{const i=n.dom.attributes;return i==null||i.length===0},zf=n=>vn(n.dom.attributes,(i,l)=>(i[l.name]=l.value,i),{}),Zd=(n,i)=>{const l=Pl(n,i);return l===void 0||l===""?[]:l.split(" ")},Pg=(n,i,l)=>{const p=Zd(n,i).concat([l]);return Dr(n,i,p.join(" ")),!0},Pm=(n,i,l)=>{const d=wt(Zd(n,i),p=>p!==l);return d.length>0?Dr(n,i,d.join(" ")):zi(n,i),!1},Il=n=>n.dom.classList!==void 0,Im=n=>Zd(n,"class"),tl=(n,i)=>Pg(n,"class",i),yf=(n,i)=>Pm(n,"class",i),zh=(n,i)=>St(Im(n),i)?yf(n,i):tl(n,i),Uu=(n,i)=>{Il(n)?n.dom.classList.add(i):tl(n,i)},Vh=n=>{(Il(n)?n.dom.classList:Im(n)).length===0&&zi(n,"class")},Nc=(n,i)=>{Il(n)?n.dom.classList.remove(i):yf(n,i),Vh(n)},Uh=(n,i)=>{const l=Il(n)?n.dom.classList.toggle(i):zh(n,i);return Vh(n),l},wf=(n,i)=>Il(n)&&n.dom.classList.contains(i),Bp=(n,i)=>{const d=(i||document).createElement("div");if(d.innerHTML=n,!d.hasChildNodes()||d.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return Wl(d.childNodes[0])},Bm=(n,i)=>{const d=(i||document).createElement(n);return Wl(d)},Vf=(n,i)=>{const d=(i||document).createTextNode(n);return Wl(d)},Wl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ye={fromHtml:Bp,fromTag:Bm,fromText:Vf,fromDom:Wl,fromPoint:(n,i,l)=>de.from(n.dom.elementFromPoint(i,l)).map(Wl)},qd=(n,i)=>{const l=[],d=w=>(l.push(w),i(w));let p=i(n);do p=p.bind(d);while(p.isSome());return l},wu=(n,i)=>{const l=n.dom;if(l.nodeType!==Hf)return!1;{const d=l;if(d.matches!==void 0)return d.matches(i);if(d.msMatchesSelector!==void 0)return d.msMatchesSelector(i);if(d.webkitMatchesSelector!==void 0)return d.webkitMatchesSelector(i);if(d.mozMatchesSelector!==void 0)return d.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Bg=n=>n.nodeType!==Hf&&n.nodeType!==zu&&n.nodeType!==vc||n.childElementCount===0,L1=(n,i)=>{const l=i===void 0?document:i.dom;return Bg(l)?[]:Tt(l.querySelectorAll(n),Ye.fromDom)},Wh=(n,i)=>{const l=i===void 0?document:i.dom;return Bg(l)?de.none():de.from(l.querySelector(n)).map(Ye.fromDom)},bt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const l=n.dom,d=i.dom;return l===d?!1:l.contains(d)},rn=n=>Ye.fromDom(n.dom.ownerDocument),To=n=>Ng(n)?n:rn(n),er=n=>Ye.fromDom(To(n).dom.documentElement),Wr=n=>Ye.fromDom(To(n).dom.defaultView),ai=n=>de.from(n.dom.parentNode).map(Ye.fromDom),pi=n=>de.from(n.dom.parentElement).map(Ye.fromDom),Gd=(n,i)=>{const l=ge(i)?i:qe;let d=n.dom;const p=[];for(;d.parentNode!==null&&d.parentNode!==void 0;){const w=d.parentNode,E=Ye.fromDom(w);if(p.push(E),l(E)===!0)break;d=w}return p},W0=n=>{const i=l=>wt(l,d=>!bt(n,d));return ai(n).map(xa).map(i).getOr([])},ya=n=>de.from(n.dom.previousSibling).map(Ye.fromDom),vd=n=>de.from(n.dom.nextSibling).map(Ye.fromDom),Lg=n=>Zs(qd(n,ya)),nl=n=>qd(n,vd),xa=n=>Tt(n.dom.childNodes,Ye.fromDom),Wu=(n,i)=>{const l=n.dom.childNodes;return de.from(l[i]).map(Ye.fromDom)},oi=n=>Wu(n,0),_u=n=>Wu(n,n.dom.childNodes.length-1),ic=n=>n.dom.childNodes.length,jh=n=>n.dom.hasChildNodes(),F1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ye.fromDom(i)},Kd=n=>$f(n)&&_e(n.dom.host),Fg=ge(Element.prototype.attachShadow)&&ge(Node.prototype.getRootNode),Yd=et(Fg),jl=Fg?n=>Ye.fromDom(n.dom.getRootNode()):To,Zh=n=>Kd(n)?n:F1(To(n)),H1=n=>Kd(n)?n:Ye.fromDom(To(n).dom.body),Lm=n=>{const i=jl(n);return Kd(i)?de.some(i):de.none()},Hg=n=>Ye.fromDom(n.dom.host),qh=n=>{if(Yd()&&_e(n.target)){const i=Ye.fromDom(n.target);if(_l(i)&&Xd(i)&&n.composed&&n.composedPath){const l=n.composedPath();if(l)return Po(l)}}return de.from(n.target)},Xd=n=>_e(n.dom.shadowRoot),yd=n=>{const i=el(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const l=i.ownerDocument;return Lm(Ye.fromDom(i)).fold(()=>l.body.contains(i),ut(yd,Hg))};var si=(n,i,l,d,p)=>n(l,d)?de.some(l):ge(p)&&p(l)?de.none():i(l,d,p);const li=(n,i,l)=>{let d=n.dom;const p=ge(l)?l:qe;for(;d.parentNode;){d=d.parentNode;const w=Ye.fromDom(d);if(i(w))return de.some(w);if(p(w))break}return de.none()},Bl=(n,i,l)=>si((p,w)=>w(p),li,n,i,l),Lp=(n,i)=>{const l=n.dom;return l.parentNode?Q(Ye.fromDom(l.parentNode),d=>!bt(n,d)&&i(d)):de.none()},Q=(n,i)=>{const l=p=>i(Ye.fromDom(p));return eo(n.dom.childNodes,l).map(Ye.fromDom)},ce=(n,i)=>{const l=d=>{for(let p=0;p<d.childNodes.length;p++){const w=Ye.fromDom(d.childNodes[p]);if(i(w))return de.some(w);const E=l(d.childNodes[p]);if(E.isSome())return E}return de.none()};return l(n.dom)},Se=(n,i,l)=>li(n,d=>wu(d,i),l),Xe=(n,i)=>Wh(i,n),rt=(n,i,l)=>si((p,w)=>wu(p,w),Se,n,i,l),On=n=>rt(n,"[contenteditable]"),Cn=(n,i=!1)=>yd(n)?n.dom.isContentEditable:On(n).fold(et(i),l=>Yo(l)==="true"),Yo=n=>n.dom.contentEditable,os=n=>n.style!==void 0&&ge(n.style.getPropertyValue),ho=(n,i,l)=>{if(!F(l))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",l,":: Element ",n),new Error("CSS value must be a string: "+l);os(n)&&n.style.setProperty(i,l)},Er=(n,i)=>{os(n)&&n.style.removeProperty(i)},Zl=(n,i,l)=>{const d=n.dom;ho(d,i,l)},ra=(n,i)=>{const l=n.dom;ln(i,(d,p)=>{ho(l,p,d)})},Ri=(n,i)=>{const l=n.dom,p=window.getComputedStyle(l).getPropertyValue(i);return p===""&&!yd(n)?Cu(l,i):p},Cu=(n,i)=>os(n)?n.style.getPropertyValue(i):"",Ta=(n,i)=>{const l=n.dom,d=Cu(l,i);return de.from(d).filter(p=>p.length>0)},Gh=n=>{const i={},l=n.dom;if(os(l))for(let d=0;d<l.style.length;d++){const p=l.style.item(d);i[p]=l.style[p]}return i},Fm=(n,i)=>{const l=n.dom;Er(l,i),qr(za(n,"style").map(pc),"")&&zi(n,"style")},Vi=n=>n.dom.offsetWidth,wa=(n,i)=>{ai(n).each(d=>{d.dom.insertBefore(i.dom,n.dom)})},Yc=(n,i)=>{vd(n).fold(()=>{ai(n).each(p=>{Qi(p,i)})},d=>{wa(d,i)})},Jd=(n,i)=>{oi(n).fold(()=>{Qi(n,i)},d=>{n.dom.insertBefore(i.dom,d.dom)})},Qi=(n,i)=>{n.dom.appendChild(i.dom)},j0=(n,i)=>{wa(n,i),Qi(i,n)},yv=(n,i)=>{Be(i,(l,d)=>{const p=d===0?n:i[d-1];Yc(p,l)})},Jr=(n,i)=>{Be(i,l=>{Qi(n,l)})},wd=n=>{n.dom.textContent="",Be(xa(n),i=>{br(i)})},br=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},ql=n=>{const i=xa(n);i.length>0&&yv(n,i),br(n)},Uf=(n,i)=>{const d=(i||document).createElement("div");return d.innerHTML=n,xa(Ye.fromDom(d))},Qd=n=>Tt(n,Ye.fromDom),Ae=n=>n.dom.innerHTML,_f=(n,i)=>{const d=rn(n).dom,p=Ye.fromDom(d.createDocumentFragment()),w=Uf(i,d);Jr(p,w),wd(n),Qi(n,p)},$g=n=>{const i=Ye.fromTag("div"),l=Ye.fromDom(n.dom.cloneNode(!0));return Qi(i,l),Ae(i)},Su=(n,i,l,d,p,w,E)=>({target:n,x:i,y:l,stop:d,prevent:p,kill:w,raw:E}),ci=n=>{const i=Ye.fromDom(qh(n).getOr(n.target)),l=()=>n.stopPropagation(),d=()=>n.preventDefault(),p=V(d,l);return Su(i,n.clientX,n.clientY,l,d,p,n)},wv=(n,i)=>l=>{n(l)&&i(ci(l))},$1=(n,i,l,d,p)=>{const w=wv(l,d);return n.dom.addEventListener(i,w,p),{unbind:He(Wf,n,i,w,p)}},Z0=(n,i,l,d)=>$1(n,i,l,d,!1),Wf=(n,i,l,d)=>{n.dom.removeEventListener(i,l,d)},Hm=(n,i)=>({left:n,top:i,translate:(d,p)=>Hm(n+d,i+p)}),zg=Hm,_v=n=>{const i=n.getBoundingClientRect();return zg(i.left,i.top)},Cf=(n,i)=>n!==void 0?n:i!==void 0?i:0,h2=n=>{const i=n.dom.ownerDocument,l=i.body,d=i.defaultView,p=i.documentElement;if(l===n.dom)return zg(l.offsetLeft,l.offsetTop);const w=Cf(d==null?void 0:d.pageYOffset,p.scrollTop),E=Cf(d==null?void 0:d.pageXOffset,p.scrollLeft),R=Cf(p.clientTop,l.clientTop),B=Cf(p.clientLeft,l.clientLeft);return ku(n).translate(E-B,w-R)},ku=n=>{const i=n.dom,d=i.ownerDocument.body;return d===i?zg(d.offsetLeft,d.offsetTop):yd(n)?_v(i):zg(0,0)},ju=n=>{const i=n!==void 0?n.dom:document,l=i.body.scrollLeft||i.documentElement.scrollLeft,d=i.body.scrollTop||i.documentElement.scrollTop;return zg(l,d)},q0=(n,i,l)=>{const p=(l!==void 0?l.dom:document).defaultView;p&&p.scrollTo(n,i)},G0=(n,i)=>{ys().browser.isSafari()&&ge(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},K0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?de.none():de.from(i.visualViewport)},z1=(n,i,l,d)=>({x:n,y:i,width:l,height:d,right:n+l,bottom:i+d}),jf=n=>{const i=n===void 0?window:n,l=i.document,d=ju(Ye.fromDom(l));return K0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,E=p.clientHeight;return z1(d.left,d.top,w,E)},p=>z1(Math.max(p.pageLeft,d.left),Math.max(p.pageTop,d.top),p.width,p.height))},Y0=(n,i)=>wt(xa(n),i),X0=(n,i)=>{let l=[];return Be(xa(n),d=>{i(d)&&(l=l.concat([d])),l=l.concat(X0(d,i))}),l},hl=(n,i)=>L1(i,n),m2=(n,i,l)=>Se(n,i,l).isSome();class bi{constructor(i,l){this.node=i,this.rootNode=l,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,l,d,p){if(i){if(!p&&i[l])return i[l];if(i!==this.rootNode){let w=i[d];if(w)return w;for(let E=i.parentNode;E&&E!==this.rootNode;E=E.parentNode)if(w=E[d],w)return w}}}findPreviousNode(i,l){if(i){const d=i.previousSibling;if(this.rootNode&&d===this.rootNode)return;if(d){if(!l){for(let w=d.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return d}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const lo=n=>i=>!!i&&i.nodeType===n,_d=n=>!!n&&!Object.getPrototypeOf(n),Qn=lo(1),wc=n=>{const i=n.toLowerCase();return l=>_e(l)&&l.nodeName.toLowerCase()===i},Sf=n=>{const i=n.map(l=>l.toLowerCase());return l=>{if(l&&l.nodeName){const d=l.nodeName.toLowerCase();return St(i,d)}return!1}},eh=(n,i)=>{const l=i.toLowerCase().split(" ");return d=>{if(Qn(d)){const p=d.ownerDocument.defaultView;if(p)for(let w=0;w<l.length;w++){const E=p.getComputedStyle(d,null);if((E?E.getPropertyValue(n):null)===l[w])return!0}}return!1}},Pc=n=>i=>Qn(i)&&i.hasAttribute(n),Vg=(n,i)=>l=>Qn(l)&&l.getAttribute(n)===i,Cd=n=>Qn(n)&&n.hasAttribute("data-mce-bogus"),ml=n=>Qn(n)&&n.getAttribute("data-mce-bogus")==="all",Eu=n=>Qn(n)&&n.tagName==="TABLE",Fp=n=>i=>!!(Qn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),V1=Sf(["textarea","input"]),Sn=lo(3),$m=lo(4),Sd=lo(7),th=lo(8),Zu=lo(9),U1=lo(11),ui=wc("br"),Ui=wc("img"),ha=Fp("true"),As=Fp("false"),kd=Sf(["td","th"]),Cl=Sf(["td","th","caption"]),qu=Sf(["video","audio","object","embed"]),Va=wc("li"),_a=wc("details"),Hp=wc("summary"),Qt="\uFEFF",Gr="\xA0",J0=n=>n===Qt,Ca=n=>n.replace(/\uFEFF/g,""),Ug=((n,i)=>{const l=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return d(w).getOr("")},d=w=>n(w)?de.from(w.dom.nodeValue):de.none();return{get:l,getOption:d,set:(w,E)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=E}}})(el,"text"),Ic=n=>Ug.get(n),Zf=n=>Ug.getOption(n),qf=(n,i)=>Ug.set(n,i),$p=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Ll=["td","th"],Ar=["thead","tbody","tfoot"],Wa=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],nh=["h1","h2","h3","h4","h5","h6"],Gl=["li","dd","dt"],Q0=["ul","ol","dl"],zm=["pre","script","textarea","style"],W1=["pre"].concat(nh),ja=n=>{let i;return l=>(i=i||ar(n,gt),un(i,Xr(l)))},ac=ja($p),At=n=>Xr(n)==="table",_c=n=>_l(n)&&!ac(n),Xc=n=>_l(n)&&Xr(n)==="br",lc=ja(Wa),Au=ja(Q0),Za=ja(Gl),qa=ja(Ar),Vm=ja(Ll),Jc=ja(zm),eb=ja(W1),$o=n=>eb(n)||_c(n),$=n=>{const i=[];let l=n.dom;for(;l;)i.push(Ye.fromDom(l)),l=l.lastChild;return i},G=n=>{const i=hl(n,"br"),l=wt($(n).slice(-1),Xc);i.length===l.length&&Be(l,br)},ve=()=>{const n=Ye.fromTag("br");return Dr(n,"data-mce-bogus","1"),n},De=n=>{wd(n),Qi(n,ve())},at=n=>{_u(n).each(i=>{ya(i).each(l=>{ac(n)&&Xc(i)&&ac(l)&&br(i)})})},Ft=Qt,kn=J0,Ln=Ca,jo=Qn,Qo=Sn,vi=n=>(Qo(n)&&(n=n.parentNode),jo(n)&&n.hasAttribute("data-mce-caret")),tr=n=>Qo(n)&&kn(n.data),vr=n=>vi(n)||tr(n),Bc=n=>n.firstChild!==n.lastChild||!ui(n.firstChild),Qc=(n,i)=>{var l;const p=((l=n.ownerDocument)!==null&&l!==void 0?l:document).createTextNode(Ft),w=n.parentNode;if(i){const E=n.previousSibling;if(Qo(E)){if(vr(E))return E;if(lr(E))return E.splitText(E.data.length-1)}w==null||w.insertBefore(p,n)}else{const E=n.nextSibling;if(Qo(E)){if(vr(E))return E;if(sh(E))return E.splitText(1),E}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},Gu=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&tr(i.previousSibling):!1},kf=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&tr(i.nextSibling):!1},oh=(n,i,l)=>{var d;const w=((d=i.ownerDocument)!==null&&d!==void 0?d:document).createElement(n);w.setAttribute("data-mce-caret",l?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(ve().dom);const E=i.parentNode;return l?E==null||E.insertBefore(w,i):i.nextSibling?E==null||E.insertBefore(w,i.nextSibling):E==null||E.appendChild(w),w},sh=n=>Qo(n)&&n.data[0]===Ft,lr=n=>Qo(n)&&n.data[n.data.length-1]===Ft,Um=n=>{var i;const l=n.getElementsByTagName("br"),d=l[l.length-1];Cd(d)&&((i=d.parentNode)===null||i===void 0||i.removeChild(d))},Wm=n=>n&&n.hasAttribute("data-mce-caret")?(Um(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,ea=n=>vi(n.startContainer),eu=ha,zp=As,jm=ui,Os=Sn,Br=Sf(["script","style","textarea"]),Da=Sf(["img","input","textarea","hr","iframe","video","audio","object","embed"]),cc=Sf(["table"]),j1=vr,Sl=n=>j1(n)?!1:Os(n)?!Br(n.parentNode):Da(n)||jm(n)||cc(n)||tu(n),Gi=n=>Qn(n)&&n.getAttribute("unselectable")==="true",tu=n=>!Gi(n)&&zp(n),Ef=(n,i)=>{for(let l=n.parentNode;l&&l!==i;l=l.parentNode){if(tu(l))return!1;if(eu(l))return!0}return!0},F_=n=>tu(n)?!vn(Mr(n.getElementsByTagName("*")),(i,l)=>i||eu(l),!1):!1,Kh=n=>Da(n)||F_(n),Wg=(n,i)=>Sl(n)&&Ef(n,i),Yh=/^[ \t\r\n]*$/,Zm=n=>Yh.test(n),jg=n=>{for(const i of n)if(!J0(i))return!1;return!0},tb=n=>" \f \v".indexOf(n)!==-1,Xh=n=>n===`
|
|
`||n==="\r",Oa=(n,i)=>i<n.length&&i>=0?Xh(n[i]):!1,rh=(n,i=4,l=!0,d=!0)=>{const p=pu(" ",i),w=n.replace(/\t/g,p);return vn(w,(R,B)=>tb(B)||B===Gr?R.pcIsSpace||R.str===""&&l||R.str.length===w.length-1&&d||Oa(w,R.str.length+1)?{pcIsSpace:!1,str:R.str+Gr}:{pcIsSpace:!0,str:R.str+" "}:{pcIsSpace:Xh(B),str:R.str+B},{pcIsSpace:!1,str:""}).str},Ed=(n,i)=>{const l=Ye.fromDom(i),d=Ye.fromDom(n);return m2(d,"pre,code",He(bt,l))},qm=(n,i)=>Sn(n)&&Zm(n.data)&&!Ed(n,i),Gm=n=>Qn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),Jh=(n,i)=>Sl(n)&&!qm(n,i)||Gm(n)||Ku(n),Ku=Pc("data-mce-bookmark"),nb=Pc("data-mce-bogus"),Z1=Vg("data-mce-bogus","all"),H_=(n,i)=>{let l=0;if(Jh(n,n))return!1;{let d=n.firstChild;if(!d)return!0;const p=new bi(d,n);do{if(i){if(Z1(d)){d=p.next(!0);continue}if(nb(d)){d=p.next();continue}}if(ui(d)){l++,d=p.next();continue}if(Jh(d,n))return!1;d=p.next()}while(d);return l<=1}},Ma=(n,i=!0)=>H_(n.dom,i),Zg="data-mce-block",Km=n=>wt(gs(n),i=>!/[A-Z]/.test(i)),nu=n=>Km(n).join(","),Af=(n,i)=>_e(i.querySelector(n))?(i.setAttribute(Zg,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(Zg),!1),Ym=(n,i)=>{const l=nu(n.getTransparentElements()),d=nu(n.getBlockElements());return wt(i.querySelectorAll(l),p=>Af(d,p))},ih=(n,i)=>{var l;const d=i?"lastChild":"firstChild";for(let p=n[d];p;p=p[d])if(Ma(Ye.fromDom(p))){(l=p.parentNode)===null||l===void 0||l.removeChild(p);return}},xu=(n,i)=>{const l=document.createRange(),d=n.parentNode;if(d){l.setStartBefore(n),l.setEndBefore(i);const p=l.extractContents();ih(p,!0),l.setStartAfter(i),l.setEndAfter(n);const w=l.extractContents();ih(w,!1),Ma(Ye.fromDom(p))||d.insertBefore(p,n),Ma(Ye.fromDom(i))||d.insertBefore(i,n),Ma(Ye.fromDom(w))||d.insertBefore(w,n),d.removeChild(n)}},Ad=(n,i,l)=>{const d=n.getBlockElements(),p=Ye.fromDom(i),w=R=>Xr(R)in d,E=R=>bt(R,p);Be(Qd(l),R=>{li(R,w,E).each(B=>{const K=Y0(R,ie=>w(ie)&&!n.isValidChild(Xr(B),Xr(ie)));if(K.length>0){const ie=pi(B);Be(K,ue=>{li(ue,w,E).each(be=>{xu(be.dom,ue.dom)})}),ie.each(ue=>Ym(n,ue.dom))}})})},Xm=(n,i,l)=>{Be([...l,...Jm(n,i)?[i]:[]],d=>Be(hl(Ye.fromDom(d),d.nodeName.toLowerCase()),p=>{Ev(n,p.dom)&&ql(p)}))},ob=(n,i)=>{const l=Ym(n,i);Ad(n,i,l),Xm(n,i,l)},Cv=(n,i)=>{if(kv(n,i)){const l=nu(n.getBlockElements());Af(l,i)}},Sv=(n,i,l)=>{const d=w=>bt(w,Ye.fromDom(i)),p=Gd(Ye.fromDom(l),d);Zr(p,p.length-2).filter(_l).fold(()=>ob(n,i),w=>ob(n,w.dom))},ah=n=>n.hasAttribute(Zg),qg=(n,i)=>un(n.getTransparentElements(),i),kv=(n,i)=>Qn(i)&&qg(n,i.nodeName),Jm=(n,i)=>kv(n,i)&&ah(i),Ev=(n,i)=>kv(n,i)&&!ah(i),nr=(n,i)=>i.type===1&&qg(n,i.name)&&F(i.attr(Zg)),Do=ys().browser,lh=n=>eo(n,_l),q1=n=>Do.isFirefox()&&Xr(n)==="table"?lh(xa(n)).filter(i=>Xr(i)==="caption").bind(i=>lh(nl(i)).map(l=>{const d=l.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return d<=p?-w:0})).getOr(0):0,Gg=(n,i)=>n.children&&St(n.children,i),Tk=(n,i,l)=>{let d=0,p=0;const w=n.ownerDocument;if(l=l||n,i){if(l===n&&i.getBoundingClientRect&&Ri(Ye.fromDom(n),"position")==="static"){const R=i.getBoundingClientRect();return d=R.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=R.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:d,y:p}}let E=i;for(;E&&E!==l&&E.nodeType&&!Gg(E,l);){const R=E;d+=R.offsetLeft||0,p+=R.offsetTop||0,E=R.offsetParent}for(E=i.parentNode;E&&E!==l&&E.nodeType&&!Gg(E,l);)d-=E.scrollLeft||0,p-=E.scrollTop||0,E=E.parentNode;p+=q1(Ye.fromDom(i))}return{x:d,y:p}},Av=(n,i={})=>{let l=0;const d={},p=Ye.fromDom(n),w=To(p),E=Me=>{i.referrerPolicy=Me},R=Me=>{i.contentCssCors=Me},B=Me=>{Qi(Zh(p),Me)},K=Me=>{const Ve=Zh(p);Xe(Ve,"#"+Me).each(br)},ie=Me=>po(d,Me).getOrThunk(()=>({id:"mce-u"+l++,passed:[],failed:[],count:0})),ue=Me=>new Promise((Ve,mt)=>{let vt;const yt=hn._addCacheSuffix(Me),Mt=ie(yt);d[yt]=Mt,Mt.count++;const dn=($t,wn)=>{Be($t,bn),Mt.status=wn,Mt.passed=[],Mt.failed=[],vt&&(vt.onload=null,vt.onerror=null,vt=null)},zn=()=>dn(Mt.passed,2),Pn=()=>dn(Mt.failed,3);if(Ve&&Mt.passed.push(Ve),mt&&Mt.failed.push(mt),Mt.status===1)return;if(Mt.status===2){zn();return}if(Mt.status===3){Pn();return}Mt.status=1;const Lt=Ye.fromTag("link",w.dom);Vu(Lt,{rel:"stylesheet",type:"text/css",id:Mt.id}),i.contentCssCors&&Dr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Dr(Lt,"referrerpolicy",i.referrerPolicy),vt=Lt.dom,vt.onload=zn,vt.onerror=Pn,B(Lt),Dr(Lt,"href",yt)}),be=Me=>Promise.allSettled(Tt(Me,mt=>ue(mt).then(et(mt)))).then(mt=>{const vt=gn(mt,yt=>yt.status==="fulfilled");return vt.fail.length>0?Promise.reject(Tt(vt.fail,yt=>yt.reason)):Tt(vt.pass,yt=>yt.value)}),Le=Me=>{const Ve=hn._addCacheSuffix(Me);po(d,Ve).each(mt=>{--mt.count===0&&(delete d[Ve],K(mt.id))})};return{load:ue,loadAll:be,unload:Le,unloadAll:Me=>{Be(Me,Ve=>{Le(Ve)})},_setReferrerPolicy:E,_setContentCssCors:R}},xv=(()=>{const n=new WeakMap;return{forElement:(l,d)=>{const w=jl(l).dom;return de.from(n.get(w)).getOrThunk(()=>{const E=Av(w,d);return n.set(w,E),E})}}})(),G1=n=>n.nodeName.toLowerCase()==="span",g2=(n,i)=>_e(n)&&(Jh(n,i)||_c(Ye.fromDom(n))),en=(n,i)=>{const l=new bi(n,i).prev(!1),d=new bi(n,i).next(!1),p=ye(l)||g2(l,i),w=ye(d)||g2(d,i);return p&&w},xd=n=>G1(n)&&n.getAttribute("data-mce-type")==="bookmark",$_=(n,i)=>Sn(n)&&n.data.length>0&&en(n,i),sb=n=>Qn(n)?n.childNodes.length>0:!1,Dk=n=>U1(n)||Zu(n),Qm=(n,i,l)=>{var d;const p=l||i;if(Qn(i)&&xd(i))return i;const w=i.childNodes;for(let E=w.length-1;E>=0;E--)Qm(n,w[E],p);if(Qn(i)){const E=i.childNodes;E.length===1&&xd(E[0])&&((d=i.parentNode)===null||d===void 0||d.insertBefore(E[0],i))}return!Dk(i)&&!Jh(i,p)&&!sb(i)&&!$_(i,p)&&n.remove(i),i},p2=hn.makeMap,Qh=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Td=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eg=/[<>&\"\']/g,yi=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Dd={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Od={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},ou={"<":"<",">":">","&":"&",""":'"',"'":"'"},Hs=n=>{const i=Ye.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},Vp=(n,i)=>{const l={};if(n){const d=n.split(",");i=i||10;for(let p=0;p<d.length;p+=2){const w=String.fromCharCode(parseInt(d[p],i));if(!Od[w]){const E="&"+d[p+1]+";";l[w]=E,l[E]=w}}return l}else return},ch=Vp("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Kg=(n,i)=>n.replace(i?Qh:Td,l=>Od[l]||l),Ok=n=>(""+n).replace(eg,i=>Od[i]||i),rb=(n,i)=>n.replace(i?Qh:Td,l=>l.length>1?"&#"+((l.charCodeAt(0)-55296)*1024+(l.charCodeAt(1)-56320)+65536)+";":Od[l]||"&#"+l.charCodeAt(0)+";"),Tv=(n,i,l)=>{const d=l||ch;return n.replace(i?Qh:Td,p=>Od[p]||d[p]||p)},Yg={encodeRaw:Kg,encodeAllRaw:Ok,encodeNumeric:rb,encodeNamed:Tv,getEncodeFunc:(n,i)=>{const l=Vp(i)||ch,d=(E,R)=>E.replace(R?Qh:Td,B=>Od[B]!==void 0?Od[B]:l[B]!==void 0?l[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(E,R)=>Tv(E,R,l),w=p2(n.replace(/\+/g,","));return w.named&&w.numeric?d:w.named?i?p:Tv:w.numeric?rb:Kg},decode:n=>n.replace(yi,(i,l)=>l?(l.charAt(0).toLowerCase()==="x"?l=parseInt(l.substr(1),16):l=parseInt(l,10),l>65535?(l-=65536,String.fromCharCode(55296+(l>>10),56320+(l&1023))):Dd[l]||String.fromCharCode(l)):ou[i]||ch[i]||Hs(i))},El=(n,i)=>(n=hn.trim(n),n?n.split(i||" "):[]),b2=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),ro=n=>{const i=/^(~)?(.+)$/;return Rs(El(n,","),l=>{const d=i.exec(l);if(d){const p=d[1]==="~",w=p?"span":"div",E=d[2];return[{inline:p,cloneName:w,name:E}]}else return[]})},v2=n=>{let i,l,d,p;if(i="id accesskey class dir lang style tabindex title role",l="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",d="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",n!=="html4"){const w="a ins del canvas map";i+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",l+=" article aside details dialog figure main header footer hgroup section nav "+w,d+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",d=[d,"acronym applet basefont big font strike tt"].join(" "),l=[l,"center dir isindex noframes"].join(" "),p=[l,d].join(" ")),p=p||[l,d].join(" "),{globalAttributes:i,blockContent:l,phrasingContent:d,flowContent:p}},Mk=n=>{const{globalAttributes:i,phrasingContent:l,flowContent:d}=v2(n),p={},w=(R,B="",K="")=>{const ie=El(K),ue=El(R);let be=ue.length;for(;be--;){const Le=El([i,B].join(" "));p[ue[be]]={attributes:ar(Le,et({})),attributesOrder:Le,children:ar(ie,et({}))}}},E=(R,B)=>{const K=El(R),ie=El(B);let ue=K.length;for(;ue--;){const be=p[K[ue]];for(let Le=0,je=ie.length;Le<je;Le++)be.attributes[ie[Le]]={},be.attributesOrder.push(ie[Le])}};return n!=="html5-strict"&&(Be(El("acronym applet basefont big font strike tt"),K=>{w(K,"",l)}),Be(El("center dir isindex noframes"),K=>{w(K,"",d)})),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),w("dd div","",d),w("address dt caption","",n==="html4"?l:d),w("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",l),w("blockquote","cite",d),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",d),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?l:d),w("q","cite",l),w("ins del","cite datetime",d),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",d),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[d,"param"].join(" ")),w("param","name value"),w("map","name",[d,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",d),w("th","colspan rowspan headers scope abbr",d),w("form","accept-charset action autocomplete enctype method name novalidate target",d),w("fieldset","disabled form name",[d,"legend"].join(" ")),w("label","form for",l),w("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?d:l),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[d,"li"].join(" ")),w("noscript","",d),n!=="html4"&&(w("wbr"),w("ruby","",[l,"rt rp"].join(" ")),w("figcaption","",d),w("mark rt rp summary bdi","",l),w("canvas","width height",d),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[d,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[d,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[l,"option"].join(" ")),w("article section nav aside main header footer","",d),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[d,"figcaption"].join(" ")),w("time","datetime",l),w("dialog","open",d),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",l),w("progress","value max",l),w("meter","value min max low high optimum",l),w("details","open",[d,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(E("script","language xml:space"),E("style","xml:space"),E("object","declare classid code codebase codetype archive standby align border hspace vspace"),E("embed","align name hspace vspace"),E("param","valuetype type"),E("a","charset name rev shape coords"),E("br","clear"),E("applet","codebase archive code object alt name width height align hspace vspace"),E("img","name longdesc align border hspace vspace"),E("iframe","longdesc frameborder marginwidth marginheight scrolling align"),E("font basefont","size color face"),E("input","usemap align"),E("select"),E("textarea"),E("h1 h2 h3 h4 h5 h6 div p legend caption","align"),E("ul","type compact"),E("li","type"),E("ol dl menu dir","compact"),E("pre","width xml:space"),E("hr","align noshade size width"),E("isindex","prompt"),E("table","summary width frame rules cellspacing cellpadding align bgcolor"),E("col","width align char charoff valign"),E("colgroup","width align char charoff valign"),E("thead","align char charoff valign"),E("tr","align char charoff valign bgcolor"),E("th","axis align char charoff valign nowrap bgcolor width height"),E("form","accept"),E("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),E("tfoot","align char charoff valign"),E("tbody","align char charoff valign"),E("area","nohref"),E("body","background bgcolor text link vlink alink")),n!=="html4"&&(E("input button select textarea","autofocus"),E("input textarea","placeholder"),E("a","download"),E("link script img","crossorigin"),E("img","loading"),E("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Be([p.video,p.audio],R=>{delete R.children.audio,delete R.children.video}),Be(El("a form meter progress dfn"),R=>{p[R]&&delete p[R].children[R]}),delete p.caption.children.table,delete p.script,p},y2=n=>n==="-"?"remove":"add",em=n=>{const i=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return Rs(El(n,","),l=>{const d=i.exec(l);if(d){const p=d[1],w=p?y2(p):"replace",E=d[2],R=El(d[3],"|");return[{operation:w,name:E,validChildren:R}]}else return[]})},Yu=(n,i)=>{const l=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,d=/[*?+]/,{attributes:p,attributesOrder:w}=i;return Be(El(n,"|"),E=>{const R=l.exec(E);if(R){const B={},K=R[1],ie=R[2].replace(/[\\:]:/g,":"),ue=R[3],be=R[4];if(K==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ie),B.required=!0),K==="-"){delete p[ie],w.splice(hn.inArray(w,ie),1);return}if(ue&&(ue==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ie,value:be}),B.defaultValue=be):ue==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ie,value:be}),B.forcedValue=be):ue==="<"&&(B.validValues=hn.makeMap(be,"?"))),d.test(ie)){const Le=B;i.attributePatterns=i.attributePatterns||[],Le.pattern=b2(ie),i.attributePatterns.push(Le)}else p[ie]||w.push(ie),p[ie]=B}})},uh=(n,i)=>{ln(n.attributes,(l,d)=>{i.attributes[d]=l}),i.attributesOrder.push(...n.attributesOrder)},Xg=(n,i)=>{const l=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return Rs(El(i,","),d=>{const p=l.exec(d);if(p){const w=p[1],E=p[2],R=p[3],B=p[4],K=p[5],ie={attributes:{},attributesOrder:[]};if(n.each(ue=>uh(ue,ie)),w==="#"?ie.paddEmpty=!0:w==="-"&&(ie.removeEmpty=!0),B==="!"&&(ie.removeEmptyAttrs=!0),K&&Yu(K,ie),R&&(ie.outputName=E),E==="@")if(n.isNone())n=de.some(ie);else return[];return[R?{name:E,element:ie,aliasName:R}:{name:E,element:ie}]}else return[]})},fh={},ib=hn.makeMap,xf=hn.each,Jg=hn.extend,w2=hn.explode,Up=(n,i={})=>{const l=ib(n," ",ib(n.toUpperCase()," "));return Jg(l,i)},Gf=n=>Up("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),_2=(n,i)=>{if(n){const l={};return F(n)&&(n={"*":n}),xf(n,(d,p)=>{l[p]=l[p.toUpperCase()]=i==="map"?ib(d,/[, ]/):w2(d,/[, ]/)}),l}else return},dh=(n={})=>{var i;const l={},d={};let p=[];const w={},E={},R=(co,Ws,ii)=>{const Ya=n[co];if(Ya)return ib(Ya,/[, ]/,ib(Ya.toUpperCase(),/[, ]/));{let Si=fh[co];return Si||(Si=Up(Ws,ii),fh[co]=Si),Si}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",K=Mk(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ie=_2(n.valid_styles),ue=_2(n.invalid_styles,"map"),be=_2(n.valid_classes,"map"),Le=R("whitespace_elements","pre script noscript style textarea video audio iframe object code"),je=R("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),Me=R("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),Ve=R("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),mt="td th iframe video audio object script code",vt=R("non_empty_elements",mt+" pre",Me),yt=R("move_caret_before_on_enter_elements",mt+" table",Me),Mt=R("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),dn=R("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",Mt),zn=R("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),Pn=R("transparent_elements","a ins del canvas map");xf("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),co=>{E[co]=new RegExp("</"+co+"[^>]*>","gi")});const Lt=co=>{const Ws=de.from(l["@"]),ii=/[*?+]/;Be(Xg(Ws,co!=null?co:""),({name:Ya,element:Si,aliasName:Ec})=>{if(Ec&&(l[Ec]=Si),ii.test(Ya)){const Mh=Si;Mh.pattern=b2(Ya),p.push(Mh)}else l[Ya]=Si})},$t=co=>{p=[],Be(gs(l),Ws=>{delete l[Ws]}),Lt(co)},wn=co=>{delete fh.text_block_elements,delete fh.block_elements,Be(ro(co!=null?co:""),({inline:Ws,name:ii,cloneName:Ya})=>{if(d[ii]=d[Ya],w[ii]=Ya,vt[ii.toUpperCase()]={},vt[ii]={},Ws||(dn[ii.toUpperCase()]={},dn[ii]={}),!l[ii]){let Si=l[Ya];Si=Jg({},Si),delete Si.removeEmptyAttrs,delete Si.removeEmpty,l[ii]=Si}ln(d,(Si,Ec)=>{Si[Ya]&&(d[Ec]=Si=Jg({},d[Ec]),Si[ii]=Si[Ya])})})},go=co=>{Be(em(co!=null?co:""),({operation:Ws,name:ii,validChildren:Ya})=>{const Si=Ws==="replace"?{"#comment":{}}:d[ii];Be(Ya,Ec=>{Ws==="remove"?delete Si[Ec]:Si[Ec]={}}),d[ii]=Si})},Oo=co=>{const Ws=l[co];if(Ws)return Ws;let ii=p.length;for(;ii--;){const Ya=p[ii];if(Ya.pattern.test(co))return Ya}};n.valid_elements?($t(n.valid_elements),xf(K,(co,Ws)=>{d[Ws]=co.children})):(xf(K,(co,Ws)=>{l[Ws]={attributes:co.attributes,attributesOrder:co.attributesOrder},d[Ws]=co.children}),xf(El("strong/b em/i"),co=>{const Ws=El(co,"/");l[Ws[1]].outputName=Ws[0]}),xf(zn,(co,Ws)=>{l[Ws]&&(n.padd_empty_block_inline_children&&(l[Ws].paddInEmptyBlock=!0),l[Ws].removeEmpty=!0)}),xf(El("ol ul blockquote a table tbody"),co=>{l[co]&&(l[co].removeEmpty=!0)}),xf(El("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),co=>{l[co]&&(l[co].paddEmpty=!0)}),xf(El("span"),co=>{l[co].removeEmptyAttrs=!0})),wn(n.custom_elements),go(n.valid_children),Lt(n.extended_valid_elements),go("+ol[ul|ol],+ul[ul|ol]"),xf({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(co,Ws)=>{l[Ws]&&(l[Ws].parentsRequired=El(co))}),n.invalid_elements&&xf(w2(n.invalid_elements),co=>{l[co]&&delete l[co]}),Oo("span")||Lt("span[!data-mce-type|*]");const Cs=et(ie),Us=et(ue),Pr=et(be),di=et(Ve),al=et(dn),Rl=et(Mt),hc=et(zn),Mn=et(Object.seal(Me)),to=et(je),wr=et(vt),Is=et(yt),yo=et(Le),Rn=et(Pn),Dn=et(Object.seal(E)),qo=(co,Ws)=>{const ii=d[co.toLowerCase()];return!!(ii&&ii[Ws.toLowerCase()])},Ys=(co,Ws)=>{const ii=Oo(co);if(ii)if(Ws){if(ii.attributes[Ws])return!0;const Ya=ii.attributePatterns;if(Ya){let Si=Ya.length;for(;Si--;)if(Ya[Si].pattern.test(Ws))return!0}}else return!0;return!1},Kr=et(w);return{type:B,children:d,elements:l,getValidStyles:Cs,getValidClasses:Pr,getBlockElements:al,getInvalidStyles:Us,getVoidElements:Mn,getTextBlockElements:Rl,getTextInlineElements:hc,getBoolAttrs:di,getElementRule:Oo,getSelfClosingElements:to,getNonEmptyElements:wr,getMoveCaretBeforeOnEnterElements:Is,getWhitespaceElements:yo,getTransparentElements:Rn,getSpecialElements:Dn,isValidChild:qo,isValid:Ys,getCustomElements:Kr,addValidElements:Lt,setValidElements:$t,addCustomElements:wn,addValidChildren:go}},Dv=(n={},i)=>{const l=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,d=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let E,R;const B=Qt;i&&(E=i.getValidStyles(),R=i.getInvalidStyles());const K=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let ue=0;ue<K.length;ue++)w[K[ue]]=B+ue,w[B+ue]=K[ue];const ie={parse:ue=>{const be={};let Le=!1;const je=n.url_converter,Me=n.url_converter_scope||ie,Ve=(Lt,$t,wn)=>{const go=be[Lt+"-top"+$t];if(!go)return;const Oo=be[Lt+"-right"+$t];if(!Oo)return;const Cs=be[Lt+"-bottom"+$t];if(!Cs)return;const Us=be[Lt+"-left"+$t];if(!Us)return;const Pr=[go,Oo,Cs,Us];let di=Pr.length-1;for(;di--&&Pr[di]===Pr[di+1];);di>-1&&wn||(be[Lt+$t]=di===-1?Pr[0]:Pr.join(" "),delete be[Lt+"-top"+$t],delete be[Lt+"-right"+$t],delete be[Lt+"-bottom"+$t],delete be[Lt+"-left"+$t])},mt=Lt=>{const $t=be[Lt];if(!$t)return;const wn=$t.indexOf(",")>-1?[$t]:$t.split(" ");let go=wn.length;for(;go--;)if(wn[go]!==wn[0])return!1;return be[Lt]=wn[0],!0},vt=(Lt,$t,wn,go)=>{!mt($t)||!mt(wn)||!mt(go)||(be[Lt]=be[$t]+" "+be[wn]+" "+be[go],delete be[$t],delete be[wn],delete be[go])},yt=Lt=>(Le=!0,w[Lt]),Mt=(Lt,$t)=>(Le&&(Lt=Lt.replace(/\uFEFF[0-9]/g,wn=>w[wn])),$t||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),dn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),zn=Lt=>Lt.replace(/\\[0-9a-f]+/gi,dn),Pn=(Lt,$t,wn,go,Oo,Cs)=>{if(Oo=Oo||Cs,Oo)return Oo=Mt(Oo),"'"+Oo.replace(/\'/g,"\\'")+"'";if($t=Mt($t||wn||go||""),!n.allow_script_urls){const Us=$t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Us)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Us))return""}return je&&($t=je.call(Me,$t,"style")),"url('"+$t.replace(/\'/g,"\\'")+"')"};if(ue){ue=ue.replace(/[\u0000-\u001F]/g,""),ue=ue.replace(/\\[\"\';:\uFEFF]/g,yt).replace(/\"[^\"]+\"|\'[^\']+\'/g,$t=>$t.replace(/[;:]/g,yt));let Lt;for(;Lt=d.exec(ue);){d.lastIndex=Lt.index+Lt[0].length;let $t=Lt[1].replace(p,"").toLowerCase(),wn=Lt[2].replace(p,"");if($t&&wn){if($t=zn($t),wn=zn(wn),$t.indexOf(B)!==-1||$t.indexOf('"')!==-1||!n.allow_script_urls&&($t==="behavior"||/expression\s*\(|\/\*|\*\//.test(wn)))continue;$t==="font-weight"&&wn==="700"?wn="bold":($t==="color"||$t==="background-color")&&(wn=wn.toLowerCase()),wn=wn.replace(l,Pn),be[$t]=Le?Mt(wn,!0):wn}}Ve("border","",!0),Ve("border","-width"),Ve("border","-color"),Ve("border","-style"),Ve("padding",""),Ve("margin",""),vt("border","border-width","border-style","border-color"),be.border==="medium none"&&delete be.border,be["border-image"]==="none"&&delete be["border-image"]}return be},serialize:(ue,be)=>{let Le="";const je=(Ve,mt)=>{const vt=mt[Ve];if(vt)for(let yt=0,Mt=vt.length;yt<Mt;yt++){const dn=vt[yt],zn=ue[dn];zn&&(Le+=(Le.length>0?" ":"")+dn+": "+zn+";")}},Me=(Ve,mt)=>{if(!R||!mt)return!0;let vt=R["*"];return vt&&vt[Ve]?!1:(vt=R[mt],!(vt&&vt[Ve]))};return be&&E?(je("*",E),je(be,E)):ln(ue,(Ve,mt)=>{Ve&&Me(mt,be)&&(Le+=(Le.length>0?" ":"")+mt+": "+Ve+";")}),Le}};return ie},z_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},C2=n=>n instanceof Event||ge(n.initEvent),Qg=n=>n.isDefaultPrevented===gt||n.isDefaultPrevented===qe,Tf=n=>Te(n.preventDefault)||C2(n),su=(n,i)=>{const l=i!=null?i:{};for(const d in n)un(z_,d)||(l[d]=n[d]);return _e(n.composedPath)&&(l.composedPath=()=>n.composedPath()),l},ep=(n,i,l,d)=>{var p;const w=su(i,d);return w.type=n,Te(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:l),Tf(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=gt,ge(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=gt,ge(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=gt,w.stopPropagation()},Qg(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?gt:qe,w.isPropagationStopped=w.cancelBubble===!0?gt:qe,w.isImmediatePropagationStopped=qe)),w},S2="mce-data-",V_=/^(?:mouse|contextmenu)|click/,ab=(n,i,l,d)=>{n.addEventListener(i,l,d||!1)},Lc=(n,i,l,d)=>{n.removeEventListener(i,l,d||!1)},lb=n=>_e(n)&&V_.test(n.type),Xu=(n,i)=>{const l=ep(n.type,n,document,i);if(lb(n)&&ye(n.pageX)&&!ye(n.clientX)){const d=l.target.ownerDocument||document,p=d.documentElement,w=d.body,E=l;E.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),E.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return l},tp=(n,i,l)=>{const d=n.document,p={type:"ready"};if(l.domLoaded){i(p);return}const w=()=>d.readyState==="complete"||d.readyState==="interactive"&&d.body,E=()=>{Lc(n,"DOMContentLoaded",E),Lc(n,"load",E),l.domLoaded||(l.domLoaded=!0,i(p)),n=null};w()?E():ab(n,"DOMContentLoaded",E),l.domLoaded||ab(n,"load",E)};class tm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=S2+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,l,d,p){const w=this;let E;const R=window,B=be=>{w.executeHandlers(Xu(be||R.event),K)};if(!i||Sn(i)||th(i))return d;let K;i[w.expando]?K=i[w.expando]:(K=w.count++,i[w.expando]=K,w.events[K]={}),p=p||i;const ie=l.split(" ");let ue=ie.length;for(;ue--;){let be=ie[ue],Le=B,je=!1,Me=!1;if(be==="DOMContentLoaded"&&(be="ready"),w.domLoaded&&be==="ready"&&i.readyState==="complete"){d.call(p,Xu({type:be}));continue}!w.hasFocusIn&&(be==="focusin"||be==="focusout")&&(je=!0,Me=be==="focusin"?"focus":"blur",Le=Ve=>{const mt=Xu(Ve||R.event);mt.type=mt.type==="focus"?"focusin":"focusout",w.executeHandlers(mt,K)}),E=w.events[K][be],E?be==="ready"&&w.domLoaded?d(Xu({type:be})):E.push({func:d,scope:p}):(w.events[K][be]=E=[{func:d,scope:p}],E.fakeName=Me,E.capture=je,E.nativeHandler=Le,be==="ready"?tp(i,Le,w):ab(i,Me||be,Le,je))}return i=E=null,d}unbind(i,l,d){if(!i||Sn(i)||th(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(l){const E=l.split(" ");let R=E.length;for(;R--;){const B=E[R],K=w[B];if(K){if(d){let ie=K.length;for(;ie--;)if(K[ie].func===d){const ue=K.nativeHandler,be=K.fakeName,Le=K.capture,je=K.slice(0,ie).concat(K.slice(ie+1));je.nativeHandler=ue,je.fakeName=be,je.capture=Le,w[B]=je}}(!d||K.length===0)&&(delete w[B],Lc(i,K.fakeName||B,K.nativeHandler,K.capture))}}}else ln(w,(E,R)=>{Lc(i,E.fakeName||R,E.nativeHandler,E.capture)}),w={};for(const E in w)if(un(w,E))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,l,d){return this.dispatch(i,l,d)}dispatch(i,l,d){if(!i||Sn(i)||th(i))return this;const p=Xu({type:l,target:i},d);do{const w=i[this.expando];w&&this.executeHandlers(p,w),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||Sn(i)||th(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const l=i.getElementsByTagName("*");let d=l.length;for(;d--;)i=l[d],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,l){const d=this.events[l],p=d&&d[i.type];if(p)for(let w=0,E=p.length;w<E;w++){const R=p[w];if(R&&R.func.call(R.scope,i)===!1&&i.preventDefault(),i.isImmediatePropagationStopped())return}}}tm.Event=new tm;const Ov=hn.each,U_=hn.grep,Wp="data-mce-style",k2=hn.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),np=(n,i,l)=>{Te(l)||l===""?zi(n,i):Dr(n,i,l)},cb=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),K1=(n,i)=>{let l=0;if(n)for(let d=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&Sn(p)&&(w===d||!p.data.length)||(l++,d=w)}return l},E2=(n,i)=>{const l=Pl(i,"style"),d=n.serialize(n.parse(l),Xr(i));np(i,Wp,d)},A2=(n,i)=>nt(n)?un(k2,i)?n+"":n+"px":n,W_=(n,i,l)=>{const d=cb(i);Te(l)||l===""?Fm(n,d):Zl(n,d,A2(l,d))},Rk=(n,i,l)=>{const d=i.keep_values,p={set:(E,R,B)=>{const K=Ye.fromDom(E);ge(i.url_converter)&&_e(R)&&(R=i.url_converter.call(i.url_converter_scope||l(),String(R),B,E));const ie="data-mce-"+B;np(K,ie,R),np(K,B,R)},get:(E,R)=>{const B=Ye.fromDom(E);return Pl(B,"data-mce-"+R)||Pl(B,R)}},w={style:{set:(E,R)=>{const B=Ye.fromDom(E);d&&np(B,Wp,R),zi(B,"style"),F(R)&&ra(B,n.parse(R))},get:E=>{const R=Ye.fromDom(E),B=Pl(R,Wp)||Pl(R,"style");return n.serialize(n.parse(B),Xr(R))}}};return d&&(w.href=w.src=p),w},Lr=(n,i={})=>{const l={},d=window,p={};let w=0;const E=!0,R=!0,B=xv.forElement(Ye.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),K=[],ie=i.schema?i.schema:dh({}),ue=Dv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),be=i.ownEvents?new tm:tm.Event,Le=ie.getBlockElements(),je=Rt=>F(Rt)?un(Le,Rt):Qn(Rt)&&(un(Le,Rt.nodeName)||Jm(ie,Rt)),Me=Rt=>Rt&&n&&F(Rt)?n.getElementById(Rt):Rt,Ve=Rt=>{const Nt=Me(Rt);return _e(Nt)?Ye.fromDom(Nt):null},mt=(Rt,Nt,Nn="")=>{let xn;const Bo=Ve(Rt);if(_e(Bo)&&_l(Bo)){const dr=w_[Nt];dr&&dr.get?xn=dr.get(Bo.dom,Nt):xn=Pl(Bo,Nt)}return _e(xn)?xn:Nn},vt=Rt=>{const Nt=Me(Rt);return Te(Nt)?[]:Nt.attributes},yt=(Rt,Nt,Nn)=>{to(Rt,xn=>{if(Qn(xn)){const Bo=Ye.fromDom(xn),dr=Nn===""?null:Nn,la=Pl(Bo,Nt),Ac=w_[Nt];Ac&&Ac.set?Ac.set(Bo.dom,dr,Nt):np(Bo,Nt,dr),la!==dr&&i.onSetAttrib&&i.onSetAttrib({attrElm:Bo.dom,attrName:Nt,attrValue:dr})}})},Mt=(Rt,Nt)=>Rt.cloneNode(Nt),dn=()=>i.root_element||n.body,zn=Rt=>{const Nt=jf(Rt);return{x:Nt.x,y:Nt.y,w:Nt.width,h:Nt.height}},Pn=(Rt,Nt)=>Tk(n.body,Me(Rt),Nt),Lt=(Rt,Nt,Nn)=>{to(Rt,xn=>{const Bo=Ye.fromDom(xn);W_(Bo,Nt,Nn),i.update_styles&&E2(ue,Bo)})},$t=(Rt,Nt)=>{to(Rt,Nn=>{const xn=Ye.fromDom(Nn);ln(Nt,(Bo,dr)=>{W_(xn,dr,Bo)}),i.update_styles&&E2(ue,xn)})},wn=(Rt,Nt,Nn)=>{const xn=Me(Rt);if(!(Te(xn)||!Qn(xn)))return Nn?Ri(Ye.fromDom(xn),cb(Nt)):(Nt=Nt.replace(/-(\D)/g,(Bo,dr)=>dr.toUpperCase()),Nt==="float"&&(Nt="cssFloat"),xn.style?xn.style[Nt]:void 0)},go=Rt=>{const Nt=Me(Rt);if(!Nt)return{w:0,h:0};let Nn=wn(Nt,"width"),xn=wn(Nt,"height");return(!Nn||Nn.indexOf("px")===-1)&&(Nn="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt(Nn,10)||Nt.offsetWidth||Nt.clientWidth,h:parseInt(xn,10)||Nt.offsetHeight||Nt.clientHeight}},Oo=Rt=>{const Nt=Me(Rt),Nn=Pn(Nt),xn=go(Nt);return{x:Nn.x,y:Nn.y,w:xn.w,h:xn.h}},Cs=(Rt,Nt)=>{if(!Rt)return!1;const Nn=se(Rt)?Rt:[Rt];return Xt(Nn,xn=>wu(Ye.fromDom(xn),Nt))},Us=(Rt,Nt,Nn,xn)=>{const Bo=[];let dr=Me(Rt);xn=xn===void 0;const la=Nn||(dn().nodeName!=="BODY"?dn().parentNode:null);if(F(Nt))if(Nt==="*")Nt=Qn;else{const Ac=Nt;Nt=du=>Cs(du,Ac)}for(;dr&&!(dr===la||Te(dr.nodeType)||Zu(dr)||U1(dr));){if(!Nt||Nt(dr))if(xn)Bo.push(dr);else return[dr];dr=dr.parentNode}return xn?Bo:null},Pr=(Rt,Nt,Nn)=>{const xn=Us(Rt,Nt,Nn,!1);return xn&&xn.length>0?xn[0]:null},di=(Rt,Nt,Nn)=>{let xn=Nt;if(Rt){F(Nt)&&(xn=Bo=>Cs(Bo,Nt));for(let Bo=Rt[Nn];Bo;Bo=Bo[Nn])if(ge(xn)&&xn(Bo))return Bo}return null},al=(Rt,Nt)=>di(Rt,Nt,"nextSibling"),Rl=(Rt,Nt)=>di(Rt,Nt,"previousSibling"),hc=Rt=>ge(Rt.querySelectorAll),Mn=(Rt,Nt)=>{var Nn,xn;const Bo=(xn=(Nn=Me(Nt))!==null&&Nn!==void 0?Nn:i.root_element)!==null&&xn!==void 0?xn:n;return hc(Bo)?Mr(Bo.querySelectorAll(Rt)):[]},to=function(Rt,Nt,Nn){const xn=Nn!=null?Nn:this;if(se(Rt)){const Bo=[];return Ov(Rt,(dr,la)=>{const Ac=Me(dr);Ac&&Bo.push(Nt.call(xn,Ac,la))}),Bo}else{const Bo=Me(Rt);return Bo?Nt.call(xn,Bo):!1}},wr=(Rt,Nt)=>{to(Rt,Nn=>{ln(Nt,(xn,Bo)=>{yt(Nn,Bo,xn)})})},Is=(Rt,Nt)=>{to(Rt,Nn=>{const xn=Ye.fromDom(Nn);_f(xn,Nt)})},yo=(Rt,Nt,Nn,xn,Bo)=>to(Rt,dr=>{const la=F(Nt)?n.createElement(Nt):Nt;return _e(Nn)&&wr(la,Nn),xn&&(!F(xn)&&xn.nodeType?la.appendChild(xn):F(xn)&&Is(la,xn)),Bo?la:dr.appendChild(la)}),Rn=(Rt,Nt,Nn)=>yo(n.createElement(Rt),Rt,Nt,Nn,!0),Dn=Yg.decode,qo=Yg.encodeAllRaw,Ys=(Rt,Nt,Nn="")=>{let xn="<"+Rt;for(const Bo in Nt)ns(Nt,Bo)&&(xn+=" "+Bo+'="'+qo(Nt[Bo])+'"');return Qa(Nn)&&un(ie.getVoidElements(),Rt)?xn+" />":xn+">"+Nn+"</"+Rt+">"},Kr=Rt=>{const Nt=n.createElement("div"),Nn=n.createDocumentFragment();Nn.appendChild(Nt),Rt&&(Nt.innerHTML=Rt);let xn;for(;xn=Nt.firstChild;)Nn.appendChild(xn);return Nn.removeChild(Nt),Nn},co=(Rt,Nt)=>to(Rt,Nn=>{const xn=Ye.fromDom(Nn);return Nt&&Be(xa(xn),Bo=>{el(Bo)&&Bo.dom.length===0?br(Bo):wa(xn,Bo)}),br(xn),xn.dom}),Ws=Rt=>to(Rt,Nt=>{const Nn=Nt.attributes;for(let xn=Nn.length-1;xn>=0;xn--)Nt.removeAttributeNode(Nn.item(xn))}),ii=Rt=>ue.parse(Rt),Ya=(Rt,Nt)=>ue.serialize(Rt,Nt),Si=Rt=>{if(_1!==Lr.DOM&&n===document){if(l[Rt])return;l[Rt]=!0}let Nt=n.getElementById("mceDefaultStyles");if(!Nt){Nt=n.createElement("style"),Nt.id="mceDefaultStyles",Nt.type="text/css";const Nn=n.head;Nn.firstChild?Nn.insertBefore(Nt,Nn.firstChild):Nn.appendChild(Nt)}Nt.styleSheet?Nt.styleSheet.cssText+=Rt:Nt.appendChild(n.createTextNode(Rt))},Ec=Rt=>{Rt||(Rt=""),Be(Rt.split(","),Nt=>{p[Nt]=!0,B.load(Nt).catch(ft)})},Mh=(Rt,Nt,Nn)=>{to(Rt,xn=>{if(Qn(xn)){const Bo=Ye.fromDom(xn),dr=Nt.split(" ");Be(dr,la=>{_e(Nn)?(Nn?Uu:Nc)(Bo,la):Uh(Bo,la)})}})},zd=(Rt,Nt)=>{Mh(Rt,Nt,!0)},Cm=(Rt,Nt)=>{Mh(Rt,Nt,!1)},Hy=(Rt,Nt)=>{const Nn=Ve(Rt),xn=Nt.split(" ");return _e(Nn)&&Js(xn,Bo=>wf(Nn,Bo))},v_=Rt=>{to(Rt,Nt=>Fm(Ye.fromDom(Nt),"display"))},$y=Rt=>{to(Rt,Nt=>Zl(Ye.fromDom(Nt),"display","none"))},zy=Rt=>{const Nt=Ve(Rt);return _e(Nt)&&qr(Ta(Nt,"display"),"none")},bD=Rt=>(Rt||"mce_")+w++,vD=Rt=>{const Nt=Ve(Rt);return _e(Nt)?Qn(Nt.dom)?Nt.dom.outerHTML:$g(Nt):""},yD=(Rt,Nt)=>{to(Rt,Nn=>{Qn(Nn)&&(Nn.outerHTML=Nt)})},Cx=(Rt,Nt)=>{const Nn=Me(Nt);return to(Rt,xn=>{const Bo=Nn==null?void 0:Nn.parentNode,dr=Nn==null?void 0:Nn.nextSibling;return Bo&&(dr?Bo.insertBefore(xn,dr):Bo.appendChild(xn)),xn})},Sx=(Rt,Nt,Nn)=>to(Nt,xn=>{var Bo;const dr=se(Nt)?Rt.cloneNode(!0):Rt;return Nn&&Ov(U_(xn.childNodes),la=>{dr.appendChild(la)}),(Bo=xn.parentNode)===null||Bo===void 0||Bo.replaceChild(dr,xn),xn}),kx=(Rt,Nt)=>{if(Rt.nodeName!==Nt.toUpperCase()){const Nn=Rn(Nt);return Ov(vt(Rt),xn=>{yt(Nn,xn.nodeName,mt(Rt,xn.nodeName))}),Sx(Nn,Rt,!0),Nn}else return Rt},GS=(Rt,Nt)=>{let Nn=Rt;for(;Nn;){let xn=Nt;for(;xn&&Nn!==xn;)xn=xn.parentNode;if(Nn===xn)break;Nn=Nn.parentNode}return!Nn&&Rt.ownerDocument?Rt.ownerDocument.documentElement:Nn},w1=Rt=>{if(Qn(Rt)){const Nt=Rt.nodeName.toLowerCase()==="a"&&!mt(Rt,"href")&&mt(Rt,"id");if(mt(Rt,"name")||mt(Rt,"data-mce-bookmark")||Nt)return!0}return!1},KS=(Rt,Nt,Nn)=>{let xn=0;if(w1(Rt))return!1;const Bo=Rt.firstChild;if(Bo){const dr=new bi(Bo,Rt),la=ie?ie.getWhitespaceElements():{},Ac=Nt||(ie?ie.getNonEmptyElements():null);let du=Bo;do{if(Qn(du)){const Ox=du.getAttribute("data-mce-bogus");if(Ox){du=dr.next(Ox==="all");continue}const Mx=du.nodeName.toLowerCase();if(Ac&&Ac[Mx]){if(Mx==="br"){xn++,du=dr.next();continue}return!1}if(w1(du))return!1}if(th(du)||Sn(du)&&!Zm(du.data)&&(!(Nn!=null&&Nn.includeZwsp)||!jg(du.data))||Sn(du)&&du.parentNode&&la[du.parentNode.nodeName]&&Zm(du.data))return!1;du=dr.next()}while(du)}return xn<=1},y_=()=>n.createRange(),cv=(Rt,Nt,Nn)=>{let xn=y_(),Bo,dr;if(Rt&&Nt&&Rt.parentNode&&Nt.parentNode){const la=Rt.parentNode;return xn.setStart(la,K1(Rt)),xn.setEnd(Nt.parentNode,K1(Nt)),Bo=xn.extractContents(),xn=y_(),xn.setStart(Nt.parentNode,K1(Nt)+1),xn.setEnd(la,K1(Rt)+1),dr=xn.extractContents(),la.insertBefore(Qm(_1,Bo),Rt),Nn?la.insertBefore(Nn,Rt):la.insertBefore(Nt,Rt),la.insertBefore(Qm(_1,dr),Rt),co(Rt),Nn||Nt}else return},Ex=(Rt,Nt,Nn,xn)=>{if(se(Rt)){let Bo=Rt.length;const dr=[];for(;Bo--;)dr[Bo]=Ex(Rt[Bo],Nt,Nn,xn);return dr}else return i.collect&&(Rt===n||Rt===d)&&K.push([Rt,Nt,Nn,xn]),be.bind(Rt,Nt,Nn,xn||_1)},Ax=(Rt,Nt,Nn)=>{if(se(Rt)){let xn=Rt.length;const Bo=[];for(;xn--;)Bo[xn]=Ax(Rt[xn],Nt,Nn);return Bo}else{if(K.length>0&&(Rt===n||Rt===d)){let xn=K.length;for(;xn--;){const[Bo,dr,la]=K[xn];Rt===Bo&&(!Nt||Nt===dr)&&(!Nn||Nn===la)&&be.unbind(Bo,dr,la)}}return be.unbind(Rt,Nt,Nn)}},x0=(Rt,Nt,Nn)=>be.dispatch(Rt,Nt,Nn),uv=(Rt,Nt,Nn)=>be.dispatch(Rt,Nt,Nn),xx=Rt=>{if(Rt&&Qn(Rt)){const Nt=Rt.getAttribute("data-mce-contenteditable");return Nt&&Nt!=="inherit"?Nt:Rt.contentEditable!=="inherit"?Rt.contentEditable:null}else return null},_1={doc:n,settings:i,win:d,files:p,stdMode:E,boxModel:R,styleSheetLoader:B,boundEvents:K,styles:ue,schema:ie,events:be,isBlock:je,root:null,clone:Mt,getRoot:dn,getViewPort:zn,getRect:Oo,getSize:go,getParent:Pr,getParents:Us,get:Me,getNext:al,getPrev:Rl,select:Mn,is:Cs,add:yo,create:Rn,createHTML:Ys,createFragment:Kr,remove:co,setStyle:Lt,getStyle:wn,setStyles:$t,removeAllAttribs:Ws,setAttrib:yt,setAttribs:wr,getAttrib:mt,getPos:Pn,parseStyle:ii,serializeStyle:Ya,addStyle:Si,loadCSS:Ec,addClass:zd,removeClass:Cm,hasClass:Hy,toggleClass:Mh,show:v_,hide:$y,isHidden:zy,uniqueId:bD,setHTML:Is,getOuterHTML:vD,setOuterHTML:yD,decode:Dn,encode:qo,insertAfter:Cx,replace:Sx,rename:kx,findCommonAncestor:GS,run:to,getAttribs:vt,isEmpty:KS,createRng:y_,nodeIndex:K1,split:cv,bind:Ex,unbind:Ax,fire:uv,dispatch:x0,getContentEditable:xx,getContentEditableParent:Rt=>{const Nt=dn();let Nn=null;for(let xn=Rt;xn&&xn!==Nt&&(Nn=xx(xn),Nn===null);xn=xn.parentNode);return Nn},isEditable:Rt=>{if(_e(Rt)){const Nt=Qn(Rt)?Rt:Rt.parentElement;return _e(Nt)&&Cn(Ye.fromDom(Nt))}else return!1},destroy:()=>{if(K.length>0){let Rt=K.length;for(;Rt--;){const[Nt,Nn,xn]=K[Rt];be.unbind(Nt,Nn,xn)}}ln(p,(Rt,Nt)=>{B.unload(Nt),delete p[Nt]})},isChildOf:(Rt,Nt)=>Rt===Nt||Nt.contains(Rt),dumpRng:Rt=>"startContainer: "+Rt.startContainer.nodeName+", startOffset: "+Rt.startOffset+", endContainer: "+Rt.endContainer.nodeName+", endOffset: "+Rt.endOffset},w_=Rk(ue,i,et(_1));return _1};Lr.DOM=Lr(document),Lr.nodeIndex=K1;const Mv=Lr.DOM,x2=0,T2=1,ub=2,Nk=3;class nm{constructor(i={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=i}_setReferrerPolicy(i){this.settings.referrerPolicy=i}loadScript(i){return new Promise((l,d)=>{const p=Mv;let w;const E=()=>{p.remove(K),w&&(w.onerror=w.onload=w=null)},R=()=>{E(),l()},B=()=>{E(),d("Failed to load script: "+i)},K=p.uniqueId();w=document.createElement("script"),w.id=K,w.type="text/javascript",w.src=hn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=R,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===ub}markDone(i){this.states[i]=ub}add(i){const l=this;return l.queue.push(i),l.states[i]===void 0&&(l.states[i]=x2),new Promise((p,w)=>{l.scriptLoadedCallbacks[i]||(l.scriptLoadedCallbacks[i]=[]),l.scriptLoadedCallbacks[i].push({resolve:p,reject:w})})}load(i){return this.add(i)}remove(i){delete this.states[i],delete this.scriptLoadedCallbacks[i]}loadQueue(){const i=this.queue;return this.queue=[],this.loadScripts(i)}loadScripts(i){const l=this,d=(B,K)=>{po(l.scriptLoadedCallbacks,K).each(ie=>{Be(ie,ue=>ue[B](K))}),delete l.scriptLoadedCallbacks[K]},p=B=>{const K=wt(B,ie=>ie.status==="rejected");return K.length>0?Promise.reject(Rs(K,({reason:ie})=>se(ie)?ie:[ie])):Promise.resolve()},w=B=>Promise.allSettled(Tt(B,K=>l.states[K]===ub?(d("resolve",K),Promise.resolve()):l.states[K]===Nk?(d("reject",K),Promise.reject(K)):(l.states[K]=T2,l.loadScript(K).then(()=>{l.states[K]=ub,d("resolve",K);const ie=l.queue;return ie.length>0?(l.queue=[],w(ie).then(p)):Promise.resolve()},()=>(l.states[K]=Nk,d("reject",K),Promise.reject(K)))))),E=B=>(l.loading=!0,w(B).then(K=>{l.loading=!1;const ie=l.queueLoadedCallbacks.shift();return de.from(ie).each(bn),p(K)})),R=cs(i);return l.loading?new Promise((B,K)=>{l.queueLoadedCallbacks.push(()=>{E(R).then(B,K)})}):E(R)}}nm.ScriptLoader=new nm;const Ga=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},fb=(n,i)=>{const l=n.indexOf(i);return l!==-1&&n.indexOf(i,l+1)>l},Y1=n=>oe(n)&&un(n,"raw"),j_=n=>se(n)&&n.length>1,db={},D2=Ga("en"),Ra=()=>po(db,D2.get()),Kf={getData:()=>ps(db,n=>({...n})),setCode:n=>{n&&D2.set(n)},getCode:()=>D2.get(),add:(n,i)=>{let l=db[n];l||(db[n]=l={});const d=Tt(gs(i),p=>p.toLowerCase());ln(i,(p,w)=>{const E=w.toLowerCase();E!==w&&fb(d,E)?(un(i,E)||(l[E]=p),l[w]=p):l[E]=p})},translate:n=>{const i=Ra().getOr({}),l=E=>ge(E)?Object.prototype.toString.call(E):d(E)?"":""+E,d=E=>E===""||E===null||E===void 0,p=E=>{const R=l(E);return un(i,R)?l(i[R]):po(i,R.toLowerCase()).map(l).getOr(R)},w=E=>E.replace(/{context:\w+}$/,"");if(d(n))return"";if(Y1(n))return l(n.raw);if(j_(n)){const E=n.slice(1),R=p(n[0]).replace(/\{([0-9]+)\}/g,(B,K)=>un(E,K)?l(E[K]):B);return w(R)}return w(p(n))},isRtl:()=>Ra().bind(n=>po(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>un(db,n)},Na=()=>{const n=[],i={},l={},d=[],p=(Me,Ve)=>{const mt=wt(d,vt=>vt.name===Me&&vt.state===Ve);Be(mt,vt=>vt.resolve())},w=Me=>un(i,Me),E=Me=>un(l,Me),R=Me=>{if(l[Me])return l[Me].instance},B=(Me,Ve)=>{const mt=Kf.getCode(),vt=","+(Ve||"")+",";!mt||Ve&&vt.indexOf(","+mt+",")===-1||nm.ScriptLoader.add(i[Me]+"/langs/"+mt+".js")},K=(Me,Ve)=>{Na.languageLoad!==!1&&(w(Me)?B(Me,Ve):je(Me,"loaded").then(()=>B(Me,Ve)))},ie=(Me,Ve)=>(n.push(Ve),l[Me]={instance:Ve},p(Me,"added"),Ve),ue=Me=>{delete i[Me],delete l[Me]},be=(Me,Ve)=>F(Ve)?F(Me)?{prefix:"",resource:Ve,suffix:""}:{prefix:Me.prefix,resource:Ve,suffix:Me.suffix}:Ve,Le=(Me,Ve)=>{if(i[Me])return Promise.resolve();let mt=F(Ve)?Ve:Ve.prefix+Ve.resource+Ve.suffix;mt.indexOf("/")!==0&&mt.indexOf("://")===-1&&(mt=Na.baseURL+"/"+mt),i[Me]=mt.substring(0,mt.lastIndexOf("/"));const vt=()=>(p(Me,"loaded"),Promise.resolve());return l[Me]?vt():nm.ScriptLoader.add(mt).then(vt)},je=(Me,Ve="added")=>Ve==="added"&&E(Me)||Ve==="loaded"&&w(Me)?Promise.resolve():new Promise(mt=>{d.push({name:Me,state:Ve,resolve:mt})});return{items:n,urls:i,lookup:l,get:R,requireLangPack:K,add:ie,remove:ue,createUrl:be,load:Le,waitFor:je}};Na.languageLoad=!0,Na.baseURL="",Na.PluginManager=Na(),Na.ThemeManager=Na(),Na.ModelManager=Na();const Sa=n=>{const i=Ga(de.none()),l=()=>i.get().each(n);return{clear:()=>{l(),i.set(de.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{l(),i.set(de.some(R))}}},Ik=n=>{const i=Ga(de.none()),l=()=>i.get().each(R=>clearInterval(R));return{clear:()=>{l(),i.set(de.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{l(),i.set(de.some(setInterval(R,n)))}}},mh=()=>{const n=Sa(ft);return{...n,on:l=>n.get().each(l)}},hb=(n,i)=>{let l=null;return{cancel:()=>{X(l)||(clearTimeout(l),l=null)},throttle:(...w)=>{X(l)&&(l=setTimeout(()=>{l=null,n.apply(null,w)},i))}}},Rv=(n,i)=>{let l=null;const d=()=>{X(l)||(clearTimeout(l),l=null)};return{cancel:d,throttle:(...w)=>{d(),l=setTimeout(()=>{l=null,n.apply(null,w)},i)}}},Yf=et("mce-annotation"),Qu=et("data-mce-annotation"),jp=et("data-mce-annotation-uid"),X1=et("data-mce-annotation-active"),mb=et("data-mce-annotation-classes"),gb=et("data-mce-annotation-attrs"),Z_=n=>i=>bt(i,n),M2=(n,i)=>{const l=n.selection.getRng(),d=Ye.fromDom(l.startContainer),p=Ye.fromDom(n.getBody()),w=i.fold(()=>"."+Yf(),B=>`[${Qu()}="${B}"]`),E=Wu(d,l.startOffset).getOr(d);return rt(E,w,Z_(p)).bind(B=>za(B,`${jp()}`).bind(K=>za(B,`${Qu()}`).map(ie=>{const ue=G_(n,K);return{uid:K,name:ie,elements:ue}})))},Bk=n=>_l(n)&&wf(n,Yf()),q_=(n,i)=>qi(n,"data-mce-bogus")||m2(n,'[data-mce-bogus="all"]',Z_(i)),G_=(n,i)=>{const l=Ye.fromDom(n.getBody()),d=hl(l,`[${jp()}="${i}"]`);return wt(d,p=>!q_(p,l))},R2=(n,i)=>{const l=Ye.fromDom(n.getBody()),d=hl(l,`[${Qu()}="${i}"]`),p={};return Be(d,w=>{if(!q_(w,l)){const E=Pl(w,jp()),R=po(p,E).getOr([]);p[E]=R.concat([w])}}),p},K_=(n,i)=>{const l=Ga({}),d=()=>({listeners:[],previous:mh()}),p=(ue,be)=>{w(ue,Le=>(be(Le),Le))},w=(ue,be)=>{const Le=l.get(),je=po(Le,ue).getOrThunk(d),Me=be(je);Le[ue]=Me,l.set(Le)},E=(ue,be,Le)=>{p(ue,je=>{Be(je.listeners,Me=>Me(!0,ue,{uid:be,nodes:Tt(Le,Ve=>Ve.dom)}))})},R=ue=>{p(ue,be=>{Be(be.listeners,Le=>Le(!1,ue))})},B=(ue,be)=>{Be(G_(n,ue),Le=>{be?Dr(Le,X1(),"true"):zi(Le,X1())})},K=Rv(()=>{const ue=Ns(i.getNames());Be(ue,be=>{w(be,Le=>{const je=Le.previous.get();return M2(n,de.some(be)).fold(()=>{je.each(Me=>{R(be),Le.previous.clear(),B(Me,!1)})},({uid:Me,name:Ve,elements:mt})=>{qr(je,Me)||(je.each(vt=>B(vt,!1)),E(Ve,Me,mt),Le.previous.set(Me),B(Me,!0))}),{previous:Le.previous,listeners:Le.listeners}})})},30);return n.on("remove",()=>{K.cancel()}),n.on("NodeChange",()=>{K.throttle()}),{addListener:(ue,be)=>{w(ue,Le=>({previous:Le.previous,listeners:Le.listeners.concat([be])}))}}},s3=(n,i)=>{const l=Qu(),d=w=>de.from(w.attr(l)).bind(i.lookup),p=w=>{var E,R;w.attr(jp(),null),w.attr(Qu(),null),w.attr(X1(),null);const B=de.from(w.attr(gb())).map(be=>be.split(",")).getOr([]),K=de.from(w.attr(mb())).map(be=>be.split(",")).getOr([]);Be(B,be=>w.attr(be,null));const ie=(R=(E=w.attr("class"))===null||E===void 0?void 0:E.split(" "))!==null&&R!==void 0?R:[],ue=ba(ie,[Yf()].concat(K));w.attr("class",ue.length>0?ue.join(" "):null),w.attr(mb(),null),w.attr(gb(),null)};n.serializer.addTempAttr(X1()),n.serializer.addAttributeFilter(l,w=>{for(const E of w)d(E).each(R=>{R.persistent===!1&&(E.name==="span"?E.unwrap():p(E))})})},Nv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>po(n,p).map(w=>w.settings),getNames:()=>gs(n)}};let Y_=0;const Ni=n=>{const l=new Date().getTime(),d=Math.floor(Math.random()*1e9);return Y_++,n+"_"+d+Y_+String(l)},Pv=(n,i)=>{Be(i,l=>{Uu(n,l)})},N2=(n,i)=>{Be(i,l=>{Nc(n,l)})},X_=(n,i)=>Ye.fromDom(n.dom.cloneNode(i)),ng=n=>X_(n,!1),uc=n=>X_(n,!0),ru=(n,i)=>{const l=Ye.fromTag(i),d=zf(n);return Vu(l,d),l},J_=(n,i)=>{const l=ru(n,i);Yc(n,l);const d=xa(n);return Jr(l,d),br(n),l},P2=(n,i,l=qe)=>{const d=new bi(n,i),p=w=>{let E;do E=d[w]();while(E&&!Sn(E)&&!l(E));return de.from(E).filter(Sn)};return{current:()=>de.from(d.current()).filter(Sn),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},op=(n,i)=>{const l=i||(E=>n.isBlock(E)||ui(E)||As(E)),d=(E,R,B,K)=>{if(Sn(E)){const ie=K(E,R,E.data);if(ie!==-1)return de.some({container:E,offset:ie})}return B().bind(ie=>d(ie.container,ie.offset,B,K))};return{backwards:(E,R,B,K)=>{const ie=P2(E,K!=null?K:n.getRoot(),l);return d(E,R,()=>ie.prev().map(ue=>({container:ue,offset:ue.length})),B).getOrNull()},forwards:(E,R,B,K)=>{const ie=P2(E,K!=null?K:n.getRoot(),l);return d(E,R,()=>ie.next().map(ue=>({container:ue,offset:0})),B).getOrNull()}}},sp=Math.round,Zp=n=>n?{left:sp(n.left),top:sp(n.top),bottom:sp(n.bottom),right:sp(n.right),width:sp(n.width),height:sp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},qp=(n,i)=>(n=Zp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),og=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Iv=(n,i,l)=>n>=0&&n<=Math.min(i.height,l.height)/2,ta=(n,i)=>{const l=Math.min(i.height/2,n.height/2);return n.bottom-l<i.top?!0:n.top>i.bottom?!1:Iv(i.top-n.bottom,n,i)},ef=(n,i)=>n.top>i.bottom?!0:n.bottom<i.top?!1:Iv(i.bottom-n.top,n,i),J1=(n,i,l)=>i>=n.left&&i<=n.right&&l>=n.top&&l<=n.bottom,Lk=n=>vn(n,(i,l)=>i.fold(()=>de.some(l),d=>{const p=Math.min(l.left,d.left),w=Math.min(l.top,d.top),E=Math.max(l.right,d.right),R=Math.max(l.bottom,d.bottom);return de.some({top:w,right:E,bottom:R,left:p,width:E-p,height:R-w})}),de.none()),I2=(n,i,l)=>{const d=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(l,n.top+n.height),n.top);return Math.sqrt((i-d)*(i-d)+(l-p)*(l-p))},Fk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),Gp=(n,i,l)=>Math.min(Math.max(n,i),l),Q1=n=>{const i=n.startContainer,l=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===l+1?i.childNodes[l]:null},Xf=(n,i)=>{if(Qn(n)&&n.hasChildNodes()){const l=n.childNodes,d=Gp(i,0,l.length-1);return l[d]}else return n},B2=(n,i)=>{if(!(i<0&&Qn(n)&&n.hasChildNodes()))return Xf(n,i)},Q_=new RegExp("[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\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\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC-\u0CCD\u0CD5-\u0CD6\u0CE2-\u0CE3\u0D01\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\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C-\u200D\u20D0-\u20DC\u20DD-\u20E0\u20E1\u20E2-\u20E4\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u302E-\u302F\u3099-\u309A\uA66F\uA670-\uA672\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E-\uFF9F]"),eC=n=>F(n)&&n.charCodeAt(0)>=768&&Q_.test(n),Hk=(...n)=>i=>{for(let l=0;l<n.length;l++)if(n[l](i))return!0;return!1},tC=(...n)=>i=>{for(let l=0;l<n.length;l++)if(!n[l](i))return!1;return!0},pb=Qn,bb=Sl,nC=eh("display","block table"),L2=eh("float","left right"),Kp=tC(pb,bb,ct(L2)),oC=ct(eh("white-space","pre pre-line pre-wrap")),Yp=Sn,sg=ui,Bv=Lr.nodeIndex,tf=B2,e0=n=>n?n.createRange():Lr.DOM.createRng(),Gs=n=>F(n)&&/[\r\n\t ]/.test(n),iu=n=>!!n.setStart&&!!n.setEnd,rg=n=>{const i=n.startContainer,l=n.startOffset;if(Gs(n.toString())&&oC(i.parentNode)&&Sn(i)){const d=i.data;if(Gs(d[l-1])||Gs(d[l+1]))return!0}return!1},F2=n=>{const i=n.ownerDocument,l=e0(i),d=i.createTextNode(Gr),p=n.parentNode;p.insertBefore(d,n),l.setStart(d,0),l.setEnd(d,1);const w=Zp(l.getBoundingClientRect());return p.removeChild(d),w},Wi=n=>{const i=n.startContainer,l=n.endContainer,d=n.startOffset,p=n.endOffset;if(i===l&&Sn(l)&&d===0&&p===1){const w=n.cloneRange();return w.setEndAfter(l),ig(w)}else return null},H2=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,ig=n=>{var i;let l;const d=n.getClientRects();return d.length>0?l=Zp(d[0]):l=Zp(n.getBoundingClientRect()),!iu(n)&&sg(n)&&H2(l)?F2(n):H2(l)&&iu(n)&&(i=Wi(n))!==null&&i!==void 0?i:l},ga=(n,i)=>{const l=qp(n,i);return l.width=1,l.right=l.left+1,l},om=n=>{const i=[],l=E=>{E.height!==0&&(i.length>0&&og(E,i[i.length-1])||i.push(E))},d=(E,R)=>{const B=e0(E.ownerDocument);if(R<E.data.length){if(eC(E.data[R]))return;if(eC(E.data[R-1])&&(B.setStart(E,R),B.setEnd(E,R+1),!rg(B))){l(ga(ig(B),!1));return}}R>0&&(B.setStart(E,R-1),B.setEnd(E,R),rg(B)||l(ga(ig(B),!1))),R<E.data.length&&(B.setStart(E,R),B.setEnd(E,R+1),rg(B)||l(ga(ig(B),!0)))},p=n.container(),w=n.offset();if(Yp(p))return d(p,w),i;if(pb(p))if(n.isAtEnd()){const E=tf(p,w);Yp(E)&&d(E,E.data.length),Kp(E)&&!sg(E)&&l(ga(ig(E),!1))}else{const E=tf(p,w);if(Yp(E)&&d(E,0),Kp(E)&&n.isAtEnd())return l(ga(ig(E),!1)),i;const R=tf(n.container(),n.offset()-1);Kp(R)&&!sg(R)&&(nC(R)||nC(E)||!Kp(E))&&l(ga(ig(R),!1)),Kp(E)&&l(ga(ig(E),!0))}return i},Vt=(n,i,l)=>{const d=()=>(Yp(n),i===0),p=()=>Yp(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ie=e0(n.ownerDocument);return ie.setStart(n,i),ie.setEnd(n,i),ie},E=()=>(l||(l=om(Vt(n,i))),l),R=()=>E().length>0,B=ie=>ie&&n===ie.container()&&i===ie.offset(),K=ie=>tf(n,ie?i-1:i);return{container:et(n),offset:et(i),toRange:w,getClientRects:E,isVisible:R,isAtStart:d,isAtEnd:p,isEqual:B,getNode:K}};Vt.fromRangeStart=n=>Vt(n.startContainer,n.startOffset),Vt.fromRangeEnd=n=>Vt(n.endContainer,n.endOffset),Vt.after=n=>Vt(n.parentNode,Bv(n)+1),Vt.before=n=>Vt(n.parentNode,Bv(n)),Vt.isAbove=(n,i)=>ni(Po(i.getClientRects()),Mo(n.getClientRects()),ta).getOr(!1),Vt.isBelow=(n,i)=>ni(Mo(i.getClientRects()),Po(n.getClientRects()),ef).getOr(!1),Vt.isAtStart=n=>n?n.isAtStart():!1,Vt.isAtEnd=n=>n?n.isAtEnd():!1,Vt.isTextPosition=n=>n?Sn(n.container()):!1,Vt.isElementPosition=n=>!Vt.isTextPosition(n);const vb=(n,i)=>{Sn(i)&&i.data.length===0&&n.remove(i)},$2=(n,i,l)=>{i.insertNode(l),vb(n,l.previousSibling),vb(n,l.nextSibling)},yb=(n,i,l)=>{const d=de.from(l.firstChild),p=de.from(l.lastChild);i.insertNode(l),d.each(w=>vb(n,w.previousSibling)),p.each(w=>vb(n,w.nextSibling))},gh=(n,i,l)=>{U1(l)?yb(n,i,l):$2(n,i,l)},nf=Sn,t0=Cd,Lv=Lr.nodeIndex,z2=n=>{const i=n.parentNode;return t0(i)?z2(i):i},Fv=n=>n?Ke(n.childNodes,(i,l)=>(t0(l)&&l.nodeName!=="BR"?i=i.concat(Fv(l)):i.push(l),i),[]):[],wb=(n,i)=>{let l=n;for(;(l=l.previousSibling)&&nf(l);)i+=l.data.length;return i},ph=n=>i=>n===i,Jf=n=>{let i,l;i=Fv(z2(n)),l=Ge(i,ph(n),n),i=i.slice(0,l+1);const d=Ke(i,(p,w,E)=>(nf(w)&&nf(i[E-1])&&p++,p),0);return i=La(i,Sf([n.nodeName])),l=Ge(i,ph(n),n),l-d},Tu=n=>(nf(n)?"text()":n.nodeName.toLowerCase())+"["+Jf(n)+"]",Fl=(n,i,l)=>{const d=[];for(let p=i.parentNode;p&&p!==n&&!(l&&l(p));p=p.parentNode)d.push(p);return d},V2=(n,i)=>{let l=[],d=i.container(),p=i.offset(),w;if(nf(d))w=wb(d,p);else{const R=d.childNodes;p>=R.length?(w="after",p=R.length-1):w="before",d=R[p]}l.push(Tu(d));let E=Fl(n,d);return E=La(E,ct(Cd)),l=l.concat(Fi(E,R=>Tu(R))),l.reverse().join("/")+","+w},rp=(n,i,l)=>{let d=Fv(n);return d=La(d,(p,w)=>!nf(p)||!nf(d[w-1])),d=La(d,Sf([i])),d[l]},sC=(n,i)=>{let l=n,d=0;for(;nf(l);){const p=l.data.length;if(i>=d&&i<=d+p){n=l,i=i-d;break}if(!nf(l.nextSibling)){n=l,i=p;break}d+=p,l=l.nextSibling}return nf(n)&&i>n.data.length&&(i=n.data.length),Vt(n,i)},_b=(n,i)=>{if(!i)return null;const l=i.split(","),d=l[0].split("/"),p=l.length>1?l[1]:"before",w=Ke(d,(E,R)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(R);return B?(B[1]==="text()"&&(B[1]="#text"),rp(E,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!nf(w)&&w.parentNode){let E;return p==="after"?E=Lv(w)+1:E=Lv(w),Vt(w.parentNode,E)}return sC(w,parseInt(p,10))},Xp=As,U2=(n,i,l)=>{let d=n(i.data.slice(0,l)).length;for(let p=i.previousSibling;p&&Sn(p);p=p.previousSibling)d+=n(p.data).length;return d},Hv=(n,i,l,d,p)=>{const w=p?d.startContainer:d.endContainer;let E=p?d.startOffset:d.endOffset;const R=[],B=n.getRoot();if(Sn(w))R.push(l?U2(i,w,E):E);else{let K=0;const ie=w.childNodes;E>=ie.length&&ie.length&&(K=1,E=Math.max(0,ie.length-1)),R.push(n.nodeIndex(ie[E],l)+K)}for(let K=w;K&&K!==B;K=K.parentNode)R.push(n.nodeIndex(K,l));return R},rC=(n,i,l,d)=>{const p=i.dom,w=Hv(p,n,l,d,!0),E=i.isForward(),R=ea(d)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:E,...R};{const B=Hv(p,n,l,d,!1);return{start:w,end:B,forward:E,...R}}},$v=(n,i,l)=>{let d=0;return hn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===l)return!1;d++;return}}),d},W2=(n,i)=>{let l=i?n.startContainer:n.endContainer,d=i?n.startOffset:n.endOffset;if(Qn(l)&&l.nodeName==="TR"){const p=l.childNodes;l=p[Math.min(i?d:d-1,p.length-1)],l&&(d=i?0:l.childNodes.length,i?n.setStart(l,d):n.setEnd(l,d))}},gl=n=>(W2(n,!0),W2(n,!1),n),Kl=(n,i)=>{if(Qn(n)&&(n=Xf(n,i),Xp(n)))return n;if(vr(n)){Sn(n)&&vi(n)&&(n=n.parentNode);let l=n.previousSibling;if(Xp(l)||(l=n.nextSibling,Xp(l)))return l}},Du=n=>Kl(n.startContainer,n.startOffset)||Kl(n.endContainer,n.endOffset),Fr=(n,i,l)=>{const d=l.getNode(),p=l.getRng();if(d.nodeName==="IMG"||Xp(d)){const E=d.nodeName;return{name:E,index:$v(l.dom,E,d)}}const w=Du(p);if(w){const E=w.tagName;return{name:E,index:$v(l.dom,E,w)}}return rC(n,l,i,p)},Yl=n=>{const i=n.getRng();return{start:V2(n.dom.getRoot(),Vt.fromRangeStart(i)),end:V2(n.dom.getRoot(),Vt.fromRangeEnd(i)),forward:n.isForward()}},Hl=n=>({rng:n.getRng(),forward:n.isForward()}),sm=(n,i,l)=>{const d={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return l?n.create("span",d,""):n.create("span",d)},yr=(n,i)=>{const l=n.dom;let d=n.getRng();const p=l.uniqueId(),w=n.isCollapsed(),E=n.getNode(),R=E.nodeName,B=n.isForward();if(R==="IMG")return{name:R,index:$v(l,R,E)};const K=gl(d.cloneRange());if(!w){K.collapse(!1);const ue=sm(l,p+"_end",i);gh(l,K,ue)}d=gl(d),d.collapse(!0);const ie=sm(l,p+"_start",i);return gh(l,d,ie),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},iC=(n,i,l=!1)=>i===2?Fr(Ln,l,n):i===3?Yl(n):i?Hl(n):yr(n,!1),au=He(Fr,Et,!0),Al=n=>{const i=w=>w(n),l=et(n),d=()=>p,p={tag:!0,inner:n,fold:(w,E)=>E(n),isValue:gt,isError:qe,map:w=>fc.value(w(n)),mapError:d,bind:i,exists:i,forall:i,getOr:l,or:d,getOrThunk:l,orThunk:d,getOrDie:l,each:w=>{w(n)},toOptional:()=>de.some(n)};return p},j2=n=>{const i=()=>l,l={tag:!1,inner:n,fold:(d,p)=>d(n),isValue:qe,isError:gt,map:i,mapError:d=>fc.error(d(n)),bind:i,exists:qe,forall:gt,getOr:Et,or:Et,getOrThunk:kt,orThunk:kt,getOrDie:an(String(n)),each:ft,toOptional:de.none};return l},fc={value:Al,error:j2,fromOption:(n,i)=>n.fold(()=>j2(i),Al)},lg={generate:n=>{if(!se(n))throw new Error("cases must be an array");if(n.length===0)throw new Error("there must be at least one case");const i=[],l={};return Be(n,(d,p)=>{const w=gs(d);if(w.length!==1)throw new Error("one and only one name per case");const E=w[0],R=d[E];if(l[E]!==void 0)throw new Error("duplicate key detected:"+E);if(E==="cata")throw new Error("cannot have a case named cata (sorry)");if(!se(R))throw new Error("case arguments must be an array");i.push(E),l[E]=(...B)=>{const K=B.length;if(K!==R.length)throw new Error("Wrong number of arguments to case "+E+". Expected "+R.length+" ("+R+"), got "+K);return{fold:(...ue)=>{if(ue.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+ue.length);return ue[p].apply(null,B)},match:ue=>{const be=gs(ue);if(i.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+`
|
|
Actual: `+be.join(","));if(!Js(i,je=>St(be,je)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+`
|
|
Required: `+i.join(", "));return ue[E].apply(null,B)},log:ue=>{console.log(ue,{constructors:i,constructor:E,params:B})}}}}),l}};lg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const $k=n=>{const i=[],l=[];return Be(n,d=>{d.fold(p=>{i.push(p)},p=>{l.push(p)})}),{errors:i,values:l}},zk=n=>n.type==="inline-command"||n.type==="inline-format",Z2=n=>n.type==="block-command"||n.type==="block-format",q2=n=>{const i=d=>fc.error({message:d,pattern:n}),l=(d,p,w)=>{if(n.format!==void 0){let E;if(se(n.format)){if(!Js(n.format,F))return i(d+" pattern has non-string items in the `format` array");E=n.format}else if(F(n.format))E=[n.format];else return i(d+" pattern has non-string `format` parameter");return fc.value(p(E))}else return n.cmd!==void 0?F(n.cmd)?fc.value(w(n.cmd,n.value)):i(d+" pattern has non-string `cmd` parameter"):i(d+" pattern is missing both `format` and `cmd` parameters")};if(!oe(n))return i("Raw pattern is not an object");if(!F(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!F(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let d=n.start,p=n.end;return p.length===0&&(p=d,d=""),l("Inline",w=>({type:"inline-format",start:d,end:p,format:w}),(w,E)=>({type:"inline-command",start:d,end:p,cmd:w,value:E}))}else return n.replacement!==void 0?F(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):fc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):l("Block",d=>({type:"block-format",start:n.start,format:d[0]}),(d,p)=>({type:"block-command",start:n.start,cmd:d,value:p}))},rm=n=>wt(n,Z2),G2=n=>wt(n,zk),Jp=(n,i)=>({inlinePatterns:G2(n),blockPatterns:rm(n),dynamicPatternsLookup:i}),pl=n=>{const i=$k(Tt(n,q2));return Be(i.errors,l=>console.error(l.message,l.pattern)),i.values},xl=n=>i=>{const l=n(i);return pl(l)},Tn=ys().deviceType,Vk=Tn.isTouch(),Xl=Lr.DOM,Uk=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return vn(i,(l,d)=>{const p=d.split("="),w=p[0],E=p.length>1?p[1]:w;return l[pc(w)]=pc(E),l},{})},K2=n=>ee(n,RegExp),oo=n=>i=>i.options.get(n),Cc=n=>F(n)||oe(n),Y2=(n,i="")=>l=>{const d=F(l);if(d)if(l.indexOf("=")!==-1){const p=Uk(l);return{value:po(p,n.id).getOr(i),valid:d}}else return{value:l,valid:d};else return{valid:!1,message:"Must be a string."}},n0=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:"<!DOCTYPE html>"}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:Y2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:Y2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:l=>{const d=F(l)&&pr(l);return d?{value:l,valid:d}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:l=>{const d=St(["block","linebreak","invert","default"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:l=>we(l)?{valid:!0,value:l}:F(l)?{valid:!0,value:l}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_upload_handler",{processor:"function"}),i("language",{processor:"string",default:"en"}),i("language_url",{processor:"string",default:""}),i("entity_encoding",{processor:"string",default:"named"}),i("indent",{processor:"boolean",default:!0}),i("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_use_margin",{processor:"boolean",default:!1}),i("indentation",{processor:"string",default:"40px"}),i("content_css",{processor:l=>{const d=l===!1||F(l)||Je(l,F);return d?F(l)?{value:Tt(l.split(","),pc),valid:d}:se(l)?{value:l,valid:d}:l===!1?{value:[],valid:d}:{value:l,valid:d}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:bC(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:l=>{const d=F(l)||Je(l,F);return d?{value:se(l)?l:Tt(l.split(","),pc),valid:d}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),i("inline_boundaries",{processor:"boolean",default:!0}),i("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),i("object_resizing",{processor:l=>{const d=we(l)||F(l);return d?l===!1||Tn.isiPhone()||Tn.isiPad()?{value:"",valid:d}:{value:l===!0?"table,img,figure.image,div,video,iframe":l,valid:d}:{valid:!1,message:"Must be boolean or a string"}},default:!Vk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:l=>l===!1||F(l)||ge(l),default:"silver"}),i("theme_url",{processor:"string"}),i("formats",{processor:"object"}),i("format_empty_lines",{processor:"boolean",default:!1}),i("format_noneditable_selector",{processor:"string",default:""}),i("preview_styles",{processor:l=>{const d=l===!1||F(l);return d?{value:l===!1?"":l,valid:d}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),i("custom_ui_selector",{processor:"string",default:""}),i("hidden_input",{processor:"boolean",default:!0}),i("submit_patch",{processor:"boolean",default:!0}),i("encoding",{processor:"string"}),i("add_form_submit_trigger",{processor:"boolean",default:!0}),i("add_unload_trigger",{processor:"boolean",default:!0}),i("custom_undo_redo_levels",{processor:"number",default:0}),i("disable_nodechange",{processor:"boolean",default:!1}),i("readonly",{processor:"boolean",default:!1}),i("editable_root",{processor:"boolean",default:!0}),i("plugins",{processor:"string[]",default:[]}),i("external_plugins",{processor:"object"}),i("forced_plugins",{processor:"string[]"}),i("model",{processor:"string",default:n.hasPlugin("rtc")?"plugin":"dom"}),i("model_url",{processor:"string"}),i("block_unsupported_drop",{processor:"boolean",default:!0}),i("visual",{processor:"boolean",default:!0}),i("visual_table_class",{processor:"string",default:"mce-item-table"}),i("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),i("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),i("setup",{processor:"function"}),i("init_instance_callback",{processor:"function"}),i("url_converter",{processor:"function",default:n.convertURL}),i("url_converter_scope",{processor:"object",default:n}),i("urlconverter_callback",{processor:"function"}),i("allow_conditional_comments",{processor:"boolean",default:!1}),i("allow_html_data_urls",{processor:"boolean",default:!1}),i("allow_svg_data_urls",{processor:"boolean"}),i("allow_html_in_named_anchor",{processor:"boolean",default:!1}),i("allow_script_urls",{processor:"boolean",default:!1}),i("allow_unsafe_link_target",{processor:"boolean",default:!1}),i("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),i("fix_list_elements",{processor:"boolean",default:!1}),i("preserve_cdata",{processor:"boolean",default:!1}),i("remove_trailing_brs",{processor:"boolean",default:!0}),i("pad_empty_with_br",{processor:"boolean",default:!1}),i("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),i("element_format",{processor:"string",default:"html"}),i("entities",{processor:"string"}),i("schema",{processor:"string",default:"html5"}),i("convert_urls",{processor:"boolean",default:!0}),i("relative_urls",{processor:"boolean",default:!0}),i("remove_script_host",{processor:"boolean",default:!0}),i("custom_elements",{processor:"string"}),i("extended_valid_elements",{processor:"string"}),i("invalid_elements",{processor:"string"}),i("invalid_styles",{processor:Cc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Cc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Cc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:l=>F(l)||l===!0}),i("browser_spellcheck",{processor:"boolean",default:!1}),i("protect",{processor:"array"}),i("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),i("deprecation_warnings",{processor:"boolean",default:!0}),i("a11y_advanced_options",{processor:"boolean",default:!1}),i("api_key",{processor:"string"}),i("paste_block_drop",{processor:"boolean",default:!1}),i("paste_data_images",{processor:"boolean",default:!0}),i("paste_preprocess",{processor:"function"}),i("paste_postprocess",{processor:"function"}),i("paste_webkit_styles",{processor:"string",default:"none"}),i("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),i("paste_merge_formats",{processor:"boolean",default:!0}),i("smart_paste",{processor:"boolean",default:!0}),i("paste_as_text",{processor:"boolean",default:!1}),i("paste_tab_spaces",{processor:"number",default:4}),i("text_patterns",{processor:l=>Je(l,oe)||l===!1?{value:pl(l===!1?[]:l),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),i("text_patterns_lookup",{processor:l=>ge(l)?{value:xl(l),valid:!0}:{valid:!1,message:"Must be a single function"},default:l=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:l=>Je(l,K2)?{value:l,valid:!0}:K2(l)?{value:[l],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),i("table_tab_navigation",{processor:"boolean",default:!0}),i("highlight_on_focus",{processor:"boolean",default:!1}),i("xss_sanitization",{processor:"boolean",default:!0}),i("details_initial_state",{processor:l=>{const d=St(["inherited","collapsed","expanded"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:l=>{const d=St(["inherited","collapsed","expanded"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("init_content_sync",{processor:"boolean",default:!1}),i("newdocument_content",{processor:"string",default:""}),n.on("ScriptsLoaded",()=>{i("directionality",{processor:"string",default:Kf.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:Xl.getAttrib(n.getElement(),"placeholder")})})},of=oo("iframe_attrs"),zv=oo("doctype"),Qp=oo("document_base_url"),Df=oo("body_id"),ol=oo("body_class"),Md=oo("content_security_policy"),Rd=oo("br_in_pre"),Hc=oo("forced_root_block"),o0=oo("forced_root_block_attrs"),X2=oo("newline_behavior"),aC=oo("br_newline_selector"),J2=oo("no_newline_selector"),bh=oo("keep_styles"),jr=oo("end_container_on_empty_block"),Vv=oo("automatic_uploads"),Qf=oo("images_reuse_filename"),lC=oo("images_replace_blob_uris"),cC=oo("icons"),ia=oo("icons_url"),Wk=oo("images_upload_url"),Uv=oo("images_upload_base_path"),Wv=oo("images_upload_credentials"),uC=oo("images_upload_handler"),jk=oo("content_css_cors"),s0=oo("referrer_policy"),fC=oo("language"),Zk=oo("language_url"),dC=oo("indent_use_margin"),qk=oo("indentation"),hC=oo("content_css"),jv=oo("content_style"),ip=oo("font_css"),r0=oo("directionality"),ji=oo("inline_boundaries_selector"),Q2=oo("object_resizing"),Sc=oo("resize_img_proportional"),i0=oo("placeholder"),sl=oo("event_root"),mC=oo("service_message"),im=oo("theme"),Gk=oo("theme_url"),Jl=oo("model"),sf=oo("model_url"),Cb=oo("inline_boundaries"),Kk=oo("formats"),Yk=oo("preview_styles"),gC=oo("format_empty_lines"),Sb=oo("format_noneditable_selector"),pC=oo("custom_ui_selector"),bC=oo("inline"),ap=oo("hidden_input"),Xk=oo("submit_patch"),Jk=oo("add_form_submit_trigger"),Qk=oo("add_unload_trigger"),ew=oo("custom_undo_redo_levels"),Zv=oo("disable_nodechange"),cg=oo("readonly"),vC=oo("editable_root"),yC=oo("content_css_cors"),qv=oo("plugins"),a0=oo("external_plugins"),ug=oo("block_unsupported_drop"),Gv=oo("visual"),Kv=oo("visual_table_class"),kb=oo("visual_anchor_class"),wC=oo("iframe_aria_text"),vh=oo("setup"),Eb=oo("init_instance_callback"),_C=oo("urlconverter_callback"),yh=oo("auto_focus"),lp=oo("browser_spellcheck"),tw=oo("protect"),CC=oo("paste_block_drop"),Yv=oo("paste_data_images"),eE=oo("paste_preprocess"),SC=oo("paste_postprocess"),tE=oo("newdocument_content"),nE=oo("paste_webkit_styles"),kC=oo("paste_remove_styles_if_webkit"),EC=oo("paste_merge_formats"),AC=oo("smart_paste"),oE=oo("paste_as_text"),sE=oo("paste_tab_spaces"),rE=oo("allow_html_data_urls"),xC=oo("text_patterns"),nw=oo("text_patterns_lookup"),ow=oo("noneditable_class"),iE=oo("editable_class"),aE=oo("noneditable_regexp"),Xv=oo("preserve_cdata"),TC=oo("highlight_on_focus"),Jv=oo("xss_sanitization"),Ab=oo("init_content_sync"),l0=n=>n.options.isSet("text_patterns_lookup"),Qv=n=>hn.explode(n.options.get("font_size_style_values")),sw=n=>hn.explode(n.options.get("font_size_classes")),DC=n=>n.options.get("encoding")==="xml",rw=n=>hn.explode(n.options.get("images_file_types")),lE=oo("table_tab_navigation"),ey=oo("details_initial_state"),xb=oo("details_serialized_state"),cE=Qn,ty=Sn,rf=n=>{const i=n.parentNode;i&&i.removeChild(n)},ny=n=>{const i=Ln(n);return{count:n.length-i.length,text:i}},OC=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},oy=(n,i)=>(bl(n),i),uE=(n,i)=>{const l=ny(n.data.substr(0,i.offset())),d=ny(n.data.substr(i.offset()));return(l.text+d.text).length>0?(OC(n),Vt(n,i.offset()-l.count)):i},Tb=(n,i)=>{const l=i.container(),d=Wo(Mr(l.childNodes),n).map(p=>p<i.offset()?Vt(l,i.offset()-1):i).getOr(i);return bl(n),d},iw=(n,i)=>ty(n)&&i.container()===n?uE(n,i):oy(n,i),fE=(n,i)=>i.container()===n.parentNode?Tb(n,i):oy(n,i),sy=(n,i)=>Vt.isTextPosition(i)?iw(n,i):fE(n,i),bl=n=>{cE(n)&&vr(n)&&(Bc(n)?n.removeAttribute("data-mce-caret"):rf(n)),ty(n)&&(OC(n),n.data.length===0&&rf(n))},dE=As,c0=qu,hE=kd,u0="*[contentEditable=false],video,audio,embed,object",aw=(n,i,l)=>{const d=qp(i.getBoundingClientRect(),l);let p,w;if(n.tagName==="BODY"){const R=n.ownerDocument.documentElement;p=n.scrollLeft||R.scrollLeft,w=n.scrollTop||R.scrollTop}else{const R=n.getBoundingClientRect();p=n.scrollLeft-R.left,w=n.scrollTop-R.top}d.left+=p,d.right+=p,d.top+=w,d.bottom+=w,d.width=1;let E=i.offsetWidth-i.clientWidth;return E>0&&(l&&(E*=-1),d.left+=E,d.right+=E),d},mE=n=>{var i,l;const d=hl(Ye.fromDom(n),u0);for(let p=0;p<d.length;p++){const w=d[p].dom;let E=w.previousSibling;if(lr(E)){const R=E.data;R.length===1?(i=E.parentNode)===null||i===void 0||i.removeChild(E):E.deleteData(R.length-1,1)}E=w.nextSibling,sh(E)&&(E.data.length===1?(l=E.parentNode)===null||l===void 0||l.removeChild(E):E.deleteData(0,1))}},gE=(n,i,l,d)=>{const p=mh();let w,E;const R=Hc(n),B=n.dom,K=(Me,Ve)=>{let mt;if(ie(),hE(Ve))return null;if(l(Ve)){const vt=oh(R,Ve,Me),yt=aw(i,Ve,Me);B.setStyle(vt,"top",yt.top),E=vt;const Mt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Mt,{...yt}),B.add(i,Mt),p.set({caret:Mt,element:Ve,before:Me}),Me&&B.addClass(Mt,"mce-visual-caret-before"),ue(),mt=Ve.ownerDocument.createRange(),mt.setStart(vt,0),mt.setEnd(vt,0)}else return E=Qc(Ve,Me),mt=Ve.ownerDocument.createRange(),am(E.nextSibling)?(mt.setStart(E,0),mt.setEnd(E,0)):(mt.setStart(E,1),mt.setEnd(E,1)),mt;return mt},ie=()=>{mE(i),E&&(bl(E),E=null),p.on(Me=>{B.remove(Me.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},ue=()=>{w=setInterval(()=>{p.on(Me=>{d()?B.toggleClass(Me.caret,"mce-visual-caret-hidden"):B.addClass(Me.caret,"mce-visual-caret-hidden")})},500)};return{show:K,hide:ie,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{p.on(Me=>{const Ve=aw(i,Me.element,Me.before);B.setStyles(Me.caret,{...Ve})})},destroy:()=>clearInterval(w)}},Db=()=>Xn.browser.isFirefox(),am=n=>dE(n)||c0(n),f0=n=>(am(n)||Eu(n)&&Db())&&pi(Ye.fromDom(n)).exists(Cn),lu=ha,e1=As,MC=qu,RC=eh("display","block table table-cell table-caption list-item"),lw=vr,cw=vi,uw=Qn,pE=Sn,Ob=Sl,ry=n=>n>0,cp=n=>n<0,Mb=(n,i)=>{let l;for(;l=n(i);)if(!cw(l))return l;return null},wh=(n,i,l,d,p)=>{const w=new bi(n,d),E=e1(n)||cw(n);let R;if(cp(i)){if(E&&(R=Mb(w.prev.bind(w),!0),l(R)))return R;for(;R=Mb(w.prev.bind(w),p);)if(l(R))return R}if(ry(i)){if(E&&(R=Mb(w.next.bind(w),!0),l(R)))return R;for(;R=Mb(w.next.bind(w),p);)if(l(R))return R}return null},bE=(n,i)=>{const l=p=>lu(p.dom),d=p=>p.dom===i;return li(Ye.fromDom(n),l,d).map(p=>p.dom).getOr(i)},lm=(n,i)=>{for(;n&&n!==i;){if(RC(n))return n;n=n.parentNode}return null},Nd=(n,i,l)=>lm(n.container(),l)===lm(i.container(),l),d0=(n,i)=>{if(!i)return de.none();const l=i.container(),d=i.offset();return uw(l)?de.from(l.childNodes[d+n]):de.none()},fw=(n,i)=>{var l;const p=((l=i.ownerDocument)!==null&&l!==void 0?l:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},h0=(n,i,l)=>lm(i,n)===lm(l,n),fg=(n,i,l)=>{const d=n?"previousSibling":"nextSibling";let p=l;for(;p&&p!==i;){let w=p[d];if(w&&lw(w)&&(w=w[d]),e1(w)||MC(w)){if(h0(i,w,p))return w;break}if(Ob(w))break;p=p.parentNode}return null},S=He(fw,!0),T=He(fw,!1),H=(n,i,l)=>{let d;const p=He(fg,!0,i),w=He(fg,!1,i),E=l.startContainer,R=l.startOffset;if(vi(E)){const B=pE(E)?E.parentNode:E,K=B.getAttribute("data-mce-caret");if(K==="before"&&(d=B.nextSibling,f0(d)))return S(d);if(K==="after"&&(d=B.previousSibling,f0(d)))return T(d)}if(!l.collapsed)return l;if(Sn(E)){if(lw(E)){if(n===1){if(d=w(E),d)return S(d);if(d=p(E),d)return T(d)}if(n===-1){if(d=p(E),d)return T(d);if(d=w(E),d)return S(d)}return l}if(lr(E)&&R>=E.data.length-1)return n===1&&(d=w(E),d)?S(d):l;if(sh(E)&&R<=1)return n===-1&&(d=p(E),d)?T(d):l;if(R===E.data.length)return d=w(E),d?S(d):l;if(R===0)return d=p(E),d?T(d):l}return l},le=(n,i)=>d0(n?0:-1,i).filter(e1),ke=(n,i,l)=>{const d=H(n,i,l);return n===-1?Vt.fromRangeStart(d):Vt.fromRangeEnd(d)},Ue=n=>de.from(n.getNode()).map(Ye.fromDom),ht=n=>de.from(n.getNode(!0)).map(Ye.fromDom),Ct=(n,i)=>{let l=i;for(;l=n(l);)if(l.isVisible())return l;return l},zt=(n,i)=>{const l=Nd(n,i);return!l&&ui(n.getNode())?!0:l};var pn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(pn||(pn={}));const $n=As,Vn=Sn,Fo=Qn,hs=ui,Ps=Sl,Hr=Kh,$s=Wg,fi=(n,i)=>{const l=[];let d=n;for(;d&&d!==i;)l.push(d),d=d.parentNode;return l},wi=(n,i)=>n.hasChildNodes()&&i<n.childNodes.length?n.childNodes[i]:null,cu=(n,i)=>{if(ry(n)){if(Ps(i.previousSibling)&&!Vn(i.previousSibling))return Vt.before(i);if(Vn(i))return Vt(i,0)}if(cp(n)){if(Ps(i.nextSibling)&&!Vn(i.nextSibling))return Vt.after(i);if(Vn(i))return Vt(i,i.data.length)}return cp(n)?hs(i)?Vt.before(i):Vt.after(i):Vt.before(i)},Ou=(n,i)=>{const l=i.nextSibling;return l&&Ps(l)?Vn(l)?Vt(l,0):Vt.before(l):Of(pn.Forwards,Vt.after(i),n)},Of=(n,i,l)=>{let d,p,w,E;if(!Fo(l)||!i)return null;if(i.isEqual(Vt.after(l))&&l.lastChild){if(E=Vt.after(l.lastChild),cp(n)&&Ps(l.lastChild)&&Fo(l.lastChild))return hs(l.lastChild)?Vt.before(l.lastChild):E}else E=i;const R=E.container();let B=E.offset();if(Vn(R)){if(cp(n)&&B>0)return Vt(R,--B);if(ry(n)&&B<R.length)return Vt(R,++B);d=R}else{if(cp(n)&&B>0&&(p=wi(R,B-1),Ps(p)))return!Hr(p)&&(w=wh(p,n,$s,p),w)?Vn(w)?Vt(w,w.data.length):Vt.after(w):Vn(p)?Vt(p,p.data.length):Vt.before(p);if(ry(n)&&B<R.childNodes.length&&(p=wi(R,B),Ps(p)))return hs(p)?Ou(l,p):!Hr(p)&&(w=wh(p,n,$s,p),w)?Vn(w)?Vt(w,0):Vt.before(w):Vn(p)?Vt(p,0):Vt.after(p);d=p||E.getNode()}if(d&&(ry(n)&&E.isAtEnd()||cp(n)&&E.isAtStart())&&(d=wh(d,n,gt,l,!0),$s(d,l)))return cu(n,d);p=d&&wh(d,n,$s,l);const K=It(wt(fi(R,l),$n));return K&&(!p||!K.contains(p))?(ry(n)?E=Vt.after(K):E=Vt.before(K),E):p?cu(n,p):null},ka=n=>({next:i=>Of(pn.Forwards,i,n),prev:i=>Of(pn.Backwards,i,n)}),cm=(n,i,l)=>{const d=n?Vt.before(l):Vt.after(l);return Pd(n,i,d)},ed=n=>ui(n)?Vt.before(n):Vt.after(n),dw=n=>Vt.isTextPosition(n)?n.offset()===0:Sl(n.getNode()),uu=n=>{if(Vt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Sl(n.getNode(!0))},NC=(n,i)=>!Vt.isTextPosition(n)&&!Vt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Rb=n=>!Vt.isTextPosition(n)&&ui(n.getNode()),Nb=(n,i,l)=>n?!NC(i,l)&&!Rb(i)&&uu(i)&&dw(l):!NC(l,i)&&dw(i)&&uu(l),Pd=(n,i,l)=>{const d=ka(i);return de.from(n?d.next(l):d.prev(l))},m0=(n,i,l)=>Pd(n,i,l).bind(d=>Nd(l,d,i)&&Nb(n,l,d)?Pd(n,i,d):de.some(d)),vE=(n,i,l,d)=>m0(n,i,l).bind(p=>d(p)?vE(n,i,p,d):de.some(p)),iy=(n,i)=>{const l=n?i.firstChild:i.lastChild;return Sn(l)?de.some(Vt(l,n?0:l.data.length)):l?Sl(l)?de.some(n?Vt.before(l):ed(l)):cm(n,i,l):de.none()},Mf=He(Pd,!0),Mu=He(Pd,!1),rl=He(iy,!0),Id=He(iy,!1),PC="_mce_caret",$c=n=>Qn(n)&&n.id===PC,g0=(n,i)=>{let l=i;for(;l&&l!==n;){if($c(l))return l;l=l.parentNode}return null},ay=n=>F(n.start),hw=n=>un(n,"rng"),yE=n=>un(n,"id"),wE=n=>un(n,"name"),t1=n=>hn.isArray(n.start),mw=n=>!wE(n)&&we(n.forward)?n.forward:!0,dg=(n,i)=>(Qn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='<br data-mce-bogus="1" />'),i),xO=(n,i)=>{const l=de.from(_b(n.getRoot(),i.start)),d=de.from(_b(n.getRoot(),i.end));return ni(l,d,(p,w)=>{const E=n.createRng();return E.setStart(p.container(),p.offset()),E.setEnd(w.container(),w.offset()),{range:E,forward:mw(i)}})},_E=(n,i)=>{var l;const p=((l=n.ownerDocument)!==null&&l!==void 0?l:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},i3=n=>!n.hasChildNodes(),kI=(n,i)=>Id(n).fold(qe,l=>(i.setStart(l.container(),l.offset()),i.setEnd(l.container(),l.offset()),!0)),a3=(n,i,l)=>i3(i)&&g0(n,i)?(_E(i,l),!0):!1,l3=(n,i,l,d)=>{const p=l[i?"start":"end"],w=n.getRoot();if(p){let E=w,R=p[0];for(let B=p.length-1;E&&B>=1;B--){const K=E.childNodes;if(a3(w,E,d))return!0;if(p[B]>K.length-1)return a3(w,E,d)?!0:kI(E,d);E=K[p[B]]}Sn(E)&&(R=Math.min(p[0],E.data.length)),Qn(E)&&(R=Math.min(p[0],E.childNodes.length)),i?d.setStart(E,R):d.setEnd(E,R)}return!0},CE=n=>Sn(n)&&n.data.length>0,SE=(n,i,l)=>{const d=n.get(l.id+"_"+i),p=d==null?void 0:d.parentNode,w=l.keep;if(d&&p){let E,R;if(i==="start"?w?d.hasChildNodes()?(E=d.firstChild,R=1):CE(d.nextSibling)?(E=d.nextSibling,R=0):CE(d.previousSibling)?(E=d.previousSibling,R=d.previousSibling.data.length):(E=p,R=n.nodeIndex(d)+1):(E=p,R=n.nodeIndex(d)):w?d.hasChildNodes()?(E=d.firstChild,R=1):CE(d.previousSibling)?(E=d.previousSibling,R=d.previousSibling.data.length):(E=p,R=n.nodeIndex(d)):(E=p,R=n.nodeIndex(d)),!w){const B=d.previousSibling,K=d.nextSibling;hn.each(hn.grep(d.childNodes),ue=>{Sn(ue)&&(ue.data=ue.data.replace(/\uFEFF/g,""))});let ie;for(;ie=n.get(l.id+"_"+i);)n.remove(ie,!0);if(Sn(K)&&Sn(B)&&!Xn.browser.isOpera()){const ue=B.data.length;B.appendData(K.data),n.remove(K),E=B,R=ue}}return de.some(Vt(E,R))}else return de.none()},kE=(n,i)=>{const l=n.createRng();return l3(n,!0,i,l)&&l3(n,!1,i,l)?de.some({range:l,forward:mw(i)}):de.none()},c3=(n,i)=>{const l=SE(n,"start",i),d=SE(n,"end",i);return ni(l,d.or(l),(p,w)=>{const E=n.createRng();return E.setStart(dg(n,p.container()),p.offset()),E.setEnd(dg(n,w.container()),w.offset()),{range:E,forward:mw(i)}})},u3=(n,i)=>de.from(n.select(i.name)[i.index]).map(l=>{const d=n.createRng();return d.selectNode(l),{range:d,forward:!0}}),f3=(n,i)=>{const l=n.dom;if(i){if(t1(i))return kE(l,i);if(ay(i))return xO(l,i);if(yE(i))return c3(l,i);if(wE(i))return u3(l,i);if(hw(i))return de.some({range:i.rng,forward:mw(i)})}return de.none()},TO=(n,i,l)=>iC(n,i,l),DO=(n,i)=>{f3(n,i).each(({range:l,forward:d})=>{n.setRng(l,d)})},Bd=n=>Qn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Ks=(n=>i=>n===i)(Gr),_h=n=>n!==""&&` \f
|
|
\r \v`.indexOf(n)!==-1,p0=n=>!_h(n)&&!Ks(n)&&!J0(n),EE=n=>({value:d3(n)}),d3=n=>fa(n,"#").toUpperCase(),ly=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},MO=n=>{const i=ly(n.red)+ly(n.green)+ly(n.blue);return EE(i)},AE=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,IC=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,gw=(n,i,l,d)=>({red:n,green:i,blue:l,alpha:d}),RO=(n,i,l,d)=>{const p=parseInt(n,10),w=parseInt(i,10),E=parseInt(l,10),R=parseFloat(d);return gw(p,w,E,R)},xE=n=>{if(n==="transparent")return de.some(gw(0,0,0,0));const i=AE.exec(n);if(i!==null)return de.some(RO(i[1],i[2],i[3],"1"));const l=IC.exec(n);return l!==null?de.some(RO(l[1],l[2],l[3],l[4])):de.none()},BC=n=>xE(n).map(MO).map(i=>"#"+i.value).getOr(n),TE=n=>{const i=[];if(n)for(let l=0;l<n.rangeCount;l++)i.push(n.getRangeAt(l));return i},EI=n=>Rs(n,i=>{const l=Q1(i);return l?[Ye.fromDom(l)]:[]}),h3=n=>TE(n).length>1,DE=n=>wt(EI(n),Vm),cy=n=>hl(n,"td[data-mce-selected],th[data-mce-selected]"),pw=(n,i)=>{const l=cy(i);return l.length>0?l:DE(n)},b0=n=>pw(TE(n.selection.getSel()),Ye.fromDom(n.getBody())),up=(n,i)=>Se(n,"table",i),m3=n=>{const i=n.startContainer,l=n.startOffset;return Sn(i)?l===0?de.some(Ye.fromDom(i)):de.none():de.from(i.childNodes[l]).map(Ye.fromDom)},NO=n=>{const i=n.endContainer,l=n.endOffset;return Sn(i)?l===i.data.length?de.some(Ye.fromDom(i)):de.none():de.from(i.childNodes[l-1]).map(Ye.fromDom)},g3=n=>oi(n).fold(et([n]),i=>[n].concat(g3(i))),OE=n=>_u(n).fold(et([n]),i=>Xr(i)==="br"?ya(i).map(l=>[n].concat(OE(l))).getOr([]):[n].concat(OE(i))),uy=(n,i)=>ni(m3(i),NO(i),(l,d)=>{const p=eo(g3(n),He(bt,l)),w=eo(OE(n),He(bt,d));return p.isSome()&&w.isSome()}).getOr(!1),ME=(n,i,l,d)=>{const p=l,w=new bi(l,p),E=Wt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,K)=>!St(["td","th","table"],K.toLowerCase()));let R=l;do{if(Sn(R)&&hn.trim(R.data).length!==0){d?i.setStart(R,0):i.setEnd(R,R.data.length);return}if(E[R.nodeName]){d?i.setStartBefore(R):R.nodeName==="BR"?i.setEndBefore(R):i.setEndAfter(R);return}}while(R=d?w.next():w.prev());p.nodeName==="BODY"&&(d?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},LC=n=>{const i=n.selection.getSel();return _e(i)&&i.rangeCount>0},RE=(n,i)=>{const l=b0(n);l.length>0?Be(l,d=>{const p=d.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},p3=(n,i,l)=>{const d=yr(n,i);l(d),n.moveToBookmark(d)},bw=n=>nt(n==null?void 0:n.nodeType),NE=n=>Qn(n)&&!Bd(n)&&!$c(n)&&!Cd(n),PO=(n,i)=>{if(NE(i)&&!/^(TD|TH)$/.test(i.nodeName)){const l=n.getAttrib(i,"data-mce-selected"),d=parseInt(l,10);return!isNaN(d)&&d>0}else return!1},um=n=>n.isContentEditable===!0,b3=(n,i,l)=>{const{selection:d,dom:p}=n,w=d.getNode(),E=As(w);p3(d,!0,()=>{i()}),E&&As(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):l(d.getStart())&&IO(p,d)},IO=(n,i)=>{var l,d;const p=i.getRng(),{startContainer:w,startOffset:E}=p,R=i.getNode();if(!PO(n,R)&&Qn(w)){const B=w.childNodes,K=n.getRoot();let ie;if(E<B.length){const ue=B[E];ie=new bi(ue,(l=n.getParent(ue,n.isBlock))!==null&&l!==void 0?l:K)}else{const ue=B[B.length-1];ie=new bi(ue,(d=n.getParent(ue,n.isBlock))!==null&&d!==void 0?d:K),ie.next(!0)}for(let ue=ie.current();ue;ue=ie.next()){if(n.getContentEditable(ue)==="false")return;if(Sn(ue)&&!Ql(ue)){p.setStart(ue,0),i.setRng(p);return}}}},Jn=(n,i,l)=>{if(n){const d=i?"nextSibling":"previousSibling";for(n=l?n:n[d];n;n=n[d])if(Qn(n)||!Ql(n))return n}},$l=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||Jm(n,i),fm=(n,i,l)=>n.schema.isValidChild(i,l),Ql=(n,i=!1)=>{if(_e(n)&&Sn(n)){const l=i?n.data.replace(/ /g,"\xA0"):n.data;return Zm(l)}else return!1},dm=n=>_e(n)&&Sn(n)&&n.length===0,v3=(n,i)=>{const l="[data-mce-cef-wrappable]",d=Sb(n),p=Qa(d)?l:`${l},${d}`;return wu(Ye.fromDom(i),p)},vw=(n,i)=>{const l=n.dom;return NE(i)&&l.getContentEditable(i)==="false"&&v3(n,i)&&l.select('[contenteditable="true"]',i).length===0},Ch=(n,i)=>ge(n)?n(i):(_e(i)&&(n=n.replace(/%(\w+)/g,(l,d)=>i[d]||l)),n),FC=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),yw=(n,i)=>{if(Te(n))return null;{let l=String(n);return(i==="color"||i==="backgroundColor")&&(l=BC(l)),i==="fontWeight"&&n===700&&(l="bold"),i==="fontFamily"&&(l=l.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),l}},ww=(n,i,l)=>{const d=n.getStyle(i,l);return yw(d,l)},PE=(n,i)=>{let l;return n.getParent(i,d=>Qn(d)?(l=n.getStyle(d,"text-decoration"),!!l&&l!=="none"):!1),l},_w=(n,i,l)=>n.getParents(i,l,n.getRoot()),HC=(n,i,l)=>{const d=n.formatter.get(i);return _e(d)&&Xt(d,l)},IE=(n,i)=>HC(n,i,d=>{const p=w=>ge(w)||w.length>1&&w.charAt(0)==="%";return Xt(["styles","attributes"],w=>po(d,w).exists(E=>{const R=se(E)?E:uo(E);return Xt(R,p)}))}),BO=(n,i,l)=>{const d=["inline","block","selector","attributes","styles","classes"],p=w=>Wt(w,(E,R)=>Xt(d,B=>B===R));return HC(n,i,w=>{const E=p(w);return HC(n,l,R=>{const B=p(R);return _o(E,B)})})},hm=n=>ns(n,"block"),$C=n=>hm(n)&&n.wrapper===!0,Cw=n=>hm(n)&&n.wrapper!==!0,td=n=>ns(n,"selector"),Tl=n=>ns(n,"inline"),BE=n=>td(n)&&Tl(n)&&qr(po(n,"mixed"),!0),Sw=n=>td(n)&&n.expand!==!1&&!Tl(n),Ld=Bd,kw=_w,LE=Ql,FE=$l,LO=n=>ui(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,y3=(n,i)=>{let l=i;for(;l;){if(Qn(l)&&n.getContentEditable(l))return n.getContentEditable(l)==="false"?l:i;l=l.parentNode}return i},Ew=(n,i,l,d)=>{const p=i.data;if(n){for(let w=l;w>0;w--)if(d(p.charAt(w-1)))return w}else for(let w=l;w<p.length;w++)if(d(p.charAt(w)))return w;return-1},w3=(n,i,l)=>Ew(n,i,l,d=>Ks(d)||_h(d)),FO=(n,i,l)=>Ew(n,i,l,p0),v0=(n,i,l,d,p,w)=>{let E;const R=n.getParent(l,n.isBlock)||i,B=(ie,ue,be)=>{const Le=op(n),je=p?Le.backwards:Le.forwards;return de.from(je(ie,ue,(Me,Ve)=>Ld(Me.parentNode)?-1:(E=Me,be(p,Me,Ve)),R))};return B(l,d,w3).bind(ie=>w?B(ie.container,ie.offset+(p?-1:0),FO):de.some(ie)).orThunk(()=>E?de.some({container:E,offset:p?0:E.length}):de.none())},zc=(n,i,l,d,p)=>{const w=d[p];Sn(d)&&Qa(d.data)&&w&&(d=w);const E=kw(n,d);for(let R=0;R<E.length;R++)for(let B=0;B<i.length;B++){const K=i[B];if(!(_e(K.collapsed)&&K.collapsed!==l.collapsed)&&td(K)&&n.is(E[R],K.selector))return E[R]}return d},Sh=(n,i,l,d)=>{var p;let w=l;const E=n.getRoot(),R=i[0];if(hm(R)&&(w=R.wrapper?null:n.getParent(l,R.block,E)),!w){const B=(p=n.getParent(l,"LI,TD,TH"))!==null&&p!==void 0?p:E;w=n.getParent(Sn(l)?l.parentNode:l,K=>K!==E&&FE(n.schema,K),B)}if(w&&hm(R)&&R.wrapper&&(w=kw(n,w,"ul,ol").reverse()[0]||w),!w)for(w=l;w&&w[d]&&!n.isBlock(w[d])&&(w=w[d],!FC(w,"br")););return w||l},Fd=(n,i,l,d)=>{const p=l.parentNode;return _e(l[d])?!1:p===i||Te(p)||n.isBlock(p)?!0:Fd(n,i,p,d)},nd=(n,i,l,d,p)=>{let w=l;const E=p?"previousSibling":"nextSibling",R=n.getRoot();if(Sn(l)&&!LE(l)&&(p?d>0:d<l.data.length))return l;for(;w;){if(!i[0].block_expand&&n.isBlock(w))return w;for(let B=w[E];B;B=B[E]){const K=Sn(B)&&!Fd(n,R,B,E);if(!Ld(B)&&!LO(B)&&!LE(B,K))return w}if(w===R||w.parentNode===R){l=w;break}w=w.parentNode}return l},zC=n=>Ld(n.parentNode)||Ld(n),Pb=(n,i,l,d=!1)=>{let{startContainer:p,startOffset:w,endContainer:E,endOffset:R}=i;const B=l[0];return Qn(p)&&p.hasChildNodes()&&(p=Xf(p,w),Sn(p)&&(w=0)),Qn(E)&&E.hasChildNodes()&&(E=Xf(E,i.collapsed?R:R-1),Sn(E)&&(R=E.data.length)),p=y3(n,p),E=y3(n,E),zC(p)&&(p=Ld(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,Sn(p)&&(w=i.collapsed?p.length:0)),zC(E)&&(E=Ld(E)?E:E.parentNode,i.collapsed?E=E.nextSibling||E:E=E.previousSibling||E,Sn(E)&&(R=i.collapsed?0:E.length)),i.collapsed&&(v0(n,n.getRoot(),p,w,!0,d).each(({container:ue,offset:be})=>{p=ue,w=be}),v0(n,n.getRoot(),E,R,!1,d).each(({container:ue,offset:be})=>{E=ue,R=be})),(Tl(B)||B.block_expand)&&((!Tl(B)||!Sn(p)||w===0)&&(p=nd(n,l,p,w,!0)),(!Tl(B)||!Sn(E)||R===E.data.length)&&(E=nd(n,l,E,R,!1))),Sw(B)&&(p=zc(n,l,i,p,"previousSibling"),E=zc(n,l,i,E,"nextSibling")),(hm(B)||td(B))&&(p=Sh(n,l,p,"previousSibling"),E=Sh(n,l,E,"nextSibling"),hm(B)&&(n.isBlock(p)||(p=nd(n,l,p,w,!0)),n.isBlock(E)||(E=nd(n,l,E,R,!1)))),Qn(p)&&p.parentNode&&(w=n.nodeIndex(p),p=p.parentNode),Qn(E)&&E.parentNode&&(R=n.nodeIndex(E)+1,E=E.parentNode),{startContainer:p,startOffset:w,endContainer:E,endOffset:R}},n1=(n,i,l)=>{var d;const p=i.startOffset,w=Xf(i.startContainer,p),E=i.endOffset,R=Xf(i.endContainer,E-1),B=Ve=>{const mt=Ve[0];Sn(mt)&&mt===w&&p>=mt.data.length&&Ve.splice(0,1);const vt=Ve[Ve.length-1];return E===0&&Ve.length>0&&vt===R&&Sn(vt)&&Ve.splice(Ve.length-1,1),Ve},K=(Ve,mt,vt)=>{const yt=[];for(;Ve&&Ve!==vt;Ve=Ve[mt])yt.push(Ve);return yt},ie=(Ve,mt)=>n.getParent(Ve,vt=>vt.parentNode===mt,mt),ue=(Ve,mt,vt)=>{const yt=vt?"nextSibling":"previousSibling";for(let Mt=Ve,dn=Mt.parentNode;Mt&&Mt!==mt;Mt=dn){dn=Mt.parentNode;const zn=K(Mt===Ve?Mt:Mt[yt],yt);zn.length&&(vt||zn.reverse(),l(B(zn)))}};if(w===R)return l(B([w]));const be=(d=n.findCommonAncestor(w,R))!==null&&d!==void 0?d:n.getRoot();if(n.isChildOf(w,R))return ue(w,be,!0);if(n.isChildOf(R,w))return ue(R,be);const Le=ie(w,be)||w,je=ie(R,be)||R;ue(w,Le,!0);const Me=K(Le===w?Le:Le.nextSibling,"nextSibling",je===R?je.nextSibling:je);Me.length&&l(B(Me)),ue(R,je)},HO=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],HE=n=>el(n)&&Ic(n)===Ft,$O=(n,i,l,d)=>ai(i).fold(()=>"skipping",p=>d==="br"||HE(i)?"valid":Bk(i)?"existing":$c(i.dom)?"caret":Xt(HO,w=>wu(i,w))?"valid-block":!fm(n,l,d)||!fm(n,Xr(p),l)?"invalid-child":"valid"),_3=(n,i)=>{const l=Pb(n.dom,i,[{inline:"span"}]);i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset),n.selection.setRng(i)},C3=(n,i,l,d,p,w)=>{const{uid:E=i,...R}=l;Uu(n,Yf()),Dr(n,`${jp()}`,E),Dr(n,`${Qu()}`,d);const{attributes:B={},classes:K=[]}=p(E,R);if(Vu(n,B),Pv(n,K),w){K.length>0&&Dr(n,`${mb()}`,K.join(","));const ie=gs(B);ie.length>0&&Dr(n,`${gb()}`,ie.join(","))}},S3=n=>{Nc(n,Yf()),zi(n,`${jp()}`),zi(n,`${Qu()}`),zi(n,`${X1()}`);const i=za(n,`${gb()}`).map(d=>d.split(",")).getOr([]),l=za(n,`${mb()}`).map(d=>d.split(",")).getOr([]);Be(i,d=>zi(n,d)),N2(n,l),zi(n,`${mb()}`),zi(n,`${gb()}`)},VC=(n,i,l,d,p)=>{const w=Ye.fromTag("span",n);return C3(w,i,l,d,p,!1),w},$E=(n,i,l,d,p,w)=>{const E=[],R=VC(n.getDoc(),l,w,d,p),B=mh(),K=()=>{B.clear()},ie=()=>B.get().getOrThunk(()=>{const je=ng(R);return E.push(je),B.set(je),je}),ue=je=>{Be(je,be)},be=je=>{switch($O(n,je,"span",Xr(je))){case"invalid-child":{K();const Ve=xa(je);ue(Ve),K();break}case"valid-block":{K(),C3(je,l,w,d,p,!0);break}case"valid":{const Ve=ie();j0(je,Ve);break}}},Le=je=>{const Me=Tt(je,Ye.fromDom);ue(Me)};return n1(n.dom,i,je=>{K(),Le(je)}),E},Ti=(n,i,l,d)=>{n.undoManager.transact(()=>{const p=n.selection,w=p.getRng(),E=b0(n).length>0,R=Ni("mce-annotation");if(w.collapsed&&!E&&_3(n,w),p.getRng().collapsed&&!E){const B=VC(n.getDoc(),R,d,i,l.decorate);_f(B,Gr),p.getRng().insertNode(B.dom),p.select(B.dom)}else p3(p,!1,()=>{RE(n,B=>{$E(n,B,R,i,l.decorate,d)})})})},o1=n=>{const i=Nv();s3(n,i);const l=K_(n,i),d=yc("span"),p=w=>{Be(w,E=>{d(E)?ql(E):S3(E)})};return{register:(w,E)=>{i.register(w,E)},annotate:(w,E)=>{i.lookup(w).each(R=>{Ti(n,w,R,E)})},annotationChanged:(w,E)=>{l.addListener(w,E)},remove:w=>{M2(n,de.some(w)).each(({elements:E})=>{const R=n.selection.getBookmark();p(E),n.selection.moveToBookmark(R)})},removeAll:w=>{const E=n.selection.getBookmark();ln(R2(n,w),(R,B)=>{p(R)}),n.selection.moveToBookmark(E)},getAll:w=>{const E=R2(n,w);return ps(E,R=>Tt(R,B=>B.dom))}}},fy=n=>({getBookmark:He(TO,n),moveToBookmark:He(DO,n)});fy.isBookmarkNode=Bd;const zE=(n,i,l)=>l.collapsed?!1:Xt(l.getClientRects(),d=>J1(d,n,i)),k3=(n,i)=>n.dispatch("PreProcess",i),VE=(n,i)=>n.dispatch("PostProcess",i),E3=n=>{n.dispatch("remove")},UC=n=>{n.dispatch("detach")},zO=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},VO=(n,i,l,d,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:l,height:d,origin:p})},A3=(n,i,l,d,p)=>{n.dispatch("ObjectResized",{target:i,width:l,height:d,origin:p})},UO=n=>{n.dispatch("PreInit")},UE=n=>{n.dispatch("PostRender")},dy=n=>{n.dispatch("Init")},hy=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},WC=(n,i,l)=>{n.dispatch(i,l)},x3=(n,i,l,d)=>{n.dispatch("FormatApply",{format:i,node:l,vars:d})},kh=(n,i,l,d)=>{n.dispatch("FormatRemove",{format:i,node:l,vars:d})},Vc=(n,i)=>n.dispatch("BeforeSetContent",i),fu=(n,i)=>n.dispatch("SetContent",i),fp=(n,i)=>n.dispatch("BeforeGetContent",i),WO=(n,i)=>n.dispatch("GetContent",i),jO=(n,i)=>{n.dispatch("AutocompleterStart",i)},ZO=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},sr=n=>{n.dispatch("AutocompleterEnd")},qO=(n,i,l)=>n.dispatch("PastePreProcess",{content:i,internal:l}),T3=(n,i,l)=>n.dispatch("PastePostProcess",{node:i,internal:l}),jC=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),GO=(n,i)=>n.dispatch("EditableRootStateChange",{state:i}),no={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:n=>n.shiftKey||n.ctrlKey||n.altKey||no.metaKeyPressed(n),metaKeyPressed:n=>Xn.os.isMacOS()||Xn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},Ib="data-mce-selected",KO="table,img,figure.image,hr,video,span.mce-preview-object,details",D3=Math.abs,ZC=Math.round,Aw={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},WE=n=>n.type==="longpress"||n.type.indexOf("touch")===0,jE=(n,i)=>{const l=i.dom,d=i.getDoc(),p=document,w=i.getBody();let E,R,B,K,ie,ue,be,Le,je,Me,Ve,mt,vt,yt,Mt,dn,zn;const Pn=Dn=>_e(Dn)&&(Ui(Dn)||l.is(Dn,"figure.image")),Lt=Dn=>qu(Dn)||l.hasClass(Dn,"mce-preview-object"),$t=(Dn,qo)=>{if(WE(Dn)){const Ys=Dn.touches[0];return Pn(Dn.target)&&!zE(Ys.clientX,Ys.clientY,qo)}else return Pn(Dn.target)&&!zE(Dn.clientX,Dn.clientY,qo)},wn=Dn=>{const qo=Dn.target;$t(Dn,i.selection.getRng())&&!Dn.isDefaultPrevented()&&i.selection.select(qo)},go=Dn=>l.hasClass(Dn,"mce-preview-object")&&_e(Dn.firstElementChild)?[Dn,Dn.firstElementChild]:l.is(Dn,"figure.image")?[Dn.querySelector("img")]:[Dn],Oo=Dn=>{const qo=Q2(i);return!qo||Dn.getAttribute("data-mce-resize")==="false"||Dn===i.getBody()?!1:l.hasClass(Dn,"mce-preview-object")&&_e(Dn.firstElementChild)?wu(Ye.fromDom(Dn.firstElementChild),qo):wu(Ye.fromDom(Dn),qo)},Cs=Dn=>Lt(Dn)?l.create("img",{src:Xn.transparentSrc}):Dn.cloneNode(!0),Us=(Dn,qo,Ys)=>{if(_e(Ys)){const Kr=go(Dn);Be(Kr,co=>{co.style[qo]||!i.schema.isValid(co.nodeName.toLowerCase(),qo)?l.setStyle(co,qo,Ys):l.setAttrib(co,qo,""+Ys)})}},Pr=(Dn,qo,Ys)=>{Us(Dn,"width",qo),Us(Dn,"height",Ys)},di=Dn=>{let qo,Ys,Kr,co,Ws;qo=Dn.screenX-ue,Ys=Dn.screenY-be,yt=qo*K[2]+Me,Mt=Ys*K[3]+Ve,yt=yt<5?5:yt,Mt=Mt<5?5:Mt,(Pn(E)||Lt(E))&&Sc(i)!==!1?Kr=!no.modifierPressed(Dn):Kr=no.modifierPressed(Dn),Kr&&(D3(qo)>D3(Ys)?(Mt=ZC(yt*mt),yt=ZC(Mt/mt)):(yt=ZC(Mt/mt),Mt=ZC(yt*mt))),Pr(R,yt,Mt),co=K.startPos.x+qo,Ws=K.startPos.y+Ys,co=co>0?co:0,Ws=Ws>0?Ws:0,l.setStyles(B,{left:co,top:Ws,display:"block"}),B.innerHTML=yt+" × "+Mt,K[2]<0&&R.clientWidth<=yt&&l.setStyle(R,"left",Le+(Me-yt)),K[3]<0&&R.clientHeight<=Mt&&l.setStyle(R,"top",je+(Ve-Mt)),qo=w.scrollWidth-dn,Ys=w.scrollHeight-zn,qo+Ys!==0&&l.setStyles(B,{left:co-qo,top:Ws-Ys}),vt||(VO(i,E,Me,Ve,"corner-"+K.name),vt=!0)},al=()=>{const Dn=vt;vt=!1,Dn&&(Us(E,"width",yt),Us(E,"height",Mt)),l.unbind(d,"mousemove",di),l.unbind(d,"mouseup",al),p!==d&&(l.unbind(p,"mousemove",di),l.unbind(p,"mouseup",al)),l.remove(R),l.remove(B),l.remove(ie),Rl(E),Dn&&(A3(i,E,yt,Mt,"corner-"+K.name),l.setAttrib(E,"style",l.getAttrib(E,"style"))),i.nodeChanged()},Rl=Dn=>{Is();const qo=l.getPos(Dn,w),Ys=qo.x,Kr=qo.y,co=Dn.getBoundingClientRect(),Ws=co.width||co.right-co.left,ii=co.height||co.bottom-co.top;E!==Dn&&(Mn(),E=Dn,yt=Mt=0);const Ya=i.dispatch("ObjectSelected",{target:Dn});Oo(Dn)&&!Ya.isDefaultPrevented()?ln(Aw,(Si,Ec)=>{const Mh=Cm=>{const Hy=go(E)[0];ue=Cm.screenX,be=Cm.screenY,Me=Hy.clientWidth,Ve=Hy.clientHeight,mt=Ve/Me,K=Si,K.name=Ec,K.startPos={x:Ws*Si[0]+Ys,y:ii*Si[1]+Kr},dn=w.scrollWidth,zn=w.scrollHeight,ie=l.add(w,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),l.setStyles(ie,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),R=Cs(E),l.addClass(R,"mce-clonedresizable"),l.setAttrib(R,"data-mce-bogus","all"),R.contentEditable="false",l.setStyles(R,{left:Ys,top:Kr,margin:0}),Pr(R,Ws,ii),R.removeAttribute(Ib),w.appendChild(R),l.bind(d,"mousemove",di),l.bind(d,"mouseup",al),p!==d&&(l.bind(p,"mousemove",di),l.bind(p,"mouseup",al)),B=l.add(w,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},Me+" × "+Ve)};let zd=l.get("mceResizeHandle"+Ec);zd&&l.remove(zd),zd=l.add(w,"div",{id:"mceResizeHandle"+Ec,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+Ec+"-resize; margin:0; padding:0"}),l.bind(zd,"mousedown",Cm=>{Cm.stopImmediatePropagation(),Cm.preventDefault(),Mh(Cm)}),Si.elm=zd,l.setStyles(zd,{left:Ws*Si[0]+Ys-zd.offsetWidth/2,top:ii*Si[1]+Kr-zd.offsetHeight/2})}):Mn(!1)},hc=hb(Rl,0),Mn=(Dn=!0)=>{hc.cancel(),Is(),E&&Dn&&E.removeAttribute(Ib),ln(Aw,(qo,Ys)=>{const Kr=l.get("mceResizeHandle"+Ys);Kr&&(l.unbind(Kr),l.remove(Kr))})},to=(Dn,qo)=>l.isChildOf(Dn,qo),wr=Dn=>{if(vt||i.removed||i.composing)return;const qo=Dn.type==="mousedown"?Dn.target:n.getNode(),Ys=rt(Ye.fromDom(qo),KO).map(co=>co.dom).filter(co=>l.isEditable(co.parentElement)).getOrUndefined(),Kr=_e(Ys)?l.getAttrib(Ys,Ib,"1"):"1";if(Be(l.select(`img[${Ib}],hr[${Ib}]`),co=>{co.removeAttribute(Ib)}),_e(Ys)&&to(Ys,w)&&i.hasFocus()){yo();const co=n.getStart(!0);if(to(co,Ys)&&to(n.getEnd(!0),Ys)){l.setAttrib(Ys,Ib,Kr),hc.throttle(Ys);return}}Mn()},Is=()=>{ln(Aw,Dn=>{Dn.elm&&(l.unbind(Dn.elm),delete Dn.elm)})},yo=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{yo(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",wr),i.on("keyup compositionend",Dn=>{E&&E.nodeName==="TABLE"&&wr(Dn)}),i.on("hide blur",Mn),i.on("contextmenu longpress",wn,!0)}),i.on("remove",Is),{isResizable:Oo,showResizeRect:Rl,hideResizeRect:Mn,updateResizeRect:wr,destroy:()=>{hc.cancel(),E=R=ie=null}}},YO=(n,i)=>{i.fold(l=>{n.setStartBefore(l.dom)},(l,d)=>{n.setStart(l.dom,d)},l=>{n.setStartAfter(l.dom)})},AI=(n,i)=>{i.fold(l=>{n.setEndBefore(l.dom)},(l,d)=>{n.setEnd(l.dom,d)},l=>{n.setEndAfter(l.dom)})},O3=(n,i,l)=>{const d=n.document.createRange();return YO(d,i),AI(d,l),d},M3=(n,i,l,d,p)=>{const w=n.document.createRange();return w.setStart(i.dom,l),w.setEnd(d.dom,p),w},qC=lg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),XO=(n,i,l)=>i(Ye.fromDom(l.startContainer),l.startOffset,Ye.fromDom(l.endContainer),l.endOffset),Xo=(n,i)=>i.match({domRange:l=>({ltr:et(l),rtl:de.none}),relative:(l,d)=>({ltr:jt(()=>O3(n,l,d)),rtl:jt(()=>de.some(O3(n,d,l)))}),exact:(l,d,p,w)=>({ltr:jt(()=>M3(n,l,d,p,w)),rtl:jt(()=>de.some(M3(n,p,w,l,d)))})}),JO=(n,i)=>{const l=i.ltr();return l.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>qC.rtl(Ye.fromDom(p.endContainer),p.endOffset,Ye.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>XO(n,qC.ltr,l)):XO(n,qC.ltr,l)},QO=(n,i)=>{const l=Xo(n,i);return JO(n,l)};qC.ltr,qC.rtl;const xw={create:(n,i,l,d)=>({start:n,soffset:i,finish:l,foffset:d})},GC=(n,i,l)=>{var d,p;return de.from((p=(d=n.dom).caretPositionFromPoint)===null||p===void 0?void 0:p.call(d,i,l)).bind(w=>{if(w.offsetNode===null)return de.none();const E=n.dom.createRange();return E.setStart(w.offsetNode,w.offset),E.collapse(),de.some(E)})},eM=(n,i,l)=>{var d,p;return de.from((p=(d=n.dom).caretRangeFromPoint)===null||p===void 0?void 0:p.call(d,i,l))},tM=(()=>document.caretPositionFromPoint?GC:document.caretRangeFromPoint?eM:de.none)(),nM=(n,i,l)=>{const d=Ye.fromDom(n.document);return tM(d,i,l).map(p=>xw.create(Ye.fromDom(p.startContainer),p.startOffset,Ye.fromDom(p.endContainer),p.endOffset))},Tw=lg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ZE=(n,i,l,d)=>n.fold(i,l,d),R3=n=>n.fold(Et,Et,Et),qE=Tw.before,GE=Tw.on,N3=Tw.after,s1={before:qE,on:GE,after:N3,cata:ZE,getStart:R3},my=lg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),KE=n=>my.exact(n.start,n.soffset,n.finish,n.foffset),oM=n=>n.match({domRange:i=>Ye.fromDom(i.startContainer),relative:(i,l)=>s1.getStart(i),exact:(i,l,d,p)=>i}),sM=my.domRange,Nr=my.relative,YE=my.exact,dp=n=>{const i=oM(n);return Wr(i)},hp=xw.create,r1={domRange:sM,relative:Nr,exact:YE,exactFromRange:KE,getWin:dp,range:hp},Ru=(n,i)=>{const l=Xr(n);return l==="input"?s1.after(n):St(["br","img"],l)?i===0?s1.before(n):s1.after(n):s1.on(n,i)},KC=(n,i)=>{const l=n.fold(s1.before,Ru,s1.after),d=i.fold(s1.before,Ru,s1.after);return r1.relative(l,d)},gy=(n,i,l,d)=>{const p=Ru(n,i),w=Ru(l,d);return r1.relative(p,w)},YC=n=>n.match({domRange:i=>{const l=Ye.fromDom(i.startContainer),d=Ye.fromDom(i.endContainer);return gy(l,i.startOffset,d,i.endOffset)},relative:KC,exact:gy}),Bb=(n,i)=>{const d=(i||document).createDocumentFragment();return Be(n,p=>{d.appendChild(p.dom)}),Ye.fromDom(d)},rM=n=>{const i=r1.getWin(n).dom,l=(p,w,E,R)=>M3(i,p,w,E,R),d=YC(n);return QO(i,d).match({ltr:l,rtl:l})},TI=(n,i,l)=>nM(n,i,l),iM=(n,i,l)=>{const d=Wr(Ye.fromDom(l));return TI(d.dom,n,i).map(p=>{const w=l.createRange();return w.setStart(p.start.dom,p.soffset),w.setEnd(p.finish.dom,p.foffset),w}).getOrUndefined()},P3=(n,i)=>_e(n)&&_e(i)&&n.startContainer===i.startContainer&&n.startOffset===i.startOffset&&n.endContainer===i.endContainer&&n.endOffset===i.endOffset,rr=(n,i,l)=>{let d=n;for(;d&&d!==i;){if(l(d))return d;d=d.parentNode}return null},mm=(n,i,l)=>rr(n,i,l)!==null,py=(n,i,l)=>mm(n,i,d=>d.nodeName===l),aM=(n,i)=>vr(n)&&!mm(n,i,$c),Lb=(n,i,l)=>{const d=i.parentNode;if(d){const p=new bi(i,n.getParent(d,n.isBlock)||n.getRoot());let w;for(;w=p[l?"prev":"next"]();)if(ui(w))return!0}return!1},cr=(n,i)=>{var l;return((l=n.previousSibling)===null||l===void 0?void 0:l.nodeName)===i},lM=(n,i)=>{let l=i;for(;l&&l!==n;){if(As(l))return!0;l=l.parentNode}return!1},XC=(n,i,l,d,p)=>{const w=n.getRoot(),E=n.schema.getNonEmptyElements(),R=p.parentNode;let B,K;if(!R)return de.none();const ie=n.getParent(R,n.isBlock)||w;if(d&&ui(p)&&i&&n.isEmpty(ie))return de.some(Vt(R,n.nodeIndex(p)));const ue=new bi(p,ie);for(;K=ue[d?"prev":"next"]();){if(n.getContentEditableParent(K)==="false"||aM(K,w))return de.none();if(Sn(K)&&K.data.length>0)return py(K,w,"A")?de.none():de.some(Vt(K,d?K.data.length:0));if(n.isBlock(K)||E[K.nodeName.toLowerCase()])return de.none();B=K}return th(B)?de.none():l&&B?de.some(Vt(B,0)):de.none()},JC=(n,i,l,d)=>{const p=n.getRoot();let w,E=!1,R=l?d.startContainer:d.endContainer,B=l?d.startOffset:d.endOffset;const K=Qn(R)&&B===R.childNodes.length,ie=n.schema.getNonEmptyElements();let ue=l;if(vr(R))return de.none();if(Qn(R)&&B>R.childNodes.length-1&&(ue=!1),Zu(R)&&(R=p,B=0),R===p){if(ue&&(w=R.childNodes[B>0?B-1:0],w&&(vr(w)||ie[w.nodeName]||Eu(w))))return de.none();if(R.hasChildNodes()){if(B=Math.min(!ue&&B>0?B-1:B,R.childNodes.length-1),R=R.childNodes[B],B=Sn(R)&&K?R.data.length:0,!i&&R===p.lastChild&&Eu(R)||lM(p,R)||vr(R))return de.none();if(R.hasChildNodes()&&!Eu(R)){w=R;const be=new bi(R,p);do{if(As(w)||vr(w)){E=!1;break}if(Sn(w)&&w.data.length>0){B=ue?0:w.data.length,R=w,E=!0;break}if(ie[w.nodeName.toLowerCase()]&&!Cl(w)){B=n.nodeIndex(w),R=w.parentNode,ue||B++,E=!0;break}}while(w=ue?be.next():be.prev())}}}return i&&(Sn(R)&&B===0&&XC(n,K,i,!0,R).each(be=>{R=be.container(),B=be.offset(),E=!0}),Qn(R)&&(w=R.childNodes[B],w||(w=R.childNodes[B-1]),w&&ui(w)&&!cr(w,"A")&&!Lb(n,w,!1)&&!Lb(n,w,!0)&&XC(n,K,i,!0,w).each(be=>{R=be.container(),B=be.offset(),E=!0}))),ue&&!i&&Sn(R)&&B===R.data.length&&XC(n,K,i,!1,R).each(be=>{R=be.container(),B=be.offset(),E=!0}),E&&R?de.some(Vt(R,B)):de.none()},QC=(n,i)=>{const l=i.collapsed,d=i.cloneRange(),p=Vt.fromRangeStart(i);return JC(n,l,!0,d).each(w=>{(!l||!Vt.isAbove(p,w))&&d.setStart(w.container(),w.offset())}),l||JC(n,l,!1,d).each(w=>{d.setEnd(w.container(),w.offset())}),l&&d.collapse(!0),P3(i,d)?de.none():de.some(d)},i1=(n,i)=>n.splitText(i),mp=n=>{let i=n.startContainer,l=n.startOffset,d=n.endContainer,p=n.endOffset;if(i===d&&Sn(i)){if(l>0&&l<i.data.length)if(d=i1(i,l),i=d.previousSibling,p>l){p=p-l;const w=i1(d,p).previousSibling;i=d=w,p=w.data.length,l=0}else p=0}else if(Sn(i)&&l>0&&l<i.data.length&&(i=i1(i,l),l=0),Sn(d)&&p>0&&p<d.data.length){const w=i1(d,p).previousSibling;d=w,p=w.data.length}return{startContainer:i,startOffset:l,endContainer:d,endOffset:p}},y=n=>({walk:(w,E)=>n1(n,w,E),split:mp,expand:(w,E={type:"word"})=>{if(E.type==="word"){const R=Pb(n,w,[{inline:"span"}]),B=n.createRng();return B.setStart(R.startContainer,R.startOffset),B.setEnd(R.endContainer,R.endOffset),B}return w},normalize:w=>QC(n,w).fold(qe,E=>(w.setStart(E.startContainer,E.startOffset),w.setEnd(E.endContainer,E.endOffset),!0))});y.compareRanges=P3,y.getCaretRangeFromPoint=iM,y.getSelectedNode=Q1,y.getNode=Xf;const D=((n,i)=>{const l=(R,B)=>{if(!nt(B)&&!B.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+B);const K=R.dom;os(K)&&(K.style[n]=B+"px")},d=R=>{const B=i(R);if(B<=0||B===null){const K=Ri(R,n);return parseFloat(K)||0}return B},p=d,w=(R,B)=>vn(B,(K,ie)=>{const ue=Ri(R,ie),be=ue===void 0?0:parseInt(ue,10);return isNaN(be)?K:K+be},0);return{set:l,get:d,getOuter:p,aggregate:w,max:(R,B,K)=>{const ie=w(R,K);return B>ie?B-ie:0}}})("height",n=>{const i=n.dom;return yd(n)?i.getBoundingClientRect().height:i.offsetHeight}),P=n=>D.get(n),Z=()=>Ye.fromDom(document),ne=(n,i)=>n.view(i).fold(et([]),d=>{const p=n.owner(d),w=ne(n,p);return[d].concat(w)}),pe=(n,i)=>{const l=i.owner(n);return ne(i,l)};var ot=Object.freeze({__proto__:null,view:n=>{var i;return(n.dom===document?de.none():de.from((i=n.dom.defaultView)===null||i===void 0?void 0:i.frameElement)).map(Ye.fromDom)},owner:n=>To(n)});const _t=n=>{const i=Z(),l=ju(i),d=pe(n,ot),p=ku(n),w=Yt(d,(E,R)=>{const B=ku(R);return{left:E.left+B.left,top:E.top+B.top}},{left:0,top:0});return zg(w.left+p.left+l.left,w.top+p.top+l.top)},fn=n=>Xr(n)==="textarea",Gn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Un=(n,i)=>{n.dispatch("AfterScrollIntoView",i)},tn=(n,i)=>{const l=xa(n);if(l.length===0||fn(n))return{element:n,offset:i};if(i<l.length&&!fn(l[i]))return{element:l[i],offset:0};{const d=l[l.length-1];return fn(d)?{element:n,offset:i}:Xr(d)==="img"?{element:d,offset:1}:el(d)?{element:d,offset:Ic(d).length}:{element:d,offset:xa(d).length}}},Wn=(n,i)=>{const l=h2(n),d=P(n);return{element:n,bottom:l.top+d,height:d,pos:l,cleanup:i}},Jt=(n,i)=>{const l=tn(n,i),d=Ye.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+Ft+"</span>");return wa(l.element,d),Wn(d,()=>br(d))},mo=n=>Wn(Ye.fromDom(n),ft),as=(n,i,l,d)=>{vl(n,(p,w)=>aa(n,i,l,d),l)},Ts=(n,i,l,d,p)=>{const w={elm:d.element.dom,alignToTop:p};if(Gn(n,w))return;const E=ju(i).top;l(n,i,E,d,p),Un(n,w)},aa=(n,i,l,d)=>{const p=Ye.fromDom(n.getBody()),w=Ye.fromDom(n.getDoc());Vi(p);const E=Jt(Ye.fromDom(l.startContainer),l.startOffset);Ts(n,w,i,E,d),E.cleanup()},Dl=(n,i,l,d)=>{const p=Ye.fromDom(n.getDoc());Ts(n,p,l,mo(i),d)},vl=(n,i,l)=>{const d=l.startContainer,p=l.startOffset,w=l.endContainer,E=l.endOffset;i(Ye.fromDom(d),Ye.fromDom(w));const R=n.dom.createRng();R.setStart(d,p),R.setEnd(w,E),n.selection.setRng(l)},Nu=(n,i,l,d,p)=>{const w=i.pos;if(d)q0(w.left,w.top,p);else{const E=w.top-l+i.height;q0(-n.getBody().getBoundingClientRect().left,E,p)}},Fb=(n,i,l,d,p,w)=>{const E=d+l,R=p.pos.top,B=p.bottom,K=B-R>=d;R<l?Nu(n,p,d,w!==!1,i):R>E?Nu(n,p,d,K?w!==!1:w===!0,i):B>E&&!K&&Nu(n,p,d,w===!0,i)},Dw=(n,i,l,d,p)=>{const w=Wr(i).dom.innerHeight;Fb(n,i,l,w,d,p)},eS=(n,i,l,d,p)=>{const w=Wr(i).dom.innerHeight;Fb(n,i,l,w,d,p);const E=_t(d.element),R=jf(window);E.top<R.y?G0(d.element,p!==!1):E.top>R.bottom&&G0(d.element,p===!0)},tS=(n,i,l)=>as(n,Dw,i,l),_i=(n,i,l)=>Dl(n,i,Dw,l),Pu=(n,i,l)=>as(n,eS,i,l),af=(n,i,l)=>Dl(n,i,eS,l),gm=(n,i,l)=>{(n.inline?_i:af)(n,i,l)},lf=(n,i,l)=>{(n.inline?tS:Pu)(n,i,l)},Hb=n=>n.dom.focus(),Iu=n=>{const i=jl(n).dom;return n.dom===i.activeElement},Ow=(n=Z())=>de.from(n.dom.activeElement).map(Ye.fromDom),Mw=n=>Ow(jl(n)).filter(i=>n.dom.contains(i.dom)),hg=(n,i)=>{const l=el(i)?Ic(i).length:xa(i).length+1;return n>l?l:n<0?0:n},dc=n=>r1.range(n.start,hg(n.soffset,n.start),n.finish,hg(n.foffset,n.finish)),XE=(n,i)=>!_d(i.dom)&&(cn(n,i)||bt(n,i)),I3=n=>i=>XE(n,i.start)&&XE(n,i.finish),B3=n=>n.inline||Xn.browser.isFirefox(),L3=n=>r1.range(Ye.fromDom(n.startContainer),n.startOffset,Ye.fromDom(n.endContainer),n.endOffset),cM=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?de.none():de.from(i.getRangeAt(0))).map(L3)},JE=n=>{const i=Wr(n);return cM(i.dom).filter(I3(n))},uM=(n,i)=>de.from(i).filter(I3(n)).map(dc),Rw=n=>{const i=document.createRange();try{return i.setStart(n.start.dom,n.soffset),i.setEnd(n.finish.dom,n.foffset),de.some(i)}catch{return de.none()}},fM=n=>{const i=B3(n)?JE(Ye.fromDom(n.getBody())):de.none();n.bookmark=i.isSome()?i:n.bookmark},F3=n=>(n.bookmark?n.bookmark:de.none()).bind(l=>uM(Ye.fromDom(n.getBody()),l)).bind(Rw),DI=n=>{F3(n).each(i=>n.selection.setRng(i))},OI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},vU=(n,i)=>(nt(i)||(i=0),setTimeout(n,i)),hM=(n,i)=>(nt(i)||(i=0),setInterval(n,i)),mg={setEditorTimeout:(n,i,l)=>vU(()=>{n.removed||i()},l),setEditorInterval:(n,i,l)=>{const d=hM(()=>{n.removed?clearInterval(d):i()},l);return d}},MI=n=>n.type==="nodechange"&&n.selectionChange,RI=(n,i)=>{const l=()=>{i.throttle()};Lr.DOM.bind(document,"mouseup",l),n.on("remove",()=>{Lr.DOM.unbind(document,"mouseup",l)})},NI=(n,i)=>{n.on("mouseup touchend",l=>{i.throttle()})},yU=(n,i)=>{NI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",l=>{MI(l)||fM(n)})},wU=n=>{const i=hb(()=>{fM(n)},0);n.on("init",()=>{n.inline&&RI(n,i),yU(n,i)}),n.on("remove",()=>{i.cancel()})};let nS;const mM=Lr.DOM,H3=n=>Qn(n)&&OI.isEditorUIElement(n),$3=n=>{const i=n.classList;return i!==void 0?i.contains("tox-edit-area")||i.contains("tox-edit-area__iframe")||i.contains("mce-content-body"):!1},QE=(n,i)=>{const l=pC(n);return mM.getParent(i,p=>H3(p)||(l?n.dom.is(p,l):!1))!==null},z3=n=>{try{const i=jl(Ye.fromDom(n.getElement()));return Ow(i).fold(()=>document.body,l=>l.dom)}catch{return document.body}},PI=(n,i)=>{const l=i.editor;wU(l);const d=(p,w)=>{if(TC(p)&&p.inline!==!0){const E=Ye.fromDom(p.getContainer());w(E,"tox-edit-focus")}};l.on("focusin",()=>{const p=n.focusedEditor;$3(z3(l))&&d(l,Uu),p!==l&&(p&&p.dispatch("blur",{focusedEditor:l}),n.setActive(l),n.focusedEditor=l,l.dispatch("focus",{blurredEditor:p}),l.focus(!0))}),l.on("focusout",()=>{mg.setEditorTimeout(l,()=>{const p=n.focusedEditor;(!$3(z3(l))||p!==l)&&d(l,Nc),!QE(l,z3(l))&&p===l&&(l.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),nS||(nS=p=>{const w=n.activeEditor;w&&qh(p).each(E=>{const R=E;R.ownerDocument===document&&R!==document.body&&!QE(w,R)&&n.focusedEditor===w&&(w.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},mM.bind(document,"focusin",nS))},_U=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&nS&&(mM.unbind(document,"focusin",nS),nS=null)},CU=n=>{n.on("AddEditor",He(PI,n)),n.on("RemoveEditor",He(_U,n))},SU=(n,i)=>n.dom.getParent(i,l=>n.dom.getContentEditable(l)==="true"),kU=n=>n.collapsed?de.from(Xf(n.startContainer,n.startOffset)).map(Ye.fromDom):de.none(),EU=(n,i)=>kU(i).bind(l=>qa(l)?de.some(l):cn(n,l)?de.none():de.some(n)),II=(n,i)=>{EU(Ye.fromDom(n.getBody()),i).bind(l=>rl(l.dom)).fold(()=>{n.selection.normalize()},l=>n.selection.setRng(l.toRange()))},gM=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},AU=n=>Iu(n)||Mw(n).isSome(),xU=n=>_e(n.iframeElement)&&Iu(Ye.fromDom(n.iframeElement)),TU=n=>{const i=n.getBody();return i&&AU(Ye.fromDom(i))},DU=n=>{const i=jl(Ye.fromDom(n.getElement()));return Ow(i).filter(l=>!$3(l.dom)&&QE(n,l.dom)).isSome()},Nw=n=>n.inline?TU(n):xU(n),V3=n=>Nw(n)||DU(n),BI=n=>{const i=n.selection,l=n.getBody();let d=i.getRng();n.quirks.refreshContentEditable(),_e(n.bookmark)&&!Nw(n)&&F3(n).each(w=>{n.selection.setRng(w),d=w});const p=SU(n,i.getNode());if(p&&n.dom.isChildOf(p,l)){gM(p),II(n,d),U3(n);return}n.inline||(Xn.browser.isOpera()||gM(l),n.getWin().focus()),(Xn.browser.isFirefox()||n.inline)&&(gM(l),II(n,d)),U3(n)},U3=n=>n.editorManager.setActive(n),OU=(n,i)=>{n.removed||(i?U3(n):BI(n))},LI=(n,i,l,d,p)=>{const w=l?i.startContainer:i.endContainer,E=l?i.startOffset:i.endOffset;return de.from(w).map(Ye.fromDom).map(R=>!d||!i.collapsed?Wu(R,p(R,E)).getOr(R):R).bind(R=>_l(R)?de.some(R):ai(R).filter(_l)).map(R=>R.dom).getOr(n)},FI=(n,i,l=!1)=>LI(n,i,!0,l,(d,p)=>Math.min(ic(d),p)),HI=(n,i,l=!1)=>LI(n,i,!1,l,(d,p)=>p>0?p-1:p),$I=(n,i)=>{const l=n;for(;n&&Sn(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||l},MU=(n,i)=>{if(!i)return n;let l=i.startContainer,d=i.endContainer;const p=i.startOffset,w=i.endOffset;let E=i.commonAncestorContainer;i.collapsed||(l===d&&w-p<2&&l.hasChildNodes()&&(E=l.childNodes[p]),Sn(l)&&Sn(d)&&(l.length===p?l=$I(l.nextSibling,!0):l=l.parentNode,w===0?d=$I(d.previousSibling,!1):d=d.parentNode,l&&l===d&&(E=l)));const R=Sn(E)?E.parentNode:E;return Qn(R)?R:n},zI=(n,i,l,d)=>{const p=[],w=n.getRoot(),E=n.getParent(l||FI(w,i,i.collapsed),n.isBlock),R=n.getParent(d||HI(w,i,i.collapsed),n.isBlock);if(E&&E!==w&&p.push(E),E&&R&&E!==R){let B;const K=new bi(E,w);for(;(B=K.next())&&B!==R;)n.isBlock(B)&&p.push(B)}return R&&E!==R&&R!==w&&p.push(R),p},RU=(n,i,l)=>de.from(i).bind(d=>de.from(d.parentNode).map(p=>{const w=n.nodeIndex(d),E=n.createRng();return E.setStart(p,w),E.setEnd(p,w+1),l&&(ME(n,E,d,!0),ME(n,E,d,!1)),E})),W3=(n,i)=>Tt(i,l=>{const d=n.dispatch("GetSelectionRange",{range:l});return d.range!==l?d.range:l}),VI=n=>Xr(n)==="img"?1:Zf(n).fold(()=>xa(n).length,i=>i.length),NU=n=>Zf(n).filter(i=>i.trim().length!==0||i.indexOf(Gr)>-1).isSome(),PU=n=>xi(n)&&Pl(n,"contenteditable")==="false",IU=["img","br"],UI=n=>NU(n)||St(IU,Xr(n))||PU(n),BU=n=>ce(n,UI),LU=n=>FU(n,UI),FU=(n,i)=>{const l=d=>{const p=xa(d);for(let w=p.length-1;w>=0;w--){const E=p[w];if(i(E))return de.some(E);const R=l(E);if(R.isSome())return R}return de.none()};return l(n)},WI="[data-mce-autocompleter]",HU=(n,i)=>{if(jI(Ye.fromDom(n.getBody())).isNone()){const l=Ye.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',n.getDoc());Qi(l,Ye.fromDom(i.extractContents())),i.insertNode(l.dom),ai(l).each(d=>d.dom.normalize()),LU(l).map(d=>{n.selection.setCursorLocation(d.dom,VI(d))})}},$U=n=>rt(n,WI),jI=n=>Xe(n,WI),zU=(n,i)=>jI(i).each(l=>{const d=n.selection.getBookmark();ql(l),n.selection.moveToBookmark(d)}),VU={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},j3=(n,i,l)=>{const d=l?"lastChild":"firstChild",p=l?"prev":"next";if(n[d])return n[d];if(n!==i){let w=n[p];if(w)return w;for(let E=n.parent;E&&E!==i;E=E.parent)if(w=E[p],w)return w}},UU=n=>{var i;const l=(i=n.value)!==null&&i!==void 0?i:"";if(!Zm(l))return!1;const d=n.parent;return!(d&&(d.name!=="span"||d.attr("style"))&&/^[ ]+$/.test(l))},ZI=n=>{const i=n.name==="a"&&!n.attr("href")&&n.attr("id");return n.attr("name")||n.attr("id")&&!n.firstChild||n.attr("data-mce-bookmark")||i};class Hd{static create(i,l){const d=new Hd(i,VU[i]||1);return l&&ln(l,(p,w)=>{d.attr(w,p)}),d}constructor(i,l){this.name=i,this.type=l,l===1&&(this.attributes=[],this.attributes.map={})}replace(i){const l=this;return i.parent&&i.remove(),l.insert(i,l),l.remove(),l}attr(i,l){const d=this;if(!F(i))return _e(i)&&ln(i,(w,E)=>{d.attr(E,w)}),d;const p=d.attributes;if(p){if(l!==void 0){if(l===null){if(i in p.map){delete p.map[i];let w=p.length;for(;w--;)if(p[w].name===i)return p.splice(w,1),d}return d}if(i in p.map){let w=p.length;for(;w--;)if(p[w].name===i){p[w].value=l;break}}else p.push({name:i,value:l});return p.map[i]=l,d}return p.map[i]}}clone(){const i=this,l=new Hd(i.name,i.type),d=i.attributes;if(d){const p=[];p.map={};for(let w=0,E=d.length;w<E;w++){const R=d[w];R.name!=="id"&&(p[p.length]={name:R.name,value:R.value},p.map[R.name]=R.value)}l.attributes=p}return l.value=i.value,l}wrap(i){const l=this;return l.parent&&(l.parent.insert(i,l),i.append(l)),l}unwrap(){const i=this;for(let l=i.firstChild;l;){const d=l.next;i.insert(l,i,!0),l=d}i.remove()}remove(){const i=this,l=i.parent,d=i.next,p=i.prev;return l&&(l.firstChild===i?(l.firstChild=d,d&&(d.prev=null)):p&&(p.next=d),l.lastChild===i?(l.lastChild=p,p&&(p.next=null)):d&&(d.prev=p),i.parent=i.next=i.prev=null),i}append(i){const l=this;i.parent&&i.remove();const d=l.lastChild;return d?(d.next=i,i.prev=d,l.lastChild=i):l.lastChild=l.firstChild=i,i.parent=l,i}insert(i,l,d){i.parent&&i.remove();const p=l.parent||this;return d?(l===p.firstChild?p.firstChild=i:l.prev&&(l.prev.next=i),i.prev=l.prev,i.next=l,l.prev=i):(l===p.lastChild?p.lastChild=i:l.next&&(l.next.prev=i),i.next=l.next,i.prev=l,l.next=i),i.parent=p,i}getAll(i){const l=this,d=[];for(let p=l.firstChild;p;p=j3(p,l))p.name===i&&d.push(p);return d}children(){const i=this,l=[];for(let d=i.firstChild;d;d=d.next)l.push(d);return l}empty(){const i=this;if(i.firstChild){const l=[];for(let p=i.firstChild;p;p=j3(p,i))l.push(p);let d=l.length;for(;d--;){const p=l[d];p.parent=p.firstChild=p.lastChild=p.next=p.prev=null}}return i.firstChild=i.lastChild=null,i}isEmpty(i,l={},d){var p;const w=this;let E=w.firstChild;if(ZI(w))return!1;if(E)do{if(E.type===1){if(E.attr("data-mce-bogus"))continue;if(i[E.name]||ZI(E))return!1}if(E.type===8||E.type===3&&!UU(E)||E.type===3&&E.parent&&l[E.parent.name]&&Zm((p=E.value)!==null&&p!==void 0?p:"")||d&&d(E))return!1}while(E=j3(E,w));return!0}walk(i){return j3(this,null,i)}}const WU=(n,i)=>/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(n.substr(i)),qI=(n,i,l=0)=>{const d=n.toLowerCase();if(d.indexOf("[if ",l)!==-1&&WU(d,l)){const p=d.indexOf("[endif]",l);return d.indexOf(">",p)}else if(i){const p=d.indexOf(">",l);return p!==-1?p:d.length}else{const p=/--!?>/g;p.lastIndex=l;const w=p.exec(n);return w?w.index+w[0].length:d.length}},Io=(n,i,l)=>{const d=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,w=n.getVoidElements();let E=1,R=l;for(;E!==0;)for(d.lastIndex=R;;){const B=d.exec(i);if(B===null)return R;if(B[1]==="!"){xr(B[2],"--")?R=qI(i,!1,B.index+3):R=qI(i,!0,B.index+1);break}else{p.lastIndex=d.lastIndex;const K=p.exec(i);if(X(K)||K.index!==d.lastIndex)continue;B[1]==="/"?E-=1:un(w,B[2])||(E+=1),R=d.lastIndex+K[0].length;break}}return R},GI=(n,i)=>{const l=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(l,"")},pM=(n,i)=>{const l=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=n.schema;let p=GI(n.getTempAttrs(),i);const w=d.getVoidElements();let E;for(;E=l.exec(p);){const R=l.lastIndex,B=E[0].length;let K;w[E[1]]?K=R:K=Io(d,p,R),p=p.substring(0,R-B)+p.substring(K),l.lastIndex=R-B}return Ln(p)},jU=pM,Z3=n=>{const i=hl(n,"[data-mce-bogus]");Be(i,l=>{Pl(l,"data-mce-bogus")==="all"?br(l):Xc(l)?(wa(l,Ye.fromText(Qt)),br(l)):ql(l)})},KI=n=>{const i=hl(n,"input");Be(i,l=>{zi(l,"name")})},ZU=(n,i)=>{const l=Hc(n),d=new RegExp(`^(<${l}[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/${l}>[\r
|
|
]*|<br \\/>[\r
|
|
]*)$`);return i.replace(d,"")},qU=(n,i)=>{const l=n.getDoc(),d=jl(Ye.fromDom(n.getBody())),p=Ye.fromTag("div",l);Dr(p,"data-mce-bogus","all"),ra(p,{position:"fixed",left:"-9999999px",top:"0"}),_f(p,i.innerHTML),Z3(p),KI(p);const w=H1(d);Qi(w,p);const E=Ln(p.dom.innerText);return br(p),E},GU=(n,i,l)=>{let d;return i.format==="raw"?d=hn.trim(jU(n.serializer,l.innerHTML)):i.format==="text"?d=qU(n,l):i.format==="tree"?d=n.serializer.serialize(l,i):d=ZU(n,n.serializer.serialize(l,i)),i.format!=="text"&&!Jc(Ye.fromDom(l))&&F(d)?hn.trim(d):d},KU=(n,i)=>de.from(n.getBody()).fold(et(i.format==="tree"?new Hd("body",11):""),l=>GU(n,i,l)),eA=hn.makeMap,bM=n=>{const i=[];n=n||{};const l=n.indent,d=eA(n.indent_before||""),p=eA(n.indent_after||""),w=Yg.getEncodeFunc(n.entity_encoding||"raw",n.entities),E=n.element_format!=="xhtml";return{start:(R,B,K)=>{if(l&&d[R]&&i.length>0){const ie=i[i.length-1];ie.length>0&&ie!==`
|
|
`&&i.push(`
|
|
`)}if(i.push("<",R),B)for(let ie=0,ue=B.length;ie<ue;ie++){const be=B[ie];i.push(" ",be.name,'="',w(be.value,!0),'"')}if(!K||E?i[i.length]=">":i[i.length]=" />",K&&l&&p[R]&&i.length>0){const ie=i[i.length-1];ie.length>0&&ie!==`
|
|
`&&i.push(`
|
|
`)}},end:R=>{let B;i.push("</",R,">"),l&&p[R]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==`
|
|
`&&i.push(`
|
|
`))},text:(R,B)=>{R.length>0&&(i[i.length]=B?R:w(R))},cdata:R=>{i.push("<![CDATA[",R,"]]>")},comment:R=>{i.push("<!--",R,"-->")},pi:(R,B)=>{B?i.push("<?",R," ",w(B),"?>"):i.push("<?",R,"?>"),l&&i.push(`
|
|
`)},doctype:R=>{i.push("<!DOCTYPE",R,">",l?`
|
|
`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Pw=(n={},i=dh())=>{const l=bM(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,E={3:B=>{var K;l.text((K=B.value)!==null&&K!==void 0?K:"",B.raw)},8:B=>{var K;l.comment((K=B.value)!==null&&K!==void 0?K:"")},7:B=>{l.pi(B.name,B.value)},10:B=>{var K;l.doctype((K=B.value)!==null&&K!==void 0?K:"")},4:B=>{var K;l.cdata((K=B.value)!==null&&K!==void 0?K:"")},11:B=>{let K=B;if(K=K.firstChild)do R(K);while(K=K.next)}};l.reset();const R=B=>{var K;const ie=E[B.type];if(ie)ie(B);else{const ue=B.name,be=ue in i.getVoidElements();let Le=B.attributes;if(w&&Le&&Le.length>1){const je=[];je.map={};const Me=i.getElementRule(B.name);if(Me){for(let Ve=0,mt=Me.attributesOrder.length;Ve<mt;Ve++){const vt=Me.attributesOrder[Ve];if(vt in Le.map){const yt=Le.map[vt];je.map[vt]=yt,je.push({name:vt,value:yt})}}for(let Ve=0,mt=Le.length;Ve<mt;Ve++){const vt=Le[Ve].name;if(!(vt in je.map)){const yt=Le.map[vt];je.map[vt]=yt,je.push({name:vt,value:yt})}}Le=je}}if(l.start(ue,Le,be),!be){let je=B.firstChild;if(je){(ue==="pre"||ue==="textarea")&&je.type===3&&((K=je.value)===null||K===void 0?void 0:K[0])===`
|
|
`&&l.text(`
|
|
`,!0);do R(je);while(je=je.next)}l.end(ue)}}};return p.type===1&&!n.inner?R(p):p.type===3?E[3](p):E[11](p),l.getContent()}}},YI=new Set;Be(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],i=>{YI.add(i)});const ms=["font","text-decoration","text-emphasis"],vM=(n,i)=>gs(n.parseStyle(n.getAttrib(i,"style"))),ks=n=>YI.has(n),XI=(n,i)=>Js(vM(n,i),l=>!ks(l)),Tse=n=>wt(n,i=>Xt(ms,l=>xr(i,l))),Dse=(n,i,l)=>{const d=vM(n,i),p=vM(n,l),w=E=>{var R,B;const K=(R=n.getStyle(i,E))!==null&&R!==void 0?R:"",ie=(B=n.getStyle(l,E))!==null&&B!==void 0?B:"";return pr(K)&&pr(ie)&&K!==ie};return Xt(d,E=>{const R=B=>Xt(B,K=>K===E);if(!R(p)&&R(ms)){const B=Tse(p);return Xt(B,w)}else return w(E)})},JI=(n,i,l)=>de.from(l.container()).filter(Sn).exists(d=>{const p=n?0:-1;return i(d.data.charAt(l.offset()+p))}),QI=He(JI,!0,_h),eB=He(JI,!1,_h),YU=n=>{const i=n.container();return Sn(i)&&(i.data.length===0||kn(i.data)&&fy.isBookmarkNode(i.parentNode))},by=(n,i)=>l=>d0(n?0:-1,l).filter(i).isSome(),es=n=>Ui(n)&&Ri(Ye.fromDom(n),"display")==="block",tB=n=>As(n)&&!ml(n),XU=by(!0,es),JU=by(!1,es),$b=by(!0,qu),oS=by(!1,qu),nB=by(!0,Eu),oB=by(!1,Eu),vy=by(!0,tB),zb=by(!1,tB),QU=n=>n.slice(0,-1),Ose=(n,i,l)=>cn(i,n)?QU(Gd(n,d=>l(d)||bt(d,i))):[],eW=(n,i)=>Ose(n,i,qe),Vb=(n,i)=>[n].concat(eW(n,i)),yM=(n,i,l)=>vE(n,i,l,YU),sB=(n,i)=>eo(Vb(Ye.fromDom(i.container()),n),ac),rB=(n,i,l)=>yM(n,i.dom,l).forall(d=>sB(i,l).fold(()=>!Nd(d,l,i.dom),p=>!Nd(d,l,i.dom)&&cn(p,Ye.fromDom(d.container())))),wM=(n,i,l)=>sB(i,l).fold(()=>yM(n,i.dom,l).forall(d=>!Nd(d,l,i.dom)),d=>yM(n,d.dom,l).isNone()),_M=He(wM,!1),Ms=He(wM,!0),iB=He(rB,!1),q3=He(rB,!0),aB=n=>Ue(n).exists(Xc),tA=(n,i,l)=>{const d=wt(Vb(Ye.fromDom(l.container()),i),ac),p=Po(d).getOr(i);return Pd(n,p.dom,l).filter(aB)},G3=(n,i)=>Ue(i).exists(Xc)||tA(!0,n,i).isSome(),K3=(n,i)=>ht(i).exists(Xc)||tA(!1,n,i).isSome(),lB=He(tA,!1),tW=He(tA,!0),CM=n=>Vt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),cB=(n,i)=>{const l=wt(Vb(Ye.fromDom(i.container()),n),ac);return Po(l).getOr(n)},uB=(n,i)=>CM(i)?eB(i):eB(i)||Mu(cB(n,i).dom,i).exists(eB),fB=(n,i)=>CM(i)?QI(i):QI(i)||Mf(cB(n,i).dom,i).exists(QI),nW=n=>St(["pre","pre-wrap"],n),SM=n=>Ue(n).bind(i=>Bl(i,_l)).exists(i=>nW(Ri(i,"white-space"))),oW=(n,i)=>Mu(n.dom,i).isNone(),sW=(n,i)=>Mf(n.dom,i).isNone(),rW=(n,i)=>oW(n,i)||sW(n,i)||_M(n,i)||Ms(n,i)||K3(n,i)||G3(n,i),kM=n=>_e(n)&&As(n)&&RC(n),Y3=(n,i)=>l=>kM(new bi(l,n)[i]()),iW=(n,i)=>{const l=Mf(n.dom,i).getOr(i),d=Y3(n.dom,"next");return i.isAtEnd()&&(d(i.container())||d(l.container()))},aW=(n,i)=>{const l=Mu(n.dom,i).getOr(i),d=Y3(n.dom,"prev");return i.isAtStart()&&(d(i.container())||d(l.container()))},dB=(n,i)=>SM(i)?!1:rW(n,i)||uB(n,i)||fB(n,i),nA=(n,i)=>SM(i)?!1:_M(n,i)||iB(n,i)||K3(n,i)||uB(n,i)||aW(n,i),lW=n=>{const i=n.container(),l=n.offset();return Sn(i)&&l<i.data.length?Vt(i,l+1):n},oA=(n,i)=>SM(i)?!1:Ms(n,i)||q3(n,i)||G3(n,i)||fB(n,i)||iW(n,i),EM=(n,i)=>nA(n,i)||oA(n,lW(i)),hB=(n,i)=>Ks(n.charAt(i)),AM=(n,i)=>_h(n.charAt(i)),cW=n=>{const i=n.container();return Sn(i)&&Qs(i.data,Gr)},uW=n=>{const i=n.split("");return Tt(i,(l,d)=>Ks(l)&&d>0&&d<i.length-1&&p0(i[d-1])&&p0(i[d+1])?" ":l).join("")},yy=(n,i,l)=>{const d=i.data,p=Vt(i,0);return!l&&hB(d,0)&&!EM(n,p)?(i.data=" "+d.slice(1),!0):l&&AM(d,0)&&nA(n,p)?(i.data=Gr+d.slice(1),!0):!1},fW=n=>{const i=n.data,l=uW(i);return l!==i?(n.data=l,!0):!1},xM=(n,i,l)=>{const d=i.data,p=Vt(i,d.length-1);return!l&&hB(d,d.length-1)&&!EM(n,p)?(i.data=d.slice(0,-1)+" ",!0):l&&AM(d,d.length-1)&&oA(n,p)?(i.data=d.slice(0,-1)+Gr,!0):!1},dW=(n,i)=>{const l=i.container();if(!Sn(l))return de.none();if(cW(i)){const d=yy(n,l,!1)||fW(l)||xM(n,l,!1);return Ss(d,i)}else if(EM(n,i)){const d=yy(n,l,!0)||xM(n,l,!0);return Ss(d,i)}else return de.none()},hW=n=>{const i=Ye.fromDom(n.getBody());n.selection.isCollapsed()&&dW(i,Vt.fromRangeStart(n.selection.getRng())).each(l=>{n.selection.setRng(l.toRange())})},TM=(n,i,l)=>{if(l===0)return;const d=Ye.fromDom(n),p=li(d,ac).getOr(d),w=n.data.slice(i,i+l),E=i+l>=n.data.length&&oA(p,Vt(n,n.data.length)),R=i===0&&nA(p,Vt(n,0));n.replaceData(i,l,rh(w,4,R,E))},sA=(n,i)=>{const l=n.data.slice(i),d=l.length-Zc(l).length;TM(n,i,d)},X3=(n,i)=>{const l=n.data.slice(0,i),d=l.length-gu(l).length;TM(n,i-d,d)},J3=(n,i,l,d=!0)=>{const p=gu(n.data).length,w=d?n:i,E=d?i:n;return d?w.appendData(E.data):w.insertData(0,E.data),br(Ye.fromDom(E)),l&&sA(w,p),w},od=(n,i)=>{const l=n.container(),d=n.offset();return!Vt.isTextPosition(n)&&l===i.parentNode&&d>Vt.before(i).offset()},mW=(n,i)=>od(i,n)?Vt(i.container(),i.offset()-1):i,gW=n=>Sn(n)?Vt(n,0):Vt.before(n),pW=n=>Sn(n)?Vt(n,n.data.length):Vt.after(n),mB=n=>Sl(n.previousSibling)?de.some(pW(n.previousSibling)):n.previousSibling?Id(n.previousSibling):de.none(),gB=n=>Sl(n.nextSibling)?de.some(gW(n.nextSibling)):n.nextSibling?rl(n.nextSibling):de.none(),Iw=(n,i)=>de.from(i.previousSibling?i.previousSibling:i.parentNode).bind(l=>Mu(n,Vt.before(l))).orThunk(()=>Mf(n,Vt.after(i))),bW=(n,i)=>Mf(n,Vt.after(i)).orThunk(()=>Mu(n,Vt.before(i))),vW=(n,i)=>mB(i).orThunk(()=>gB(i)).orThunk(()=>Iw(n,i)),Pa=(n,i)=>gB(i).orThunk(()=>mB(i)).orThunk(()=>bW(n,i)),Q3=(n,i,l)=>n?Pa(i,l):vW(i,l),Mse=(n,i,l)=>Q3(n,i,l).map(He(mW,l)),Uc=(n,i,l)=>{l.fold(()=>{n.focus()},d=>{n.selection.setRng(d.toRange(),i)})},Qr=n=>i=>i.dom===n,pm=(n,i)=>i&&un(n.schema.getBlockElements(),Xr(i)),yW=n=>{if(Ma(n)){const i=Ye.fromHtml('<br data-mce-bogus="1">');return wd(n),Qi(n,i),de.some(Vt.before(i.dom))}else return de.none()},pB=(n,i,l)=>{const d=ya(n).filter(el),p=vd(n).filter(el);return br(n),bf(d,p,i,(w,E,R)=>{const B=w.dom,K=E.dom,ie=B.data.length;return J3(B,K,l),R.container()===K?Vt(B,ie):R}).orThunk(()=>(l&&(d.each(w=>X3(w.dom,w.dom.length)),p.each(w=>sA(w.dom,0))),i))},DM=(n,i)=>un(n.schema.getTextInlineElements(),Xr(i)),Ub=(n,i,l,d=!0)=>{const p=Mse(i,n.getBody(),l.dom),w=li(l,He(pm,n),Qr(n.getBody())),E=pB(l,p,DM(n,l));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):w.bind(yW).fold(()=>{d&&Uc(n,i,E)},R=>{d&&Uc(n,i,de.some(R))})},bB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,vB=n=>bB.test(n),Bw=(n,i)=>wu(Ye.fromDom(i),ji(n))&&!Jm(n.schema,i)&&n.dom.isEditable(i),yB=n=>{var i;return Lr.DOM.getStyle(n,"direction",!0)==="rtl"||vB((i=n.textContent)!==null&&i!==void 0?i:"")},OM=(n,i,l)=>wt(Lr.DOM.getParents(l.container(),"*",i),n),Wb=(n,i,l)=>{const d=OM(n,i,l);return de.from(d[d.length-1])},gp=(n,i,l)=>{const d=lm(i,n),p=lm(l,n);return _e(d)&&d===p},wW=n=>Gu(n)||kf(n),gg=(n,i)=>{const l=i.container(),d=i.offset();return n?tr(l)?Sn(l.nextSibling)?Vt(l.nextSibling,0):Vt.after(l):Gu(i)?Vt(l,d+1):i:tr(l)?Sn(l.previousSibling)?Vt(l.previousSibling,l.previousSibling.data.length):Vt.before(l):kf(i)?Vt(l,d-1):i},_W=He(gg,!0),eT=He(gg,!1),wB=(n,i)=>{const l=d=>d.stopImmediatePropagation();n.on("beforeinput input",l,!0),n.getDoc().execCommand(i),n.off("beforeinput input",l)},rA=n=>{n.execCommand("delete")},MM=n=>wB(n,"Delete"),sS=n=>wB(n,"ForwardDelete"),pg=n=>i=>qr(ai(i),n,bt),iA=n=>lc(n)||Za(n),Ci=(n,i)=>cn(n,i)?Bl(i,iA,pg(n)):de.none(),Lw=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},RM=(n,i,l)=>ni(rl(l),Id(l),(d,p)=>{const w=gg(!0,d),E=gg(!1,p),R=gg(!1,i);return n?Mf(l,R).exists(B=>B.isEqual(E)&&i.isEqual(w)):Mu(l,R).exists(B=>B.isEqual(w)&&i.isEqual(E))}).getOr(!0),NM=n=>(U0(n)?ya(n):_u(n)).bind(NM).orThunk(()=>de.some(n)),tT=(n,i,l,d=!0)=>{var p;i.deleteContents();const w=NM(l).getOr(l),E=Ye.fromDom((p=n.dom.getParent(w.dom,n.dom.isBlock))!==null&&p!==void 0?p:l.dom);if(E.dom===n.getBody()?Lw(n,d):Ma(E)&&(De(E),d&&n.selection.setCursorLocation(E.dom,0)),!bt(l,E)){const R=qr(ai(E),l)?[]:W0(E);Be(R.concat(xa(l)),B=>{!bt(B,E)&&!cn(B,E)&&Ma(B)&&br(B)})}},PM=n=>i=>bt(n,i),aA=n=>hl(n,"td,th"),IM=(n,i)=>{const l=K=>up(Ye.fromDom(K),i),d=l(n.startContainer),p=l(n.endContainer),w=d.isSome(),E=p.isSome(),R=ni(d,p,bt).getOr(!1);return{startTable:d,endTable:p,isStartInTable:w,isEndInTable:E,isSameTable:R,isMultiTable:!R&&w&&E}},rS=(n,i)=>({start:n,end:i}),BM=(n,i,l)=>({rng:n,table:i,cells:l}),iS=lg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),lA=(n,i)=>rt(Ye.fromDom(n),"td,th",i),LM=n=>!bt(n.start,n.end),FM=(n,i)=>up(n.start,i).bind(l=>up(n.end,i).bind(d=>Ss(bt(l,d),l))),_B=(n,i)=>!LM(n)&&FM(n,i).exists(l=>{const d=l.dom.rows;return d.length===1&&d[0].cells.length===1}),aS=(n,i)=>{const l=lA(n.startContainer,i),d=lA(n.endContainer,i);return ni(l,d,rS)},CB=n=>i=>up(i,n).bind(l=>Mo(aA(l)).map(d=>rS(i,d))),HM=n=>i=>up(i,n).bind(l=>Po(aA(l)).map(d=>rS(d,i))),$M=n=>i=>FM(i,n).map(l=>BM(i,l,aA(l))),SB=(n,i,l,d)=>{if(l.collapsed||!n.forall(LM))return de.none();if(i.isSameTable){const p=n.bind($M(d));return de.some({start:p,end:p})}else{const p=lA(l.startContainer,d),w=lA(l.endContainer,d),E=p.bind(CB(d)).bind($M(d)),R=w.bind(HM(d)).bind($M(d));return de.some({start:E,end:R})}},zM=(n,i)=>ds(n,l=>bt(l,i)),nT=n=>ni(zM(n.cells,n.rng.start),zM(n.cells,n.rng.end),(i,l)=>n.cells.slice(i,l+1)),kB=(n,i,l)=>n.exists(d=>_B(d,l)&&uy(d.start,i)),cA=(n,i)=>{const{startTable:l,endTable:d}=i,p=n.cloneRange();return l.each(w=>p.setStartAfter(w.dom)),d.each(w=>p.setEndBefore(w.dom)),p},EB=(n,i,l,d)=>SB(n,i,l,d).bind(({start:p,end:w})=>p.or(w)).bind(p=>{const{isSameTable:w}=i,E=nT(p).getOr([]);if(w&&p.cells.length===E.length)return de.some(iS.fullTable(p.table));if(E.length>0){if(w)return de.some(iS.partialTable(E,de.none()));{const R=cA(l,i);return de.some(iS.partialTable(E,de.some({...i,rng:R})))}}else return de.none()}),AB=(n,i,l,d)=>SB(n,i,l,d).bind(({start:p,end:w})=>{const E=p.bind(nT).getOr([]),R=w.bind(nT).getOr([]);if(E.length>0&&R.length>0){const B=cA(l,i);return de.some(iS.multiTable(E,R,B))}else return de.none()}),xB=(n,i)=>{const l=PM(n),d=aS(i,l),p=IM(i,l);return kB(d,i,l)?d.map(w=>iS.singleCellTable(i,w.start)):p.isMultiTable?AB(d,p,i,l):EB(d,p,i,l)},VM=n=>Be(n,i=>{zi(i,"contenteditable"),De(i)}),TB=(n,i)=>de.from(n.dom.getParent(i,n.dom.isBlock)).map(Ye.fromDom),DB=(n,i,l)=>{l.each(d=>{i?br(d):(De(d),n.selection.setCursorLocation(d.dom,0))})},oT=(n,i,l,d)=>{const p=l.cloneRange();d?(p.setStart(l.startContainer,l.startOffset),p.setEndAfter(i.dom.lastChild)):(p.setStartBefore(i.dom.firstChild),p.setEnd(l.endContainer,l.endOffset)),uA(n,p,i,!1).each(w=>w())},UM=n=>{const i=b0(n),l=Ye.fromDom(n.selection.getNode());kd(l.dom)&&Ma(l)?n.selection.setCursorLocation(l.dom,0):n.selection.collapse(!0),i.length>1&&Xt(i,d=>bt(d,l))&&Dr(l,"data-mce-selected","1")},WM=(n,i,l)=>de.some(()=>{const d=n.selection.getRng(),p=l.bind(({rng:w,isStartInTable:E})=>{const R=TB(n,E?w.endContainer:w.startContainer);w.deleteContents(),DB(n,E,R.filter(Ma));const B=E?i[0]:i[i.length-1];return oT(n,B,d,E),Ma(B)?de.none():de.some(E?i.slice(1):i.slice(0,-1))}).getOr(i);VM(p),UM(n)}),OB=(n,i,l,d)=>de.some(()=>{const p=n.selection.getRng(),w=i[0],E=l[l.length-1];oT(n,w,p,!0),oT(n,E,p,!1);const R=Ma(w)?i:i.slice(1),B=Ma(E)?l:l.slice(0,-1);VM(R.concat(B)),d.deleteContents(),UM(n)}),uA=(n,i,l,d=!0)=>de.some(()=>{tT(n,i,l,d)}),MB=(n,i)=>de.some(()=>Ub(n,!1,i)),RB=(n,i,l)=>xB(i,l).bind(d=>d.fold(He(uA,n),He(MB,n),He(WM,n),He(OB,n))),NB=(n,i)=>fA(n,i),PB=(n,i,l,d)=>lS(i,d).fold(()=>RB(n,i,l),p=>NB(n,p)),IB=(n,i,l)=>{const d=Ye.fromDom(n.getBody()),p=n.selection.getRng();return l.length!==0?WM(n,l,de.none()):PB(n,d,p,i)},sT=(n,i)=>eo(Vb(i,n),Vm),lS=(n,i)=>eo(Vb(i,n),yc("caption")),BB=(n,i,l,d,p)=>m0(l,n.getBody(),p).bind(w=>sT(i,Ye.fromDom(w.getNode())).bind(E=>bt(E,d)?de.none():de.some(ft))),fA=(n,i)=>de.some(()=>{De(i),n.selection.setCursorLocation(i.dom,0)}),rT=(n,i,l,d)=>rl(n.dom).bind(p=>Id(n.dom).map(w=>i?l.isEqual(p)&&d.isEqual(w):l.isEqual(w)&&d.isEqual(p))).getOr(!0),jM=(n,i)=>fA(n,i),dA=(n,i,l)=>lS(n,Ye.fromDom(l.getNode())).fold(()=>de.some(ft),d=>Ss(!bt(d,i),ft)),ZM=(n,i,l,d,p)=>m0(l,n.getBody(),p).fold(()=>de.some(ft),w=>rT(d,l,p,w)?jM(n,d):dA(i,d,w)),LB=(n,i,l,d)=>{const p=Vt.fromRangeStart(n.selection.getRng());return sT(l,d).bind(w=>Ma(w)?fA(n,w):BB(n,l,i,w,p))},cS=(n,i,l,d)=>{const p=Vt.fromRangeStart(n.selection.getRng());return Ma(d)?fA(n,d):ZM(n,l,i,d,p)},iT=(n,i)=>n?nB(i):oB(i),qM=(n,i)=>{const l=Vt.fromRangeStart(n.selection.getRng());return iT(i,l)||Pd(i,n.getBody(),l).exists(d=>iT(i,d))},hA=(n,i,l)=>{const d=Ye.fromDom(n.getBody());return lS(d,l).fold(()=>LB(n,i,d,l).orThunk(()=>Ss(qM(n,i),ft)),p=>cS(n,i,d,p))},y0=(n,i)=>{const l=Ye.fromDom(n.selection.getStart(!0)),d=b0(n);return n.selection.isCollapsed()&&d.length===0?hA(n,i,l):IB(n,l,d)},wy=(n,i)=>{let l=i;for(;l&&l!==n;){if(ha(l)||As(l))return l;l=l.parentNode}return null},CW=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],FB=hn.each,aT=n=>{const i=n.dom,l=new Set(n.serializer.getTempAttrs()),d=(w,E)=>{if(w.nodeName!==E.nodeName||w.nodeType!==E.nodeType)return!1;const R=K=>{const ie={};return FB(i.getAttribs(K),ue=>{const be=ue.nodeName.toLowerCase();be!=="style"&&!p(be)&&(ie[be]=i.getAttrib(K,be))}),ie},B=(K,ie)=>{for(const ue in K)if(un(K,ue)){const be=ie[ue];if(ye(be)||K[ue]!==be)return!1;delete ie[ue]}for(const ue in ie)if(un(ie,ue))return!1;return!0};return Qn(w)&&Qn(E)&&(!B(R(w),R(E))||!B(i.parseStyle(i.getAttrib(w,"style")),i.parseStyle(i.getAttrib(E,"style"))))?!1:!Bd(w)&&!Bd(E)},p=w=>Xt(CW,E=>xr(w,E))||l.has(w);return{compare:d,isAttributeInternal:p}},SW=(n,i)=>{let l=n;for(;l=l.walk();)i(l)},kW=(n,i,l,d)=>{const p=l.name;for(let w=0,E=n.length;w<E;w++){const R=n[w];if(R.name===p){const B=d.nodes[p];B?B.nodes.push(l):d.nodes[p]={filter:R,nodes:[l]}}}if(l.attributes)for(let w=0,E=i.length;w<E;w++){const R=i[w],B=R.name;if(B in l.attributes.map){const K=d.attributes[B];K?K.nodes.push(l):d.attributes[B]={filter:R,nodes:[l]}}}},EW=(n,i,l)=>{const d={nodes:{},attributes:{}};return l.firstChild&&SW(l,p=>{kW(n,i,p,d)}),d},lT=(n,i)=>{const l=(d,p)=>{ln(d,w=>{const E=Mr(w.nodes);Be(w.filter.callbacks,R=>{for(let B=E.length-1;B>=0;B--){const K=E[B];(!(p?K.attr(w.filter.name)!==void 0:K.name===w.filter.name)||Te(K.parent))&&E.splice(B,1)}E.length>0&&R(E,w.filter.name,i)})})};l(n.nodes,!1),l(n.attributes,!0)},pp=(n,i,l,d={})=>{const p=EW(n,i,l);lT(p,d)},mA=(n,i,l,d)=>{if((n.pad_empty_with_br||i.insert)&&l(d)){const w=new Hd("br",1);i.insert&&w.attr("data-mce-bogus","1"),d.empty().append(w)}else d.empty().append(new Hd("#text",3)).value=Gr},cT=n=>{var i;return uT(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Gr},uT=(n,i)=>{const l=n==null?void 0:n.firstChild;return _e(l)&&l===n.lastChild&&l.name===i},AW=(n,i)=>{const l=n.getElementRule(i.name);return(l==null?void 0:l.paddEmpty)===!0},uS=(n,i,l,d)=>d.isEmpty(i,l,p=>AW(n,p)),xW=(n,i)=>_e(n)&&(i(n)||n.name==="br"),HB=n=>{let i;for(let l=n;l;l=l.parent){const d=l.attr("contenteditable");if(d==="false")break;d==="true"&&(i=l)}return de.from(i)},gA=(n,i,l=n.parent)=>{if(i.getSpecialElements()[n.name])n.empty().remove();else{const d=n.children();for(const p of d)l&&!i.isValidChild(l.name,p.name)&&gA(p,i,l);n.unwrap()}},GM=(n,i,l,d=ft)=>{const p=i.getTextBlockElements(),w=i.getNonEmptyElements(),E=i.getWhitespaceElements(),R=hn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),B=new Set,K=ie=>ie!==l&&!R[ie.name];for(let ie=0;ie<n.length;ie++){const ue=n[ie];let be,Le,je;if(!ue.parent||B.has(ue))continue;if(p[ue.name]&&ue.parent.name==="li"){let Ve=ue.next;for(;Ve&&p[Ve.name];){Ve.name="li",B.add(Ve),ue.parent.insert(Ve,ue.parent);Ve=Ve.next}ue.unwrap();continue}const Me=[ue];for(be=ue.parent;be&&!i.isValidChild(be.name,ue.name)&&K(be);be=be.parent)Me.push(be);if(be&&Me.length>1)if(i.isValidChild(be.name,ue.name)){Me.reverse(),Le=Me[0].clone(),d(Le);let Ve=Le;for(let mt=0;mt<Me.length-1;mt++){i.isValidChild(Ve.name,Me[mt].name)&&mt>0?(je=Me[mt].clone(),d(je),Ve.append(je)):je=Ve;for(let vt=Me[mt].firstChild;vt&&vt!==Me[mt+1];){const yt=vt.next;je.append(vt),vt=yt}Ve=je}uS(i,w,E,Le)?be.insert(ue,Me[0],!0):(be.insert(Le,Me[0],!0),be.insert(ue,Le)),be=Me[0],(uS(i,w,E,be)||uT(be,"br"))&&be.empty().remove()}else gA(ue,i);else if(ue.parent){if(ue.name==="li"){let Ve=ue.prev;if(Ve&&(Ve.name==="ul"||Ve.name==="ol")){Ve.append(ue);continue}if(Ve=ue.next,Ve&&(Ve.name==="ul"||Ve.name==="ol")&&Ve.firstChild){Ve.insert(ue,Ve.firstChild,!0);continue}const mt=new Hd("ul",1);d(mt),ue.wrap(mt);continue}if(i.isValidChild(ue.parent.name,"div")&&i.isValidChild("div",ue.name)){const Ve=new Hd("div",1);d(Ve),ue.wrap(Ve)}else gA(ue,i)}}},$B=(n,i)=>{let l=n;for(;l;){if(l.name===i)return!0;l=l.parent}return!1},zB=(n,i,l=i.parent)=>l&&n.children[i.name]&&!n.isValidChild(l.name,i.name)?!0:!!(l&&i.name==="a"&&$B(l,"a")),pA=(n,i,l,d)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(l,d),p},VB=n=>{const i=Vt.fromRangeStart(n),l=Vt.fromRangeEnd(n),d=n.commonAncestorContainer;return Pd(!1,d,l).map(p=>!Nd(i,l,d)&&Nd(i,p,d)?pA(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},KM=n=>n.collapsed?n:VB(n),UB=n=>_e(n.firstChild)&&n.firstChild===n.lastChild,TW=n=>n.name==="br"||n.value===Gr,DW=(n,i)=>n.getBlockElements()[i.name]&&UB(i)&&TW(i.firstChild),OW=(n,i)=>{const l=n.getNonEmptyElements();return _e(i)&&(i.isEmpty(l)||DW(n,i))},MW=(n,i)=>{let l=i.firstChild,d=i.lastChild;return l&&l.name==="meta"&&(l=l.next),d&&d.attr("id")==="mce_marker"&&(d=d.prev),OW(n,d)&&(d=d==null?void 0:d.prev),!l||l!==d?!1:l.name==="ul"||l.name==="ol"},RW=n=>{var i,l;const d=n.firstChild,p=n.lastChild;return d&&d.nodeName==="META"&&((i=d.parentNode)===null||i===void 0||i.removeChild(d)),p&&p.id==="mce_marker"&&((l=p.parentNode)===null||l===void 0||l.removeChild(p)),n},WB=(n,i,l)=>{const d=i.serialize(l),p=n.createFragment(d);return RW(p)},NW=n=>{var i;return wt((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],l=>l.nodeName==="LI")},YM=n=>n.data===Gr||ui(n),Fw=n=>_e(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&YM(n.firstChild),PW=n=>!n.firstChild||Fw(n),IW=n=>n.length>0&&PW(n[n.length-1])?n.slice(0,-1):n,fS=(n,i)=>{const l=n.getParent(i,n.isBlock);return l&&l.nodeName==="LI"?l:null},jB=(n,i)=>!!fS(n,i),ZB=(n,i)=>{const l=i.cloneRange(),d=i.cloneRange();return l.setStartBefore(n),d.setEndAfter(n),[l.cloneContents(),d.cloneContents()]},BW=(n,i)=>{const l=Vt.before(n),p=ka(i).next(l);return p?p.toRange():null},XM=(n,i)=>{const l=Vt.after(n),p=ka(i).prev(l);return p?p.toRange():null},LW=(n,i,l,d)=>{const p=ZB(n,d),w=n.parentNode;return w&&(w.insertBefore(p[0],n),hn.each(i,E=>{w.insertBefore(E,n)}),w.insertBefore(p[1],n),w.removeChild(n)),XM(i[i.length-1],l)},Hw=(n,i,l)=>{const d=n.parentNode;return d&&hn.each(i,p=>{d.insertBefore(p,n)}),BW(n,l)},qB=(n,i,l,d)=>(d.insertAfter(i.reverse(),n),XM(i[0],l)),GB=(n,i,l,d)=>{const p=WB(i,n,d),w=fS(i,l.startContainer),E=IW(NW(p.firstChild)),R=1,B=2,K=i.getRoot(),ie=ue=>{const be=Vt.fromRangeStart(l),Le=ka(i.getRoot()),je=ue===R?Le.prev(be):Le.next(be),Me=je==null?void 0:je.getNode();return Me?fS(i,Me)!==w:!0};return w?ie(R)?Hw(w,E,K):ie(B)?qB(w,E,K,i):LW(w,E,K,l):null},KB=["pre"],fT=(n,i,l,d)=>{var p;const w=i.firstChild,E=i.lastChild,R=E.attr("data-mce-type")==="bookmark"?E.prev:E,B=w===R,K=St(KB,w.name);if(B&&K){const ie=w.attr("contenteditable")!=="false",ue=((p=n.getParent(l,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===w.name,be=de.from(wy(d,l)).forall(ha);return ie&&ue&&be}else return!1},dT=kd,FW=(n,i,l)=>{if(_e(l)){const d=n.getParent(i.endContainer,dT);return l===d&&uy(Ye.fromDom(l),i)}else return!1},YB=(n,i,l)=>{var d;if(l.getAttribute("data-mce-bogus")==="all")(d=l.parentNode)===null||d===void 0||d.insertBefore(n.dom.createFragment(i),l);else{const p=l.firstChild,w=l.lastChild;!p||p===w&&p.nodeName==="BR"?n.dom.setHTML(l,i):n.selection.setContent(i,{no_events:!0})}},HW=(n,i)=>{de.from(n.getParent(i,"td,th")).map(Ye.fromDom).each(at)},$W=(n,i)=>{const l=n.schema.getTextInlineElements(),d=n.dom;if(i){const p=n.getBody(),w=aT(n);hn.each(d.select("*[data-mce-fragment]"),E=>{if(_e(l[E.nodeName.toLowerCase()])&&XI(d,E)){for(let B=E.parentElement;_e(B)&&B!==p&&!Dse(d,E,B);B=B.parentElement)if(w.compare(B,E)){d.remove(E,!0);break}}})}},hT=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},XB=n=>{hn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},JM=n=>!!n.getAttribute("data-mce-fragment"),zW=(n,i)=>_e(i)&&!n.schema.getVoidElements()[i.nodeName],VW=(n,i)=>{var l,d,p;let w;const E=n.dom,R=n.selection;if(!i)return;R.scrollIntoView(i);const B=wy(n.getBody(),i);if(B&&E.getContentEditable(B)==="false"){E.remove(i),R.select(B);return}let K=E.createRng();const ie=i.previousSibling;if(Sn(ie)){K.setStart(ie,(d=(l=ie.nodeValue)===null||l===void 0?void 0:l.length)!==null&&d!==void 0?d:0);const Le=i.nextSibling;Sn(Le)&&(ie.appendData(Le.data),(p=Le.parentNode)===null||p===void 0||p.removeChild(Le))}else K.setStartBefore(i),K.setEndBefore(i);const ue=Le=>{let je=Vt.fromRangeStart(Le);return je=ka(n.getBody()).next(je),je==null?void 0:je.toRange()},be=E.getParent(i,E.isBlock);if(E.remove(i),be&&E.isEmpty(be)){const Le=dT(be);wd(Ye.fromDom(be)),K.setStart(be,0),K.setEnd(be,0),!Le&&!JM(be)&&(w=ue(K))?(K=w,E.remove(be)):E.add(be,E.create("br",Le?{}:{"data-mce-bogus":"1"}))}R.setRng(K)},JB=n=>{const i=n.dom,l=KM(n.selection.getRng());n.selection.setRng(l);const d=i.getParent(l.startContainer,dT);FW(i,l,d)?uA(n,l,Ye.fromDom(d)):l.startContainer===l.endContainer&&l.endOffset-l.startOffset===1&&Sn(l.startContainer.childNodes[l.startOffset])?l.deleteContents():n.getDoc().execCommand("Delete",!1)},QM=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return de.some(i);return de.none()},QB=(n,i,l)=>{var d,p;const w=n.selection,E=n.dom,R=n.parser,B=l.merge,K=Pw({validate:!0},n.schema),ie='<span id="mce_marker" data-mce-type="bookmark"></span>';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ie);let ue=w.getRng();const be=ue.startContainer,Le=n.getBody();be===Le&&w.isCollapsed()&&E.isBlock(Le.firstChild)&&zW(n,Le.firstChild)&&E.isEmpty(Le.firstChild)&&(ue=E.createRng(),ue.setStart(Le.firstChild,0),ue.setEnd(Le.firstChild,0),w.setRng(ue)),w.isCollapsed()||JB(n);const je=w.getNode(),Me={context:je.nodeName.toLowerCase(),data:l.data,insert:!0},Ve=R.parse(i,Me);if(l.paste===!0&&MW(n.schema,Ve)&&jB(E,je))return ue=GB(K,E,w.getRng(),Ve),ue&&w.setRng(ue),i;l.paste===!0&&fT(E,Ve,je,n.getBody())&&((d=Ve.firstChild)===null||d===void 0||d.unwrap()),hT(Ve);let mt=Ve.lastChild;if(mt&&mt.attr("id")==="mce_marker"){const vt=mt;for(mt=mt.prev;mt;mt=mt.walk(!0))if(mt.type===3||!E.isBlock(mt.name)){mt.parent&&n.schema.isValidChild(mt.parent.name,"span")&&mt.parent.insert(vt,mt,mt.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(je),!Me.invalid)i=K.serialize(Ve),YB(n,i,je);else{n.selection.setContent(ie);let vt=w.getNode(),yt;const Mt=n.getBody();for(Zu(vt)?vt=yt=Mt:yt=vt;yt&&yt!==Mt;)vt=yt,yt=yt.parentNode;i=vt===Mt?Mt.innerHTML:E.getOuterHTML(vt);const dn=R.parse(i),zn=QM(dn),Pn=zn.bind(HB).getOr(dn);zn.each(go=>go.replace(Ve));const Lt=Ve.children(),$t=(p=Ve.parent)!==null&&p!==void 0?p:dn;Ve.unwrap();const wn=wt(Lt,go=>zB(n.schema,go,$t));GM(wn,n.schema,Pn),pp(R.getNodeFilters(),R.getAttributeFilters(),dn),i=K.serialize(dn),vt===Mt?E.setHTML(Mt,i):E.setOuterHTML(vt,i)}return $W(n,B),VW(n,E.get("mce_marker")),XB(n.getBody()),HW(E,w.getStart()),Sv(n.schema,n.getBody(),w.getStart()),i},mT=n=>n instanceof Hd,UW=n=>{Nw(n)&&rl(n.getBody()).each(i=>{const l=i.getNode(),d=Eu(l)?rl(l).getOr(i):i;n.selection.setRng(d.toRange())})},eR=(n,i,l)=>{n.dom.setHTML(n.getBody(),i),l!==!0&&UW(n)},gT=(n,i,l,d)=>{if(l.length===0||/^\s+$/.test(l)){const p='<br data-mce-bogus="1">';i.nodeName==="TABLE"?l="<tr><td>"+p+"</td></tr>":/^(UL|OL)$/.test(i.nodeName)&&(l="<li>"+p+"</li>");const w=Hc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),w.toLowerCase())?(l=p,l=n.dom.createHTML(w,o0(n),l)):l||(l=p),eR(n,l,d.no_selection),{content:l,html:l}}else{d.format!=="raw"&&(l=Pw({validate:!1},n.schema).serialize(n.parser.parse(l,{isRootContent:!0,insert:!0})));const p=Jc(Ye.fromDom(i))?l:hn.trim(l);return eR(n,p,d.no_selection),{content:p,html:p}}},jb=(n,i,l,d)=>{pp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),l);const p=Pw({validate:!1},n.schema).serialize(l),w=Jc(Ye.fromDom(i))?p:hn.trim(p);return eR(n,w,d.no_selection),{content:l,html:w}},WW=(n,i,l)=>de.from(n.getBody()).map(d=>mT(i)?jb(n,d,i,l):gT(n,d,i,l)).getOr({content:i,html:mT(l.content)?"":l.content}),tR=(n,i,l)=>li(n,i,l).isSome(),Ol=(n,i)=>Lp(n,i).isSome(),pT=n=>ge(n)?n:qe,nR=(n,i,l)=>{let d=n.dom;const p=pT(l);for(;d.parentNode;){d=d.parentNode;const w=Ye.fromDom(d),E=i(w);if(E.isSome())return E;if(p(w))break}return de.none()},a1=(n,i,l)=>{const d=i(n),p=pT(l);return d.orThunk(()=>p(n)?de.none():nR(n,i,p))},bT=FC,oR=(n,i,l)=>{const d=n.formatter.get(l);if(d)for(let p=0;p<d.length;p++){const w=d[p];if(td(w)&&w.inherit===!1&&n.dom.is(i,w.selector))return!0}return!1},$w=(n,i,l,d,p)=>{const w=n.dom.getRoot();if(i===w)return!1;const E=n.dom.getParent(i,R=>oR(n,R,l)?!0:R.parentNode===w||!!Eh(n,R,l,d,!0));return!!Eh(n,E,l,d,p)},vT=(n,i,l)=>Tl(l)&&bT(i,l.inline)||hm(l)&&bT(i,l.block)?!0:td(l)?Qn(i)&&n.is(i,l.selector):!1,e8=(n,i,l,d,p,w)=>{const E=l[d],R=d==="attributes";if(ge(l.onmatch))return l.onmatch(i,l,d);if(E){if(Sr(E)){for(let B=0;B<E.length;B++)if(R?n.getAttrib(i,E[B]):ww(n,i,E[B]))return!0}else for(const B in E)if(un(E,B)){const K=R?n.getAttrib(i,B):ww(n,i,B),ie=Ch(E[B],w),ue=Te(K)||Qa(K);if(ue&&Te(ie))continue;if(p&&ue&&!l.exact||(!p||l.exact)&&!bT(K,yw(ie,B)))return!1}}return!0},Eh=(n,i,l,d,p)=>{const w=n.formatter.get(l),E=n.dom;if(w&&Qn(i))for(let R=0;R<w.length;R++){const B=w[R];if(vT(n.dom,i,B)&&e8(E,i,B,"attributes",p,d)&&e8(E,i,B,"styles",p,d)){const K=B.classes;if(K){for(let ie=0;ie<K.length;ie++)if(!n.dom.hasClass(i,Ch(K[ie],d)))return}return B}}},sR=(n,i,l,d,p)=>{if(d)return $w(n,d,i,l,p);if(d=n.selection.getNode(),$w(n,d,i,l,p))return!0;const w=n.selection.getStart();return!!(w!==d&&$w(n,w,i,l,p))},zw=(n,i,l)=>{const d=[],p={},w=n.selection.getStart();return n.dom.getParent(w,E=>{for(let R=0;R<i.length;R++){const B=i[R];!p[B]&&Eh(n,E,B,l)&&(p[B]=!0,d.push(B))}},n.dom.getRoot()),d},jW=(n,i)=>{const l=p=>bt(p,Ye.fromDom(n.getBody())),d=(p,w)=>Eh(n,p.dom,w)?de.some(w):de.none();return de.from(n.selection.getStart(!0)).bind(p=>a1(Ye.fromDom(p),w=>Ls(i,E=>d(w,E)),l)).getOrNull()},_y=(n,i)=>{const l=n.formatter.get(i),d=n.dom;if(l&&n.selection.isEditable()){const p=n.selection.getStart(),w=_w(d,p);for(let E=l.length-1;E>=0;E--){const R=l[E];if(!td(R))return!0;for(let B=w.length-1;B>=0;B--)if(d.is(w[B],R.selector))return!0}}return!1},bg=(n,i,l)=>vn(l,(d,p)=>{const w=IE(n,p);return n.formatter.matchNode(i,p,{},w)?d.concat([p]):d},[]),Zb=Ft,rR=(n,i)=>n.importNode(i,!0),ZW=n=>{const i=[];let l=n;for(;l;){if(Sn(l)&&l.data!==Zb||l.childNodes.length>1)return[];Qn(l)&&i.push(l),l=l.firstChild}return i},t8=n=>ZW(n).length>0,bA=n=>{if(n){const i=new bi(n,n);for(let l=i.current();l;l=i.next())if(Sn(l))return l}return null},iR=n=>{const i=Ye.fromTag("span");return Vu(i,{id:PC,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&Qi(i,Ye.fromText(Zb)),i},bp=n=>{const i=bA(n);return i&&i.data.charAt(0)===Zb&&i.deleteData(0,1),i},dS=(n,i,l=!0)=>{const d=n.dom,p=n.selection;if(t8(i))Ub(n,!1,Ye.fromDom(i),l);else{const w=p.getRng(),E=d.getParent(i,d.isBlock),R=w.startContainer,B=w.startOffset,K=w.endContainer,ie=w.endOffset,ue=bp(i);d.remove(i,!0),R===ue&&B>0&&w.setStart(ue,B-1),K===ue&&ie>0&&w.setEnd(ue,ie-1),E&&d.isEmpty(E)&&De(Ye.fromDom(E)),p.setRng(w)}},yT=(n,i,l=!0)=>{const d=n.dom,p=n.selection;if(i)dS(n,i,l);else if(i=g0(n.getBody(),p.getStart()),!i)for(;i=d.get(PC);)dS(n,i,l)},aR=(n,i,l)=>{var d,p;const w=n.dom,E=w.getParent(l,He($l,n.schema));E&&w.isEmpty(E)?(d=l.parentNode)===null||d===void 0||d.replaceChild(i,l):(G(Ye.fromDom(l)),w.isEmpty(l)?(p=l.parentNode)===null||p===void 0||p.replaceChild(i,l):w.insertAfter(i,l))},wT=(n,i)=>(n.appendChild(i),i),Cy=(n,i)=>{var l;const d=Yt(n,(w,E)=>wT(w,E.cloneNode(!1)),i),p=(l=d.ownerDocument)!==null&&l!==void 0?l:document;return wT(d,p.createTextNode(Zb))},lR=(n,i,l,d,p,w)=>{const E=n.formatter,R=n.dom,B=wt(gs(E.get()),ue=>ue!==d&&!Qs(ue,"removeformat")),K=bg(n,l,B);if(wt(K,ue=>!BO(n,ue,d)).length>0){const ue=l.cloneNode(!1);return R.add(i,ue),E.remove(d,p,ue,w),R.remove(ue),de.some(ue)}else return de.none()},qW=(n,i,l)=>{let d;const p=n.selection,w=n.formatter.get(i);if(!w)return;const E=p.getRng();let R=E.startOffset;const K=E.startContainer.nodeValue;d=g0(n.getBody(),p.getStart());const ie=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(K&&R>0&&R<K.length&&ie.test(K.charAt(R))&&ie.test(K.charAt(R-1))){const ue=p.getBookmark();E.collapse(!0);let be=Pb(n.dom,E,w);be=mp(be),n.formatter.apply(i,l,be),p.moveToBookmark(ue)}else{let ue=d?bA(d):null;(!d||(ue==null?void 0:ue.data)!==Zb)&&(d=rR(n.getDoc(),iR(!0).dom),ue=d.firstChild,E.insertNode(d),R=1),n.formatter.apply(i,l,d),p.setCursorLocation(ue,R)}},n8=(n,i,l,d)=>{const p=n.dom,w=n.selection;let E=!1;const R=n.formatter.get(i);if(!R)return;const B=w.getRng(),K=B.startContainer,ie=B.startOffset;let ue=K;Sn(K)&&(ie!==K.data.length&&(E=!0),ue=ue.parentNode);const be=[];let Le;for(;ue;){if(Eh(n,ue,i,l,d)){Le=ue;break}ue.nextSibling&&(E=!0),be.push(ue),ue=ue.parentNode}if(!!Le)if(E){const je=w.getBookmark();B.collapse(!0);let Me=Pb(p,B,R,!0);Me=mp(Me),n.formatter.remove(i,l,Me,d),w.moveToBookmark(je)}else{const je=g0(n.getBody(),Le),Me=iR(!1).dom;aR(n,Me,je!=null?je:Le);const Ve=lR(n,Me,Le,i,l,d),mt=Cy(be.concat(Ve.toArray()),Me);je&&dS(n,je,!1),w.setCursorLocation(mt,1),p.isEmpty(Le)&&p.remove(Le)}},GW=(n,i,l)=>{const d=n.selection,p=n.getBody();yT(n,null,l),(i===8||i===46)&&d.isCollapsed()&&d.getStart().innerHTML===Zb&&yT(n,g0(p,d.getStart())),(i===37||i===39)&&yT(n,g0(p,d.getStart()))},KW=n=>Sn(n)&&Ki(n.data,Gr),YW=n=>{n.on("mouseup keydown",i=>{GW(n,i.keyCode,KW(n.selection.getRng().endContainer))})},o8=n=>{const i=iR(!1),l=Cy(n,i.dom);return{caretContainer:i,caretPosition:Vt(l,0)}},hS=(n,i)=>{const{caretContainer:l,caretPosition:d}=o8(i);return wa(Ye.fromDom(n),l),br(Ye.fromDom(n)),d},XW=(n,i)=>{const{caretContainer:l,caretPosition:d}=o8(i);return n.insertNode(l.dom),d},cR=(n,i)=>{const l=n.schema.getTextInlineElements();return un(l,Xr(i))&&!$c(i.dom)&&!Cd(i.dom)},_T=n=>$c(n.dom)&&t8(n.dom),vA={},uR=Sf(["pre"]),s8=(n,i)=>{vA[n]||(vA[n]=[]),vA[n].push(i)},JW=(n,i)=>{un(vA,n)&&Be(vA[n],l=>{l(i)})};s8("pre",n=>{const i=n.selection.getRng(),l=p=>w=>{const E=w.previousSibling;return uR(E)&&St(p,E)},d=(p,w)=>{const E=Ye.fromDom(w),R=To(E).dom;br(E),Jr(Ye.fromDom(p),[Ye.fromTag("br",R),Ye.fromTag("br",R),...xa(E)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),w=wt(wt(p,uR),l(p));Be(w,E=>{d(E.previousSibling,E)})}});const r8=["fontWeight","fontStyle","color","fontSize","fontFamily"],QW=n=>oe(n.styles)&&Xt(gs(n.styles),i=>St(r8,i)),ej=n=>eo(n,i=>Tl(i)&&i.inline==="span"&&QW(i)),i8=(n,i)=>{const l=n.get(i);return se(l)?ej(l):de.none()},a8=(n,i)=>Mu(i,Vt.fromRangeStart(n)).isNone(),l8=(n,i)=>Mf(i,Vt.fromRangeEnd(n)).exists(l=>!ui(l.getNode())||Mf(i,l).isSome())===!1,c8=n=>i=>Va(i)&&n.isEditable(i),tj=n=>{const i=n.getSelectedBlocks(),l=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return a8(l,i[0])&&l8(l,i[0])?i:[];{const d=Po(i).filter(E=>a8(l,E)).toArray(),p=Mo(i).filter(E=>l8(l,E)).toArray(),w=i.slice(1,-1);return d.concat(w).concat(p)}},nj=n=>wt(tj(n),c8(n.dom)),u8=n=>wt(n.getSelectedBlocks(),c8(n.dom)),fR=hn.each,dR=n=>Qn(n)&&!Bd(n)&&!$c(n)&&!Cd(n),hR=(n,i)=>{for(let l=n;l;l=l[i]){if(Sn(l)&&pr(l.data))return n;if(Qn(l)&&!Bd(l))return l}return n},f8=(n,i,l)=>{const d=aT(n),p=Qn(i)&&um(i),w=Qn(l)&&um(l);if(p&&w){const E=hR(i,"previousSibling"),R=hR(l,"nextSibling");if(d.compare(E,R)){for(let B=E.nextSibling;B&&B!==R;){const K=B;B=B.nextSibling,E.appendChild(K)}return n.dom.remove(R),hn.each(hn.grep(R.childNodes),B=>{E.appendChild(B)}),E}}return l},Vw=(n,i,l,d)=>{var p;if(d&&i.merge_siblings!==!1){const w=(p=f8(n,Jn(d),d))!==null&&p!==void 0?p:d;f8(n,w,Jn(w,!0))}},oj=(n,i,l)=>{if(i.clear_child_styles){const d=i.links?"*:not(a)":"*";fR(n.select(d,l),p=>{dR(p)&&um(p)&&fR(i.styles,(w,E)=>{n.setStyle(p,E,"")})})}},mR=(n,i,l)=>{fR(n.childNodes,d=>{dR(d)&&(i(d)&&l(d),d.hasChildNodes()&&mR(d,i,l))})},sj=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},d8=(n,i)=>l=>!!(l&&ww(n,l,i)),gR=(n,i,l)=>d=>{n.setStyle(d,i,l),d.getAttribute("style")===""&&d.removeAttribute("style"),sj(n,d)},Uw=lg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),rj=/^(src|href|style)$/,pR=hn.each,CT=FC,ij=n=>/^(TR|TH|TD)$/.test(n.nodeName),h8=(n,i,l)=>n.isChildOf(i,l)&&i!==l&&!n.isBlock(l),m8=(n,i,l)=>{let d=i[l?"startContainer":"endContainer"],p=i[l?"startOffset":"endOffset"];if(Qn(d)){const w=d.childNodes.length-1;!l&&p&&p--,d=d.childNodes[p>w?w:p]}return Sn(d)&&l&&p>=d.data.length&&(d=new bi(d,n.getBody()).next()||d),Sn(d)&&!l&&p===0&&(d=new bi(d,n.getBody()).prev()||d),d},g8=(n,i)=>{const l=i?"firstChild":"lastChild",d=n[l];return ij(n)&&d?n.nodeName==="TR"&&d[l]||d:n},bR=(n,i,l,d)=>{var p;const w=n.create(l,d);return(p=i.parentNode)===null||p===void 0||p.insertBefore(w,i),w.appendChild(i),w},p8=(n,i,l,d,p)=>{const w=Ye.fromDom(i),E=Ye.fromDom(n.create(d,p)),R=l?nl(w):Lg(w);return Jr(E,R),l?(wa(w,E),Jd(E,w)):(Yc(w,E),Qi(E,w)),E.dom},vR=(n,i)=>i.links&&n.nodeName==="A",yR=(n,i,l)=>{const d=i.parentNode;let p;const w=n.dom,E=Hc(n);hm(l)&&d===w.getRoot()&&(!l.list_block||!CT(i,l.list_block))&&Be(Mr(i.childNodes),R=>{fm(n,E,R.nodeName.toLowerCase())?p?p.appendChild(R):(p=bR(w,R,E),w.setAttribs(p,o0(n))):p=null}),!(BE(l)&&!CT(l.inline,i))&&w.remove(i,!0)},aj=(n,i,l)=>nt(n)?{name:i,value:null}:{name:n,value:Ch(i,l)},mS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},wR=(n,i,l,d,p)=>{let w=!1;pR(l.styles,(E,R)=>{const{name:B,value:K}=aj(R,E,d),ie=yw(K,B);(l.remove_similar||X(K)||!Qn(p)||CT(ww(n,p,B),ie))&&n.setStyle(i,B,""),w=!0}),w&&mS(n,i)},yA=(n,i,l)=>{i==="removeformat"?Be(u8(n.selection),d=>{Be(r8,p=>n.dom.setStyle(d,p,"")),mS(n.dom,d)}):i8(n.formatter,i).each(d=>{Be(u8(n.selection),p=>wR(n.dom,p,d,l,null))})},gS=(n,i,l,d,p)=>{const w=n.dom,E=aT(n),R=n.schema;if(Tl(i)&&qg(R,i.inline)&&Jm(R,d)&&d.parentElement===n.getBody())return yR(n,d,i),Uw.removed();if(!i.ceFalseOverride&&d&&w.getContentEditableParent(d)==="false"||d&&!vT(w,d,i)&&!vR(d,i))return Uw.keep();const B=d,K=i.preserve_attributes;if(Tl(i)&&i.remove==="all"&&se(K)){const ie=wt(w.getAttribs(B),ue=>St(K,ue.name.toLowerCase()));if(w.removeAllAttribs(B),Be(ie,ue=>w.setAttrib(B,ue.name,ue.value)),ie.length>0)return Uw.rename("span")}if(i.remove!=="all"){wR(w,B,i,l,p),pR(i.attributes,(ue,be)=>{const{name:Le,value:je}=aj(be,ue,l);if(i.remove_similar||X(je)||!Qn(p)||CT(w.getAttrib(p,Le),je)){if(Le==="class"){const Me=w.getAttrib(B,Le);if(Me){let Ve="";if(Be(Me.split(/\s+/),mt=>{/mce\-\w+/.test(mt)&&(Ve+=(Ve?" ":"")+mt)}),Ve){w.setAttrib(B,Le,Ve);return}}}if(rj.test(Le)&&B.removeAttribute("data-mce-"+Le),Le==="style"&&Sf(["li"])(B)&&w.getStyle(B,"list-style-type")==="none"){B.removeAttribute(Le),w.setStyle(B,"list-style-type","none");return}Le==="class"&&B.removeAttribute("className"),B.removeAttribute(Le)}}),pR(i.classes,ue=>{ue=Ch(ue,l),(!Qn(p)||w.hasClass(p,ue))&&w.removeClass(B,ue)});const ie=w.getAttribs(B);for(let ue=0;ue<ie.length;ue++){const be=ie[ue].nodeName;if(!E.isAttributeInternal(be))return Uw.keep()}}return i.remove!=="none"?(yR(n,B,i),Uw.removed()):Uw.keep()},b8=(n,i,l,d,p)=>{let w;return i.parentNode&&Be(_w(n.dom,i.parentNode).reverse(),E=>{if(!w&&Qn(E)&&E.id!=="_start"&&E.id!=="_end"){const R=Eh(n,E,l,d,p);R&&R.split!==!1&&(w=E)}}),w},Rse=(n,i,l,d)=>gS(n,i,l,d,d).fold(et(d),p=>(n.dom.createFragment().appendChild(d),n.dom.rename(d,p)),et(null)),lj=(n,i,l,d,p,w,E,R)=>{var B,K;let ie,ue;const be=n.dom;if(l){const Le=l.parentNode;for(let je=d.parentNode;je&&je!==Le;je=je.parentNode){let Me=be.clone(je,!1);for(let Ve=0;Ve<i.length&&(Me=Rse(n,i[Ve],R,Me),Me!==null);Ve++);Me&&(ie&&Me.appendChild(ie),ue||(ue=Me),ie=Me)}w&&(!E.mixed||!be.isBlock(l))&&(d=(B=be.split(l,d))!==null&&B!==void 0?B:d),ie&&ue&&((K=p.parentNode)===null||K===void 0||K.insertBefore(ie,p),ue.appendChild(p),Tl(E)&&Vw(n,E,R,ie))}return d},Nse=(n,i,l,d,p)=>{const w=n.formatter.get(i),E=w[0],R=n.dom,B=n.selection,K=Me=>{const Ve=b8(n,Me,i,l,p);return lj(n,w,Ve,Me,Me,!0,E,l)},ie=Me=>Bd(Me)&&Qn(Me)&&(Me.id==="_start"||Me.id==="_end"),ue=Me=>Xt(w,Ve=>wA(n,Ve,l,Me,Me)),be=Me=>{const Ve=Mr(Me.childNodes),vt=ue(Me)||Xt(w,dn=>vT(R,Me,dn)),yt=Me.parentNode;if(!vt&&_e(yt)&&Sw(E)&&ue(yt),E.deep&&Ve.length)for(let dn=0;dn<Ve.length;dn++)be(Ve[dn]);Be(["underline","line-through","overline"],dn=>{Qn(Me)&&n.dom.getStyle(Me,"text-decoration")===dn&&Me.parentNode&&PE(R,Me.parentNode)===dn&&wA(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:dn}},void 0,Me)})},Le=Me=>{const Ve=R.get(Me?"_start":"_end");if(Ve){let mt=Ve[Me?"firstChild":"lastChild"];return ie(mt)&&(mt=mt[Me?"firstChild":"lastChild"]),Sn(mt)&&mt.data.length===0&&(mt=Me?Ve.previousSibling||Ve.nextSibling:Ve.nextSibling||Ve.previousSibling),R.remove(Ve,!0),mt}else return null},je=Me=>{let Ve,mt,vt=Pb(R,Me,w,Me.collapsed);if(E.split){if(vt=mp(vt),Ve=m8(n,vt,!0),mt=m8(n,vt),Ve!==mt){if(Ve=g8(Ve,!0),mt=g8(mt,!1),h8(R,Ve,mt)){const Mt=de.from(Ve.firstChild).getOr(Ve);K(p8(R,Mt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Le(!0);return}if(h8(R,mt,Ve)){const Mt=de.from(mt.lastChild).getOr(mt);K(p8(R,Mt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Le(!1);return}Ve=bR(R,Ve,"span",{id:"_start","data-mce-type":"bookmark"}),mt=bR(R,mt,"span",{id:"_end","data-mce-type":"bookmark"});const yt=R.createRng();yt.setStartAfter(Ve),yt.setEndBefore(mt),n1(R,yt,Mt=>{Be(Mt,dn=>{!Bd(dn)&&!Bd(dn.parentNode)&&K(dn)})}),K(Ve),K(mt),Ve=Le(!0),mt=Le()}else Ve=mt=K(Ve);vt.startContainer=Ve.parentNode?Ve.parentNode:Ve,vt.startOffset=R.nodeIndex(Ve),vt.endContainer=mt.parentNode?mt.parentNode:mt,vt.endOffset=R.nodeIndex(mt)+1}n1(R,vt,yt=>{Be(yt,be)})};if(d){if(bw(d)){const Me=R.createRng();Me.setStartBefore(d),Me.setEndAfter(d),je(Me)}else je(d);kh(n,i,d,l);return}!B.isCollapsed()||!Tl(E)||b0(n).length?(b3(n,()=>RE(n,je),Me=>Tl(E)&&sR(n,i,l,Me)),n.nodeChanged()):n8(n,i,l,p),yA(n,i,l),kh(n,i,d,l)},v8=(n,i,l,d,p)=>{(d||n.selection.isEditable())&&Nse(n,i,l,d,p)},wA=(n,i,l,d,p)=>gS(n,i,l,d,p).fold(qe,w=>(n.dom.rename(d,w),!0),gt),cj=hn.each,uj=(n,i,l,d)=>{const p=w=>{if(Qn(w)&&Qn(w.parentNode)&&um(w)){const E=PE(n,w.parentNode);n.getStyle(w,"color")&&E?n.setStyle(w,"text-decoration",E):n.getStyle(w,"text-decoration")===E&&n.setStyle(w,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(hn.walk(d,p,"childNodes"),p(d))},y8=(n,i,l,d)=>{if(i.styles&&i.styles.backgroundColor){const p=d8(n,"fontSize");mR(d,w=>p(w)&&um(w),gR(n,"backgroundColor",Ch(i.styles.backgroundColor,l)))}},fj=(n,i,l,d)=>{if(Tl(i)&&(i.inline==="sub"||i.inline==="sup")){const p=d8(n,"fontSize");mR(d,E=>p(E)&&um(E),gR(n,"fontSize",""));const w=wt(n.select(i.inline==="sup"?"sub":"sup",d),um);n.remove(w,!0)}},w8=(n,i,l,d)=>{cj(i,p=>{Tl(p)&&cj(n.dom.select(p.inline,d),w=>{dR(w)&&wA(n,p,l,w,p.exact?w:null)}),oj(n.dom,p,d)})},dj=(n,i,l,d,p)=>{const w=p.parentNode;Eh(n,w,l,d)&&wA(n,i,d,p)||i.merge_with_parents&&w&&n.dom.getParent(w,E=>Eh(n,E,l,d)?(wA(n,i,d,p),!0):!1)},Ww=hn.each,_8=(n,i,l,d)=>{if(gC(n)&&Tl(i)&&l.parentNode){const p=Gf(n.schema),w=Ol(Ye.fromDom(l),E=>$c(E.dom));return ns(p,d)&&Ma(Ye.fromDom(l.parentNode),!1)&&!w}else return!1},ec=(n,i,l,d)=>{if(Ww(l.styles,(p,w)=>{n.setStyle(i,w,Ch(p,d))}),l.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},Pse=(n,i,l,d)=>{const p=n.formatter.get(i),w=p[0],E=!d&&n.selection.isCollapsed(),R=n.dom,B=n.selection,K=(je,Me=w)=>{ge(Me.onformat)&&Me.onformat(je,Me,l,d),ec(R,je,Me,l),Ww(Me.attributes,(Ve,mt)=>{R.setAttrib(je,mt,Ch(Ve,l))}),Ww(Me.classes,Ve=>{const mt=Ch(Ve,l);R.hasClass(je,mt)||R.addClass(je,mt)})},ie=(je,Me)=>{let Ve=!1;return Ww(je,mt=>td(mt)?R.getContentEditable(Me)==="false"&&!mt.ceFalseOverride||_e(mt.collapsed)&&mt.collapsed!==E?!0:R.is(Me,mt.selector)&&!$c(Me)?(K(Me,mt),Ve=!0,!1):!0:!1),Ve},ue=je=>{if(F(je)){const Me=R.create(je);return K(Me),Me}else return null},be=(je,Me,Ve)=>{const mt=[];let vt=!0;const yt=w.inline||w.block,Mt=ue(yt),dn=Lt=>$C(w)&&Eh(n,Lt,i,l),zn=(Lt,$t,wn)=>{const go=Cw(w)&&$l(n.schema,Lt)&&fm(n,$t,yt);return wn&&go},Pn=(Lt,$t,wn,go)=>{const Oo=Lt.nodeName.toLowerCase(),Cs=fm(n,yt,Oo)&&fm(n,$t,yt),Us=!Ve&&Sn(Lt)&&kn(Lt.data),Pr=$c(Lt),di=!Tl(w)||!je.isBlock(Lt);return(wn||go)&&Cs&&!Us&&!Pr&&di};n1(je,Me,Lt=>{let $t;const wn=go=>{let Oo=!1,Cs=vt,Us=!1;const Pr=go.parentNode,di=Pr.nodeName.toLowerCase(),al=je.getContentEditable(go);_e(al)&&(Cs=vt,vt=al==="true",Oo=!0,Us=vw(n,go));const Rl=vt&&!Oo;if(ui(go)&&!_8(n,w,go,di)){$t=null,hm(w)&&je.remove(go);return}if(dn(go)){$t=null;return}if(zn(go,di,Rl)){const hc=je.rename(go,yt);K(hc),mt.push(hc),$t=null;return}if(td(w)){let hc=ie(p,go);if(!hc&&_e(Pr)&&Sw(w)&&(hc=ie(p,Pr)),!Tl(w)||hc){$t=null;return}}_e(Mt)&&Pn(go,di,Rl,Us)?($t||($t=je.clone(Mt,!1),Pr.insertBefore($t,go),mt.push($t)),Us&&Oo&&(vt=Cs),$t.appendChild(go)):($t=null,Be(Mr(go.childNodes),wn),Oo&&(vt=Cs),$t=null)};Be(Lt,wn)}),w.links===!0&&Be(mt,Lt=>{const $t=wn=>{wn.nodeName==="A"&&K(wn,w),Be(Mr(wn.childNodes),$t)};$t(Lt)}),Be(mt,Lt=>{const $t=Oo=>{let Cs=0;return Be(Oo.childNodes,Us=>{!dm(Us)&&!Bd(Us)&&Cs++}),Cs},wn=Oo=>eo(Oo.childNodes,NE).filter(Us=>je.getContentEditable(Us)!=="false"&&vT(je,Us,w)).map(Us=>{const Pr=je.clone(Us,!1);return K(Pr),je.replace(Pr,Oo,!0),je.remove(Us,!0),Pr}).getOr(Oo),go=$t(Lt);if((mt.length>1||!je.isBlock(Lt))&&go===0){je.remove(Lt,!0);return}(Tl(w)||hm(w)&&w.wrapper)&&(!w.exact&&go===1&&(Lt=wn(Lt)),w8(n,p,l,Lt),dj(n,w,i,l,Lt),y8(je,w,l,Lt),uj(je,w,l,Lt),fj(je,w,l,Lt),Vw(n,w,l,Lt))})},Le=bw(d)?d:B.getNode();if(R.getContentEditable(Le)==="false"&&!vw(n,Le)){d=Le,ie(p,d),x3(n,i,d,l);return}if(w){if(d)if(bw(d)){if(!ie(p,d)){const je=R.createRng();je.setStartBefore(d),je.setEndAfter(d),be(R,Pb(R,je,p),!0)}}else be(R,d,!0);else!E||!Tl(w)||b0(n).length?(B.setRng(KM(B.getRng())),b3(n,()=>{RE(n,(je,Me)=>{const Ve=Me?je:Pb(R,je,p);be(R,Ve,!1)})},gt),n.nodeChanged()):qW(n,i,l),i8(n.formatter,i).each(je=>{Be(nj(n.selection),Me=>ec(R,Me,je,l))});JW(i,n)}x3(n,i,d,l)},hj=(n,i,l,d)=>{(d||n.selection.isEditable())&&Pse(n,i,l,d)},mj=n=>un(n,"vars"),Ise=(n,i)=>{n.set({}),i.on("NodeChange",l=>{Gb(i,l.element,n.get())}),i.on("FormatApply FormatRemove",l=>{const d=de.from(l.node).map(p=>bw(p)?p:p.startContainer).bind(p=>Qn(p)?de.some(p):de.from(p.parentElement)).getOrThunk(()=>vg(i));Gb(i,d,n.get())})},vg=n=>n.selection.getStart(),_A=(n,i,l,d,p)=>rs(i,R=>{const B=n.formatter.matchNode(R,l,p!=null?p:{},d);return!ye(B)},R=>oR(n,R,l)?!0:d?!1:_e(n.formatter.matchNode(R,l,p,!0))),qb=(n,i)=>{const l=i!=null?i:vg(n);return wt(_w(n.dom,l),d=>Qn(d)&&!Cd(d))},Gb=(n,i,l)=>{const d=qb(n,i);ln(l,(p,w)=>{const E=R=>{const B=_A(n,d,w,R.similar,mj(R)?R.vars:void 0),K=B.isSome();if(R.state.get()!==K){R.state.set(K);const ie=B.getOr(i);mj(R)?R.callback(K,{node:ie,format:w,parents:d}):Be(R.callbacks,ue=>ue(K,{node:ie,format:w,parents:d}))}};Be([p.withSimilar,p.withoutSimilar],E),Be(p.withVars,E)})},gj=(n,i,l,d,p,w)=>{const E=i.get();Be(l.split(","),R=>{const B=po(E,R).getOrThunk(()=>{const ie={withSimilar:{state:Ga(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ga(!1),similar:!1,callbacks:[]},withVars:[]};return E[R]=ie,ie}),K=()=>{const ie=qb(n);return _A(n,ie,R,p,w).isSome()};if(ye(w)){const ie=p?B.withSimilar:B.withoutSimilar;ie.callbacks.push(d),ie.callbacks.length===1&&ie.state.set(K())}else B.withVars.push({state:Ga(K()),similar:p,vars:w,callback:d})}),i.set(E)},pj=(n,i,l)=>{const d=n.get();Be(i.split(","),p=>po(d,p).each(w=>{d[p]={withSimilar:{...w.withSimilar,callbacks:wt(w.withSimilar.callbacks,E=>E!==l)},withoutSimilar:{...w.withoutSimilar,callbacks:wt(w.withoutSimilar.callbacks,E=>E!==l)},withVars:wt(w.withVars,E=>E.callback!==l)}})),n.set(d)},pS=(n,i,l,d,p,w)=>(gj(n,i,l,d,p,w),{unbind:()=>pj(i,l,d)}),bS=(n,i,l,d)=>{const p=n.formatter.get(i);p&&(sR(n,i,l,d)&&(!("toggle"in p[0])||p[0].toggle)?v8(n,i,l,d):hj(n,i,l,d))},jw=hn.explode,_R=()=>{const n={};return{addFilter:(p,w)=>{Be(jw(p),E=>{un(n,E)||(n[E]={name:E,callbacks:[]}),n[E].callbacks.push(w)})},getFilters:()=>uo(n),removeFilter:(p,w)=>{Be(jw(p),E=>{if(un(n,E))if(_e(w)){const R=n[E],B=wt(R.callbacks,K=>K!==w);B.length>0?R.callbacks=B:delete n[E]}else delete n[E]})}}},CR=(n,i)=>{Be(i,l=>{n.attr(l,null)})},C8=(n,i,l)=>{n.addNodeFilter("font",d=>{Be(d,p=>{const w=i.parse(p.attr("style")),E=p.attr("color"),R=p.attr("face"),B=p.attr("size");E&&(w.color=E),R&&(w["font-family"]=R),B&&qc(B).each(K=>{w["font-size"]=l[K-1]}),p.name="span",p.attr("style",i.serialize(w)),CR(p,["color","face","size"])})})},S8=(n,i,l)=>{n.addNodeFilter("strike",d=>{const p=i.type!=="html4";Be(d,w=>{if(p)w.name="s";else{const E=l.parse(w.attr("style"));E["text-decoration"]="line-through",w.name="span",w.attr("style",l.serialize(E))}})})},bj=(n,i,l)=>{var d;const p=Dv();i.convert_fonts_to_spans&&C8(n,p,hn.explode((d=i.font_size_legacy_values)!==null&&d!==void 0?d:"")),S8(n,l,p)},vj=(n,i,l)=>{i.inline_styles&&bj(n,i,l)},SR=(n,i,l)=>{i.addNodeFilter("br",(d,p,w)=>{const E=hn.extend({},l.getBlockElements()),R=l.getNonEmptyElements(),B=l.getWhitespaceElements();E.body=1;const K=ie=>ie.name in E||nr(l,ie);for(let ie=0,ue=d.length;ie<ue;ie++){let be=d[ie],Le=be.parent;if(Le&&K(Le)&&be===Le.lastChild){let je=be.prev;for(;je;){const Me=je.name;if(Me!=="span"||je.attr("data-mce-type")!=="bookmark"){Me==="br"&&(be=null);break}je=je.prev}if(be&&(be.remove(),uS(l,R,B,Le))){const Me=l.getElementRule(Le.name);Me&&(Me.removeEmpty?Le.remove():Me.paddEmpty&&mA(n,w,K,Le))}}else{let je=be;for(;Le&&Le.firstChild===je&&Le.lastChild===je&&(je=Le,!E[Le.name]);)Le=Le.parent;if(je===Le){const Me=new Hd("#text",3);Me.value=Gr,be.replace(Me)}}}})},yj=n=>fetch(n).then(i=>i.ok?i.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${n} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})),wj=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},kR=n=>{const[i,...l]=n.split(","),d=l.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const w=p[2]===";base64",E=w?wj(d):decodeURIComponent(d);return de.some({type:p[1],data:E,base64Encoded:w})}else return de.none()},k8=(n,i,l=!0)=>{let d=i;if(l)try{d=atob(i)}catch{return de.none()}const p=new Uint8Array(d.length);for(let w=0;w<p.length;w++)p[w]=d.charCodeAt(w);return de.some(new Blob([p],{type:n}))},_j=n=>new Promise((i,l)=>{kR(n).bind(({type:d,data:p,base64Encoded:w})=>k8(d,p,w)).fold(()=>l("Invalid data URI"),i)}),E8=n=>xr(n,"blob:")?yj(n):xr(n,"data:")?_j(n):Promise.reject("Unknown URI format"),A8=n=>new Promise((i,l)=>{const d=new FileReader;d.onloadend=()=>{i(d.result)},d.onerror=()=>{var p;l((p=d.error)===null||p===void 0?void 0:p.message)},d.readAsDataURL(n)});let CA=0;const x8=n=>(n||"blobid")+CA++,T8=(n,i,l)=>kR(n).bind(({data:d,type:p,base64Encoded:w})=>{if(i&&!w)return de.none();{const E=w?d:btoa(d);return l(E,p)}}),ER=(n,i,l)=>{const d=n.create(x8(),i,l);return n.add(d),d},D8=(n,i,l=!1)=>T8(i,l,(d,p)=>de.from(n.getByData(d,p)).orThunk(()=>k8(p,d).map(w=>ER(n,w,d)))),O8=(n,i)=>{const l=()=>Promise.reject("Invalid data URI");if(xr(i,"blob:")){const d=n.getByUri(i);return _e(d)?Promise.resolve(d):E8(i).then(p=>A8(p).then(w=>T8(w,!1,E=>de.some(ER(n,p,E))).getOrThunk(l)))}else return xr(i,"data:")?D8(n,i).fold(l,d=>Promise.resolve(d)):Promise.reject("Unknown image data format")},Cj=n=>_e(n.attr("data-mce-bogus")),Sj=n=>n.attr("src")===Xn.transparentSrc||_e(n.attr("data-mce-placeholder")),M8=(n,i)=>{const{blob_cache:l}=i;if(l){const d=p=>{const w=p.attr("src");Sj(p)||Cj(p)||Te(w)||D8(l,w,!0).each(E=>{p.attr("src",E.blobUri())})};n.addAttributeFilter("src",p=>Be(p,d))}},R8=(n,i)=>{const l=n.schema;i.remove_trailing_brs&&SR(i,n,l),n.addAttributeFilter("href",p=>{let w=p.length;const E=B=>B.split(" ").filter(ie=>ie.length>0).concat(["noopener"]).sort().join(" "),R=B=>{const K=B?hn.trim(B):"";return/\b(noopener)\b/g.test(K)?K:E(K)};if(!i.allow_unsafe_link_target)for(;w--;){const B=p[w];B.name==="a"&&B.attr("target")==="_blank"&&B.attr("rel",R(B.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let w=p.length,E,R,B,K;for(;w--;)if(K=p[w],K.name==="a"&&K.firstChild&&!K.attr("href"))for(B=K.parent,E=K.lastChild;E&&B;)R=E.prev,B.insert(E,K),E=R}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let w=p.length,E,R;for(;w--;)if(E=p[w],R=E.parent,R&&(R.name==="ul"||R.name==="ol"))if(E.prev&&E.prev.name==="li")E.prev.append(E);else{const B=new Hd("li",1);B.attr("style","list-style-type: none"),E.wrap(B)}});const d=l.getValidClasses();i.validate&&d&&n.addAttributeFilter("class",p=>{var w;let E=p.length;for(;E--;){const R=p[E],B=(w=R.attr("class"))!==null&&w!==void 0?w:"",K=hn.explode(B," ");let ie="";for(let ue=0;ue<K.length;ue++){const be=K[ue];let Le=!1,je=d["*"];je&&je[be]&&(Le=!0),je=d[R.name],!Le&&je&&je[be]&&(Le=!0),Le&&(ie&&(ie+=" "),ie+=be)}ie.length||(ie=null),R.attr("class",ie)}}),M8(n,i)};function Sy(n){return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Sy(n)}function ST(n,i){return ST=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ST(n,i)}function N8(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function SA(n,i,l){return N8()?SA=Reflect.construct:SA=function(p,w,E){var R=[null];R.push.apply(R,w);var B=Function.bind.apply(p,R),K=new B;return E&&ST(K,E.prototype),K},SA.apply(null,arguments)}function l1(n){return kj(n)||Ej(n)||AR(n)||P8()}function kj(n){if(Array.isArray(n))return Zw(n)}function Ej(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function AR(n,i){if(!!n){if(typeof n=="string")return Zw(n,i);var l=Object.prototype.toString.call(n).slice(8,-1);if(l==="Object"&&n.constructor&&(l=n.constructor.name),l==="Map"||l==="Set")return Array.from(n);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return Zw(n,i)}}function Zw(n,i){(i==null||i>n.length)&&(i=n.length);for(var l=0,d=new Array(i);l<i;l++)d[l]=n[l];return d}function P8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var I8=Object.hasOwnProperty,kA=Object.setPrototypeOf,Aj=Object.isFrozen,xj=Object.getPrototypeOf,ky=Object.getOwnPropertyDescriptor,sd=Object.freeze,c1=Object.seal,EA=Object.create,xR=typeof Reflect<"u"&&Reflect,vS=xR.apply,kT=xR.construct;vS||(vS=function(i,l,d){return i.apply(l,d)}),sd||(sd=function(i){return i}),c1||(c1=function(i){return i}),kT||(kT=function(i,l){return SA(i,l1(l))});var B8=yg(Array.prototype.forEach),Tj=yg(Array.prototype.pop),AA=yg(Array.prototype.push),ET=yg(String.prototype.toLowerCase),TR=yg(String.prototype.match),Ey=yg(String.prototype.replace),L8=yg(String.prototype.indexOf),Dj=yg(String.prototype.trim),Ah=yg(RegExp.prototype.test),DR=Rf(TypeError);function yg(n){return function(i){for(var l=arguments.length,d=new Array(l>1?l-1:0),p=1;p<l;p++)d[p-1]=arguments[p];return vS(n,i,d)}}function Rf(n){return function(){for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];return kT(n,l)}}function Pi(n,i){kA&&kA(n,null);for(var l=i.length;l--;){var d=i[l];if(typeof d=="string"){var p=ET(d);p!==d&&(Aj(i)||(i[l]=p),d=p)}n[d]=!0}return n}function w0(n){var i=EA(null),l;for(l in n)vS(I8,n,[l])&&(i[l]=n[l]);return i}function _0(n,i){for(;n!==null;){var l=ky(n,i);if(l){if(l.get)return yg(l.get);if(typeof l.value=="function")return yg(l.value)}n=xj(n)}function d(p){return console.warn("fallback value for",p),null}return d}var OR=sd(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),rd=sd(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Kb=sd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F8=sd(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),MR=sd(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H8=sd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$8=sd(["#text"]),RR=sd(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),qw=sd(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),AT=sd(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xT=sd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z8=c1(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Oj=c1(/<%[\w\W]*|[\w\W]*%>/gm),NR=c1(/^data-[\-\w.\u00B7-\uFFFF]/),PR=c1(/^aria-[\-\w]+$/),Mj=c1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Rj=c1(/^(?:\w+script|data):/i),C0=c1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),IR=c1(/^html$/i),Nj=function(){return typeof window>"u"?null:window},BR=function(i,l){if(Sy(i)!=="object"||typeof i.createPolicy!="function")return null;var d=null,p="data-tt-policy-suffix";l.currentScript&&l.currentScript.hasAttribute(p)&&(d=l.currentScript.getAttribute(p));var w="dompurify"+(d?"#"+d:"");try{return i.createPolicy(w,{createHTML:function(R){return R}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}};function TT(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nj(),i=function(qt){return TT(qt)};if(i.version="2.3.8",i.removed=[],!n||!n.document||n.document.nodeType!==9)return i.isSupported=!1,i;var l=n.document,d=n.document,p=n.DocumentFragment,w=n.HTMLTemplateElement,E=n.Node,R=n.Element,B=n.NodeFilter,K=n.NamedNodeMap,ie=K===void 0?n.NamedNodeMap||n.MozNamedAttrMap:K,ue=n.HTMLFormElement,be=n.DOMParser,Le=n.trustedTypes,je=R.prototype,Me=_0(je,"cloneNode"),Ve=_0(je,"nextSibling"),mt=_0(je,"childNodes"),vt=_0(je,"parentNode");if(typeof w=="function"){var yt=d.createElement("template");yt.content&&yt.content.ownerDocument&&(d=yt.content.ownerDocument)}var Mt=BR(Le,l),dn=Mt?Mt.createHTML(""):"",zn=d,Pn=zn.implementation,Lt=zn.createNodeIterator,$t=zn.createDocumentFragment,wn=zn.getElementsByTagName,go=l.importNode,Oo={};try{Oo=w0(d).documentMode?d.documentMode:{}}catch{}var Cs={};i.isSupported=typeof vt=="function"&&Pn&&typeof Pn.createHTMLDocument<"u"&&Oo!==9;var Us=z8,Pr=Oj,di=NR,al=PR,Rl=Rj,hc=C0,Mn=Mj,to=null,wr=Pi({},[].concat(l1(OR),l1(rd),l1(Kb),l1(MR),l1($8))),Is=null,yo=Pi({},[].concat(l1(RR),l1(qw),l1(AT),l1(xT))),Rn=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Dn=null,qo=null,Ys=!0,Kr=!0,co=!1,Ws=!1,ii=!1,Ya=!1,Si=!1,Ec=!1,Mh=!1,zd=!1,Cm=!0,Hy=!0,v_=!1,$y={},zy=null,bD=Pi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),vD=null,yD=Pi({},["audio","video","img","source","image","track"]),Cx=null,Sx=Pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kx="http://www.w3.org/1998/Math/MathML",GS="http://www.w3.org/2000/svg",w1="http://www.w3.org/1999/xhtml",KS=w1,y_=!1,cv,Ex=["application/xhtml+xml","text/html"],Ax="text/html",x0,uv=null,xx=d.createElement("form"),Tx=function(qt){return qt instanceof RegExp||qt instanceof Function},Dx=function(qt){uv&&uv===qt||((!qt||Sy(qt)!=="object")&&(qt={}),qt=w0(qt),to="ALLOWED_TAGS"in qt?Pi({},qt.ALLOWED_TAGS):wr,Is="ALLOWED_ATTR"in qt?Pi({},qt.ALLOWED_ATTR):yo,Cx="ADD_URI_SAFE_ATTR"in qt?Pi(w0(Sx),qt.ADD_URI_SAFE_ATTR):Sx,vD="ADD_DATA_URI_TAGS"in qt?Pi(w0(yD),qt.ADD_DATA_URI_TAGS):yD,zy="FORBID_CONTENTS"in qt?Pi({},qt.FORBID_CONTENTS):bD,Dn="FORBID_TAGS"in qt?Pi({},qt.FORBID_TAGS):{},qo="FORBID_ATTR"in qt?Pi({},qt.FORBID_ATTR):{},$y="USE_PROFILES"in qt?qt.USE_PROFILES:!1,Ys=qt.ALLOW_ARIA_ATTR!==!1,Kr=qt.ALLOW_DATA_ATTR!==!1,co=qt.ALLOW_UNKNOWN_PROTOCOLS||!1,Ws=qt.SAFE_FOR_TEMPLATES||!1,ii=qt.WHOLE_DOCUMENT||!1,Ec=qt.RETURN_DOM||!1,Mh=qt.RETURN_DOM_FRAGMENT||!1,zd=qt.RETURN_TRUSTED_TYPE||!1,Si=qt.FORCE_BODY||!1,Cm=qt.SANITIZE_DOM!==!1,Hy=qt.KEEP_CONTENT!==!1,v_=qt.IN_PLACE||!1,Mn=qt.ALLOWED_URI_REGEXP||Mn,KS=qt.NAMESPACE||w1,qt.CUSTOM_ELEMENT_HANDLING&&Tx(qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Rn.tagNameCheck=qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&Tx(qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Rn.attributeNameCheck=qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&typeof qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Rn.allowCustomizedBuiltInElements=qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),cv=Ex.indexOf(qt.PARSER_MEDIA_TYPE)===-1?cv=Ax:cv=qt.PARSER_MEDIA_TYPE,x0=cv==="application/xhtml+xml"?function(vo){return vo}:ET,Ws&&(Kr=!1),Mh&&(Ec=!0),$y&&(to=Pi({},l1($8)),Is=[],$y.html===!0&&(Pi(to,OR),Pi(Is,RR)),$y.svg===!0&&(Pi(to,rd),Pi(Is,qw),Pi(Is,xT)),$y.svgFilters===!0&&(Pi(to,Kb),Pi(Is,qw),Pi(Is,xT)),$y.mathMl===!0&&(Pi(to,MR),Pi(Is,AT),Pi(Is,xT))),qt.ADD_TAGS&&(to===wr&&(to=w0(to)),Pi(to,qt.ADD_TAGS)),qt.ADD_ATTR&&(Is===yo&&(Is=w0(Is)),Pi(Is,qt.ADD_ATTR)),qt.ADD_URI_SAFE_ATTR&&Pi(Cx,qt.ADD_URI_SAFE_ATTR),qt.FORBID_CONTENTS&&(zy===bD&&(zy=w0(zy)),Pi(zy,qt.FORBID_CONTENTS)),Hy&&(to["#text"]=!0),ii&&Pi(to,["html","head","body"]),to.table&&(Pi(to,["tbody"]),delete Dn.tbody),sd&&sd(qt),uv=qt)},wD=Pi({},["mi","mo","mn","ms","mtext"]),_D=Pi({},["foreignobject","desc","title","annotation-xml"]),R$=Pi({},["title","style","font","a","script"]),_1=Pi({},rd);Pi(_1,Kb),Pi(_1,F8);var w_=Pi({},MR);Pi(w_,H8);var Rt=function(qt){var vo=vt(qt);(!vo||!vo.tagName)&&(vo={namespaceURI:w1,tagName:"template"});var ws=ET(qt.tagName),wl=ET(vo.tagName);return qt.namespaceURI===GS?vo.namespaceURI===w1?ws==="svg":vo.namespaceURI===kx?ws==="svg"&&(wl==="annotation-xml"||wD[wl]):Boolean(_1[ws]):qt.namespaceURI===kx?vo.namespaceURI===w1?ws==="math":vo.namespaceURI===GS?ws==="math"&&_D[wl]:Boolean(w_[ws]):qt.namespaceURI===w1?vo.namespaceURI===GS&&!_D[wl]||vo.namespaceURI===kx&&!wD[wl]?!1:!w_[ws]&&(R$[ws]||!_1[ws]):!1},Nt=function(qt){AA(i.removed,{element:qt});try{qt.parentNode.removeChild(qt)}catch{try{qt.outerHTML=dn}catch{qt.remove()}}},Nn=function(qt,vo){try{AA(i.removed,{attribute:vo.getAttributeNode(qt),from:vo})}catch{AA(i.removed,{attribute:null,from:vo})}if(vo.removeAttribute(qt),qt==="is"&&!Is[qt])if(Ec||Mh)try{Nt(vo)}catch{}else try{vo.setAttribute(qt,"")}catch{}},xn=function(qt){var vo,ws;if(Si)qt="<remove></remove>"+qt;else{var wl=TR(qt,/^[\r\n\t ]+/);ws=wl&&wl[0]}cv==="application/xhtml+xml"&&(qt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+qt+"</body></html>");var Sm=Mt?Mt.createHTML(qt):qt;if(KS===w1)try{vo=new be().parseFromString(Sm,cv)}catch{}if(!vo||!vo.documentElement){vo=Pn.createDocument(KS,"template",null);try{vo.documentElement.innerHTML=y_?"":Sm}catch{}}var Vd=vo.body||vo.documentElement;return qt&&ws&&Vd.insertBefore(d.createTextNode(ws),Vd.childNodes[0]||null),KS===w1?wn.call(vo,ii?"html":"body")[0]:ii?vo.documentElement:Vd},Bo=function(qt){return Lt.call(qt.ownerDocument||qt,qt,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null,!1)},dr=function(qt){return qt instanceof ue&&(typeof qt.nodeName!="string"||typeof qt.textContent!="string"||typeof qt.removeChild!="function"||!(qt.attributes instanceof ie)||typeof qt.removeAttribute!="function"||typeof qt.setAttribute!="function"||typeof qt.namespaceURI!="string"||typeof qt.insertBefore!="function")},la=function(qt){return Sy(E)==="object"?qt instanceof E:qt&&Sy(qt)==="object"&&typeof qt.nodeType=="number"&&typeof qt.nodeName=="string"},Ac=function(qt,vo,ws){!Cs[qt]||B8(Cs[qt],function(wl){wl.call(i,vo,ws,uv)})},du=function(qt){var vo;if(Ac("beforeSanitizeElements",qt,null),dr(qt)||Ah(/[\u0080-\uFFFF]/,qt.nodeName))return Nt(qt),!0;var ws=x0(qt.nodeName);if(Ac("uponSanitizeElement",qt,{tagName:ws,allowedTags:to}),qt.hasChildNodes()&&!la(qt.firstElementChild)&&(!la(qt.content)||!la(qt.content.firstElementChild))&&Ah(/<[/\w]/g,qt.innerHTML)&&Ah(/<[/\w]/g,qt.textContent)||ws==="select"&&Ah(/<template/i,qt.innerHTML))return Nt(qt),!0;if(!to[ws]||Dn[ws]){if(!Dn[ws]&&Mx(ws)&&(Rn.tagNameCheck instanceof RegExp&&Ah(Rn.tagNameCheck,ws)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(ws)))return!1;if(Hy&&!zy[ws]){var wl=vt(qt)||qt.parentNode,Sm=mt(qt)||qt.childNodes;if(Sm&&wl)for(var Vd=Sm.length,Nf=Vd-1;Nf>=0;--Nf)wl.insertBefore(Me(Sm[Nf],!0),Ve(qt))}return Nt(qt),!0}return qt instanceof R&&!Rt(qt)||(ws==="noscript"||ws==="noembed")&&Ah(/<\/no(script|embed)/i,qt.innerHTML)?(Nt(qt),!0):(Ws&&qt.nodeType===3&&(vo=qt.textContent,vo=Ey(vo,Us," "),vo=Ey(vo,Pr," "),qt.textContent!==vo&&(AA(i.removed,{element:qt.cloneNode()}),qt.textContent=vo)),Ac("afterSanitizeElements",qt,null),!1)},Ox=function(qt,vo,ws){if(Cm&&(vo==="id"||vo==="name")&&(ws in d||ws in xx))return!1;if(!(Kr&&!qo[vo]&&Ah(di,vo))){if(!(Ys&&Ah(al,vo))){if(!Is[vo]||qo[vo]){if(!(Mx(qt)&&(Rn.tagNameCheck instanceof RegExp&&Ah(Rn.tagNameCheck,qt)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(qt))&&(Rn.attributeNameCheck instanceof RegExp&&Ah(Rn.attributeNameCheck,vo)||Rn.attributeNameCheck instanceof Function&&Rn.attributeNameCheck(vo))||vo==="is"&&Rn.allowCustomizedBuiltInElements&&(Rn.tagNameCheck instanceof RegExp&&Ah(Rn.tagNameCheck,ws)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(ws))))return!1}else if(!Cx[vo]){if(!Ah(Mn,Ey(ws,hc,""))){if(!((vo==="src"||vo==="xlink:href"||vo==="href")&&qt!=="script"&&L8(ws,"data:")===0&&vD[qt])){if(!(co&&!Ah(Rl,Ey(ws,hc,"")))){if(ws)return!1}}}}}}return!0},Mx=function(qt){return qt.indexOf("-")>0},J6=function(qt){var vo,ws,wl,Sm;Ac("beforeSanitizeAttributes",qt,null);var Vd=qt.attributes;if(!!Vd){var Nf={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Is};for(Sm=Vd.length;Sm--;){vo=Vd[Sm];var YS=vo,ad=YS.name,N$=YS.namespaceURI;ws=ad==="value"?vo.value:Dj(vo.value),wl=x0(ad);var P$=ws;if(Nf.attrName=wl,Nf.attrValue=ws,Nf.keepAttr=!0,Nf.forceKeepAttr=void 0,Ac("uponSanitizeAttribute",qt,Nf),ws=Nf.attrValue,!Nf.forceKeepAttr){if(!Nf.keepAttr){Nn(ad,qt);continue}if(Ah(/\/>/i,ws)){Nn(ad,qt);continue}Ws&&(ws=Ey(ws,Us," "),ws=Ey(ws,Pr," "));var Nee=x0(qt.nodeName);if(!Ox(Nee,wl,ws)){Nn(ad,qt);continue}if(ws!==P$)try{N$?qt.setAttributeNS(N$,ad,ws):qt.setAttribute(ad,ws)}catch{Nn(ad,qt)}}}Ac("afterSanitizeAttributes",qt,null)}},Ree=function zs(qt){var vo,ws=Bo(qt);for(Ac("beforeSanitizeShadowDOM",qt,null);vo=ws.nextNode();)Ac("uponSanitizeShadowNode",vo,null),!du(vo)&&(vo.content instanceof p&&zs(vo.content),J6(vo));Ac("afterSanitizeShadowDOM",qt,null)};return i.sanitize=function(zs,qt){var vo,ws,wl,Sm,Vd;if(y_=!zs,y_&&(zs="<!-->"),typeof zs!="string"&&!la(zs)){if(typeof zs.toString!="function")throw DR("toString is not a function");if(zs=zs.toString(),typeof zs!="string")throw DR("dirty is not a string, aborting")}if(!i.isSupported){if(Sy(n.toStaticHTML)==="object"||typeof n.toStaticHTML=="function"){if(typeof zs=="string")return n.toStaticHTML(zs);if(la(zs))return n.toStaticHTML(zs.outerHTML)}return zs}if(Ya||Dx(qt),i.removed=[],typeof zs=="string"&&(v_=!1),v_){if(zs.nodeName){var Nf=x0(zs.nodeName);if(!to[Nf]||Dn[Nf])throw DR("root node is forbidden and cannot be sanitized in-place")}}else if(zs instanceof E)vo=xn("<!---->"),ws=vo.ownerDocument.importNode(zs,!0),ws.nodeType===1&&ws.nodeName==="BODY"||ws.nodeName==="HTML"?vo=ws:vo.appendChild(ws);else{if(!Ec&&!Ws&&!ii&&zs.indexOf("<")===-1)return Mt&&zd?Mt.createHTML(zs):zs;if(vo=xn(zs),!vo)return Ec?null:zd?dn:""}vo&&Si&&Nt(vo.firstChild);for(var YS=Bo(v_?zs:vo);wl=YS.nextNode();)wl.nodeType===3&&wl===Sm||du(wl)||(wl.content instanceof p&&Ree(wl.content),J6(wl),Sm=wl);if(Sm=null,v_)return zs;if(Ec){if(Mh)for(Vd=$t.call(vo.ownerDocument);vo.firstChild;)Vd.appendChild(vo.firstChild);else Vd=vo;return Is.shadowroot&&(Vd=go.call(l,Vd,!0)),Vd}var ad=ii?vo.outerHTML:vo.innerHTML;return ii&&to["!doctype"]&&vo.ownerDocument&&vo.ownerDocument.doctype&&vo.ownerDocument.doctype.name&&Ah(IR,vo.ownerDocument.doctype.name)&&(ad="<!DOCTYPE "+vo.ownerDocument.doctype.name+`>
|
|
`+ad),Ws&&(ad=Ey(ad,Us," "),ad=Ey(ad,Pr," ")),Mt&&zd?Mt.createHTML(ad):ad},i.setConfig=function(zs){Dx(zs),Ya=!0},i.clearConfig=function(){uv=null,Ya=!1},i.isValidAttribute=function(zs,qt,vo){uv||Dx({});var ws=x0(zs),wl=x0(qt);return Ox(ws,wl,vo)},i.addHook=function(zs,qt){typeof qt=="function"&&(Cs[zs]=Cs[zs]||[],AA(Cs[zs],qt))},i.removeHook=function(zs){if(Cs[zs])return Tj(Cs[zs])},i.removeHooks=function(zs){Cs[zs]&&(Cs[zs]=[])},i.removeAllHooks=function(){Cs={}},i}var V8=TT();const LR=hn.each,U8=hn.trim,Pj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Ij={ftp:21,http:80,https:443,mailto:25},Bj=["img","video"],Lj=(n,i)=>_e(n)?!n:_e(i)?!St(Bj,i):!0,Fj=n=>{try{return decodeURIComponent(n)}catch{return unescape(n)}},FR=(n,i,l)=>{const d=Fj(i).replace(/\s/g,"");return n.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(d)?!0:n.allow_html_data_urls?!1:/^data:image\//i.test(d)?Lj(n.allow_svg_data_urls,l)&&/^data:image\/svg\+xml/i.test(d):/^data:/i.test(d)};class u1{static parseDataUri(i){let l;const d=decodeURIComponent(i).split(","),p=/data:([^;]+)/.exec(d[0]);return p&&(l=p[1]),{type:l,data:d[1]}}static isDomSafe(i,l,d={}){if(d.allow_script_urls)return!0;{const p=Yg.decode(i).replace(/[\s\u0000-\u001F]+/g,"");return!FR(d,p,l)}}static getDocumentBaseUrl(i){var l;let d;return i.protocol.indexOf("http")!==0&&i.protocol!=="file:"?d=(l=i.href)!==null&&l!==void 0?l:"":d=i.protocol+"//"+i.host+i.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(d)&&(d=d.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(d)||(d+="/")),d}constructor(i,l={}){this.path="",this.directory="",i=U8(i),this.settings=l;const d=l.base_uri,p=this;if(/^([\w\-]+):([^\/]{2})/i.test(i)||/^\s*#/.test(i)){p.source=i;return}const w=i.indexOf("//")===0;if(i.indexOf("/")===0&&!w&&(i=(d&&d.protocol||"http")+"://mce_host"+i),!/^[\w\-]*:?\/\//.test(i)){const R=d?d.path:new u1(document.location.href).directory;if((d==null?void 0:d.protocol)==="")i="//mce_host"+p.toAbsPath(R,i);else{const B=/([^#?]*)([#?]?.*)/.exec(i);B&&(i=(d&&d.protocol||"http")+"://mce_host"+p.toAbsPath(R,B[1])+B[2])}}i=i.replace(/@@/g,"(mce_at)");const E=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(i);E&&LR(Pj,(R,B)=>{let K=E[B];K&&(K=K.replace(/\(mce_at\)/g,"@@")),p[R]=K}),d&&(p.protocol||(p.protocol=d.protocol),p.userInfo||(p.userInfo=d.userInfo),!p.port&&p.host==="mce_host"&&(p.port=d.port),(!p.host||p.host==="mce_host")&&(p.host=d.host),p.source=""),w&&(p.protocol="")}setPath(i){const l=/^(.*?)\/?(\w+)?$/.exec(i);l&&(this.path=l[0],this.directory=l[1],this.file=l[2]),this.source="",this.getURI()}toRelative(i){if(i==="./")return i;const l=new u1(i,{base_uri:this});if(l.host!=="mce_host"&&this.host!==l.host&&l.host||this.port!==l.port||this.protocol!==l.protocol&&l.protocol!=="")return l.getURI();const d=this.getURI(),p=l.getURI();if(d===p||d.charAt(d.length-1)==="/"&&d.substr(0,d.length-1)===p)return d;let w=this.toRelPath(this.path,l.path);return l.query&&(w+="?"+l.query),l.anchor&&(w+="#"+l.anchor),w}toAbsolute(i,l){const d=new u1(i,{base_uri:this});return d.getURI(l&&this.isSameOrigin(d))}isSameOrigin(i){if(this.host==i.host&&this.protocol==i.protocol){if(this.port==i.port)return!0;const l=this.protocol?Ij[this.protocol]:null;if(l&&(this.port||l)==(i.port||l))return!0}return!1}toRelPath(i,l){let d=0,p="",w,E;const R=i.substring(0,i.lastIndexOf("/")).split("/"),B=l.split("/");if(R.length>=B.length){for(w=0,E=R.length;w<E;w++)if(w>=B.length||R[w]!==B[w]){d=w+1;break}}if(R.length<B.length){for(w=0,E=B.length;w<E;w++)if(w>=R.length||R[w]!==B[w]){d=w+1;break}}if(d===1)return l;for(w=0,E=R.length-(d-1);w<E;w++)p+="../";for(w=d-1,E=B.length;w<E;w++)w!==d-1?p+="/"+B[w]:p+=B[w];return p}toAbsPath(i,l){let d=0;const p=/\/$/.test(l)?"/":"",w=i.split("/"),E=l.split("/"),R=[];LR(w,ue=>{ue&&R.push(ue)});const B=[];for(let ue=E.length-1;ue>=0;ue--)if(!(E[ue].length===0||E[ue]===".")){if(E[ue]===".."){d++;continue}if(d>0){d--;continue}B.push(E[ue])}const K=R.length-d;let ie;return K<=0?ie=Zs(B).join("/"):ie=R.slice(0,K).join("/")+"/"+Zs(B).join("/"),ie.indexOf("/")!==0&&(ie="/"+ie),p&&ie.lastIndexOf("/")!==ie.length-1&&(ie+=p),ie}getURI(i=!1){let l;return(!this.source||i)&&(l="",i||(this.protocol?l+=this.protocol+"://":l+="//",this.userInfo&&(l+=this.userInfo+"@"),this.host&&(l+=this.host),this.port&&(l+=":"+this.port)),this.path&&(l+=this.path),this.query&&(l+="?"+this.query),this.anchor&&(l+="#"+this.anchor),this.source=l),this.source}}const Hj=hn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),HR="data-mce-type";let $R=0;const DT=(n,i,l,d)=>{var p,w,E,R;const B=i.validate,K=l.getSpecialElements();n.nodeType===$u&&!i.allow_conditional_comments&&/^\[if/i.test((p=n.nodeValue)!==null&&p!==void 0?p:"")&&(n.nodeValue=" "+n.nodeValue);const ie=(w=d==null?void 0:d.tagName)!==null&&w!==void 0?w:n.nodeName.toLowerCase();if(n.nodeType!==Hf||ie==="body")return;const ue=Ye.fromDom(n),be=qi(ue,HR),Le=Pl(ue,"data-mce-bogus");if(!be&&F(Le)){Le==="all"?br(ue):ql(ue);return}const je=l.getElementRule(ie);if(B&&!je){un(K,ie)?br(ue):ql(ue);return}else _e(d)&&(d.allowedTags[ie]=!0);if(B&&je&&!be){if(Be((E=je.attributesForced)!==null&&E!==void 0?E:[],Me=>{Dr(ue,Me.name,Me.value==="{$uid}"?`mce_${$R++}`:Me.value)}),Be((R=je.attributesDefault)!==null&&R!==void 0?R:[],Me=>{qi(ue,Me.name)||Dr(ue,Me.name,Me.value==="{$uid}"?`mce_${$R++}`:Me.value)}),je.attributesRequired&&!Xt(je.attributesRequired,Me=>qi(ue,Me))){ql(ue);return}if(je.removeEmptyAttrs&&rc(ue)){ql(ue);return}je.outputName&&je.outputName!==ie&&J_(ue,je.outputName)}},zR=(n,i,l,d,p)=>!(d in Hj&&FR(n,p,l))&&(!n.validate||i.isValid(l,d)||xr(d,"data-")||xr(d,"aria-")),VR=(n,i)=>n.hasAttribute(HR)&&(i==="id"||i==="class"||i==="style"),OT=(n,i)=>n in i.getBoolAttrs(),W8=(n,i,l)=>{const{attributes:d}=n;for(let p=d.length-1;p>=0;p--){const w=d[p],E=w.name,R=w.value;!zR(i,l,n.tagName.toLowerCase(),E,R)&&!VR(n,E)?n.removeAttribute(E):OT(E,l)&&n.setAttribute(E,E)}},j8=(n,i)=>{const l=V8();return l.addHook("uponSanitizeElement",(d,p)=>{DT(d,n,i,p)}),l.addHook("uponSanitizeAttribute",(d,p)=>{const w=d.tagName.toLowerCase(),{attrName:E,attrValue:R}=p;p.keepAttr=zR(n,i,w,E,R),p.keepAttr?(p.allowedAttributes[E]=!0,OT(E,i)&&(p.attrValue=E),n.allow_svg_data_urls&&xr(R,"data:image/svg+xml")&&(p.forceKeepAttr=!0)):VR(d,E)&&(p.forceKeepAttr=!0)}),l},Z8=(n,i)=>{const d={...{IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]}};return d.PARSER_MEDIA_TYPE=i,n.allow_script_urls?d.ALLOWED_URI_REGEXP=/.*/:n.allow_html_data_urls&&(d.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),d},q8=(n,i)=>{if(n.sanitize){const l=j8(n,i);return(d,p)=>{l.sanitize(d,Z8(n,p)),l.removed=[]}}else return(l,d)=>{const p=document.createNodeIterator(l,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let w;for(;w=p.nextNode();)DT(w,n,i),Qn(w)&&W8(w,n,i)}},G8=hn.makeMap,MT=hn.extend,K8=(n,i,l)=>{const d=n.name,p=d in l&&d!=="title"&&d!=="textarea",w=i.childNodes;for(let E=0,R=w.length;E<R;E++){const B=w[E],K=new Hd(B.nodeName.toLowerCase(),B.nodeType);if(Qn(B)){const ie=B.attributes;for(let ue=0,be=ie.length;ue<be;ue++){const Le=ie[ue];K.attr(Le.name,Le.value)}}else Sn(B)?(K.value=B.data,p&&(K.raw=!0)):(th(B)||$m(B)||Sd(B))&&(K.value=B.data);K8(K,B,l),n.append(K)}},RT=(n,i,l)=>{const d=[];for(let p=n,w=p;p;w=p,p=p.walk()){const E=p;Be(i,R=>R(E)),Te(E.parent)&&E!==n?p=w:d.push(E)}for(let p=d.length-1;p>=0;p--){const w=d[p];Be(l,E=>E(w))}},$j=(n,i,l,d)=>{const p=l.validate,w=i.getNonEmptyElements(),E=i.getWhitespaceElements(),R=MT(G8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),B=Gf(i),K=/[ \t\r\n]+/g,ie=/^[ \t\r\n]+/,ue=/[ \t\r\n]+$/,be=vt=>{let yt=vt.parent;for(;_e(yt);){if(yt.name in E)return!0;yt=yt.parent}return!1},Le=vt=>{let yt=vt;for(;_e(yt);){if(yt.name in B)return uS(i,w,E,yt);yt=yt.parent}return!1},je=vt=>vt.name in R||nr(i,vt),Me=(vt,yt)=>{const Mt=yt?vt.prev:vt.next;return _e(Mt)||Te(vt.parent)?!1:je(vt.parent)&&(vt.parent!==n||d.isRootContent===!0)};return[vt=>{var yt;if(vt.type===3&&!be(vt)){let Mt=(yt=vt.value)!==null&&yt!==void 0?yt:"";Mt=Mt.replace(K," "),(xW(vt.prev,je)||Me(vt,!0))&&(Mt=Mt.replace(ie,"")),Mt.length===0?vt.remove():vt.value=Mt}},vt=>{var yt;if(vt.type===1){const Mt=i.getElementRule(vt.name);if(p&&Mt){const dn=uS(i,w,E,vt);Mt.paddInEmptyBlock&&dn&&Le(vt)?mA(l,d,je,vt):Mt.removeEmpty&&dn?je(vt)?vt.remove():vt.unwrap():Mt.paddEmpty&&(dn||cT(vt))&&mA(l,d,je,vt)}}else if(vt.type===3&&!be(vt)){let Mt=(yt=vt.value)!==null&&yt!==void 0?yt:"";(vt.next&&je(vt.next)||Me(vt,!1))&&(Mt=Mt.replace(ue,"")),Mt.length===0?vt.remove():vt.value=Mt}}]},zj=(n,i)=>{var l;const d=(l=i.forced_root_block)!==null&&l!==void 0?l:n.forced_root_block;return d===!1?"":d===!0?"p":d},yS=(n={},i=dh())=>{const l=_R(),d=_R(),p={validate:!0,root_name:"body",sanitize:!0,...n},w=new DOMParser,E=q8(p,i),R=(yt,Mt,dn="html")=>{const zn=dn==="xhtml"?"application/xhtml+xml":"text/html",Pn=un(i.getSpecialElements(),Mt.toLowerCase()),Lt=Pn?`<${Mt}>${yt}</${Mt}>`:yt,$t=dn==="xhtml"?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${Lt}</body></html>`:`<body>${Lt}</body>`,wn=w.parseFromString($t,zn).body;return E(wn,zn),Pn?wn.firstChild:wn},B=l.addFilter,K=l.getFilters,ie=l.removeFilter,ue=d.addFilter,be=d.getFilters,Le=d.removeFilter,je=(yt,Mt)=>{zB(i,yt)&&Mt.push(yt)},Me=(yt,Mt)=>{const dn=F(Mt.attr(HR)),zn=Mt.type===1&&!un(yt,Mt.name)&&!nr(i,Mt);return Mt.type===3||zn&&!dn},Ve=(yt,Mt)=>{const dn=MT(G8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),zn=/^[ \t\r\n]+/,Pn=/[ \t\r\n]+$/;let Lt=yt.firstChild,$t=null;const wn=go=>{var Oo,Cs;go&&(Lt=go.firstChild,Lt&&Lt.type===3&&(Lt.value=(Oo=Lt.value)===null||Oo===void 0?void 0:Oo.replace(zn,"")),Lt=go.lastChild,Lt&&Lt.type===3&&(Lt.value=(Cs=Lt.value)===null||Cs===void 0?void 0:Cs.replace(Pn,"")))};if(!!i.isValidChild(yt.name,Mt.toLowerCase())){for(;Lt;){const go=Lt.next;Me(dn,Lt)?($t||($t=new Hd(Mt,1),$t.attr(p.forced_root_block_attrs),yt.insert($t,Lt)),$t.append(Lt)):(wn($t),$t=null),Lt=go}wn($t)}},vt={schema:i,addAttributeFilter:ue,getAttributeFilters:be,removeAttributeFilter:Le,addNodeFilter:B,getNodeFilters:K,removeNodeFilter:ie,parse:(yt,Mt={})=>{var dn;const zn=p.validate,Pn=(dn=Mt.context)!==null&&dn!==void 0?dn:p.root_name,Lt=R(yt,Pn,Mt.format);ob(i,Lt);const $t=new Hd(Pn,11);K8($t,Lt,i.getSpecialElements()),Lt.innerHTML="";const[wn,go]=$j($t,i,p,Mt),Oo=[],Cs=zn?al=>je(al,Oo):ft,Us={nodes:{},attributes:{}},Pr=al=>kW(K(),be(),al,Us);if(RT($t,[wn,Pr],[go,Cs]),Oo.reverse(),zn&&Oo.length>0)if(Mt.context){const{pass:al,fail:Rl}=gn(Oo,hc=>hc.parent===$t);GM(Rl,i,$t,Pr),Mt.invalid=al.length>0}else GM(Oo,i,$t,Pr);const di=zj(p,Mt);return di&&($t.name==="body"||Mt.isRootContent)&&Ve($t,di),Mt.invalid||lT(Us,Mt),$t}};return R8(vt,p),vj(vt,p,i),vt},Y8=n=>mT(n)?Pw({validate:!1}).serialize(n):n,UR=(n,i,l)=>{const d=Y8(n),p=i(d);if(p.isDefaultPrevented())return p;if(mT(n))if(p.content!==d){const w=yS({validate:!1,forced_root_block:!1,sanitize:l}).parse(p.content,{context:n.name});return{...p,content:w}}else return{...p,content:n};else return p},X8=(n,i)=>{if(i.no_events)return fc.value(i);{const l=fp(n,i);return l.isDefaultPrevented()?fc.error(WO(n,{content:"",...l}).content):fc.value(l)}},J8=(n,i,l)=>l.no_events?i:UR(i,p=>WO(n,{...l,content:p}),Jv(n)).content,WR=(n,i)=>{if(i.no_events)return fc.value(i);{const l=UR(i.content,d=>Vc(n,{...i,content:d}),Jv(n));return l.isDefaultPrevented()?(fu(n,l),fc.error(void 0)):fc.value(l)}},jR=(n,i,l)=>{l.no_events||fu(n,{...l,content:i})},ZR=(n,i,l)=>({element:n,width:i,rows:l}),qR=(n,i)=>({element:n,cells:i}),Bse=(n,i)=>({x:n,y:i}),Q8=(n,i)=>za(n,i).bind(qc).getOr(1),Vj=(n,i,l,d,p)=>{const w=Q8(p,"rowspan"),E=Q8(p,"colspan"),R=n.rows;for(let B=l;B<l+w;B++){R[B]||(R[B]=qR(uc(d),[]));for(let K=i;K<i+E;K++){const ie=R[B].cells;ie[K]=B===l&&K===i?p:ng(p)}}},Uj=(n,i,l)=>{const d=n.rows;return!!(d[l]?d[l].cells:[])[i]},Wj=(n,i,l)=>{for(;Uj(n,i,l);)i++;return i},eL=n=>vn(n,(i,l)=>l.cells.length>i?l.cells.length:i,0),tL=(n,i)=>{const l=n.rows;for(let d=0;d<l.length;d++){const p=l[d].cells;for(let w=0;w<p.length;w++)if(bt(p[w],i))return de.some(Bse(w,d))}return de.none()},nL=(n,i,l,d,p)=>{const w=[],E=n.rows;for(let R=l;R<=p;R++){const B=E[R].cells,K=i<d?B.slice(i,d+1):B.slice(d,i+1);w.push(qR(E[R].element,K))}return w},oL=(n,i,l)=>{const d=i.x,p=i.y,w=l.x,E=l.y,R=p<E?nL(n,d,p,w,E):nL(n,d,E,w,p);return ZR(n.element,eL(R),R)},jj=(n,i)=>{const l=ng(n.element),d=Ye.fromTag("tbody");return Jr(d,i),Qi(l,d),l},Zj=n=>Tt(n.rows,i=>{const l=Tt(i.cells,p=>{const w=uc(p);return zi(w,"colspan"),zi(w,"rowspan"),w}),d=ng(i.element);return Jr(d,l),d}),qj=n=>{const i=ZR(ng(n),0,[]);return Be(hl(n,"tr"),(l,d)=>{Be(hl(l,"td,th"),(p,w)=>{Vj(i,Wj(i,w,d),d,l,p)})}),ZR(i.element,eL(i.rows),i.rows)},Gj=n=>jj(n,Zj(n)),Kj=(n,i,l)=>tL(n,i).bind(d=>tL(n,l).map(p=>oL(n,d,p))),Lse=n=>eo(n,i=>Xr(i)==="ul"||Xr(i)==="ol"),Fse=(n,i)=>eo(n,l=>Xr(l)==="li"&&uy(l,i)).fold(et([]),l=>Lse(n).map(d=>{const p=Ye.fromTag(Xr(d)),w=Wt(Gh(d),(E,R)=>xr(R,"list-style"));return ra(p,w),[Ye.fromTag("li"),p]}).getOr([])),Yj=(n,i)=>{const l=vn(i,(d,p)=>(Qi(p,d),p),n);return i.length>0?Bb([l]):l},Xj=n=>Za(n)?ai(n).filter(Au).fold(et([]),i=>[n,i]):Au(n)?[n]:[],Hse=(n,i)=>{const l=Ye.fromDom(i.commonAncestorContainer),d=Vb(l,n),p=wt(d,$o),w=Fse(d,i),E=p.concat(w.length?w:Xj(l));return Tt(E,ng)},sL=()=>Bb([]),il=(n,i)=>Yj(Ye.fromDom(i.cloneContents()),Hse(n,i)),GR=(n,i)=>Se(i,"table",He(bt,n)),$se=(n,i)=>GR(n,i[0]).bind(l=>{const d=i[0],p=i[i.length-1],w=qj(l);return Kj(w,d,p).map(E=>Bb([Gj(E)]))}).getOrThunk(sL),Jj=(n,i)=>i.length>0&&i[0].collapsed?sL():il(n,i[0]),Qj=(n,i)=>{const l=pw(i,n);return l.length>0?$se(n,l):Jj(n,i)},Yb=(n,i)=>i>=0&&i<n.length&&_h(n.charAt(i)),eZ=n=>Ln(n.innerText),zse=n=>n.map(i=>i.nodeName).getOr("div").toLowerCase(),Bu=n=>de.from(n.selection.getRng()).map(i=>{var l;const d=de.from(n.dom.getParent(i.commonAncestorContainer,n.dom.isBlock)),p=n.getBody(),w=zse(d),E=Ye.fromDom(i.cloneContents());Z3(E),KI(E);const R=n.dom.add(p,w,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},E.dom),B=eZ(R),K=Ln((l=R.textContent)!==null&&l!==void 0?l:"");if(n.dom.remove(R),Yb(K,0)||Yb(K,K.length-1)){const ie=d.getOr(p),ue=eZ(ie),be=ue.indexOf(B);if(be===-1)return B;{const Le=Yb(ue,be-1),je=Yb(ue,be+B.length);return(Le?" ":"")+B+(je?" ":"")}}else return B}).getOr(""),rL=(n,i)=>{const l=n.selection.getRng(),d=n.dom.create("body"),p=n.selection.getSel(),w=W3(n,TE(p)),E=i.contextual?Qj(Ye.fromDom(n.getBody()),w).dom:l.cloneContents();return E&&d.appendChild(E),n.selection.serializer.serialize(d,i)},iL=(n,i)=>{if(i.format==="text")return Bu(n);{const l=rL(n,i);return i.format==="tree"?l:n.selection.isCollapsed()?"":l}},aL=(n,i)=>({...n,format:i,get:!0,selection:!0,getInner:!0}),tZ=(n,i,l={})=>{const d=aL(l,i);return X8(n,d).fold(Et,p=>{const w=iL(n,p);return J8(n,w,p)})},KR=0,xA=1,lL=2,YR=(n,i)=>{const l=n.length+i.length+2,d=new Array(l),p=new Array(l),w=(ie,ue,be)=>({start:ie,end:ue,diag:be}),E=(ie,ue,be,Le,je)=>{const Me=B(ie,ue,be,Le);if(Me===null||Me.start===ue&&Me.diag===ue-Le||Me.end===ie&&Me.diag===ie-be){let Ve=ie,mt=be;for(;Ve<ue||mt<Le;)Ve<ue&&mt<Le&&n[Ve]===i[mt]?(je.push([KR,n[Ve]]),++Ve,++mt):ue-ie>Le-be?(je.push([lL,n[Ve]]),++Ve):(je.push([xA,i[mt]]),++mt)}else{E(ie,Me.start,be,Me.start-Me.diag,je);for(let Ve=Me.start;Ve<Me.end;++Ve)je.push([KR,n[Ve]]);E(Me.end,ue,Me.end-Me.diag,Le,je)}},R=(ie,ue,be,Le)=>{let je=ie;for(;je-ue<Le&&je<be&&n[je]===i[je-ue];)++je;return w(ie,je,ue)},B=(ie,ue,be,Le)=>{const je=ue-ie,Me=Le-be;if(je===0||Me===0)return null;const Ve=je-Me,mt=Me+je,vt=(mt%2===0?mt:mt+1)/2;d[1+vt]=ie,p[1+vt]=ue+1;let yt,Mt,dn,zn,Pn;for(yt=0;yt<=vt;++yt){for(Mt=-yt;Mt<=yt;Mt+=2){for(dn=Mt+vt,Mt===-yt||Mt!==yt&&d[dn-1]<d[dn+1]?d[dn]=d[dn+1]:d[dn]=d[dn-1]+1,zn=d[dn],Pn=zn-ie+be-Mt;zn<ue&&Pn<Le&&n[zn]===i[Pn];)d[dn]=++zn,++Pn;if(Ve%2!==0&&Ve-yt<=Mt&&Mt<=Ve+yt&&p[dn-Ve]<=d[dn])return R(p[dn-Ve],Mt+ie-be,ue,Le)}for(Mt=Ve-yt;Mt<=Ve+yt;Mt+=2){for(dn=Mt+vt-Ve,Mt===Ve-yt||Mt!==Ve+yt&&p[dn+1]<=p[dn-1]?p[dn]=p[dn+1]-1:p[dn]=p[dn-1],zn=p[dn]-1,Pn=zn-ie+be-Mt;zn>=ie&&Pn>=be&&n[zn]===i[Pn];)p[dn]=zn--,Pn--;if(Ve%2===0&&-yt<=Mt&&Mt<=yt&&p[dn]<=d[dn+Ve])return R(p[dn],Mt+ie-be,ue,Le)}}return null},K=[];return E(0,n.length,0,i.length,K),K},cL=n=>Qn(n)?n.outerHTML:Sn(n)?Yg.encodeRaw(n.data,!1):th(n)?"<!--"+n.data+"-->":"",uL=n=>{let i;const l=document.createElement("div"),d=document.createDocumentFragment();for(n&&(l.innerHTML=n);i=l.firstChild;)d.appendChild(i);return d},fL=(n,i,l)=>{const d=uL(i);if(n.hasChildNodes()&&l<n.childNodes.length){const p=n.childNodes[l];n.insertBefore(d,p)}else n.appendChild(d)},XR=(n,i)=>{if(n.hasChildNodes()&&i<n.childNodes.length){const l=n.childNodes[i];n.removeChild(l)}},dL=(n,i)=>{let l=0;Be(n,d=>{d[0]===KR?l++:d[0]===xA?(fL(i,d[1],l),l++):d[0]===lL&&XR(i,l)})},JR=n=>wt(Tt(Mr(n.childNodes),cL),i=>i.length>0),nZ=(n,i)=>{const l=Tt(Mr(i.childNodes),cL);return dL(YR(l,n),i),i},oZ=jt(()=>document.implementation.createHTMLDocument("undo")),sZ=n=>n.indexOf("</iframe>")!==-1,wg=n=>({type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}),rZ=n=>({type:"complete",fragments:null,content:n,bookmark:null,beforeBookmark:null}),NT=n=>{const i=JR(n.getBody()),l=Rs(i,p=>{const w=pM(n.serializer,p);return w.length>0?[w]:[]}),d=l.join("");return sZ(d)?wg(l):rZ(d)},QR=(n,i,l)=>{const d=l?i.beforeBookmark:i.bookmark;i.type==="fragmented"?nZ(i.fragments,n.getBody()):n.setContent(i.content,{format:"raw",no_selection:_e(d)&&t1(d)?!d.isFakeCaret:!0}),d&&(n.selection.moveToBookmark(d),n.selection.scrollIntoView())},e5=n=>n.type==="fragmented"?n.fragments.join(""):n.content,hL=n=>{const i=Ye.fromTag("body",oZ());return _f(i,e5(n)),Be(hl(i,"*[data-mce-bogus]"),ql),Ae(i)},mL=(n,i)=>e5(n)===e5(i),iZ=(n,i)=>hL(n)===hL(i),t5=(n,i)=>!n||!i?!1:mL(n,i)?!0:iZ(n,i),n5=n=>n.get()===0,Gw=(n,i,l)=>{n5(l)&&(n.typing=i)},gL=(n,i)=>{n.typing&&(Gw(n,!1,i),n.add())},aZ=n=>{n.typing&&(n.typing=!1,n.add())},pL=(n,i,l)=>{n5(i)&&l.set(au(n.selection))},o5=(n,i,l,d,p,w,E)=>{const R=NT(n),B=hn.extend(w||{},R);if(!n5(d)||n.removed)return null;const K=i.data[l.get()];if(n.dispatch("BeforeAddUndo",{level:B,lastLevel:K,originalEvent:E}).isDefaultPrevented()||K&&t5(K,B))return null;i.data[l.get()]&&p.get().each(be=>{i.data[l.get()].beforeBookmark=be});const ie=ew(n);if(ie&&i.data.length>ie){for(let be=0;be<i.data.length-1;be++)i.data[be]=i.data[be+1];i.data.length--,l.set(i.data.length)}B.bookmark=au(n.selection),l.get()<i.data.length-1&&(i.data.length=l.get()+1),i.data.push(B),l.set(i.data.length-1);const ue={level:B,lastLevel:K,originalEvent:E};return l.get()>0?(n.setDirty(!0),n.dispatch("AddUndo",ue),n.dispatch("change",ue)):n.dispatch("AddUndo",ue),B},lZ=(n,i,l)=>{i.data=[],l.set(0),i.typing=!1,n.dispatch("ClearUndos")},cZ=(n,i,l,d,p)=>{if(i.transact(d)){const w=i.data[l.get()].bookmark,E=i.data[l.get()-1];QR(n,E,!0),i.transact(p)&&(i.data[l.get()-1].beforeBookmark=w)}},Vse=(n,i,l)=>{let d;return i.get()<l.length-1&&(i.set(i.get()+1),d=l[i.get()],QR(n,d,!1),n.setDirty(!0),n.dispatch("Redo",{level:d})),d},uZ=(n,i,l,d)=>{let p;return i.typing&&(i.add(),i.typing=!1,Gw(i,!1,l)),d.get()>0&&(d.set(d.get()-1),p=i.data[d.get()],QR(n,p,!0),n.setDirty(!0),n.dispatch("Undo",{level:p})),p},fZ=n=>{n.clear(),n.add()},bL=(n,i,l)=>l.get()>0||i.typing&&i.data[0]&&!t5(NT(n),i.data[0]),vL=(n,i)=>i.get()<n.data.length-1&&!n.typing,dZ=(n,i,l)=>(gL(n,i),n.beforeChange(),n.ignore(l),n.add()),Kw=(n,i)=>{try{n.set(n.get()+1),i()}finally{n.set(n.get()-1)}},wS=(n,i)=>{const l=n.dom,d=_e(i)?i:n.getBody();Be(l.select("table,a",d),p=>{switch(p.nodeName){case"TABLE":const w=Kv(n),E=l.getAttrib(p,"border");(!E||E==="0")&&n.hasVisual?l.addClass(p,w):l.removeClass(p,w);break;case"A":if(!l.getAttrib(p,"href")){const R=l.getAttrib(p,"name")||p.id,B=kb(n);R&&n.hasVisual?l.addClass(p,B):l.removeClass(p,B)}break}}),n.dispatch("VisualAid",{element:i,hasVisual:n.hasVisual})},_S=n=>({init:{bindEvents:ft},undoManager:{beforeChange:(i,l)=>pL(n,i,l),add:(i,l,d,p,w,E)=>o5(n,i,l,d,p,w,E),undo:(i,l,d)=>uZ(n,i,l,d),redo:(i,l)=>Vse(n,i,l),clear:(i,l)=>lZ(n,i,l),reset:i=>fZ(i),hasUndo:(i,l)=>bL(n,i,l),hasRedo:(i,l)=>vL(i,l),transact:(i,l,d)=>dZ(i,l,d),ignore:(i,l)=>Kw(i,l),extra:(i,l,d,p)=>cZ(n,i,l,d,p)},formatter:{match:(i,l,d,p)=>sR(n,i,l,d,p),matchAll:(i,l)=>zw(n,i,l),matchNode:(i,l,d,p)=>Eh(n,i,l,d,p),canApply:i=>_y(n,i),closest:i=>jW(n,i),apply:(i,l,d)=>hj(n,i,l,d),remove:(i,l,d,p)=>v8(n,i,l,d,p),toggle:(i,l,d)=>bS(n,i,l,d),formatChanged:(i,l,d,p,w)=>pS(n,i,l,d,p,w)},editor:{getContent:i=>KU(n,i),setContent:(i,l)=>WW(n,i,l),insertContent:(i,l)=>QB(n,i,l),addVisual:i=>wS(n,i)},selection:{getContent:(i,l)=>tZ(n,i,l)},autocompleter:{addDecoration:i=>HU(n,i),removeDecoration:()=>zU(n,Ye.fromDom(n.getBody()))},raw:{getModel:()=>de.none()}}),yL=n=>{const i=K=>oe(K)?K:{},{init:l,undoManager:d,formatter:p,editor:w,selection:E,autocompleter:R,raw:B}=n;return{init:{bindEvents:l.bindEvents},undoManager:{beforeChange:d.beforeChange,add:d.add,undo:d.undo,redo:d.redo,clear:d.clear,reset:d.reset,hasUndo:d.hasUndo,hasRedo:d.hasRedo,transact:(K,ie,ue)=>d.transact(ue),ignore:(K,ie)=>d.ignore(ie),extra:(K,ie,ue,be)=>d.extra(ue,be)},formatter:{match:(K,ie,ue,be)=>p.match(K,i(ie),be),matchAll:p.matchAll,matchNode:p.matchNode,canApply:K=>p.canApply(K),closest:K=>p.closest(K),apply:(K,ie,ue)=>p.apply(K,i(ie)),remove:(K,ie,ue,be)=>p.remove(K,i(ie)),toggle:(K,ie,ue)=>p.toggle(K,i(ie)),formatChanged:(K,ie,ue,be,Le)=>p.formatChanged(ie,ue,be,Le)},editor:{getContent:K=>w.getContent(K),setContent:(K,ie)=>({content:w.setContent(K,ie),html:""}),insertContent:(K,ie)=>(w.insertContent(K),""),addVisual:w.addVisual},selection:{getContent:(K,ie)=>E.getContent(ie)},autocompleter:{addDecoration:R.addDecoration,removeDecoration:R.removeDecoration},raw:{getModel:()=>de.some(B.getRawModel())}}},wL=()=>{const n=et(null),i=et("");return{init:{bindEvents:ft},undoManager:{beforeChange:ft,add:n,undo:n,redo:n,clear:ft,reset:ft,hasUndo:qe,hasRedo:qe,transact:n,ignore:ft,extra:ft},formatter:{match:qe,matchAll:et([]),matchNode:et(void 0),canApply:qe,closest:i,apply:ft,remove:ft,toggle:ft,formatChanged:et({unbind:ft})},editor:{getContent:i,setContent:et({content:"",html:""}),insertContent:et(""),addVisual:ft},selection:{getContent:i},autocompleter:{addDecoration:ft,removeDecoration:ft},raw:{getModel:et(de.none())}}},S0=n=>un(n.plugins,"rtc"),_L=n=>po(n.plugins,"rtc").bind(i=>de.from(i.setup)),hZ=n=>{const i=n;return _L(n).fold(()=>(i.rtcInstance=_S(n),de.none()),l=>(i.rtcInstance=wL(),de.some(()=>l().then(d=>(i.rtcInstance=yL(d),d.rtc.isRemote)))))},s5=n=>n.rtcInstance?n.rtcInstance:_S(n),tc=n=>{const i=n.rtcInstance;if(i)return i;throw new Error("Failed to get RTC instance not yet initialized.")},mZ=(n,i,l)=>{tc(n).undoManager.beforeChange(i,l)},CL=(n,i,l,d,p,w,E)=>tc(n).undoManager.add(i,l,d,p,w,E),gZ=(n,i,l,d)=>tc(n).undoManager.undo(i,l,d),pZ=(n,i,l)=>tc(n).undoManager.redo(i,l),TA=(n,i,l)=>{tc(n).undoManager.clear(i,l)},SL=(n,i)=>{tc(n).undoManager.reset(i)},kL=(n,i,l)=>tc(n).undoManager.hasUndo(i,l),bZ=(n,i,l)=>tc(n).undoManager.hasRedo(i,l),vZ=(n,i,l,d)=>tc(n).undoManager.transact(i,l,d),yZ=(n,i,l)=>{tc(n).undoManager.ignore(i,l)},EL=(n,i,l,d,p)=>{tc(n).undoManager.extra(i,l,d,p)},wZ=(n,i,l,d,p)=>tc(n).formatter.match(i,l,d,p),_Z=(n,i,l)=>tc(n).formatter.matchAll(i,l),CZ=(n,i,l,d,p)=>tc(n).formatter.matchNode(i,l,d,p),SZ=(n,i)=>tc(n).formatter.canApply(i),Use=(n,i)=>tc(n).formatter.closest(i),f1=(n,i,l,d)=>{tc(n).formatter.apply(i,l,d)},r5=(n,i,l,d,p)=>{tc(n).formatter.remove(i,l,d,p)},kZ=(n,i,l,d)=>{tc(n).formatter.toggle(i,l,d)},EZ=(n,i,l,d,p,w)=>tc(n).formatter.formatChanged(i,l,d,p,w),AZ=(n,i)=>s5(n).editor.getContent(i),xZ=(n,i,l)=>s5(n).editor.setContent(i,l),ei=(n,i,l)=>s5(n).editor.insertContent(i,l),Wse=(n,i,l)=>tc(n).selection.getContent(i,l),TZ=(n,i)=>tc(n).editor.addVisual(i),AL=n=>tc(n).init.bindEvents(),Ka=(n,i)=>tc(n).autocompleter.addDecoration(i),DZ=n=>tc(n).autocompleter.removeDecoration(),DA=(n,i={})=>{const l=i.format?i.format:"html";return Wse(n,l,i)},xL=n=>n.dom.length===0?(br(n),de.none()):de.some(n),OZ=(n,i)=>n.filter(l=>fy.isBookmarkNode(l.dom)).bind(i?vd:ya),MZ=(n,i,l,d)=>{const p=n.dom,w=i.dom,E=d?p.length:w.length;d?(J3(p,w,!1,!d),l.setStart(w,E)):(J3(w,p,!1,!d),l.setEnd(w,E))},TL=(n,i)=>{ai(n).each(l=>{const d=n.dom;i&&nA(l,Vt(d,0))?sA(d,0):!i&&oA(l,Vt(d,d.length))&&X3(d,d.length)})},Xb=(n,i,l,d)=>{n.bind(p=>((d?X3:sA)(p.dom,d?p.dom.length:0),i.filter(el).map(E=>MZ(p,E,l,d)))).orThunk(()=>OZ(i,d).or(i).filter(el).map(w=>TL(w,d)))},xh=(n,i)=>{const l=de.from(i.firstChild).map(Ye.fromDom),d=de.from(i.lastChild).map(Ye.fromDom);n.deleteContents(),n.insertNode(i);const p=l.bind(ya).filter(el).bind(xL),w=d.bind(vd).filter(el).bind(xL);Xb(p,l,n,!0),Xb(w,d,n,!1),n.collapse(!1)},OA=(n,i)=>({format:"html",...n,set:!0,selection:!0,content:i}),Ay=(n,i)=>{if(i.format!=="raw"){const l=n.selection.getRng(),d=n.dom.getParent(l.commonAncestorContainer,n.dom.isBlock),p=d?{context:d.nodeName.toLowerCase()}:{},w=n.parser.parse(i.content,{forced_root_block:!1,...p,...i});return Pw({validate:!1},n.schema).serialize(w)}else return i.content},k0=(n,i,l={})=>{const d=OA(l,i);WR(n,d).each(p=>{const w=Ay(n,p),E=n.selection.getRng();xh(E,E.createContextualFragment(w)),n.selection.setRng(E),lf(n,E),jR(n,w,p)})},CS=(n,i,l)=>{if(un(n,i)){const d=wt(n[i],p=>p!==l);d.length===0?delete n[i]:n[i]=d}};var i5=(n,i)=>{let l,d;const p=(R,B)=>eo(B,K=>n.is(K,R)),w=R=>n.getParents(R,void 0,n.getRoot()),E=()=>{l={},d={},i.on("NodeChange",R=>{const B=R.element,K=w(B),ie={};ln(l,(ue,be)=>{p(be,K).each(Le=>{d[be]||(Be(ue,je=>{je(!0,{node:Le,selector:be,parents:K})}),d[be]=ue),ie[be]=ue})}),ln(d,(ue,be)=>{ie[be]||(delete d[be],Be(ue,Le=>{Le(!1,{node:B,selector:be,parents:K})}))})})};return{selectorChangedWithUnbind:(R,B)=>(l||E(),l[R]||(l[R]=[]),l[R].push(B),p(R,w(i.selection.getStart())).each(()=>{d[R]=l[R]}),{unbind:()=>{CS(l,R,B),CS(d,R,B)}})}};const PT=n=>!!(n&&n.ownerDocument)&&cn(Ye.fromDom(n.ownerDocument),Ye.fromDom(n)),DL=n=>n?PT(n.startContainer)&&PT(n.endContainer):!1,a5=(n,i,l,d)=>{let p,w;const{selectorChangedWithUnbind:E}=i5(n,d),R=(Mn,to)=>{const wr=n.createRng();_e(Mn)&&_e(to)?(wr.setStart(Mn,to),wr.setEnd(Mn,to),Mt(wr),mt(!1)):(ME(n,wr,d.getBody(),!0),Mt(wr))},B=Mn=>DA(d,Mn),K=(Mn,to)=>k0(d,Mn,to),ie=Mn=>FI(d.getBody(),yt(),Mn),ue=Mn=>HI(d.getBody(),yt(),Mn),be=(Mn,to)=>Rl.getBookmark(Mn,to),Le=Mn=>Rl.moveToBookmark(Mn),je=(Mn,to)=>(RU(n,Mn,to).each(Mt),Mn),Me=()=>{const Mn=yt(),to=vt();return!Mn||Mn.item?!1:Mn.compareEndPoints?Mn.compareEndPoints("StartToEnd",Mn)===0:!to||Mn.collapsed},Ve=()=>{const Mn=yt(),to=d.getBody().querySelectorAll('[data-mce-selected="1"]');return to.length>0?Js(to,wr=>n.isEditable(wr.parentElement)):Mn.startContainer===Mn.endContainer?n.isEditable(Mn.startContainer):n.isEditable(Mn.startContainer)&&n.isEditable(Mn.endContainer)},mt=Mn=>{const to=yt();to.collapse(!!Mn),Mt(to)},vt=()=>i.getSelection?i.getSelection():i.document.selection,yt=()=>{let Mn;const to=(Is,yo,Rn)=>{try{return yo.compareBoundaryPoints(Is,Rn)}catch{return-1}},wr=i.document;if(_e(d.bookmark)&&!Nw(d)){const Is=F3(d);if(Is.isSome())return Is.map(yo=>W3(d,[yo])[0]).getOr(wr.createRange())}try{const Is=vt();Is&&!_d(Is.anchorNode)&&(Is.rangeCount>0?Mn=Is.getRangeAt(0):Mn=wr.createRange(),Mn=W3(d,[Mn])[0])}catch{}if(Mn||(Mn=wr.createRange()),Zu(Mn.startContainer)&&Mn.collapsed){const Is=n.getRoot();Mn.setStart(Is,0),Mn.setEnd(Is,0)}return p&&w&&(to(Mn.START_TO_START,Mn,p)===0&&to(Mn.END_TO_END,Mn,p)===0?Mn=w:(p=null,w=null)),Mn},Mt=(Mn,to)=>{if(!DL(Mn))return;const wr=vt();if(Mn=d.dispatch("SetSelectionRange",{range:Mn,forward:to}).range,wr){w=Mn;try{wr.removeAllRanges(),wr.addRange(Mn)}catch{}to===!1&&wr.extend&&(wr.collapse(Mn.endContainer,Mn.endOffset),wr.extend(Mn.startContainer,Mn.startOffset)),p=wr.rangeCount>0?wr.getRangeAt(0):null}if(!Mn.collapsed&&Mn.startContainer===Mn.endContainer&&(wr==null?void 0:wr.setBaseAndExtent)&&Mn.endOffset-Mn.startOffset<2&&Mn.startContainer.hasChildNodes()){const yo=Mn.startContainer.childNodes[Mn.startOffset];yo&&yo.nodeName==="IMG"&&(wr.setBaseAndExtent(Mn.startContainer,Mn.startOffset,Mn.endContainer,Mn.endOffset),(wr.anchorNode!==Mn.startContainer||wr.focusNode!==Mn.endContainer)&&wr.setBaseAndExtent(yo,0,yo,1))}d.dispatch("AfterSetSelectionRange",{range:Mn,forward:to})},dn=Mn=>(K(n.getOuterHTML(Mn)),Mn),zn=()=>MU(d.getBody(),yt()),Pn=(Mn,to)=>zI(n,yt(),Mn,to),Lt=()=>{const Mn=vt(),to=Mn==null?void 0:Mn.anchorNode,wr=Mn==null?void 0:Mn.focusNode;if(!Mn||!to||!wr||_d(to)||_d(wr))return!0;const Is=n.createRng(),yo=n.createRng();try{Is.setStart(to,Mn.anchorOffset),Is.collapse(!0),yo.setStart(wr,Mn.focusOffset),yo.collapse(!0)}catch{return!0}return Is.compareBoundaryPoints(Is.START_TO_START,yo)<=0},al={dom:n,win:i,serializer:l,editor:d,expand:(Mn={type:"word"})=>Mt(y(n).expand(yt(),Mn)),collapse:mt,setCursorLocation:R,getContent:B,setContent:K,getBookmark:be,moveToBookmark:Le,select:je,isCollapsed:Me,isEditable:Ve,isForward:Lt,setNode:dn,getNode:zn,getSel:vt,setRng:Mt,getRng:yt,getStart:ie,getEnd:ue,getSelectedBlocks:Pn,normalize:()=>{const Mn=yt(),to=vt();if(!h3(to)&&LC(d)){const wr=QC(n,Mn);return wr.each(Is=>{Mt(Is,Lt())}),wr.getOr(Mn)}return Mn},selectorChanged:(Mn,to)=>(E(Mn,to),al),selectorChangedWithUnbind:E,getScrollContainer:()=>{let Mn,to=n.getRoot();for(;to&&to.nodeName!=="BODY";){if(to.scrollHeight>to.clientHeight){Mn=to;break}to=to.parentNode}return Mn},scrollIntoView:(Mn,to)=>{_e(Mn)?gm(d,Mn,to):lf(d,yt(),to)},placeCaretAt:(Mn,to)=>Mt(iM(Mn,to,d.getDoc())),getBoundingClientRect:()=>{const Mn=yt();return Mn.collapsed?Vt.fromRangeStart(Mn).getClientRects()[0]:Mn.getBoundingClientRect()},destroy:()=>{i=p=w=null,hc.destroy()}},Rl=fy(al),hc=jE(al,d);return al.bookmarkManager=Rl,al.controlSelection=hc,al},RZ=(n,i,l)=>{n.addAttributeFilter("data-mce-tabindex",(d,p)=>{let w=d.length;for(;w--;){const E=d[w];E.attr("tabindex",E.attr("data-mce-tabindex")),E.attr(p,null)}}),n.addAttributeFilter("src,href,style",(d,p)=>{const w="data-mce-"+p,E=i.url_converter,R=i.url_converter_scope;let B=d.length;for(;B--;){const K=d[B];let ie=K.attr(w);ie!==void 0?(K.attr(p,ie.length>0?ie:null),K.attr(w,null)):(ie=K.attr(p),p==="style"?ie=l.serializeStyle(l.parseStyle(ie),K.name):E&&(ie=E.call(R,ie,p,K.name)),K.attr(p,ie.length>0?ie:null))}}),n.addAttributeFilter("class",d=>{let p=d.length;for(;p--;){const w=d[p];let E=w.attr("class");E&&(E=E.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),w.attr("class",E.length>0?E:null))}}),n.addAttributeFilter("data-mce-type",(d,p,w)=>{let E=d.length;for(;E--;){const R=d[E];R.attr("data-mce-type")==="bookmark"&&!w.cleanup&&(de.from(R.firstChild).exists(K=>{var ie;return!kn((ie=K.value)!==null&&ie!==void 0?ie:"")})?R.unwrap():R.remove())}}),n.addNodeFilter("noscript",d=>{var p;let w=d.length;for(;w--;){const E=d[w].firstChild;E&&(E.value=Yg.decode((p=E.value)!==null&&p!==void 0?p:""))}}),n.addNodeFilter("script,style",(d,p)=>{var w;const E=B=>B.replace(/(<!--\[CDATA\[|\]\]-->)/g,`
|
|
`).replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let R=d.length;for(;R--;){const B=d[R],K=B.firstChild,ie=(w=K==null?void 0:K.value)!==null&&w!==void 0?w:"";if(p==="script"){const ue=B.attr("type");ue&&B.attr("type",ue==="mce-no/type"?null:ue.replace(/^mce\-/,"")),i.element_format==="xhtml"&&K&&ie.length>0&&(K.value=`// <![CDATA[
|
|
`+E(ie)+`
|
|
// ]]>`)}else i.element_format==="xhtml"&&K&&ie.length>0&&(K.value=`<!--
|
|
`+E(ie)+`
|
|
-->`)}}),n.addNodeFilter("#comment",d=>{let p=d.length;for(;p--;){const w=d[p],E=w.value;i.preserve_cdata&&(E==null?void 0:E.indexOf("[CDATA["))===0?(w.name="#cdata",w.type=4,w.value=l.decode(E.replace(/^\[CDATA\[|\]\]$/g,""))):(E==null?void 0:E.indexOf("mce:protected "))===0&&(w.name="#text",w.type=3,w.raw=!0,w.value=unescape(E).substr(14))}}),n.addNodeFilter("xml:namespace,input",(d,p)=>{let w=d.length;for(;w--;){const E=d[w];E.type===7?E.remove():E.type===1&&p==="input"&&!E.attr("type")&&E.attr("type","text")}}),n.addAttributeFilter("data-mce-type",d=>{Be(d,p=>{p.attr("data-mce-type")==="format-caret"&&(p.isEmpty(n.schema.getNonEmptyElements())?p.remove():p.unwrap())})}),n.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(d,p)=>{let w=d.length;for(;w--;)d[w].attr(p,null)}),i.remove_trailing_brs&&SR(i,n,n.schema)},NZ=n=>{const i=d=>(d==null?void 0:d.name)==="br",l=n.lastChild;if(i(l)){const d=l.prev;i(d)&&(l.remove(),d.remove())}},OL=(n,i,l)=>{let d;const p=n.dom;let w=i.cloneNode(!0);const E=document.implementation;if(E.createHTMLDocument){const R=E.createHTMLDocument("");hn.each(w.nodeName==="BODY"?w.childNodes:[w],B=>{R.body.appendChild(R.importNode(B,!0))}),w.nodeName!=="BODY"?w=R.body.firstChild:w=R.body,d=p.doc,p.doc=R}return k3(n,{...l,node:w}),d&&(p.doc=d),w},ML=(n,i)=>_e(n)&&n.hasEventListeners("PreProcess")&&!i.no_events,RL=(n,i,l)=>ML(n,l)?OL(n,i,l):i,NL=(n,i,l)=>{hn.inArray(i,l)===-1&&(n.addAttributeFilter(l,(d,p)=>{let w=d.length;for(;w--;)d[w].attr(p,null)}),i.push(l))},l5=(n,i,l)=>!i.no_events&&n?VE(n,{...i,content:l}).content:l,jse=(n,i,l)=>{const d=Ln(l.getInner?i.innerHTML:n.getOuterHTML(i));return l.selection||Jc(Ye.fromDom(i))?d:hn.trim(d)},PZ=(n,i,l)=>{const d=l.selection?{forced_root_block:!1,...l}:l,p=n.parse(i,d);return NZ(p),p},Zse=(n,i,l)=>Pw(n,i).serialize(l),IZ=(n,i,l,d,p)=>{const w=Zse(i,l,d);return l5(n,p,w)},BZ=(n,i)=>{const l=["data-mce-selected"],d={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...n},p=i&&i.dom?i.dom:Lr.DOM,w=i&&i.schema?i.schema:dh(d),E=yS(d,w);RZ(E,d,p);const R=(B,K={})=>{const ie={format:"html",...K},ue=RL(i,B,ie),be=jse(p,ue,ie),Le=PZ(E,be,ie);return ie.format==="tree"?Le:IZ(i,d,w,Le,ie)};return{schema:w,addNodeFilter:E.addNodeFilter,addAttributeFilter:E.addAttributeFilter,serialize:R,addRules:w.addValidElements,setRules:w.setValidElements,addTempAttr:He(NL,E,l),getTempAttrs:et(l),getNodeFilters:E.getNodeFilters,getAttributeFilters:E.getAttributeFilters,removeNodeFilter:E.removeNodeFilter,removeAttributeFilter:E.removeAttributeFilter}},d1=(n,i)=>{const l=BZ(n,i);return{schema:l.schema,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:l.serialize,addRules:l.addRules,setRules:l.setRules,addTempAttr:l.addTempAttr,getTempAttrs:l.getTempAttrs,getNodeFilters:l.getNodeFilters,getAttributeFilters:l.getAttributeFilters,removeNodeFilter:l.removeNodeFilter,removeAttributeFilter:l.removeAttributeFilter}},qse="html",Gse=(n,i)=>({...n,format:i,get:!0,getInner:!0}),LZ=(n,i={})=>{const l=i.format?i.format:qse,d=Gse(i,l);return X8(n,d).fold(Et,p=>{const w=AZ(n,p);return J8(n,w,p)})},MA="html",FZ=(n,i)=>({format:MA,...n,set:!0,content:i}),IT=(n,i,l={})=>{const d=FZ(l,i);return WR(n,d).map(p=>{const w=xZ(n,p.content,p);return jR(n,w.html,p),w.content}).getOr(i)},PL="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),IL="template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),HZ="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),BL=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],Jb=(n,i)=>{const l=wt(i,d=>un(n,d));return Ns(l)},$Z=n=>{const i=Jb(n,PL),l=n.forced_root_block;return(l===!1||l==="")&&i.push("forced_root_block (false only)"),Ns(i)},zZ=n=>Jb(n,IL),LL=(n,i)=>{const l=hn.makeMap(n.plugins," "),p=wt(i,w=>un(l,w));return Ns(p)},VZ=n=>LL(n,HZ),UZ=n=>LL(n,BL.map(i=>i.name)),WZ=(n,i)=>{const l=$Z(n),d=VZ(i),p=d.length>0,w=l.length>0,E=i.theme==="mobile";if(p||w||E){const R=`
|
|
- `,B=E?`
|
|
|
|
Themes:${R}mobile`:"",K=p?`
|
|
|
|
Plugins:${R}${d.join(R)}`:"",ie=w?`
|
|
|
|
Options:${R}${l.join(R)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+B+K+ie)}},jZ=n=>eo(BL,i=>i.name===n).fold(()=>n,i=>i.replacedWith?`${n}, replaced by ${i.replacedWith}`:n),ZZ=(n,i)=>{const l=zZ(n),d=UZ(i),p=d.length>0,w=l.length>0;if(p||w){const E=`
|
|
- `,R=p?`
|
|
|
|
Plugins:${E}${d.map(jZ).join(E)}`:"",B=w?`
|
|
|
|
Options:${E}${l.join(E)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+R+B)}},qZ=(n,i)=>{WZ(n,i),ZZ(n,i)},BT=Lr.DOM,GZ=n=>{BT.setStyle(n.id,"display",n.orgDisplay)},c5=n=>de.from(n).each(i=>i.destroy()),RA=n=>{const i=n;i.contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null;const l=n.selection;if(l){const d=l.dom;i.selection=l.win=l.dom=d.doc=null}},KZ=n=>{const i=n.formElement;i&&(i._mceOldSubmit&&(i.submit=i._mceOldSubmit,delete i._mceOldSubmit),BT.unbind(i,"submit reset",n.formEventDelegate))},u5=n=>{if(!n.removed){const{_selectionOverrides:i,editorUpload:l}=n,d=n.getBody(),p=n.getElement();d&&n.save({is_removing:!0}),n.removed=!0,n.unbindAllNativeEvents(),n.hasHiddenInput&&_e(p==null?void 0:p.nextSibling)&&BT.remove(p.nextSibling),E3(n),n.editorManager.remove(n),!n.inline&&d&&GZ(n),UC(n),BT.remove(n.getContainer()),c5(i),c5(l),n.destroy()}},YZ=(n,i)=>{const{selection:l,dom:d}=n;if(!n.destroyed){if(!i&&!n.removed){n.remove();return}i||(n.editorManager.off("beforeunload",n._beforeUnload),n.theme&&n.theme.destroy&&n.theme.destroy(),c5(l),c5(d)),KZ(n),RA(n),n.destroyed=!0}},LT=(()=>{const n={};return{add:(p,w)=>{n[p]=w},get:p=>n[p]?n[p]:{icons:{}},has:p=>un(n,p)}})(),SS=Na.ModelManager,xy=(n,i)=>i.dom[n],Ty=(n,i)=>parseInt(Ri(i,n),10),FT=He(xy,"clientWidth"),HT=He(xy,"clientHeight"),Yw=He(Ty,"margin-top"),Xw=He(Ty,"margin-left"),$T=n=>n.dom.getBoundingClientRect(),zT=(n,i,l)=>{const d=FT(n),p=HT(n);return i>=0&&l>=0&&i<=d&&l<=p},FL=(n,i,l,d)=>{const p=$T(i),w=n?p.left+i.dom.clientLeft+Xw(i):0,E=n?p.top+i.dom.clientTop+Yw(i):0,R=l-w,B=d-E;return{x:R,y:B}},f5=(n,i,l)=>{const d=Ye.fromDom(n.getBody()),p=n.inline?d:er(d),w=FL(n.inline,p,i,l);return zT(p,w.x,w.y)},d5=n=>de.from(n).map(Ye.fromDom),HL=n=>{const i=n.inline?n.getBody():n.getContentAreaContainer();return d5(i).map(yd).getOr(!1)};var $L=()=>{const n=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:n,close:n,getArgs:n}};const Jw=n=>{const i=[],l=()=>{const be=n.theme;return be&&be.getNotificationManagerImpl?be.getNotificationManagerImpl():$L()},d=()=>de.from(i[0]),p=(be,Le)=>be.type===Le.type&&be.text===Le.text&&!be.progressBar&&!be.timeout&&!Le.progressBar&&!Le.timeout,w=()=>{Be(i,be=>{be.reposition()})},E=be=>{i.push(be)},R=be=>{ds(i,Le=>Le===be).each(Le=>{i.splice(Le,1)})},B=(be,Le=!0)=>n.removed||!HL(n)?{}:(Le&&n.dispatch("BeforeOpenNotification",{notification:be}),eo(i,je=>p(l().getArgs(je),be)).getOrThunk(()=>{n.editorManager.setActive(n);const je=l().open(be,()=>{R(je),w(),d().fold(()=>n.focus(),Me=>Hb(Ye.fromDom(Me.getEl())))});return E(je),w(),n.dispatch("OpenNotification",{notification:{...je}}),je})),K=()=>{d().each(be=>{l().close(be),R(be),w()})},ie=et(i);return(be=>{be.on("SkinLoaded",()=>{const Le=mC(be);Le&&B({text:Le,type:"warning",timeout:0},!1),w()}),be.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(w)}),be.on("remove",()=>{Be(i.slice(),Le=>{l().close(Le)})})})(n),{open:B,close:K,getNotifications:ie}},Qw=Na.PluginManager,Dy=Na.ThemeManager;var zL=()=>{const n=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:n,openUrl:n,alert:n,confirm:n,close:n}};const NA=n=>{let i=[];const l=()=>{const Me=n.theme;return Me&&Me.getWindowManagerImpl?Me.getWindowManagerImpl():zL()},d=(Me,Ve)=>(...mt)=>Ve?Ve.apply(Me,mt):void 0,p=Me=>{n.dispatch("OpenWindow",{dialog:Me})},w=Me=>{n.dispatch("CloseWindow",{dialog:Me})},E=Me=>{i.push(Me),p(Me)},R=Me=>{w(Me),i=wt(i,Ve=>Ve!==Me),i.length===0&&n.focus()},B=()=>de.from(i[i.length-1]),K=Me=>{n.editorManager.setActive(n),fM(n),n.ui.show();const Ve=Me();return E(Ve),Ve},ie=(Me,Ve)=>K(()=>l().open(Me,Ve,R)),ue=Me=>K(()=>l().openUrl(Me,R)),be=(Me,Ve,mt)=>{const vt=l();vt.alert(Me,d(mt||vt,Ve))},Le=(Me,Ve,mt)=>{const vt=l();vt.confirm(Me,d(mt||vt,Ve))},je=()=>{B().each(Me=>{l().close(Me),R(Me)})};return n.on("remove",()=>{Be(i,Me=>{l().close(Me)})}),{open:ie,openUrl:ue,alert:be,confirm:Le,close:je}},h5=(n,i)=>{n.notificationManager.open({type:"error",text:i})},PA=(n,i)=>{n._skinLoaded?h5(n,i):n.on("SkinLoaded",()=>{h5(n,i)})},VL=(n,i)=>{PA(n,Kf.translate(["Failed to upload image: {0}",i]))},kS=(n,i,l)=>{WC(n,i,{message:l}),console.error(l)},_g=(n,i,l)=>l?`Failed to load ${n}: ${l} from url ${i}`:`Failed to load ${n} url: ${i}`,Oy=(n,i,l)=>{kS(n,"PluginLoadError",_g("plugin",i,l))},vp=(n,i,l)=>{kS(n,"IconsLoadError",_g("icons",i,l))},XZ=(n,i,l)=>{kS(n,"LanguageLoadError",_g("language",i,l))},JZ=(n,i,l)=>{kS(n,"ThemeLoadError",_g("theme",i,l))},QZ=(n,i,l)=>{kS(n,"ModelLoadError",_g("model",i,l))},eq=(n,i,l)=>{const d=Kf.translate(["Failed to initialize plugin: {0}",i]);WC(n,"PluginLoadError",{message:d}),VT(d,l),PA(n,d)},VT=(n,...i)=>{const l=window.console;l&&(l.error?l.error(n,...i):l.log(n,...i))},tq=n=>/^[a-z0-9\-]+$/i.test(n),nq=n=>UL(n,hC(n)),oq=n=>UL(n,ip(n)),UL=(n,i)=>{const l=n.editorManager.baseURL+"/skins/content",p=`content${n.editorManager.suffix}.css`;return Tt(i,w=>tq(w)&&!n.inline?`${l}/${w}/${p}`:n.documentBaseURI.toAbsolute(w))},sq=n=>{n.contentCSS=n.contentCSS.concat(nq(n),oq(n))},rq=n=>n?Mr(n.getElementsByTagName("img")):[],iq=(n,i)=>{const l={};return{findAll:(p,w=gt)=>{const E=wt(rq(p),B=>{const K=B.src;return B.hasAttribute("data-mce-bogus")||B.hasAttribute("data-mce-placeholder")||!K||K===Xn.transparentSrc?!1:xr(K,"blob:")?!n.isUploaded(K)&&w(B):xr(K,"data:")?w(B):!1}),R=Tt(E,B=>{const K=B.src;if(un(l,K))return l[K].then(ie=>F(ie)?ie:{image:B,blobInfo:ie.blobInfo});{const ie=O8(i,K).then(ue=>(delete l[K],{image:B,blobInfo:ue})).catch(ue=>(delete l[K],ue));return l[K]=ie,ie}});return Promise.all(R)}}},UT=()=>{let l={};const d=(be,Le)=>({status:be,resultUri:Le}),p=be=>be in l;return{hasBlobUri:p,getResultUri:be=>{const Le=l[be];return Le?Le.resultUri:null},isPending:be=>p(be)?l[be].status===1:!1,isUploaded:be=>p(be)?l[be].status===2:!1,markPending:be=>{l[be]=d(1,null)},markUploaded:(be,Le)=>{l[be]=d(2,Le)},removeFailed:be=>{delete l[be]},destroy:()=>{l={}}}};let m5=0;const WL=()=>{const n=()=>Math.round(Math.random()*4294967295).toString(36);return"s"+new Date().getTime().toString(36)+n()+n()+n()},aq=n=>n+m5+++WL(),lq=()=>{let n=[];const i=ue=>({"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"})[ue.toLowerCase()]||"dat",l=(ue,be,Le,je,Me)=>{if(F(ue))return d({id:ue,name:je,filename:Me,blob:be,base64:Le});if(oe(ue))return d(ue);throw new Error("Unknown input type")},d=ue=>{if(!ue.blob||!ue.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const be=ue.id||aq("blobid"),Le=ue.name||be,je=ue.blob;return{id:et(be),name:et(Le),filename:et(ue.filename||Le+"."+i(je.type)),blob:et(je),base64:et(ue.base64),blobUri:et(ue.blobUri||URL.createObjectURL(je)),uri:et(ue.uri)}},p=ue=>{E(ue.id())||n.push(ue)},w=ue=>eo(n,ue).getOrUndefined(),E=ue=>w(be=>be.id()===ue);return{create:l,add:p,get:E,getByUri:ue=>w(be=>be.blobUri()===ue),getByData:(ue,be)=>w(Le=>Le.base64()===ue&&Le.blob().type===be),findFirst:w,removeByUri:ue=>{n=wt(n,be=>be.blobUri()===ue?(URL.revokeObjectURL(be.blobUri()),!1):!0)},destroy:()=>{Be(n,ue=>{URL.revokeObjectURL(ue.blobUri())}),n=[]}}},jL=(n,i)=>{const l={},d=(Me,Ve)=>Me?Me.replace(/\/$/,"")+"/"+Ve.replace(/^\//,""):Ve,p=(Me,Ve)=>new Promise((mt,vt)=>{const yt=new XMLHttpRequest;yt.open("POST",i.url),yt.withCredentials=i.credentials,yt.upload.onprogress=dn=>{Ve(dn.loaded/dn.total*100)},yt.onerror=()=>{vt("Image upload failed due to a XHR Transport error. Code: "+yt.status)},yt.onload=()=>{if(yt.status<200||yt.status>=300){vt("HTTP Error: "+yt.status);return}const dn=JSON.parse(yt.responseText);if(!dn||!F(dn.location)){vt("Invalid JSON: "+yt.responseText);return}mt(d(i.basePath,dn.location))};const Mt=new FormData;Mt.append("file",Me.blob(),Me.filename()),yt.send(Mt)}),w=ge(i.handler)?i.handler:p,E=()=>new Promise(Me=>{Me([])}),R=(Me,Ve)=>({url:Ve,blobInfo:Me,status:!0}),B=(Me,Ve)=>({url:"",blobInfo:Me,status:!1,error:Ve}),K=(Me,Ve)=>{hn.each(l[Me],mt=>{mt(Ve)}),delete l[Me]},ie=(Me,Ve,mt)=>(n.markPending(Me.blobUri()),new Promise(vt=>{let yt,Mt;try{const dn=()=>{yt&&(yt.close(),Mt=ft)},zn=Lt=>{dn(),n.markUploaded(Me.blobUri(),Lt),K(Me.blobUri(),R(Me,Lt)),vt(R(Me,Lt))},Pn=Lt=>{dn(),n.removeFailed(Me.blobUri()),K(Me.blobUri(),B(Me,Lt)),vt(B(Me,Lt))};Mt=Lt=>{Lt<0||Lt>100||de.from(yt).orThunk(()=>de.from(mt).map(kt)).each($t=>{yt=$t,$t.progressBar.value(Lt)})},Ve(Me,Mt).then(zn,Lt=>{Pn(F(Lt)?{message:Lt}:Lt)})}catch(dn){vt(B(Me,dn))}})),ue=Me=>Me===p,be=Me=>{const Ve=Me.blobUri();return new Promise(mt=>{l[Ve]=l[Ve]||[],l[Ve].push(mt)})},Le=(Me,Ve)=>(Me=hn.grep(Me,mt=>!n.isUploaded(mt.blobUri())),Promise.all(hn.map(Me,mt=>n.isPending(mt.blobUri())?be(mt):ie(mt,w,Ve))));return{upload:(Me,Ve)=>!i.url&&ue(w)?E():Le(Me,Ve)}},g5=n=>()=>n.notificationManager.open({text:n.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),WT=(n,i)=>jL(i,{url:Wk(n),basePath:Uv(n),credentials:Wv(n),handler:uC(n)}),ZL=n=>{const i=UT(),l=WT(n,i);return{upload:(d,p=!0)=>l.upload(d,p?g5(n):void 0)}},qL=(n,i)=>n.dom.isEmpty(i.dom)&&_e(n.schema.getTextBlockElements()[Xr(i)]),p5=n=>i=>{qL(n,i)&&Qi(i,Ye.fromHtml('<br data-mce-bogus="1" />'))},cq=n=>{const i=lq();let l,d;const p=UT(),w=[],E=yt=>Mt=>n.selection?yt(Mt):[],R=yt=>yt+(yt.indexOf("?")===-1?"?":"&")+new Date().getTime(),B=(yt,Mt,dn)=>{let zn=0;do zn=yt.indexOf(Mt,zn),zn!==-1&&(yt=yt.substring(0,zn)+dn+yt.substr(zn+Mt.length),zn+=dn.length-Mt.length+1);while(zn!==-1);return yt},K=(yt,Mt,dn)=>{const zn=`src="${dn}"${dn===Xn.transparentSrc?' data-mce-placeholder="1"':""}`;return yt=B(yt,`src="${Mt}"`,zn),yt=B(yt,'data-mce-src="'+Mt+'"','data-mce-src="'+dn+'"'),yt},ie=(yt,Mt)=>{Be(n.undoManager.data,dn=>{dn.type==="fragmented"?dn.fragments=Tt(dn.fragments,zn=>K(zn,yt,Mt)):dn.content=K(dn.content,yt,Mt)})},ue=(yt,Mt)=>{const dn=n.convertURL(Mt,"src");ie(yt.src,Mt),Vu(Ye.fromDom(yt),{src:Qf(n)?R(Mt):Mt,"data-mce-src":dn})},be=()=>(l||(l=WT(n,p)),Ve().then(E(yt=>{const Mt=Tt(yt,dn=>dn.blobInfo);return l.upload(Mt,g5(n)).then(E(dn=>{const zn=[];let Pn=!1;const Lt=Tt(dn,($t,wn)=>{const{blobInfo:go,image:Oo}=yt[wn];let Cs=!1;return $t.status&&lC(n)?($t.url&&!Qs(Oo.src,$t.url)&&(Pn=!0),i.removeByUri(Oo.src),S0(n)||ue(Oo,$t.url)):$t.error&&($t.error.remove&&(ie(Oo.src,Xn.transparentSrc),zn.push(Oo),Cs=!0),VL(n,$t.error.message)),{element:Oo,status:$t.status,uploadUri:$t.url,blobInfo:go,removed:Cs}});return zn.length>0&&!S0(n)?n.undoManager.transact(()=>{Be(Qd(zn),$t=>{const wn=ai($t);br($t),wn.each(p5(n)),i.removeByUri($t.dom.src)})}):Pn&&n.undoManager.dispatchChange(),Lt}))}))),Le=()=>Vv(n)?be():Promise.resolve([]),je=yt=>Js(w,Mt=>Mt(yt)),Me=yt=>{w.push(yt)},Ve=()=>(d||(d=iq(p,i)),d.findAll(n.getBody(),je).then(E(yt=>{const Mt=wt(yt,dn=>F(dn)?(PA(n,dn),!1):dn.uriType!=="blob");return S0(n)||Be(Mt,dn=>{ie(dn.image.src,dn.blobInfo.blobUri()),dn.image.src=dn.blobInfo.blobUri(),dn.image.removeAttribute("data-mce-src")}),Mt}))),mt=()=>{i.destroy(),p.destroy(),d=l=null},vt=yt=>yt.replace(/src="(blob:[^"]+)"/g,(Mt,dn)=>{const zn=p.getResultUri(dn);if(zn)return'src="'+zn+'"';let Pn=i.getByUri(dn);return Pn||(Pn=vn(n.editorManager.get(),(Lt,$t)=>Lt||$t.editorUpload&&$t.editorUpload.blobCache.getByUri(dn),void 0)),Pn?'src="data:'+Pn.blob().type+";base64,"+Pn.base64()+'"':Mt});return n.on("SetContent",()=>{Vv(n)?Le():Ve()}),n.on("RawSaveContent",yt=>{yt.content=vt(yt.content)}),n.on("GetContent",yt=>{yt.source_view||yt.format==="raw"||yt.format==="tree"||(yt.content=vt(yt.content))}),n.on("PostRender",()=>{n.parser.addNodeFilter("img",yt=>{Be(yt,Mt=>{const dn=Mt.attr("src");if(!dn||i.getByUri(dn))return;const zn=p.getResultUri(dn);zn&&Mt.attr("src",zn)})})}),{blobCache:i,addFilter:Me,uploadImages:be,uploadImagesAuto:Le,scanForImages:Ve,destroy:mt}},uq=n=>{const i=n.dom,l=n.schema.type,d={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:p=>{i.setStyle(p,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:p=>{i.setStyle(p,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const p={inline:"span",styles:{textDecoration:"line-through"},exact:!0},w={inline:"strike",remove:"all",preserve_attributes:["class","style"]},E={inline:"s",remove:"all",preserve_attributes:["class","style"]};return l!=="html4"?[E,p,w]:[p,E,w]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(p,w,E)=>Qn(p)&&p.hasAttribute("href"),onformat:(p,w,E)=>{hn.each(E,(R,B)=>{i.setAttrib(p,B,R)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":p=>{var w;return(w=p==null?void 0:p.customValue)!==null&&w!==void 0?w:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return hn.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),p=>{d[p]={block:p,remove:"all"}}),d},h1={remove_similar:!0,inherit:!1},id={selector:"td,th",...h1},jT={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...id},tablecellverticalalign:{styles:{"vertical-align":"%value"},...id},tablecellbordercolor:{styles:{borderColor:"%value"},...id},tablecellclass:{classes:["%value"],...id},tableclass:{selector:"table",classes:["%value"],...h1},tablecellborderstyle:{styles:{borderStyle:"%value"},...id},tablecellborderwidth:{styles:{borderWidth:"%value"},...id}},GL=et(jT),ZT=n=>{const i={},l=E=>_e(E)?i[E]:i,d=E=>un(i,E),p=(E,R)=>{E&&(F(E)?(se(R)||(R=[R]),Be(R,B=>{ye(B.deep)&&(B.deep=!td(B)),ye(B.split)&&(B.split=!td(B)||Tl(B)),ye(B.remove)&&td(B)&&!Tl(B)&&(B.remove="none"),td(B)&&Tl(B)&&(B.mixed=!0,B.block_expand=!0),F(B.classes)&&(B.classes=B.classes.split(/\s+/))}),i[E]=R):ln(E,(B,K)=>{p(K,B)}))},w=E=>(E&&i[E]&&delete i[E],i);return p(uq(n)),p(GL()),p(Kk(n)),{get:l,has:d,register:p,unregister:w}},IA=hn.each,bm=Lr.DOM,qT=n=>_e(n)&&oe(n),b5=(n,i)=>{const l=i&&i.schema||dh({}),d=(B,K)=>{K.classes.length>0&&bm.addClass(B,K.classes.join(" ")),bm.setAttribs(B,K.attrs)},p=B=>{const K=F(B)?{name:B,classes:[],attrs:{}}:B,ie=bm.create(K.name);return d(ie,K),ie},w=(B,K)=>{const ie=l.getElementRule(B.nodeName.toLowerCase()),ue=ie==null?void 0:ie.parentsRequired;return ue&&ue.length?K&&St(ue,K)?K:ue[0]:!1},E=(B,K,ie)=>{let ue;const be=K[0],Le=qT(be)?be.name:void 0,je=w(B,Le);if(je)Le===je?(ue=be,K=K.slice(1)):ue=je;else if(be)ue=be,K=K.slice(1);else if(!ie)return B;const Me=ue?p(ue):bm.create("div");Me.appendChild(B),ie&&hn.each(ie,mt=>{const vt=p(mt);Me.insertBefore(vt,B)});const Ve=qT(ue)?ue.siblings:void 0;return E(Me,K,Ve)},R=bm.create("div");if(n.length>0){const B=n[0],K=p(B),ie=qT(B)?B.siblings:void 0;R.appendChild(E(K,n.slice(1),ie))}return R},KL=n=>{n=hn.trim(n);let i="div";const l={name:i,classes:[],attrs:{},selector:n};return n!=="*"&&(i=n.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(d,p,w,E,R)=>{switch(p){case"#":l.attrs.id=w;break;case".":l.classes.push(w);break;case":":hn.inArray("checked disabled enabled read-only required".split(" "),w)!==-1&&(l.attrs[w]=w);break}if(E==="["){const B=R.match(/([\w\-]+)(?:\=\"([^\"]+))?/);B&&(l.attrs[B[1]]=B[2])}return""})),l.name=i||"div",l},YL=n=>F(n)?(n=n.split(/\s*,\s*/)[0],n=n.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),hn.map(n.split(/(?:>|\s+(?![^\[\]]+\]))/),i=>{const l=hn.map(i.split(/(?:~\+|~|\+)/),KL),d=l.pop();return l.length&&(d.siblings=l),d}).reverse()):[],GT=(n,i)=>{let l="",d=Yk(n);if(d==="")return"";const p=be=>F(be)?be.replace(/%(\w+)/g,""):"",w=(be,Le)=>bm.getStyle(Le!=null?Le:n.getBody(),be,!0);if(F(i)){const be=n.formatter.get(i);if(!be)return"";i=be[0]}if("preview"in i){const be=i.preview;if(be===!1)return"";d=be||d}let E=i.block||i.inline||"span",R;const B=YL(i.selector);B.length>0?(B[0].name||(B[0].name=E),E=i.selector,R=b5(B,n)):R=b5([E],n);const K=bm.select(E,R)[0]||R.firstChild;IA(i.styles,(be,Le)=>{const je=p(be);je&&bm.setStyle(K,Le,je)}),IA(i.attributes,(be,Le)=>{const je=p(be);je&&bm.setAttrib(K,Le,je)}),IA(i.classes,be=>{const Le=p(be);bm.hasClass(K,Le)||bm.addClass(K,Le)}),n.dispatch("PreviewFormats"),bm.setStyles(R,{position:"absolute",left:-65535}),n.getBody().appendChild(R);const ie=w("fontSize"),ue=/px$/.test(ie)?parseInt(ie,10):0;return IA(d.split(" "),be=>{let Le=w(be,K);if(!(be==="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(Le)&&(Le=w(be),BC(Le).toLowerCase()==="#ffffff"))&&!(be==="color"&&BC(Le).toLowerCase()==="#000000")){if(be==="font-size"&&/em|%$/.test(Le)){if(ue===0)return;Le=parseFloat(Le)/(/%$/.test(Le)?100:1)*ue+"px"}be==="border"&&Le&&(l+="padding:0 2px;"),l+=be+":"+Le+";"}}),n.dispatch("AfterPreviewFormats"),bm.remove(R),l},v5=n=>{n.addShortcut("meta+b","","Bold"),n.addShortcut("meta+i","","Italic"),n.addShortcut("meta+u","","Underline");for(let i=1;i<=6;i++)n.addShortcut("access+"+i,"",["FormatBlock",!1,"h"+i]);n.addShortcut("access+7","",["FormatBlock",!1,"p"]),n.addShortcut("access+8","",["FormatBlock",!1,"div"]),n.addShortcut("access+9","",["FormatBlock",!1,"address"])},XL=n=>{const i=ZT(n),l=Ga({});return v5(n),YW(n),S0(n)||Ise(l,n),{get:i.get,has:i.has,register:i.register,unregister:i.unregister,apply:(d,p,w)=>{f1(n,d,p,w)},remove:(d,p,w,E)=>{r5(n,d,p,w,E)},toggle:(d,p,w)=>{kZ(n,d,p,w)},match:(d,p,w,E)=>wZ(n,d,p,w,E),closest:d=>Use(n,d),matchAll:(d,p)=>_Z(n,d,p),matchNode:(d,p,w,E)=>CZ(n,d,p,w,E),canApply:d=>SZ(n,d),formatChanged:(d,p,w,E)=>EZ(n,l,d,p,w,E),getCssText:He(GT,n)}},JL=n=>{switch(n.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},fq=(n,i,l)=>{const d=Ga(!1),p=B=>{Gw(i,!1,l),i.add({},B)};n.on("init",()=>{i.add()}),n.on("BeforeExecCommand",B=>{const K=B.command;JL(K)||(gL(i,l),i.beforeChange())}),n.on("ExecCommand",B=>{const K=B.command;JL(K)||p(B)}),n.on("ObjectResizeStart cut",()=>{i.beforeChange()}),n.on("SaveContent ObjectResized blur",p),n.on("dragend",p),n.on("keyup",B=>{const K=B.keyCode;if(B.isDefaultPrevented())return;const ie=Xn.os.isMacOS()&&B.key==="Meta";(K>=33&&K<=36||K>=37&&K<=40||K===45||B.ctrlKey||ie)&&(p(),n.nodeChanged()),(K===46||K===8)&&n.nodeChanged(),d.get()&&i.typing&&!t5(NT(n),i.data[0])&&(n.isDirty()||n.setDirty(!0),n.dispatch("TypingUndo"),d.set(!1),n.nodeChanged())}),n.on("keydown",B=>{const K=B.keyCode;if(B.isDefaultPrevented())return;if(K>=33&&K<=36||K>=37&&K<=40||K===45){i.typing&&p(B);return}const ie=B.ctrlKey&&!B.altKey||B.metaKey;if((K<16||K>20)&&K!==224&&K!==91&&!i.typing&&!ie){i.beforeChange(),Gw(i,!0,l),i.add({},B),d.set(!0);return}(Xn.os.isMacOS()?B.metaKey:B.ctrlKey&&!B.altKey)&&i.beforeChange()}),n.on("mousedown",B=>{i.typing&&p(B)});const w=B=>B.inputType==="insertReplacementText",E=B=>B.inputType==="insertText"&&B.data===null,R=B=>B.inputType==="insertFromPaste"||B.inputType==="insertFromDrop";n.on("input",B=>{B.inputType&&(w(B)||E(B)||R(B))&&p(B)}),n.on("AddUndo Undo Redo ClearUndos",B=>{B.isDefaultPrevented()||n.nodeChanged()})},dq=n=>{n.addShortcut("meta+z","","Undo"),n.addShortcut("meta+y,meta+shift+z","","Redo")},y5=n=>{const i=mh(),l=Ga(0),d=Ga(0),p={data:[],typing:!1,beforeChange:()=>{mZ(n,l,i)},add:(w,E)=>CL(n,p,d,l,i,w,E),dispatchChange:()=>{n.setDirty(!0);const w=NT(n);w.bookmark=au(n.selection),n.dispatch("change",{level:w,lastLevel:Zr(p.data,d.get()).getOrUndefined()})},undo:()=>gZ(n,p,l,d),redo:()=>pZ(n,d,p.data),clear:()=>{TA(n,p,d)},reset:()=>{SL(n,p)},hasUndo:()=>kL(n,p,d),hasRedo:()=>bZ(n,p,d),transact:w=>vZ(n,p,l,w),ignore:w=>{yZ(n,l,w)},extra:(w,E)=>{EL(n,p,d,w,E)}};return S0(n)||fq(n,p,l),dq(n),p},hq=[9,27,no.HOME,no.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,no.DOWN,no.UP,no.LEFT,no.RIGHT].concat(Xn.browser.isFirefox()?[224]:[]),QL="data-mce-placeholder",KT=n=>n.type==="keydown"||n.type==="keyup",eF=n=>{const i=n.keyCode;return i===no.BACKSPACE||i===no.DELETE},mq=n=>{if(KT(n)){const i=n.keyCode;return!eF(n)&&(no.metaKeyPressed(n)||n.altKey||i>=112&&i<=123||St(hq,i))}else return!1},gq=n=>KT(n)&&!(eF(n)||n.type==="keyup"&&n.keyCode===229),pq=(n,i,l)=>{if(Ma(Ye.fromDom(i),!1)){const d=i.firstElementChild;return d?n.getStyle(i.firstElementChild,"padding-left")||n.getStyle(i.firstElementChild,"padding-right")?!1:l===d.nodeName.toLowerCase():!0}else return!1},bq=n=>{var i;const l=n.dom,d=Hc(n),p=(i=i0(n))!==null&&i!==void 0?i:"",w=(E,R)=>{if(mq(E))return;const B=n.getBody(),K=gq(E)?!1:pq(l,B,d);(l.getAttrib(B,QL)!==""!==K||R)&&(l.setAttrib(B,QL,K?p:null),l.setAttrib(B,"aria-placeholder",K?p:null),hy(n,K),n.on(K?"keydown":"keyup",w),n.off(K?"keyup":"keydown",w))};pr(p)&&n.on("init",E=>{w(E,!0),n.on("change SetContent ExecCommand",w),n.on("paste",R=>mg.setEditorTimeout(n,()=>w(R)))})},vq=(n,i)=>({block:n,position:i}),yq=(n,i)=>({from:n,to:i}),ES=(n,i)=>{const l=Ye.fromDom(n),d=Ye.fromDom(i.container());return Ci(l,d).map(p=>vq(p,i))},w5=n=>!bt(n.from.block,n.to.block),tF=(n,i)=>Bl(i,p=>Vm(p)||ha(p.dom),p=>bt(p,n)).filter(_l).getOr(n),wq=(n,i)=>{const l=Ye.fromDom(n);return bt(tF(l,i.from.block),tF(l,i.to.block))},_q=n=>As(n.from.block.dom)===!1&&As(n.to.block.dom)===!1,Cq=n=>{const i=l=>lc(l)||ah(l.dom);return i(n.from.block)&&i(n.to.block)},nF=(n,i,l)=>ui(l.position.getNode())&&!Ma(l.block)?iy(!1,l.block.dom).bind(d=>d.isEqual(l.position)?Pd(i,n,d).bind(p=>ES(n,p)):de.some(l)).getOr(l):l,Sq=(n,i,l)=>{const d=ES(n,Vt.fromRangeStart(l)),p=d.bind(w=>Pd(i,n,w.position).bind(E=>ES(n,E).map(R=>nF(n,i,R))));return ni(d,p,yq).filter(w=>w5(w)&&wq(n,w)&&_q(w)&&Cq(w))},kq=(n,i,l)=>l.collapsed?Sq(n,i,l):de.none(),_5=n=>{const i=xa(n);return ds(i,ac).fold(et(i),l=>i.slice(0,l))},oF=n=>{const i=_5(n);return Be(i,br),i},sF=(n,i)=>{const l=Vb(i,n);return eo(l.reverse(),d=>Ma(d)).each(br)},Eq=n=>wt(Lg(n),i=>!Ma(i)).length===0,Aq=(n,i,l,d)=>{if(Ma(l))return De(l),rl(l.dom);Eq(d)&&Ma(i)&&wa(d,Ye.fromTag("br"));const p=Mu(l.dom,Vt.before(d.dom));return Be(oF(i),w=>{wa(d,w)}),sF(n,i),p},xq=(n,i,l)=>{if(Ma(l)){if(Ma(i)){const w=Yt((E=>{const R=(B,K)=>oi(B).fold(()=>K,ie=>_c(ie)?R(ie,K.concat(ng(ie))):K);return R(E,[])})(l),(E,R)=>(j0(E,R),R),ve());wd(i),Qi(i,w)}return br(l),rl(i.dom)}const d=Id(l.dom);return Be(oF(i),p=>{Qi(l,p)}),sF(n,i),d},Tq=(n,i)=>{const l=Vb(i,n);return de.from(l[l.length-1])},Dq=(n,i)=>cn(i,n)?Tq(i,n):de.none(),BA=(n,i)=>{iy(n,i.dom).bind(l=>de.from(l.getNode())).map(Ye.fromDom).filter(Xc).each(br)},LA=(n,i,l)=>(BA(!0,i),BA(!1,l),Dq(i,l).fold(He(xq,n,i,l),He(Aq,n,i,l))),rF=(n,i,l,d)=>i?LA(n,d,l):LA(n,l,d),C5=(n,i)=>{const l=Ye.fromDom(n.getBody());return kq(l.dom,i,n.selection.getRng()).map(p=>()=>{rF(l,i,p.from.block,p.to.block).each(w=>{n.selection.setRng(w.toRange())})})},YT=(n,i)=>{const l=i.getRng();return ni(Ci(n,Ye.fromDom(l.startContainer)),Ci(n,Ye.fromDom(l.endContainer)),(d,p)=>bt(d,p)?de.none():de.some(()=>{l.deleteContents(),rF(n,!0,d,p).each(w=>{i.setRng(w.toRange())})})).getOr(de.none())},iF=(n,i)=>{const l=Ye.fromDom(i),d=He(bt,n);return li(l,Vm,d).isSome()},Oq=(n,i)=>iF(n,i.startContainer)||iF(n,i.endContainer),Mq=(n,i)=>{const l=Mu(n.dom,Vt.fromRangeStart(i)).isNone(),d=Mf(n.dom,Vt.fromRangeEnd(i)).isNone();return!Oq(n,i)&&l&&d},Rq=n=>de.some(()=>{n.setContent(""),n.selection.setCursorLocation()}),Nq=n=>{const i=Ye.fromDom(n.getBody()),l=n.selection.getRng();return Mq(i,l)?Rq(n):YT(i,n.selection)},S5=(n,i)=>n.selection.isCollapsed()?de.none():Nq(n),Qb=(n,i,l,d,p)=>de.from(i._selectionOverrides.showCaret(n,l,d,p)),Pq=n=>{const i=n.ownerDocument.createRange();return i.selectNode(n),i},FA=(n,i)=>n.dispatch("BeforeObjectSelected",{target:i}).isDefaultPrevented()?de.none():de.some(Pq(i)),Iq=(n,i,l)=>{const d=H(1,n.getBody(),i),p=Vt.fromRangeStart(d),w=p.getNode();if(am(w))return Qb(1,n,w,!p.isAtEnd(),!1);const E=p.getNode(!0);if(am(E))return Qb(1,n,E,!1,!1);const R=wy(n.dom.getRoot(),p.getNode());return am(R)?Qb(1,n,R,!1,l):de.none()},k5=(n,i,l)=>i.collapsed?Iq(n,i,l).getOr(i):i,Yse=n=>vy(n)||$b(n),yp=n=>zb(n)||oS(n),E5=(n,i)=>{Sn(i)&&i.data.length===0&&n.remove(i)},A5=(n,i,l,d,p,w)=>{Qb(d,n,w.getNode(!p),p,!0).each(E=>{if(i.collapsed){const R=i.cloneRange();p?R.setEnd(E.startContainer,E.startOffset):R.setStart(E.endContainer,E.endOffset),R.deleteContents()}else i.deleteContents();n.selection.setRng(E)}),E5(n.dom,l)},aF=(n,i)=>{const l=n.selection.getRng();if(!Sn(l.commonAncestorContainer))return de.none();const d=i?pn.Forwards:pn.Backwards,p=ka(n.getBody()),w=He(Ct,i?p.next:p.prev),E=i?Yse:yp,R=ke(d,n.getBody(),l),B=w(R),K=B&&gg(i,B);if(!K||!zt(R,K))return de.none();if(E(K))return de.some(()=>A5(n,l,R.getNode(),d,i,K));const ie=w(K);return ie&&E(ie)&&zt(K,ie)?de.some(()=>A5(n,l,R.getNode(),d,i,ie)):de.none()},x5=(n,i)=>aF(n,i),XT=(n,i)=>{const l=n.getBody();return i?rl(l).filter(vy):Id(l).filter(zb)},T5=n=>{const i=n.selection.getRng();return!i.collapsed&&(XT(n,!0).exists(l=>l.isEqual(Vt.fromRangeStart(i)))||XT(n,!1).exists(l=>l.isEqual(Vt.fromRangeEnd(i))))},lF=n=>_e(n)&&(Vm(Ye.fromDom(n))||Za(Ye.fromDom(n))),vm=lg.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Bq=(n,i)=>{const l=i.getNode(!n),d=n?"after":"before";return Qn(l)&&l.getAttribute("data-mce-caret")===d},Lq=(n,i,l,d)=>{const p=w=>_c(Ye.fromDom(w))&&!Nd(l,d,n);return le(!i,l).fold(()=>le(i,d).fold(qe,p),p)},e_=(n,i,l,d)=>{const p=d.getNode(!i);return Ci(Ye.fromDom(n),Ye.fromDom(l.getNode())).map(w=>Ma(w)?vm.remove(w.dom):vm.moveToElement(p)).orThunk(()=>de.some(vm.moveToElement(p)))},D5=(n,i,l)=>Pd(i,n,l).bind(d=>lF(d.getNode())||Lq(n,i,l,d)?de.none():i&&As(d.getNode())||!i&&As(d.getNode(!0))?e_(n,i,l,d):i&&zb(l)||!i&&vy(l)?de.some(vm.moveToPosition(d)):de.none()),cF=(n,i)=>Te(i)?de.none():n&&As(i.nextSibling)?de.some(vm.moveToElement(i.nextSibling)):!n&&As(i.previousSibling)?de.some(vm.moveToElement(i.previousSibling)):de.none(),uF=(n,i,l)=>l.fold(d=>de.some(vm.remove(d)),d=>de.some(vm.moveToElement(d)),d=>Nd(i,d,n)?de.none():de.some(vm.moveToPosition(d))),O5=(n,i,l)=>Bq(i,l)?cF(i,l.getNode(!i)).orThunk(()=>D5(n,i,l)):D5(n,i,l).bind(d=>uF(n,l,d)),Fq=(n,i,l)=>{const d=H(i?1:-1,n,l),p=Vt.fromRangeStart(d),w=Ye.fromDom(n);return!i&&zb(p)?de.some(vm.remove(p.getNode(!0))):i&&vy(p)?de.some(vm.remove(p.getNode())):!i&&vy(p)&&K3(w,p)?lB(w,p).map(E=>vm.remove(E.getNode())):i&&zb(p)&&G3(w,p)?tW(w,p).map(E=>vm.remove(E.getNode())):O5(n,i,p)},Hq=(n,i)=>l=>(n._selectionOverrides.hideFakeCaret(),Ub(n,i,Ye.fromDom(l)),!0),$q=(n,i)=>l=>{const d=i?Vt.before(l):Vt.after(l);return n.selection.setRng(d.toRange()),!0},Xse=n=>i=>(n.selection.setRng(i.toRange()),!0),zq=(n,i)=>de.from(wy(n.getBody(),i)),Jse=(n,i)=>{const l=n.selection.getNode();return zq(n,l).filter(As).fold(()=>Fq(n.getBody(),i,n.selection.getRng()).map(d=>()=>d.fold(Hq(n,i),$q(n,i),Xse(n))),()=>de.some(ft))},wp=n=>{Be(hl(n,".mce-offscreen-selection"),br)},Vq=(n,i)=>{const l=n.selection.getNode();return As(l)&&!kd(l)?zq(n,l.parentNode).filter(As).fold(()=>de.some(()=>{wp(Ye.fromDom(n.getBody())),Ub(n,i,Ye.fromDom(n.selection.getNode())),Lw(n)}),()=>de.some(ft)):T5(n)?de.some(()=>{tT(n,n.selection.getRng(),Ye.fromDom(n.getBody()))}):de.none()},fF=n=>{const i=n.dom,l=n.selection,d=wy(n.getBody(),l.getNode());if(ha(d)&&i.isBlock(d)&&i.isEmpty(d)){const p=i.create("br",{"data-mce-bogus":"1"});i.setHTML(d,""),d.appendChild(p),l.setRng(Vt.before(p).toRange())}return!0},ev=(n,i)=>n.selection.isCollapsed()?Jse(n,i):Vq(n,i),dF=(n,i)=>{const l=Vt.fromRangeStart(n.selection.getRng());return Pd(i,n.getBody(),l).filter(d=>i?XU(d):JU(d)).bind(d=>d0(i?0:-1,d)).map(d=>()=>n.selection.select(d))},M5=(n,i)=>n.selection.isCollapsed()?dF(n,i):de.none(),tv=Sn,hF=n=>tv(n)&&n.data[0]===Ft,mF=n=>tv(n)&&n.data[n.data.length-1]===Ft,gF=n=>{var i;return((i=n.ownerDocument)!==null&&i!==void 0?i:document).createTextNode(Ft)},Uq=n=>{var i;if(tv(n.previousSibling))return mF(n.previousSibling)||n.previousSibling.appendData(Ft),n.previousSibling;if(tv(n))return hF(n)||n.insertData(0,Ft),n;{const l=gF(n);return(i=n.parentNode)===null||i===void 0||i.insertBefore(l,n),l}},Wq=n=>{var i,l;if(tv(n.nextSibling))return hF(n.nextSibling)||n.nextSibling.insertData(0,Ft),n.nextSibling;if(tv(n))return mF(n)||n.appendData(Ft),n;{const d=gF(n);return n.nextSibling?(i=n.parentNode)===null||i===void 0||i.insertBefore(d,n.nextSibling):(l=n.parentNode)===null||l===void 0||l.appendChild(d),d}},JT=(n,i)=>n?Uq(i):Wq(i),nv=He(JT,!0),jq=He(JT,!1),pF=(n,i)=>Sn(n.container())?JT(i,n.container()):JT(i,n.getNode()),bF=(n,i)=>{const l=i.get();return l&&n.container()===l&&tr(l)},R5=(n,i)=>i.fold(l=>{bl(n.get());const d=nv(l);return n.set(d),de.some(Vt(d,d.length-1))},l=>rl(l).map(d=>{if(bF(d,n)){const p=n.get();return Vt(p,1)}else{bl(n.get());const p=pF(d,!0);return n.set(p),Vt(p,1)}}),l=>Id(l).map(d=>{if(bF(d,n)){const p=n.get();return Vt(p,p.length-1)}else{bl(n.get());const p=pF(d,!1);return n.set(p),Vt(p,p.length-1)}}),l=>{bl(n.get());const d=jq(l);return n.set(d),de.some(Vt(d,1))}),vF=(n,i)=>{for(let l=0;l<n.length;l++){const d=n[l].apply(null,i);if(d.isSome())return d}return de.none()},cf=lg.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),QT=(n,i)=>{const l=lm(i,n);return l||n},N5=(n,i,l)=>{const d=_W(l),p=QT(i,d.container());return Wb(n,p,d).fold(()=>Mf(p,d).bind(He(Wb,n,p)).map(w=>cf.before(w)),de.none)},yF=(n,i)=>g0(n,i)===null,P5=(n,i,l)=>Wb(n,i,l).filter(He(yF,i)),wF=(n,i,l)=>{const d=eT(l);return P5(n,i,d).bind(p=>Mu(p,d).isNone()?de.some(cf.start(p)):de.none())},Zq=(n,i,l)=>{const d=_W(l);return P5(n,i,d).bind(p=>Mf(p,d).isNone()?de.some(cf.end(p)):de.none())},HA=(n,i,l)=>{const d=eT(l),p=QT(i,d.container());return Wb(n,p,d).fold(()=>Mu(p,d).bind(He(Wb,n,p)).map(w=>cf.after(w)),de.none)},e4=n=>!yB(t4(n)),m1=(n,i,l)=>vF([N5,wF,Zq,HA],[n,i,l]).filter(e4),t4=n=>n.fold(Et,Et,Et,Et),I5=n=>n.fold(et("before"),et("start"),et("end"),et("after")),$A=n=>n.fold(cf.before,cf.before,cf.after,cf.after),AS=n=>n.fold(cf.start,cf.start,cf.end,cf.end),B5=(n,i)=>I5(n)===I5(i)&&t4(n)===t4(i),zA=(n,i,l,d,p,w)=>ni(Wb(i,l,d),Wb(i,l,p),(E,R)=>E!==R&&gp(l,E,R)?cf.after(n?E:R):w).getOr(w),qq=(n,i)=>n.fold(gt,l=>!B5(l,i)),_F=(n,i,l,d,p)=>{const w=gg(n,p);return Pd(n,l,w).map(He(gg,n)).fold(()=>d.map($A),B=>m1(i,l,B).map(He(zA,n,i,l,w,B)).filter(He(qq,d))).filter(e4)},Gq=(n,i)=>n?i.fold(V(de.some,cf.start),de.none,V(de.some,cf.after),de.none):i.fold(de.none,V(de.some,cf.before),de.none,V(de.some,cf.end)),Kq=(n,i,l,d)=>{const p=gg(n,d),w=m1(i,l,p);return m1(i,l,p).bind(He(Gq,n)).orThunk(()=>_F(n,i,l,w,d))},CF=n=>ge(n.selection.getSel().modify),SF=(n,i,l)=>{const d=n?1:-1;return i.setRng(Vt(l.container(),l.offset()+d).toRange()),i.getSel().modify("move",n?"forward":"backward","word"),!0},kF=(n,i)=>{const l=i.selection.getRng(),d=n?Vt.fromRangeEnd(l):Vt.fromRangeStart(l);return CF(i)?n&&Gu(d)?SF(!0,i.selection,d):!n&&kf(d)?SF(!1,i.selection,d):!1:!1};var ov;(function(n){n[n.Br=0]="Br",n[n.Block=1]="Block",n[n.Wrap=2]="Wrap",n[n.Eol=3]="Eol"})(ov||(ov={}));const n4=(n,i)=>n===pn.Backwards?Zs(i):i,Yq=(n,i,l)=>n===pn.Forwards?i.next(l):i.prev(l),Xq=(n,i,l,d)=>ui(d.getNode(i===pn.Forwards))?ov.Br:Nd(l,d)===!1?ov.Block:ov.Wrap,EF=(n,i,l,d)=>{const p=ka(l);let w=d;const E=[];for(;w;){const R=Yq(i,p,w);if(!R)break;if(ui(R.getNode(!1)))return i===pn.Forwards?{positions:n4(i,E).concat([R]),breakType:ov.Br,breakAt:de.some(R)}:{positions:n4(i,E),breakType:ov.Br,breakAt:de.some(R)};if(!R.isVisible()){w=R;continue}if(n(w,R)){const B=Xq(l,i,w,R);return{positions:n4(i,E),breakType:B,breakAt:de.some(R)}}E.push(R),w=R}return{positions:n4(i,E),breakType:ov.Eol,breakAt:de.none()}},AF=(n,i,l,d)=>i(l,d).breakAt.map(p=>{const w=i(l,p).positions;return n===pn.Backwards?w.concat(p):[p].concat(w)}).getOr([]),L5=(n,i)=>vn(n,(l,d)=>l.fold(()=>de.some(d),p=>ni(Po(p.getClientRects()),Po(d.getClientRects()),(w,E)=>{const R=Math.abs(i-w.left);return Math.abs(i-E.left)<=R?d:p}).or(l)),de.none()),o4=(n,i)=>Po(i.getClientRects()).bind(l=>L5(n,l.left)),VA=He(EF,Vt.isAbove,-1),xS=He(EF,Vt.isBelow,1),xF=He(AF,-1,VA),My=He(AF,1,xS),F5=(n,i)=>VA(n,i).breakAt.isNone(),s4=(n,i)=>xS(n,i).breakAt.isNone(),TF=n=>rl(n).map(i=>[i].concat(xS(n,i).positions)).getOr([]),H5=n=>Id(n).map(i=>VA(n,i).positions.concat(i)).getOr([]),Ry=(n,i)=>o4(xF(n,i),i),DF=(n,i)=>o4(My(n,i),i),Cg=As,Ny=(n,i)=>Math.abs(n.left-i),r4=(n,i)=>Math.abs(n.right-i),Jq=n=>ns(n,"node"),$5=(n,i)=>Ke(n,(l,d)=>{const p=Math.min(Ny(l,i),r4(l,i)),w=Math.min(Ny(d,i),r4(d,i));return w===p&&Jq(d)&&Cg(d.node)||w<p?d:l}),Qq=n=>{const i=l=>Tt(l,d=>{const p=Zp(d);return p.node=n,p});if(Qn(n))return i(n.getClientRects());if(Sn(n)){const l=n.ownerDocument.createRange();return l.setStart(n,0),l.setEnd(n,n.data.length),i(l.getClientRects())}else return[]},OF=n=>Rs(n,Qq);var UA;(function(n){n[n.Up=-1]="Up",n[n.Down=1]="Down"})(UA||(UA={}));const eG=(n,i,l,d)=>{let p=d;for(;p=wh(p,n,Wg,i);)if(l(p))return},MF=(n,i,l,d,p,w)=>{let E=0;const R=[],B=ue=>{let be=OF([ue]);n===-1&&(be=be.reverse());for(let Le=0;Le<be.length;Le++){const je=be[Le];if(!l(je,K)){if(R.length>0&&i(je,It(R))&&E++,je.line=E,p(je))return!0;R.push(je)}}return!1},K=It(w.getClientRects());if(!K)return R;const ie=w.getNode();return ie&&(B(ie),eG(n,d,B,ie)),R},RF=(n,i)=>i.line>n,tG=(n,i)=>i.line===n,nG=He(MF,UA.Up,ta,ef),TS=He(MF,UA.Down,ef,ta),i4=n=>It(n.getClientRects()),NF=(n,i,l,d)=>{const p=ka(i);let w,E,R,B;const K=[];let ie=0;n===1?(w=p.next,E=ef,R=ta,B=Vt.after(d)):(w=p.prev,E=ta,R=ef,B=Vt.before(d));const ue=i4(B);do{if(!B.isVisible())continue;const be=i4(B);if(R(be,ue))continue;K.length>0&&E(be,It(K))&&ie++;const Le=Zp(be);if(Le.position=B,Le.line=ie,l(Le))return K;K.push(Le)}while(B=w(B));return K},z5=n=>i=>RF(n,i),WA=n=>i=>tG(n,i),sv=(n,i)=>{n.selection.setRng(i),lf(n,n.selection.getRng())},V5=(n,i,l)=>de.some(k5(n,i,l)),PF=(n,i,l,d,p,w)=>{const E=i===pn.Forwards,R=ka(n.getBody()),B=He(Ct,E?R.next:R.prev),K=E?d:p;if(!l.collapsed){const je=Q1(l);if(w(je))return Qb(i,n,je,i===pn.Backwards,!1);if(T5(n)){const Me=l.cloneRange();return Me.collapse(i===pn.Backwards),de.from(Me)}}const ie=ke(i,n.getBody(),l);if(K(ie))return FA(n,ie.getNode(!E));let ue=B(ie);const be=ea(l);if(ue)ue=gg(E,ue);else return be?de.some(l):de.none();if(K(ue))return Qb(i,n,ue.getNode(!E),E,!1);const Le=B(ue);return Le&&K(Le)&&zt(ue,Le)?Qb(i,n,Le.getNode(!E),E,!1):be?V5(n,ue.toRange(),!1):de.none()},IF=(n,i,l,d,p,w)=>{const E=ke(i,n.getBody(),l),R=It(E.getClientRects()),B=i===UA.Down,K=n.getBody();if(!R)return de.none();if(T5(n)){const Ve=B?Vt.fromRangeEnd(l):Vt.fromRangeStart(l);return(B?DF:Ry)(K,Ve).orThunk(()=>de.from(Ve)).map(vt=>vt.toRange())}const ue=(B?TS:nG)(K,z5(1),E),be=wt(ue,WA(1)),Le=R.left,je=$5(be,Le);if(je&&w(je.node)){const Ve=Math.abs(Le-je.left),mt=Math.abs(Le-je.right);return Qb(i,n,je.node,Ve<mt,!1)}let Me;if(d(E)?Me=E.getNode():p(E)?Me=E.getNode(!0):Me=Q1(l),Me){const Ve=NF(i,K,z5(1),Me);let mt=$5(wt(Ve,WA(1)),Le);if(mt||(mt=It(wt(Ve,WA(0))),mt))return V5(n,mt.position.toRange(),!1)}return be.length===0?U5(n,B).filter(B?p:d).map(Ve=>k5(n,Ve.toRange(),!1)):de.none()},U5=(n,i)=>{const l=n.selection.getRng(),d=i?Vt.fromRangeEnd(l):Vt.fromRangeStart(l),p=bE(d.container(),n.getBody());if(i){const w=xS(p,d);return Mo(w.positions)}else{const w=VA(p,d);return Po(w.positions)}},BF=(n,i,l)=>U5(n,i).filter(l).exists(d=>(n.selection.setRng(d.toRange()),!0)),a4=(n,i)=>{const l=n.dom.createRng();l.setStart(i.container(),i.offset()),l.setEnd(i.container(),i.offset()),n.selection.setRng(l)},W5=(n,i)=>{n?i.setAttribute("data-mce-selected","inline-boundary"):i.removeAttribute("data-mce-selected")},LF=(n,i,l)=>R5(i,l).map(d=>(a4(n,d),l)),oG=(n,i,l)=>{const d=Vt.fromRangeStart(n);if(n.collapsed)return d;{const p=Vt.fromRangeEnd(n);return l?Mu(i,p).getOr(p):Mf(i,d).getOr(d)}},ym=(n,i,l)=>{const d=n.getBody(),p=oG(n.selection.getRng(),d,l),w=He(Bw,n);return Kq(l,w,d,p).bind(R=>LF(n,i,R))},sG=(n,i,l)=>{const d=Tt(hl(Ye.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),E=>E.dom),p=wt(d,n),w=wt(l,n);Be(ba(p,w),He(W5,!1)),Be(ba(w,p),He(W5,!0))},j5=(n,i)=>{const l=i.get();if(n.selection.isCollapsed()&&!n.composing&&l){const d=Vt.fromRangeStart(n.selection.getRng());Vt.isTextPosition(d)&&!wW(d)&&(a4(n,sy(l,d)),i.set(null))}},FF=(n,i,l,d)=>{if(i.selection.isCollapsed()){const p=wt(d,n);Be(p,w=>{const E=Vt.fromRangeStart(i.selection.getRng());m1(n,i.getBody(),E).bind(R=>LF(i,l,R))})}},l4=(n,i,l)=>Cb(n)?ym(n,i,l).isSome():!1,HF=(n,i,l)=>Cb(i)?kF(n,i):!1,rG=n=>{const i=Ga(null),l=He(Bw,n);return n.on("NodeChange",d=>{Cb(n)&&(sG(l,n.dom,d.parents),j5(n,i),FF(l,n,i,d.parents))}),i},iG=He(HF,!0),aG=He(HF,!1),c4=(n,i,l)=>{if(Cb(n)){const d=U5(n,i).getOrThunk(()=>{const p=n.selection.getRng();return i?Vt.fromRangeEnd(p):Vt.fromRangeStart(p)});return m1(He(Bw,n),n.getBody(),d).exists(p=>{const w=$A(p);return R5(l,w).exists(E=>(a4(n,E),!0))})}else return!1},$F=(n,i)=>{const l=document.createRange();return l.setStart(n.container(),n.offset()),l.setEnd(i.container(),i.offset()),l},lG=n=>ni(rl(n),Id(n),(i,l)=>{const d=gg(!0,i),p=gg(!1,l);return Mf(n,d).forall(w=>w.isEqual(p))}).getOr(!0),zF=(n,i)=>l=>R5(i,l).map(d=>()=>a4(n,d)),DS=(n,i,l,d)=>{const p=n.getBody(),w=He(Bw,n);n.undoManager.ignore(()=>{n.selection.setRng($F(l,d)),MM(n),m1(w,p,Vt.fromRangeStart(n.selection.getRng())).map(AS).bind(zF(n,i)).each(bn)}),n.nodeChanged()},rv=(n,i)=>{const l=lm(i,n);return l||n},t_=(n,i,l,d)=>{const p=rv(n.getBody(),d.container()),w=He(Bw,n),E=m1(w,p,d);return E.bind(B=>l?B.fold(et(de.some(AS(B))),de.none,et(de.some($A(B))),de.none):B.fold(de.none,et(de.some($A(B))),de.none,et(de.some(AS(B))))).map(zF(n,i)).getOrThunk(()=>{const B=m0(l,p,d),K=B.bind(ie=>m1(w,p,ie));return ni(E,K,()=>Wb(w,p,d).bind(ie=>lG(ie)?de.some(()=>{Ub(n,l,Ye.fromDom(ie))}):de.none())).getOrThunk(()=>K.bind(()=>B.map(ie=>()=>{l?DS(n,i,d,ie):DS(n,i,ie,d)})))})},OS=(n,i,l)=>{if(n.selection.isCollapsed()&&Cb(n)){const d=Vt.fromRangeStart(n.selection.getRng());return t_(n,i,l,d)}return de.none()},Z5=n=>ic(n)>1,u4=(n,i)=>{const l=Ye.fromDom(n.getBody()),d=Ye.fromDom(n.selection.getStart()),p=Vb(d,l);return ds(p,i).fold(et(p),w=>p.slice(0,w))},VF=n=>ic(n)===1,cG=n=>u4(n,i=>ac(i)||Z5(i)),UF=n=>u4(n,ac),q5=(n,i)=>{const l=He(cR,n);return Rs(i,d=>l(d)?[d.dom]:[])},WF=n=>{const i=UF(n);return q5(n,i)},uG=(n,i,l,d)=>{const p=q5(i,d);if(p.length===0)Ub(i,n,l);else{const w=hS(l.dom,p);i.selection.setRng(w.toRange())}},fG=(n,i)=>{const l=wt(cG(n),VF);return Mo(l).bind(d=>{const p=Vt.fromRangeStart(n.selection.getRng());return RM(i,p,d.dom)&&!_T(d)?de.some(()=>uG(i,n,d,l)):de.none()})},dG=(n,i)=>{const l=i.parentElement;return ui(i)&&!X(l)&&n.dom.isEmpty(l)},hG=n=>_T(Ye.fromDom(n)),jF=(n,i)=>{const l=n.selection.getStart(),d=dG(n,l)||hG(l)?hS(l,i):XW(n.selection.getRng(),i);n.selection.setRng(d.toRange())},ZF=(n,i)=>{const l=ba(i,WF(n));l.length>0&&jF(n,l)},G5=n=>Sn(n.startContainer),Qse=n=>n.startOffset===0&&G5(n),ere=(n,i)=>{const l=i.startContainer.parentElement;return!X(l)&&cR(n,Ye.fromDom(l))},tre=n=>{const i=n.startContainer.parentNode,l=n.endContainer.parentNode;return!X(i)&&!X(l)&&i.isEqualNode(l)},mG=n=>{const i=n.endContainer;return n.endOffset===(Sn(i)?i.length:i.childNodes.length)},nre=n=>tre(n)&&mG(n),ore=n=>!n.endContainer.isEqualNode(n.commonAncestorContainer),gG=n=>nre(n)||ore(n),pG=n=>{const i=n.selection.getRng();return Qse(i)&&ere(n,i)&&gG(i)},sre=n=>{if(pG(n)){const i=WF(n);return de.some(()=>{MM(n),ZF(n,i)})}else return de.none()},K5=(n,i)=>n.selection.isCollapsed()?fG(n,i):sre(n),Th=n=>tR(n,i=>$c(i.dom),ac),qF=n=>Th(Ye.fromDom(n.selection.getStart())),jA=n=>{const i=n.selection.getRng();return i.collapsed&&(G5(i)||n.dom.isEmpty(i.startContainer))&&!qF(n)},ZA=n=>(jA(n)&&jF(n,[]),!0),f4=(n,i,l)=>_e(l)?de.some(()=>{n._selectionOverrides.hideFakeCaret(),Ub(n,i,Ye.fromDom(l))}):de.none(),GF=(n,i)=>{const l=i?$b:oS,d=i?pn.Forwards:pn.Backwards,p=ke(d,n.getBody(),n.selection.getRng());return l(p)?f4(n,i,p.getNode(!i)):de.from(gg(i,p)).filter(w=>l(w)&&zt(p,w)).bind(w=>f4(n,i,w.getNode(!i)))},Y5=(n,i)=>{const l=n.selection.getNode();return qu(l)?f4(n,i,l):de.none()},X5=(n,i)=>n.selection.isCollapsed()?GF(n,i):Y5(n,i),bG=n=>Bl(n,i=>ha(i.dom)||As(i.dom)).exists(i=>ha(i.dom)),d4=n=>qc(n!=null?n:"").getOr(0),KF=(n,i)=>{const l=n||At(i)?"margin":"padding",d=Ri(i,"direction")==="rtl"?"-right":"-left";return l+d},vG=(n,i,l,d,p,w)=>{const E=KF(l,Ye.fromDom(w)),R=d4(n.getStyle(w,E));if(i==="outdent"){const B=Math.max(0,R-d);n.setStyle(w,E,B?B+p:"")}else{const B=R+d+p;n.setStyle(w,E,B)}},yG=(n,i)=>Js(i,l=>{const d=KF(dC(n),l),p=Ta(l,d).map(d4).getOr(0);return n.dom.getContentEditable(l.dom)!=="false"&&p>0}),h4=n=>{const i=_G(n);return!n.mode.isReadOnly()&&(i.length>1||yG(n,i))},YF=n=>Au(n)||Za(n),wG=n=>ai(n).exists(YF),_G=n=>wt(Qd(n.selection.getSelectedBlocks()),i=>!YF(i)&&!wG(i)&&bG(i)),XF=(n,i)=>{var l,d;const{dom:p}=n,w=qk(n),E=(d=(l=/[a-z%]+$/i.exec(w))===null||l===void 0?void 0:l[0])!==null&&d!==void 0?d:"px",R=d4(w),B=dC(n);Be(_G(n),K=>{vG(p,i,B,R,E,K.dom)})},JF=n=>XF(n,"indent"),CG=n=>XF(n,"outdent"),QF=n=>{if(n.selection.isCollapsed()&&h4(n)){const i=n.dom,l=n.selection.getRng(),d=Vt.fromRangeStart(l),p=i.getParent(l.startContainer,i.isBlock);if(p!==null&&_M(Ye.fromDom(p),d))return de.some(()=>CG(n))}return de.none()},e7=(n,i,l)=>Ls([QF,ev,x5,(d,p)=>OS(d,i,p),C5,y0,M5,X5,S5,K5],d=>d(n,l)).filter(d=>n.selection.isEditable()),SG=(n,i)=>{e7(n,i,!1).fold(()=>{MM(n),Lw(n)},bn)},J5=(n,i)=>{e7(n,i,!0).fold(()=>sS(n),bn)},m4=(n,i)=>{n.addCommand("delete",()=>{SG(n,i)}),n.addCommand("forwardDelete",()=>{J5(n,i)})},Q5=5,t7=400,n7=n=>n.touches===void 0||n.touches.length!==1?de.none():de.some(n.touches[0]),kG=(n,i)=>{const l=Math.abs(n.clientX-i.x),d=Math.abs(n.clientY-i.y);return l>Q5||d>Q5},eN=n=>{const i=mh(),l=Ga(!1),d=Rv(p=>{n.dispatch("longpress",{...p,type:"longpress"}),l.set(!0)},t7);n.on("touchstart",p=>{n7(p).each(w=>{d.cancel();const E={x:w.clientX,y:w.clientY,target:p.target};d.throttle(p),l.set(!1),i.set(E)})},!0),n.on("touchmove",p=>{d.cancel(),n7(p).each(w=>{i.on(E=>{kG(w,E)&&(i.clear(),l.set(!1),n.dispatch("longpresscancel"))})})},!0),n.on("touchend touchcancel",p=>{d.cancel(),p.type!=="touchcancel"&&i.get().filter(w=>w.target.isEqualNode(p.target)).each(()=>{l.get()?p.preventDefault():n.dispatch("tap",{...p,type:"tap"})})},!0)},tN=(n,i)=>un(n,i.nodeName),EG=(n,i)=>Sn(i)?!0:Qn(i)?!tN(n.getBlockElements(),i)&&!Bd(i)&&!Jm(n,i):!1,AG=(n,i,l)=>Xt(eW(Ye.fromDom(l),Ye.fromDom(i)),d=>tN(n,d.dom)),xG=(n,i)=>{if(Sn(i)){if(i.data.length===0)return!0;if(/^\s+$/.test(i.data)&&(!i.nextSibling||tN(n,i.nextSibling)))return!0}return!1},Sg=n=>n.dom.create(Hc(n),o0(n)),o7=n=>{const i=n.dom,l=n.selection,d=n.schema,p=d.getBlockElements(),w=l.getStart(),E=n.getBody();let R,B,K=!1;const ie=Hc(n);if(!w||!Qn(w))return;const ue=E.nodeName.toLowerCase();if(!d.isValidChild(ue,ie.toLowerCase())||AG(p,E,w))return;const be=l.getRng(),{startContainer:Le,startOffset:je,endContainer:Me,endOffset:Ve}=be,mt=Nw(n);let vt=E.firstChild;for(;vt;)if(Qn(vt)&&Cv(d,vt),EG(d,vt)){if(xG(p,vt)){B=vt,vt=vt.nextSibling,i.remove(B);continue}R||(R=Sg(n),E.insertBefore(R,vt),K=!0),B=vt,vt=vt.nextSibling,R.appendChild(B)}else R=null,vt=vt.nextSibling;K&&mt&&(be.setStart(Le,je),be.setEnd(Me,Ve),l.setRng(be),n.nodeChanged())},nN=(n,i,l)=>{const d=Ye.fromDom(Sg(n)),p=ve();Qi(d,p),l(i,d);const w=document.createRange();return w.setStartBefore(p.dom),w.setEndBefore(p.dom),w},rre=n=>{n.on("NodeChange",He(o7,n))},TG=n=>i=>(" "+i.attr("class")+" ").indexOf(n)!==-1,ire=(n,i,l)=>function(d){const p=arguments,w=p[p.length-2],E=w>0?i.charAt(w-1):"";if(E==='"')return d;if(E===">"){const R=i.lastIndexOf("<",w);if(R!==-1&&i.substring(R,w).indexOf('contenteditable="false"')!==-1)return d}return'<span class="'+l+'" data-mce-content="'+n.dom.encode(p[0])+'">'+n.dom.encode(typeof p[1]=="string"?p[1]:p[0])+"</span>"},are=(n,i,l)=>{let d=i.length,p=l.content;if(l.format!=="raw"){for(;d--;)p=p.replace(i[d],ire(n,p,ow(n)));l.content=p}},DG=n=>{const i="contenteditable",l=" "+hn.trim(iE(n))+" ",d=" "+hn.trim(ow(n))+" ",p=TG(l),w=TG(d),E=aE(n);E.length>0&&n.on("BeforeSetContent",R=>{are(n,E,R)}),n.parser.addAttributeFilter("class",R=>{let B=R.length;for(;B--;){const K=R[B];p(K)?K.attr(i,"true"):w(K)&&K.attr(i,"false")}}),n.serializer.addAttributeFilter(i,R=>{let B=R.length;for(;B--;){const K=R[B];!p(K)&&!w(K)||(E.length>0&&K.attr("data-mce-content")?(K.name="#text",K.type=3,K.raw=!0,K.value=K.attr("data-mce-content")):K.attr(i,null))}})},g4=n=>Xe(Ye.fromDom(n.getBody()),"*[data-mce-caret]").map(i=>i.dom).getOrNull(),s7=(n,i)=>{i.hasAttribute("data-mce-caret")&&(Wm(i),n.selection.setRng(n.selection.getRng()),n.selection.scrollIntoView(i))},oN=(n,i)=>{const l=g4(n);if(!!l){if(i.type==="compositionstart"){i.preventDefault(),i.stopPropagation(),s7(n,l);return}Bc(l)&&(s7(n,l),n.undoManager.add())}},r7=n=>{n.on("keyup compositionstart",He(oN,n))},sN=As,i7=(n,i,l)=>PF(i,n,l,vy,zb,sN),OG=(n,i,l)=>IF(i,n,l,w=>vy(w)||nB(w),w=>zb(w)||oB(w),sN),MG=n=>{const i=n.dom.create(Hc(n));return i.innerHTML='<br data-mce-bogus="1">',i},a7=(n,i,l)=>{const d=ka(n.getBody()),p=He(Ct,i===1?d.next:d.prev);if(l.collapsed){const w=n.dom.getParent(l.startContainer,"PRE");if(!w)return;if(!p(Vt.fromRangeStart(l))){const R=Ye.fromDom(MG(n));i===1?Yc(Ye.fromDom(w),R):wa(Ye.fromDom(w),R),n.selection.select(R.dom,!0),n.selection.collapse()}}},RG=(n,i)=>{const l=i?pn.Forwards:pn.Backwards,d=n.selection.getRng();return i7(l,n,d).orThunk(()=>(a7(n,l,d),de.none()))},p4=(n,i)=>{const l=i?1:-1,d=n.selection.getRng();return OG(l,n,d).orThunk(()=>(a7(n,l,d),de.none()))},NG=(n,i)=>{const l=i?n.getEnd(!0):n.getStart(!0);return yB(l)?!i:i},l7=(n,i)=>RG(n,NG(n.selection,i)).exists(l=>(sv(n,l),!0)),c7=(n,i)=>p4(n,i).exists(l=>(sv(n,l),!0)),b4=(n,i)=>BF(n,i,i?zb:vy),v4=(n,i)=>XT(n,!i).map(l=>{const d=l.toRange(),p=n.selection.getRng();return i?d.setStart(p.startContainer,p.startOffset):d.setEnd(p.endContainer,p.endOffset),d}).exists(l=>(sv(n,l),!0)),PG=n=>St(["figcaption"],Xr(n)),u7=(n,i)=>{const l=He(bt,i);return Bl(Ye.fromDom(n.container()),ac,l).filter(PG)},IG=(n,i,l)=>i?s4(n.dom,l):F5(n.dom,l),BG=(n,i)=>{const l=Ye.fromDom(n.getBody()),d=Vt.fromRangeStart(n.selection.getRng());return u7(d,l).exists(()=>{if(IG(l,i,d)){const w=nN(n,l,i?Qi:Jd);return n.selection.setRng(w),!0}else return!1})},f7=(n,i)=>n.selection.isCollapsed()?BG(n,i):!1,LG=(n,i,l)=>{const d=n.selection.getRng(),p=Vt.fromRangeStart(d);return n.getBody().firstChild===i&&F5(l,p)?(n.execCommand("InsertNewBlockBefore"),!0):!1},FG=(n,i)=>{const l=n.selection.getRng(),d=Vt.fromRangeStart(l);return n.getBody().lastChild===i&&s4(i,d)?(n.execCommand("InsertNewBlockAfter"),!0):!1},HG=(n,i)=>i?de.from(n.dom.getParent(n.selection.getNode(),"details")).map(l=>FG(n,l)).getOr(!1):de.from(n.dom.getParent(n.selection.getNode(),"summary")).bind(l=>de.from(n.dom.getParent(l,"details")).map(d=>LG(n,d,l))).getOr(!1),y4=(n,i)=>HG(n,i),d7={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},h7=n=>Tt(n,i=>({...d7,...i})),$G=n=>Tt(n,i=>({...d7,...i})),m7=(n,i)=>i.keyCode===n.keyCode&&i.shiftKey===n.shiftKey&&i.altKey===n.altKey&&i.ctrlKey===n.ctrlKey&&i.metaKey===n.metaKey,zG=(n,i)=>Rs(h7(n),l=>m7(l,i)?[l]:[]),VG=(n,i)=>Rs($G(n),l=>m7(l,i)?[l]:[]),us=(n,...i)=>()=>n.apply(null,i),qA=(n,i)=>eo(zG(n,i),l=>l.action()),nc=(n,i)=>Ls(VG(n,i),l=>l.action()),g7=(n,i)=>{const l=i?pn.Forwards:pn.Backwards,d=n.selection.getRng();return PF(n,l,d,$b,oS,qu).exists(p=>(sv(n,p),!0))},p7=(n,i)=>{const l=i?1:-1,d=n.selection.getRng();return IF(n,l,d,$b,oS,qu).exists(p=>(sv(n,p),!0))},b7=(n,i)=>BF(n,i,i?oS:$b),rN=lg.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),MS={...rN,none:n=>rN.none(n)},Py=(n,i)=>w4(n,i,gt),w4=(n,i,l)=>Rs(xa(n),d=>wu(d,i)?l(d)?[d]:[]:w4(d,i,l)),y7=(n,i,l=qe)=>{if(l(i))return de.none();if(St(n,Xr(i)))return de.some(i);const d=p=>wu(p,"table")||l(p);return Se(i,n.join(","),d)},iN=(n,i)=>y7(["td","th"],n,i),aN=n=>Py(n,"th,td"),_4=(n,i)=>rt(n,"table",i),C4=(n,i,l,d,p=gt)=>{const w=d===1;if(!w&&l<=0)return MS.first(n[0]);if(w&&l>=n.length-1)return MS.last(n[n.length-1]);{const E=l+d,R=n[E];return p(R)?MS.middle(i,R):C4(n,i,E,d,p)}},GA=(n,i)=>_4(n,i).bind(l=>{const d=aN(l);return ds(d,w=>bt(n,w)).map(w=>({index:w,all:d}))}),S4=(n,i,l)=>GA(n,l).fold(()=>MS.none(n),p=>C4(p.all,n,p.index,1,i)),KA=(n,i,l)=>GA(n,l).fold(()=>MS.none(),p=>C4(p.all,n,p.index,-1,i)),YA=(n,i)=>({left:n.left-i,top:n.top-i,right:n.right+i*2,bottom:n.bottom+i*2,width:n.width+i,height:n.height+i}),_p=(n,i)=>Rs(i,l=>{const d=YA(Zp(l.getBoundingClientRect()),-1);return[{x:d.left,y:n(d),cell:l},{x:d.right,y:n(d),cell:l}]}),XA=(n,i,l)=>vn(n,(d,p)=>d.fold(()=>de.some(p),w=>{const E=Math.sqrt(Math.abs(w.x-i)+Math.abs(w.y-l)),R=Math.sqrt(Math.abs(p.x-i)+Math.abs(p.y-l));return de.some(R<E?p:w)}),de.none()),lN=(n,i,l,d,p)=>{const w=hl(Ye.fromDom(l),"td,th,caption").map(R=>R.dom),E=wt(_p(n,w),R=>i(R,p));return XA(E,d,p).map(R=>R.cell)},w7=n=>n.bottom,UG=n=>n.top,_7=(n,i)=>n.y<i,WG=(n,i)=>n.y>i,jG=He(lN,w7,_7),JA=He(lN,UG,WG),ZG=(n,i)=>Po(i.getClientRects()).bind(l=>jG(n,l.left,l.top)).bind(l=>o4(H5(l),i)),qG=(n,i)=>Mo(i.getClientRects()).bind(l=>JA(n,l.left,l.top)).bind(l=>o4(TF(l),i)),GG=(n,i,l)=>l.breakAt.exists(d=>n(i,d).breakAt.isSome()),KG=n=>n.breakType===ov.Wrap&&n.positions.length===0,YG=n=>n.breakType===ov.Br&&n.positions.length===1,C7=(n,i,l)=>{const d=n(i,l);return KG(d)||!ui(l.getNode())&&YG(d)?!GG(n,i,d):d.breakAt.isNone()},XG=He(C7,VA),JG=He(C7,xS),QG=(n,i,l)=>{const d=Vt.fromRangeStart(i);return iy(!n,l).exists(p=>p.isEqual(d))},eK=(n,i,l,d)=>{const p=n.selection.getRng(),w=i?1:-1;return Db()&&QG(i,p,l)?(Qb(w,n,l,!i,!1).each(E=>{sv(n,E)}),!0):!1},tK=(n,i,l)=>ZG(i,l).orThunk(()=>Po(l.getClientRects()).bind(d=>L5(xF(n,Vt.before(i)),d.left))).getOr(Vt.before(i)),nK=(n,i,l)=>qG(i,l).orThunk(()=>Po(l.getClientRects()).bind(d=>L5(My(n,Vt.after(i)),d.left))).getOr(Vt.after(i)),S7=(n,i)=>{const l=i.getNode(n);return Eu(l)?de.some(l):de.none()},oK=(n,i,l)=>{i.undoManager.transact(()=>{const d=n?Yc:wa,p=nN(i,Ye.fromDom(l),d);sv(i,p)})},cN=(n,i,l)=>{const d=S7(!!i,l),p=i===!1;d.fold(()=>sv(n,l.toRange()),w=>iy(p,n.getBody()).filter(E=>E.isEqual(l)).fold(()=>sv(n,l.toRange()),E=>oK(i,n,w)))},k7=(n,i,l,d)=>{const p=n.selection.getRng(),w=Vt.fromRangeStart(p),E=n.getBody();if(!i&&XG(d,w)){const R=tK(E,l,w);return cN(n,i,R),!0}else if(i&&JG(d,w)){const R=nK(E,l,w);return cN(n,i,R),!0}else return!1},uN=(n,i,l)=>de.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(d=>de.from(n.dom.getParent(d,"table")).map(p=>l(n,i,p,d))).getOr(!1),E7=(n,i)=>uN(n,i,eK),fN=(n,i)=>uN(n,i,k7),sK=n=>{const i=r1.exact(n,0,n,0);return rM(i)},A7=(n,i,l)=>l.fold(de.none,de.none,(d,p)=>BU(p).map(w=>sK(w)),d=>(n.execCommand("mceTableInsertRowAfter"),dN(n,i,d))),dN=(n,i,l)=>A7(n,i,S4(l,Cn)),rK=(n,i,l)=>A7(n,i,KA(l,Cn)),hN=(n,i)=>{const l=["table","li","dl"],d=Ye.fromDom(n.getBody()),p=R=>{const B=Xr(R);return bt(R,d)||St(l,B)},w=n.selection.getRng(),E=Ye.fromDom(i?w.endContainer:w.startContainer);return iN(E,p).map(R=>(_4(R,p).each(ie=>{n.model.table.clearSelectedCells(ie.dom)}),n.selection.collapse(!i),(i?dN:rK)(n,p,R).each(ie=>{n.selection.setRng(ie)}),!0)).getOr(!1)},iK=(n,i,l)=>{const d=Xn.os.isMacOS()||Xn.os.isiOS();qA([{keyCode:no.RIGHT,action:us(l7,n,!0)},{keyCode:no.LEFT,action:us(l7,n,!1)},{keyCode:no.UP,action:us(c7,n,!1)},{keyCode:no.DOWN,action:us(c7,n,!0)},...d?[{keyCode:no.UP,action:us(v4,n,!1),metaKey:!0,shiftKey:!0},{keyCode:no.DOWN,action:us(v4,n,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:no.RIGHT,action:us(E7,n,!0)},{keyCode:no.LEFT,action:us(E7,n,!1)},{keyCode:no.UP,action:us(fN,n,!1)},{keyCode:no.DOWN,action:us(fN,n,!0)},{keyCode:no.UP,action:us(fN,n,!1)},{keyCode:no.UP,action:us(y4,n,!1)},{keyCode:no.DOWN,action:us(y4,n,!0)},{keyCode:no.RIGHT,action:us(g7,n,!0)},{keyCode:no.LEFT,action:us(g7,n,!1)},{keyCode:no.UP,action:us(p7,n,!1)},{keyCode:no.DOWN,action:us(p7,n,!0)},{keyCode:no.RIGHT,action:us(l4,n,i,!0)},{keyCode:no.LEFT,action:us(l4,n,i,!1)},{keyCode:no.RIGHT,ctrlKey:!d,altKey:d,action:us(iG,n,i)},{keyCode:no.LEFT,ctrlKey:!d,altKey:d,action:us(aG,n,i)},{keyCode:no.UP,action:us(f7,n,!1)},{keyCode:no.DOWN,action:us(f7,n,!0)}],l).each(p=>{l.preventDefault()})},x7=(n,i)=>{n.on("keydown",l=>{l.isDefaultPrevented()||iK(n,i,l)})},Cp=(n,i)=>({container:n,offset:i}),k4=Lr.DOM,E4=n=>i=>n===i?-1:0,aK=n=>i=>n.isBlock(i)||St(["BR","IMG","HR","INPUT"],i.nodeName)||n.getContentEditable(i)==="false",A4=(n,i,l)=>{if(Sn(n)&&i>=0)return de.some(Cp(n,i));{const d=op(k4);return de.from(d.backwards(n,i,E4(n),l)).map(p=>Cp(p.container,p.container.data.length))}},lK=(n,i,l)=>{if(Sn(n)&&i>=n.length)return de.some(Cp(n,i));{const d=op(k4);return de.from(d.forwards(n,i,E4(n),l)).map(p=>Cp(p.container,0))}},mN=(n,i,l)=>{if(!Sn(n))return de.none();const d=n.data;if(i>=0&&i<=d.length)return de.some(Cp(n,i));{const p=op(k4);return de.from(p.backwards(n,i,E4(n),l)).bind(w=>{const E=w.container.data;return mN(w.container,i+E.length,l)})}},gN=(n,i,l)=>{if(!Sn(n))return de.none();const d=n.data;if(i<=d.length)return de.some(Cp(n,i));{const p=op(k4);return de.from(p.forwards(n,i,E4(n),l)).bind(w=>gN(w.container,i-d.length,l))}},pN=(n,i,l,d,p)=>{const w=op(n,aK(n));return de.from(w.backwards(i,l,d,p))},cK=n=>n.collapsed&&Sn(n.startContainer),bN=n=>Ln(n.toString().replace(/\u00A0/g," ")),T7=n=>n!==""&&` \xA0\f
|
|
\r \v`.indexOf(n)!==-1,vN=(n,i)=>n.substring(i.length),uK=(n,i,l)=>{let d;const p=l.charAt(0);for(d=i-1;d>=0;d--){const w=n.charAt(d);if(T7(w))return de.none();if(p===w&&Qs(n,l,d,i))break}return de.some(d)},D7=(n,i,l,d=0)=>{if(!cK(i))return de.none();const p={text:"",offset:0},w=(R,B,K)=>(p.text=K+p.text,p.offset+=B,uK(p.text,p.offset,l).getOr(B)),E=n.getParent(i.startContainer,n.isBlock)||n.getRoot();return pN(n,i.startContainer,i.startOffset,w,E).bind(R=>{const B=i.cloneRange();if(B.setStart(R.container,R.offset),B.setEnd(i.endContainer,i.endOffset),B.collapsed)return de.none();const K=bN(B);return K.lastIndexOf(l)!==0||vN(K,l).length<d?de.none():de.some({text:vN(K,l),range:B,trigger:l})})},yN=(n,i,l,d=0)=>$U(Ye.fromDom(i.startContainer)).fold(()=>D7(n,i,l,d),p=>{const w=n.createRng();w.selectNode(p.dom);const E=bN(w);return de.some({range:w,text:vN(E,l),trigger:l})}),fK=n=>n.nodeType===jd,dK=n=>n.nodeType===Hf,O7=n=>{if(fK(n))return Cp(n,n.data.length);{const i=n.childNodes;return i.length>0?O7(i[i.length-1]):Cp(n,i.length)}},M7=(n,i)=>{const l=n.childNodes;return l.length>0&&i<l.length?M7(l[i],0):l.length>0&&dK(n)&&l.length===i?O7(l[l.length-1]):Cp(n,i)},hK=(n,i)=>{var l;const d=(l=n.getParent(i.container,n.isBlock))!==null&&l!==void 0?l:n.getRoot();return pN(n,i.container,i.offset,(p,w)=>w===0?-1:w,d).filter(p=>{const w=p.container.data.charAt(p.offset-1);return!T7(w)}).isSome()},mK=n=>i=>{const l=M7(i.startContainer,i.startOffset);return!hK(n,l)},gK=(n,i,l)=>Ls(l.triggers,d=>yN(n,i,d)),pK=(n,i)=>{const l=i(),d=n.selection.getRng();return gK(n.dom,d,l).bind(p=>bK(n,i,p))},bK=(n,i,l,d={})=>{var p;const w=i(),R=(p=n.selection.getRng().startContainer.nodeValue)!==null&&p!==void 0?p:"",B=wt(w.lookupByTrigger(l.trigger),ie=>l.text.length>=ie.minChars&&ie.matches.getOrThunk(()=>mK(n.dom))(l.range,R,l.text));if(B.length===0)return de.none();const K=Promise.all(Tt(B,ie=>ie.fetch(l.text,ie.maxResults,d).then(be=>({matchText:l.text,items:be,columns:ie.columns,onAction:ie.onAction,highlightOn:ie.highlightOn}))));return de.some({lookupData:K,context:l})};var g1;(function(n){n[n.Error=0]="Error",n[n.Value=1]="Value"})(g1||(g1={}));const RS=(n,i,l)=>n.stype===g1.Error?i(n.serror):l(n.svalue),R7=n=>{const i=[],l=[];return Be(n,d=>{RS(d,p=>l.push(p),p=>i.push(p))}),{values:i,errors:l}},N7=(n,i)=>n.stype===g1.Error?{stype:g1.Error,serror:i(n.serror)}:n,vK=(n,i)=>n.stype===g1.Value?{stype:g1.Value,svalue:i(n.svalue)}:n,P7=(n,i)=>n.stype===g1.Value?i(n.svalue):n,I7=(n,i)=>n.stype===g1.Error?i(n.serror):n,B7=n=>({stype:g1.Value,svalue:n}),L7=n=>({stype:g1.Error,serror:n}),Lu={fromResult:n=>n.fold(L7,B7),toResult:n=>RS(n,fc.error,fc.value),svalue:B7,partition:R7,serror:L7,bind:P7,bindError:I7,map:vK,mapError:N7,fold:RS},QA=n=>oe(n)&&gs(n).length>100?" removed due to size":JSON.stringify(n,null,2),wK=n=>{const i=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:et("... (only showing first ten failures)")}]):n;return Tt(i,l=>"Failed path: ("+l.path.join(" > ")+`)
|
|
`+l.getErrorInfo())},x4=(n,i)=>Lu.serror([{path:n,getErrorInfo:i}]),_K=(n,i,l)=>x4(n,()=>'Could not find valid *required* value for "'+i+'" in '+QA(l)),F7=(n,i)=>x4(n,()=>'Choice schema did not contain choice key: "'+i+'"'),CK=(n,i,l)=>x4(n,()=>'The chosen schema: "'+l+'" did not exist in branches: '+QA(i)),SK=(n,i)=>x4(n,et(i)),kK=(n,i,l,d)=>po(l,d).fold(()=>CK(n,l,d),w=>w.extract(n.concat(["branch: "+d]),i)),EK=(n,i)=>({extract:(p,w)=>po(w,n).fold(()=>F7(p,n),R=>kK(p,w,i,R)),toString:()=>"chooseOn("+n+"). Possible values: "+gs(i)}),AK=(n,i)=>i,kc=(n,i)=>te(n)&&te(i)?T4(n,i):i,p1=n=>(...i)=>{if(i.length===0)throw new Error("Can't merge zero objects");const l={};for(let d=0;d<i.length;d++){const p=i[d];for(const w in p)un(p,w)&&(l[w]=n(l[w],p[w]))}return l},T4=p1(kc),cre=p1(AK),H7=()=>({tag:"required",process:{}}),xK=n=>({tag:"defaultedThunk",process:n}),$7=n=>xK(et(n)),TK=()=>({tag:"option",process:{}}),z7=(n,i)=>n.length>0?Lu.svalue(T4(i,cre.apply(void 0,n))):Lu.svalue(i),n_=n=>V(Lu.serror,Or)(n),DK={consolidateObj:(n,i)=>{const l=Lu.partition(n);return l.errors.length>0?n_(l.errors):z7(l.values,i)},consolidateArr:n=>{const i=Lu.partition(n);return i.errors.length>0?n_(i.errors):Lu.svalue(i.values)}},b1=(n,i,l,d)=>({tag:"field",key:n,newKey:i,presence:l,prop:d}),OK=(n,i)=>({tag:"custom",newKey:n,instantiator:i}),V7=(n,i,l)=>{switch(n.tag){case"field":return i(n.key,n.newKey,n.presence,n.prop);case"custom":return l(n.newKey,n.instantiator)}},D4=n=>{const i=(d,p)=>Lu.bindError(n(p),w=>SK(d,w)),l=et("val");return{extract:i,toString:l}},MK=D4(Lu.svalue),wN=(n,i,l,d)=>po(i,l).fold(()=>_K(n,l,i),d),_N=(n,i,l,d)=>{const p=po(n,i).getOrThunk(()=>l(n));return d(p)},RK=(n,i,l)=>l(po(n,i)),NK=(n,i,l,d)=>{const p=po(n,i).map(w=>w===!0?l(n):w);return d(p)},PK=(n,i,l,d,p)=>{const w=R=>p.extract(i.concat([d]),R),E=R=>R.fold(()=>Lu.svalue(de.none()),B=>{const K=p.extract(i.concat([d]),B);return Lu.map(K,de.some)});switch(n.tag){case"required":return wN(i,l,d,w);case"defaultedThunk":return _N(l,d,n.process,w);case"option":return RK(l,d,E);case"defaultedOptionThunk":return NK(l,d,n.process,E);case"mergeWithThunk":return _N(l,d,et({}),R=>{const B=T4(n.process(l),R);return w(B)})}},U7=(n,i,l)=>{const d={},p=[];for(const w of l)V7(w,(E,R,B,K)=>{const ie=PK(B,n,i,E,K);Lu.fold(ie,ue=>{p.push(...ue)},ue=>{d[R]=ue})},(E,R)=>{d[E]=R(i)});return p.length>0?Lu.serror(p):Lu.svalue(d)},O4=n=>({extract:(d,p)=>U7(d,p,n),toString:()=>`obj{
|
|
`+Tt(n,p=>V7(p,(w,E,R,B)=>w+" -> "+B.toString(),(w,E)=>"state("+w+")")).join(`
|
|
`)+"}"}),M4=n=>({extract:(d,p)=>{const w=Tt(p,(E,R)=>n.extract(d.concat(["["+R+"]"]),E));return DK.consolidateArr(w)},toString:()=>"array("+n.toString()+")"}),CN=n=>D4(i=>n(i).fold(Lu.serror,Lu.svalue)),SN=(n,i,l)=>{const d=i.extract([n],l);return Lu.mapError(d,p=>({input:l,errors:p}))},IK=(n,i,l)=>Lu.toResult(SN(n,i,l)),BK=n=>`Errors:
|
|
`+wK(n.errors).join(`
|
|
`)+`
|
|
|
|
Input object: `+QA(n.input),W7=(n,i)=>EK(n,ps(i,O4)),LK=et(MK),NS=(n,i)=>D4(l=>{const d=typeof l;return n(l)?Lu.svalue(l):Lu.serror(`Expected type: ${i} but got: ${d}`)}),j7=NS(nt,"number"),R4=NS(F,"string"),Z7=NS(we,"boolean"),kN=NS(ge,"function"),o_=b1,q7=OK,FK=n=>CN(i=>St(n,i)?fc.value(i):fc.error(`Unsupported value: "${i}", choose one of "${n.join(", ")}".`)),G7=(n,i)=>o_(n,n,H7(),i),K7=n=>G7(n,R4),Y7=n=>G7(n,kN),X7=(n,i)=>o_(n,n,H7(),M4(i)),ex=(n,i)=>o_(n,n,TK(),i),tx=n=>ex(n,R4),J7=n=>ex(n,kN),HK=(n,i)=>o_(n,n,$7(i),LK()),PS=(n,i,l)=>o_(n,n,$7(i),l),Q7=(n,i)=>PS(n,i,j7),N4=(n,i)=>PS(n,i,R4),EN=(n,i,l)=>PS(n,i,FK(l)),P4=(n,i)=>PS(n,i,Z7),AN=(n,i)=>PS(n,i,kN),$K=(n,i,l)=>PS(n,i,M4(l)),fre=K7("type"),dre=Y7("fetch"),e9=Y7("onAction"),zK=AN("onSetup",()=>ft),hre=tx("text"),VK=tx("icon"),UK=tx("tooltip"),mre=tx("label"),WK=P4("active",!1),yl=P4("enabled",!0),I4=P4("primary",!1),E0=n=>HK("columns",n),IS=n=>N4("type",n),t9=O4([fre,K7("trigger"),Q7("minChars",1),E0(1),Q7("maxResults",10),J7("matches"),dre,e9,$K("highlightOn",[],R4)]),jK=n=>IK("Autocompleter",t9,{trigger:n.ch,...n}),BS=[yl,UK,VK,hre,zK],B4=[WK].concat(BS),n9=[AN("predicate",qe),EN("scope","node",["node","editor"]),EN("position","selection",["node","selection","line"])],o9=BS.concat([IS("contextformbutton"),I4,e9,q7("original",Et)]),ZK=B4.concat([IS("contextformbutton"),I4,e9,q7("original",Et)]),qK=BS.concat([IS("contextformbutton")]),GK=B4.concat([IS("contextformtogglebutton")]),KK=W7("type",{contextformbutton:o9,contextformtogglebutton:ZK});O4([IS("contextform"),AN("initValue",et("")),mre,X7("commands",KK),ex("launch",W7("type",{contextformbutton:qK,contextformtogglebutton:GK}))].concat(n9));const YK=n=>{const i=n.ui.registry.getAll().popups,l=ps(i,E=>jK(E).fold(R=>{throw new Error(BK(R))},Et)),d=cs(qn(l,E=>E.trigger)),p=uo(l);return{dataset:l,triggers:d,lookupByTrigger:E=>wt(p,R=>R.trigger===E)}},s9=(n,i)=>{const l=Rv(i.load,50);n.on("keypress compositionend",d=>{d.which!==27&&l.throttle()}),n.on("keydown",d=>{const p=d.which;p===8?l.throttle():p===27&&i.cancelIfNecessary()}),n.on("remove",l.cancel)},XK=n=>{const i=mh(),l=Ga(!1),d=i.isSet,p=()=>{d()&&(DZ(n),sr(n),l.set(!1),i.clear())},w=K=>{d()||(Ka(n,K.range),i.set({trigger:K.trigger,matchLength:K.text.length}))},E=jt(()=>YK(n)),R=K=>i.get().map(ie=>yN(n.dom,n.selection.getRng(),ie.trigger).bind(ue=>bK(n,E,ue,K))).getOrThunk(()=>pK(n,E)),B=K=>{R(K).fold(p,ie=>{w(ie.context),ie.lookupData.then(ue=>{i.get().map(be=>{const Le=ie.context;be.trigger===Le.trigger&&(Le.text.length-be.matchLength>=10?p():(i.set({...be,matchLength:Le.text.length}),l.get()?ZO(n,{lookupData:ue}):(l.set(!0),jO(n,{lookupData:ue}))))})})})};n.addCommand("mceAutocompleterReload",(K,ie)=>{const ue=oe(ie)?ie.fetchOptions:{};B(ue)}),n.addCommand("mceAutocompleterClose",p),s9(n,{cancelIfNecessary:p,load:B})},JK=ys().browser.isSafari(),r9=n=>De(Ye.fromDom(n)),i9=(n,i)=>{var l;return n.startOffset===0&&n.endOffset===((l=i.textContent)===null||l===void 0?void 0:l.length)},nx=(n,i)=>de.from(n.getParent(i.container(),"details")),xN=(n,i)=>nx(n,i).isSome(),QK=(n,i)=>{const l=de.from(n.getParent(i.startContainer,"details")),d=de.from(n.getParent(i.endContainer,"details"));if(l.isSome()||d.isSome()){const p=l.bind(w=>de.from(n.select("summary",w)[0]));return de.some({startSummary:p,startDetails:l,endDetails:d})}else return de.none()},eY=(n,i)=>rl(i).exists(l=>l.isEqual(n)),pre=(n,i)=>Id(i).exists(l=>ui(l.getNode())&&Mu(i,l).exists(d=>d.isEqual(n))||l.isEqual(n)),TN=(n,i)=>i.startSummary.exists(l=>eY(n,l)),tY=(n,i)=>i.startSummary.exists(l=>pre(n,l)),nY=(n,i)=>i.startDetails.exists(l=>Mu(l,n).forall(d=>i.startSummary.exists(p=>!p.contains(n.container())&&p.contains(d.container())))),oY=(n,i,l)=>l.startDetails.exists(d=>Mf(n,i).forall(p=>!d.contains(p.container()))),DN=(n,i)=>{const l=i.getNode();ye(l)||n.selection.setCursorLocation(l,i.offset())},a9=(n,i,l)=>{const d=n.dom.getParent(i.container(),"details");if(d&&!d.open){const p=n.dom.select("summary",d)[0];p&&(l?rl(p):Id(p)).each(E=>DN(n,E))}else DN(n,i)},l9=(n,i)=>{const l=B=>B.contains(n.startContainer),d=B=>B.contains(n.endContainer),p=i.startSummary.exists(l),w=i.startSummary.exists(d),E=i.startDetails.forall(B=>i.endDetails.forall(K=>B!==K));return(p||w)&&!(p&&w)||E},c9=(n,i,l)=>{const{dom:d,selection:p}=n,w=n.getBody();if(l==="character"){const E=Vt.fromRangeStart(p.getRng()),R=d.getParent(E.container(),d.isBlock),B=nx(d,E),K=R&&d.isEmpty(R),ie=X(R==null?void 0:R.previousSibling),ue=X(R==null?void 0:R.nextSibling);return K&&(i?ue:ie)&&m0(!i,w,E).exists(je=>xN(d,je)&&!Nl(B,nx(d,je)))?!0:m0(i,w,E).fold(qe,be=>{const Le=nx(d,be);if(xN(d,be)&&!Nl(B,Le)){if(i||a9(n,be,!1),R&&K){if(i&&ie)return!0;if(!i&&ue)return!0;a9(n,be,i),n.dom.remove(R)}return!0}else return!1})}else return!1},sY=(n,i,l,d)=>{const w=n.selection.getRng(),E=Vt.fromRangeStart(w),R=n.getBody();return d==="selection"?l9(w,i):l?tY(E,i)||oY(R,E,i):TN(E,i)||nY(E,i)},bre=(n,i,l)=>QK(n.dom,n.selection.getRng()).fold(()=>c9(n,i,l),d=>sY(n,d,i,l)||c9(n,i,l)),uf=(n,i,l)=>{const d=n.selection,p=d.getNode(),w=d.getRng(),E=Vt.fromRangeStart(w);return Hp(p)?(l==="selection"&&i9(w,p)||RM(i,E,p)?r9(p):n.undoManager.transact(()=>{const R=d.getSel();let{anchorNode:B,anchorOffset:K,focusNode:ie,focusOffset:ue}=R!=null?R:{};const be=()=>{_e(B)&&_e(K)&&_e(ie)&&_e(ue)&&(R==null||R.setBaseAndExtent(B,K,ie,ue))},Le=()=>{B=R==null?void 0:R.anchorNode,K=R==null?void 0:R.anchorOffset,ie=R==null?void 0:R.focusNode,ue=R==null?void 0:R.focusOffset},je=(Ve,mt)=>{Be(Ve.childNodes,vt=>{bw(vt)&&mt.appendChild(vt)})},Me=n.dom.create("span",{"data-mce-bogus":"1"});je(p,Me),p.appendChild(Me),be(),(l==="word"||l==="line")&&(R==null||R.modify("extend",i?"right":"left",l)),!d.isCollapsed()&&i9(d.getRng(),Me)?r9(p):(n.execCommand(i?"ForwardDelete":"Delete"),Le(),je(Me,p),be()),n.dom.remove(Me)}),!0):!1},s_=(n,i,l)=>bre(n,i,l)||JK&&uf(n,i,l)?de.some(ft):de.none(),u9=n=>(i,l,d={})=>{const p=i.getBody(),w={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:p,currentTarget:p,eventPhase:Event.AT_TARGET,originalTarget:p,explicitOriginalTarget:p,isTrusted:!1,srcElement:p,cancelable:!1,preventDefault:ft,inputType:l},E=su(new InputEvent(n));return i.dispatch(n,{...E,...w,...d})},ox=u9("input"),L4=u9("beforeinput"),f9=ys(),d9=f9.os,h9=d9.isMacOS()||d9.isiOS(),rY=f9.browser.isFirefox(),iY=(n,i,l)=>{const d=l.keyCode===no.BACKSPACE?"deleteContentBackward":"deleteContentForward",p=n.selection.isCollapsed(),w=p?"character":"selection",E=R=>p?R?"word":"line":"selection";nc([{keyCode:no.BACKSPACE,action:us(QF,n)},{keyCode:no.BACKSPACE,action:us(ev,n,!1)},{keyCode:no.DELETE,action:us(ev,n,!0)},{keyCode:no.BACKSPACE,action:us(x5,n,!1)},{keyCode:no.DELETE,action:us(x5,n,!0)},{keyCode:no.BACKSPACE,action:us(OS,n,i,!1)},{keyCode:no.DELETE,action:us(OS,n,i,!0)},{keyCode:no.BACKSPACE,action:us(y0,n,!1)},{keyCode:no.DELETE,action:us(y0,n,!0)},{keyCode:no.BACKSPACE,action:us(s_,n,!1,w)},{keyCode:no.DELETE,action:us(s_,n,!0,w)},...h9?[{keyCode:no.BACKSPACE,altKey:!0,action:us(s_,n,!1,E(!0))},{keyCode:no.DELETE,altKey:!0,action:us(s_,n,!0,E(!0))},{keyCode:no.BACKSPACE,metaKey:!0,action:us(s_,n,!1,E(!1))}]:[{keyCode:no.BACKSPACE,ctrlKey:!0,action:us(s_,n,!1,E(!0))},{keyCode:no.DELETE,ctrlKey:!0,action:us(s_,n,!0,E(!0))}],{keyCode:no.BACKSPACE,action:us(M5,n,!1)},{keyCode:no.DELETE,action:us(M5,n,!0)},{keyCode:no.BACKSPACE,action:us(X5,n,!1)},{keyCode:no.DELETE,action:us(X5,n,!0)},{keyCode:no.BACKSPACE,action:us(S5,n,!1)},{keyCode:no.DELETE,action:us(S5,n,!0)},{keyCode:no.BACKSPACE,action:us(C5,n,!1)},{keyCode:no.DELETE,action:us(C5,n,!0)},{keyCode:no.BACKSPACE,action:us(K5,n,!1)},{keyCode:no.DELETE,action:us(K5,n,!0)}],l).filter(R=>n.selection.isEditable()).each(R=>{l.preventDefault(),L4(n,d).isDefaultPrevented()||(R(),ox(n,d))})},MN=(n,i,l)=>qA([{keyCode:no.BACKSPACE,action:us(fF,n)},{keyCode:no.DELETE,action:us(fF,n)},...h9?[{keyCode:no.BACKSPACE,altKey:!0,action:us(ZA,n)},{keyCode:no.DELETE,altKey:!0,action:us(ZA,n)},...l?[{keyCode:rY?224:91,action:us(ZA,n)}]:[]]:[{keyCode:no.BACKSPACE,ctrlKey:!0,action:us(ZA,n)},{keyCode:no.DELETE,ctrlKey:!0,action:us(ZA,n)}]],i),RN=(n,i)=>{let l=!1;n.on("keydown",d=>{l=d.keyCode===no.BACKSPACE,d.isDefaultPrevented()||iY(n,i,d)}),n.on("keyup",d=>{d.isDefaultPrevented()||MN(n,d,l),l=!1})},aY=n=>{for(;n;){if(Qn(n)||Sn(n)&&n.data&&/[\r\n\s]/.test(n.data))return n;n=n.nextSibling}return null},sx=(n,i)=>{const l=n.dom,d=n.schema.getMoveCaretBeforeOnEnterElements();if(!i)return;if(/^(LI|DT|DD)$/.test(i.nodeName)){const w=aY(i.firstChild);w&&/^(UL|OL|DL)$/.test(w.nodeName)&&i.insertBefore(l.doc.createTextNode(Gr),i.firstChild)}const p=l.createRng();if(i.normalize(),i.hasChildNodes()){const w=new bi(i,i);let E=i,R;for(;R=w.current();){if(Sn(R)){p.setStart(R,0),p.setEnd(R,0);break}if(d[R.nodeName.toLowerCase()]){p.setStartBefore(R),p.setEndBefore(R);break}E=R,R=w.next()}R||(p.setStart(E,0),p.setEnd(E,0))}else ui(i)?i.nextSibling&&l.isBlock(i.nextSibling)?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)):(p.setStart(i,0),p.setEnd(i,0));n.selection.setRng(p),lf(n,p)},F4=(n,i)=>{const l=n.getRoot();let d,p=i;for(;p!==l&&p&&n.getContentEditable(p)!=="false";){if(n.getContentEditable(p)==="true"){d=p;break}p=p.parentNode}return p!==l?d:l},m9=n=>de.from(n.dom.getParent(n.selection.getStart(!0),n.dom.isBlock)),lY=n=>m9(n).fold(et(""),i=>i.nodeName.toUpperCase()),cY=n=>m9(n).filter(i=>Za(Ye.fromDom(i))).isSome(),g9=n=>{n.innerHTML='<br data-mce-bogus="1">'},uY=(n,i,l)=>{const d=n.dom;de.from(l.style).map(d.parseStyle).each(B=>{const ie={...Gh(Ye.fromDom(i)),...B};d.setStyles(i,ie)});const p=de.from(l.class).map(B=>B.split(/\s+/)),w=de.from(i.className).map(B=>wt(B.split(/\s+/),K=>K!==""));ni(p,w,(B,K)=>{const ie=wt(K,be=>!St(B,be)),ue=[...B,...ie];d.setAttrib(i,"class",ue.join(" "))});const E=["style","class"],R=Wt(l,(B,K)=>!St(E,K));d.setAttribs(i,R)},Dh=(n,i)=>{if(Hc(n).toLowerCase()===i.tagName.toLowerCase()){const d=o0(n);uY(n,i,d)}},p9=(n,i,l,d,p=!0,w)=>{const E=n.dom,R=n.schema,B=Hc(n),K=l?l.nodeName.toUpperCase():"";let ie=i;const ue=R.getTextInlineElements();let be;w||K==="TABLE"||K==="HR"?be=E.create(w||B):be=l.cloneNode(!1);let Le=be;if(!p)E.setAttrib(be,"style",null),E.setAttrib(be,"class",null);else do if(ue[ie.nodeName]){if($c(ie)||Bd(ie))continue;const je=ie.cloneNode(!1);E.setAttrib(je,"id",""),be.hasChildNodes()?(je.appendChild(be.firstChild),be.appendChild(je)):(Le=je,be.appendChild(je))}while((ie=ie.parentNode)&&ie!==d);return Dh(n,be),g9(Le),be},fY=(n,i)=>n.dom.getParent(i,_a),Iy=(n,i,l)=>{let d=i;for(;d&&d!==n&&X(d.nextSibling);){const p=d.parentElement;if(!p||!l(p))return _a(p);d=p}return!1},dY=(n,i,l)=>!i&&l.nodeName.toLowerCase()===Hc(n)&&n.dom.isEmpty(l)&&Iy(n.getBody(),l,d=>un(n.schema.getTextBlockElements(),d.nodeName.toLowerCase())),b9=(n,i,l)=>{var d,p,w;const E=i(Hc(n)),R=fY(n,l);!R||(n.dom.insertAfter(E,R),sx(n,E),((w=(p=(d=l.parentElement)===null||d===void 0?void 0:d.childNodes)===null||p===void 0?void 0:p.length)!==null&&w!==void 0?w:0)>1&&n.dom.remove(l))},hY=(n,i)=>n.firstChild&&n.firstChild.nodeName===i,mY=n=>{var i;return((i=n.parentNode)===null||i===void 0?void 0:i.firstChild)===n},v9=(n,i)=>{const l=n==null?void 0:n.parentNode;return _e(l)&&l.nodeName===i},y9=n=>_e(n)&&/^(OL|UL|LI)$/.test(n.nodeName),gY=n=>_e(n)&&/^(LI|DT|DD)$/.test(n.nodeName),pY=n=>y9(n)&&y9(n.parentNode),H4=n=>{const i=n.parentNode;return gY(i)?i:n},LS=(n,i,l)=>{let d=n[l?"firstChild":"lastChild"];for(;d&&!Qn(d);)d=d[l?"nextSibling":"previousSibling"];return d===i},w9=(n,i,l,d,p)=>{const w=n.dom,E=n.selection.getRng(),R=l.parentNode;if(l===n.getBody()||!R)return;pY(l)&&(p="LI");let B=i(p);if(LS(l,d,!0)&&LS(l,d,!1))if(v9(l,"LI")){const K=H4(l);w.insertAfter(B,K),mY(l)?w.remove(K):w.remove(l)}else w.replace(B,l);else if(LS(l,d,!0))v9(l,"LI")?(w.insertAfter(B,H4(l)),B.appendChild(w.doc.createTextNode(" ")),B.appendChild(l)):R.insertBefore(B,l),w.remove(d);else if(LS(l,d,!1))w.insertAfter(B,H4(l)),w.remove(d);else{l=H4(l);const K=E.cloneRange();K.setStartAfter(d),K.setEndAfter(l);const ie=K.extractContents();p==="LI"&&hY(ie,"LI")?(B=ie.firstChild,w.insertAfter(ie,l)):(w.insertAfter(ie,l),w.insertAfter(B,l)),w.remove(d)}sx(n,B)},$4=n=>{Be(X0(Ye.fromDom(n),el),i=>{const l=i.dom;l.nodeValue=Ln(l.data)})},bY=(n,i)=>{const l=n.dom.getParent(i,"ol,ul,dl");return l!==null&&n.dom.getContentEditableParent(l)==="false"},vY=(n,i)=>i&&i.nodeName==="A"&&n.isEmpty(i),NN=(n,i)=>n.nodeName===i||n.previousSibling&&n.previousSibling.nodeName===i,PN=(n,i)=>_e(i)&&n.isBlock(i)&&!/^(TD|TH|CAPTION|FORM)$/.test(i.nodeName)&&!/^(fixed|absolute)/i.test(i.style.position)&&n.isEditable(i.parentNode)&&n.getContentEditable(i)!=="false",yY=(n,i,l)=>{var d;const p=[];if(!l)return;let w=l;for(;w=w.firstChild;){if(n.isBlock(w))return;Qn(w)&&!i[w.nodeName.toLowerCase()]&&p.push(w)}let E=p.length;for(;E--;)w=p[E],(!w.hasChildNodes()||w.firstChild===w.lastChild&&((d=w.firstChild)===null||d===void 0?void 0:d.nodeValue)===""||vY(n,w))&&n.remove(w)},z4=(n,i,l)=>Sn(i)?n?l===1&&i.data.charAt(l-1)===Ft?0:l:l===i.data.length-1&&i.data.charAt(l)===Ft?i.data.length:l:l,wY=n=>{const i=n.cloneRange();return i.setStart(n.startContainer,z4(!0,n.startContainer,n.startOffset)),i.setEnd(n.endContainer,z4(!1,n.endContainer,n.endOffset)),i},_9=n=>{let i=n;do Sn(i)&&(i.data=i.data.replace(/^[\r\n]+/,"")),i=i.firstChild;while(i)},C9=(n,i,l,d,p)=>{var w,E;const R=n.dom,B=(w=F4(R,d))!==null&&w!==void 0?w:R.getRoot();let K=R.getParent(d,R.isBlock);if(!K||!PN(R,K)){if(K=K||B,!K.hasChildNodes()){const Le=R.create(i);return Dh(n,Le),K.appendChild(Le),l.setStart(Le,0),l.setEnd(Le,0),Le}let ie=d;for(;ie&&ie.parentNode!==K;)ie=ie.parentNode;let ue;for(;ie&&!R.isBlock(ie);)ue=ie,ie=ie.previousSibling;const be=(E=ue==null?void 0:ue.parentElement)===null||E===void 0?void 0:E.nodeName;if(ue&&be&&n.schema.isValidChild(be,i.toLowerCase())){const Le=ue.parentNode,je=R.create(i);for(Dh(n,je),Le.insertBefore(je,ue),ie=ue;ie&&!R.isBlock(ie);){const Me=ie.nextSibling;je.appendChild(ie),ie=Me}l.setStart(d,p),l.setEnd(d,p)}}return d},_Y=(n,i)=>{i.normalize();const l=i.lastChild;(!l||Qn(l)&&/^(left|right)$/gi.test(n.getStyle(l,"float",!0)))&&n.add(i,"br")},CY=(n,i)=>{const l=jr(n);return Te(i)?!1:F(l)?St(hn.explode(l),i.nodeName.toLowerCase()):l},k9={insert:(n,i)=>{let l,d,p,w,E=!1;const R=n.dom,B=n.schema,K=B.getNonEmptyElements(),ie=n.selection.getRng(),ue=Hc(n),be=Ye.fromDom(ie.startContainer),Le=Wu(be,ie.startOffset),je=Le.exists(wn=>xi(wn)&&!Cn(wn)),Me=ie.collapsed&&je,Ve=wn=>p9(n,l,zn,dn,bh(n),wn),mt=wn=>{const go=z4(wn,l,d);if(Sn(l)&&(wn?go>0:go<l.data.length))return!1;if(l.parentNode===zn&&E&&!wn||wn&&Qn(l)&&l===zn.firstChild)return!0;if(NN(l,"TABLE")||NN(l,"HR"))return E&&!wn||!E&&wn;const Oo=new bi(l,zn);Sn(l)&&(wn&&go===0?Oo.prev():!wn&&go===l.data.length&&Oo.next());let Cs;for(;Cs=Oo.current();){if(Qn(Cs)){if(!Cs.getAttribute("data-mce-bogus")){const Us=Cs.nodeName.toLowerCase();if(K[Us]&&Us!=="br")return!1}}else if(Sn(Cs)&&!Zm(Cs.data))return!1;wn?Oo.prev():Oo.next()}return!0},vt=()=>{let wn;return/^(H[1-6]|PRE|FIGURE)$/.test(p)&&Pn!=="HGROUP"?wn=Ve(ue):wn=Ve(),CY(n,w)&&PN(R,w)&&R.isEmpty(zn,void 0,{includeZwsp:!0})?wn=R.split(w,zn):R.insertAfter(wn,zn),sx(n,wn),wn};QC(R,ie).each(wn=>{ie.setStart(wn.startContainer,wn.startOffset),ie.setEnd(wn.endContainer,wn.endOffset)}),l=ie.startContainer,d=ie.startOffset;const yt=!!(i&&i.shiftKey),Mt=!!(i&&i.ctrlKey);Qn(l)&&l.hasChildNodes()&&!Me&&(E=d>l.childNodes.length-1,l=l.childNodes[Math.min(d,l.childNodes.length-1)]||l,E&&Sn(l)?d=l.data.length:d=0);const dn=F4(R,l);if(!dn||bY(n,l))return;yt||(l=C9(n,ue,ie,l,d));let zn=R.getParent(l,R.isBlock)||R.getRoot();w=_e(zn==null?void 0:zn.parentNode)?R.getParent(zn.parentNode,R.isBlock):null,p=zn?zn.nodeName.toUpperCase():"";const Pn=w?w.nodeName.toUpperCase():"";if(Pn==="LI"&&!Mt){const wn=w;zn=wn,w=wn.parentNode,p=Pn}if(Qn(w)&&dY(n,yt,zn))return b9(n,Ve,zn);if(/^(LI|DT|DD)$/.test(p)&&Qn(w)&&R.isEmpty(zn)){w9(n,Ve,w,zn,ue);return}if(!Me&&(zn===n.getBody()||!PN(R,zn)))return;const Lt=zn.parentNode;let $t;if(Me)$t=Ve(ue),Le.fold(()=>{Qi(be,Ye.fromDom($t))},wn=>{wa(wn,Ye.fromDom($t))}),n.selection.setCursorLocation($t,0);else if(vi(zn))$t=Wm(zn),R.isEmpty(zn)&&g9(zn),Dh(n,$t),sx(n,$t);else if(mt(!1))$t=vt();else if(mt(!0)&&Lt){$t=Lt.insertBefore(Ve(),zn);const wn=jh(Ye.fromDom(ie.startContainer))&&ie.collapsed;sx(n,NN(zn,"HR")||wn?$t:zn)}else{const wn=wY(ie).cloneRange();wn.setEndAfter(zn);const go=wn.extractContents();$4(go),_9(go),$t=go.firstChild,R.insertAfter(go,zn),yY(R,K,$t),_Y(R,zn),R.isEmpty(zn)&&g9(zn),$t.normalize(),R.isEmpty($t)?(R.remove($t),vt()):(Dh(n,$t),sx(n,$t))}R.setAttrib($t,"id",""),n.dispatch("NewBlock",{newBlock:$t})},fakeEventName:"insertParagraph"},V4=(n,i,l)=>{const d=new bi(i,l);let p;const w=n.getNonEmptyElements();for(;p=d.next();)if(w[p.nodeName.toLowerCase()]||Sn(p)&&p.length>0)return!0;return!1},E9=(n,i,l)=>{const d=n.dom.createRng();l?(d.setStartBefore(i),d.setEndBefore(i)):(d.setStartAfter(i),d.setEndAfter(i)),n.selection.setRng(d),lf(n,d)},IN=(n,i)=>{const l=n.selection,d=n.dom,p=l.getRng();let w,E=!1;QC(d,p).each(Le=>{p.setStart(Le.startContainer,Le.startOffset),p.setEnd(Le.endContainer,Le.endOffset)});let R=p.startOffset,B=p.startContainer;if(Qn(B)&&B.hasChildNodes()){const Le=R>B.childNodes.length-1;B=B.childNodes[Math.min(R,B.childNodes.length-1)]||B,Le&&Sn(B)?R=B.data.length:R=0}let K=d.getParent(B,d.isBlock);const ie=K&&K.parentNode?d.getParent(K.parentNode,d.isBlock):null,ue=ie?ie.nodeName.toUpperCase():"",be=!!(i&&i.ctrlKey);ue==="LI"&&!be&&(K=ie),Sn(B)&&R>=B.data.length&&(V4(n.schema,B,K||d.getRoot())||(w=d.create("br"),p.insertNode(w),p.setStartAfter(w),p.setEndAfter(w),E=!0)),w=d.create("br"),gh(d,p,w),E9(n,w,E),n.undoManager.add()},BN=(n,i)=>{const l=Ye.fromTag("br");wa(Ye.fromDom(i),l),n.undoManager.add()},A9=(n,i)=>{yre(n.getBody(),i)||Yc(Ye.fromDom(i),Ye.fromTag("br"));const l=Ye.fromTag("br");Yc(Ye.fromDom(i),l),E9(n,l.dom,!1),n.undoManager.add()},SY=n=>ui(n.getNode()),yre=(n,i)=>SY(Vt.after(i))?!0:Mf(n,Vt.after(i)).map(l=>ui(l.getNode())).getOr(!1),iv=n=>n&&n.nodeName==="A"&&"href"in n,kY=n=>n.fold(qe,iv,iv,qe),EY=n=>{const i=He(Bw,n),l=Vt.fromRangeStart(n.selection.getRng());return m1(i,n.getBody(),l).filter(kY)},AY=(n,i)=>{i.fold(ft,He(BN,n),He(A9,n),ft)},FN={insert:(n,i)=>{const l=EY(n);l.isSome()?l.each(He(AY,n)):IN(n,i)},fakeEventName:"insertLineBreak"},x9=(n,i)=>m9(n).filter(l=>i.length>0&&wu(Ye.fromDom(l),i)).isSome(),T9=n=>x9(n,aC(n)),TY=n=>x9(n,J2(n)),wm=lg.generate([{br:[]},{block:[]},{none:[]}]),DY=(n,i)=>TY(n),HN=n=>(i,l)=>cY(i)===n,U4=(n,i)=>(l,d)=>lY(l)===n.toUpperCase()===i,OY=n=>{const i=F4(n.dom,n.selection.getStart());return Te(i)},r_=n=>U4("pre",n),D9=()=>U4("summary",!0),i_=n=>(i,l)=>Rd(i)===n,O9=(n,i)=>T9(n),rx=(n,i)=>i,MY=n=>{const i=Hc(n),l=F4(n.dom,n.selection.getStart());return _e(l)&&n.schema.isValidChild(l.nodeName,i)},RY=n=>{const i=n.selection.getRng(),l=Ye.fromDom(i.startContainer),p=Wu(l,i.startOffset).map(w=>xi(w)&&!Cn(w));return i.collapsed&&p.getOr(!0)},$d=(n,i)=>(l,d)=>vn(n,(w,E)=>w&&E(l,d),!0)?de.some(i):de.none(),M9=(n,i)=>vF([$d([DY],wm.none()),$d([r_(!0),OY],wm.none()),$d([D9()],wm.br()),$d([r_(!0),i_(!1),rx],wm.br()),$d([r_(!0),i_(!1)],wm.block()),$d([r_(!0),i_(!0),rx],wm.block()),$d([r_(!0),i_(!0)],wm.br()),$d([HN(!0),rx],wm.br()),$d([HN(!0)],wm.block()),$d([O9],wm.br()),$d([rx],wm.br()),$d([MY],wm.block()),$d([RY],wm.block())],[n,!!(i&&i.shiftKey)]).getOr(wm.none()),W4=(n,i,l)=>{i.selection.isCollapsed()||rA(i),!(_e(l)&&L4(i,n.fakeEventName).isDefaultPrevented())&&(n.insert(i,l),_e(l)&&ox(i,n.fakeEventName))},R9=(n,i)=>{const l=()=>W4(FN,n,i),d=()=>W4(k9,n,i),p=M9(n,i);switch(X2(n)){case"linebreak":p.fold(l,l,ft);break;case"block":p.fold(d,d,ft);break;case"invert":p.fold(d,l,ft);break;default:p.fold(l,d,ft);break}},$N=ys(),NY=$N.os.isiOS()&&$N.browser.isSafari(),N9=(n,i)=>{i.isDefaultPrevented()||(i.preventDefault(),aZ(n.undoManager),n.undoManager.transact(()=>{R9(n,i)}))},PY=n=>{if(!n.collapsed)return!1;const i=n.startContainer;if(Sn(i)){const l=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,d=i.data.charAt(n.startOffset-1);return l.test(d)}else return!1},IY=n=>{let i=de.none();const l=p=>{i=de.some(p.selection.getBookmark()),p.undoManager.add()},d=(p,w)=>{p.undoManager.undo(),i.fold(ft,E=>p.selection.moveToBookmark(E)),N9(p,w),i=de.none()};n.on("keydown",p=>{p.keyCode===no.ENTER&&(NY&&PY(n.selection.getRng())?l(n):N9(n,p))}),n.on("keyup",p=>{p.keyCode===no.ENTER&&i.each(()=>d(n,p))})},BY=(n,i,l)=>{const d=Xn.os.isMacOS()||Xn.os.isiOS();qA([{keyCode:no.END,action:us(b4,n,!0)},{keyCode:no.HOME,action:us(b4,n,!1)},...d?[]:[{keyCode:no.HOME,action:us(v4,n,!1),ctrlKey:!0,shiftKey:!0},{keyCode:no.END,action:us(v4,n,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:no.END,action:us(b7,n,!0)},{keyCode:no.HOME,action:us(b7,n,!1)},{keyCode:no.END,action:us(c4,n,!0,i)},{keyCode:no.HOME,action:us(c4,n,!1,i)}],l).each(p=>{l.preventDefault()})},P9=(n,i)=>{n.on("keydown",l=>{l.isDefaultPrevented()||BY(n,i,l)})},LY=n=>{n.on("input",i=>{i.isComposing||hW(n)})},I9=ys(),FY=(n,i,l)=>{qA([{keyCode:no.PAGE_UP,action:us(c4,n,!1,i)},{keyCode:no.PAGE_DOWN,action:us(c4,n,!0,i)}],l)},B9=n=>n.stopImmediatePropagation(),L9=n=>n.keyCode===no.PAGE_UP||n.keyCode===no.PAGE_DOWN,F9=(n,i,l)=>{l&&!n.get()?i.on("NodeChange",B9,!0):!l&&n.get()&&i.off("NodeChange",B9),n.set(l)},HY=(n,i)=>{if(I9.os.isMacOS())return;const l=Ga(!1);n.on("keydown",d=>{L9(d)&&F9(l,n,!0)}),n.on("keyup",d=>{d.isDefaultPrevented()||FY(n,i,d),L9(d)&&l.get()&&(F9(l,n,!1),n.nodeChanged())})},a_=(n,i)=>{const l=i.container(),d=i.offset();return Sn(l)?(l.insertData(d,n),de.some(Vt(l,d+n.length))):Ue(i).map(p=>{const w=Ye.fromText(n);return i.isAtEnd()?Yc(p,w):wa(p,w),Vt(w.dom,n.length)})},H9=He(a_,Gr),$9=He(a_," "),z9=(n,i)=>dB(n,i)?H9(i):$9(i),$Y=n=>i=>i.fold(l=>Mu(n.dom,Vt.before(l)),l=>rl(l),l=>Id(l),l=>Mf(n.dom,Vt.after(l))),zY=(n,i)=>l=>dB(n,l)?H9(i):$9(i),V9=n=>i=>{n.selection.setRng(i.toRange()),n.nodeChanged()},U9=(n,i)=>n.isEditable(n.getParent(i,"summary")),VY=n=>{const i=Vt.fromRangeStart(n.selection.getRng()),l=Ye.fromDom(n.getBody());if(n.selection.isCollapsed()){const d=He(Bw,n),p=Vt.fromRangeStart(n.selection.getRng());return m1(d,n.getBody(),p).bind($Y(l)).map(w=>()=>zY(l,i)(w).each(V9(n)))}else return de.none()},UY=n=>{const i=()=>{const l=Ye.fromDom(n.getBody());n.selection.isCollapsed()||n.getDoc().execCommand("Delete");const d=Vt.fromRangeStart(n.selection.getRng());z9(l,d).each(V9(n))};return Ss(Xn.browser.isFirefox()&&n.selection.isEditable()&&U9(n.dom,n.selection.getRng().startContainer),i)},wre=(n,i)=>{nc([{keyCode:no.SPACEBAR,action:us(VY,n)},{keyCode:no.SPACEBAR,action:us(UY,n)}],i).each(l=>{i.preventDefault(),L4(n,"insertText",{data:" "}).isDefaultPrevented()||(l(),ox(n,"insertText",{data:" "}))})},j4=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||wre(n,i)})},WY=n=>lE(n)?[{keyCode:no.TAB,action:us(hN,n,!0)},{keyCode:no.TAB,shiftKey:!0,action:us(hN,n,!1)}]:[],jY=(n,i)=>{qA([...WY(n)],i).each(l=>{i.preventDefault()})},ZY=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||jY(n,i)})},qY=n=>{if(n.addShortcut("Meta+P","","mcePrint"),XK(n),S0(n))return Ga(null);{const i=rG(n);return r7(n),x7(n,i),RN(n,i),IY(n),j4(n),LY(n),ZY(n),P9(n,i),HY(n,i),i}};class GY{constructor(i){this.lastPath=[],this.editor=i;let l;const d=this;"onselectionchange"in i.getDoc()||i.on("NodeChange click mouseup keyup focus",p=>{const w=i.selection.getRng(),E={startContainer:w.startContainer,startOffset:w.startOffset,endContainer:w.endContainer,endOffset:w.endOffset};(p.type==="nodechange"||!P3(E,l))&&i.dispatch("SelectionChange"),l=E}),i.on("contextmenu",()=>{i.dispatch("SelectionChange")}),i.on("SelectionChange",()=>{const p=i.selection.getStart(!0);!p||LC(i)&&!d.isSameElementPath(p)&&i.dom.isChildOf(p,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("mouseup",p=>{!p.isDefaultPrevented()&&LC(i)&&(i.selection.getNode().nodeName==="IMG"?mg.setEditorTimeout(i,()=>{i.nodeChanged()}):i.nodeChanged())})}nodeChanged(i={}){const l=this.editor.selection;let d;if(this.editor.initialized&&l&&!Zv(this.editor)&&!this.editor.mode.isReadOnly()){const p=this.editor.getBody();d=l.getStart(!0)||p,(d.ownerDocument!==this.editor.getDoc()||!this.editor.dom.isChildOf(d,p))&&(d=p);const w=[];this.editor.dom.getParent(d,E=>E===p?!0:(w.push(E),!1)),this.editor.dispatch("NodeChange",{...i,element:d,parents:w})}}isSameElementPath(i){let l;const d=this.editor,p=Zs(d.dom.getParents(i,gt,d.getBody()));if(p.length===this.lastPath.length){for(l=p.length;l>=0&&p[l]===this.lastPath[l];l--);if(l===-1)return this.lastPath=p,!0}return this.lastPath=p,!1}}const W9=Ni("image"),KY=n=>{const i=n;return de.from(i[W9])},YY=(n,i)=>{const l=n;l[W9]=i},zN=Ni("event"),XY=n=>{const i=n;return de.from(i[zN])},Z4=n=>i=>{const l=i;l[zN]=n},JY=(n,i)=>Z4(i)(n),j9=Z4(0),Zi=Z4(2),QY=Z4(1),tX=(n=>i=>{const l=i;return de.from(l[zN]).exists(d=>d===n)})(0),VN=()=>Object.freeze({length:0,item:n=>null}),q4=Ni("mode"),Z9=n=>{const i=n;return de.from(i[q4])},G4=n=>i=>{const l=i;l[q4]=n},UN=(n,i)=>G4(i)(n),q9=G4(0),WN=G4(2),G9=G4(1),K9=n=>i=>{const l=i;return de.from(l[q4]).exists(d=>d===n)},FS=K9(0),Y9=K9(1),HS=(n,i)=>({...i,get length(){return i.length},add:(l,d)=>{if(FS(n))if(F(l)){if(!ye(d))return i.add(l,d)}else return i.add(l);return null},remove:l=>{FS(n)&&i.remove(l)},clear:()=>{FS(n)&&i.clear()}}),ix=["none","copy","link","move"],nX=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],jN=()=>{const n=new window.DataTransfer;let i="move",l="all";const d={get dropEffect(){return i},set dropEffect(p){St(ix,p)&&(i=p)},get effectAllowed(){return l},set effectAllowed(p){tX(d)&&St(nX,p)&&(l=p)},get items(){return HS(d,n.items)},get files(){return Y9(d)?VN():n.files},get types(){return n.types},setDragImage:(p,w,E)=>{FS(d)&&(YY(d,{image:p,x:w,y:E}),n.setDragImage(p,w,E))},getData:p=>Y9(d)?"":n.getData(p),setData:(p,w)=>{FS(d)&&n.setData(p,w)},clearData:p=>{FS(d)&&n.clearData(p)}};return q9(d),d},$S=n=>{const i=jN(),l=Z9(n);return WN(n),j9(i),i.dropEffect=n.dropEffect,i.effectAllowed=n.effectAllowed,KY(n).each(d=>i.setDragImage(d.image,d.x,d.y)),Be(n.types,d=>{d!=="Files"&&i.setData(d,n.getData(d))}),Be(n.files,d=>i.items.add(d)),XY(n).each(d=>{JY(i,d)}),l.each(d=>{UN(n,d),UN(i,d)}),i},oX=n=>{const i=n.getData("text/html");return i===""?de.none():de.some(i)},K4=(n,i)=>n.setData("text/html",i),Y4="x-tinymce/html",ax=et(Y4),ZN="<!-- "+Y4+" -->",sX=n=>ZN+n,X9=n=>n.replace(ZN,""),qN=n=>n.indexOf(ZN)!==-1,rX=n=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(n),iX=(n,i)=>{let l="<"+n;const d=qn(i,(p,w)=>w+'="'+Yg.encodeAllRaw(p)+'"');return d.length&&(l+=" "+d.join(" ")),l+">"},aX=(n,i,l)=>{const d=n.split(/\n\n/),p=iX(i,l),w="</"+i+">",E=Tt(d,B=>B.split(/\n/).join("<br />")),R=B=>p+B+w;return E.length===1?E[0]:Tt(E,R).join("")},GN="%MCEPASTEBIN%",lX=(n,i)=>{const{dom:l,selection:d}=n,p=n.getBody();i.set(d.getRng());const w=l.add(n.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},GN);Xn.browser.isFirefox()&&l.setStyle(w,"left",l.getStyle(p,"direction",!0)==="rtl"?65535:-65535),l.bind(w,"beforedeactivate focusin focusout",E=>{E.stopPropagation()}),w.focus(),d.select(w,!0)},J9=(n,i)=>{const l=n.dom;if(KN(n)){let d;const p=i.get();for(;d=KN(n);)l.remove(d),l.unbind(d);p&&n.selection.setRng(p)}i.set(null)},KN=n=>n.dom.get("mcepastebin"),cX=n=>_e(n)&&n.id==="mcepastebin",uX=n=>{const i=n.dom,l=(E,R)=>{E.appendChild(R),i.remove(R,!0)},[d,...p]=wt(n.getBody().childNodes,cX);Be(p,E=>{l(d,E)});const w=i.select("div[id=mcepastebin]",d);for(let E=w.length-1;E>=0;E--){const R=i.create("div");d.insertBefore(R,w[E]),l(R,w[E])}return d?d.innerHTML:""},Q9=n=>n===GN,fX=n=>{const i=Ga(null);return{create:()=>lX(n,i),remove:()=>J9(n,i),getEl:()=>KN(n),getHtml:()=>uX(n),getLastRng:i.get}},lx=(n,i)=>(hn.each(i,l=>{ee(l,RegExp)?n=n.replace(l,""):n=n.replace(l[0],l[1])}),n),dX=n=>{const i=dh(),l=yS({},i);let d="";const p=i.getVoidElements(),w=hn.makeMap("script noscript style textarea video audio iframe object"," "),E=i.getBlockElements(),R=B=>{const K=B.name,ie=B;if(K==="br"){d+=`
|
|
`;return}if(K!=="wbr"){if(p[K]&&(d+=" "),w[K]){d+=" ";return}if(B.type===3&&(d+=B.value),!(B.name in i.getVoidElements())){let ue=B.firstChild;if(ue)do R(ue);while(ue=ue.next)}E[K]&&ie.next&&(d+=`
|
|
`,K==="p"&&(d+=`
|
|
`))}};return n=lx(n,[/<!\[[^\]]+\]>/g]),R(l.parse(n)),d},YN=n=>(n=lx(n,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(l,d,p)=>!d&&!p?" ":Gr],/<br class="Apple-interchange-newline">/g,/<br>$/i]),n),hX=n=>{let i=0;return()=>n+i++},mX=n=>{const i=n.toLowerCase(),l={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return hn.hasOwn(l,i)?"image/"+l[i]:"image/"+i},gX=(n,i)=>{const l=yS({sanitize:Jv(n)},n.schema);l.addNodeFilter("meta",p=>{hn.each(p,w=>{w.remove()})});const d=l.parse(i,{forced_root_block:!1,isRootContent:!0});return Pw({validate:!0},n.schema).serialize(d)},eH=(n,i)=>({content:n,cancelled:i}),pX=(n,i,l)=>{const d=n.dom.create("div",{style:"display:none"},i),p=T3(n,d,l);return eH(p.node.innerHTML,p.isDefaultPrevented())},bX=(n,i,l)=>{const d=qO(n,i,l),p=gX(n,d.content);return n.hasEventListeners("PastePostProcess")&&!d.isDefaultPrevented()?pX(n,p,l):eH(p,d.isDefaultPrevented())},tH=(n,i,l)=>bX(n,i,l),XN=(n,i)=>(n.insertContent(i,{merge:EC(n),paste:!0}),!0),JN=n=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(n),vX=(n,i)=>JN(i)&&Xt(rw(n),l=>Ki(i.toLowerCase(),`.${l.toLowerCase()}`)),yX=(n,i,l)=>(n.undoManager.extra(()=>{l(n,i)},()=>{n.insertContent('<img src="'+i+'">')}),!0),wX=(n,i,l)=>(n.undoManager.extra(()=>{l(n,i)},()=>{n.execCommand("mceInsertLink",!1,i)}),!0),_X=(n,i,l)=>!n.selection.isCollapsed()&&JN(i)?wX(n,i,l):!1,CX=(n,i,l)=>vX(n,i)?yX(n,i,l):!1,nH=(n,i)=>{hn.each([_X,CX,XN],l=>!l(n,i,XN))},SX=(n,i,l)=>{l||!AC(n)?XN(n,i):nH(n,i)},kX=hX("mceclip"),EX=n=>{const i=jN();return K4(i,n),WN(i),i},oH=(n,i,l,d,p)=>{const w=tH(n,i,l);if(!w.cancelled){const E=w.content,R=()=>SX(n,E,d);p?L4(n,"insertFromPaste",{dataTransfer:EX(E)}).isDefaultPrevented()||(R(),ox(n,"insertFromPaste")):R()}},X4=(n,i,l,d)=>{const p=l||qN(i);oH(n,X9(i),p,!1,d)},QN=(n,i,l)=>{const d=n.dom.encode(i).replace(/\r\n/g,`
|
|
`),p=rh(d,sE(n)),w=aX(p,Hc(n),o0(n));oH(n,w,!1,!0,l)},sH=n=>{const i={};if(n&&n.types)for(let l=0;l<n.types.length;l++){const d=n.types[l];try{i[d]=n.getData(d)}catch{i[d]=""}}return i},v1=(n,i)=>i in n&&n[i].length>0,e6=n=>v1(n,"text/html")||v1(n,"text/plain"),AX=(n,i)=>{const l=i.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return _e(l)?n.dom.encode(l[1]):void 0},rH=(n,i,l,d)=>{const p=kX(),w=Qf(n)&&_e(l.name),E=w?AX(n,l.name):p,R=w?l.name:void 0,B=i.create(p,l,d,E,R);return i.add(B),B},iH=(n,i)=>{kR(i.uri).each(({data:l,type:d,base64Encoded:p})=>{const w=p?l:btoa(l),E=i.file,R=n.editorUpload.blobCache,B=R.getByData(w,d),K=B!=null?B:rH(n,R,E,w);X4(n,`<img src="${K.blobUri()}">`,!1,!0)})},t6=n=>n.type==="paste",xX=n=>Promise.all(Tt(n,i=>A8(i).then(l=>({file:i,uri:l})))),aH=n=>{const i=rw(n);return l=>xr(l.type,"image/")&&Xt(i,d=>mX(d)===l.type)},TX=(n,i)=>{const l=i.items?Rs(Mr(i.items),p=>p.kind==="file"?[p.getAsFile()]:[]):[],d=i.files?Mr(i.files):[];return wt(l.length>0?l:d,aH(n))},n6=(n,i,l)=>{const d=t6(i)?i.clipboardData:i.dataTransfer;if(Yv(n)&&d){const p=TX(n,d);if(p.length>0)return i.preventDefault(),xX(p).then(w=>{l&&n.selection.setRng(l),Be(w,E=>{iH(n,E)})}),!0}return!1},DX=n=>{var i,l;return Xn.os.isAndroid()&&((l=(i=n.clipboardData)===null||i===void 0?void 0:i.items)===null||l===void 0?void 0:l.length)===0},lH=n=>no.metaKeyPressed(n)&&n.keyCode===86||n.shiftKey&&n.keyCode===45,o6=(n,i,l,d,p)=>{let w=YN(l);const E=v1(i,ax())||qN(l),R=!E&&rX(w),B=JN(w);(Q9(w)||!w.length||R&&!B)&&(d=!0),(d||B)&&(v1(i,"text/plain")&&R?w=i["text/plain"]:w=dX(w)),!Q9(w)&&(d?QN(n,w,p):X4(n,w,E,p))},OX=(n,i,l)=>{let d;const p=()=>i.getLastRng()||n.selection.getRng();n.on("keydown",w=>{lH(w)&&!w.isDefaultPrevented()&&(d=w.shiftKey&&w.keyCode===86)}),n.on("paste",w=>{if(w.isDefaultPrevented()||DX(w))return;const E=l.get()==="text"||d;d=!1;const R=sH(w.clipboardData);!e6(R)&&n6(n,w,p())||(v1(R,"text/html")?(w.preventDefault(),o6(n,R,R["text/html"],E,!0)):v1(R,"text/plain")&&v1(R,"text/uri-list")?(w.preventDefault(),o6(n,R,R["text/plain"],E,!0)):(i.create(),mg.setEditorTimeout(n,()=>{const B=i.getHtml();i.remove(),o6(n,R,B,E,!1)},0)))})},MX=n=>{const i=p=>xr(p,"webkit-fake-url"),l=p=>xr(p,"data:"),d=p=>{var w;return((w=p.data)===null||w===void 0?void 0:w.paste)===!0};n.parser.addNodeFilter("img",(p,w,E)=>{if(!Yv(n)&&d(E))for(const R of p){const B=R.attr("src");F(B)&&!R.attr("data-mce-object")&&B!==Xn.transparentSrc&&(i(B)||!rE(n)&&l(B))&&R.remove()}})},cx=(n,i,l)=>{OX(n,i,l),MX(n)},RX=(n,i)=>{i.get()==="text"?(i.set("html"),jC(n,!1)):(i.set("text"),jC(n,!0)),n.focus()},NX=(n,i)=>{n.addCommand("mceTogglePlainTextPaste",()=>{RX(n,i)}),n.addCommand("mceInsertClipboardContent",(l,d)=>{d.html&&X4(n,d.html,d.internal,!1),d.text&&QN(n,d.text,!1)})},cH=(n,i,l)=>{if(n)try{return n.clearData(),n.setData("text/html",i),n.setData("text/plain",l),n.setData(ax(),i),!0}catch{return!1}else return!1},uH=(n,i,l,d)=>{cH(n.clipboardData,i.html,i.text)?(n.preventDefault(),d()):l(i.html,d)},fH=n=>(i,l)=>{const{dom:d,selection:p}=n,w=d.create("div",{contenteditable:"false","data-mce-bogus":"all"}),E=d.create("div",{contenteditable:"true"},i);d.setStyles(w,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),w.appendChild(E),d.add(n.getBody(),w);const R=p.getRng();E.focus();const B=d.createRng();B.selectNodeContents(E),p.setRng(B),mg.setEditorTimeout(n,()=>{p.setRng(R),d.remove(w),l()},0)},dH=n=>({html:sX(n.selection.getContent({contextual:!0})),text:n.selection.getContent({format:"text"})}),PX=n=>!!n.dom.getParent(n.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",n.getBody()),hH=n=>!n.selection.isCollapsed()||PX(n),J4=n=>i=>{!i.isDefaultPrevented()&&hH(n)&&uH(i,dH(n),fH(n),()=>{if(Xn.browser.isChromium()||Xn.browser.isFirefox()){const l=n.selection.getRng();mg.setEditorTimeout(n,()=>{n.selection.setRng(l),n.execCommand("Delete")},0)}else n.execCommand("Delete")})},mH=n=>i=>{!i.isDefaultPrevented()&&hH(n)&&uH(i,dH(n),fH(n),ft)},gH=n=>{n.on("cut",J4(n)),n.on("copy",mH(n))},pH=(n,i)=>{var l,d;return y.getCaretRangeFromPoint((l=i.clientX)!==null&&l!==void 0?l:0,(d=i.clientY)!==null&&d!==void 0?d:0,n.getDoc())},IX=n=>{const i=n["text/plain"];return i?i.indexOf("file://")===0:!1},bH=(n,i)=>{n.focus(),i&&n.selection.setRng(i)},_re=n=>Xt(n.files,i=>/^image\//.test(i.type)),BX=(n,i,l,d)=>{const p=n.getParent(l,E=>Jm(i,E));if(!X(n.getParent(l,"summary")))return!0;if(p&&un(d,"text/html")){const E=new DOMParser().parseFromString(d["text/html"],"text/html").body;return!X(E.querySelector(p.nodeName.toLowerCase()))}else return!1},s6=n=>{n.on("input",i=>{const l=d=>X(d.querySelector("summary"));if(i.inputType==="deleteByDrag"){const d=wt(n.dom.select("details"),l);Be(d,p=>{ui(p.firstChild)&&p.firstChild.remove();const w=n.dom.create("summary");w.appendChild(ve().dom),p.prepend(w)})}})},r6=(n,i)=>{CC(n)&&n.on("dragend dragover draggesture dragdrop drop drag",l=>{l.preventDefault(),l.stopPropagation()}),Yv(n)||n.on("drop",l=>{const d=l.dataTransfer;d&&_re(d)&&l.preventDefault()}),n.on("drop",l=>{if(l.isDefaultPrevented())return;const d=pH(n,l);if(Te(d))return;const p=sH(l.dataTransfer),w=v1(p,ax());if((!e6(p)||IX(p))&&n6(n,l,d))return;const E=p[ax()],R=E||p["text/html"]||p["text/plain"],B=BX(n.dom,n.schema,d.startContainer,p),K=i.get();K&&!B||R&&(l.preventDefault(),mg.setEditorTimeout(n,()=>{n.undoManager.transact(()=>{(E||K&&B)&&n.execCommand("Delete"),bH(n,d);const ie=YN(R);p["text/html"]?X4(n,ie,w,!0):QN(n,ie,!0)})}))}),n.on("dragstart",l=>{i.set(!0)}),n.on("dragover dragend",l=>{Yv(n)&&!i.get()&&(l.preventDefault(),bH(n,pH(n,l))),l.type==="dragend"&&i.set(!1)}),s6(n)},Q4=n=>{const i=p=>w=>{p(n,w)},l=eE(n);ge(l)&&n.on("PastePreProcess",i(l));const d=SC(n);ge(d)&&n.on("PastePostProcess",i(d))},LX=(n,i)=>{n.on("PastePreProcess",l=>{l.content=i(n,l.content,l.internal)})},FX=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i6=n=>hn.trim(n).replace(FX,BC).toLowerCase(),HX=(n,i,l)=>{const d=nE(n);if(l||d==="all"||!kC(n))return i;const p=d?d.split(/[, ]/):[];if(p&&d!=="none"){const w=n.dom,E=n.selection.getNode();i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(R,B,K,ie)=>{const ue=w.parseStyle(w.decode(K)),be={};for(let je=0;je<p.length;je++){const Me=ue[p[je]];let Ve=Me,mt=w.getStyle(E,p[je],!0);/color/.test(p[je])&&(Ve=i6(Ve),mt=i6(mt)),mt!==Ve&&(be[p[je]]=Me)}const Le=w.serializeStyle(be,"span");return Le?B+' style="'+Le+'"'+ie:B+ie})}else i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return i=i.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(w,E,R,B)=>E+' style="'+R+'"'+B),i},a6=n=>{(Xn.browser.isChromium()||Xn.browser.isSafari())&&LX(n,HX)},vH=n=>{const i=Ga(!1),l=Ga(oE(n)?"text":"html"),d=fX(n);a6(n),NX(n,l),Q4(n),n.on("PreInit",()=>{gH(n),r6(n,i),cx(n,d,l)})},$X=n=>{n.on("click",i=>{n.dom.getParent(i.target,"details")&&i.preventDefault()})},zX=n=>{n.parser.addNodeFilter("details",i=>{const l=ey(n);Be(i,d=>{l==="expanded"?d.attr("open","open"):l==="collapsed"&&d.attr("open",null)})}),n.serializer.addNodeFilter("details",i=>{const l=xb(n);Be(i,d=>{l==="expanded"?d.attr("open","open"):l==="collapsed"&&d.attr("open",null)})})},yH=n=>{$X(n),zX(n)},VX=ui,UX=Sn,WX=n=>As(n.dom),jX=n=>ha(n.dom),wH=n=>i=>bt(Ye.fromDom(n),i),_H=(n,i)=>Bl(Ye.fromDom(n),l=>jX(l)||ac(l),wH(i)).getOr(Ye.fromDom(i)).dom,CH=(n,i)=>Bl(Ye.fromDom(n),WX,wH(i)),l6=(n,i,l)=>{const d=new bi(n,i),p=l?d.next.bind(d):d.prev.bind(d);let w=n;for(let E=l?n:p();E&&!VX(E);E=p())Sl(E)&&(w=E);return w},ZX=(n,i)=>{const d=Vt.fromRangeStart(n).getNode(),p=_H(d,i),w=l6(d,p,!1),E=l6(d,p,!0),R=document.createRange();return CH(w,p).fold(()=>{UX(w)?R.setStart(w,0):R.setStartBefore(w)},B=>R.setStartBefore(B.dom)),CH(E,p).fold(()=>{UX(E)?R.setEnd(E,E.data.length):R.setEndAfter(E)},B=>R.setEndAfter(B.dom)),R},qX=n=>{const i=ZX(n.selection.getRng(),n.getBody());n.selection.setRng(KM(i))},GX=n=>{n.on("mousedown",i=>{i.detail>=3&&(i.preventDefault(),qX(n))})};var zS;(function(n){n.Before="before",n.After="after"})(zS||(zS={}));const KX=(n,i)=>Math.abs(n.left-i),SH=(n,i)=>Math.abs(n.right-i),Cre=(n,i)=>n>=i.top&&n<=i.bottom,YX=(n,i)=>n.top<i.bottom&&n.bottom>i.top,kH=(n,i)=>{const l=Fk(n,i)/Math.min(n.height,i.height);return YX(n,i)&&l>.5},XX=(n,i)=>{const l=wt(n,d=>Cre(i,d));return Lk(l).fold(()=>[[],n],d=>{const{pass:p,fail:w}=gn(n,E=>kH(E,d));return[p,w]})},c6=(n,i)=>({node:n.node,position:KX(n,i)<SH(n,i)?zS.Before:zS.After}),JX=(n,i,l)=>i>n.left&&i<n.right?0:Math.min(Math.abs(n.left-i),Math.abs(n.right-i)),u6=(n,i,l)=>{const d=ie=>Sl(ie.node)?de.some(ie):Qn(ie.node)?u6(Mr(ie.node.childNodes),i,l):de.none(),p=(ie,ue)=>{if(ie.length>=2){const be=d(ie[0]).getOr(ie[0]),Le=d(ie[1]).getOr(ie[1]);if(Math.abs(ue(be,i,l)-ue(Le,i,l))<2){if(Sn(be.node))return de.some(be);if(Sn(Le.node))return de.some(Le)}}return de.none()},w=(ie,ue)=>{const be=Ns(ie,(Le,je)=>ue(Le,i,l)-ue(je,i,l));return p(be,ue).orThunk(()=>Ls(be,d))},[E,R]=XX(OF(n),l),{pass:B,fail:K}=gn(R,ie=>ie.top<l);return w(E,JX).orThunk(()=>w(K,I2)).orThunk(()=>w(B,I2))},QX=(n,i,l,d)=>{const p=(w,E)=>{const R=K=>Qn(K)&&K.classList.contains("mce-drag-container"),B=wt(w.dom.childNodes,ct(R));return E.fold(()=>u6(B,l,d),K=>{const ie=wt(B,ue=>ue!==K.dom);return u6(ie,l,d)}).orThunk(()=>(bt(w,n)?de.none():pi(w)).bind(ie=>p(ie,de.some(w))))};return p(i,de.none())},EH=(n,i,l)=>{const d=Ye.fromDom(n),p=To(d),E=Ye.fromPoint(p,i,l).filter(R=>cn(d,R)).getOr(d);return QX(d,E,i,l)},ux=(n,i,l)=>EH(n,i,l).filter(d=>f0(d.node)).map(d=>c6(d,i)),f6=n=>{var i,l;const d=n.getBoundingClientRect(),p=n.ownerDocument,w=p.documentElement,E=p.defaultView;return{top:d.top+((i=E==null?void 0:E.scrollY)!==null&&i!==void 0?i:0)-w.clientTop,left:d.left+((l=E==null?void 0:E.scrollX)!==null&&l!==void 0?l:0)-w.clientLeft}},AH=n=>n.inline?f6(n.getBody()):{left:0,top:0},eJ=n=>{const i=n.getBody();return n.inline?{left:i.scrollLeft,top:i.scrollTop}:{left:0,top:0}},tJ=n=>{const i=n.getBody(),l=n.getDoc().documentElement,d={left:i.scrollLeft,top:i.scrollTop},p={left:i.scrollLeft||l.scrollLeft,top:i.scrollTop||l.scrollTop};return n.inline?d:p},xH=(n,i)=>{if(i.target.ownerDocument!==n.getDoc()){const l=f6(n.getContentAreaContainer()),d=tJ(n);return{left:i.pageX-l.left+d.left,top:i.pageY-l.top+d.top}}return{left:i.pageX,top:i.pageY}},nJ=(n,i,l)=>({pageX:l.left-n.left+i.left,pageY:l.top-n.top+i.top}),oJ=(n,i)=>nJ(AH(n),eJ(n),xH(n,i)),TH=n=>({target:n,srcElement:n}),d6=(n,i,l,d)=>({...i,dataTransfer:d,type:n,...TH(l)}),sJ=(n,i,l)=>{const d=an("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:n,composedPath:d,initEvent:d,preventDefault:ft,stopImmediatePropagation:ft,stopPropagation:ft,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:d,initMouseEvent:d,getModifierState:d,dataTransfer:l,...TH(i)}},rJ=(n,i)=>{const l=$S(n);return i==="dragstart"?(j9(l),q9(l)):i==="drop"?(Zi(l),WN(l)):(QY(l),G9(l)),l},iJ=(n,i,l,d)=>{const p=rJ(l,n);return ye(d)?sJ(n,i,p):d6(n,d,i,p)},eD=32,aJ=100,tD=8,fx=16,h6=As,m6=Hk(h6,ha),g6=(n,i,l)=>h6(l)&&l!==i&&n.isEditable(l.parentElement),lJ=(n,i,l)=>Te(i)||i===l||n.dom.isChildOf(i,l)?!1:n.dom.isEditable(i),p6=(n,i,l,d)=>{const p=n.dom,w=i.cloneNode(!0);p.setStyles(w,{width:l,height:d}),p.setAttrib(w,"data-mce-selected",null);const E=p.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return p.setStyles(E,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:l,height:d}),p.setStyles(w,{margin:0,boxSizing:"border-box"}),E.appendChild(w),E},cJ=(n,i)=>{n.parentNode!==i&&i.appendChild(n)},nD=(n,i)=>l=>()=>{const d=n==="left"?l.scrollX:l.scrollY;l.scroll({[n]:d+i,behavior:"smooth"})},b6=nD("left",-eD),DH=nD("left",eD),OH=nD("top",-eD),MH=nD("top",eD),uJ=(n,i,l,d,p,w,E,R,B,K,ie,ue)=>{let be=0,Le=0;n.style.left=i.pageX+"px",n.style.top=i.pageY+"px",i.pageX+l>p&&(be=i.pageX+l-p),i.pageY+d>w&&(Le=i.pageY+d-w),n.style.width=l-be+"px",n.style.height=d-Le+"px";const je=B.clientHeight,Me=B.clientWidth,Ve=E+B.getBoundingClientRect().top,mt=R+B.getBoundingClientRect().left;ie.on(vt=>{vt.intervalId.clear(),vt.dragging&&ue&&(E+tD>=je?vt.intervalId.set(MH(K)):E-tD<=0?vt.intervalId.set(OH(K)):R+tD>=Me?vt.intervalId.set(DH(K)):R-tD<=0?vt.intervalId.set(b6(K)):Ve+fx>=window.innerHeight?vt.intervalId.set(MH(window)):Ve-fx<=0?vt.intervalId.set(OH(window)):mt+fx>=window.innerWidth?vt.intervalId.set(DH(window)):mt-fx<=0&&vt.intervalId.set(b6(window)))})},RH=n=>{n&&n.parentNode&&n.parentNode.removeChild(n)},fJ=(n,i)=>{const l=n.getParent(i.parentNode,n.isBlock);RH(i),l&&l!==n.getRoot()&&n.isEmpty(l)&&De(Ye.fromDom(l))},dJ=n=>n.button===0,NH=(n,i)=>({pageX:i.pageX-n.relX,pageY:i.pageY+5}),hJ=(n,i)=>l=>{if(dJ(l)){const d=eo(i.dom.getParents(l.target),m6).getOr(null);if(_e(d)&&g6(i.dom,i.getBody(),d)){const p=i.dom.getPos(d),w=i.getBody(),E=i.getDoc().documentElement;n.set({element:d,dataTransfer:jN(),dragging:!1,screenX:l.screenX,screenY:l.screenY,maxX:(i.inline?w.scrollWidth:E.offsetWidth)-2,maxY:(i.inline?w.scrollHeight:E.offsetHeight)-2,relX:l.pageX-p.x,relY:l.pageY-p.y,width:d.offsetWidth,height:d.offsetHeight,ghost:p6(i,d,d.offsetWidth,d.offsetHeight),intervalId:Ik(aJ)})}}},v6=(n,i,l)=>{n._selectionOverrides.hideFakeCaret(),ux(n.getBody(),i,l).fold(()=>n.selection.placeCaretAt(i,l),d=>{const p=n._selectionOverrides.showCaret(1,d.node,d.position===zS.Before,!1);p?n.selection.setRng(p):n.selection.placeCaretAt(i,l)})},dx=(n,i,l,d,p)=>{i==="dragstart"&&K4(d,n.dom.getOuterHTML(l));const w=iJ(i,l,d,p);return n.dispatch(i,w)},mJ=(n,i)=>{const l=hb((p,w)=>v6(i,p,w),0);i.on("remove",l.cancel);const d=n;return p=>n.on(w=>{const E=Math.max(Math.abs(p.screenX-w.screenX),Math.abs(p.screenY-w.screenY));if(!w.dragging&&E>10){const R=dx(i,"dragstart",w.element,w.dataTransfer,p);if(_e(R.dataTransfer)&&(w.dataTransfer=R.dataTransfer),R.isDefaultPrevented())return;w.dragging=!0,i.focus()}if(w.dragging){const R=p.currentTarget===i.getDoc().documentElement,B=NH(w,oJ(i,p));cJ(w.ghost,i.getBody()),uJ(w.ghost,B,w.width,w.height,w.maxX,w.maxY,p.clientY,p.clientX,i.getContentAreaContainer(),i.getWin(),d,R),l.throttle(p.clientX,p.clientY)}})},gJ=n=>{const i=n.getSel();if(_e(i)){const d=i.getRangeAt(0).startContainer;return Sn(d)?d.parentNode:d}else return null},pJ=(n,i)=>l=>{n.on(d=>{var p;if(d.intervalId.clear(),d.dragging){if(lJ(i,gJ(i.selection),d.element)){const w=(p=i.getDoc().elementFromPoint(l.clientX,l.clientY))!==null&&p!==void 0?p:i.getBody();dx(i,"drop",w,d.dataTransfer,l).isDefaultPrevented()||i.undoManager.transact(()=>{fJ(i.dom,d.element),oX(d.dataTransfer).each(R=>i.insertContent(R)),i._selectionOverrides.hideFakeCaret()})}dx(i,"dragend",i.getBody(),d.dataTransfer,l)}}),hx(n)},PH=(n,i,l)=>{n.on(d=>{d.intervalId.clear(),d.dragging&&l.fold(()=>dx(i,"dragend",d.element,d.dataTransfer),p=>dx(i,"dragend",d.element,d.dataTransfer,p))}),hx(n)},bJ=(n,i)=>l=>PH(n,i,de.some(l)),hx=n=>{n.on(i=>{i.intervalId.clear(),RH(i.ghost)}),n.clear()},vJ=n=>{const i=mh(),l=Lr.DOM,d=document,p=hJ(i,n),w=mJ(i,n),E=pJ(i,n),R=bJ(i,n);n.on("mousedown",p),n.on("mousemove",w),n.on("mouseup",E),l.bind(d,"mousemove",w),l.bind(d,"mouseup",R),n.on("remove",()=>{l.unbind(d,"mousemove",w),l.unbind(d,"mouseup",R)}),n.on("keydown",B=>{B.keyCode===no.ESC&&PH(i,n,de.none())})},yJ=n=>{const i=p=>{if(!p.isDefaultPrevented()){const w=p.dataTransfer;w&&(St(w.types,"Files")||w.files.length>0)&&(p.preventDefault(),p.type==="drop"&&PA(n,"Dropped file type is not supported"))}},l=p=>{QE(n,p.target)&&i(p)},d=()=>{const p=Lr.DOM,w=n.dom,E=document,R=n.inline?n.getBody():n.getDoc(),B=["drop","dragover"];Be(B,K=>{p.bind(E,K,l),w.bind(R,K,i)}),n.on("remove",()=>{Be(B,K=>{p.unbind(E,K,l),w.unbind(R,K,i)})})};n.on("init",()=>{mg.setEditorTimeout(n,d,0)})},wJ=n=>{vJ(n),ug(n)&&yJ(n)},_J=n=>{const i=hb(()=>{if(!n.removed&&n.getBody().contains(document.activeElement)){const l=n.selection.getRng();if(l.collapsed){const d=k5(n,l,!1);n.selection.setRng(d)}}},0);n.on("focus",()=>{i.throttle()}),n.on("blur",()=>{i.cancel()})},CJ=n=>{n.on("init",()=>{n.on("focusin",i=>{const l=i.target;if(qu(l)){const d=wy(n.getBody(),l),p=As(d)?d:l;n.selection.getNode()!==p&&FA(n,p).each(w=>n.selection.setRng(w))}})})},mx=As,IH=(n,i)=>wy(n.getBody(),i),SJ=n=>{const i=n.selection,l=n.dom,d=n.getBody(),p=gE(n,d,l.isBlock,()=>Nw(n)),w="sel-"+l.uniqueId(),E="data-mce-selected";let R;const B=Pn=>_e(Pn)&&l.hasClass(Pn,"mce-offscreen-selection"),K=Pn=>Pn!==d&&(mx(Pn)||qu(Pn))&&l.isChildOf(Pn,d)&&l.isEditable(Pn.parentNode),ie=Pn=>{Pn&&i.setRng(Pn)},ue=(Pn,Lt,$t,wn=!0)=>n.dispatch("ShowCaret",{target:Lt,direction:Pn,before:$t}).isDefaultPrevented()?null:(wn&&i.scrollIntoView(Lt,Pn===-1),p.show($t,Lt)),be=Pn=>{Pn.hasAttribute("data-mce-caret")&&(Wm(Pn),i.scrollIntoView(Pn))},Le=()=>{n.on("click",Lt=>{l.isEditable(Lt.target)||(Lt.preventDefault(),n.focus())}),n.on("blur NewBlock",Mt),n.on("ResizeWindow FullscreenStateChanged",p.reposition),n.on("tap",Lt=>{const $t=Lt.target,wn=IH(n,$t);mx(wn)?(Lt.preventDefault(),FA(n,wn).each(yt)):K($t)&&FA(n,$t).each(yt)},!0),n.on("mousedown",Lt=>{const $t=Lt.target;if($t!==d&&$t.nodeName!=="HTML"&&!l.isChildOf($t,d)||!f5(n,Lt.clientX,Lt.clientY))return;Mt(),zn();const wn=IH(n,$t);mx(wn)?(Lt.preventDefault(),FA(n,wn).each(yt)):ux(d,Lt.clientX,Lt.clientY).each(go=>{Lt.preventDefault();const Oo=ue(1,go.node,go.position===zS.Before,!1);ie(Oo),Qn(wn)?wn.focus():n.getBody().focus()})}),n.on("keypress",Lt=>{no.modifierPressed(Lt)||mx(i.getNode())&&Lt.preventDefault()}),n.on("GetSelectionRange",Lt=>{let $t=Lt.range;if(R){if(!R.parentNode){R=null;return}$t=$t.cloneRange(),$t.selectNode(R),Lt.range=$t}}),n.on("SetSelectionRange",Lt=>{Lt.range=Ve(Lt.range);const $t=yt(Lt.range,Lt.forward);$t&&(Lt.range=$t)});const Pn=Lt=>Qn(Lt)&&Lt.id==="mcepastebin";n.on("AfterSetSelectionRange",Lt=>{const $t=Lt.range,wn=$t.startContainer.parentElement;!Me($t)&&!Pn(wn)&&zn(),B(wn)||Mt()}),wJ(n),_J(n),CJ(n)},je=Pn=>vr(Pn)||sh(Pn)||lr(Pn),Me=Pn=>je(Pn.startContainer)||je(Pn.endContainer),Ve=Pn=>{const Lt=n.schema.getVoidElements(),$t=l.createRng(),wn=Pn.startContainer,go=Pn.startOffset,Oo=Pn.endContainer,Cs=Pn.endOffset;return un(Lt,wn.nodeName.toLowerCase())?go===0?$t.setStartBefore(wn):$t.setStartAfter(wn):$t.setStart(wn,go),un(Lt,Oo.nodeName.toLowerCase())?Cs===0?$t.setEndBefore(Oo):$t.setEndAfter(Oo):$t.setEnd(Oo,Cs),$t},mt=(Pn,Lt)=>{const $t=Ye.fromDom(n.getBody()),wn=n.getDoc(),go=Xe($t,"#"+w).getOrThunk(()=>{const Us=Ye.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',wn);return Dr(Us,"id",w),Qi($t,Us),Us}),Oo=l.createRng();wd(go),Jr(go,[Ye.fromText(Gr,wn),Ye.fromDom(Lt),Ye.fromText(Gr,wn)]),Oo.setStart(go.dom.firstChild,1),Oo.setEnd(go.dom.lastChild,0),ra(go,{top:l.getPos(Pn,n.getBody()).y+"px"}),Hb(go);const Cs=i.getSel();return Cs&&(Cs.removeAllRanges(),Cs.addRange(Oo)),Oo},vt=Pn=>{const Lt=Pn.cloneNode(!0),$t=n.dispatch("ObjectSelected",{target:Pn,targetClone:Lt});if($t.isDefaultPrevented())return null;const wn=mt(Pn,$t.targetClone),go=Ye.fromDom(Pn);return Be(hl(Ye.fromDom(n.getBody()),`*[${E}]`),Oo=>{bt(go,Oo)||zi(Oo,E)}),l.getAttrib(Pn,E)||Pn.setAttribute(E,"1"),R=Pn,zn(),wn},yt=(Pn,Lt)=>{if(!Pn)return null;if(Pn.collapsed){if(!Me(Pn)){const Oo=Lt?1:-1,Cs=ke(Oo,d,Pn),Us=Cs.getNode(!Lt);if(_e(Us)){if(f0(Us))return ue(Oo,Us,Lt?!Cs.isAtEnd():!1,!1);if(tr(Us)&&As(Us.nextSibling)){const di=l.createRng();return di.setStart(Us,0),di.setEnd(Us,0),di}}const Pr=Cs.getNode(Lt);if(_e(Pr)){if(f0(Pr))return ue(Oo,Pr,Lt?!1:!Cs.isAtEnd(),!1);if(tr(Pr)&&As(Pr.previousSibling)){const di=l.createRng();return di.setStart(Pr,1),di.setEnd(Pr,1),di}}}return null}let $t=Pn.startContainer,wn=Pn.startOffset;const go=Pn.endOffset;if(Sn($t)&&wn===0&&mx($t.parentNode)&&($t=$t.parentNode,wn=l.nodeIndex($t),$t=$t.parentNode),!Qn($t))return null;if(go===wn+1&&$t===Pn.endContainer){const Oo=$t.childNodes[wn];if(K(Oo))return vt(Oo)}return null},Mt=()=>{R&&R.removeAttribute(E),Xe(Ye.fromDom(n.getBody()),"#"+w).each(br),R=null},dn=()=>{p.destroy(),R=null},zn=()=>{p.hide()};return S0(n)||Le(),{showCaret:ue,showBlockCaretContainer:be,hideFakeCaret:zn,destroy:dn}},kJ=(n,i)=>{let l=i;for(let d=n.previousSibling;Sn(d);d=d.previousSibling)l+=d.data.length;return l},y6=(n,i,l,d,p)=>{if(Sn(l)&&(d<0||d>l.data.length))return[];const w=p&&Sn(l)?[kJ(l,d)]:[d];let E=l;for(;E!==i&&E.parentNode;)w.push(n.nodeIndex(E,p)),E=E.parentNode;return E===i?w.reverse():[]},w6=(n,i,l,d,p,w,E=!1)=>{const R=y6(n,i,l,d,E),B=y6(n,i,p,w,E);return{start:R,end:B}},_6=(n,i)=>{const l=i.slice(),d=l.pop();return nt(d)?vn(l,(w,E)=>w.bind(R=>de.from(R.childNodes[E])),de.some(n)).bind(w=>Sn(w)&&(d<0||d>w.data.length)?de.none():de.some({node:w,offset:d})):de.none()},BH=(n,i)=>_6(n,i.start).bind(({node:l,offset:d})=>_6(n,i.end).map(({node:p,offset:w})=>{const E=document.createRange();return E.setStart(l,d),E.setEnd(p,w),E})),EJ=(n,i,l,d=!1)=>w6(n,i,l.startContainer,l.startOffset,l.endContainer,l.endOffset,d),l_=(n,i,l)=>{if(i&&n.isEmpty(i)&&!l(i)){const d=i.parentNode;n.remove(i,Sn(i.firstChild)&&Zm(i.firstChild.data)),l_(n,d,l)}},By=(n,i,l,d=!0)=>{const p=i.startContainer.parentNode,w=i.endContainer.parentNode;i.deleteContents(),d&&!l(i.startContainer)&&(Sn(i.startContainer)&&i.startContainer.data.length===0&&n.remove(i.startContainer),Sn(i.endContainer)&&i.endContainer.data.length===0&&n.remove(i.endContainer),l_(n,p,l),p!==w&&l_(n,w,l))},C6=(n,i)=>de.from(n.dom.getParent(i.startContainer,n.dom.isBlock)),S6=(n,i,l)=>{const d=n.dynamicPatternsLookup({text:l,block:i});return{...n,blockPatterns:rm(d).concat(n.blockPatterns),inlinePatterns:G2(d).concat(n.inlinePatterns)}},LH=(n,i,l,d)=>{const p=n.createRng();return p.setStart(i,0),p.setEnd(l,d),p.toString()},AJ=n=>/^\s[^\s]/.test(n),FH=(n,i,l)=>{lK(i,0,i).each(p=>{const w=p.container;gN(w,l.start.length,i).each(B=>{const K=n.createRng();K.setStart(w,0),K.setEnd(B.container,B.offset),By(n,K,ie=>ie===i)});const E=Ye.fromDom(w),R=Ic(E);AJ(R)&&qf(E,R.slice(1))})},xJ=(n,i)=>{const l=n.dom,d=i.pattern,p=BH(l.getRoot(),i.range).getOrDie("Unable to resolve path range"),w=(E,R)=>{const B=R.get(E);return se(B)&&Po(B).exists(K=>un(K,"block"))};return C6(n,p).each(E=>{d.type==="block-format"?w(d.format,n.formatter)&&n.undoManager.transact(()=>{FH(n.dom,E,d),n.formatter.apply(d.format)}):d.type==="block-command"&&n.undoManager.transact(()=>{FH(n.dom,E,d),n.execCommand(d.cmd,!1,d.value)})}),!0},HH=n=>Ns(n,(i,l)=>l.start.length-i.start.length),TJ=(n,i)=>{const l=HH(n),d=i.replace(Gr," ");return eo(l,p=>i.indexOf(p.start)===0||d.indexOf(p.start)===0)},$H=(n,i,l,d)=>{var p;const w=n.dom,E=Hc(n);if(!w.is(i,E))return[];const R=(p=i.textContent)!==null&&p!==void 0?p:"";return TJ(l.blockPatterns,R).map(B=>hn.trim(R).length===B.start.length?[]:[{pattern:B,range:w6(w,w.getRoot(),i,0,i,0,d)}]).getOr([])},DJ=(n,i)=>{if(i.length===0)return;const l=n.selection.getBookmark();Be(i,d=>xJ(n,d)),n.selection.moveToBookmark(l)},zH=(n,i)=>n.create("span",{"data-mce-type":"bookmark",id:i}),oD=(n,i)=>{const l=n.createRng();return l.setStartAfter(i.start),l.setEndBefore(i.end),l},VH=(n,i,l)=>{const d=BH(n.getRoot(),l).getOrDie("Unable to resolve path range"),p=d.startContainer,w=d.endContainer,E=d.endOffset===0?w:w.splitText(d.endOffset),R=d.startOffset===0?p:p.splitText(d.startOffset),B=R.parentNode,K=E.parentNode;return{prefix:i,end:K.insertBefore(zH(n,i+"-end"),E),start:B.insertBefore(zH(n,i+"-start"),R)}},UH=(n,i,l)=>{l_(n,n.get(i.prefix+"-end"),l),l_(n,n.get(i.prefix+"-start"),l)},k6=n=>n.start.length===0,OJ=n=>(i,l)=>{const p=i.data.substring(0,l),w=p.lastIndexOf(n.charAt(n.length-1)),E=p.lastIndexOf(n);return E!==-1?E+n.length:w!==-1?w+1:-1},WH=(n,i,l,d)=>{const p=i.start;return pN(n,d.container,d.offset,OJ(p),l).bind(E=>{var R,B;const K=(B=(R=l.textContent)===null||R===void 0?void 0:R.indexOf(p))!==null&&B!==void 0?B:-1;if(K!==-1&&E.offset>=K+p.length){const ue=n.createRng();return ue.setStart(E.container,E.offset-p.length),ue.setEnd(E.container,E.offset),de.some(ue)}else{const ue=E.offset-p.length;return mN(E.container,ue,l).map(be=>{const Le=n.createRng();return Le.setStart(be.container,be.offset),Le.setEnd(E.container,E.offset),Le}).filter(be=>be.toString()===p).orThunk(()=>WH(n,i,l,Cp(E.container,0)))}})},MJ=(n,i,l,d,p,w=!1)=>{if(i.start.length===0&&!w){const E=n.createRng();return E.setStart(l,d),E.setEnd(l,d),de.some(E)}return A4(l,d,p).bind(E=>WH(n,i,p,E).bind(B=>{var K;if(w){if(B.endContainer===E.container&&B.endOffset===E.offset)return de.none();if(E.offset===0&&((K=B.endContainer.textContent)===null||K===void 0?void 0:K.length)===B.endOffset)return de.none()}return de.some(B)}))},jH=(n,i,l,d)=>{const p=n.dom,w=p.getRoot(),E=l.pattern,R=l.position.container,B=l.position.offset;return mN(R,B-l.pattern.end.length,i).bind(K=>{const ie=w6(p,w,K.container,K.offset,R,B,d);if(k6(E))return de.some({matches:[{pattern:E,startRng:ie,endRng:ie}],position:K});{const ue=VS(n,l.remainingPatterns,K.container,K.offset,i,d),be=ue.getOr({matches:[],position:K}),Le=be.position;return MJ(p,E,Le.container,Le.offset,i,ue.isNone()).map(Me=>{const Ve=EJ(p,w,Me,d);return{matches:be.matches.concat([{pattern:E,startRng:Ve,endRng:ie}]),position:Cp(Me.startContainer,Me.startOffset)}})}})},VS=(n,i,l,d,p,w)=>{const E=n.dom;return A4(l,d,E.getRoot()).bind(R=>{const B=LH(E,p,l,d);for(let K=0;K<i.length;K++){const ie=i[K];if(!Ki(B,ie.end))continue;const ue=i.slice();ue.splice(K,1);const be=jH(n,p,{pattern:ie,remainingPatterns:ue,position:R},w);if(be.isNone()&&d>0)return VS(n,i,l,d-1,p,w);if(be.isSome())return be}return de.none()})},E6=(n,i,l)=>{n.selection.setRng(l),i.type==="inline-format"?Be(i.format,d=>{n.formatter.apply(d)}):n.execCommand(i.cmd,!1,i.value)},ZH=(n,i,l,d)=>{const p=oD(n.dom,l);By(n.dom,p,d),E6(n,i,p)},RJ=(n,i,l,d,p)=>{const w=n.dom,E=oD(w,d),R=oD(w,l);By(w,R,p),By(w,E,p);const B={prefix:l.prefix,start:l.end,end:d.start},K=oD(w,B);E6(n,i,K)},NJ=(n,i)=>{const l=Ni("mce_textpattern"),d=Yt(i,(p,w)=>{const E=VH(n,l+`_end${p.length}`,w.endRng);return p.concat([{...w,endMarker:E}])},[]);return Yt(d,(p,w)=>{const E=d.length-p.length-1,R=k6(w.pattern)?w.endMarker:VH(n,l+`_start${E}`,w.startRng);return p.concat([{...w,startMarker:R}])},[])},PJ=n=>Ns(n,(i,l)=>l.end.length-i.end.length),qH=(n,i)=>{const l=Js(n,d=>Xt(i,p=>d.pattern.start===p.pattern.start&&d.pattern.end===p.pattern.end));return n.length===i.length?l?n:i:n.length>i.length?n:i},A6=(n,i,l,d,p,w)=>{const E=VS(n,p.inlinePatterns,l,d,i,w).fold(()=>[],B=>B.matches),R=VS(n,PJ(p.inlinePatterns),l,d,i,w).fold(()=>[],B=>B.matches);return qH(E,R)},GH=(n,i)=>{if(i.length===0)return;const l=n.dom,d=n.selection.getBookmark(),p=NJ(l,i);Be(p,w=>{const E=l.getParent(w.startMarker.start,l.isBlock),R=B=>B===E;k6(w.pattern)?ZH(n,w.pattern,w.endMarker,R):RJ(n,w.pattern,w.startMarker,w.endMarker,R),UH(l,w.endMarker,R),UH(l,w.startMarker,R)}),n.selection.moveToBookmark(d)},IJ=(n,i)=>{const l=n.selection.getRng();return C6(n,l).map(d=>{var p;const w=Math.max(0,l.startOffset),E=S6(i,d,(p=d.textContent)!==null&&p!==void 0?p:""),R=A6(n,d,l.startContainer,w,E,!0),B=$H(n,d,E,!0);return B.length>0||R.length>0?(n.undoManager.add(),n.undoManager.extra(()=>{n.execCommand("mceInsertNewLine")},()=>{n.insertContent(Qt),GH(n,R),DJ(n,B);const K=n.selection.getRng(),ie=A4(K.startContainer,K.startOffset,n.dom.getRoot());n.execCommand("mceInsertNewLine"),ie.each(ue=>{const be=ue.container;be.data.charAt(ue.offset-1)===Qt&&(be.deleteData(ue.offset-1,1),l_(n.dom,be.parentNode,Le=>Le===n.dom.getRoot()))})}),!0):!1}).getOr(!1)},x6=(n,i)=>{const l=n.selection.getRng();C6(n,l).map(d=>{const p=Math.max(0,l.startOffset-1),w=LH(n.dom,d,l.startContainer,p),E=S6(i,d,w),R=A6(n,d,l.startContainer,p,E,!1);R.length>0&&n.undoManager.transact(()=>{GH(n,R)})})},gx=(n,i,l)=>{for(let d=0;d<n.length;d++)if(l(n[d],i))return!0;return!1},sD=(n,i)=>gx(n,i,(l,d)=>l===d.keyCode&&!no.modifierPressed(d)),av=(n,i)=>gx(n,i,(l,d)=>l.charCodeAt(0)===d.charCode),rD=n=>{const i=[",",".",";",":","!","?"],l=[32],d=()=>Jp(xC(n),nw(n)),p=()=>l0(n);n.on("keydown",E=>{if(E.keyCode===13&&!no.modifierPressed(E)&&n.selection.isCollapsed()){const R=d();(R.inlinePatterns.length>0||R.blockPatterns.length>0||p())&&IJ(n,R)&&E.preventDefault()}},!0);const w=()=>{if(n.selection.isCollapsed()){const E=d();(E.inlinePatterns.length>0||p())&&x6(n,E)}};n.on("keyup",E=>{sD(l,E)&&w()}),n.on("keypress",E=>{av(i,E)&&mg.setEditorTimeout(n,w)})},US=n=>{rD(n)},KH=n=>{const i=hn.each,l=no.BACKSPACE,d=no.DELETE,p=n.dom,w=n.selection,E=n.parser,R=Xn.browser,B=R.isFirefox(),K=R.isChromium()||R.isSafari(),ie=Xn.deviceType.isiPhone()||Xn.deviceType.isiPad(),ue=Xn.os.isMacOS()||Xn.os.isiOS(),be=(yo,Rn)=>{try{n.getDoc().execCommand(yo,!1,String(Rn))}catch{}},Le=yo=>yo.isDefaultPrevented(),je=()=>{const yo=qo=>{const Ys=p.create("body"),Kr=qo.cloneContents();return Ys.appendChild(Kr),w.serializer.serialize(Ys,{format:"html"})},Rn=qo=>{const Ys=yo(qo),Kr=p.createRng();Kr.selectNode(n.getBody());const co=yo(Kr);return Ys===co},Dn=qo=>{const Ys=Ye.fromDom(qo),Kr=co=>pi(co).exists(Ws=>!Cn(Ws));return Xt(hl(Ys,'[contenteditable="true"]'),Kr)};n.on("keydown",qo=>{const Ys=qo.keyCode;if(!Le(qo)&&(Ys===d||Ys===l)&&n.selection.isEditable()){const Kr=n.selection.isCollapsed(),co=n.getBody();if(Kr&&(!p.isEmpty(co)||Dn(co))||!Kr&&!Rn(n.selection.getRng()))return;qo.preventDefault(),n.setContent(""),co.firstChild&&p.isBlock(co.firstChild)?n.selection.setCursorLocation(co.firstChild,0):n.selection.setCursorLocation(co,0),n.nodeChanged()}})},Me=()=>{n.shortcuts.add("meta+a",null,"SelectAll")},Ve=()=>{n.inline||p.bind(n.getDoc(),"mousedown mouseup",yo=>{let Rn;if(yo.target===n.getDoc().documentElement)if(Rn=w.getRng(),n.getBody().focus(),yo.type==="mousedown"){if(vr(Rn.startContainer))return;w.placeCaretAt(yo.clientX,yo.clientY)}else w.setRng(Rn)})},mt=()=>{n.on("keydown",yo=>{if(!Le(yo)&&yo.keyCode===l){if(!n.getBody().getElementsByTagName("hr").length)return;if(w.isCollapsed()&&w.getRng().startOffset===0){const Rn=w.getNode(),Dn=Rn.previousSibling;if(Rn.nodeName==="HR"){p.remove(Rn),yo.preventDefault();return}Dn&&Dn.nodeName&&Dn.nodeName.toLowerCase()==="hr"&&(p.remove(Dn),yo.preventDefault())}}})},vt=()=>{Range.prototype.getClientRects||n.on("mousedown",yo=>{if(!Le(yo)&&yo.target.nodeName==="HTML"){const Rn=n.getBody();Rn.blur(),mg.setEditorTimeout(n,()=>{Rn.focus()})}})},yt=()=>{const yo=kb(n);n.on("click",Rn=>{const Dn=Rn.target;/^(IMG|HR)$/.test(Dn.nodeName)&&p.isEditable(Dn.parentNode)&&(Rn.preventDefault(),n.selection.select(Dn),n.nodeChanged()),Dn.nodeName==="A"&&p.hasClass(Dn,yo)&&Dn.childNodes.length===0&&p.isEditable(Dn.parentNode)&&(Rn.preventDefault(),w.select(Dn))})},Mt=()=>{const yo=()=>{const Dn=p.getAttribs(w.getStart().cloneNode(!1));return()=>{const qo=w.getStart();qo!==n.getBody()&&(p.setAttrib(qo,"style",null),i(Dn,Ys=>{qo.setAttributeNode(Ys.cloneNode(!0))}))}},Rn=()=>!w.isCollapsed()&&p.getParent(w.getStart(),p.isBlock)!==p.getParent(w.getEnd(),p.isBlock);n.on("keypress",Dn=>{let qo;return!Le(Dn)&&(Dn.keyCode===8||Dn.keyCode===46)&&Rn()?(qo=yo(),n.getDoc().execCommand("delete",!1),qo(),Dn.preventDefault(),!1):!0}),p.bind(n.getDoc(),"cut",Dn=>{if(!Le(Dn)&&Rn()){const qo=yo();mg.setEditorTimeout(n,()=>{qo()})}})},dn=()=>{n.on("keydown",yo=>{if(!Le(yo)&&yo.keyCode===l&&w.isCollapsed()&&w.getRng().startOffset===0){const Rn=w.getNode().previousSibling;if(Rn&&Rn.nodeName&&Rn.nodeName.toLowerCase()==="table")return yo.preventDefault(),!1}return!0})},zn=()=>{n.on("keydown",yo=>{if(Le(yo)||yo.keyCode!==no.BACKSPACE)return;let Rn=w.getRng();const Dn=Rn.startContainer,qo=Rn.startOffset,Ys=p.getRoot();let Kr=Dn;if(!(!Rn.collapsed||qo!==0)){for(;Kr.parentNode&&Kr.parentNode.firstChild===Kr&&Kr.parentNode!==Ys;)Kr=Kr.parentNode;Kr.nodeName==="BLOCKQUOTE"&&(n.formatter.toggle("blockquote",void 0,Kr),Rn=p.createRng(),Rn.setStart(Dn,0),Rn.setEnd(Dn,0),w.setRng(Rn))}})},Pn=()=>{const yo=()=>{be("StyleWithCSS",!1),be("enableInlineTableEditing",!1),Q2(n)||be("enableObjectResizing",!1)};cg(n)||n.on("BeforeExecCommand mousedown",yo)},Lt=()=>{const yo=()=>{i(p.select("a:not([data-mce-block])"),Rn=>{var Dn;let qo=Rn.parentNode;const Ys=p.getRoot();if((qo==null?void 0:qo.lastChild)===Rn){for(;qo&&!p.isBlock(qo);){if(((Dn=qo.parentNode)===null||Dn===void 0?void 0:Dn.lastChild)!==qo||qo===Ys)return;qo=qo.parentNode}p.add(qo,"br",{"data-mce-bogus":1})}})};n.on("SetContent ExecCommand",Rn=>{(Rn.type==="setcontent"||Rn.command==="mceInsertLink")&&yo()})},$t=()=>{n.on("init",()=>{be("DefaultParagraphSeparator",Hc(n))})},wn=yo=>{const Rn=yo.getBody(),Dn=yo.selection.getRng();return Dn.startContainer===Dn.endContainer&&Dn.startContainer===Rn&&Dn.startOffset===0&&Dn.endOffset===Rn.childNodes.length},go=()=>{n.on("keyup focusin mouseup",yo=>{!no.modifierPressed(yo)&&!wn(n)&&w.normalize()},!0)},Oo=()=>{n.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},Cs=()=>{n.inline||n.on("keydown",()=>{document.activeElement===document.body&&n.getWin().focus()})},Us=()=>{n.inline||(n.contentStyles.push("body {min-height: 150px}"),n.on("click",yo=>{let Rn;yo.target.nodeName==="HTML"&&(Rn=n.selection.getRng(),n.getBody().focus(),n.selection.setRng(Rn),n.selection.normalize(),n.nodeChanged())}))},Pr=()=>{ue&&n.on("keydown",yo=>{no.metaKeyPressed(yo)&&!yo.shiftKey&&(yo.keyCode===37||yo.keyCode===39)&&(yo.preventDefault(),n.selection.getSel().modify("move",yo.keyCode===37?"backward":"forward","lineboundary"))})},di=()=>{n.on("click",yo=>{let Rn=yo.target;do if(Rn.tagName==="A"){yo.preventDefault();return}while(Rn=Rn.parentNode)}),n.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},al=()=>{n.on("init",()=>{n.dom.bind(n.getBody(),"submit",yo=>{yo.preventDefault()})})},Rl=()=>{E.addNodeFilter("br",yo=>{let Rn=yo.length;for(;Rn--;)yo[Rn].attr("class")==="Apple-interchange-newline"&&yo[Rn].remove()})},hc=ft,Mn=()=>{if(!B||n.removed)return!1;const yo=n.selection.getSel();return!yo||!yo.rangeCount||yo.rangeCount===0},to=()=>{K&&(Ve(),yt(),al(),Me(),ie&&(Cs(),Us(),di())),B&&(vt(),Pn(),Oo(),Pr())},wr=()=>{n.on("drop",yo=>{var Rn;const Dn=(Rn=yo.dataTransfer)===null||Rn===void 0?void 0:Rn.getData("text/html");F(Dn)&&/^<img[^>]*>$/.test(Dn)&&n.dispatch("dragend",new window.DragEvent("dragend",yo))})},Is=()=>{zn(),je(),Xn.windowsPhone||go(),K&&(Ve(),yt(),$t(),al(),dn(),Rl(),ie?(Cs(),Us(),di()):Me()),B&&(mt(),vt(),Mt(),Pn(),Lt(),Oo(),Pr(),dn(),wr())};return S0(n)?to():Is(),{refreshContentEditable:hc,isHidden:Mn}},T6=Lr.DOM,BJ=(n,i)=>{const l=Ye.fromDom(n.getBody()),d=Zh(jl(l)),p=Ye.fromTag("style");Dr(p,"type","text/css"),Qi(p,Ye.fromText(i)),Qi(d,p),n.on("remove",()=>{br(p)})},YH=n=>n.inline?n.getElement().nodeName.toLowerCase():void 0,D6=n=>Wt(n,i=>ye(i)===!1),iD=n=>{const i=n.options.get,l=n.editorUpload.blobCache;return D6({allow_conditional_comments:i("allow_conditional_comments"),allow_html_data_urls:i("allow_html_data_urls"),allow_svg_data_urls:i("allow_svg_data_urls"),allow_html_in_named_anchor:i("allow_html_in_named_anchor"),allow_script_urls:i("allow_script_urls"),allow_unsafe_link_target:i("allow_unsafe_link_target"),convert_fonts_to_spans:i("convert_fonts_to_spans"),fix_list_elements:i("fix_list_elements"),font_size_legacy_values:i("font_size_legacy_values"),forced_root_block:i("forced_root_block"),forced_root_block_attrs:i("forced_root_block_attrs"),preserve_cdata:i("preserve_cdata"),inline_styles:i("inline_styles"),root_name:YH(n),sanitize:i("xss_sanitization"),validate:!0,blob_cache:l,document:n.getDoc()})},px=n=>{const i=n.options.get;return D6({custom_elements:i("custom_elements"),extended_valid_elements:i("extended_valid_elements"),invalid_elements:i("invalid_elements"),invalid_styles:i("invalid_styles"),schema:i("schema"),valid_children:i("valid_children"),valid_classes:i("valid_classes"),valid_elements:i("valid_elements"),valid_styles:i("valid_styles"),verify_html:i("verify_html"),padd_empty_block_inline_children:i("format_empty_lines")})},Ly=n=>{const i=n.options.get;return{...iD(n),...px(n),...D6({remove_trailing_brs:i("remove_trailing_brs"),pad_empty_with_br:i("pad_empty_with_br"),url_converter:i("url_converter"),url_converter_scope:i("url_converter_scope"),element_format:i("element_format"),entities:i("entities"),entity_encoding:i("entity_encoding"),indent:i("indent"),indent_after:i("indent_after"),indent_before:i("indent_before")})}},c_=n=>{const i=yS(iD(n),n.schema);return i.addAttributeFilter("src,href,style,tabindex",(l,d)=>{const p=n.dom,w="data-mce-"+d;let E=l.length;for(;E--;){const R=l[E];let B=R.attr(d);if(B&&!R.attr(w)){if(B.indexOf("data:")===0||B.indexOf("blob:")===0)continue;d==="style"?(B=p.serializeStyle(p.parseStyle(B),R.name),B.length||(B=null),R.attr(w,B),R.attr(d,B)):d==="tabindex"?(R.attr(w,B),R.attr(d,null)):R.attr(w,n.convertURL(B,d,R.name))}}}),i.addNodeFilter("script",l=>{let d=l.length;for(;d--;){const p=l[d],w=p.attr("type")||"no/type";w.indexOf("mce-")!==0&&p.attr("type","mce-"+w)}}),Xv(n)&&i.addNodeFilter("#cdata",l=>{var d;let p=l.length;for(;p--;){const w=l[p];w.type=8,w.name="#comment",w.value="[CDATA["+n.dom.encode((d=w.value)!==null&&d!==void 0?d:"")+"]]"}}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",l=>{let d=l.length;const p=n.schema.getNonEmptyElements();for(;d--;){const w=l[d];w.isEmpty(p)&&w.getAll("br").length===0&&w.append(new Hd("br",1))}}),i},XH=n=>{const i=yh(n);i&&mg.setEditorTimeout(n,()=>{let l;i===!0?l=n:l=n.editorManager.get(i),l&&!l.destroyed&&(l.focus(),l.selection.scrollIntoView())},100)},LJ=n=>{const i=n.dom.getRoot();!n.inline&&(!LC(n)||n.selection.getStart(!0)===i)&&rl(i).each(l=>{const d=l.getNode(),p=Eu(d)?rl(d).getOr(l):l;n.selection.setRng(p.toRange())})},FJ=n=>{n.bindPendingEventDelegates(),n.initialized=!0,dy(n),n.focus(!0),LJ(n),n.nodeChanged({initial:!0});const i=Eb(n);ge(i)&&i.call(n,n),XH(n)},JH=n=>n.inline?n.ui.styleSheetLoader:n.dom.styleSheetLoader,HJ=(n,i,l)=>{const d=[JH(n).loadAll(i)];return n.inline?d:d.concat([n.ui.styleSheetLoader.loadAll(l)])},QH=n=>{const i=JH(n),l=ip(n),d=n.contentCSS,p=()=>{i.unloadAll(d),n.inline||n.ui.styleSheetLoader.unloadAll(l)},w=()=>{n.removed?p():n.on("remove",p)};if(n.contentStyles.length>0){let B="";hn.each(n.contentStyles,K=>{B+=K+`\r
|
|
`}),n.dom.addStyle(B)}const E=Promise.all(HJ(n,d,l)).then(w).catch(w),R=jv(n);return R&&BJ(n,R),E},$J=n=>{const i=n.getDoc(),l=n.getBody();UO(n),lp(n)||(i.body.spellcheck=!1,T6.setAttrib(l,"spellcheck","false")),n.quirks=KH(n),UE(n);const d=r0(n);d!==void 0&&(l.dir=d);const p=tw(n);p&&n.on("BeforeSetContent",w=>{hn.each(p,E=>{w.content=w.content.replace(E,R=>"<!--mce:protected "+escape(R)+"-->")})}),n.on("SetContent",()=>{n.addVisual(n.getBody())}),n.on("compositionstart compositionend",w=>{n.composing=w.type==="compositionstart"})},e$=n=>{S0(n)||n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"})},O6=n=>{n.removed!==!0&&(e$(n),FJ(n))},zJ=n=>{let i=!1;const l=setTimeout(()=>{i||n.setProgressState(!0)},500);return()=>{clearTimeout(l),i=!0,n.setProgressState(!1)}},t$=n=>{const i=n.getElement();let l=n.getDoc();n.inline&&(T6.addClass(i,"mce-content-body"),n.contentDocument=l=document,n.contentWindow=window,n.bodyElement=i,n.contentAreaContainer=i);const d=n.getBody();d.disabled=!0,n.readonly=cg(n),n._editableRoot=vC(n),!n.readonly&&n.hasEditableRoot()&&(n.inline&&T6.getStyle(d,"position",!0)==="static"&&(d.style.position="relative"),d.contentEditable="true"),d.disabled=!1,n.editorUpload=cq(n),n.schema=dh(px(n)),n.dom=Lr(l,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,update_styles:!0,root_element:n.inline?n.getBody():null,collect:n.inline,schema:n.schema,contentCssCors:jk(n),referrerPolicy:s0(n),onSetAttrib:E=>{n.dispatch("SetAttrib",E)}}),n.parser=c_(n),n.serializer=d1(Ly(n),n),n.selection=a5(n.dom,n.getWin(),n.serializer,n),n.annotator=o1(n),n.formatter=XL(n),n.undoManager=y5(n),n._nodeChangeDispatcher=new GY(n),n._selectionOverrides=SJ(n),eN(n),yH(n),DG(n),S0(n)||(GX(n),US(n));const p=qY(n);m4(n,p),rre(n),bq(n),vH(n);const w=hZ(n);$J(n),w.fold(()=>{const E=zJ(n);QH(n).then(()=>{O6(n),E()})},E=>{n.setProgressState(!0),QH(n).then(()=>{E().then(R=>{n.setProgressState(!1),O6(n),AL(n)},R=>{n.notificationManager.open({type:"error",text:String(R)}),O6(n),AL(n)})})})},Sre=gt,VJ=(n,i,l)=>Z0(n,i,Sre,l),bx=Lr.DOM,UJ=(n,i,l,d)=>{const p=Ye.fromTag("iframe");return d.each(w=>Dr(p,"tabindex",w)),Vu(p,l),Vu(p,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:i}),Uu(p,"tox-edit-area__iframe"),p},WJ=n=>{let i=zv(n)+"<html><head>";Qp(n)!==n.documentBaseUrl&&(i+='<base href="'+n.documentBaseURI.getURI()+'" />'),i+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const l=Df(n),d=ol(n),p=n.translate(wC(n));return Md(n)&&(i+='<meta http-equiv="Content-Security-Policy" content="'+Md(n)+'" />'),i+=`</head><body id="${l}" class="mce-content-body ${d}" data-id="${n.id}" aria-label="${p}"><br></body></html>`,i},n$=(n,i)=>{const l=n.translate("Rich Text Area"),d=za(Ye.fromDom(n.getElement()),"tabindex").bind(qc),p=UJ(n.id,l,of(n),d).dom;p.onload=()=>{p.onload=null,n.dispatch("load")},n.contentAreaContainer=i.iframeContainer,n.iframeElement=p,n.iframeHTML=WJ(n),bx.add(i.iframeContainer,p)},jJ=n=>{const i=n.iframeElement,l=()=>{n.contentDocument=i.contentDocument,t$(n)};if(Ab(n)||Xn.browser.isFirefox()){const d=n.getDoc();d.open(),d.write(n.iframeHTML),d.close(),l()}else{const d=VJ(Ye.fromDom(i),"load",()=>{d.unbind(),l()});i.srcdoc=n.iframeHTML}},o$=(n,i)=>{n$(n,i),i.editorContainer&&(i.editorContainer.style.display=n.orgDisplay,n.hidden=bx.isHidden(i.editorContainer)),n.getElement().style.display="none",bx.setAttrib(n.id,"aria-hidden","true"),n.getElement().style.visibility=n.orgVisibility,jJ(n)},s$=Lr.DOM,M6=(n,i,l)=>{const d=Qw.get(l),p=Qw.urls[l]||n.documentBaseUrl.replace(/\/$/,"");if(l=hn.trim(l),d&&hn.inArray(i,l)===-1){if(n.plugins[l])return;try{const w=d(n,p)||{};n.plugins[l]=w,ge(w.init)&&(w.init(n,p),i.push(l))}catch(w){eq(n,l,w)}}},ZJ=n=>n.replace(/^\-/,""),qJ=n=>{const i=[];Be(qv(n),l=>{M6(n,i,ZJ(l))})},GJ=n=>{const i=hn.trim(cC(n)),l=n.ui.registry.getAll().icons,d={...LT.get("default").icons,...LT.get(i).icons};ln(d,(p,w)=>{un(l,w)||n.ui.registry.addIcon(w,p)})},KJ=n=>{const i=im(n);if(F(i)){const l=Dy.get(i);n.theme=l(n,Dy.urls[i])||{},ge(n.theme.init)&&n.theme.init(n,Dy.urls[i]||n.documentBaseUrl.replace(/\/$/,""))}else n.theme={}},r$=n=>{const i=Jl(n),l=SS.get(i);n.model=l(n,SS.urls[i])},R6=n=>{const i=n.theme.renderUI;return i?i():XJ(n)},i$=n=>{const i=n.getElement(),d=im(n)(n,i);return d.editorContainer.nodeType&&(d.editorContainer.id=d.editorContainer.id||n.id+"_parent"),d.iframeContainer&&d.iframeContainer.nodeType&&(d.iframeContainer.id=d.iframeContainer.id||n.id+"_iframecontainer"),d.height=d.iframeHeight?d.iframeHeight:i.offsetHeight,d},aD=(n,i)=>({editorContainer:n,iframeContainer:i,api:{}}),YJ=n=>{const i=s$.create("div");return s$.insertAfter(i,n),aD(i,i)},XJ=n=>{const i=n.getElement();return n.inline?aD(null):YJ(i)},kre=n=>{const i=n.getElement();return n.orgDisplay=i.style.display,F(im(n))?R6(n):ge(im(n))?i$(n):XJ(n)},JJ=(n,i)=>{const l={show:de.from(i.show).getOr(ft),hide:de.from(i.hide).getOr(ft),isEnabled:de.from(i.isEnabled).getOr(gt),setEnabled:d=>{n.mode.isReadOnly()||de.from(i.setEnabled).each(p=>p(d))}};n.ui={...n.ui,...l}},a$=async n=>{n.dispatch("ScriptsLoaded"),GJ(n),KJ(n),r$(n),qJ(n);const i=await kre(n);JJ(n,de.from(i.api).getOr({})),n.editorContainer=i.editorContainer,sq(n),n.inline?t$(n):o$(n,{editorContainer:i.editorContainer,iframeContainer:i.iframeContainer})},u_=Lr.DOM,l$=n=>n.charAt(0)==="-",QJ=(n,i)=>{const l=fC(i),d=Zk(i);if(!Kf.hasCode(l)&&l!=="en"){const p=pr(d)?d:`${i.editorManager.baseURL}/langs/${l}.js`;n.add(p).catch(()=>{XZ(i,p,l)})}},Ere=(n,i)=>{const l=im(n);if(F(l)&&!l$(l)&&!un(Dy.urls,l)){const d=Gk(n),p=d?n.documentBaseURI.toAbsolute(d):`themes/${l}/theme${i}.js`;Dy.load(l,p).catch(()=>{JZ(n,p,l)})}},Are=(n,i)=>{const l=Jl(n);if(l!=="plugin"&&!un(SS.urls,l)){const d=sf(n),p=F(d)?n.documentBaseURI.toAbsolute(d):`models/${l}/model${i}.js`;SS.load(l,p).catch(()=>{QZ(n,p,l)})}},c$=n=>de.from(ia(n)).filter(pr).map(i=>({url:i,name:de.none()})),N6=(n,i,l)=>de.from(i).filter(d=>pr(d)&&!LT.has(d)).map(d=>({url:`${n.editorManager.baseURL}/icons/${d}/icons${l}.js`,name:de.some(d)})),eQ=(n,i,l)=>{const d=N6(i,"default",l),p=c$(i).orThunk(()=>N6(i,cC(i),""));Be(Xi([d,p]),w=>{n.add(w.url).catch(()=>{vp(i,w.url,w.name.getOrUndefined())})})},tQ=(n,i)=>{const l=(d,p)=>{Qw.load(d,p).catch(()=>{Oy(n,p,d)})};ln(a0(n),(d,p)=>{l(p,d),n.options.set("plugins",qv(n).concat(p))}),Be(qv(n),d=>{d=hn.trim(d),d&&!Qw.urls[d]&&!l$(d)&&l(d,`plugins/${d}/plugin${i}.js`)})},nQ=n=>{const i=im(n);return!F(i)||_e(Dy.get(i))},xre=n=>{const i=Jl(n);return _e(SS.get(i))},Tre=(n,i)=>{const l=nm.ScriptLoader,d=()=>{!n.removed&&nQ(n)&&xre(n)&&a$(n)};Ere(n,i),Are(n,i),QJ(l,n),eQ(l,n,i),tQ(n,i),l.loadQueue().then(d,d)},Dre=(n,i)=>xv.forElement(n,{contentCssCors:yC(i),referrerPolicy:s0(i)}),oQ=n=>{const i=n.id;Kf.setCode(fC(n));const l=()=>{u_.unbind(window,"ready",l),n.render()};if(!tm.Event.domLoaded){u_.bind(window,"ready",l);return}if(!n.getElement())return;const d=Ye.fromDom(n.getElement()),p=zf(d);n.on("remove",()=>{Ut(d.dom.attributes,E=>zi(d,E.name)),Vu(d,p)}),n.ui.styleSheetLoader=Dre(d,n),bC(n)?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");const w=n.getElement().form||u_.getParent(i,"form");w&&(n.formElement=w,ap(n)&&!V1(n.getElement())&&(u_.insertAfter(u_.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=E=>{n.dispatch(E.type,E)},u_.bind(w,"submit reset",n.formEventDelegate),n.on("reset",()=>{n.resetContent()}),Xk(n)&&!w.submit.nodeType&&!w.submit.length&&!w._mceOldSubmit&&(w._mceOldSubmit=w.submit,w.submit=()=>(n.editorManager.triggerSave(),n.setDirty(!1),w._mceOldSubmit(w)))),n.windowManager=NA(n),n.notificationManager=Jw(n),DC(n)&&n.on("GetContent",E=>{E.save&&(E.content=u_.encode(E.content))}),Jk(n)&&n.on("submit",()=>{n.initialized&&n.save()}),Qk(n)&&(n._beforeUnload=()=>{n.initialized&&!n.destroyed&&!n.isHidden()&&n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),Tre(n,n.suffix)},Ore=(n,i)=>{n._editableRoot!==i&&(n._editableRoot=i,n.readonly||(n.getBody().contentEditable=String(n.hasEditableRoot()),n.nodeChanged()),GO(n,i))},sQ=n=>n._editableRoot,f_=(n,i)=>({sections:et(n),options:et(i)}),lD=ys().deviceType,vx=lD.isPhone(),u$=lD.isTablet(),WS=n=>{if(Te(n))return[];{const i=se(n)?n:n.split(/[ ,]/),l=Tt(i,pc);return wt(l,pr)}},f$=(n,i)=>{const l=Dt(i,(d,p)=>St(n,p));return f_(l.t,l.f)},rQ=(n,i,l={})=>{const d=n.sections(),p=po(d,i).getOr({});return hn.extend({},l,p)},P6=(n,i)=>un(n.sections(),i),iQ=(n,i)=>P6(n,i)?n.sections()[i]:{},aQ=(n,i)=>({...{table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:po(n,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},...i?{menubar:!1}:{}}),Fy=(n,i)=>{var l;const d=(l=i.external_plugins)!==null&&l!==void 0?l:{};return n&&n.external_plugins?hn.extend({},n.external_plugins,d):d},lQ=(n,i)=>[...WS(n),...WS(i)],d$=(n,i,l,d)=>n&&P6(i,"mobile")?d:l,cQ=(n,i,l,d)=>{const p=WS(l.forced_plugins),w=WS(d.plugins),E=iQ(i,"mobile"),R=E.plugins?WS(E.plugins):w,B=d$(n,i,w,R),K=lQ(p,B);return hn.extend(d,{forced_plugins:p,plugins:K})},cD=(n,i)=>n&&P6(i,"mobile"),uQ=(n,i,l,d,p)=>{var w;const E=n?{mobile:aQ((w=p.mobile)!==null&&w!==void 0?w:{},i)}:{},R=f$(["mobile"],T4(E,p)),B=hn.extend(l,d,R.options(),cD(n,R)?rQ(R,"mobile"):{},{external_plugins:Fy(d,R.options())});return cQ(n,R,d,B)},fQ=(n,i)=>uQ(vx||u$,vx,i,n,i),dQ=(n,i)=>TZ(n,i),h$=n=>{const i=(d,p)=>{n.formatter.toggle(d,p),n.nodeChanged()},l=d=>()=>{Be("left,center,right,justify".split(","),p=>{d!==p&&n.formatter.remove("align"+p)}),d!=="none"&&i("align"+d)};n.editorCommands.addCommands({JustifyLeft:l("left"),JustifyCenter:l("center"),JustifyRight:l("right"),JustifyFull:l("justify"),JustifyNone:l("none")})},hQ=n=>{const i=l=>()=>{const d=n.selection,p=d.isCollapsed()?[n.dom.getParent(d.getNode(),n.dom.isBlock)]:d.getSelectedBlocks();return Xt(p,w=>_e(n.formatter.matchNode(w,l)))};n.editorCommands.addCommands({JustifyLeft:i("alignleft"),JustifyCenter:i("aligncenter"),JustifyRight:i("alignright"),JustifyFull:i("alignjustify")},"state")},mQ=n=>{h$(n),hQ(n)},gQ=n=>{n.editorCommands.addCommands({"Cut,Copy,Paste":i=>{const l=n.getDoc();let d;try{l.execCommand(i)}catch{d=!0}if(i==="paste"&&!l.queryCommandEnabled(i)&&(d=!0),d||!l.queryCommandSupported(i)){let p=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(Xn.os.isMacOS()||Xn.os.isiOS())&&(p=p.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:p,type:"error"})}}})},I6=(n,i,l)=>{const d=Ye.fromDom(n.getRoot());return nA(d,Vt.fromRangeStart(i))?l=l.replace(/^ /," "):l=l.replace(/^ /," "),oA(d,Vt.fromRangeEnd(i))?l=l.replace(/( | )(<br( \/)>)?$/," "):l=l.replace(/ (<br( \/)?>)?$/," "),l},pQ=n=>{if(typeof n!="string"){const i=hn.extend({paste:n.paste,data:{paste:n.paste}},n);return{content:n.content,details:i}}return{content:n,details:{}}},bQ=(n,i)=>{const l=n.selection,d=n.dom;return/^ | $/.test(i)?I6(d,l.getRng(),i):i},Ml=(n,i)=>{if(n.selection.isEditable()){const{content:l,details:d}=pQ(i);WR(n,{...d,content:bQ(n,l),format:"html",set:!1,selection:!0}).each(p=>{const w=ei(n,p.content,d);jR(n,w,p),n.addVisual()})}},vQ=n=>{n.editorCommands.addCommands({mceCleanup:()=>{const i=n.selection.getBookmark();n.setContent(n.getContent()),n.selection.moveToBookmark(i)},insertImage:(i,l,d)=>{Ml(n,n.dom.createHTML("img",{src:d}))},insertHorizontalRule:()=>{n.execCommand("mceInsertContent",!1,"<hr>")},insertText:(i,l,d)=>{Ml(n,n.dom.encode(d))},insertHTML:(i,l,d)=>{Ml(n,d)},mceInsertContent:(i,l,d)=>{Ml(n,d)},mceSetContent:(i,l,d)=>{n.setContent(d)},mceReplaceContent:(i,l,d)=>{n.execCommand("mceInsertContent",!1,d.replace(/\{\$selection\}/g,n.selection.getContent({format:"text"})))},mceNewDocument:()=>{n.setContent(tE(n))}})},yQ={"font-size":"size","font-family":"face"},B6=yc("font"),m$=(n,i,l)=>{const d=w=>Ta(w,n).orThunk(()=>B6(w)?po(yQ,n).bind(E=>za(w,E)):de.none()),p=w=>bt(Ye.fromDom(i),w);return a1(Ye.fromDom(l),w=>d(w),p)},L6=n=>n.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),wQ=(n,i)=>de.from(Lr.DOM.getStyle(i,n,!0)),g$=n=>(i,l)=>de.from(l).map(Ye.fromDom).filter(_l).bind(d=>m$(n,i,d.dom).or(wQ(n,d.dom))).getOr(""),_Q=g$("font-size"),CQ=V(L6,g$("font-family")),SQ=n=>rl(n.getBody()).bind(i=>{const l=i.container();return de.from(Sn(l)?l.parentNode:l)}),kQ=n=>de.from(n.selection.getRng()).bind(i=>{const l=n.getBody();return i.startContainer===l&&i.startOffset===0?de.none():de.from(n.selection.getStart(!0))}),EQ=(n,i)=>kQ(n).orThunk(He(SQ,n)).map(Ye.fromDom).filter(_l).bind(i),F6=(n,i)=>EQ(n,ut(de.some,i)),d_=(n,i)=>{if(/^[0-9.]+$/.test(i)){const l=parseInt(i,10);if(l>=1&&l<=7){const d=Qv(n),p=sw(n);return p.length>0?p[l-1]||i:d[l-1]||i}else return i}else return i},y1=n=>{const i=n.split(/\s*,\s*/);return Tt(i,l=>l.indexOf(" ")!==-1&&!(xr(l,'"')||xr(l,"'"))?`'${l}'`:l).join(",")},AQ=(n,i)=>{const l=d_(n,i);n.formatter.toggle("fontname",{value:y1(l)}),n.nodeChanged()},xQ=n=>F6(n,i=>CQ(n.getBody(),i.dom)).getOr(""),TQ=(n,i)=>{n.formatter.toggle("fontsize",{value:d_(n,i)}),n.nodeChanged()},DQ=n=>F6(n,i=>_Q(n.getBody(),i.dom)).getOr(""),OQ=n=>F6(n,i=>{const l=Ye.fromDom(n.getBody()),d=a1(i,w=>Ta(w,"line-height"),He(bt,l)),p=()=>{const w=parseFloat(Ri(i,"line-height")),E=parseFloat(Ri(i,"font-size"));return String(w/E)};return d.getOrThunk(p)}).getOr(""),MQ=(n,i)=>{n.formatter.toggle("lineheight",{value:String(i)}),n.nodeChanged()},RQ=n=>{const i=(l,d)=>{n.formatter.toggle(l,d),n.nodeChanged()};n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":l=>{i(l)},"ForeColor,HiliteColor":(l,d,p)=>{i(l,{value:p})},BackColor:(l,d,p)=>{i("hilitecolor",{value:p})},FontName:(l,d,p)=>{AQ(n,p)},FontSize:(l,d,p)=>{TQ(n,p)},LineHeight:(l,d,p)=>{MQ(n,p)},Lang:(l,d,p)=>{var w;i(l,{value:p.code,customValue:(w=p.customCode)!==null&&w!==void 0?w:null})},RemoveFormat:l=>{n.formatter.remove(l)},mceBlockQuote:()=>{i("blockquote")},FormatBlock:(l,d,p)=>{i(F(p)?p:"p")},mceToggleFormat:(l,d,p)=>{i(p)}})},NQ=n=>{const i=l=>n.formatter.match(l);n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":l=>i(l),mceBlockQuote:()=>i("blockquote")},"state"),n.editorCommands.addQueryValueHandler("FontName",()=>xQ(n)),n.editorCommands.addQueryValueHandler("FontSize",()=>DQ(n)),n.editorCommands.addQueryValueHandler("LineHeight",()=>OQ(n))},PQ=n=>{RQ(n),NQ(n)},Mre=n=>{n.editorCommands.addCommands({mceAddUndoLevel:()=>{n.undoManager.add()},mceEndUndoLevel:()=>{n.undoManager.add()},Undo:()=>{n.undoManager.undo()},Redo:()=>{n.undoManager.redo()}})},IQ=n=>{n.editorCommands.addCommands({Indent:()=>{JF(n)},Outdent:()=>{CG(n)}}),n.editorCommands.addCommands({Outdent:()=>h4(n)},"state")},BQ=n=>{const i=(l,d,p)=>{const w=F(p)?{href:p}:p,E=n.dom.getParent(n.selection.getNode(),"a");oe(w)&&F(w.href)&&(w.href=w.href.replace(/ /g,"%20"),(!E||!w.href)&&n.formatter.remove("link"),w.href&&n.formatter.apply("link",w,E))};n.editorCommands.addCommands({unlink:()=>{if(n.selection.isEditable()){if(n.selection.isCollapsed()){const l=n.dom.getParent(n.selection.getStart(),"a");l&&n.dom.remove(l,!0);return}n.formatter.remove("link")}},mceInsertLink:i,createLink:i})},LQ=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{n.getDoc().execCommand(i);const l=n.dom.getParent(n.selection.getNode(),"ol,ul");if(l){const d=l.parentNode;if(d&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(d.nodeName)){const p=n.selection.getBookmark();n.dom.split(d,l),n.selection.moveToBookmark(p)}}}})},FQ=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{const l=n.dom.getParent(n.selection.getNode(),"ul,ol");return l&&(i==="insertunorderedlist"&&l.tagName==="UL"||i==="insertorderedlist"&&l.tagName==="OL")}},"state")},HQ=n=>{LQ(n),FQ(n)},$Q=(n,i,l,d)=>{const p=n.dom,w=R=>p.isBlock(R)&&R.parentElement===l,E=w(i)?i:p.getParent(d,w,l);return de.from(E).map(Ye.fromDom)},zQ=(n,i)=>{const l=n.dom,d=n.selection.getRng(),p=i?n.selection.getStart():n.selection.getEnd(),w=i?d.startContainer:d.endContainer,E=F4(l,w);if(!E||!E.isContentEditable)return;const R=i?wa:Yc,B=Hc(n);$Q(n,p,E,w).each(K=>{const ie=p9(n,w,K.dom,E,!1,B);R(K,Ye.fromDom(ie)),n.selection.setCursorLocation(ie,0),n.dispatch("NewBlock",{newBlock:ie}),ox(n,"insertParagraph")})},VQ=n=>zQ(n,!0),UQ=n=>zQ(n,!1),WQ=n=>{n.editorCommands.addCommands({InsertNewBlockBefore:()=>{VQ(n)},InsertNewBlockAfter:()=>{UQ(n)}})},jQ=n=>{n.editorCommands.addCommands({insertParagraph:()=>{W4(k9,n)},mceInsertNewLine:(i,l,d)=>{R9(n,d)},InsertLineBreak:(i,l,d)=>{W4(FN,n)}})},ZQ=n=>{n.editorCommands.addCommands({mceSelectNodeDepth:(i,l,d)=>{let p=0;n.dom.getParent(n.selection.getNode(),w=>Qn(w)&&p++===d?(n.selection.select(w),!1):!0,n.getBody())},mceSelectNode:(i,l,d)=>{n.selection.select(d)},selectAll:()=>{const i=n.dom.getParent(n.selection.getStart(),ha);if(i){const l=n.dom.createRng();l.selectNodeContents(i),n.selection.setRng(l)}}})},qQ=n=>{n.editorCommands.addCommands({mceRemoveNode:(i,l,d)=>{const p=d!=null?d:n.selection.getNode();if(p!==n.getBody()){const w=n.selection.getBookmark();n.dom.remove(p,!0),n.selection.moveToBookmark(w)}},mcePrint:()=>{n.getWin().print()},mceFocus:(i,l,d)=>{OU(n,d===!0)},mceToggleVisualAid:()=>{n.hasVisual=!n.hasVisual,n.addVisual()}})},GQ=n=>{mQ(n),gQ(n),Mre(n),ZQ(n),vQ(n),BQ(n),IQ(n),WQ(n),jQ(n),HQ(n),PQ(n),qQ(n)},KQ=["toggleview"],p$=n=>St(KQ,n.toLowerCase());class b${constructor(i){this.commands={state:{},exec:{},value:{}},this.editor=i}execCommand(i,l=!1,d,p){const w=this.editor,E=i.toLowerCase(),R=p==null?void 0:p.skip_focus;if(w.removed||(E!=="mcefocus"&&(!/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(E)&&!R?w.focus():DI(w)),w.dispatch("BeforeExecCommand",{command:i,ui:l,value:d}).isDefaultPrevented()))return!1;const K=this.commands.exec[E];return ge(K)?(K(E,l,d),w.dispatch("ExecCommand",{command:i,ui:l,value:d}),!0):!1}queryCommandState(i){if(!p$(i)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const l=i.toLowerCase(),d=this.commands.state[l];return ge(d)?d(l):!1}queryCommandValue(i){if(!p$(i)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const l=i.toLowerCase(),d=this.commands.value[l];return ge(d)?d(l):""}addCommands(i,l="exec"){const d=this.commands;ln(i,(p,w)=>{Be(w.toLowerCase().split(","),E=>{d[l][E]=p})})}addCommand(i,l,d){const p=i.toLowerCase();this.commands.exec[p]=(w,E,R)=>l.call(d!=null?d:this.editor,E,R)}queryCommandSupported(i){const l=i.toLowerCase();return!!this.commands.exec[l]}addQueryStateHandler(i,l,d){this.commands.state[i.toLowerCase()]=()=>l.call(d!=null?d:this.editor)}addQueryValueHandler(i,l,d){this.commands.value[i.toLowerCase()]=()=>l.call(d!=null?d:this.editor)}}const h_="data-mce-contenteditable",YQ=(n,i,l)=>{wf(n,i)&&!l?Nc(n,i):l&&Uu(n,i)},H6=(n,i,l)=>{try{n.getDoc().execCommand(i,!1,String(l))}catch{}},uD=(n,i)=>{n.dom.contentEditable=i?"true":"false"},XQ=n=>{Be(hl(n,'*[contenteditable="true"]'),i=>{Dr(i,h_,"true"),uD(i,!1)})},JQ=n=>{Be(hl(n,`*[${h_}="true"]`),i=>{zi(i,h_),uD(i,!0)})},v$=n=>{de.from(n.selection.getNode()).each(i=>{i.removeAttribute("data-mce-selected")})},QQ=n=>{n.selection.setRng(n.selection.getRng())},eee=(n,i)=>{const l=Ye.fromDom(n.getBody());YQ(l,"mce-content-readonly",i),i?(n.selection.controlSelection.hideResizeRect(),n._selectionOverrides.hideFakeCaret(),v$(n),n.readonly=!0,uD(l,!1),XQ(l)):(n.readonly=!1,n.hasEditableRoot()&&uD(l,!0),JQ(l),H6(n,"StyleWithCSS",!1),H6(n,"enableInlineTableEditing",!1),H6(n,"enableObjectResizing",!1),V3(n)&&n.focus(),QQ(n),n.nodeChanged())},m_=n=>n.readonly,y$=n=>{n.parser.addAttributeFilter("contenteditable",i=>{m_(n)&&Be(i,l=>{l.attr(h_,l.attr("contenteditable")),l.attr("contenteditable","false")})}),n.serializer.addAttributeFilter(h_,i=>{m_(n)&&Be(i,l=>{l.attr("contenteditable",l.attr(h_))})}),n.serializer.addTempAttr(h_)},tee=n=>{n.serializer?y$(n):n.on("PreInit",()=>{y$(n)})},nee=n=>n.type==="click",oee=["copy"],see=n=>St(oee,n.type),w$=(n,i)=>rt(i,"a",d=>bt(d,Ye.fromDom(n.getBody()))).bind(d=>za(d,"href")),ree=(n,i)=>{if(nee(i)&&!no.metaKeyPressed(i)){const l=Ye.fromDom(i.target);w$(n,l).each(d=>{if(i.preventDefault(),/^#/.test(d)){const p=n.dom.select(`${d},[name="${fa(d,"#")}"]`);p.length&&n.selection.scrollIntoView(p[0],!0)}else window.open(d,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})}else see(i)&&n.dispatch(i.type,i)},iee=n=>{n.on("ShowCaret",i=>{m_(n)&&i.preventDefault()}),n.on("ObjectSelected",i=>{m_(n)&&i.preventDefault()})},aee=hn.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class $6{static isNative(i){return!!aee[i.toLowerCase()]}constructor(i){this.bindings={},this.settings=i||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||qe}fire(i,l){return this.dispatch(i,l)}dispatch(i,l){const d=i.toLowerCase(),p=ep(d,l!=null?l:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(p);const w=this.bindings[d];if(w)for(let E=0,R=w.length;E<R;E++){const B=w[E];if(!B.removed){if(B.once&&this.off(d,B.func),p.isImmediatePropagationStopped())return p;if(B.func.call(this.scope,p)===!1)return p.preventDefault(),p}}return p}on(i,l,d,p){if(l===!1&&(l=qe),l){const w={func:l,removed:!1};p&&hn.extend(w,p);const E=i.toLowerCase().split(" ");let R=E.length;for(;R--;){const B=E[R];let K=this.bindings[B];K||(K=[],this.toggleEvent(B,!0)),d?K=[w,...K]:K=[...K,w],this.bindings[B]=K}}return this}off(i,l){if(i){const d=i.toLowerCase().split(" ");let p=d.length;for(;p--;){const w=d[p];let E=this.bindings[w];if(!w)return ln(this.bindings,(R,B)=>{this.toggleEvent(B,!1),delete this.bindings[B]}),this;if(E){if(!l)E.length=0;else{const R=gn(E,B=>B.func===l);E=R.fail,this.bindings[w]=E,Be(R.pass,B=>{B.removed=!0})}E.length||(this.toggleEvent(i,!1),delete this.bindings[w])}}}else ln(this.bindings,(d,p)=>{this.toggleEvent(p,!1)}),this.bindings={};return this}once(i,l,d){return this.on(i,l,d,{once:!0})}has(i){i=i.toLowerCase();const l=this.bindings[i];return!(!l||l.length===0)}}const yx=n=>(n._eventDispatcher||(n._eventDispatcher=new $6({scope:n,toggleEvent:(i,l)=>{$6.isNative(i)&&n.toggleNativeEvent&&n.toggleNativeEvent(i,l)}})),n._eventDispatcher),z6={fire(n,i,l){return this.dispatch(n,i,l)},dispatch(n,i,l){const d=this;if(d.removed&&n!=="remove"&&n!=="detach")return ep(n.toLowerCase(),i!=null?i:{},d);const p=yx(d).dispatch(n,i);if(l!==!1&&d.parent){let w=d.parent();for(;w&&!p.isPropagationStopped();)w.dispatch(n,p,!1),w=w.parent?w.parent():void 0}return p},on(n,i,l){return yx(this).on(n,i,l)},off(n,i){return yx(this).off(n,i)},once(n,i){return yx(this).once(n,i)},hasEventListeners(n){return yx(this).has(n)}},fD=Lr.DOM;let g_;const wx=(n,i)=>{if(i==="selectionchange")return n.getDoc();if(!n.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(i))return n.getDoc().documentElement;const l=sl(n);return l?(n.eventRoot||(n.eventRoot=fD.select(l)[0]),n.eventRoot):n.getBody()},Rre=n=>!n.hidden&&!m_(n),V6=(n,i,l)=>{Rre(n)?n.dispatch(i,l):m_(n)&&ree(n,l)},_$=(n,i)=>{if(n.delegates||(n.delegates={}),n.delegates[i]||n.removed)return;const l=wx(n,i);if(sl(n)){if(g_||(g_={},n.editorManager.on("removeEditor",()=>{n.editorManager.activeEditor||g_&&(ln(g_,(p,w)=>{n.dom.unbind(wx(n,w))}),g_=null)})),g_[i])return;const d=p=>{const w=p.target,E=n.editorManager.get();let R=E.length;for(;R--;){const B=E[R].getBody();(B===w||fD.isChildOf(w,B))&&V6(E[R],i,p)}};g_[i]=d,fD.bind(l,i,d)}else{const d=p=>{V6(n,i,p)};fD.bind(l,i,d),n.delegates[i]=d}},U6={...z6,bindPendingEventDelegates(){const n=this;hn.each(n._pendingNativeEvents,i=>{_$(n,i)})},toggleNativeEvent(n,i){const l=this;n==="focus"||n==="blur"||l.removed||(i?l.initialized?_$(l,n):l._pendingNativeEvents?l._pendingNativeEvents.push(n):l._pendingNativeEvents=[n]:l.initialized&&l.delegates&&(l.dom.unbind(wx(l,n),n,l.delegates[n]),delete l.delegates[n]))},unbindAllNativeEvents(){const n=this,i=n.getBody(),l=n.dom;n.delegates&&(ln(n.delegates,(d,p)=>{n.dom.unbind(wx(n,p),p,d)}),delete n.delegates),!n.inline&&i&&l&&(i.onload=null,l.unbind(n.getWin()),l.unbind(n.getDoc())),l&&(l.unbind(i),l.unbind(n.getContainer()))}},lee=n=>F(n)?{value:n.split(/[ ,]/),valid:!0}:Je(n,F)?{value:n,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},cee=n=>{const i=(()=>{switch(n){case"array":return se;case"boolean":return we;case"function":return ge;case"number":return nt;case"object":return oe;case"string":return F;case"string[]":return lee;case"object[]":return l=>Je(l,oe);case"regexp":return l=>ee(l,RegExp);default:return gt}})();return l=>W6(l,i,`The value must be a ${n}.`)},uee=n=>F(n.processor),C$=(n,i)=>{const l=Qa(i.message)?"":`. ${i.message}`;return n+l},S$=n=>n.valid,W6=(n,i,l="")=>{const d=i(n);return we(d)?d?{value:n,valid:!0}:{valid:!1,message:l}:d},j6=(n,i,l)=>{if(!ye(i)){const d=W6(i,l);if(S$(d))return d.value;console.error(C$(`Invalid default value passed for the "${n}" option`,d))}},Z6=(n,i)=>{const l={},d={},p=(ue,be,Le)=>{const je=W6(be,Le);return S$(je)?(d[ue]=je.value,!0):(console.warn(C$(`Invalid value passed for the ${ue} option`,je)),!1)},w=(ue,be)=>{const Le=uee(be)?cee(be.processor):be.processor,je=j6(ue,be.default,Le);l[ue]={...be,default:je,processor:Le},po(d,ue).orThunk(()=>po(i,ue)).each(Ve=>p(ue,Ve,Le))},E=ue=>un(l,ue);return{register:w,isRegistered:E,get:ue=>po(d,ue).orThunk(()=>po(l,ue).map(be=>be.default)).getOrUndefined(),set:(ue,be)=>{if(E(ue)){const Le=l[ue];return Le.immutable?(console.error(`"${ue}" is an immutable option and cannot be updated`),!1):p(ue,be,Le.processor)}else return console.warn(`"${ue}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:ue=>{const be=E(ue);return be&&delete d[ue],be},isSet:ue=>un(d,ue)}},fee=["design","readonly"],q6=(n,i,l,d)=>{const p=l[i.get()],w=l[d];try{w.activate()}catch(E){console.error(`problem while activating editor mode ${d}:`,E);return}p.deactivate(),p.editorReadOnly!==w.editorReadOnly&&eee(n,w.editorReadOnly),i.set(d),zO(n,d)},dee=(n,i,l,d)=>{if(d!==l.get()){if(!un(i,d))throw new Error(`Editor mode '${d}' is invalid`);n.initialized?q6(n,l,i,d):n.on("init",()=>q6(n,l,i,d))}},hee=(n,i,l)=>{if(St(fee,i))throw new Error(`Cannot override default mode ${i}`);return{...n,[i]:{...l,deactivate:()=>{try{l.deactivate()}catch(d){console.error(`problem while deactivating editor mode ${i}:`,d)}}}}},mee=n=>{const i=Ga("design"),l=Ga({design:{activate:ft,deactivate:ft,editorReadOnly:!1},readonly:{activate:ft,deactivate:ft,editorReadOnly:!0}});return tee(n),iee(n),{isReadOnly:()=>m_(n),set:d=>dee(n,l.get(),i,d),get:()=>i.get(),register:(d,p)=>{l.set(hee(l.get(),d,p))}}},G6=hn.each,K6=hn.explode,gee={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},k$=hn.makeMap("alt,ctrl,shift,meta,access"),pee=n=>n in k$,bee=n=>{const i={},l=Xn.os.isMacOS()||Xn.os.isiOS();G6(K6(n.toLowerCase(),"+"),w=>{pee(w)?i[w]=!0:/^[0-9]{2,}$/.test(w)?i.keyCode=parseInt(w,10):(i.charCode=w.charCodeAt(0),i.keyCode=gee[w]||w.toUpperCase().charCodeAt(0))});const d=[i.keyCode];let p;for(p in k$)i[p]?d.push(p):i[p]=!1;return i.id=d.join(","),i.access&&(i.alt=!0,l?i.ctrl=!0:i.shift=!0),i.meta&&(l?i.meta=!0:(i.ctrl=!0,i.meta=!1)),i};class E${constructor(i){this.shortcuts={},this.pendingPatterns=[],this.editor=i;const l=this;i.on("keyup keypress keydown",d=>{(l.hasModifier(d)||l.isFunctionKey(d))&&!d.isDefaultPrevented()&&(G6(l.shortcuts,p=>{l.matchShortcut(d,p)&&(l.pendingPatterns=p.subpatterns.slice(0),d.type==="keydown"&&l.executeShortcutAction(p))}),l.matchShortcut(d,l.pendingPatterns[0])&&(l.pendingPatterns.length===1&&d.type==="keydown"&&l.executeShortcutAction(l.pendingPatterns[0]),l.pendingPatterns.shift()))})}add(i,l,d,p){const w=this,E=w.normalizeCommandFunc(d);return G6(K6(hn.trim(i)),R=>{const B=w.createShortcut(R,l,E,p);w.shortcuts[B.id]=B}),!0}remove(i){const l=this.createShortcut(i);return this.shortcuts[l.id]?(delete this.shortcuts[l.id],!0):!1}normalizeCommandFunc(i){const l=this,d=i;return typeof d=="string"?()=>{l.editor.execCommand(d,!1,null)}:hn.isArray(d)?()=>{l.editor.execCommand(d[0],d[1],d[2])}:d}createShortcut(i,l,d,p){const w=hn.map(K6(i,">"),bee);return w[w.length-1]=hn.extend(w[w.length-1],{func:d,scope:p||this.editor}),hn.extend(w[0],{desc:this.editor.translate(l),subpatterns:w.slice(1)})}hasModifier(i){return i.altKey||i.ctrlKey||i.metaKey}isFunctionKey(i){return i.type==="keydown"&&i.keyCode>=112&&i.keyCode<=123}matchShortcut(i,l){return!l||l.ctrl!==i.ctrlKey||l.meta!==i.metaKey||l.alt!==i.altKey||l.shift!==i.shiftKey?!1:i.keyCode===l.keyCode||i.charCode&&i.charCode===l.charCode?(i.preventDefault(),!0):!1}executeShortcutAction(i){return i.func?i.func.call(i.scope):null}}const Y6=()=>{const n={},i={},l={},d={},p={},w={},E={},R={},B=(ie,ue)=>(be,Le)=>{ie[be.toLowerCase()]={...Le,type:ue}},K=(ie,ue)=>d[ie.toLowerCase()]=ue;return{addButton:B(n,"button"),addGroupToolbarButton:B(n,"grouptoolbarbutton"),addToggleButton:B(n,"togglebutton"),addMenuButton:B(n,"menubutton"),addSplitButton:B(n,"splitbutton"),addMenuItem:B(i,"menuitem"),addNestedMenuItem:B(i,"nestedmenuitem"),addToggleMenuItem:B(i,"togglemenuitem"),addAutocompleter:B(l,"autocompleter"),addContextMenu:B(p,"contextmenu"),addContextToolbar:B(w,"contexttoolbar"),addContextForm:B(w,"contextform"),addSidebar:B(E,"sidebar"),addView:B(R,"views"),addIcon:K,getAll:()=>({buttons:n,menuItems:i,icons:d,popups:l,contextMenus:p,contextToolbars:w,sidebars:E,views:R})}},vee=()=>{const n=Y6();return{addAutocompleter:n.addAutocompleter,addButton:n.addButton,addContextForm:n.addContextForm,addContextMenu:n.addContextMenu,addContextToolbar:n.addContextToolbar,addIcon:n.addIcon,addMenuButton:n.addMenuButton,addMenuItem:n.addMenuItem,addNestedMenuItem:n.addNestedMenuItem,addSidebar:n.addSidebar,addSplitButton:n.addSplitButton,addToggleButton:n.addToggleButton,addGroupToolbarButton:n.addGroupToolbarButton,addToggleMenuItem:n.addToggleMenuItem,addView:n.addView,getAll:n.getAll}},p_=Lr.DOM,A$=hn.extend,yee=hn.each;class dD{constructor(i,l,d){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=d,this.documentBaseUrl=d.documentBaseURL,A$(this,U6);const p=this;this.id=i,this.hidden=!1;const w=fQ(d.defaultOptions,l);this.options=Z6(p,w),n0(p);const E=this.options.get;E("deprecation_warnings")&&qZ(l,w);const R=E("suffix");R&&(d.suffix=R),this.suffix=d.suffix;const B=E("base_url");B&&d._setBaseUrl(B),this.baseUri=d.baseURI;const K=s0(p);K&&(nm.ScriptLoader._setReferrerPolicy(K),Lr.DOM.styleSheetLoader._setReferrerPolicy(K));const ie=yC(p);_e(ie)&&Lr.DOM.styleSheetLoader._setContentCssCors(ie),Na.languageLoad=E("language_load"),Na.baseURL=d.baseURL,this.setDirty(!1),this.documentBaseURI=new u1(Qp(p),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=bC(p),this.hasVisual=Gv(p),this.shortcuts=new E$(this),this.editorCommands=new b$(this),GQ(this);const ue=E("cache_suffix");ue&&(Xn.cacheSuffix=ue.replace(/^[\?\&]+/,"")),this.ui={registry:vee(),styleSheetLoader:void 0,show:ft,hide:ft,setEnabled:ft,isEnabled:gt},this.mode=mee(p),d.dispatch("SetupEditor",{editor:this});const be=vh(p);ge(be)&&be.call(p,p)}render(){oQ(this)}focus(i){this.execCommand("mceFocus",!1,i)}hasFocus(){return Nw(this)}translate(i){return Kf.translate(i)}getParam(i,l,d){const p=this.options;return p.isRegistered(i)||(_e(d)?p.register(i,{processor:d,default:l}):p.register(i,{processor:gt,default:l})),!p.isSet(i)&&!ye(l)?l:p.get(i)}hasPlugin(i,l){return St(qv(this),i)?l?Qw.get(i)!==void 0:!0:!1}nodeChanged(i){this._nodeChangeDispatcher.nodeChanged(i)}addCommand(i,l,d){this.editorCommands.addCommand(i,l,d)}addQueryStateHandler(i,l,d){this.editorCommands.addQueryStateHandler(i,l,d)}addQueryValueHandler(i,l,d){this.editorCommands.addQueryValueHandler(i,l,d)}addShortcut(i,l,d,p){this.shortcuts.add(i,l,d,p)}execCommand(i,l,d,p){return this.editorCommands.execCommand(i,l,d,p)}queryCommandState(i){return this.editorCommands.queryCommandState(i)}queryCommandValue(i){return this.editorCommands.queryCommandValue(i)}queryCommandSupported(i){return this.editorCommands.queryCommandSupported(i)}show(){const i=this;i.hidden&&(i.hidden=!1,i.inline?i.getBody().contentEditable="true":(p_.show(i.getContainer()),p_.hide(i.id)),i.load(),i.dispatch("show"))}hide(){const i=this;i.hidden||(i.save(),i.inline?(i.getBody().contentEditable="false",i===i.editorManager.focusedEditor&&(i.editorManager.focusedEditor=null)):(p_.hide(i.getContainer()),p_.setStyle(i.id,"display",i.orgDisplay)),i.hidden=!0,i.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(i,l){this.dispatch("ProgressState",{state:i,time:l})}load(i={}){const l=this,d=l.getElement();if(l.removed)return"";if(d){const p={...i,load:!0},w=V1(d)?d.value:d.innerHTML,E=l.setContent(w,p);return p.no_events||l.dispatch("LoadContent",{...p,element:d}),E}else return""}save(i={}){const l=this;let d=l.getElement();if(!d||!l.initialized||l.removed)return"";const p={...i,save:!0,element:d};let w=l.getContent(p);const E={...p,content:w};if(E.no_events||l.dispatch("SaveContent",E),E.format==="raw"&&l.dispatch("RawSaveContent",E),w=E.content,V1(d))d.value=w;else{(i.is_removing||!l.inline)&&(d.innerHTML=w);const R=p_.getParent(l.id,"form");R&&yee(R.elements,B=>B.name===l.id?(B.value=w,!1):!0)}return E.element=p.element=d=null,E.set_dirty!==!1&&l.setDirty(!1),w}setContent(i,l){return IT(this,i,l)}getContent(i){return LZ(this,i)}insertContent(i,l){l&&(i=A$({content:i},l)),this.execCommand("mceInsertContent",!1,i)}resetContent(i){i===void 0?IT(this,this.startContent,{format:"raw"}):IT(this,i),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(i){const l=!this.isNotDirty;this.isNotDirty=!i,i&&i!==l&&this.dispatch("dirty")}getContainer(){const i=this;return i.container||(i.container=i.editorContainer||p_.get(i.id+"_parent")),i.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=p_.get(this.id)),this.targetElm}getWin(){const i=this;if(!i.contentWindow){const l=i.iframeElement;l&&(i.contentWindow=l.contentWindow)}return i.contentWindow}getDoc(){const i=this;if(!i.contentDocument){const l=i.getWin();l&&(i.contentDocument=l.document)}return i.contentDocument}getBody(){var i,l;const d=this.getDoc();return(l=(i=this.bodyElement)!==null&&i!==void 0?i:d==null?void 0:d.body)!==null&&l!==void 0?l:null}convertURL(i,l,d){const p=this,w=p.options.get,E=_C(p);return ge(E)?E.call(p,i,d,!0,l):!w("convert_urls")||d==="link"||oe(d)&&d.nodeName==="LINK"||i.indexOf("file:")===0||i.length===0?i:w("relative_urls")?p.documentBaseURI.toRelative(i):(i=p.documentBaseURI.toAbsolute(i,w("remove_script_host")),i)}addVisual(i){dQ(this,i)}setEditableRoot(i){Ore(this,i)}hasEditableRoot(){return sQ(this)}remove(){u5(this)}destroy(i){YZ(this,i)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const b_=Lr.DOM,A0=hn.each;let wee=!1,hD,Oh=[];const mD=n=>{const i=n.type;A0(lv.get(),l=>{switch(i){case"scroll":l.dispatch("ScrollWindow",n);break;case"resize":l.dispatch("ResizeWindow",n);break}})},x$=n=>{if(n!==wee){const i=Lr.DOM;n?(i.bind(window,"resize",mD),i.bind(window,"scroll",mD)):(i.unbind(window,"resize",mD),i.unbind(window,"scroll",mD)),wee=n}},_ee=n=>{const i=Oh;return Oh=wt(Oh,l=>n!==l),lv.activeEditor===n&&(lv.activeEditor=Oh.length>0?Oh[0]:null),lv.focusedEditor===n&&(lv.focusedEditor=null),i.length!==Oh.length},Cee=n=>{n&&n.initialized&&!(n.getContainer()||n.getBody()).parentNode&&(_ee(n),n.unbindAllNativeEvents(),n.destroy(!0),n.removed=!0)},_m=document.compatMode!=="CSS1Compat",lv={...z6,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"7.0",releaseDate:"2023-08-30",i18n:Kf,activeEditor:null,focusedEditor:null,setup(){const n=this;let i="",l="",d=u1.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(d)&&(d=d.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(d)||(d+="/"));const p=window.tinymce||window.tinyMCEPreInit;if(p)i=p.base||p.baseURL,l=p.suffix;else{const w=document.getElementsByTagName("script");for(let E=0;E<w.length;E++){const R=w[E].src||"";if(R==="")continue;const B=R.substring(R.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(R)){B.indexOf(".min")!==-1&&(l=".min"),i=R.substring(0,R.lastIndexOf("/"));break}}if(!i&&document.currentScript){const E=document.currentScript.src;E.indexOf(".min")!==-1&&(l=".min"),i=E.substring(0,E.lastIndexOf("/"))}}n.baseURL=new u1(d).toAbsolute(i),n.documentBaseURL=d,n.baseURI=new u1(n.baseURL),n.suffix=l,CU(n)},overrideDefaults(n){const i=n.base_url;i&&this._setBaseUrl(i);const l=n.suffix;l&&(this.suffix=l),this.defaultOptions=n;const d=n.plugin_base_urls;d!==void 0&&ln(d,(p,w)=>{Na.PluginManager.urls[w]=p})},init(n){const i=this;let l;const d=hn.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),p=(ie,ue)=>ie.inline&&ue.tagName.toLowerCase()in d,w=ie=>{let ue=ie.id;return ue||(ue=po(ie,"name").filter(be=>!b_.get(be)).getOrThunk(b_.uniqueId),ie.setAttribute("id",ue)),ue},E=ie=>{const ue=n[ie];if(!!ue)return ue.apply(i,[])},R=ie=>Xn.browser.isIE()||Xn.browser.isEdge()?(VT("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/6/support/#supportedwebbrowsers"),[]):_m?(VT("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):F(ie.selector)?b_.select(ie.selector):_e(ie.target)?[ie.target]:[];let B=ie=>{l=ie};const K=()=>{let ie=0;const ue=[];let be;const Le=(je,Me,Ve)=>{const mt=new dD(je,Me,i);ue.push(mt),mt.on("init",()=>{++ie===be.length&&B(ue)}),mt.targetElm=mt.targetElm||Ve,mt.render()};b_.unbind(window,"ready",K),E("onpageload"),be=na(R(n)),hn.each(be,je=>{Cee(i.get(je.id))}),be=hn.grep(be,je=>!i.get(je.id)),be.length===0?B([]):A0(be,je=>{p(n,je)?VT("Could not initialize inline editor on invalid inline target element",je):Le(w(je),n,je)})};return b_.bind(window,"ready",K),new Promise(ie=>{l?ie(l):B=ue=>{ie(ue)}})},get(n){return arguments.length===0?Oh.slice(0):F(n)?eo(Oh,i=>i.id===n).getOr(null):nt(n)&&Oh[n]?Oh[n]:null},add(n){const i=this,l=i.get(n.id);return l===n||(l===null&&Oh.push(n),x$(!0),i.activeEditor=n,i.dispatch("AddEditor",{editor:n}),hD||(hD=d=>{const p=i.dispatch("BeforeUnload");if(p.returnValue)return d.preventDefault(),d.returnValue=p.returnValue,p.returnValue},window.addEventListener("beforeunload",hD))),n},createEditor(n,i){return this.add(new dD(n,i,this))},remove(n){const i=this;let l;if(!n){for(let d=Oh.length-1;d>=0;d--)i.remove(Oh[d]);return}if(F(n)){A0(b_.select(n),d=>{l=i.get(d.id),l&&i.remove(l)});return}return l=n,X(i.get(l.id))?null:(_ee(l)&&i.dispatch("RemoveEditor",{editor:l}),Oh.length===0&&window.removeEventListener("beforeunload",hD),l.remove(),x$(Oh.length>0),l)},execCommand(n,i,l){var d;const p=this,w=oe(l)?(d=l.id)!==null&&d!==void 0?d:l.index:l;switch(n){case"mceAddEditor":{if(!p.get(w)){const E=l.options;new dD(w,E,p).render()}return!0}case"mceRemoveEditor":{const E=p.get(w);return E&&E.remove(),!0}case"mceToggleEditor":{const E=p.get(w);return E?(E.isHidden()?E.show():E.hide(),!0):(p.execCommand("mceAddEditor",!1,l),!0)}}return p.activeEditor?p.activeEditor.execCommand(n,i,l):!1},triggerSave:()=>{A0(Oh,n=>{n.save()})},addI18n:(n,i)=>{Kf.add(n,i)},translate:n=>Kf.translate(n),setActive(n){const i=this.activeEditor;this.activeEditor!==n&&(i&&i.dispatch("deactivate",{relatedTarget:n}),n.dispatch("activate",{relatedTarget:i})),this.activeEditor=n},_setBaseUrl(n){this.baseURL=new u1(this.documentBaseURL).toAbsolute(n.replace(/\/+$/,"")),this.baseURI=new u1(this.baseURL)}};lv.setup();const See=(()=>{const n=mh(),i=w=>({items:w,types:gs(w),getType:E=>po(w,E).getOrUndefined()}),l=w=>{n.set(w)},d=()=>n.get().getOrUndefined(),p=n.clear;return{FakeClipboardItem:i,write:l,read:d,clear:p}})(),T$=Math.min,jS=Math.max,gD=Math.round,D$=(n,i,l)=>{let d=i.x,p=i.y;const w=n.w,E=n.h,R=i.w,B=i.h,K=(l||"").split("");return K[0]==="b"&&(p+=B),K[1]==="r"&&(d+=R),K[0]==="c"&&(p+=gD(B/2)),K[1]==="c"&&(d+=gD(R/2)),K[3]==="b"&&(p-=E),K[4]==="r"&&(d-=w),K[3]==="c"&&(p-=gD(E/2)),K[4]==="c"&&(d-=gD(w/2)),ZS(d,p,w,E)},kee=(n,i,l,d)=>{for(let p=0;p<d.length;p++){const w=D$(n,i,d[p]);if(w.x>=l.x&&w.x+w.w<=l.w+l.x&&w.y>=l.y&&w.y+w.h<=l.h+l.y)return d[p]}return null},O$=(n,i,l)=>ZS(n.x-i,n.y-l,n.w+i*2,n.h+l*2),Eee=(n,i)=>{const l=jS(n.x,i.x),d=jS(n.y,i.y),p=T$(n.x+n.w,i.x+i.w),w=T$(n.y+n.h,i.y+i.h);return p-l<0||w-d<0?null:ZS(l,d,p-l,w-d)},Aee=(n,i,l)=>{let d=n.x,p=n.y,w=n.x+n.w,E=n.y+n.h;const R=i.x+i.w,B=i.y+i.h,K=jS(0,i.x-d),ie=jS(0,i.y-p),ue=jS(0,w-R),be=jS(0,E-B);return d+=K,p+=ie,l&&(w+=K,E+=ie,d-=ue,p-=be),w-=ue,E-=be,ZS(d,p,w-d,E-p)},ZS=(n,i,l,d)=>({x:n,y:i,w:l,h:d}),xee={inflate:O$,relativePosition:D$,findBestRelativePosition:kee,intersect:Eee,clamp:Aee,create:ZS,fromClientRect:n=>ZS(n.left,n.top,n.width,n.height)},Tee=(n,i,l=1e3)=>{let d=!1,p=null;const w=K=>(...ie)=>{d||(d=!0,p!==null&&(clearTimeout(p),p=null),K.apply(null,ie))},E=w(n),R=w(i);return{start:(...K)=>{!d&&p===null&&(p=setTimeout(()=>R.apply(null,K),l))},resolve:E,reject:R}},qS=(()=>{const n={},i={};return{load:(w,E)=>{const R=`Script at URL "${E}" failed to load`,B=`Script at URL "${E}" did not call \`tinymce.Resource.add('${w}', data)\` within 1 second`;if(n[w]!==void 0)return n[w];{const K=new Promise((ie,ue)=>{const be=Tee(ie,ue);i[w]=be.resolve,nm.ScriptLoader.loadScript(E).then(()=>be.start(B),()=>be.reject(R))});return n[w]=K,K}},add:(w,E)=>{i[w]!==void 0&&(i[w](E),delete i[w]),n[w]=Promise.resolve(E)},unload:w=>{delete n[w]}}})(),Dee=()=>(()=>{let n={},i=[];const l={getItem:d=>{const p=n[d];return p||null},setItem:(d,p)=>{i.push(d),n[d]=String(p)},key:d=>i[d],removeItem:d=>{i=i.filter(p=>p===d),delete n[d]},clear:()=>{i=[],n={}},length:0};return Object.defineProperty(l,"length",{get:()=>i.length,configurable:!1,enumerable:!1}),l})();let _x;try{const n="__storage_test__";_x=window.localStorage,_x.setItem(n,n),_x.removeItem(n)}catch{_x=Dee()}var Oee=_x;const Mee={geom:{Rect:xee},util:{Delay:mg,Tools:hn,VK:no,URI:u1,EventDispatcher:$6,Observable:z6,I18n:Kf,LocalStorage:Oee,ImageUploader:ZL},dom:{EventUtils:tm,TreeWalker:bi,TextSeeker:op,DOMUtils:Lr,ScriptLoader:nm,RangeUtils:y,Serializer:d1,StyleSheetLoader:Av,ControlSelection:jE,BookmarkManager:fy,Selection:a5,Event:tm.Event},html:{Styles:Dv,Entities:Yg,Node:Hd,Schema:dh,DomParser:yS,Writer:bM,Serializer:Pw},Env:Xn,AddOnManager:Na,Annotator:o1,Formatter:XL,UndoManager:y5,EditorCommands:b$,WindowManager:NA,NotificationManager:Jw,EditorObservable:U6,Shortcuts:E$,Editor:dD,FocusManager:OI,EditorManager:lv,DOM:Lr.DOM,ScriptLoader:nm.ScriptLoader,PluginManager:Qw,ThemeManager:Dy,ModelManager:SS,IconManager:LT,Resource:qS,FakeClipboard:See,trim:hn.trim,isArray:hn.isArray,is:hn.is,toArray:hn.toArray,makeMap:hn.makeMap,each:hn.each,map:hn.map,grep:hn.grep,inArray:hn.inArray,extend:hn.extend,walk:hn.walk,resolve:hn.resolve,explode:hn.explode,_addCacheSuffix:hn._addCacheSuffix},X6=hn.extend(lv,Mee),pD=n=>{try{r.exports=n}catch{}};(n=>{window.tinymce=n,window.tinyMCE=n})(X6),pD(X6)})()})(dme);const yCe=dme.exports;(function(){var r=tinymce.util.Tools.resolve("tinymce.ModelManager");const e=(y,k,D)=>{var P;return D(y,k.prototype)?!0:((P=y.constructor)===null||P===void 0?void 0:P.name)===k.name},t=y=>{const k=typeof y;return y===null?"null":k==="object"&&Array.isArray(y)?"array":k==="object"&&e(y,String,(D,P)=>P.isPrototypeOf(D))?"string":k},s=y=>k=>t(k)===y,a=y=>k=>typeof k===y,u=y=>k=>y===k,f=s("string"),h=s("object"),g=s("array"),v=u(null),_=a("boolean"),A=u(void 0),O=y=>y==null,N=y=>!O(y),L=a("function"),j=a("number"),z=()=>{},q=(y,k)=>(...D)=>y(k.apply(null,D)),ee=(y,k)=>D=>y(k(D)),F=y=>()=>y,oe=y=>y,te=(y,k)=>y===k;function se(y,...k){return(...D)=>{const P=k.concat(D);return y.apply(null,P)}}const X=y=>k=>!y(k),we=y=>()=>{throw new Error(y)},ye=y=>y(),Te=F(!1),_e=F(!0);class ge{constructor(k,D){this.tag=k,this.value=D}static some(k){return new ge(!0,k)}static none(){return ge.singletonNone}fold(k,D){return this.tag?D(this.value):k()}isSome(){return this.tag}isNone(){return!this.tag}map(k){return this.tag?ge.some(k(this.value)):ge.none()}bind(k){return this.tag?k(this.value):ge.none()}exists(k){return this.tag&&k(this.value)}forall(k){return!this.tag||k(this.value)}filter(k){return!this.tag||k(this.value)?this:ge.none()}getOr(k){return this.tag?this.value:k}or(k){return this.tag?this:k}getOrThunk(k){return this.tag?this.value:k()}orThunk(k){return this.tag?this:k()}getOrDie(k){if(this.tag)return this.value;throw new Error(k!=null?k:"Called getOrDie on None")}static from(k){return N(k)?ge.some(k):ge.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(k){this.tag&&k(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ge.singletonNone=new ge(!1);const nt=Array.prototype.slice,Je=Array.prototype.indexOf,ft=Array.prototype.push,V=(y,k)=>Je.call(y,k),ut=(y,k)=>V(y,k)>-1,et=(y,k)=>{for(let D=0,P=y.length;D<P;D++){const Z=y[D];if(k(Z,D))return!0}return!1},Et=(y,k)=>{const D=[];for(let P=0;P<y;P++)D.push(k(P));return D},xt=(y,k)=>{const D=y.length,P=new Array(D);for(let Z=0;Z<D;Z++){const ne=y[Z];P[Z]=k(ne,Z)}return P},He=(y,k)=>{for(let D=0,P=y.length;D<P;D++){const Z=y[D];k(Z,D)}},ct=(y,k)=>{for(let D=y.length-1;D>=0;D--){const P=y[D];k(P,D)}},an=(y,k)=>{const D=[],P=[];for(let Z=0,ne=y.length;Z<ne;Z++){const pe=y[Z];(k(pe,Z)?D:P).push(pe)}return{pass:D,fail:P}},kt=(y,k)=>{const D=[];for(let P=0,Z=y.length;P<Z;P++){const ne=y[P];k(ne,P)&&D.push(ne)}return D},bn=(y,k,D)=>(ct(y,(P,Z)=>{D=k(D,P,Z)}),D),qe=(y,k,D)=>(He(y,(P,Z)=>{D=k(D,P,Z)}),D),gt=(y,k,D)=>{for(let P=0,Z=y.length;P<Z;P++){const ne=y[P];if(k(ne,P))return ge.some(ne);if(D(ne,P))break}return ge.none()},de=(y,k)=>gt(y,k,Te),No=(y,k)=>{for(let D=0,P=y.length;D<P;D++){const Z=y[D];if(k(Z,D))return ge.some(D)}return ge.none()},Zn=y=>{const k=[];for(let D=0,P=y.length;D<P;++D){if(!g(y[D]))throw new Error("Arr.flatten item "+D+" was not an array, input: "+y);ft.apply(k,y[D])}return k},Bn=(y,k)=>Zn(xt(y,k)),ao=(y,k)=>{for(let D=0,P=y.length;D<P;++D){const Z=y[D];if(k(Z,D)!==!0)return!1}return!0},Wo=y=>{const k=nt.call(y,0);return k.reverse(),k},St=(y,k)=>{const D={};for(let P=0,Z=y.length;P<Z;P++){const ne=y[P];D[String(ne)]=k(ne,P)}return D},Xt=(y,k)=>{const D=nt.call(y,0);return D.sort(k),D},Tt=(y,k)=>k>=0&&k<y.length?ge.some(y[k]):ge.none(),Be=y=>Tt(y,0),Ut=y=>Tt(y,y.length-1),gn=(y,k)=>{for(let D=0;D<y.length;D++){const P=k(y[D],D);if(P.isSome())return P}return ge.none()},wt=Object.keys,Yt=Object.hasOwnProperty,vn=(y,k)=>{const D=wt(y);for(let P=0,Z=D.length;P<Z;P++){const ne=D[P],pe=y[ne];k(pe,ne)}},rs=(y,k)=>eo(y,(D,P)=>({k:P,v:k(D,P)})),eo=(y,k)=>{const D={};return vn(y,(P,Z)=>{const ne=k(P,Z);D[ne.k]=ne.v}),D},ds=y=>(k,D)=>{y[D]=k},Or=(y,k,D,P)=>{vn(y,(Z,ne)=>{(k(Z,ne)?D:P)(Z,ne)})},Rs=(y,k)=>{const D={};return Or(y,k,ds(D),z),D},Js=(y,k)=>{const D=[];return vn(y,(P,Z)=>{D.push(k(P,Z))}),D},Zs=y=>Js(y,oe),ba=(y,k)=>ar(y,k)?ge.from(y[k]):ge.none(),ar=(y,k)=>Yt.call(y,k),Ns=(y,k)=>ar(y,k)&&y[k]!==void 0&&y[k]!==null,Zr=y=>{for(const k in y)if(Yt.call(y,k))return!1;return!0},Po=typeof window<"u"?window:Function("return this;")(),Mo=(y,k)=>{let D=k!=null?k:Po;for(let P=0;P<y.length&&D!==void 0&&D!==null;++P)D=D[y[P]];return D},Mr=(y,k)=>{const D=y.split(".");return Mo(D,k)},Ls=(y,k)=>Mr(y,k),na=(y,k)=>{const D=Ls(y,k);if(D==null)throw new Error(y+" not available on this browser");return D},gs=Object.getPrototypeOf,va=y=>na("HTMLElement",y),ln=y=>{const k=Mr("ownerDocument.defaultView",y);return h(y)&&(va(k).prototype.isPrototypeOf(y)||/^HTML\w*Element$/.test(gs(y).constructor.name))},ps=8,Li=9,ze=11,Qe=1,Dt=3,Wt=y=>y.dom.nodeName.toLowerCase(),qn=y=>y.dom.nodeType,uo=y=>k=>qn(k)===y,po=y=>qn(y)===ps||Wt(y)==="#comment",un=y=>ns(y)&&ln(y.dom),ns=uo(Qe),_o=uo(Dt),cs=uo(Li),Sr=uo(ze),Ir=y=>k=>ns(k)&&Wt(k)===y,Vs=(y,k,D)=>{if(f(D)||_(D)||j(D))y.setAttribute(k,D+"");else throw console.error("Invalid call to Attribute.set. Key ",k,":: Value ",D,":: Element ",y),new Error("Attribute value was not simple")},Ur=(y,k,D)=>{Vs(y.dom,k,D)},Fi=(y,k)=>{const D=y.dom;vn(k,(P,Z)=>{Vs(D,Z,P)})},La=(y,k)=>{vn(k,(D,P)=>{D.fold(()=>{Ge(y,P)},Z=>{Vs(y.dom,P,Z)})})},mi=(y,k)=>{const D=y.dom.getAttribute(k);return D===null?void 0:D},Ke=(y,k)=>ge.from(mi(y,k)),Ge=(y,k)=>{y.dom.removeAttribute(k)},It=y=>qe(y.dom.attributes,(k,D)=>(k[D.name]=D.value,k),{}),jt=(y,k)=>{const P=(k||document).createElement("div");if(P.innerHTML=y,!P.hasChildNodes()||P.childNodes.length>1){const Z="HTML does not have a single root node";throw console.error(Z,y),new Error(Z)}return Ko(P.childNodes[0])},fo=(y,k)=>{const P=(k||document).createElement(y);return Ko(P)},Lo=(y,k)=>{const P=(k||document).createTextNode(y);return Ko(P)},Ko=y=>{if(y==null)throw new Error("Node cannot be null or undefined");return{dom:y}},it={fromHtml:jt,fromTag:fo,fromText:Lo,fromDom:Ko,fromPoint:(y,k,D)=>ge.from(y.dom.elementFromPoint(k,D)).map(Ko)},Zo=(y,k)=>{const D=y.dom;if(D.nodeType!==Qe)return!1;{const P=D;if(P.matches!==void 0)return P.matches(k);if(P.msMatchesSelector!==void 0)return P.msMatchesSelector(k);if(P.webkitMatchesSelector!==void 0)return P.webkitMatchesSelector(k);if(P.mozMatchesSelector!==void 0)return P.mozMatchesSelector(k);throw new Error("Browser lacks native selectors")}},Oi=y=>y.nodeType!==Qe&&y.nodeType!==Li&&y.nodeType!==ze||y.childElementCount===0,oa=(y,k)=>{const D=k===void 0?document:k.dom;return Oi(D)?[]:xt(D.querySelectorAll(y),it.fromDom)},ua=(y,k)=>{const D=k===void 0?document:k.dom;return Oi(D)?ge.none():ge.from(D.querySelector(y)).map(it.fromDom)},ur=(y,k)=>y.dom===k.dom,Dc=(y,k)=>{const D=y.dom,P=k.dom;return D===P?!1:D.contains(P)},gc=Zo,Ja=y=>it.fromDom(y.dom.ownerDocument),fa=y=>cs(y)?y:Ja(y),Qs=y=>it.fromDom(fa(y).dom.documentElement),xr=y=>it.fromDom(fa(y).dom.defaultView),Ki=y=>ge.from(y.dom.parentNode).map(it.fromDom),dl=y=>ge.from(y.dom.parentElement).map(it.fromDom),pc=(y,k)=>{const D=L(k)?k:Te;let P=y.dom;const Z=[];for(;P.parentNode!==null&&P.parentNode!==void 0;){const ne=P.parentNode,pe=it.fromDom(ne);if(Z.push(pe),D(pe)===!0)break;P=ne}return Z},Zc=y=>ge.from(y.dom.previousSibling).map(it.fromDom),gu=y=>ge.from(y.dom.nextSibling).map(it.fromDom),pr=y=>xt(y.dom.childNodes,it.fromDom),Qa=(y,k)=>{const D=y.dom.childNodes;return ge.from(D[k]).map(it.fromDom)},pu=y=>Qa(y,0),qc=(y,k)=>{Ki(y).each(P=>{P.dom.insertBefore(k.dom,y.dom)})},Vl=(y,k)=>{gu(y).fold(()=>{Ki(y).each(Z=>{Tr(Z,k)})},P=>{qc(P,k)})},Aa=(y,k)=>{pu(y).fold(()=>{Tr(y,k)},P=>{y.dom.insertBefore(k.dom,P.dom)})},Tr=(y,k)=>{y.dom.appendChild(k.dom)},Rm=(y,k,D)=>{Qa(y,D).fold(()=>{Tr(y,k)},P=>{qc(P,k)})},gf=(y,k)=>{qc(y,k),Tr(k,y)},kr=(y,k)=>{He(k,(D,P)=>{const Z=P===0?y:k[P-1];Vl(Z,D)})},Fa=(y,k)=>{He(k,D=>{Tr(y,D)})},sa=y=>{y.dom.textContent="",He(pr(y),k=>{Yi(k)})},Yi=y=>{const k=y.dom;k.parentNode!==null&&k.parentNode.removeChild(k)},bu=y=>{const k=pr(y);k.length>0&&kr(y,k),Yi(y)},Oc=(y,k)=>it.fromDom(y.dom.cloneNode(k)),Ha=y=>Oc(y,!1),Mc=y=>Oc(y,!0),bc=(y,k)=>{const D=it.fromTag(k),P=It(y);return Fi(D,P),D},gd=(y,k)=>{const D=bc(y,k),P=pr(Mc(y));return Fa(D,P),D},Bf=(y,k)=>{const D=bc(y,k);Vl(y,D);const P=pr(y);return Fa(D,P),Yi(y),D},vu=["tfoot","thead","tbody","colgroup"],Ul=y=>ut(vu,y),Rc=(y,k)=>({rows:y,columns:k}),pf=(y,k)=>({row:y,column:k}),Gc=(y,k,D)=>({element:y,rowspan:k,colspan:D}),pd=(y,k,D,P)=>({element:y,rowspan:k,colspan:D,isNew:P}),xe=(y,k,D,P,Z,ne)=>({element:y,rowspan:k,colspan:D,row:P,column:Z,isLocked:ne}),tt=(y,k,D)=>({element:y,cells:k,section:D}),pt=(y,k,D,P)=>({element:y,cells:k,section:D,isNew:P}),Pt=(y,k,D)=>({element:y,isNew:k,isLocked:D}),yn=(y,k,D,P)=>({element:y,cells:k,section:D,isNew:P}),Ro=(y,k,D,P)=>({startRow:y,startCol:k,finishRow:D,finishCol:P}),Rr=(y,k,D)=>({element:y,colspan:k,column:D}),ys=(y,k)=>({element:y,columns:k}),is=y=>Sr(y)&&N(y.dom.host),Ei=L(Element.prototype.attachShadow)&&L(Node.prototype.getRootNode),qs=F(Ei),Hi=Ei?y=>it.fromDom(y.dom.getRootNode()):fa,yu=y=>{const k=Hi(y);return is(k)?ge.some(k):ge.none()},bd=y=>it.fromDom(y.dom.host),Xn=y=>{if(qs()&&N(y.target)){const k=it.fromDom(y.target);if(ns(k)&&Nm(k)&&y.composed&&y.composedPath){const D=y.composedPath();if(D)return Be(D)}}return ge.from(y.target)},Nm=y=>N(y.dom.shadowRoot),$i=y=>{const k=_o(y)?y.dom.parentNode:y.dom;if(k==null||k.ownerDocument===null)return!1;const D=k.ownerDocument;return yu(it.fromDom(k)).fold(()=>D.body.contains(k),ee($i,bd))},he=()=>Re(it.fromDom(document)),Re=y=>{const k=y.dom.body;if(k==null)throw new Error("Body is not available yet");return it.fromDom(k)},We=(y,k,D)=>kt(pc(y,D),k),Bt=(y,k)=>kt(pr(y),k),Fn=(y,k)=>{let D=[];return He(pr(y),P=>{k(P)&&(D=D.concat([P])),D=D.concat(Fn(P,k))}),D},Jo=(y,k,D)=>We(y,P=>Zo(P,k),D),so=(y,k)=>Bt(y,D=>Zo(D,k)),gi=(y,k)=>oa(k,y);var hn=(y,k,D,P,Z)=>y(D,P)?ge.some(D):L(Z)&&Z(D)?ge.none():k(D,P,Z);const qr=(y,k,D)=>{let P=y.dom;const Z=L(D)?D:Te;for(;P.parentNode;){P=P.parentNode;const ne=it.fromDom(P);if(k(ne))return ge.some(ne);if(Z(ne))break}return ge.none()},Nl=(y,k,D)=>hn((Z,ne)=>ne(Z),qr,y,k,D),Xi=(y,k)=>{const D=Z=>k(it.fromDom(Z));return de(y.dom.childNodes,D).map(it.fromDom)},ni=(y,k)=>{const D=P=>{for(let Z=0;Z<P.childNodes.length;Z++){const ne=it.fromDom(P.childNodes[Z]);if(k(ne))return ge.some(ne);const pe=D(P.childNodes[Z]);if(pe.isSome())return pe}return ge.none()};return D(y.dom)},bf=(y,k,D)=>qr(y,P=>Zo(P,k),D),Ss=(y,k)=>Xi(y,D=>Zo(D,k)),Kc=(y,k)=>ua(k,y),Ai=(y,k,D)=>hn((Z,ne)=>Zo(Z,ne),bf,y,k,D),sc=(y,k,D=te)=>y.exists(P=>D(P,k)),Mi=y=>{const k=[],D=P=>{k.push(P)};for(let P=0;P<y.length;P++)y[P].each(D);return k},Lf=(y,k)=>y!=null?k(y):ge.none(),da=(y,k)=>y?ge.some(k):ge.none(),Ff=(y,k,D)=>k===""||y.length>=k.length&&y.substr(D,D+k.length)===k,fr=(y,k,D=0,P)=>{const Z=y.indexOf(k,D);return Z!==-1?A(P)?!0:Z+k.length<=P:!1},$u=(y,k)=>Ff(y,k,0),zu=(y,k)=>Ff(y,k,y.length-k.length),Hf=(y=>k=>k.replace(y,""))(/^\s+|\s+$/g),jd=y=>y.length>0,Xr=y=>{const k=parseFloat(y);return isNaN(k)?ge.none():ge.some(k)},Ji=y=>y.style!==void 0&&L(y.style.getPropertyValue),$a=(y,k,D)=>{if(!f(D))throw console.error("Invalid call to CSS.set. Property ",k,":: Value ",D,":: Element ",y),new Error("CSS value must be a string: "+D);Ji(y)&&y.style.setProperty(k,D)},U0=(y,k)=>{Ji(y)&&y.style.removeProperty(k)},xi=(y,k,D)=>{const P=y.dom;$a(P,k,D)},_l=(y,k)=>{const D=y.dom;vn(k,(P,Z)=>{$a(D,Z,P)})},el=(y,k)=>{const D=y.dom,Z=window.getComputedStyle(D).getPropertyValue(k);return Z===""&&!$i(y)?Ng(D,k):Z},Ng=(y,k)=>Ji(y)?y.style.getPropertyValue(k):"",$f=(y,k)=>{const D=y.dom,P=Ng(D,k);return ge.from(P).filter(Z=>Z.length>0)},yc=(y,k)=>{const D=y.dom;U0(D,k),sc(Ke(y,"style").map(Hf),"")&&Ge(y,"style")},vf=(y,k)=>{const D=y.dom,P=k.dom;Ji(D)&&Ji(P)&&(P.style.cssText=D.style.cssText)},Dr=(y,k,D=0)=>Ke(y,k).map(P=>parseInt(P,10)).getOr(D),Vu=(y,k)=>Dr(y,k,1),Pl=y=>Ir("col")(y)?Dr(y,"span",1)>1:Vu(y,"colspan")>1,za=y=>Vu(y,"rowspan")>1,qi=(y,k)=>parseInt(el(y,k),10),zi=F(10),rc=F(10),zf=(y,k)=>Zd(y,k,_e),Zd=(y,k,D)=>Bn(pr(y),P=>Zo(P,k)?D(P)?[P]:[]:Zd(P,k,D)),Pg=(y,k,D=Te)=>{if(D(k))return ge.none();if(ut(y,Wt(k)))return ge.some(k);const P=Z=>Zo(Z,"table")||D(Z);return bf(k,y.join(","),P)},Pm=(y,k)=>Pg(["td","th"],y,k),Il=y=>zf(y,"th,td"),Im=y=>Zo(y,"colgroup")?so(y,"col"):Bn(zh(y),k=>so(k,"col")),tl=(y,k)=>Ai(y,"table",k),yf=y=>zf(y,"tr"),zh=y=>tl(y).fold(F([]),k=>so(k,"colgroup")),Uu=(y,k)=>xt(y,D=>{if(Wt(D)==="colgroup"){const P=xt(Im(D),Z=>{const ne=Dr(Z,"span",1);return Gc(Z,1,ne)});return tt(D,P,"colgroup")}else{const P=xt(Il(D),Z=>{const ne=Dr(Z,"rowspan",1),pe=Dr(Z,"colspan",1);return Gc(Z,ne,pe)});return tt(D,P,k(D))}}),Vh=y=>Ki(y).map(k=>{const D=Wt(k);return Ul(D)?D:"tbody"}).getOr("tbody"),Nc=y=>{const k=yf(y),P=[...zh(y),...k];return Uu(P,Vh)},Uh=(y,k)=>Uu(y,()=>k),wf=y=>{let k=!1,D;return(...P)=>(k||(k=!0,D=y.apply(null,P)),D)},Bp=(y,k,D,P)=>{const Z=y.isiOS()&&/ipad/i.test(D)===!0,ne=y.isiOS()&&!Z,pe=y.isiOS()||y.isAndroid(),Ee=pe||P("(pointer:coarse)"),Fe=Z||!ne&&pe&&P("(min-device-width:768px)"),ot=ne||pe&&!Fe,_t=k.isSafari()&&y.isiOS()&&/safari/i.test(D)===!1,fn=!ot&&!Fe&&!_t;return{isiPad:F(Z),isiPhone:F(ne),isTablet:F(Fe),isPhone:F(ot),isTouch:F(Ee),isAndroid:y.isAndroid,isiOS:y.isiOS,isWebView:F(_t),isDesktop:F(fn)}},Bm=(y,k)=>{for(let D=0;D<y.length;D++){const P=y[D];if(P.test(k))return P}},Vf=(y,k)=>{const D=Bm(y,k);if(!D)return{major:0,minor:0};const P=Z=>Number(k.replace(D,"$"+Z));return Ye(P(1),P(2))},Wl=(y,k)=>{const D=String(k).toLowerCase();return y.length===0?Ig():Vf(y,D)},Ig=()=>Ye(0,0),Ye=(y,k)=>({major:y,minor:k}),qd={nu:Ye,detect:Wl,unknown:Ig},wu=(y,k)=>gn(k.brands,D=>{const P=D.brand.toLowerCase();return de(y,Z=>{var ne;return P===((ne=Z.brand)===null||ne===void 0?void 0:ne.toLowerCase())}).map(Z=>({current:Z.name,version:qd.nu(parseInt(D.version,10),0)}))}),Bg=(y,k)=>{const D=String(k).toLowerCase();return de(y,P=>P.search(D))},L1=(y,k)=>Bg(y,k).map(D=>{const P=qd.detect(D.versionRegexes,k);return{current:D.name,version:P}}),Wh=(y,k)=>Bg(y,k).map(D=>{const P=qd.detect(D.versionRegexes,k);return{current:D.name,version:P}}),bt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,cn=y=>k=>fr(k,y),rn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:y=>fr(y,"edge/")&&fr(y,"chrome")&&fr(y,"safari")&&fr(y,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,bt],search:y=>fr(y,"chrome")&&!fr(y,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:y=>fr(y,"msie")||fr(y,"trident")},{name:"Opera",versionRegexes:[bt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:cn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:cn("firefox")},{name:"Safari",versionRegexes:[bt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:y=>(fr(y,"safari")||fr(y,"mobile/"))&&fr(y,"applewebkit")}],To=[{name:"Windows",search:cn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:y=>fr(y,"iphone")||fr(y,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:cn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:cn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:cn("linux"),versionRegexes:[]},{name:"Solaris",search:cn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:cn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:cn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],er={browsers:F(rn),oses:F(To)},Wr="Edge",ai="Chromium",pi="IE",Gd="Opera",W0="Firefox",ya="Safari",vd=()=>Lg({current:void 0,version:qd.unknown()}),Lg=y=>{const k=y.current,D=y.version,P=Z=>()=>k===Z;return{current:k,version:D,isEdge:P(Wr),isChromium:P(ai),isIE:P(pi),isOpera:P(Gd),isFirefox:P(W0),isSafari:P(ya)}},nl={unknown:vd,nu:Lg,edge:F(Wr),chromium:F(ai),ie:F(pi),opera:F(Gd),firefox:F(W0),safari:F(ya)},xa="Windows",Wu="iOS",oi="Android",_u="Linux",ic="macOS",jh="Solaris",F1="FreeBSD",Kd="ChromeOS",Fg=()=>Yd({current:void 0,version:qd.unknown()}),Yd=y=>{const k=y.current,D=y.version,P=Z=>()=>k===Z;return{current:k,version:D,isWindows:P(xa),isiOS:P(Wu),isAndroid:P(oi),isMacOS:P(ic),isLinux:P(_u),isSolaris:P(jh),isFreeBSD:P(F1),isChromeOS:P(Kd)}},jl={unknown:Fg,nu:Yd,windows:F(xa),ios:F(Wu),android:F(oi),linux:F(_u),macos:F(ic),solaris:F(jh),freebsd:F(F1),chromeos:F(Kd)},H1={detect:(y,k,D)=>{const P=er.browsers(),Z=er.oses(),ne=k.bind(Fe=>wu(P,Fe)).orThunk(()=>L1(P,y)).fold(nl.unknown,nl.nu),pe=Wh(Z,y).fold(jl.unknown,jl.nu),Ee=Bp(pe,ne,y,D);return{browser:ne,os:pe,deviceType:Ee}}},Lm=y=>window.matchMedia(y).matches;let Hg=wf(()=>H1.detect(navigator.userAgent,ge.from(navigator.userAgentData),Lm));const qh=()=>Hg(),Xd=(y,k)=>{const D=(Ee,Fe)=>{if(!j(Fe)&&!Fe.match(/^[0-9]+$/))throw new Error(y+".set accepts only positive integer values. Value was "+Fe);const ot=Ee.dom;Ji(ot)&&(ot.style[y]=Fe+"px")},P=Ee=>{const Fe=k(Ee);if(Fe<=0||Fe===null){const ot=el(Ee,y);return parseFloat(ot)||0}return Fe},Z=P,ne=(Ee,Fe)=>qe(Fe,(ot,_t)=>{const fn=el(Ee,_t),Gn=fn===void 0?0:parseInt(fn,10);return isNaN(Gn)?ot:ot+Gn},0);return{set:D,get:P,getOuter:Z,aggregate:ne,max:(Ee,Fe,ot)=>{const _t=ne(Ee,ot);return Fe>_t?Fe-_t:0}}},yd=(y,k)=>Xr(y).getOr(k),si=(y,k,D)=>yd(el(y,k),D),li=(y,k,D,P)=>{const Z=si(y,`padding-${D}`,0),ne=si(y,`padding-${P}`,0),pe=si(y,`border-${D}-width`,0),Ee=si(y,`border-${P}-width`,0);return k-Z-ne-pe-Ee},Bl=(y,k)=>{const D=y.dom,P=D.getBoundingClientRect().width||D.offsetWidth;return k==="border-box"?P:li(y,P,"left","right")},Lp=y=>si(y,"height",y.dom.offsetHeight),Q=y=>si(y,"width",y.dom.offsetWidth),ce=y=>Bl(y,"content-box"),Se=Xd("width",y=>y.dom.offsetWidth),Xe=y=>Se.get(y),rt=y=>Se.getOuter(y),On=ce,Cn=Q,Yo=(y,k,D)=>{const P=y.cells,Z=P.slice(0,k),ne=P.slice(k),pe=Z.concat(D).concat(ne);return Er(y,pe)},os=(y,k,D)=>Yo(y,k,[D]),ho=(y,k,D)=>{const P=y.cells;P[k]=D},Er=(y,k)=>yn(y.element,k,y.section,y.isNew),Zl=(y,k)=>{const D=y.cells,P=xt(D,k);return yn(y.element,P,y.section,y.isNew)},ra=(y,k)=>y.cells[k],Ri=(y,k)=>ra(y,k).element,Cu=y=>y.cells.length,Ta=y=>{const k=an(y,D=>D.section==="colgroup");return{rows:k.fail,cols:k.pass}},Gh=(y,k,D)=>{const P=xt(y.cells,D);return yn(k(y.element),P,y.section,!0)},Fm="data-snooker-locked-cols",Vi=y=>Ke(y,Fm).bind(k=>ge.from(k.match(/\d+/g))).map(k=>St(k,_e)),wa=y=>{const k=qe(Ta(y).rows,(P,Z)=>(He(Z.cells,(ne,pe)=>{ne.isLocked&&(P[pe]=!0)}),P),{}),D=Js(k,(P,Z)=>parseInt(Z,10));return Xt(D)},Yc=(y,k)=>y+","+k,Jd=(y,k,D)=>ge.from(y.access[Yc(k,D)]),Qi=(y,k,D)=>{const P=j0(y,Z=>D(k,Z.element));return P.length>0?ge.some(P[0]):ge.none()},j0=(y,k)=>{const D=Bn(y.all,P=>P.cells);return kt(D,k)},yv=y=>{const k={};let D=0;return He(y.cells,P=>{const Z=P.colspan;Et(Z,ne=>{const pe=D+ne;k[pe]=Rr(P.element,Z,pe)}),D+=Z}),k},Jr=y=>{const k={},D=[],Z=Be(y).map(Un=>Un.element).bind(tl).bind(Vi).getOr({});let ne=0,pe=0,Ee=0;const{pass:Fe,fail:ot}=an(y,Un=>Un.section==="colgroup");He(ot,Un=>{const tn=[];He(Un.cells,Wn=>{let Jt=0;for(;k[Yc(Ee,Jt)]!==void 0;)Jt++;const mo=Ns(Z,Jt.toString()),as=xe(Wn.element,Wn.rowspan,Wn.colspan,Ee,Jt,mo);for(let Ts=0;Ts<Wn.colspan;Ts++)for(let aa=0;aa<Wn.rowspan;aa++){const Dl=Ee+aa,vl=Jt+Ts,Nu=Yc(Dl,vl);k[Nu]=as,pe=Math.max(pe,vl+1)}tn.push(as)}),ne++,D.push(tt(Un.element,tn,Un.section)),Ee++});const{columns:_t,colgroups:fn}=Ut(Fe).map(Un=>{const tn=yv(Un);return{colgroups:[ys(Un.element,Zs(tn))],columns:tn}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Rc(ne,pe),access:k,all:D,columns:_t,colgroups:fn}},Ae={fromTable:y=>{const k=Nc(y);return Jr(k)},generate:Jr,getAt:Jd,findItem:Qi,filterItems:j0,justCells:y=>Bn(y.all,k=>k.cells),justColumns:y=>Zs(y.columns),hasColumns:y=>wt(y.columns).length>0,getColumnAt:(y,k)=>ge.from(y.columns[k])},_f=(y,k=_e)=>{const D=y.grid,P=Et(D.columns,oe),Z=Et(D.rows,oe);return xt(P,ne=>$g(()=>Bn(Z,ot=>Ae.getAt(y,ot,ne).filter(_t=>_t.column===ne).toArray()),ot=>ot.colspan===1&&k(ot.element),()=>Ae.getAt(y,0,ne)))},$g=(y,k,D)=>{const P=y();return de(P,k).orThunk(()=>ge.from(P[0]).orThunk(D)).map(pe=>pe.element)},Su=y=>{const k=y.grid,D=Et(k.rows,oe),P=Et(k.columns,oe);return xt(D,Z=>$g(()=>Bn(P,Fe=>Ae.getAt(y,Z,Fe).filter(ot=>ot.row===Z).fold(F([]),ot=>[ot])),Fe=>Fe.rowspan===1,()=>Ae.getAt(y,Z,0)))},ci=(y,k)=>{if(k<0||k>=y.length-1)return ge.none();const D=y[k].fold(()=>{const Z=Wo(y.slice(0,k));return gn(Z,(ne,pe)=>ne.map(Ee=>({value:Ee,delta:pe+1})))},Z=>ge.some({value:Z,delta:0})),P=y[k+1].fold(()=>{const Z=y.slice(k+1);return gn(Z,(ne,pe)=>ne.map(Ee=>({value:Ee,delta:pe+1})))},Z=>ge.some({value:Z,delta:1}));return D.bind(Z=>P.map(ne=>{const pe=ne.delta+Z.delta;return Math.abs(ne.value-Z.value)/pe}))},wv=(y,k)=>D=>$1(D)==="rtl"?k:y,$1=y=>el(y,"direction")==="rtl"?"rtl":"ltr",Z0=Xd("height",y=>{const k=y.dom;return $i(y)?k.getBoundingClientRect().height:k.offsetHeight}),Wf=y=>Z0.get(y),Hm=y=>Z0.getOuter(y),zg=Lp,_v=(y,k)=>({left:y,top:k,translate:(P,Z)=>_v(y+P,k+Z)}),Cf=_v,h2=y=>{const k=y.getBoundingClientRect();return Cf(k.left,k.top)},ku=(y,k)=>y!==void 0?y:k!==void 0?k:0,ju=y=>{const k=y.dom.ownerDocument,D=k.body,P=k.defaultView,Z=k.documentElement;if(D===y.dom)return Cf(D.offsetLeft,D.offsetTop);const ne=ku(P==null?void 0:P.pageYOffset,Z.scrollTop),pe=ku(P==null?void 0:P.pageXOffset,Z.scrollLeft),Ee=ku(Z.clientTop,D.clientTop),Fe=ku(Z.clientLeft,D.clientLeft);return q0(y).translate(pe-Fe,ne-Ee)},q0=y=>{const k=y.dom,P=k.ownerDocument.body;return P===k?Cf(P.offsetLeft,P.offsetTop):$i(y)?h2(k):Cf(0,0)},G0=(y,k)=>({row:y,y:k}),K0=(y,k)=>({col:y,x:k}),z1=y=>ju(y).left+rt(y),jf=y=>ju(y).left,Y0=(y,k)=>K0(y,jf(k)),X0=(y,k)=>K0(y,z1(k)),hl=y=>ju(y).top,m2=(y,k)=>G0(y,hl(k)),bi=(y,k)=>G0(y,hl(k)+Hm(k)),lo=(y,k,D)=>{if(D.length===0)return[];const P=xt(D.slice(1),(ne,pe)=>ne.map(Ee=>y(pe,Ee))),Z=D[D.length-1].map(ne=>k(D.length-1,ne));return P.concat([Z])},_d=y=>-y,Qn={delta:oe,positions:y=>lo(m2,bi,y),edge:hl},eh=wv({delta:oe,edge:jf,positions:y=>lo(Y0,X0,y)},{delta:_d,edge:z1,positions:y=>lo(X0,Y0,y)}),Pc={delta:(y,k)=>eh(k).delta(y,k),positions:(y,k)=>eh(k).positions(y,k),edge:y=>eh(y).edge(y)},Vg={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Cd=(()=>{const y="[0-9]+",D="[eE]"+("[+-]?"+y),P="\\.",Z=Ee=>`(?:${Ee})?`,pe=`[+-]?(?:${["Infinity",y+P+Z(y)+Z(D),P+y+Z(D),y+Z(D)].join("|")})`;return new RegExp(`^(${pe})(.*)$`)})(),ml=(y,k)=>et(k,D=>et(Vg[D],P=>y===P)),Eu=(y,k)=>ge.from(Cd.exec(y)).bind(P=>{const Z=Number(P[1]),ne=P[2];return ml(ne,k)?ge.some({value:Z,unit:ne}):ge.none()}),Fp=/(\d+(\.\d+)?)%/,V1=/(\d+(\.\d+)?)px|em/,Sn=Ir("col"),$m=(y,k,D)=>{const P=dl(y).getOrThunk(()=>Re(Ja(y)));return k(y)/D(P)*100},Sd=(y,k)=>{xi(y,"width",k+"px")},th=(y,k)=>{xi(y,"width",k+"%")},Zu=(y,k)=>{xi(y,"height",k+"px")},U1=y=>zg(y)+"px",ui=(y,k,D,P)=>{const Z=tl(y).map(ne=>{const pe=D(ne);return Math.floor(k/100*pe)}).getOr(k);return P(y,Z),Z},Ui=(y,k,D,P)=>{const Z=parseFloat(y);return zu(y,"%")&&Wt(k)!=="table"?ui(k,Z,D,P):Z},ha=y=>{const k=U1(y);return k?Ui(k,y,Wf,Zu):Wf(y)},As=(y,k,D)=>{const P=D(y),Z=Vu(y,k);return P/Z},kd=(y,k)=>$f(y,k).orThunk(()=>Ke(y,k).map(D=>D+"px")),Cl=y=>kd(y,"width"),qu=y=>kd(y,"height"),Va=y=>$m(y,Xe,On),_a=y=>Sn(y)?Xe(y):Cn(y),Hp=y=>As(y,"rowspan",ha),Qt=y=>Cl(y).bind(D=>Eu(D,["fixed","relative","empty"])),Gr=(y,k,D)=>{xi(y,"width",k+D)},J0=y=>Xe(y)+"px",Ca=y=>$m(y,Xe,On)+"%",Ua=y=>Cl(y).exists(k=>Fp.test(k)),Ug=y=>Cl(y).exists(k=>V1.test(k)),Ic=y=>Cl(y).isNone(),Zf=F(Fp),qf=Ir("col"),$p=y=>Cl(y).getOrThunk(()=>_a(y)+"px"),Ll=y=>qu(y).getOrThunk(()=>Hp(y)+"px"),Ar=y=>xt(Ae.justColumns(y),k=>ge.from(k.element)),Wa=y=>{const k=qh().browser,D=k.isChromium()||k.isFirefox();return qf(y)?D:!0},nh=(y,k,D,P,Z,ne)=>y.filter(P).fold(()=>ne(ci(D,k)),pe=>Z(pe)),Gl=(y,k,D,P)=>{const Z=_f(y),ne=Ae.hasColumns(y)?Ar(y):Z,pe=[ge.some(Pc.edge(k))].concat(xt(Pc.positions(Z,k),Fe=>Fe.map(ot=>ot.x))),Ee=X(Pl);return xt(ne,(Fe,ot)=>nh(Fe,ot,pe,Ee,_t=>{if(Wa(_t))return D(_t);{const fn=Lf(Z[ot],oe);return nh(fn,ot,pe,Ee,Gn=>P(ge.some(Xe(Gn))),P)}},P))},Q0=y=>y.map(k=>k+"px").getOr(""),zm=(y,k)=>Gl(y,k,$p,Q0),W1=(y,k,D)=>Gl(y,k,Va,P=>P.fold(()=>D.minCellWidth(),Z=>Z/D.pixelWidth()*100)),ja=(y,k,D)=>Gl(y,k,_a,P=>P.getOrThunk(D.minCellWidth)),ac=(y,k,D,P,Z)=>{const ne=Su(y),pe=[ge.some(D.edge(k))].concat(xt(D.positions(ne,k),Ee=>Ee.map(Fe=>Fe.y)));return xt(ne,(Ee,Fe)=>nh(Ee,Fe,pe,X(za),P,Z))},At=(y,k,D)=>ac(y,k,D,Hp,P=>P.getOrThunk(rc)),_c=(y,k,D)=>ac(y,k,D,Ll,Q0),Xc=(y,k)=>()=>$i(y)?k(y):parseFloat($f(y,"width").getOr("0")),lc=y=>{const k=Xc(y,Xe),D=F(0);return{width:k,pixelWidth:k,getWidths:(Z,ne)=>ja(Z,y,ne),getCellDelta:D,singleColumnWidth:F([0]),minCellWidth:D,setElementWidth:z,adjustTableWidth:z,isRelative:!0,label:"none"}},Au=y=>{const k=Xc(y,Fe=>parseFloat(Ca(Fe))),D=Xc(y,Xe);return{width:k,pixelWidth:D,getWidths:(Fe,ot)=>W1(Fe,y,ot),getCellDelta:Fe=>Fe/D()*100,singleColumnWidth:(Fe,ot)=>[100-Fe],minCellWidth:()=>zi()/D()*100,setElementWidth:th,adjustTableWidth:Fe=>{const ot=k(),_t=Fe/100*ot,fn=ot+_t;th(y,fn)},isRelative:!0,label:"percent"}},Za=y=>{const k=Xc(y,Xe);return{width:k,pixelWidth:k,getWidths:(pe,Ee)=>ja(pe,y,Ee),getCellDelta:oe,singleColumnWidth:(pe,Ee)=>[Math.max(zi(),pe+Ee)-pe],minCellWidth:zi,setElementWidth:Sd,adjustTableWidth:pe=>{const Ee=k()+pe;Sd(y,Ee)},isRelative:!1,label:"pixel"}},qa=(y,k)=>Zf().exec(k)!==null?Au(y):Za(y),Jc={getTableSize:y=>Cl(y).fold(()=>lc(y),D=>qa(y,D)),pixelSize:Za,percentageSize:Au,noneSize:lc},eb=(y,k,D,P,Z,ne)=>({minRow:y,minCol:k,maxRow:D,maxCol:P,allCells:Z,selectedCells:ne}),$o=(y,k)=>{const D=y.grid.columns;let Z=y.grid.rows,ne=D,pe=0,Ee=0;const Fe=[],ot=[];return vn(y.access,_t=>{if(Fe.push(_t),k(_t)){ot.push(_t);const fn=_t.row,Gn=fn+_t.rowspan-1,Un=_t.column,tn=Un+_t.colspan-1;fn<Z?Z=fn:Gn>pe&&(pe=Gn),Un<ne?ne=Un:tn>Ee&&(Ee=tn)}}),eb(Z,ne,pe,Ee,Fe,ot)},$=(y,k,D)=>{const P=y[D].element,Z=it.fromTag("td");Tr(Z,it.fromTag("br")),(k?Tr:Aa)(P,Z)},G=(y,k,D,P)=>{const Z=kt(y,Ee=>Ee.section!=="colgroup"),ne=k.grid.columns,pe=k.grid.rows;for(let Ee=0;Ee<pe;Ee++){let Fe=!1;for(let ot=0;ot<ne;ot++)Ee<D.minRow||Ee>D.maxRow||ot<D.minCol||ot>D.maxCol||(Ae.getAt(k,Ee,ot).filter(P).isNone()?$(Z,Fe,Ee):Fe=!0)}},ve=(y,k,D,P)=>{vn(D.columns,pe=>{(pe.column<k.minCol||pe.column>k.maxCol)&&Yi(pe.element)});const Z=kt(zf(y,"tr"),pe=>pe.dom.childElementCount===0);He(Z,Yi),(k.minCol===k.maxCol||k.minRow===k.maxRow)&&He(zf(y,"th,td"),pe=>{Ge(pe,"rowspan"),Ge(pe,"colspan")}),Ge(y,Fm),Ge(y,"data-snooker-col-series"),Jc.getTableSize(y).adjustTableWidth(P)},De=(y,k,D,P)=>{if(P.minCol===0&&k.grid.columns===P.maxCol+1)return 0;const Z=ja(k,y,D),ne=qe(Z,(ot,_t)=>ot+_t,0),Fe=qe(Z.slice(P.minCol,P.maxCol+1),(ot,_t)=>ot+_t,0)/ne*D.pixelWidth()-D.pixelWidth();return D.getCellDelta(Fe)},at=(y,k)=>{const D=Gn=>Zo(Gn.element,k),P=Mc(y),Z=Nc(P),ne=Jc.getTableSize(y),pe=Ae.generate(Z),Ee=$o(pe,D),Fe="th:not("+k+"),td:not("+k+")",ot=Zd(P,"th,td",Gn=>Zo(Gn,Fe));He(ot,Yi),G(Z,pe,Ee,D);const _t=Ae.fromTable(y),fn=De(y,_t,ne,Ee);return ve(P,Ee,pe,fn),P},Ft="\xA0",Ln=((y,k)=>{const D=ne=>{if(!y(ne))throw new Error("Can only get "+k+" value of a "+k+" node");return P(ne).getOr("")},P=ne=>y(ne)?ge.from(ne.dom.nodeValue):ge.none();return{get:D,getOption:P,set:(ne,pe)=>{if(!y(ne))throw new Error("Can only set raw "+k+" value of a "+k+" node");ne.dom.nodeValue=pe}}})(_o,"text"),jo=y=>Ln.get(y),Qo=y=>Ln.getOption(y),vi=(y,k)=>Ln.set(y,k),tr=y=>Wt(y)==="img"?1:Qo(y).fold(()=>pr(y).length,k=>k.length),vr=y=>Qo(y).filter(k=>k.trim().length!==0||k.indexOf(Ft)>-1).isSome(),Bc=y=>un(y)&&mi(y,"contenteditable")==="false",Qc=["img","br"],Gu=y=>vr(y)||ut(Qc,Wt(y))||Bc(y),kf=y=>ni(y,Gu),oh=y=>sh(y,Gu),sh=(y,k)=>{const D=P=>{const Z=pr(P);for(let ne=Z.length-1;ne>=0;ne--){const pe=Z[ne];if(k(pe))return ge.some(pe);const Ee=D(pe);if(Ee.isSome())return Ee}return ge.none()};return D(y)},lr={scope:["row","col"]},Um=y=>()=>{const k=it.fromTag("td",y.dom);return Tr(k,it.fromTag("br",y.dom)),k},Wm=y=>()=>it.fromTag("col",y.dom),ea=y=>()=>it.fromTag("colgroup",y.dom),eu=y=>()=>it.fromTag("tr",y.dom),zp=(y,k,D)=>{const P=gd(y,k);return vn(D,(Z,ne)=>{Z===null?Ge(P,ne):Ur(P,ne,Z)}),P},jm=y=>y,Os=(y,k,D)=>kf(y).map(Z=>{const ne=D.join(","),pe=Jo(Z,ne,Ee=>ur(Ee,y));return bn(pe,(Ee,Fe)=>{const ot=Ha(Fe);return Tr(Ee,ot),ot},k)}).getOr(k),Br=(y,k)=>{vn(lr,(D,P)=>Ke(y,P).filter(Z=>ut(D,Z)).each(Z=>Ur(k,P,Z)))},Da=(y,k,D)=>{const P=(pe,Ee)=>{vf(pe.element,Ee),yc(Ee,"height"),pe.colspan!==1&&yc(Ee,"width")},Z=pe=>{const Ee=it.fromTag(Wt(pe.element),k.dom),Fe=D.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),ot=Fe.length>0?Os(pe.element,Ee,Fe):Ee;return Tr(ot,it.fromTag("br")),P(pe,Ee),Br(pe.element,Ee),y(pe.element,Ee),Ee};return{col:pe=>{const Ee=it.fromTag(Wt(pe.element),k.dom);return P(pe,Ee),y(pe.element,Ee),Ee},colgroup:ea(k),row:eu(k),cell:Z,replace:zp,colGap:Wm(k),gap:Um(k)}},cc=y=>({col:Wm(y),colgroup:ea(y),row:eu(y),cell:Um(y),replace:jm,colGap:Wm(y),gap:Um(y)}),j1=(y,k)=>{const P=(k||document).createElement("div");return P.innerHTML=y,pr(it.fromDom(P))},Sl=y=>xt(y,it.fromDom),Gi=y=>k=>k.options.get(y),tu="100%",Ef=y=>{var k;const D=y.dom,P=(k=D.getParent(y.selection.getStart(),D.isBlock))!==null&&k!==void 0?k:y.getBody();return On(it.fromDom(P))+"px"},F_=(y,k)=>Gm(y)||!Ku(y)?k:qm(y)?{...k,width:Ef(y)}:{...k,width:tu},Kh=(y,k)=>Gm(y)||Ku(y)?k:qm(y)?{...k,width:Ef(y)}:{...k,width:tu},Wg=y=>{const k=y.options.register;k("table_clone_elements",{processor:"string[]"}),k("table_use_colgroups",{processor:"boolean",default:!0}),k("table_header_type",{processor:D=>{const P=ut(["section","cells","sectionCells","auto"],D);return P?{value:D,valid:P}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),k("table_sizing_mode",{processor:"string",default:"auto"}),k("table_default_attributes",{processor:"object",default:{border:"1"}}),k("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),k("table_column_resizing",{processor:D=>{const P=ut(["preservetable","resizetable"],D);return P?{value:D,valid:P}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),k("table_resize_bars",{processor:"boolean",default:!0}),k("table_style_by_css",{processor:"boolean",default:!0}),k("table_merge_content_on_paste",{processor:"boolean",default:!0})},Yh=y=>ge.from(y.options.get("table_clone_elements")),Zm=y=>{const k=y.options.get("object_resizing");return ut(k.split(","),"table")},jg=Gi("table_header_type"),tb=Gi("table_column_resizing"),Xh=y=>tb(y)==="preservetable",Oa=y=>tb(y)==="resizetable",rh=Gi("table_sizing_mode"),Ed=y=>rh(y)==="relative",qm=y=>rh(y)==="fixed",Gm=y=>rh(y)==="responsive",Jh=Gi("table_resize_bars"),Ku=Gi("table_style_by_css"),nb=Gi("table_merge_content_on_paste"),Z1=y=>{const k=y.options,D=k.get("table_default_attributes");return k.isSet("table_default_attributes")?D:Kh(y,D)},H_=y=>{const k=y.options,D=k.get("table_default_styles");return k.isSet("table_default_styles")?D:F_(y,D)},Ma=Gi("table_use_colgroups"),Zg=y=>Ai(y,"[contenteditable]"),Km=(y,k=!1)=>$i(y)?y.dom.isContentEditable:Zg(y).fold(F(k),D=>nu(D)==="true"),nu=y=>y.dom.contentEditable,Af=y=>it.fromDom(y.getBody()),Ym=y=>k=>ur(k,Af(y)),ih=y=>{Ge(y,"data-mce-style");const k=D=>Ge(D,"data-mce-style");He(Il(y),k),He(Im(y),k),He(yf(y),k)},xu=y=>it.fromDom(y.selection.getStart()),Ad=y=>y.getBoundingClientRect().width,Xm=y=>y.getBoundingClientRect().height,ob=(y,k)=>{const D=y.dom.getStyle(k,"width")||y.dom.getAttrib(k,"width");return ge.from(D).filter(jd)},Cv=y=>/^(\d+(\.\d+)?)%$/.test(y),Sv=y=>/^(\d+(\.\d+)?)px$/.test(y),ah=y=>Nl(y,Ir("table")).exists(Km),qg=(y,k)=>{const D=k.column,P=k.column+k.colspan-1,Z=k.row,ne=k.row+k.rowspan-1;return D<=y.finishCol&&P>=y.startCol&&Z<=y.finishRow&&ne>=y.startRow},kv=(y,k)=>k.column>=y.startCol&&k.column+k.colspan-1<=y.finishCol&&k.row>=y.startRow&&k.row+k.rowspan-1<=y.finishRow,Jm=(y,k)=>{let D=!0;const P=se(kv,k);for(let Z=k.startRow;Z<=k.finishRow;Z++)for(let ne=k.startCol;ne<=k.finishCol;ne++)D=D&&Ae.getAt(y,Z,ne).exists(P);return D?ge.some(k):ge.none()},Ev=(y,k)=>Ro(Math.min(y.row,k.row),Math.min(y.column,k.column),Math.max(y.row+y.rowspan-1,k.row+k.rowspan-1),Math.max(y.column+y.colspan-1,k.column+k.colspan-1)),nr=(y,k,D)=>{const P=Ae.findItem(y,k,ur),Z=Ae.findItem(y,D,ur);return P.bind(ne=>Z.map(pe=>Ev(ne,pe)))},Do=(y,k,D)=>nr(y,k,D).bind(P=>Jm(y,P)),lh=(y,k,D,P)=>Ae.findItem(y,k,ur).bind(Z=>{const ne=D>0?Z.row+Z.rowspan-1:Z.row,pe=P>0?Z.column+Z.colspan-1:Z.column;return Ae.getAt(y,ne+D,pe+P).map(Fe=>Fe.element)}),q1=(y,k,D)=>nr(y,k,D).map(P=>{const Z=Ae.filterItems(y,se(qg,P));return xt(Z,ne=>ne.element)}),Gg=(y,k)=>{const D=(P,Z)=>Dc(Z,P);return Ae.findItem(y,k,D).map(P=>P.element)},Tk=(y,k,D)=>tl(y).bind(P=>{const Z=G1(P);return lh(Z,y,k,D)}),Av=(y,k,D)=>{const P=G1(y);return q1(P,k,D)},ri=(y,k,D,P,Z)=>{const ne=G1(y),pe=ur(y,D)?ge.some(k):Gg(ne,k),Ee=ur(y,Z)?ge.some(P):Gg(ne,P);return pe.bind(Fe=>Ee.bind(ot=>q1(ne,Fe,ot)))},xv=(y,k,D)=>{const P=G1(y);return Do(P,k,D)},G1=Ae.fromTable;var g2=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],en=()=>{const y=ot=>it.fromDom(ot.dom.cloneNode(!1)),k=ot=>fa(ot).dom,D=ot=>ns(ot)?Wt(ot)==="body"?!0:ut(g2,Wt(ot)):!1,P=ot=>ns(ot)?ut(["br","img","hr","input"],Wt(ot)):!1,Z=ot=>ns(ot)&&mi(ot,"contenteditable")==="false",ne=(ot,_t)=>ot.dom.compareDocumentPosition(_t.dom),pe=(ot,_t)=>{const fn=It(ot);Fi(_t,fn)},Ee=ot=>{const _t=Wt(ot);return ut(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],_t)},Fe=ot=>ns(ot)?Ke(ot,"lang"):ge.none();return{up:F({selector:bf,closest:Ai,predicate:qr,all:pc}),down:F({selector:gi,predicate:Fn}),styles:F({get:el,getRaw:$f,set:xi,remove:yc}),attrs:F({get:mi,set:Ur,remove:Ge,copyTo:pe}),insert:F({before:qc,after:Vl,afterAll:kr,append:Tr,appendAll:Fa,prepend:Aa,wrap:gf}),remove:F({unwrap:bu,remove:Yi}),create:F({nu:it.fromTag,clone:y,text:it.fromText}),query:F({comparePosition:ne,prevSibling:Zc,nextSibling:gu}),property:F({children:pr,name:Wt,parent:Ki,document:k,isText:_o,isComment:po,isElement:ns,isSpecial:Ee,getLanguage:Fe,getText:jo,setText:vi,isBoundary:D,isEmptyTag:P,isNonEditable:Z}),eq:ur,is:gc}};const xd=(y,k,D,P)=>{const Z=D[0],ne=D.slice(1);return P(y,k,Z,ne)},$_=(y,k,D)=>D.length>0?xd(y,k,D,sb):ge.none(),sb=(y,k,D,P)=>{const Z=k(y,D);return bn(P,(ne,pe)=>{const Ee=k(y,pe);return Dk(y,ne,Ee)},Z)},Dk=(y,k,D)=>k.bind(P=>D.filter(se(y.eq,P))),Qm=(y,k)=>se(y.eq,k),p2=(y,k,D,P=Te)=>{const Z=[k].concat(y.up().all(k)),ne=[D].concat(y.up().all(D)),pe=_t=>No(_t,P).fold(()=>_t,Gn=>_t.slice(0,Gn+1)),Ee=pe(Z),Fe=pe(ne),ot=de(Ee,_t=>et(Fe,Qm(y,_t)));return{firstpath:Ee,secondpath:Fe,shared:ot}},Qh=$_,Td=p2,eg=en(),yi=(y,k)=>Qh(eg,(D,P)=>y(P),k),Dd=(y,k,D)=>Td(eg,y,k,D),Od=y=>bf(y,"table"),ou=(y,k,D)=>{const P=Z=>ne=>D!==void 0&&D(ne)||ur(ne,Z);return ur(y,k)?ge.some({boxes:ge.some([y]),start:y,finish:k}):Od(y).bind(Z=>Od(k).bind(ne=>{if(ur(Z,ne))return ge.some({boxes:Av(Z,y,k),start:y,finish:k});if(Dc(Z,ne)){const pe=Jo(k,"td,th",P(Z)),Ee=pe.length>0?pe[pe.length-1]:k;return ge.some({boxes:ri(Z,y,Z,k,ne),start:y,finish:Ee})}else if(Dc(ne,Z)){const pe=Jo(y,"td,th",P(ne)),Ee=pe.length>0?pe[pe.length-1]:y;return ge.some({boxes:ri(ne,y,Z,k,ne),start:y,finish:Ee})}else return Dd(y,k).shared.bind(pe=>Ai(pe,"table",D).bind(Ee=>{const Fe=Jo(k,"td,th",P(Ee)),ot=Fe.length>0?Fe[Fe.length-1]:k,_t=Jo(y,"td,th",P(Ee)),fn=_t.length>0?_t[_t.length-1]:y;return ge.some({boxes:ri(Ee,y,Z,k,ne),start:fn,finish:ot})}))}))},Hs=(y,k)=>{const D=gi(y,k);return D.length>0?ge.some(D):ge.none()},Vp=(y,k)=>de(y,D=>Zo(D,k)),ch=(y,k,D)=>Kc(y,k).bind(P=>Kc(y,D).bind(Z=>yi(Od,[P,Z]).map(ne=>({first:P,last:Z,table:ne})))),Kg=(y,k)=>bf(y,"table").bind(D=>Kc(D,k).bind(P=>ou(P,y).bind(Z=>Z.boxes.map(ne=>({boxes:ne,start:Z.start,finish:Z.finish}))))),Ok=(y,k,D,P,Z)=>Vp(y,Z).bind(ne=>Tk(ne,k,D).bind(pe=>Kg(pe,P))),rb=(y,k)=>Hs(y,k),Tv=(y,k,D)=>ch(y,k,D).bind(P=>{const Z=Fe=>ur(y,Fe),ne="thead,tfoot,tbody,table",pe=bf(P.first,ne,Z),Ee=bf(P.last,ne,Z);return pe.bind(Fe=>Ee.bind(ot=>ur(Fe,ot)?xv(P.table,P.first,P.last):ge.none()))}),kl=oe,o3=y=>{const k=(P,Z)=>Ke(P,Z).exists(ne=>parseInt(ne,10)>1),D=P=>k(P,"rowspan")||k(P,"colspan");return y.length>0&&ao(y,D)?ge.some(y):ge.none()},Yg=(y,k,D)=>k.length<=1?ge.none():Tv(y,D.firstSelectedSelector,D.lastSelectedSelector).map(P=>({bounds:P,cells:k})),El="data-mce-selected",b2="td["+El+"],th["+El+"]",ro="["+El+"]",v2="data-mce-first-selected",Mk="td["+v2+"],th["+v2+"]",y2="data-mce-last-selected",em="td["+y2+"],th["+y2+"]",Yu=ro,uh={selected:El,selectedSelector:b2,firstSelected:v2,firstSelectedSelector:Mk,lastSelected:y2,lastSelectedSelector:em},Xg=(y,k,D)=>({element:D,mergable:Yg(k,y,uh),unmergable:o3(y),selection:kl(y)}),fh=(y,k,D)=>({element:y,clipboard:k,generators:D}),ib=(y,k,D,P)=>({selection:kl(y),clipboard:D,generators:P}),xf=y=>tl(y).bind(k=>rb(k,uh.firstSelectedSelector)).fold(F(y),k=>k[0]),Jg=y=>(k,D)=>{const P=Wt(k),Z=P==="col"||P==="colgroup"?xf(k):k;return Ai(Z,y,D)},w2=Jg("th,td,caption"),Up=Jg("th,td"),Gf=y=>Sl(y.model.table.getSelectedCells()),_2=y=>kt(Gf(y),k=>Zo(k,uh.selectedSelector)),dh=y=>tl(y[0]).map(k=>{const D=at(k,Yu);return ih(D),[D]}),Dv=(y,k)=>xt(k,D=>y.selection.serializer.serialize(D.dom,{})).join(""),z_=y=>xt(y,k=>k.dom.innerText).join(""),C2=(y,k)=>{y.on("BeforeGetContent",D=>{const P=Z=>{D.preventDefault(),dh(Z).each(ne=>{D.content=D.format==="text"?z_(ne):Dv(y,ne)})};if(D.selection===!0){const Z=_2(y);Z.length>=1&&P(Z)}}),y.on("BeforeSetContent",D=>{if(D.selection===!0&&D.paste===!0){const P=Gf(y);Be(P).each(Z=>{tl(Z).each(ne=>{const pe=kt(j1(D.content),Fe=>Wt(Fe)!=="meta"),Ee=Ir("table");if(nb(y)&&pe.length===1&&Ee(pe[0])){D.preventDefault();const Fe=it.fromDom(y.getDoc()),ot=cc(Fe),_t=fh(Z,pe[0],ot);k.pasteCells(ne,_t).each(()=>{y.focus()})}})})}})},Qg=(y,k)=>({element:y,offset:k}),Tf=(y,k,D)=>y.property().isText(k)&&y.property().getText(k).trim().length===0||y.property().isComment(k)?D(k).bind(P=>Tf(y,P,D).orThunk(()=>ge.some(P))):ge.none(),su=(y,k)=>y.property().isText(k)?y.property().getText(k).length:y.property().children(k).length,ep=(y,k)=>{const D=Tf(y,k,y.query().prevSibling).getOr(k);if(y.property().isText(D))return Qg(D,su(y,D));const P=y.property().children(D);return P.length>0?ep(y,P[P.length-1]):Qg(D,su(y,D))},S2=ep,V_=en(),ab=y=>S2(V_,y),Lc=(y,k)=>{Pl(y)||Qt(y).each(P=>{const Z=P.value/2;Gr(y,Z,P.unit),Gr(k,Z,P.unit)})},lb=y=>xt(y,F(0)),Xu=(y,k,D,P,Z)=>Z(y.slice(0,k)).concat(P).concat(Z(y.slice(D))),tp=y=>(k,D,P,Z)=>{if(y(P)){const ne=Math.max(Z,k[D]-Math.abs(P)),pe=Math.abs(ne-k[D]);return P>=0?pe:-pe}else return P},tm=tp(y=>y<0),Ov=tp(_e),U_=()=>{const y=(Ee,Fe,ot,_t,fn)=>{const Gn=tm(Ee,Fe,_t,fn);return Xu(Ee,Fe,ot+1,[Gn,0],lb)},k=(Ee,Fe,ot,_t)=>{const fn=(100+ot)/100,Gn=Math.max(_t,(Ee[Fe]+ot)/fn);return xt(Ee,(Un,tn)=>(tn===Fe?Gn:Un/fn)-Un)},D=(Ee,Fe,ot,_t,fn,Gn)=>Gn?k(Ee,Fe,_t,fn):y(Ee,Fe,ot,_t,fn);return{resizeTable:(Ee,Fe)=>Ee(Fe),clampTableDelta:tm,calcLeftEdgeDeltas:D,calcMiddleDeltas:(Ee,Fe,ot,_t,fn,Gn,Un)=>D(Ee,ot,_t,fn,Gn,Un),calcRightEdgeDeltas:(Ee,Fe,ot,_t,fn,Gn)=>{if(Gn)return k(Ee,ot,_t,fn);{const Un=tm(Ee,ot,_t,fn);return lb(Ee.slice(0,ot)).concat([Un])}},calcRedestributedWidths:(Ee,Fe,ot,_t)=>{if(_t){const Gn=(Fe+ot)/Fe,Un=xt(Ee,tn=>tn/Gn);return{delta:Gn*100-100,newSizes:Un}}else return{delta:ot,newSizes:Ee}}}},Wp=()=>{const y=(pe,Ee,Fe,ot,_t)=>{const fn=ot>=0?Fe:Ee,Gn=Ov(pe,fn,ot,_t);return Xu(pe,Ee,Fe+1,[Gn,-Gn],lb)};return{resizeTable:(pe,Ee,Fe)=>{Fe&&pe(Ee)},clampTableDelta:(pe,Ee,Fe,ot,_t)=>{if(_t){if(Fe>=0)return Fe;{const fn=qe(pe,(Gn,Un)=>Gn+Un-ot,0);return Math.max(-fn,Fe)}}else return tm(pe,Ee,Fe,ot)},calcLeftEdgeDeltas:y,calcMiddleDeltas:(pe,Ee,Fe,ot,_t,fn)=>y(pe,Fe,ot,_t,fn),calcRightEdgeDeltas:(pe,Ee,Fe,ot,_t,fn)=>{if(fn)return lb(pe);{const Gn=ot/pe.length;return xt(pe,F(Gn))}},calcRedestributedWidths:(pe,Ee,Fe,ot)=>({delta:0,newSizes:pe})}},k2=y=>Ae.fromTable(y).grid,np=Ir("th"),cb=y=>ao(y,k=>np(k.element)),K1=(y,k)=>y&&k?"sectionCells":y?"section":"cells",E2=y=>{const k=y.section==="thead",D=sc(A2(y.cells),"th");return y.section==="tfoot"?{type:"footer"}:k||D?{type:"header",subType:K1(k,D)}:{type:"body"}},A2=y=>{const k=kt(y,D=>np(D.element));return k.length===0?ge.some("td"):k.length===y.length?ge.some("th"):ge.none()},W_=y=>{const k=xt(y,Z=>E2(Z).type),D=ut(k,"header"),P=ut(k,"footer");if(!D&&!P)return ge.some("body");{const Z=ut(k,"body");return D&&!Z&&!P?ge.some("header"):!D&&!Z&&P?ge.some("footer"):ge.none()}},Rk=y=>gn(y.all,k=>{const D=E2(k);return D.type==="header"?ge.from(D.subType):ge.none()}),Lr=(y,k,D)=>Pt(D(y.element,k),!0,y.isLocked),Mv=(y,k)=>y.section!==k?yn(y.element,y.cells,k,y.isNew):y,x2=()=>({transformRow:Mv,transformCell:(y,k,D)=>{const P=D(y.element,k),Z=Wt(P)!=="td"?Bf(P,"td"):P;return Pt(Z,y.isNew,y.isLocked)}}),T2=()=>({transformRow:Mv,transformCell:Lr}),ub=()=>({transformRow:(y,k)=>Mv(y,k==="thead"?"tbody":k),transformCell:Lr}),Ga={getTableSectionType:(y,k)=>{const D=Ae.fromTable(y);switch(Rk(D).getOr(k)){case"section":return x2();case"sectionCells":return T2();case"cells":return ub()}},section:x2,sectionCells:T2,cells:ub,fallback:()=>({transformRow:oe,transformCell:Lr})},fb=(y,k,D,P)=>{D===P?Ge(y,k):Ur(y,k,D)},Y1=(y,k,D)=>{Ut(so(y,k)).fold(()=>Aa(y,D),P=>Vl(P,D))},j_=(y,k)=>{const D=Ss(y,k).getOrThunk(()=>{const P=it.fromTag(k,Ja(y).dom);return k==="thead"?Y1(y,"caption,colgroup",P):k==="colgroup"?Y1(y,"caption",P):Tr(y,P),P});return sa(D),D},db=(y,k)=>{const D=[],P=[],Z=Un=>xt(Un,tn=>{tn.isNew&&D.push(tn.element);const Wn=tn.element;return sa(Wn),He(tn.cells,Jt=>{Jt.isNew&&P.push(Jt.element),fb(Jt.element,"colspan",Jt.colspan,1),fb(Jt.element,"rowspan",Jt.rowspan,1),Tr(Wn,Jt.element)}),Wn}),ne=Un=>Bn(Un,tn=>xt(tn.cells,Wn=>(fb(Wn.element,"span",Wn.colspan,1),Wn.element))),pe=(Un,tn)=>{const Wn=j_(y,tn),mo=(tn==="colgroup"?ne:Z)(Un);Fa(Wn,mo)},Ee=Un=>{Ss(y,Un).each(Yi)},Fe=(Un,tn)=>{Un.length>0?pe(Un,tn):Ee(tn)},ot=[],_t=[],fn=[],Gn=[];return He(k,Un=>{switch(Un.section){case"thead":ot.push(Un);break;case"tbody":_t.push(Un);break;case"tfoot":fn.push(Un);break;case"colgroup":Gn.push(Un);break}}),Fe(Gn,"colgroup"),Fe(ot,"thead"),Fe(_t,"tbody"),Fe(fn,"tfoot"),{newRows:D,newCells:P}},D2=y=>xt(y,k=>{const D=Ha(k.element);return He(k.cells,P=>{const Z=Mc(P.element);fb(Z,"colspan",P.colspan,1),fb(Z,"rowspan",P.rowspan,1),Tr(D,Z)}),D}),Ra=(y,k)=>xt(y,D=>ra(D,k)),hh=(y,k)=>y[k],ma=(y,k)=>{if(y.length===0)return 0;const D=y[0];return No(y,Z=>!k(D.element,Z.element)).getOr(y.length)},Ju=(y,k,D,P)=>{const Z=hh(y,k),ne=Z.section==="colgroup",pe=ma(Z.cells.slice(D),P),Ee=ne?1:ma(Ra(y.slice(k),D),P);return{colspan:pe,rowspan:Ee}},tg=(y,k)=>{const D=xt(y,Z=>xt(Z.cells,Te)),P=(Z,ne,pe,Ee)=>{for(let Fe=Z;Fe<Z+pe;Fe++)for(let ot=ne;ot<ne+Ee;ot++)D[Fe][ot]=!0};return xt(y,(Z,ne)=>{const pe=Bn(Z.cells,(Ee,Fe)=>{if(D[ne][Fe]===!1){const ot=Ju(y,ne,Fe,k);return P(ne,Fe,ot.rowspan,ot.colspan),[pd(Ee.element,ot.rowspan,ot.colspan,Ee.isNew)]}else return[]});return pt(Z.element,pe,Z.section,Z.isNew)})},Fc=(y,k,D)=>{const P=[];He(y.colgroups,Z=>{const ne=[];for(let pe=0;pe<y.grid.columns;pe++){const Ee=Ae.getColumnAt(y,pe).map(Fe=>Pt(Fe.element,D,!1)).getOrThunk(()=>Pt(k.colGap(),!0,!1));ne.push(Ee)}P.push(yn(Z.element,ne,"colgroup",D))});for(let Z=0;Z<y.grid.rows;Z++){const ne=[];for(let Fe=0;Fe<y.grid.columns;Fe++){const ot=Ae.getAt(y,Z,Fe).map(_t=>Pt(_t.element,D,_t.isLocked)).getOrThunk(()=>Pt(k.gap(),!0,!1));ne.push(ot)}const pe=y.all[Z],Ee=yn(pe.element,ne,pe.section,D);P.push(Ee)}return P},Pk=(y,k)=>Fc(y,k,!1),O2=y=>tg(y,ur),Kf=(y,k)=>gn(y.all,D=>de(D.cells,P=>ur(k,P.element))),Na=(y,k,D)=>{const P=xt(k.selection,ne=>Pm(ne).bind(pe=>Kf(y,pe)).filter(D)),Z=Mi(P);return da(Z.length>0,Z)},Sa=(y,k,D,P,Z)=>(ne,pe,Ee,Fe)=>{const ot=Ae.fromTable(ne),_t=ge.from(Fe==null?void 0:Fe.section).getOrThunk(Ga.fallback);return k(ot,pe).map(Gn=>{const Un=Pk(ot,Ee),tn=y(Un,Gn,ur,Z(Ee),_t),Wn=wa(tn.grid),Jt=O2(tn.grid);return{info:Gn,grid:Jt,cursor:tn.cursor,lockedColumns:Wn}}).bind(Gn=>{const Un=db(ne,Gn.grid),tn=ge.from(Fe==null?void 0:Fe.sizing).getOrThunk(()=>Jc.getTableSize(ne)),Wn=ge.from(Fe==null?void 0:Fe.resize).getOrThunk(Wp);return D(ne,Gn.grid,Gn.info,{sizing:tn,resize:Wn,section:_t}),P(ne),Ge(ne,Fm),Gn.lockedColumns.length>0&&Ur(ne,Fm,Gn.lockedColumns.join(",")),ge.some({cursor:Gn.cursor,newRows:Un.newRows,newCells:Un.newCells})})},Ik=(y,k)=>Pm(k.element).bind(D=>Kf(y,D).map(P=>({...P,generators:k.generators,clipboard:k.clipboard}))),mh=(y,k)=>Na(y,k,_e).map(D=>({cells:D,generators:k.generators,clipboard:k.clipboard})),hb=(y,k)=>k.mergable,Rv=(y,k)=>k.unmergable,Yf=(y,k)=>Na(y,k,_e),Qu=(y,k)=>Na(y,k,D=>!D.isLocked),jp=(y,k)=>Kf(y,k).exists(D=>!D.isLocked),X1=(y,k)=>ao(k,D=>jp(y,D)),mb=(y,k)=>hb(y,k).filter(D=>X1(y,D.cells)),gb=(y,k)=>Rv(y,k).filter(D=>X1(y,D)),Z_=(y,k,D,P)=>{const Z=Ta(y).rows;if(Z.length===0)return y;for(let ne=k.startRow;ne<=k.finishRow;ne++)for(let pe=k.startCol;pe<=k.finishCol;pe++){const Ee=Z[ne],Fe=ra(Ee,pe).isLocked;ho(Ee,pe,Pt(P(),!1,Fe))}return y},M2=(y,k,D,P)=>{const Z=Ta(y).rows;let ne=!0;for(let pe=0;pe<Z.length;pe++)for(let Ee=0;Ee<Cu(Z[0]);Ee++){const Fe=Z[pe],ot=ra(Fe,Ee),_t=ot.element,fn=D(_t,k);fn&&!ne?ho(Fe,Ee,Pt(P(),!0,ot.isLocked)):fn&&(ne=!1)}return y},Bk=(y,k)=>qe(y,(D,P)=>et(D,Z=>k(Z.element,P.element))?D:D.concat([P]),[]),q_=(y,k,D,P)=>(k>0&&k<y[0].cells.length&&He(y,Z=>{const ne=Z.cells[k-1];let pe=0;const Ee=P();for(;Z.cells.length>k+pe&&D(ne.element,Z.cells[k+pe].element);)ho(Z,k+pe,Pt(Ee,!0,Z.cells[k+pe].isLocked)),pe++}),y),G_=(y,k,D,P)=>{const Z=Ta(y).rows;if(k>0&&k<Z.length){const ne=Z[k-1].cells,pe=Bk(ne,D);He(pe,Ee=>{let Fe=ge.none();for(let ot=k;ot<Z.length;ot++)for(let _t=0;_t<Cu(Z[0]);_t++){const fn=Z[ot],Gn=ra(fn,_t);D(Gn.element,Ee.element)&&(Fe.isNone()&&(Fe=ge.some(P())),Fe.each(tn=>{ho(fn,_t,Pt(tn,!0,Gn.isLocked))}))}})}return y},R2=y=>{const k=ne=>ne(y),D=F(y),P=()=>Z,Z={tag:!0,inner:y,fold:(ne,pe)=>pe(y),isValue:_e,isError:Te,map:ne=>Nv.value(ne(y)),mapError:P,bind:k,exists:k,forall:k,getOr:D,or:P,getOrThunk:D,orThunk:P,getOrDie:D,each:ne=>{ne(y)},toOptional:()=>ge.some(y)};return Z},K_=y=>{const k=()=>D,D={tag:!1,inner:y,fold:(P,Z)=>P(y),isValue:Te,isError:_e,map:k,mapError:P=>Nv.error(P(y)),bind:k,exists:Te,forall:_e,getOr:oe,or:oe,getOrThunk:ye,orThunk:ye,getOrDie:we(String(y)),each:z,toOptional:ge.none};return D},Nv={value:R2,error:K_,fromOption:(y,k)=>y.fold(()=>K_(k),R2)},Y_=(y,k,D)=>{if(y.row>=k.length||y.column>Cu(k[0]))return Nv.error("invalid start address out of table bounds, row: "+y.row+", column: "+y.column);const P=k.slice(y.row),Z=P[0].cells.slice(y.column),ne=Cu(D[0]),pe=D.length;return Nv.value({rowDelta:P.length-pe,colDelta:Z.length-ne})},Ni=(y,k)=>{const D=Cu(y[0]),P=Cu(k[0]);return{rowDelta:0,colDelta:D-P}},Pv=(y,k)=>{const D=y.length,P=k.length;return{rowDelta:D-P,colDelta:0}},N2=(y,k,D,P)=>{const Z=k.section==="colgroup"?D.col:D.cell;return Et(y,ne=>Pt(Z(),!0,P(ne)))},X_=(y,k,D,P)=>{const Z=y[y.length-1];return y.concat(Et(k,()=>{const ne=Z.section==="colgroup"?D.colgroup:D.row,pe=Gh(Z,ne,oe),Ee=N2(pe.cells.length,pe,D,Fe=>ar(P,Fe.toString()));return Er(pe,Ee)}))},ng=(y,k,D,P)=>xt(y,Z=>{const ne=N2(k,Z,D,Te);return Yo(Z,P,ne)}),uc=(y,k,D)=>xt(y,P=>qe(D,(Z,ne)=>{const pe=N2(1,P,k,_e)[0];return os(Z,ne,pe)},P)),ru=(y,k,D)=>{const P=k.colDelta<0?ng:oe,Z=k.rowDelta<0?X_:oe,ne=wa(y),pe=Cu(y[0]),Ee=et(ne,_t=>_t===pe-1),Fe=P(y,Math.abs(k.colDelta),D,Ee?pe-1:pe),ot=wa(Fe);return Z(Fe,Math.abs(k.rowDelta),D,St(ot,_e))},J_=(y,k,D,P)=>{const Z=ra(y[k],D),ne=se(P,Z.element),pe=y[k];return y.length>1&&Cu(pe)>1&&(D>0&&ne(Ri(pe,D-1))||D<pe.cells.length-1&&ne(Ri(pe,D+1))||k>0&&ne(Ri(y[k-1],D))||k<y.length-1&&ne(Ri(y[k+1],D)))},P2=(y,k,D,P,Z,ne)=>{const pe=y.row,Ee=y.column,Fe=D.length,ot=Cu(D[0]),_t=pe+Fe,fn=Ee+ot+ne.length,Gn=St(ne,_e);for(let Un=pe;Un<_t;Un++){let tn=0;for(let Wn=Ee;Wn<fn;Wn++){if(Gn[Wn]){tn++;continue}J_(k,Un,Wn,Z)&&M2(k,Ri(k[Un],Wn),Z,P.cell);const Jt=Wn-Ee-tn,mo=ra(D[Un-pe],Jt),as=mo.element,Ts=P.replace(as);ho(k[Un],Wn,Pt(Ts,!0,mo.isLocked))}}return k},op=(y,k,D)=>{const P=Cu(k[0]),Z=Ta(k).cols.length+y.row,ne=Et(P-y.column,Ee=>Ee+y.column),pe=de(ne,Ee=>ao(D,Fe=>Fe!==Ee)).getOr(P-1);return{row:Z,column:pe}},sp=(y,k,D)=>kt(D,P=>P>=y.column&&P<=Cu(k[0])+y.column),Zp=(y,k,D,P,Z)=>{const ne=wa(k),pe=op(y,k,ne),Ee=Ta(D).rows,Fe=sp(pe,Ee,ne);return Y_(pe,k,Ee).map(_t=>{const fn={..._t,colDelta:_t.colDelta-Fe.length},Gn=ru(k,fn,P),Un=wa(Gn),tn=sp(pe,Ee,Un);return P2(pe,Gn,Ee,P,Z,tn)})},qp=(y,k,D,P,Z)=>{q_(k,y,Z,P.cell);const ne=Pv(D,k),pe=ru(D,ne,P),Ee=Pv(k,pe),Fe=ru(k,Ee,P);return xt(Fe,(ot,_t)=>Yo(ot,y,pe[_t].cells))},og=(y,k,D,P,Z)=>{G_(k,y,Z,P.cell);const ne=wa(k),pe=Ni(k,D),Ee={...pe,colDelta:pe.colDelta-ne.length},Fe=ru(k,Ee,P),{cols:ot,rows:_t}=Ta(Fe),fn=wa(Fe),Gn=Ni(D,k),Un={...Gn,colDelta:Gn.colDelta+fn.length},tn=uc(D,P,fn),Wn=ru(tn,Un,P);return[...ot,..._t.slice(0,y),...Wn,..._t.slice(y,_t.length)]},Iv=(y,k,D,P)=>Gh(y,Z=>P(Z,D),k),ta=(y,k,D,P,Z)=>{const{rows:ne,cols:pe}=Ta(y),Ee=ne.slice(0,k),Fe=ne.slice(k),ot=Iv(ne[D],(_t,fn)=>k>0&&k<ne.length&&P(Ri(ne[k-1],fn),Ri(ne[k],fn))?ra(ne[k],fn):Pt(Z(_t.element,P),!0,_t.isLocked),P,Z);return[...pe,...Ee,ot,...Fe]},ef=(y,k,D,P,Z,ne,pe)=>{if(D==="colgroup"||!P){const Ee=ra(y,Z);return Pt(pe(Ee.element,ne),!0,!1)}else return ra(y,k)},J1=(y,k,D,P,Z)=>xt(y,ne=>{const pe=k>0&&k<Cu(ne)&&P(Ri(ne,k-1),Ri(ne,k)),Ee=ef(ne,k,ne.section,pe,D,P,Z);return os(ne,k,Ee)}),Lk=(y,k)=>Bn(y,D=>{const P=D.cells,Z=bn(k,(ne,pe)=>pe>=0&&pe<ne.length?ne.slice(0,pe).concat(ne.slice(pe+1)):ne,P);return Z.length>0?[yn(D.element,Z,D.section,D.isNew)]:[]}),I2=(y,k,D)=>{const{rows:P,cols:Z}=Ta(y);return[...Z,...P.slice(0,k),...P.slice(D+1)]},Fk=(y,k,D,P)=>Ri(y[k],D)!==void 0&&k>0&&P(Ri(y[k-1],D),Ri(y[k],D)),Gp=(y,k,D)=>k>0&&D(Ri(y,k-1),Ri(y,k)),Q1=(y,k,D,P)=>Fk(y,k,D,P)||Gp(y[k],D,P),Xf=(y,k)=>ao(k,oe)&&cb(y.cells)?_e:(P,Z,ne)=>!(Wt(P.element)==="th"&&k[ne]),B2=(y,k)=>ao(k,oe)&&cb(y)?_e:(P,Z,ne)=>!(Wt(P.element)==="th"&&k[Z]),Q_=(y,k,D,P)=>{const Z=pe=>pe==="row"?za(k):Pl(k),ne=pe=>Z(pe)?`${pe}group`:pe;return y?np(k)?ne(D):null:P&&np(k)?ne(D==="row"?"col":"row"):null},eC=(y,k)=>(D,P,Z)=>ge.some(Q_(y,D.element,"col",k[Z])),Hk=(y,k)=>(D,P)=>ge.some(Q_(y,D.element,"row",k[P])),tC=(y,k,D)=>Pt(D(y.element,k),!0,y.isLocked),pb=(y,k,D,P,Z,ne,pe)=>{const Ee=Fe=>et(k,ot=>D(Fe.element,ot.element));return xt(y,(Fe,ot)=>Zl(Fe,(_t,fn)=>{if(Ee(_t)){const Gn=pe(_t,ot,fn)?Z(_t,D,P):_t;return ne(Gn,ot,fn).each(Un=>{La(Gn.element,{scope:ge.from(Un)})}),Gn}else return _t}))},bb=(y,k,D)=>Bn(y,(P,Z)=>Q1(y,Z,k,D)?[]:[ra(P,k)]),nC=(y,k,D)=>{const P=y[k];return Bn(P.cells,(Z,ne)=>Q1(y,k,ne,D)?[]:[Z])},L2=(y,k,D,P,Z)=>{const ne=Ta(y).rows,pe=Bn(k,_t=>bb(ne,_t,P)),Ee=xt(ne,_t=>cb(_t.cells)),Fe=B2(pe,Ee),ot=Hk(D,Ee);return pb(y,pe,P,Z,tC,ot,Fe)},Kp=(y,k,D,P,Z,ne,pe)=>{const{cols:Ee,rows:Fe}=Ta(y),ot=Fe[k[0]],_t=Bn(k,Jt=>nC(Fe,Jt,Z)),fn=xt(ot.cells,(Jt,mo)=>cb(bb(Fe,mo,Z))),Gn=[...Fe];He(k,Jt=>{Gn[Jt]=pe.transformRow(Fe[Jt],D)});const Un=[...Ee,...Gn],tn=Xf(ot,fn),Wn=eC(P,fn);return pb(Un,_t,Z,ne,pe.transformCell,Wn,tn)},oC=(y,k,D,P)=>{const Z=Ta(y).rows,ne=xt(k,pe=>ra(Z[pe.row],pe.column));return pb(y,ne,D,P,tC,ge.none,_e)},sg={generate:y=>{if(!g(y))throw new Error("cases must be an array");if(y.length===0)throw new Error("there must be at least one case");const k=[],D={};return He(y,(P,Z)=>{const ne=wt(P);if(ne.length!==1)throw new Error("one and only one name per case");const pe=ne[0],Ee=P[pe];if(D[pe]!==void 0)throw new Error("duplicate key detected:"+pe);if(pe==="cata")throw new Error("cannot have a case named cata (sorry)");if(!g(Ee))throw new Error("case arguments must be an array");k.push(pe),D[pe]=(...Fe)=>{const ot=Fe.length;if(ot!==Ee.length)throw new Error("Wrong number of arguments to case "+pe+". Expected "+Ee.length+" ("+Ee+"), got "+ot);return{fold:(...fn)=>{if(fn.length!==y.length)throw new Error("Wrong number of arguments to fold. Expected "+y.length+", got "+fn.length);return fn[Z].apply(null,Fe)},match:fn=>{const Gn=wt(fn);if(k.length!==Gn.length)throw new Error("Wrong number of arguments to match. Expected: "+k.join(",")+`
|
|
Actual: `+Gn.join(","));if(!ao(k,tn=>ut(Gn,tn)))throw new Error("Not all branches were specified when using match. Specified: "+Gn.join(", ")+`
|
|
Required: `+k.join(", "));return fn[pe].apply(null,Fe)},log:fn=>{console.log(fn,{constructors:k,constructor:pe,params:Fe})}}}}),D}},tf={...sg.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},e0=(y,k)=>y.length===0?tf.none():y.length===1?tf.only(0):k===0?tf.left(0,1):k===y.length-1?tf.right(k-1,k):k>0&&k<y.length-1?tf.middle(k-1,k,k+1):tf.none(),Gs=(y,k,D,P,Z)=>{const ne=y.slice(0),pe=e0(y,k),Ee=F(xt(ne,F(0))),Fe=Gn=>P.singleColumnWidth(ne[Gn],D),ot=(Gn,Un)=>Z.calcLeftEdgeDeltas(ne,Gn,Un,D,P.minCellWidth(),P.isRelative),_t=(Gn,Un,tn)=>Z.calcMiddleDeltas(ne,Gn,Un,tn,D,P.minCellWidth(),P.isRelative),fn=(Gn,Un)=>Z.calcRightEdgeDeltas(ne,Gn,Un,D,P.minCellWidth(),P.isRelative);return pe.fold(Ee,Fe,ot,_t,fn)},iu=(y,k,D)=>{let P=0;for(let Z=y;Z<k;Z++)P+=D[Z]!==void 0?D[Z]:0;return P},rg=(y,k)=>{const D=Ae.justCells(y);return xt(D,P=>{const Z=iu(P.column,P.column+P.colspan,k);return{element:P.element,width:Z,colspan:P.colspan}})},F2=(y,k)=>{const D=Ae.justColumns(y);return xt(D,(P,Z)=>({element:P.element,width:k[Z],colspan:P.colspan}))},Wi=(y,k)=>{const D=Ae.justCells(y);return xt(D,P=>{const Z=iu(P.row,P.row+P.rowspan,k);return{element:P.element,height:Z,rowspan:P.rowspan}})},H2=(y,k)=>xt(y.all,(D,P)=>({element:D.element,height:k[P]})),ig=y=>bn(y,(k,D)=>k+D,0),ga=(y,k)=>Ae.hasColumns(y)?F2(y,k):rg(y,k),om=(y,k,D)=>{const P=ga(y,k);He(P,Z=>{D.setElementWidth(Z.element,Z.width)})},Vt=(y,k,D,P,Z)=>{const ne=Ae.fromTable(y),pe=Z.getCellDelta(k),Ee=Z.getWidths(ne,Z),Fe=D===ne.grid.columns-1,ot=P.clampTableDelta(Ee,D,pe,Z.minCellWidth(),Fe),_t=Gs(Ee,D,ot,Z,P),fn=xt(_t,(Gn,Un)=>Gn+Ee[Un]);om(ne,fn,Z),P.resizeTable(Z.adjustTableWidth,ot,Fe)},vb=(y,k,D,P)=>{const Z=Ae.fromTable(y),ne=At(Z,y,P),pe=xt(ne,(_t,fn)=>D===fn?Math.max(k+_t,rc()):_t),Ee=Wi(Z,pe),Fe=H2(Z,pe);He(Fe,_t=>{Zu(_t.element,_t.height)}),He(Ee,_t=>{Zu(_t.element,_t.height)});const ot=ig(pe);Zu(y,ot)},$2=(y,k,D,P,Z)=>{const ne=Ae.generate(k),pe=P.getWidths(ne,P),Ee=P.pixelWidth(),{newSizes:Fe,delta:ot}=Z.calcRedestributedWidths(pe,Ee,D.pixelDelta,P.isRelative);om(ne,Fe,P),P.adjustTableWidth(ot)},yb=(y,k,D,P)=>{const Z=Ae.generate(k),ne=P.getWidths(Z,P);om(Z,ne,P)},gh=y=>qe(y,(D,P)=>et(D,ne=>ne.column===P.column)?D:D.concat([P]),[]).sort((D,P)=>D.column-P.column),nf=Ir("col"),t0=Ir("colgroup"),Lv=y=>Wt(y)==="tr"||t0(y),z2=y=>{const k=Dr(y,"colspan",1),D=Dr(y,"rowspan",1);return{element:y,colspan:k,rowspan:D}},Fv=(y,k=z2)=>{const D=Ee=>nf(Ee.element)?y.col(Ee):y.cell(Ee),P=Ee=>t0(Ee.element)?y.colgroup(Ee):y.row(Ee),Z=Ee=>{if(Lv(Ee))return P({element:Ee});{const Fe=Ee,ot=D(k(Fe));return ne=ge.some({item:Fe,replacement:ot}),ot}};let ne=ge.none();return{getOrInit:(Ee,Fe)=>ne.fold(()=>Z(Ee),ot=>Fe(Ee,ot.item)?ot.replacement:Z(Ee))}},wb=y=>k=>{const D=[],P=(pe,Ee)=>de(D,Fe=>Ee(Fe.item,pe)),Z=pe=>{const Ee=y==="td"?{scope:null}:{},Fe=k.replace(pe,y,Ee);return D.push({item:pe,sub:Fe}),Fe};return{replaceOrInit:(pe,Ee)=>{if(Lv(pe)||nf(pe))return pe;{const Fe=pe;return P(Fe,Ee).fold(()=>Z(Fe),ot=>Ee(pe,ot.item)?ot.sub:Z(Fe))}}}},ph=y=>Ke(y,"scope").map(k=>k.substr(0,3)),Tu={modification:Fv,transform:wb,merging:y=>({unmerge:P=>{const Z=ph(P);return Z.each(ne=>Ur(P,"scope",ne)),()=>{const ne=y.cell({element:P,colspan:1,rowspan:1});return yc(ne,"width"),yc(P,"width"),Z.each(pe=>Ur(ne,"scope",pe)),ne}},merge:P=>{const Z=()=>{const ne=Mi(xt(P,ph));if(ne.length===0)return ge.none();{const pe=ne[0],Ee=["row","col"];return et(ne,ot=>ot!==pe&&ut(Ee,ot))?ge.none():ge.from(pe)}};return yc(P[0],"width"),Z().fold(()=>Ge(P[0],"scope"),ne=>Ur(P[0],"scope",ne+"group")),F(P[0])}})},Fl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],V2=(y,k)=>{const D=y.property().name(k);return ut(["ol","ul"],D)},rp=(y,k)=>{const D=y.property().name(k);return ut(Fl,D)},sC=(y,k)=>ut(["br","img","hr","input"],y.property().name(k)),_b=en(),Xp=y=>rp(_b,y),U2=y=>V2(_b,y),Hv=y=>sC(_b,y),rC=y=>{const k=Ir("br"),D=Fe=>ao(Fe,ot=>k(ot)||_o(ot)&&jo(ot).trim().length===0),P=Fe=>Wt(Fe)==="li"||qr(Fe,U2).isSome(),Z=Fe=>gu(Fe).map(ot=>Xp(ot)?!0:Hv(ot)?Wt(ot)!=="img":!1).getOr(!1),ne=Fe=>oh(Fe).bind(ot=>{const _t=Z(ot);return Ki(ot).map(fn=>_t===!0||P(fn)||k(ot)||Xp(fn)&&!ur(Fe,fn)?[]:[it.fromTag("br")])}).getOr([]),Ee=(()=>{const Fe=Bn(y,ot=>{const _t=pr(ot);return D(_t)?[]:_t.concat(ne(ot))});return Fe.length===0?[it.fromTag("br")]:Fe})();sa(y[0]),Fa(y[0],Ee)},$v=y=>Km(y,!0),W2=y=>{Il(y).length===0&&Yi(y)},gl=(y,k)=>({grid:y,cursor:k}),Kl=y=>gn(y,k=>gn(k.cells,D=>{const P=D.element;return da($v(P),P)})),Du=(y,k,D)=>{var P,Z;const ne=Ta(y).rows;return ge.from((Z=(P=ne[k])===null||P===void 0?void 0:P.cells[D])===null||Z===void 0?void 0:Z.element).filter($v).orThunk(()=>Kl(ne))},Fr=(y,k,D)=>{const P=Du(y,k,D);return gl(y,P)},Yl=y=>qe(y,(D,P)=>et(D,ne=>ne.row===P.row)?D:D.concat([P]),[]).sort((D,P)=>D.row-P.row),Hl=(y,k,D,P)=>{const Z=k[0].row,ne=Yl(k),pe=bn(ne,(Ee,Fe)=>({grid:ta(Ee.grid,Z,Fe.row+Ee.delta,D,P.getOrInit),delta:Ee.delta+1}),{grid:y,delta:0}).grid;return Fr(pe,Z,k[0].column)},sm=(y,k,D,P)=>{const Z=Yl(k),ne=Z[Z.length-1],pe=ne.row+ne.rowspan,Ee=bn(Z,(Fe,ot)=>ta(Fe,pe,ot.row,D,P.getOrInit),y);return Fr(Ee,pe,k[0].column)},yr=(y,k,D,P)=>{const Z=k.details,ne=gh(Z),pe=ne[0].column,Ee=bn(ne,(Fe,ot)=>({grid:J1(Fe.grid,pe,ot.column+Fe.delta,D,P.getOrInit),delta:Fe.delta+1}),{grid:y,delta:0}).grid;return Fr(Ee,Z[0].row,pe)},iC=(y,k,D,P)=>{const Z=k.details,ne=Z[Z.length-1],pe=ne.column+ne.colspan,Ee=gh(Z),Fe=bn(Ee,(ot,_t)=>J1(ot,pe,_t.column,D,P.getOrInit),y);return Fr(Fe,Z[0].row,pe)},au=(y,k,D,P)=>{const Z=gh(k),ne=xt(Z,Ee=>Ee.column),pe=L2(y,ne,!0,D,P.replaceOrInit);return Fr(pe,k[0].row,k[0].column)},Al=(y,k,D,P)=>{const Z=oC(y,k,D,P.replaceOrInit);return Fr(Z,k[0].row,k[0].column)},j2=(y,k,D,P)=>{const Z=gh(k),ne=xt(Z,Ee=>Ee.column),pe=L2(y,ne,!1,D,P.replaceOrInit);return Fr(pe,k[0].row,k[0].column)},ag=(y,k,D,P)=>{const Z=oC(y,k,D,P.replaceOrInit);return Fr(Z,k[0].row,k[0].column)},fc=(y,k)=>(D,P,Z,ne,pe)=>{const Ee=Yl(P),Fe=xt(Ee,_t=>_t.row),ot=Kp(D,Fe,y,k,Z,ne.replaceOrInit,pe);return Fr(ot,P[0].row,P[0].column)},r3=fc("thead",!0),lg=fc("tbody",!1),$k=fc("tfoot",!1),zk=(y,k,D,P)=>{const Z=gh(k.details),ne=Lk(y,xt(Z,Ee=>Ee.column)),pe=ne.length>0?ne[0].cells.length-1:0;return Fr(ne,Z[0].row,Math.min(Z[0].column,pe))},Z2=(y,k,D,P)=>{const Z=Yl(k),ne=I2(y,Z[0].row,Z[Z.length-1].row),pe=ne.length>0?ne.length-1:0;return Fr(ne,Math.min(k[0].row,pe),k[0].column)},q2=(y,k,D,P)=>{const Z=k.cells;rC(Z);const ne=Z_(y,k.bounds,D,P.merge(Z));return gl(ne,ge.from(Z[0]))},rm=(y,k,D,P)=>{const ne=bn(k,(pe,Ee)=>M2(pe,Ee,D,P.unmerge(Ee)),y);return gl(ne,ge.from(k[0]))},G2=(y,k,D,P)=>{const ne=((Fe,ot)=>{const _t=Ae.fromTable(Fe);return Fc(_t,ot,!0)})(k.clipboard,k.generators),pe=pf(k.row,k.column);return Zp(pe,y,ne,k.generators,D).fold(()=>gl(y,ge.some(k.element)),Fe=>Fr(Fe,k.row,k.column))},Jp=(y,k,D)=>{const P=Uh(y,D.section),Z=Ae.generate(P);return Fc(Z,k,!0)},pl=(y,k,D,P)=>{const Z=Ta(y).rows,ne=k.cells[0].column,pe=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,pe),Fe=qp(ne,y,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},xl=(y,k,D,P)=>{const Z=Ta(y).rows,ne=k.cells[k.cells.length-1].column+k.cells[k.cells.length-1].colspan,pe=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,pe),Fe=qp(ne,y,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Tn=(y,k,D,P)=>{const Z=Ta(y).rows,ne=k.cells[0].row,pe=Z[ne],Ee=Jp(k.clipboard,k.generators,pe),Fe=og(ne,y,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Vk=(y,k,D,P)=>{const Z=Ta(y).rows,ne=k.cells[k.cells.length-1].row+k.cells[k.cells.length-1].rowspan,pe=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,pe),Fe=og(ne,y,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Xl=(y,k)=>{const D=Ae.fromTable(y);return Yf(D,k).bind(Z=>{const ne=Z[Z.length-1],pe=Z[0].column,Ee=ne.column+ne.colspan,Fe=Zn(xt(D.all,ot=>kt(ot.cells,_t=>_t.column>=pe&&_t.column<Ee)));return A2(Fe)}).getOr("")},Uk=(y,k)=>{const D=Ae.fromTable(y);return Yf(D,k).bind(A2).getOr("")},K2=(y,k)=>{const D=Ae.fromTable(y);return Yf(D,k).bind(Z=>{const ne=Z[Z.length-1],pe=Z[0].row,Ee=ne.row+ne.rowspan,Fe=D.all.slice(pe,Ee);return W_(Fe)}).getOr("")},oo=(y,k,D,P)=>yb(y,k,D,P.sizing),Cc=(y,k,D,P)=>$2(y,k,D,P.sizing,P.resize),Y2=(y,k)=>et(k,D=>D.column===0&&D.isLocked),n0=(y,k)=>et(k,D=>D.column+D.colspan>=y.grid.columns&&D.isLocked),of=(y,k)=>{const D=_f(y),P=gh(k);return qe(P,(Z,ne)=>{const Ee=D[ne.column].map(rt).getOr(0);return Z+Ee},0)},zv=y=>(k,D)=>Yf(k,D).filter(P=>!(y?Y2:n0)(k,P)).map(P=>({details:P,pixelDelta:of(k,P)})),Qp=(y,k)=>Qu(y,k).map(D=>({details:D,pixelDelta:-of(y,D)})),Df=y=>(k,D)=>mh(k,D).filter(P=>!(y?Y2:n0)(k,P.cells)),ol=Tu.transform("th"),Md=Tu.transform("td"),Rd=Sa(Hl,Yf,z,z,Tu.modification),Hc=Sa(sm,Yf,z,z,Tu.modification),o0=Sa(yr,zv(!0),Cc,z,Tu.modification),X2=Sa(iC,zv(!1),Cc,z,Tu.modification),aC=Sa(zk,Qp,Cc,W2,Tu.modification),J2=Sa(Z2,Yf,z,W2,Tu.modification),bh=Sa(au,Qu,z,z,ol),jr=Sa(j2,Qu,z,z,Md),Vv=Sa(r3,Qu,z,z,ol),Qf=Sa(lg,Qu,z,z,Md),lC=Sa($k,Qu,z,z,Md),cC=Sa(Al,Qu,z,z,ol),ia=Sa(ag,Qu,z,z,Md),Wk=Sa(q2,mb,oo,z,Tu.merging),Uv=Sa(rm,gb,oo,z,Tu.merging),Wv=Sa(G2,Ik,oo,z,Tu.modification),uC=Sa(pl,Df(!0),z,z,Tu.modification),jk=Sa(xl,Df(!1),z,z,Tu.modification),s0=Sa(Tn,mh,z,z,Tu.modification),fC=Sa(Vk,mh,z,z,Tu.modification),Zk=Xl,dC=Uk,qk=K2,hC=(y,k)=>y.dispatch("NewRow",{node:k}),jv=(y,k)=>y.dispatch("NewCell",{node:k}),ip=(y,k,D)=>{y.dispatch("TableModified",{...D,table:k})},r0=(y,k,D,P,Z)=>{y.dispatch("TableSelectionChange",{cells:k,start:D,finish:P,otherCells:Z})},ji=y=>{y.dispatch("TableSelectionClear")},Q2=(y,k,D,P,Z)=>{y.dispatch("ObjectResizeStart",{target:k,width:D,height:P,origin:Z})},Sc=(y,k,D,P,Z)=>{y.dispatch("ObjectResized",{target:k,width:D,height:P,origin:Z})},i0={structure:!1,style:!0},sl={structure:!0,style:!1},mC={structure:!0,style:!0},im=(y,k)=>Ed(y)?Jc.percentageSize(k):qm(y)?Jc.pixelSize(k):Jc.getTableSize(k),Gk=(y,k,D)=>{const P=Iu=>Wt(Af(Iu))==="table",Z=Iu=>!P(y)||k2(Iu).rows>1,ne=Iu=>!P(y)||k2(Iu).columns>1,pe=Yh(y),Ee=Oa(y)?z:Lc,Fe=Iu=>{switch(jg(y)){case"section":return Ga.section();case"sectionCells":return Ga.sectionCells();case"cells":return Ga.cells();default:return Ga.getTableSectionType(Iu,"section")}},ot=(Iu,Ow)=>Ow.cursor.fold(()=>{const Mw=Il(Iu);return Be(Mw).filter($i).map(hg=>{D.clearSelectedCells(Iu.dom);const dc=y.dom.createRng();return dc.selectNode(hg.dom),y.selection.setRng(dc),Ur(hg,"data-mce-selected","1"),dc})},Mw=>{const hg=ab(Mw),dc=y.dom.createRng();return dc.setStart(hg.element.dom,hg.offset),dc.setEnd(hg.element.dom,hg.offset),y.selection.setRng(dc),D.clearSelectedCells(Iu.dom),ge.some(dc)}),_t=(Iu,Ow,Mw,hg)=>(dc,XE,I3=!1)=>{ih(dc);const B3=it.fromDom(y.getDoc()),L3=Da(Mw,B3,pe),cM={sizing:im(y,dc),resize:Oa(y)?U_():Wp(),section:Fe(dc)};return Ow(dc)?Iu(dc,XE,L3,cM).bind(JE=>{k.refresh(dc.dom),He(JE.newRows,Rw=>{hC(y,Rw.dom)}),He(JE.newCells,Rw=>{jv(y,Rw.dom)});const uM=ot(dc,JE);return $i(dc)&&(ih(dc),I3||ip(y,dc.dom,hg)),uM.map(Rw=>({rng:Rw,effect:hg}))}):ge.none()},fn=_t(J2,Z,z,sl),Gn=_t(aC,ne,z,sl),Un=_t(Rd,_e,z,sl),tn=_t(Hc,_e,z,sl),Wn=_t(o0,_e,Ee,sl),Jt=_t(X2,_e,Ee,sl),mo=_t(Wk,_e,z,sl),as=_t(Uv,_e,z,sl),Ts=_t(uC,_e,z,sl),aa=_t(jk,_e,z,sl),Dl=_t(s0,_e,z,sl),vl=_t(fC,_e,z,sl),Nu=_t(Wv,_e,z,mC),Fb=_t(cC,_e,z,sl),Dw=_t(ia,_e,z,sl),eS=_t(bh,_e,z,sl),tS=_t(jr,_e,z,sl),_i=_t(Vv,_e,z,sl),Pu=_t(Qf,_e,z,sl),af=_t(lC,_e,z,sl);return{deleteRow:fn,deleteColumn:Gn,insertRowsBefore:Un,insertRowsAfter:tn,insertColumnsBefore:Wn,insertColumnsAfter:Jt,mergeCells:mo,unmergeCells:as,pasteColsBefore:Ts,pasteColsAfter:aa,pasteRowsBefore:Dl,pasteRowsAfter:vl,pasteCells:Nu,makeCellsHeader:Fb,unmakeCellsHeader:Dw,makeColumnsHeader:eS,unmakeColumnsHeader:tS,makeRowsHeader:_i,makeRowsBody:Pu,makeRowsFooter:af,getTableRowType:qk,getTableCellType:dC,getTableColType:Zk}},Jl=(y,k,D)=>{const P=Dr(y,k,1);D===1||P<=1?Ge(y,k):Ur(y,k,Math.min(D,P))},sf=(y,k)=>D=>{const P=D.column+D.colspan-1,Z=D.column;return P>=y&&Z<k},Cb=(y,k,D)=>{if(Ae.hasColumns(y)){const P=kt(Ae.justColumns(y),sf(k,D)),Z=xt(P,pe=>{const Ee=Mc(pe.element);return Jl(Ee,"span",D-k),Ee}),ne=it.fromTag("colgroup");return Fa(ne,Z),[ne]}else return[]},Kk=(y,k,D)=>xt(y.all,P=>{const Z=kt(P.cells,sf(k,D)),ne=xt(Z,Ee=>{const Fe=Mc(Ee.element);return Jl(Fe,"colspan",D-k),Fe}),pe=it.fromTag("tr");return Fa(pe,ne),pe}),Yk=(y,k)=>{const D=Ae.fromTable(y);return Qu(D,k).map(Z=>{const ne=Z[Z.length-1],pe=Z[0].column,Ee=ne.column+ne.colspan,Fe=Cb(D,pe,Ee),ot=Kk(D,pe,Ee);return[...Fe,...ot]})},gC=(y,k,D)=>{const P=Ae.fromTable(y);return Yf(P,k).bind(ne=>{const pe=Fc(P,D,!1),Fe=Ta(pe).rows.slice(ne[0].row,ne[ne.length-1].row+ne[ne.length-1].rowspan),ot=Bn(Fe,fn=>{const Gn=kt(fn.cells,Un=>!Un.isLocked);return Gn.length>0?[{...fn,cells:Gn}]:[]}),_t=O2(ot);return da(_t.length>0,_t)}).map(ne=>D2(ne))},Sb=sg.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),pC=(y,k,D)=>{const P=D.substring(0,D.length-y.length),Z=parseFloat(P);return P===Z.toString()?k(Z):Sb.invalid(D)},ap={...Sb,from:y=>zu(y,"%")?pC("%",Sb.percent,y):zu(y,"px")?pC("px",Sb.pixels,y):Sb.invalid(y)},Xk=(y,k)=>xt(y,D=>ap.from(D).fold(()=>D,Z=>Z/k*100+"%",Z=>Z+"%")),Jk=(y,k,D)=>{const P=D/k;return xt(y,Z=>ap.from(Z).fold(()=>Z,pe=>pe*P+"px",pe=>pe/100*D+"px"))},Qk=(y,k)=>{const D=y.fold(()=>F(""),P=>{const Z=P/k;return F(Z+"px")},()=>{const P=100/k;return F(P+"%")});return Et(k,D)},ew=(y,k,D)=>y.fold(()=>k,P=>Jk(k,D,P),P=>Xk(k,D)),Zv=(y,k,D)=>{const P=ap.from(D),Z=ao(y,ne=>ne==="0px")?Qk(P,y.length):ew(P,y,k);return qv(Z)},cg=(y,k)=>y.length===0?k:bn(y,(D,P)=>ap.from(P).fold(F(0),oe,oe)+D,0),vC=(y,k)=>{const D=Math.floor(y);return{value:D+k,remainder:y-D}},yC=(y,k)=>ap.from(y).fold(F(y),D=>D+k+"px",D=>D+k+"%"),qv=y=>{if(y.length===0)return y;const k=bn(y,(P,Z)=>{const ne=ap.from(Z).fold(()=>({value:Z,remainder:0}),pe=>vC(pe,"px"),pe=>({value:pe+"%",remainder:0}));return{output:[ne.value].concat(P.output),remainder:P.remainder+ne.remainder}},{output:[],remainder:0}),D=k.output;return D.slice(0,D.length-1).concat([yC(D[D.length-1],Math.round(k.remainder))])},a0=ap.from,ug=(y,k,D)=>{He(k,P=>{const Z=y.slice(P.column,P.colspan+P.column),ne=cg(Z,zi());xi(P.element,"width",ne+D)})},Gv=(y,k,D)=>{He(k,(P,Z)=>{const ne=cg([y[Z]],zi());xi(P.element,"width",ne+D)})},Kv=(y,k,D,P)=>{He(D,Z=>{const ne=y.slice(Z.row,Z.rowspan+Z.row),pe=cg(ne,rc());xi(Z.element,"height",pe+P)}),He(k,(Z,ne)=>{xi(Z.element,"height",y[ne])})},kb=y=>a0(y).fold(F("px"),F("px"),F("%")),wC=(y,k,D)=>{const P=Ae.fromTable(y),Z=P.all,ne=Ae.justCells(P),pe=Ae.justColumns(P);k.each(Ee=>{const Fe=kb(Ee),ot=Xe(y),_t=zm(P,y),fn=Zv(_t,ot,Ee);Ae.hasColumns(P)?Gv(fn,pe,Fe):ug(fn,ne,Fe),xi(y,"width",Ee)}),D.each(Ee=>{const Fe=kb(Ee),ot=Wf(y),_t=_c(P,y,Qn),fn=Zv(_t,ot,Ee);Kv(fn,Z,ne,Fe),xi(y,"height",Ee)})},vh=Ua,Eb=Ug,_C=Ic,yh=y=>{Ge(y,"width")},lp=y=>{const k=Ca(y);wC(y,ge.some(k),ge.none()),yh(y)},tw=y=>{const k=J0(y);wC(y,ge.some(k),ge.none()),yh(y)},CC=y=>{yc(y,"width");const k=Im(y),D=k.length>0?k:Il(y);He(D,P=>{yc(P,"width"),yh(P)}),yh(y)},Yv={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},eE=()=>it.fromTag("th"),SC=()=>it.fromTag("td"),tE=()=>it.fromTag("col"),nE=(y,k,D,P)=>{const Z=it.fromTag("tr");for(let ne=0;ne<y;ne++){const pe=P<k||ne<D?eE():SC();ne<D&&Ur(pe,"scope","row"),P<k&&Ur(pe,"scope","col"),Tr(pe,it.fromTag("br")),Tr(Z,pe)}return Z},kC=y=>{const k=it.fromTag("colgroup");return Et(y,()=>Tr(k,tE())),k},EC=(y,k,D,P)=>Et(y,Z=>nE(k,D,P,Z)),AC=(y,k,D,P,Z,ne=Yv)=>{const pe=it.fromTag("table"),Ee=Z!=="cells";_l(pe,ne.styles),Fi(pe,ne.attributes),ne.colGroups&&Tr(pe,kC(k));const Fe=Math.min(y,D);if(Ee&&D>0){const Un=it.fromTag("thead");Tr(pe,Un);const Wn=EC(D,k,Z==="sectionCells"?Fe:0,P);Fa(Un,Wn)}const ot=it.fromTag("tbody");Tr(pe,ot);const _t=Ee?y-Fe:y,Gn=EC(_t,k,Ee?0:D,P);return Fa(ot,Gn),pe},oE=y=>y.dom.innerHTML,sE=y=>{const k=it.fromTag("div"),D=it.fromDom(y.dom.cloneNode(!0));return Tr(k,D),oE(k)},rE=(y,k)=>{y.selection.select(k.dom,!0),y.selection.collapse(!0)},xC=(y,k)=>{Kc(k,"td,th").each(se(rE,y))},nw=(y,k)=>{He(gi(k,"tr"),D=>{hC(y,D.dom),He(gi(D,"th,td"),P=>{jv(y,P.dom)})})},ow=y=>f(y)&&y.indexOf("%")!==-1,iE=(y,k,D,P,Z)=>{const ne=H_(y),pe={styles:ne,attributes:Z1(y),colGroups:Ma(y)};return y.undoManager.ignore(()=>{const Ee=AC(D,k,Z,P,jg(y),pe);Ur(Ee,"data-mce-id","__mce");const Fe=sE(Ee);y.insertContent(Fe),y.addVisual()}),Kc(Af(y),'table[data-mce-id="__mce"]').map(Ee=>(qm(y)?tw(Ee):Gm(y)?CC(Ee):(Ed(y)||ow(ne.width))&&lp(Ee),ih(Ee),Ge(Ee,"data-mce-id"),nw(y,Ee),xC(y,Ee),Ee.dom)).getOrNull()},aE=(y,k,D,P={})=>{const Z=ne=>j(ne)&&ne>0;if(Z(k)&&Z(D)){const ne=P.headerRows||0,pe=P.headerColumns||0;return iE(y,D,k,pe,ne)}else return console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table."),null};var Xv=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const TC="x-tinymce/dom-table-",Jv=TC+"rows",Ab=TC+"columns",l0=y=>{const k=Xv.FakeClipboardItem(y);Xv.write([k])},Qv=y=>{var k;const D=(k=Xv.read())!==null&&k!==void 0?k:[];return gn(D,P=>ge.from(P.getType(y)))},sw=y=>{Qv(y).isSome()&&Xv.clear()},DC=y=>{y.fold(lE,k=>l0({[Jv]:k}))},rw=()=>Qv(Jv),lE=()=>sw(Jv),ey=y=>{y.fold(cE,k=>l0({[Ab]:k}))},xb=()=>Qv(Ab),cE=()=>sw(Ab),ty=y=>w2(xu(y),Ym(y)).filter(ah),rf=y=>Up(xu(y),Ym(y)).filter(ah),ny=(y,k)=>{const D=Ym(y),P=()=>ty(y).each(Jt=>{tl(Jt,D).filter(X(D)).each(mo=>{const as=it.fromText("");if(Vl(mo,as),Yi(mo),y.dom.isEmpty(y.getBody()))y.setContent(""),y.selection.setCursorLocation();else{const Ts=y.dom.createRng();Ts.setStart(as.dom,0),Ts.setEnd(as.dom,0),y.selection.setRng(Ts),y.nodeChanged()}})}),Z=Jt=>ty(y).each(mo=>{Gm(y)||qm(y)||Ed(y)||tl(mo,D).each(Ts=>{Jt==="relative"&&!vh(Ts)?lp(Ts):Jt==="fixed"&&!Eb(Ts)?tw(Ts):Jt==="responsive"&&!_C(Ts)&&CC(Ts),ih(Ts),ip(y,Ts.dom,sl)})}),ne=Jt=>tl(Jt,D),pe=Jt=>rf(y).bind(mo=>ne(mo).map(as=>Jt(as,mo))),Ee=(Jt,mo)=>{pe(as=>{y.formatter.toggle("tableclass",{value:mo},as.dom),ip(y,as.dom,i0)})},Fe=(Jt,mo)=>{pe(as=>{const Ts=Gf(y),Dl=ao(Ts,vl=>y.formatter.match("tablecellclass",{value:mo},vl.dom))?y.formatter.remove:y.formatter.apply;He(Ts,vl=>Dl("tablecellclass",{value:mo},vl.dom)),ip(y,as.dom,i0)})},ot=()=>{ty(y).each(Jt=>{tl(Jt,D).each(mo=>{Ss(mo,"caption").fold(()=>{const as=it.fromTag("caption");Tr(as,it.fromText("Caption")),Rm(mo,as,0),y.selection.setCursorLocation(as.dom,0)},as=>{Ir("caption")(Jt)&&ua("td",mo).each(Ts=>y.selection.setCursorLocation(Ts.dom,0)),Yi(as)}),ip(y,mo.dom,sl)})})},_t=Jt=>{y.focus()},fn=(Jt,mo=!1)=>pe((as,Ts)=>{const aa=Xg(Gf(y),as,Ts);Jt(as,aa,mo).each(_t)}),Gn=()=>pe((Jt,mo)=>{const as=Xg(Gf(y),Jt,mo),Ts=Da(z,it.fromDom(y.getDoc()),ge.none());return gC(Jt,as,Ts)}),Un=()=>pe((Jt,mo)=>{const as=Xg(Gf(y),Jt,mo);return Yk(Jt,as)}),tn=(Jt,mo)=>mo().each(as=>{const Ts=xt(as,aa=>Mc(aa));pe((aa,Dl)=>{const vl=cc(it.fromDom(y.getDoc())),Nu=ib(Gf(y),Dl,Ts,vl);Jt(aa,Nu).each(_t)})}),Wn=Jt=>(mo,as)=>ba(as,"type").each(Ts=>{fn(Jt(Ts),as.no_events)});vn({mceTableSplitCells:()=>fn(k.unmergeCells),mceTableMergeCells:()=>fn(k.mergeCells),mceTableInsertRowBefore:()=>fn(k.insertRowsBefore),mceTableInsertRowAfter:()=>fn(k.insertRowsAfter),mceTableInsertColBefore:()=>fn(k.insertColumnsBefore),mceTableInsertColAfter:()=>fn(k.insertColumnsAfter),mceTableDeleteCol:()=>fn(k.deleteColumn),mceTableDeleteRow:()=>fn(k.deleteRow),mceTableCutCol:()=>Un().each(Jt=>{ey(Jt),fn(k.deleteColumn)}),mceTableCutRow:()=>Gn().each(Jt=>{DC(Jt),fn(k.deleteRow)}),mceTableCopyCol:()=>Un().each(Jt=>ey(Jt)),mceTableCopyRow:()=>Gn().each(Jt=>DC(Jt)),mceTablePasteColBefore:()=>tn(k.pasteColsBefore,xb),mceTablePasteColAfter:()=>tn(k.pasteColsAfter,xb),mceTablePasteRowBefore:()=>tn(k.pasteRowsBefore,rw),mceTablePasteRowAfter:()=>tn(k.pasteRowsAfter,rw),mceTableDelete:P,mceTableCellToggleClass:Fe,mceTableToggleClass:Ee,mceTableToggleCaption:ot,mceTableSizingMode:(Jt,mo)=>Z(mo),mceTableCellType:Wn(Jt=>Jt==="th"?k.makeCellsHeader:k.unmakeCellsHeader),mceTableColType:Wn(Jt=>Jt==="th"?k.makeColumnsHeader:k.unmakeColumnsHeader),mceTableRowType:Wn(Jt=>{switch(Jt){case"header":return k.makeRowsHeader;case"footer":return k.makeRowsFooter;default:return k.makeRowsBody}})},(Jt,mo)=>y.addCommand(mo,Jt)),y.addCommand("mceInsertTable",(Jt,mo)=>{aE(y,mo.rows,mo.columns,mo.options)}),y.addCommand("mceTableApplyCellStyle",(Jt,mo)=>{const as=Dl=>"tablecell"+Dl.toLowerCase().replace("-","");if(!h(mo))return;const Ts=kt(Gf(y),ah);if(Ts.length===0)return;const aa=Rs(mo,(Dl,vl)=>y.formatter.has(as(vl))&&f(Dl));Zr(aa)||(vn(aa,(Dl,vl)=>{const Nu=as(vl);He(Ts,Fb=>{Dl===""?y.formatter.remove(Nu,{value:null},Fb.dom,!0):y.formatter.apply(Nu,{value:Dl},Fb.dom)})}),ne(Ts[0]).each(Dl=>ip(y,Dl.dom,i0)))})},OC=(y,k)=>{const D=Ym(y),P=Z=>Up(xu(y)).bind(ne=>tl(ne,D).map(pe=>{const Ee=Xg(Gf(y),pe,ne);return Z(pe,Ee)})).getOr("");vn({mceTableRowType:()=>P(k.getTableRowType),mceTableCellType:()=>P(k.getTableCellType),mceTableColType:()=>P(k.getTableColType)},(Z,ne)=>y.addQueryValueHandler(ne,Z))},oy=sg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),uE=(y,k,D,P)=>y.fold(k,D,P),Tb=y=>y.fold(oe,oe,oe),iw=oy.before,fE=oy.on,sy=oy.after,bl={before:iw,on:fE,after:sy,cata:uE,getStart:Tb},c0={create:(y,k)=>({selection:y,kill:k})},hE=(y,k)=>{const D=y.document.createRange();return D.selectNode(k.dom),D},u0=(y,k)=>{const D=y.document.createRange();return aw(D,k),D},aw=(y,k)=>y.selectNodeContents(k.dom),mE=(y,k)=>{k.fold(D=>{y.setStartBefore(D.dom)},(D,P)=>{y.setStart(D.dom,P)},D=>{y.setStartAfter(D.dom)})},gE=(y,k)=>{k.fold(D=>{y.setEndBefore(D.dom)},(D,P)=>{y.setEnd(D.dom,P)},D=>{y.setEndAfter(D.dom)})},Db=(y,k,D)=>{const P=y.document.createRange();return mE(P,k),gE(P,D),P},am=(y,k,D,P,Z)=>{const ne=y.document.createRange();return ne.setStart(k.dom,D),ne.setEnd(P.dom,Z),ne},f0=y=>({left:y.left,top:y.top,right:y.right,bottom:y.bottom,width:y.width,height:y.height}),lu=y=>{const k=y.getClientRects(),D=k.length>0?k[0]:y.getBoundingClientRect();return D.width>0||D.height>0?ge.some(D).map(f0):ge.none()},e1=sg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),MC=(y,k,D)=>k(it.fromDom(D.startContainer),D.startOffset,it.fromDom(D.endContainer),D.endOffset),RC=(y,k)=>k.match({domRange:D=>({ltr:F(D),rtl:ge.none}),relative:(D,P)=>({ltr:wf(()=>Db(y,D,P)),rtl:wf(()=>ge.some(Db(y,P,D)))}),exact:(D,P,Z,ne)=>({ltr:wf(()=>am(y,D,P,Z,ne)),rtl:wf(()=>ge.some(am(y,Z,ne,D,P)))})}),lw=(y,k)=>{const D=k.ltr();return D.collapsed?k.rtl().filter(Z=>Z.collapsed===!1).map(Z=>e1.rtl(it.fromDom(Z.endContainer),Z.endOffset,it.fromDom(Z.startContainer),Z.startOffset)).getOrThunk(()=>MC(y,e1.ltr,D)):MC(y,e1.ltr,D)},cw=(y,k)=>{const D=RC(y,k);return lw(y,D)},uw=(y,k)=>cw(y,k).match({ltr:(P,Z,ne,pe)=>{const Ee=y.document.createRange();return Ee.setStart(P.dom,Z),Ee.setEnd(ne.dom,pe),Ee},rtl:(P,Z,ne,pe)=>{const Ee=y.document.createRange();return Ee.setStart(ne.dom,pe),Ee.setEnd(P.dom,Z),Ee}});e1.ltr,e1.rtl;const Ob={create:(y,k,D,P)=>({start:y,soffset:k,finish:D,foffset:P})},cp={create:(y,k,D,P)=>({start:bl.on(y,k),finish:bl.on(D,P)})},Mb=(y,k)=>{const D=uw(y,k);return Ob.create(it.fromDom(D.startContainer),D.startOffset,it.fromDom(D.endContainer),D.endOffset)},wh=cp.create,bE=(y,k,D,P,Z,ne,pe)=>ur(D,Z)&&P===ne?ge.none():Ai(D,"td,th",k).bind(Ee=>Ai(Z,"td,th",k).bind(Fe=>lm(y,k,Ee,Fe,pe))),lm=(y,k,D,P,Z)=>ur(D,P)?ge.none():ou(D,P,k).bind(ne=>{const pe=ne.boxes.getOr([]);return pe.length>1?(Z(y,pe,ne.start,ne.finish),ge.some(c0.create(ge.some(wh(D,0,D,tr(D))),!0))):ge.none()}),Nd=(y,k,D,P,Z)=>{const ne=pe=>(Z.clearBeforeUpdate(D),Z.selectRange(D,pe.boxes,pe.start,pe.finish),pe.boxes);return Ok(P,y,k,Z.firstSelectedSelector,Z.lastSelectedSelector).map(ne)},d0=(y,k)=>({item:y,mode:k}),fw=(y,k,D,P=h0)=>y.property().parent(k).map(Z=>d0(Z,P)),h0=(y,k,D,P=fg)=>D.sibling(y,k).map(Z=>d0(Z,P)),fg=(y,k,D,P=fg)=>{const Z=y.property().children(k);return D.first(Z).map(pe=>d0(pe,P))},S=[{current:fw,next:h0,fallback:ge.none()},{current:h0,next:fg,fallback:ge.some(fw)},{current:fg,next:fg,fallback:ge.some(h0)}],T=(y,k,D,P,Z=S)=>de(Z,pe=>pe.current===D).bind(pe=>pe.current(y,k,P,pe.next).orThunk(()=>pe.fallback.bind(Ee=>T(y,k,Ee,P)))),ke={left:()=>({sibling:(D,P)=>D.query().prevSibling(P),first:D=>D.length>0?ge.some(D[D.length-1]):ge.none()}),right:()=>({sibling:(D,P)=>D.query().nextSibling(P),first:D=>D.length>0?ge.some(D[0]):ge.none()})},Ue=(y,k,D,P,Z,ne)=>T(y,k,P,Z).bind(Ee=>ne(Ee.item)?ge.none():D(Ee.item)?ge.some(Ee.item):Ue(y,Ee.item,D,Ee.mode,Z,ne)),ht=(y,k,D,P)=>Ue(y,k,D,h0,ke.left(),P),Ct=(y,k,D,P)=>Ue(y,k,D,h0,ke.right(),P),zt=y=>k=>y.property().children(k).length===0,pn=(y,k,D)=>Vn(y,k,zt(y),D),$n=(y,k,D)=>Fo(y,k,zt(y),D),Vn=ht,Fo=Ct,hs=en(),Ps=(y,k)=>pn(hs,y,k),Hr=(y,k)=>$n(hs,y,k),$s=(y,k,D)=>Vn(hs,y,k,D),fi=(y,k,D)=>Fo(hs,y,k,D),wi=(y,k,D)=>qr(y,k,D).isSome(),cu=sg.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Ou=(y,k,D)=>{const P=y.getRect(k),Z=y.getRect(D);return Z.right>P.left&&Z.left<P.right},Of=y=>Ai(y,"tr"),ed={...cu,verify:(y,k,D,P,Z,ne,pe)=>Ai(P,"td,th",pe).bind(Ee=>Ai(k,"td,th",pe).map(Fe=>ur(Ee,Fe)?ur(P,Ee)&&tr(Ee)===Z?ne(Fe):cu.none("in same cell"):yi(Of,[Ee,Fe]).fold(()=>Ou(y,Fe,Ee)?cu.success():ne(Fe),ot=>ne(Fe)))).getOr(cu.none("default")),cata:(y,k,D,P,Z)=>y.fold(k,D,P,Z)},dw=(y,k,D,P)=>({parent:y,children:k,element:D,index:P}),uu=y=>Ki(y).bind(k=>{const D=pr(k);return NC(D,y).map(P=>dw(k,D,y,P))}),NC=(y,k)=>No(y,se(ur,k)),Rb=Ir("br"),Nb=(y,k,D)=>k(y,D).bind(P=>_o(P)&&jo(P).trim().length===0?Nb(P,k,D):ge.some(P)),Pd=(y,k,D)=>D.traverse(k).orThunk(()=>Nb(k,D.gather,y)).map(D.relative),m0=(y,k)=>Qa(y,k).filter(Rb).orThunk(()=>Qa(y,k-1).filter(Rb)),vE=(y,k,D,P)=>m0(k,D).bind(Z=>P.traverse(Z).fold(()=>Nb(Z,P.gather,y).map(P.relative),ne=>uu(ne).map(pe=>bl.on(pe.parent,pe.index)))),iy=(y,k,D,P)=>(Rb(k)?Pd(y,k,P):vE(y,k,D,P)).map(ne=>({start:ne,finish:ne})),Mf=y=>ed.cata(y,k=>ge.none(),()=>ge.none(),k=>ge.some(Qg(k,0)),k=>ge.some(Qg(k,tr(k)))),Mu=(y,k)=>({left:y.left,top:y.top+k,right:y.right,bottom:y.bottom+k}),rl=(y,k)=>({left:y.left,top:y.top-k,right:y.right,bottom:y.bottom-k}),Id=(y,k,D)=>({left:y.left+k,top:y.top+D,right:y.right+k,bottom:y.bottom+D}),PC=y=>y.top,$c=y=>y.bottom,g0=(y,k,D)=>D>=0&&D<tr(k)?y.getRangedRect(k,D,k,D+1):D>0?y.getRangedRect(k,D-1,k,D):ge.none(),ay=y=>({left:y.left,top:y.top,right:y.right,bottom:y.bottom}),hw=(y,k)=>ge.some(y.getRect(k)),yE=(y,k,D)=>ns(k)?hw(y,k).map(ay):_o(k)?g0(y,k,D).map(ay):ge.none(),wE=(y,k)=>ns(k)?hw(y,k).map(ay):_o(k)?y.getRangedRect(k,0,k,tr(k)).map(ay):ge.none(),t1=5,mw=100,dg=sg.generate([{none:[]},{retry:["caret"]}]),xO=(y,k)=>y.left<k.left||Math.abs(k.right-y.left)<1||y.left>k.right,_E=(y,k,D)=>Nl(k,Xp).fold(Te,P=>wE(y,P).exists(Z=>xO(D,Z))),i3=(y,k,D,P,Z)=>{const ne=Mu(Z,t1);return Math.abs(D.bottom-P.bottom)<1||D.top>Z.bottom?dg.retry(ne):D.top===Z.bottom?dg.retry(Mu(Z,1)):_E(y,k,Z)?dg.retry(Id(ne,t1,0)):dg.none()},a3={point:PC,adjuster:(y,k,D,P,Z)=>{const ne=rl(Z,t1);return Math.abs(D.top-P.top)<1||D.bottom<Z.top?dg.retry(ne):D.bottom===Z.top?dg.retry(rl(Z,1)):_E(y,k,Z)?dg.retry(Id(ne,t1,0)):dg.none()},move:rl,gather:Ps},l3={point:$c,adjuster:i3,move:Mu,gather:Hr},CE=(y,k,D)=>y.elementFromPoint(k,D).filter(P=>Wt(P)==="table").isSome(),SE=(y,k,D,P,Z)=>kE(y,k,D,k.move(P,t1),Z),kE=(y,k,D,P,Z)=>Z===0?ge.some(P):CE(y,P.left,k.point(P))?SE(y,k,D,P,Z-1):y.situsFromPoint(P.left,k.point(P)).bind(ne=>ne.start.fold(ge.none,pe=>wE(y,pe).bind(Ee=>k.adjuster(y,pe,Ee,D,P).fold(ge.none,Fe=>kE(y,k,D,Fe,Z-1))).orThunk(()=>ge.some(P)),ge.none)),c3=(y,k,D)=>y.point(k)>D.getInnerHeight()?ge.some(y.point(k)-D.getInnerHeight()):y.point(k)<0?ge.some(-y.point(k)):ge.none(),u3=(y,k,D)=>{const P=y.move(D,t1),Z=kE(k,y,D,P,mw).getOr(P);return c3(y,Z,k).fold(()=>k.situsFromPoint(Z.left,y.point(Z)),ne=>(k.scrollBy(0,ne),k.situsFromPoint(Z.left,y.point(Z)-ne)))},f3={tryUp:se(u3,a3),tryDown:se(u3,l3),getJumpSize:F(t1)},TO=20,DO=(y,k,D)=>y.getSelection().bind(P=>iy(k,P.finish,P.foffset,D).fold(()=>ge.some(Qg(P.finish,P.foffset)),Z=>{const ne=y.fromSitus(Z),pe=ed.verify(y,P.finish,P.foffset,ne.finish,ne.foffset,D.failure,k);return Mf(pe)})),Bd=(y,k,D,P,Z,ne)=>ne===0?ge.none():_h(y,k,D,P,Z).bind(pe=>{const Ee=y.fromSitus(pe),Fe=ed.verify(y,D,P,Ee.finish,Ee.foffset,Z.failure,k);return ed.cata(Fe,()=>ge.none(),()=>ge.some(pe),ot=>ur(D,ot)&&P===0?OO(y,D,P,rl,Z):Bd(y,k,ot,0,Z,ne-1),ot=>ur(D,ot)&&P===tr(ot)?OO(y,D,P,Mu,Z):Bd(y,k,ot,tr(ot),Z,ne-1))}),OO=(y,k,D,P,Z)=>yE(y,k,D).bind(ne=>Ks(y,Z,P(ne,f3.getJumpSize()))),Ks=(y,k,D)=>{const P=qh().browser;return P.isChromium()||P.isSafari()||P.isFirefox()?k.retry(y,D):ge.none()},_h=(y,k,D,P,Z)=>yE(y,D,P).bind(ne=>Ks(y,Z,ne)),p0=(y,k,D)=>DO(y,k,D).bind(P=>Bd(y,k,P.element,P.offset,D,TO).map(y.fromSitus)),EE=(y,k)=>wi(y,D=>Ki(D).exists(P=>ur(P,k))),d3=(y,k,D,P,Z)=>Ai(P,"td,th",k).bind(ne=>Ai(ne,"table",k).bind(pe=>EE(Z,pe)?p0(y,k,D).bind(Ee=>Ai(Ee.finish,"td,th",k).map(Fe=>({start:ne,finish:Fe,range:Ee}))):ge.none())),ly=(y,k,D,P,Z,ne)=>ne(P,k).orThunk(()=>d3(y,k,D,P,Z).map(pe=>{const Ee=pe.range;return c0.create(ge.some(wh(Ee.start,Ee.soffset,Ee.finish,Ee.foffset)),!0)})),MO=(y,k)=>Ai(y,"tr",k).bind(D=>Ai(D,"table",k).bind(P=>{const Z=gi(P,"tr");return ur(D,Z[0])?$s(P,ne=>oh(ne).isSome(),k).map(ne=>{const pe=tr(ne);return c0.create(ge.some(wh(ne,pe,ne,pe)),!0)}):ge.none()})),AE=(y,k)=>Ai(y,"tr",k).bind(D=>Ai(D,"table",k).bind(P=>{const Z=gi(P,"tr");return ur(D,Z[Z.length-1])?fi(P,ne=>kf(ne).isSome(),k).map(ne=>c0.create(ge.some(wh(ne,0,ne,0)),!0)):ge.none()})),IC=(y,k,D,P,Z,ne,pe)=>d3(y,D,P,Z,ne).bind(Ee=>lm(k,D,Ee.start,Ee.finish,pe)),gw=y=>{let k=y;return{get:()=>k,set:Z=>{k=Z}}},RO=y=>{const k=gw(ge.none()),D=()=>k.get().each(y);return{clear:()=>{D(),k.set(ge.none())},isSet:()=>k.get().isSome(),get:()=>k.get(),set:Ee=>{D(),k.set(ge.some(Ee))}}},xE=()=>{const y=RO(z);return{...y,on:D=>y.get().each(D)}},BC=(y,k)=>Ai(y,"td,th",k),TE=y=>dl(y).exists(Km),EI=(y,k,D,P)=>{const Z=xE(),ne=Z.clear,pe=_t=>{Z.on(fn=>{P.clearBeforeUpdate(k),BC(_t.target,D).each(Gn=>{ou(fn,Gn,D).each(Un=>{const tn=Un.boxes.getOr([]);if(tn.length===1){const Wn=tn[0],Jt=nu(Wn)==="false",mo=sc(Zg(_t.target),Wn,ur);Jt&&mo&&(P.selectRange(k,tn,Wn,Wn),y.selectContents(Wn))}else tn.length>1&&(P.selectRange(k,tn,Un.start,Un.finish),y.selectContents(Gn))})})})};return{clearstate:ne,mousedown:_t=>{P.clear(k),BC(_t.target,D).filter(TE).each(Z.set)},mouseover:_t=>{pe(_t)},mouseup:_t=>{pe(_t),ne()}}},h3={traverse:gu,gather:Hr,relative:bl.before,retry:f3.tryDown,failure:ed.failedDown},DE={traverse:Zc,gather:Ps,relative:bl.before,retry:f3.tryUp,failure:ed.failedUp},cy=y=>k=>k===y,pw=cy(38),b0=cy(40),up=y=>y>=37&&y<=40,m3={isBackward:cy(37),isForward:cy(39)},NO={isBackward:cy(39),isForward:cy(37)},g3=y=>{const k=y!==void 0?y.dom:document,D=k.body.scrollLeft||k.documentElement.scrollLeft,P=k.body.scrollTop||k.documentElement.scrollTop;return Cf(D,P)},OE=(y,k,D)=>{const Z=(D!==void 0?D.dom:document).defaultView;Z&&Z.scrollBy(y,k)},uy=sg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ME=y=>uy.exact(y.start,y.soffset,y.finish,y.foffset),LC=y=>y.match({domRange:k=>it.fromDom(k.startContainer),relative:(k,D)=>bl.getStart(k),exact:(k,D,P,Z)=>k}),RE=uy.domRange,p3=uy.relative,bw=uy.exact,NE=y=>{const k=LC(y);return xr(k)},PO=Ob.create,um={domRange:RE,relative:p3,exact:bw,exactFromRange:ME,getWin:NE,range:PO},b3=(y,k,D)=>{var P,Z;return ge.from((Z=(P=y.dom).caretPositionFromPoint)===null||Z===void 0?void 0:Z.call(P,k,D)).bind(ne=>{if(ne.offsetNode===null)return ge.none();const pe=y.dom.createRange();return pe.setStart(ne.offsetNode,ne.offset),pe.collapse(),ge.some(pe)})},IO=(y,k,D)=>{var P,Z;return ge.from((Z=(P=y.dom).caretRangeFromPoint)===null||Z===void 0?void 0:Z.call(P,k,D))},Jn=(()=>document.caretPositionFromPoint?b3:document.caretRangeFromPoint?IO:ge.none)(),$l=(y,k,D)=>{const P=it.fromDom(y.document);return Jn(P,k,D).map(Z=>Ob.create(it.fromDom(Z.startContainer),Z.startOffset,it.fromDom(Z.endContainer),Z.endOffset))},fm=(y,k)=>{const D=Wt(y);return D==="input"?bl.after(y):ut(["br","img"],D)?k===0?bl.before(y):bl.after(y):bl.on(y,k)},Ql=(y,k)=>{const D=y.fold(bl.before,fm,bl.after),P=k.fold(bl.before,fm,bl.after);return um.relative(D,P)},dm=(y,k,D,P)=>{const Z=fm(y,k),ne=fm(D,P);return um.relative(Z,ne)},v3=(y,k,D,P)=>{const ne=Ja(y).dom.createRange();return ne.setStart(y.dom,k),ne.setEnd(D.dom,P),ne},vw=(y,k,D,P)=>{const Z=v3(y,k,D,P),ne=ur(y,D)&&k===P;return Z.collapsed&&!ne},Ch=y=>ge.from(y.getSelection()),FC=(y,k)=>{Ch(y).each(D=>{D.removeAllRanges(),D.addRange(k)})},yw=(y,k,D,P,Z)=>{const ne=am(y,k,D,P,Z);FC(y,ne)},ww=(y,k,D,P,Z,ne)=>{k.collapse(D.dom,P),k.extend(Z.dom,ne)},PE=(y,k)=>cw(y,k).match({ltr:(D,P,Z,ne)=>{yw(y,D,P,Z,ne)},rtl:(D,P,Z,ne)=>{Ch(y).each(pe=>{if(pe.setBaseAndExtent)pe.setBaseAndExtent(D.dom,P,Z.dom,ne);else if(pe.extend)try{ww(y,pe,D,P,Z,ne)}catch{yw(y,Z,ne,D,P)}else yw(y,Z,ne,D,P)})}}),_w=(y,k,D,P,Z)=>{const ne=dm(k,D,P,Z);PE(y,ne)},HC=(y,k,D)=>{const P=Ql(k,D);PE(y,P)},IE=y=>{if(y.rangeCount>0){const k=y.getRangeAt(0),D=y.getRangeAt(y.rangeCount-1);return ge.some(Ob.create(it.fromDom(k.startContainer),k.startOffset,it.fromDom(D.endContainer),D.endOffset))}else return ge.none()},BO=y=>{if(y.anchorNode===null||y.focusNode===null)return IE(y);{const k=it.fromDom(y.anchorNode),D=it.fromDom(y.focusNode);return vw(k,y.anchorOffset,D,y.focusOffset)?ge.some(Ob.create(k,y.anchorOffset,D,y.focusOffset)):IE(y)}},hm=(y,k,D=!0)=>{const Z=(D?u0:hE)(y,k);FC(y,Z)},$C=y=>Ch(y).filter(k=>k.rangeCount>0).bind(BO),Cw=y=>$C(y).map(k=>um.exact(k.start,k.soffset,k.finish,k.foffset)),td=(y,k)=>{const D=uw(y,k);return lu(D)},Tl=(y,k,D)=>$l(y,k,D),BE=y=>{Ch(y).each(k=>k.removeAllRanges())},Sw=y=>({elementFromPoint:(Jt,mo)=>it.fromPoint(it.fromDom(y.document),Jt,mo),getRect:Jt=>Jt.dom.getBoundingClientRect(),getRangedRect:(Jt,mo,as,Ts)=>{const aa=um.exact(Jt,mo,as,Ts);return td(y,aa)},getSelection:()=>Cw(y).map(Jt=>Mb(y,Jt)),fromSitus:Jt=>{const mo=um.relative(Jt.start,Jt.finish);return Mb(y,mo)},situsFromPoint:(Jt,mo)=>Tl(y,Jt,mo).map(as=>cp.create(as.start,as.soffset,as.finish,as.foffset)),clearSelection:()=>{BE(y)},collapseSelection:(Jt=!1)=>{Cw(y).each(mo=>mo.fold(as=>as.collapse(Jt),(as,Ts)=>{const aa=Jt?as:Ts;HC(y,aa,aa)},(as,Ts,aa,Dl)=>{const vl=Jt?as:aa,Nu=Jt?Ts:Dl;_w(y,vl,Nu,vl,Nu)}))},setSelection:Jt=>{_w(y,Jt.start,Jt.soffset,Jt.finish,Jt.foffset)},setRelativeSelection:(Jt,mo)=>{HC(y,Jt,mo)},selectNode:Jt=>{hm(y,Jt,!1)},selectContents:Jt=>{hm(y,Jt)},getInnerHeight:()=>y.innerHeight,getScrollY:()=>g3(it.fromDom(y.document)).top,scrollBy:(Jt,mo)=>{OE(Jt,mo,it.fromDom(y.document))}}),Ld=(y,k)=>({rows:y,cols:k}),kw=(y,k,D,P)=>{const Z=Sw(y),ne=EI(Z,k,D,P);return{clearstate:ne.clearstate,mousedown:ne.mousedown,mouseover:ne.mouseover,mouseup:ne.mouseup}},LE=y=>Nl(y,un).exists(Km),FE=(y,k)=>LE(y)||LE(k),LO=(y,k,D,P)=>{const Z=Sw(y),ne=()=>(P.clear(k),ge.none());return{keydown:(Fe,ot,_t,fn,Gn,Un)=>{const tn=Fe.raw,Wn=tn.which,Jt=tn.shiftKey===!0;return Hs(k,P.selectedSelector).fold(()=>(up(Wn)&&!Jt&&P.clearBeforeUpdate(k),up(Wn)&&Jt&&!FE(ot,fn)?ge.none:b0(Wn)&&Jt?se(IC,Z,k,D,h3,fn,ot,P.selectRange):pw(Wn)&&Jt?se(IC,Z,k,D,DE,fn,ot,P.selectRange):b0(Wn)?se(ly,Z,D,h3,fn,ot,AE):pw(Wn)?se(ly,Z,D,DE,fn,ot,MO):ge.none),as=>{const Ts=aa=>()=>gn(aa,vl=>Nd(vl.rows,vl.cols,k,as,P)).fold(()=>ch(k,P.firstSelectedSelector,P.lastSelectedSelector).map(vl=>{const Nu=b0(Wn)||Un.isForward(Wn)?bl.after:bl.before;return Z.setRelativeSelection(bl.on(vl.first,0),Nu(vl.table)),P.clear(k),c0.create(ge.none(),!0)}),vl=>ge.some(c0.create(ge.none(),!0)));return up(Wn)&&Jt&&!FE(ot,fn)?ge.none:b0(Wn)&&Jt?Ts([Ld(1,0)]):pw(Wn)&&Jt?Ts([Ld(-1,0)]):Un.isBackward(Wn)&&Jt?Ts([Ld(0,-1),Ld(-1,0)]):Un.isForward(Wn)&&Jt?Ts([Ld(0,1),Ld(1,0)]):up(Wn)&&!Jt?ne:ge.none})()},keyup:(Fe,ot,_t,fn,Gn)=>Hs(k,P.selectedSelector).fold(()=>{const Un=Fe.raw,tn=Un.which;return Un.shiftKey===!0&&up(tn)&&FE(ot,fn)?bE(k,D,ot,_t,fn,Gn,P.selectRange):ge.none()},ge.none)}},y3=(y,k,D,P)=>{const Z=Sw(y);return(ne,pe)=>{P.clearBeforeUpdate(k),ou(ne,pe,D).each(Ee=>{const Fe=Ee.boxes.getOr([]);P.selectRange(k,Fe,Ee.start,Ee.finish),Z.selectContents(pe),Z.collapseSelection()})}},Ew=(y,k)=>{const D=mi(y,k);return D===void 0||D===""?[]:D.split(" ")},w3=(y,k,D)=>{const Z=Ew(y,k).concat([D]);return Ur(y,k,Z.join(" ")),!0},FO=(y,k,D)=>{const P=kt(Ew(y,k),Z=>Z!==D);return P.length>0?Ur(y,k,P.join(" ")):Ge(y,k),!1},v0=y=>y.dom.classList!==void 0,zc=y=>Ew(y,"class"),Sh=(y,k)=>w3(y,"class",k),Fd=(y,k)=>FO(y,"class",k),nd=(y,k)=>{v0(y)?y.dom.classList.add(k):Sh(y,k)},zC=y=>{(v0(y)?y.dom.classList:zc(y)).length===0&&Ge(y,"class")},Pb=(y,k)=>{v0(y)?y.dom.classList.remove(k):Fd(y,k),zC(y)},n1=(y,k)=>v0(y)&&y.dom.classList.contains(k),HO=(y,k)=>{He(k,D=>{Pb(y,D)})},HE=y=>k=>{nd(k,y)},$O=y=>k=>{HO(k,y)},S3={byClass:y=>{const k=HE(y.selected),D=$O([y.selected,y.lastSelected,y.firstSelected]),P=ne=>{const pe=gi(ne,y.selectedSelector);He(pe,D)};return{clearBeforeUpdate:P,clear:P,selectRange:(ne,pe,Ee,Fe)=>{P(ne),He(pe,k),nd(Ee,y.firstSelected),nd(Fe,y.lastSelected)},selectedSelector:y.selectedSelector,firstSelectedSelector:y.firstSelectedSelector,lastSelectedSelector:y.lastSelectedSelector}},byAttr:(y,k,D)=>{const P=Fe=>{Ge(Fe,y.selected),Ge(Fe,y.firstSelected),Ge(Fe,y.lastSelected)},Z=Fe=>{Ur(Fe,y.selected,"1")},ne=Fe=>{pe(Fe),D()},pe=Fe=>{const ot=gi(Fe,`${y.selectedSelector},${y.firstSelectedSelector},${y.lastSelectedSelector}`);He(ot,P)};return{clearBeforeUpdate:pe,clear:ne,selectRange:(Fe,ot,_t,fn)=>{ne(Fe),He(ot,Z),Ur(_t,y.firstSelected,"1"),Ur(fn,y.lastSelected,"1"),k(ot,_t,fn)},selectedSelector:y.selectedSelector,firstSelectedSelector:y.firstSelectedSelector,lastSelectedSelector:y.lastSelectedSelector}}},VC=(y,k,D,P)=>{switch(y.tag){case"none":return k();case"single":return P(y.element);case"multiple":return D(y.elements)}},$E=()=>({tag:"none"}),Ti=y=>({tag:"multiple",elements:y}),o1=y=>({tag:"single",element:y}),fy=(y,k,D)=>({get:()=>rb(y(),D).fold(()=>k().fold($E,o1),Ti)}),zE=(y,k)=>{const D=y.slice(0,k[k.length-1].row+1),P=O2(D);return Bn(P,Z=>{const ne=Z.cells.slice(0,k[k.length-1].column+1);return xt(ne,pe=>pe.element)})},k3=(y,k)=>{const D=y.slice(k[0].row+k[0].rowspan-1,y.length),P=O2(D);return Bn(P,Z=>{const ne=Z.cells.slice(k[0].column+k[0].colspan-1,Z.cells.length);return xt(ne,pe=>pe.element)})},VE=(y,k,D)=>{const P=Ae.fromTable(y);return Yf(P,k).map(ne=>{const pe=Fc(P,D,!1),{rows:Ee}=Ta(pe),Fe=zE(Ee,ne),ot=k3(Ee,ne);return{upOrLeftCells:Fe,downOrRightCells:ot}})},E3=(y,k,D,P,Z,ne,pe)=>({target:y,x:k,y:D,stop:P,prevent:Z,kill:ne,raw:pe}),UC=y=>{const k=it.fromDom(Xn(y).getOr(y.target)),D=()=>y.stopPropagation(),P=()=>y.preventDefault(),Z=q(P,D);return E3(k,y.clientX,y.clientY,D,P,Z,y)},zO=(y,k)=>D=>{y(D)&&k(UC(D))},VO=(y,k,D,P,Z)=>{const ne=zO(D,P);return y.dom.addEventListener(k,ne,Z),{unbind:se(UO,y,k,ne,Z)}},A3=(y,k,D,P)=>VO(y,k,D,P,!1),UO=(y,k,D,P)=>{y.dom.removeEventListener(k,D,P)},UE=_e,dy=(y,k,D)=>A3(y,k,UE,D),hy=UC,WC=y=>!n1(it.fromDom(y.target),"ephox-snooker-resizer-bar"),x3=(y,k)=>{const D=fy(()=>it.fromDom(y.getBody()),()=>Up(xu(y),Ym(y)),uh.selectedSelector),P=(Fe,ot,_t)=>{tl(ot).each(Gn=>{const Un=Yh(y),tn=Da(z,it.fromDom(y.getDoc()),Un),Wn=Gf(y),Jt=VE(Gn,{selection:Wn},tn);r0(y,Fe,ot,_t,Jt)})},Z=()=>ji(y),ne=S3.byAttr(uh,P,Z);return y.on("init",Fe=>{const ot=y.getWin(),_t=Af(y),fn=Ym(y),Gn=()=>{const _i=y.selection,Pu=it.fromDom(_i.getStart()),af=it.fromDom(_i.getEnd());yi(tl,[Pu,af]).fold(()=>ne.clear(_t),z)},Un=kw(ot,_t,fn,ne),tn=LO(ot,_t,fn,ne),Wn=y3(ot,_t,fn,ne),Jt=_i=>_i.raw.shiftKey===!0;y.on("TableSelectorChange",_i=>Wn(_i.start,_i.finish));const mo=(_i,Pu)=>{!Jt(_i)||(Pu.kill&&_i.kill(),Pu.selection.each(af=>{const gm=um.relative(af.start,af.finish),lf=uw(ot,gm);y.selection.setRng(lf)}))},as=_i=>{const Pu=hy(_i);if(Pu.raw.shiftKey&&up(Pu.raw.which)){const af=y.selection.getRng(),gm=it.fromDom(af.startContainer),lf=it.fromDom(af.endContainer);tn.keyup(Pu,gm,af.startOffset,lf,af.endOffset).each(Hb=>{mo(Pu,Hb)})}},Ts=_i=>{const Pu=hy(_i);k.hide();const af=y.selection.getRng(),gm=it.fromDom(af.startContainer),lf=it.fromDom(af.endContainer),Hb=wv(m3,NO)(it.fromDom(y.selection.getStart()));tn.keydown(Pu,gm,af.startOffset,lf,af.endOffset,Hb).each(Iu=>{mo(Pu,Iu)}),k.show()},aa=_i=>_i.button===0,Dl=_i=>_i.buttons===void 0?!0:(_i.buttons&1)!==0,vl=_i=>{Un.clearstate()},Nu=_i=>{aa(_i)&&WC(_i)&&Un.mousedown(hy(_i))},Fb=_i=>{Dl(_i)&&WC(_i)&&Un.mouseover(hy(_i))},Dw=_i=>{aa(_i)&&WC(_i)&&Un.mouseup(hy(_i))},tS=(()=>{const _i=gw(it.fromDom(_t)),Pu=gw(0);return{touchEnd:gm=>{const lf=it.fromDom(gm.target);if(Ir("td")(lf)||Ir("th")(lf)){const Hb=_i.get(),Iu=Pu.get();ur(Hb,lf)&&gm.timeStamp-Iu<300&&(gm.preventDefault(),Wn(lf,lf))}_i.set(lf),Pu.set(gm.timeStamp)}}})();y.on("dragstart",vl),y.on("mousedown",Nu),y.on("mouseover",Fb),y.on("mouseup",Dw),y.on("touchend",tS.touchEnd),y.on("keyup",as),y.on("keydown",Ts),y.on("NodeChange",Gn)}),y.on("PreInit",()=>{y.serializer.addTempAttr(uh.firstSelected),y.serializer.addTempAttr(uh.lastSelected)}),{getSelectedCells:()=>VC(D.get(),F([]),Fe=>xt(Fe,ot=>ot.dom),Fe=>[Fe.dom]),clearSelectedCells:Fe=>ne.clear(it.fromDom(Fe))}},kh=y=>{let k=[];return{bind:ne=>{if(ne===void 0)throw new Error("Event bind error: undefined handler");k.push(ne)},unbind:ne=>{k=kt(k,pe=>pe!==ne)},trigger:(...ne)=>{const pe={};He(y,(Ee,Fe)=>{pe[Ee]=ne[Fe]}),He(k,Ee=>{Ee(pe)})}}},Vc=y=>{const k=rs(y,P=>({bind:P.bind,unbind:P.unbind})),D=rs(y,P=>P.trigger);return{registry:k,trigger:D}},fu=(y,k)=>{let D=null;const P=()=>{v(D)||(clearTimeout(D),D=null)};return{cancel:P,throttle:(...ne)=>{P(),D=setTimeout(()=>{D=null,y.apply(null,ne)},k)}}},fp=y=>y.slice(0).sort(),WO=(y,k)=>{throw new Error("All required keys ("+fp(y).join(", ")+") were not specified. Specified keys were: "+fp(k).join(", ")+".")},jO=y=>{throw new Error("Unsupported keys for object: "+fp(y).join(", "))},ZO=(y,k)=>{if(!g(k))throw new Error("The "+y+" fields must be an array. Was: "+k+".");He(k,D=>{if(!f(D))throw new Error("The value "+D+" in the "+y+" fields was not a string.")})},sr=(y,k)=>{throw new Error("All values need to be of type: "+k+". Keys ("+fp(y).join(", ")+") were not.")},qO=y=>{const k=fp(y);de(k,(P,Z)=>Z<k.length-1&&P===k[Z+1]).each(P=>{throw new Error("The field: "+P+" occurs more than once in the combined fields: ["+k.join(", ")+"].")})},T3=(y,k)=>jC(y,k,{validate:L,label:"function"}),jC=(y,k,D)=>{if(k.length===0)throw new Error("You must specify at least one required field.");return ZO("required",k),qO(k),P=>{const Z=wt(P);ao(k,Ee=>ut(Z,Ee))||WO(k,Z),y(k,Z);const pe=kt(k,Ee=>!D.validate(P[Ee],Ee));return pe.length>0&&sr(pe,D.label),P}},GO=(y,k)=>{const D=kt(k,P=>!ut(y,P));D.length>0&&jO(D)},no=y=>T3(GO,y),Ib=no(["compare","extract","mutate","sink"]),KO=no(["element","start","stop","destroy"]),D3=no(["forceDrop","drop","move","delayDrop"]),ZC=()=>{let y=ge.none();const k=()=>{y=ge.none()},D=(ne,pe)=>{const Ee=y.map(Fe=>ne.compare(Fe,pe));return y=ge.some(pe),Ee},P=(ne,pe)=>{pe.extract(ne).each(Fe=>{D(pe,Fe).each(_t=>{Z.trigger.move(_t)})})},Z=Vc({move:kh(["info"])});return{onEvent:P,reset:k,events:Z.registry}},Aw=()=>{const y=Vc({move:kh(["info"])});return{onEvent:z,reset:z,events:y.registry}},WE=()=>{const y=Aw(),k=ZC();let D=y;return{on:()=>{D.reset(),D=k},off:()=>{D.reset(),D=y},isOn:()=>D===k,onEvent:(Ee,Fe)=>{D.onEvent(Ee,Fe)},events:k.events}},jE=(y,k,D)=>{let P=!1;const Z=Vc({start:kh([]),stop:kh([])}),ne=WE(),pe=()=>{tn.stop(),ne.isOn()&&(ne.off(),Z.trigger.stop())},Ee=fu(pe,200),Fe=Jt=>{tn.start(Jt),ne.on(),Z.trigger.start()},ot=Jt=>{Ee.cancel(),ne.onEvent(Jt,k)};ne.events.move.bind(Jt=>{k.mutate(y,Jt.info)});const _t=()=>{P=!0},fn=()=>{P=!1},Gn=()=>P,Un=Jt=>(...mo)=>{P&&Jt.apply(null,mo)},tn=k.sink(D3({forceDrop:pe,drop:Un(pe),move:Un(ot),delayDrop:Un(Ee.throttle)}),D),Wn=()=>{tn.destroy()};return{element:tn.element,go:Fe,on:_t,off:fn,isActive:Gn,destroy:Wn,events:Z.registry}},YO=y=>{const k=y.replace(/\./g,"-");return{resolve:P=>k+"-"+P}},O3=YO("ephox-dragster").resolve,M3=y=>{const k={layerClass:O3("blocker"),...y},D=it.fromTag("div");return Ur(D,"role","presentation"),_l(D,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),nd(D,O3("blocker")),nd(D,k.layerClass),{element:F(D),destroy:()=>{Yi(D)}}};var QO=Ib({compare:(y,k)=>Cf(k.left-y.left,k.top-y.top),extract:y=>ge.some(Cf(y.x,y.y)),sink:(y,k)=>{const D=M3(k),P=dy(D.element(),"mousedown",y.forceDrop),Z=dy(D.element(),"mouseup",y.drop),ne=dy(D.element(),"mousemove",y.move),pe=dy(D.element(),"mouseout",y.delayDrop),Ee=()=>{D.destroy(),Z.unbind(),ne.unbind(),pe.unbind(),P.unbind()},Fe=_t=>{Tr(_t,D.element())},ot=()=>{Yi(D.element())};return KO({element:D.element,start:Fe,stop:ot,destroy:Ee})},mutate:(y,k)=>{y.mutate(k.left,k.top)}});const xI=(y,k={})=>{var D;const P=(D=k.mode)!==null&&D!==void 0?D:QO;return jE(y,P,k)},GC=YO("ephox-snooker").resolve,eM=()=>{const y=Vc({drag:kh(["xDelta","yDelta"])});return{mutate:(D,P)=>{y.trigger.drag(D,P)},events:y.registry}},tM=()=>{const y=Vc({drag:kh(["xDelta","yDelta","target"])});let k=ge.none();const D=eM();return D.events.drag.bind(ne=>{k.each(pe=>{y.trigger.drag(ne.xDelta,ne.yDelta,pe)})}),{assign:ne=>{k=ge.some(ne)},get:()=>k,mutate:D.mutate,events:y.registry}},nM=(y,k,D,P,Z)=>{const ne=it.fromTag("div");return _l(ne,{position:"absolute",left:k-P/2+"px",top:D+"px",height:Z+"px",width:P+"px"}),Fi(ne,{"data-column":y,role:"presentation"}),ne},Tw=(y,k,D,P,Z)=>{const ne=it.fromTag("div");return _l(ne,{position:"absolute",left:k+"px",top:D-Z/2+"px",height:Z+"px",width:P+"px"}),Fi(ne,{"data-row":y,role:"presentation"}),ne},ZE=GC("resizer-bar"),R3=GC("resizer-rows"),qE=GC("resizer-cols"),GE=7,N3=(y,k)=>Bn(y.all,(D,P)=>k(D.element)?[P]:[]),s1=(y,k)=>{const D=[];return Et(y.grid.columns,P=>{Ae.getColumnAt(y,P).map(ne=>ne.element).forall(k)&&D.push(P)}),kt(D,P=>{const Z=Ae.filterItems(y,ne=>ne.column===P);return ao(Z,ne=>k(ne.element))})},my=y=>{const k=gi(y.parent(),"."+ZE);He(k,Yi)},KE=(y,k,D)=>{const P=y.origin();He(k,Z=>{Z.each(ne=>{const pe=D(P,ne);nd(pe,ZE),Tr(y.parent(),pe)})})},oM=(y,k,D,P)=>{KE(y,k,(Z,ne)=>{const pe=nM(ne.col,ne.x-Z.left,D.top-Z.top,GE,P);return nd(pe,qE),pe})},sM=(y,k,D,P)=>{KE(y,k,(Z,ne)=>{const pe=Tw(ne.row,D.left-Z.left,ne.y-Z.top,P,GE);return nd(pe,R3),pe})},Nr=(y,k,D,P,Z)=>{const ne=ju(D),pe=k.isResizable,Ee=P.length>0?Qn.positions(P,D):[],Fe=Ee.length>0?N3(y,pe):[],ot=kt(Ee,(Un,tn)=>et(Fe,Wn=>tn===Wn));sM(k,ot,ne,rt(D));const _t=Z.length>0?Pc.positions(Z,D):[],fn=_t.length>0?s1(y,pe):[],Gn=kt(_t,(Un,tn)=>et(fn,Wn=>tn===Wn));oM(k,Gn,ne,Hm(D))},YE=(y,k)=>{if(my(y),y.isResizable(k)){const D=Ae.fromTable(k),P=Su(D),Z=_f(D);Nr(D,y,k,P,Z)}},dp=(y,k)=>{const D=gi(y.parent(),"."+ZE);He(D,k)},hp=y=>{dp(y,k=>{xi(k,"display","none")})},r1=y=>{dp(y,k=>{xi(k,"display","block")})},Ru=y=>n1(y,R3),KC=y=>n1(y,qE),gy=GC("resizer-bar-dragging"),YC=y=>{const k=tM(),D=xI(k,{});let P=ge.none();const Z=(tn,Wn)=>ge.from(mi(tn,Wn));k.events.drag.bind(tn=>{Z(tn.target,"data-row").each(Wn=>{const Jt=qi(tn.target,"top");xi(tn.target,"top",Jt+tn.yDelta+"px")}),Z(tn.target,"data-column").each(Wn=>{const Jt=qi(tn.target,"left");xi(tn.target,"left",Jt+tn.xDelta+"px")})});const ne=(tn,Wn)=>{const Jt=qi(tn,Wn),mo=Dr(tn,"data-initial-"+Wn,0);return Jt-mo};D.events.stop.bind(()=>{k.get().each(tn=>{P.each(Wn=>{Z(tn,"data-row").each(Jt=>{const mo=ne(tn,"top");Ge(tn,"data-initial-top"),Un.trigger.adjustHeight(Wn,mo,parseInt(Jt,10))}),Z(tn,"data-column").each(Jt=>{const mo=ne(tn,"left");Ge(tn,"data-initial-left"),Un.trigger.adjustWidth(Wn,mo,parseInt(Jt,10))}),YE(y,Wn)})})});const pe=(tn,Wn)=>{Un.trigger.startAdjust(),k.assign(tn),Ur(tn,"data-initial-"+Wn,qi(tn,Wn)),nd(tn,gy),xi(tn,"opacity","0.2"),D.go(y.parent())},Ee=dy(y.parent(),"mousedown",tn=>{Ru(tn.target)&&pe(tn.target,"top"),KC(tn.target)&&pe(tn.target,"left")}),Fe=tn=>ur(tn,y.view()),ot=tn=>Ai(tn,"table",Fe).filter(Km),_t=dy(y.view(),"mouseover",tn=>{ot(tn.target).fold(()=>{$i(tn.target)&&my(y)},Wn=>{D.isActive()&&(P=ge.some(Wn),YE(y,Wn))})}),fn=()=>{Ee.unbind(),_t.unbind(),D.destroy(),my(y)},Gn=tn=>{YE(y,tn)},Un=Vc({adjustHeight:kh(["table","delta","row"]),adjustWidth:kh(["table","delta","column"]),startAdjust:kh([])});return{destroy:fn,refresh:Gn,on:D.on,off:D.off,hideBars:se(hp,y),showBars:se(r1,y),events:Un.registry}},rM={create:(y,k,D)=>{const P=Qn,Z=Pc,ne=YC(y),pe=Vc({beforeResize:kh(["table","type"]),afterResize:kh(["table","type"]),startDrag:kh([])});return ne.events.adjustHeight.bind(Ee=>{const Fe=Ee.table;pe.trigger.beforeResize(Fe,"row");const ot=P.delta(Ee.delta,Fe);vb(Fe,ot,Ee.row,P),pe.trigger.afterResize(Fe,"row")}),ne.events.startAdjust.bind(Ee=>{pe.trigger.startDrag()}),ne.events.adjustWidth.bind(Ee=>{const Fe=Ee.table;pe.trigger.beforeResize(Fe,"col");const ot=Z.delta(Ee.delta,Fe),_t=D(Fe);Vt(Fe,ot,Ee.column,k,_t),pe.trigger.afterResize(Fe,"col")}),{on:ne.on,off:ne.off,refreshBars:ne.refresh,hideBars:ne.hideBars,showBars:ne.showBars,destroy:ne.destroy,events:pe.registry}}},rr={only:(y,k)=>{const D=cs(y)?Qs(y):y;return{parent:F(D),view:F(y),origin:F(Cf(0,0)),isResizable:k}},detached:(y,k,D)=>{const P=()=>ju(k);return{parent:F(k),view:F(y),origin:P,isResizable:D}},body:(y,k,D)=>({parent:F(k),view:F(y),origin:F(Cf(0,0)),isResizable:D})},mm=()=>{const y=it.fromTag("div");return _l(y,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Tr(he(),y),y},py=(y,k)=>y.inline?rr.body(it.fromDom(y.getBody()),mm(),k):rr.only(it.fromDom(y.getDoc()),k),aM=(y,k)=>{y.inline&&Yi(k.parent())},Lb=y=>N(y)&&y.nodeName==="TABLE",cr="bar-",lM=y=>mi(y,"data-mce-resize")!=="false",XC=y=>{const k=Ae.fromTable(y);Ae.hasColumns(k)||He(Il(y),D=>{const P=el(D,"width");xi(D,"width",P),Ge(D,"width")})},JC=y=>{const k=xE(),D=xE(),P=xE();let Z,ne;const pe=tn=>im(y,tn),Ee=()=>Xh(y)?Wp():U_(),Fe=tn=>k2(tn).columns,ot=(tn,Wn,Jt)=>{const mo=zu(Wn,"e");if(ne===""&&lp(tn),Jt!==Z&&ne!==""){xi(tn,"width",ne);const as=Ee(),Ts=pe(tn),aa=Xh(y)||mo?Fe(tn)-1:0;Vt(tn,Jt-Z,aa,as,Ts)}else if(Cv(ne)){const as=parseFloat(ne.replace("%","")),Ts=Jt*as/Z;xi(tn,"width",Ts+"%")}Sv(ne)&&XC(tn)},_t=()=>{D.on(tn=>{tn.destroy()}),P.on(tn=>{aM(y,tn)})};return y.on("init",()=>{const tn=py(y,lM);if(P.set(tn),Zm(y)&&Jh(y)){const Wn=Ee(),Jt=rM.create(tn,Wn,pe);Jt.on(),Jt.events.startDrag.bind(mo=>{k.set(y.selection.getRng())}),Jt.events.beforeResize.bind(mo=>{const as=mo.table.dom;Q2(y,as,Ad(as),Xm(as),cr+mo.type)}),Jt.events.afterResize.bind(mo=>{const as=mo.table,Ts=as.dom;ih(as),k.on(aa=>{y.selection.setRng(aa),y.focus()}),Sc(y,Ts,Ad(Ts),Xm(Ts),cr+mo.type),y.undoManager.add()}),D.set(Jt)}}),y.on("ObjectResizeStart",tn=>{const Wn=tn.target;if(Lb(Wn)){const Jt=it.fromDom(Wn);He(y.dom.select(".mce-clonedresizable"),mo=>{y.dom.addClass(mo,"mce-"+tb(y)+"-columns")}),!Eb(Jt)&&qm(y)?tw(Jt):!vh(Jt)&&Ed(y)&&lp(Jt),_C(Jt)&&$u(tn.origin,cr)&&lp(Jt),Z=tn.width,ne=Gm(y)?"":ob(y,Wn).getOr("")}}),y.on("ObjectResized",tn=>{const Wn=tn.target;if(Lb(Wn)){const Jt=it.fromDom(Wn),mo=tn.origin;$u(mo,"corner-")&&ot(Jt,mo,tn.width),ih(Jt),ip(y,Jt.dom,i0)}}),y.on("SwitchMode",()=>{D.on(tn=>{y.mode.isReadOnly()?tn.hideBars():tn.showBars()})}),y.on("dragstart dragend",tn=>{D.on(Wn=>{tn.type==="dragstart"?(Wn.hideBars(),Wn.off()):(Wn.on(),Wn.showBars())})}),y.on("remove",()=>{_t()}),{refresh:tn=>{D.on(Wn=>Wn.refreshBars(it.fromDom(tn)))},hide:()=>{D.on(tn=>tn.hideBars())},show:()=>{D.on(tn=>tn.showBars())}}},QC=y=>{Wg(y);const k=JC(y),D=x3(y,k),P=Gk(y,k,D);return ny(y,P),OC(y,P),C2(y,P),{getSelectedCells:D.getSelectedCells,clearSelectedCells:D.clearSelectedCells}},i1=y=>({table:QC(y)});var mp=()=>{r.add("dom",i1)};mp()})();tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2Zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1Z" fill-rule="nonzero"/></svg>',"accordion-toggle":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.3 7.3a1 1 0 0 1 1.4 0L16 9.6l2.3-2.3a1 1 0 1 1 1.4 1.4L16 12.4l-3.7-3.7a1 1 0 0 1 0-1.4ZM4.3 11.7a1 1 0 0 1 0-1.4L6.6 8 4.3 5.7a1 1 0 0 1 1.4-1.4L9.4 8l-3.7 3.7a1 1 0 0 1-1.4 0Z"/></svg>',accordion:'<svg width="24" height="24"><rect x="12" y="7" width="10" height="2" rx="1"/><rect x="12" y="11" width="10" height="2" rx="1"/><rect x="12" y="15" width="6" height="2" rx="1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.3 7.3a1 1 0 0 1 1.4 0L6 9.6l2.3-2.3a1 1 0 0 1 1.4 1.4L6 12.4 2.3 8.7a1 1 0 0 1 0-1.4Z"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3Z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3Z"/></svg>',addtag:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 5a2 2 0 0 1 1.6.8L21 12l-4.4 6.2a2 2 0 0 1-1.6.8h-3v-2h3l3.5-5L15 7H5v3H3V7c0-1.1.9-2 2-2h10Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 12a1 1 0 0 0-1 1v2H3a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2H7v-2c0-.6-.4-1-1-1Z"/></svg>',"ai-prompt":'<svg width="24" height="24"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.7a1 1 0 0 0-1.4 0l-9.9 10a1 1 0 0 0 0 1.3l2.1 2.1c.4.4 1 .4 1.4 0l10-9.9c.3-.3.3-1 0-1.4l-2.2-2Zm1.4 2.8-2-2-3 2.7 2.2 2.2 2.8-2.9Z"/><path d="m18.5 7.3-.7-1.5-1.5-.8 1.5-.7.7-1.5.7 1.5 1.5.7-1.5.8-.7 1.5ZM18.5 16.5l-.7-1.6-1.5-.7 1.5-.7.7-1.6.7 1.6 1.5.7-1.5.7-.7 1.6ZM9.7 7.3 9 5.8 7.5 5 9 4.3l.7-1.5.7 1.5L12 5l-1.5.8-.7 1.5Z"/></g><defs><clipPath id="a"><path d="M0 0h24v24H0z"/></clipPath></defs></svg>',ai:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H5Zm6.8 11.5.5 1.2a68.3 68.3 0 0 0 .7 1.1l.4.1c.3 0 .5 0 .7-.3.2-.1.3-.3.3-.6l-.3-1-2.6-6.2a20.4 20.4 0 0 0-.5-1.3l-.5-.4-.7-.2c-.2 0-.5 0-.6.2-.2 0-.4.2-.5.4l-.3.6-.3.7L5.7 15l-.2.6-.1.4c0 .3 0 .5.3.7l.6.2c.3 0 .5 0 .7-.2l.4-1 .5-1.2h3.9ZM9.8 9l1.5 4h-3l1.5-4Zm5.6-.9v7.6c0 .4 0 .7.2 1l.7.2c.3 0 .6 0 .8-.3l.2-.9V8.1c0-.4 0-.7-.2-.9a1 1 0 0 0-.8-.3c-.2 0-.5.1-.7.3l-.2 1Z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5 13 7H5a1 1 0 1 1 0-2h9.2Zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h6.8Zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h4.4Zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2ZM7 17l-1.2 2H5a1 1 0 0 1 0-2h2Zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2Zm5.2-13.5 1.3.7-9.7 16.3-1.3-.7 9.7-16.3Z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="m5.6 13 12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8Z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="m18.5 13-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8Z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1Z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3Zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3Zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1ZM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7Zm10 3.5.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0Zm-10-7-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3Zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7Zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8ZM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8Zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7Z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9.4-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6Z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8ZM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7Z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="m15.7 2 1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 0 1-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2ZM18 12l-4.5-4L9 12h9ZM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16Z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 0 1-2-2v-5h2zm8-7V4h6a2 2 0 0 1 2 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="m13 11-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="m18.4 8 1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 0 1-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8Zm1.6 7-3-3-3 3h6Z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 0 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1Zm4.8-6.8V10H7.7V5.8h-1v-1h2ZM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1Zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1ZM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2V18.7l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1Zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6Zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4Zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8Zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1Z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2ZM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11Z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8Z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3 4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1Z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3Z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8 5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0Z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2 13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5Z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4Zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5Z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8Zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3 3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2Z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6Z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3Zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7Zm0 12V9h-7v10h7Z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3ZM9 9v5l5-5H9Zm1 6h5v-5l-5 5Z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7Zm12.3 5h-3v10h3v-10ZM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8Zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4ZM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8A2.5 2.5 0 0 0 7.7 6l-.4-.1H7Z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14ZM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18V18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5Zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3ZM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4Zm8.5-7.1h-11v2h11v-2Z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8Zm-8.5 2.2.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1Zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4Zm5.4 4 .2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2Z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5Zm0 4h2v2h-2V9ZM9 9h2v2H9V9Zm4 4h2v2h-2v-2Zm-4 0h2v2H9v-2Zm0 4h2v2H9v-2Zm4 0h2v2h-2v-2ZM9 5h2v2H9V5Z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7Zm-2 2h-3v12h3V8Zm-2-6v2H8v15H6V2h7Z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16Zm-2 2H8v3h12v-3Zm-1-6v2H4v5H2V7h17Z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10Zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2Z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1Z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="m19.8 8.8-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5Zm-2-.2 1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5Zm-1 1-2.5-2.4-6 6 2.5 2.5 6-6Zm-7 7.1-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5Z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9ZM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13Zm3-5.3 1.3 2 3-4.7 3.7 6H7l2-3.3Z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3 18 7v1h-5V5H7v14h9a1 1 0 0 1 2 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5Z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3Z"/><path d="M16.4 9.2a1 1 0 0 1 1.4.2l2.4 3.6-2.4 3.6a1 1 0 0 1-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 0 1 .2-1.4Z"/></g></svg>',fill:'<svg width="24" height="26"><path d="m16.6 12-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2ZM5.2 13 10 8.2l4.8 4.8H5.2ZM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5Z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2Zm4-8h2V9h-2v2ZM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2Zm14-2v2h2a2 2 0 0 0-2-2Zm-7 16h2V3h-2v18Zm7-6h2v-2h-2v2Zm-4-8h2V5h-2v2Zm4 12a2 2 0 0 0 2-2h-2v2Z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5Zm8 4v2h2v-2h-2Zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2Zm2 14h-2v2a2 2 0 0 0 2-2ZM3 11v2h18v-2H3Zm6 7v2h2v-2H9Zm8-4v2h2v-2h-2ZM5 18c0 1.1.9 2 2 2v-2H5Z" fill-rule="nonzero"/></svg>',footnote:'<svg width="24" height="24"><path d="M19 13c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h14Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19 4v6h-1V5h-1.5V4h2.6Z"/><path d="M12 18c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h7ZM14 8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2h9Z"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3Z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 0 1 0 2h-4v11a1 1 0 0 1-2 0V7H7a1 1 0 1 1 0-2h10Z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="m15.3 10-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3Zm0 4 3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2ZM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3ZM8.7 10 5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2Z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="m5 15.7 2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7ZM5 18V19h3l1.8-1.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1Zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1Zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1Z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0Z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1ZM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8Z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-1 3v2h2V7h-2Zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4Z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1Z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3 16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6Zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6Z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="m16.7 4.7-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 0 0 3.2-2.1l-.2-.2a6 6 0 0 0-1-.6Zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 0 1-2-2.8Zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7Zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3Zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 0 1-.3-2Zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1Zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6Zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3Zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1Zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3Zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1Zm3-1.4-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 0 0-1.3-3.5Zm-9 0 2 .2V5.5a9 9 0 0 0-2 2.2Zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 0 0-2-2.3Zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 0 1 1.9-2.5Zm4.4 0 .1.1a10 10 0 0 1 1.8 2.4l1.1-.7a7.5 7.5 0 0 0-3-1.8Z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="m15 9-8 8H4v-3l8-8 3 3Zm1-1-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1ZM4 18h16v2H4v-2Z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8h-.1l-1.5 1v-1.1l1.6-1.1h1.2v6zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2Zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5Zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7Zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7Zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6ZM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7ZM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4Zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3ZM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6Zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7Zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4Zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3Zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7Zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8Zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4ZM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22Zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3ZM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM37.1 34.6 34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1ZM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4Zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8Zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3ZM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22Zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1Zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33Zm0 10v-1.2h-1.3V26H33Zm0 10v-1.2h-1.3V36H33Z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15Zm0 10v-1.2h1.3V26H15Zm0 10v-1.2h1.3V36H15Z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="m39.3 17-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3Zm-1.6-4.7-.7 2.3h1.6l-.8-2.3ZM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7Zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26ZM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="m12.6 17-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3ZM11 12.3l-.7 2.3h1.6l-.8-2.3Zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7ZM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7ZM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26Zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3Zm0 10v-1.2H33V27h-1.3Zm0 10v-1.2H33V37h-1.3Z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',minus:'<svg width="24" height="24"><path d="M19 11a1 1 0 0 1 .1 2H5a1 1 0 0 1-.1-2H19Z"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3Zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1Z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M15.5 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7ZM13 17v-2h-2v2h2Zm0-4V7h-2v6h2Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2Zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19Zm-1 8.8.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3Zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4 1 13l6.4 6.5 6.5-6.5-6.5-6.5ZM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7ZM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1Z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2Z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2ZM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1ZM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1Z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm8 7v12h-6V8h6Zm-1.5 1.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm-2 7v12H4V8h6ZM8.5 9.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 11v5H8v-5h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 7v5H8V8h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2Z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5 8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1Z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 0 1 .1 2H13v6a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H11V5c0-.6.4-1 1-1Z"/></svg>',preferences:'<svg width="24" height="24"><path d="m20.1 13.5-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5Zm-2.4-1 .7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1Zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6Z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3Zm-1 10H7v-4h10v4Zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5Zm.5-8H6v2h12V5Z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m5 22.1-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5ZM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1Z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1Zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4Zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9Zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7ZM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3Z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5Z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8Z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5Zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2Z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2Zm0 2v2h14v-2H5Zm10 0h2v2h-2v-2Zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6Z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2Zm0 8h2v-2H3v2Zm4 8h2v-2H7v2ZM3 9h2V7H3v2Zm10-6h-2v2h2V3Zm6 0v2h2a2 2 0 0 0-2-2ZM5 21v-2H3c0 1.1.9 2 2 2Zm-2-4h2v-2H3v2ZM9 3H7v2h2V3Zm2 18h2v-2h-2v2Zm8-8h2v-2h-2v2Zm0 8a2 2 0 0 0 2-2h-2v2Zm0-12h2V7h-2v2Zm0 8h2v-2h-2v2Zm-4 4h2v-2h-2v2Zm0-16h2V3h-2v2ZM7 17h10V7H7v10Zm2-8h6v6H9V9Z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3Z"/></svg>',send:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="m13.3 22 7-18.3-18.3 7L9 15l4.3 7ZM18 6.8l-.7-.7L9.4 14l.7.7L18 6.8Z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6ZM8 8h2V6H8v2Zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6ZM14 13h2v-2h-2v2Zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6ZM8 18h2v-2H8v2Z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="m16 6 4 4-8 9-8-9 4-4h8Zm-4 10.2 5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2Z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6Zm0-3v2h2V5H6Zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1Zm-5 1.5-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5ZM13 10V8h-2v2h2Zm0-3V5h-2v2h2Zm3 5 1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12Z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="m10.4 10 4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10ZM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19Z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4 10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4Zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11Z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8Zm-2 2H5v5h6V6Z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 0 1 2 2v7h-8v-2h6V6h-6V4Z" opacity=".2"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3Z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8 0h-6v5h6v-5Zm-8-7H5v5h6V6Z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v7h-8v7H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8-7h-6v5h6V6Zm-8 0H5v5h6V6Z"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6Zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 6v12h14V6H5Z"/><path d="m14.4 8.6 1.1 1-2.4 2.4 2.4 2.4-1.1 1.1-2.4-2.4-2.4 2.4-1-1.1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15.5V18h3v-2.5H5Zm14-5h-9V18h9v-7.5ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Zm-8 7.5h3v-3H5v3Z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6Zm0 12h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 11h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 6h8v3H6V6Zm11 0c.6 0 1 .4 1 1v1a1 1 0 1 1-2 0V7c0-.6.4-1 1-1Z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h12Zm0 12h-8v3h8v-3ZM7 16a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8v-3ZM7 11a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8V6ZM7 6a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V7c0-.6-.4-1-1-1Z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-9h-6v3h6V6ZM5 9h6V6H5v3Z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',"template-add":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12v4H5a2 2 0 0 0-2 2v3h9.3a6 6 0 0 1-.3-2H5v-1h7a6 6 0 0 1 .8-2H11v-5l-.8-.6a3 3 0 1 1 3.6 0l-.8.6v4.7a6 6 0 0 1 2-1.9V12a5 5 0 1 0-6 0Z"/><path d="M18 15c.5 0 1 .4 1 .9V18h2a1 1 0 0 1 .1 2H19v2a1 1 0 0 1-2 .1V20h-2a1 1 0 0 1-.1-2H17v-2c0-.6.4-1 1-1Z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',"text-size-decrease":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM14 12a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z"/></svg>',"text-size-increase":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM17 9a1 1 0 0 0-1 1v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2c0-.6-.4-1-1-1Z"/></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',typography:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1ZM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2ZM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1ZM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5Zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5Zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17Zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19Zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19Z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2Z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6Z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12ZM11 6.4 8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4Z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24Zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7ZM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13Z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 0 1 1.2 1.5l-.1.1-4.1 3-4-3a1 1 0 0 1 1-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8 4 2.9a1 1 0 0 1-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 0 1-1-1v-4l-2 1.3a1 1 0 0 1-1.2-.1l-.1-.1a1 1 0 0 1 .1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2Zm-4 0v2a2 2 0 0 1-2-2h2Zm8 0v2h-2v-2h2Zm8 0a2 2 0 0 1-2 2v-2h2Zm-4 0v2h-2v-2h2ZM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15ZM5 15v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 11v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 7v2H3V7h2Zm16 0v2h-2V7h2ZM5 3v2H3c0-1.1.9-2 2-2Zm8 0v2h-2V3h2Zm6 0a2 2 0 0 1 2 2h-2V3ZM9 3v2H7V3h2Zm8 0v2h-2V3h2Z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6ZM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3Zm.7-3 .3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4Z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8Zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>'}});(function(){const r=Object.getPrototypeOf,e=(o,c,m)=>{var b;return m(o,c.prototype)?!0:((b=o.constructor)===null||b===void 0?void 0:b.name)===c.name},t=o=>{const c=typeof o;return o===null?"null":c==="object"&&Array.isArray(o)?"array":c==="object"&&e(o,String,(m,b)=>b.isPrototypeOf(m))?"string":c},s=o=>c=>t(c)===o,a=o=>c=>typeof c===o,u=o=>c=>o===c,f=(o,c)=>g(o)&&e(o,c,(m,b)=>r(m)===b),h=s("string"),g=s("object"),v=o=>f(o,Object),_=s("array"),A=u(null),O=a("boolean"),N=u(void 0),L=o=>o==null,j=o=>!L(o),z=a("function"),q=a("number"),ee=(o,c)=>{if(_(o)){for(let m=0,b=o.length;m<b;++m)if(!c(o[m]))return!1;return!0}return!1},F=()=>{},oe=o=>()=>o(),te=(o,c)=>(...m)=>o(c.apply(null,m)),se=(o,c)=>m=>o(c(m)),X=o=>()=>o,we=o=>o,ye=(o,c)=>o===c;function Te(o,...c){return(...m)=>{const b=c.concat(m);return o.apply(null,b)}}const _e=o=>c=>!o(c),ge=o=>()=>{throw new Error(o)},nt=o=>o(),Je=X(!1),ft=X(!0);class V{constructor(c,m){this.tag=c,this.value=m}static some(c){return new V(!0,c)}static none(){return V.singletonNone}fold(c,m){return this.tag?m(this.value):c()}isSome(){return this.tag}isNone(){return!this.tag}map(c){return this.tag?V.some(c(this.value)):V.none()}bind(c){return this.tag?c(this.value):V.none()}exists(c){return this.tag&&c(this.value)}forall(c){return!this.tag||c(this.value)}filter(c){return!this.tag||c(this.value)?this:V.none()}getOr(c){return this.tag?this.value:c}or(c){return this.tag?this:c}getOrThunk(c){return this.tag?this.value:c()}orThunk(c){return this.tag?this:c()}getOrDie(c){if(this.tag)return this.value;throw new Error(c!=null?c:"Called getOrDie on None")}static from(c){return j(c)?V.some(c):V.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(c){this.tag&&c(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}V.singletonNone=new V(!1);const ut=Array.prototype.slice,et=Array.prototype.indexOf,Et=Array.prototype.push,xt=(o,c)=>et.call(o,c),He=(o,c)=>{const m=xt(o,c);return m===-1?V.none():V.some(m)},ct=(o,c)=>xt(o,c)>-1,an=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const C=o[m];if(c(C,m))return!0}return!1},kt=(o,c)=>{const m=[];for(let b=0;b<o;b++)m.push(c(b));return m},bn=(o,c)=>{const m=[];for(let b=0;b<o.length;b+=c){const C=ut.call(o,b,b+c);m.push(C)}return m},qe=(o,c)=>{const m=o.length,b=new Array(m);for(let C=0;C<m;C++){const x=o[C];b[C]=c(x,C)}return b},gt=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const C=o[m];c(C,m)}},de=(o,c)=>{for(let m=o.length-1;m>=0;m--){const b=o[m];c(b,m)}},No=(o,c)=>{const m=[],b=[];for(let C=0,x=o.length;C<x;C++){const M=o[C];(c(M,C)?m:b).push(M)}return{pass:m,fail:b}},Zn=(o,c)=>{const m=[];for(let b=0,C=o.length;b<C;b++){const x=o[b];c(x,b)&&m.push(x)}return m},Bn=(o,c,m)=>(de(o,(b,C)=>{m=c(m,b,C)}),m),ao=(o,c,m)=>(gt(o,(b,C)=>{m=c(m,b,C)}),m),Wo=(o,c,m)=>{for(let b=0,C=o.length;b<C;b++){const x=o[b];if(c(x,b))return V.some(x);if(m(x,b))break}return V.none()},St=(o,c)=>Wo(o,c,Je),Xt=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const C=o[m];if(c(C,m))return V.some(m)}return V.none()},Tt=o=>{const c=[];for(let m=0,b=o.length;m<b;++m){if(!_(o[m]))throw new Error("Arr.flatten item "+m+" was not an array, input: "+o);Et.apply(c,o[m])}return c},Be=(o,c)=>Tt(qe(o,c)),Ut=(o,c)=>{for(let m=0,b=o.length;m<b;++m){const C=o[m];if(c(C,m)!==!0)return!1}return!0},gn=o=>{const c=ut.call(o,0);return c.reverse(),c},wt=(o,c)=>Zn(o,m=>!ct(c,m)),Yt=(o,c)=>{const m={};for(let b=0,C=o.length;b<C;b++){const x=o[b];m[String(x)]=c(x,b)}return m},vn=o=>[o],rs=(o,c)=>{const m=ut.call(o,0);return m.sort(c),m},eo=(o,c)=>c>=0&&c<o.length?V.some(o[c]):V.none(),ds=o=>eo(o,0),Or=o=>eo(o,o.length-1),Rs=z(Array.from)?Array.from:o=>ut.call(o),Js=(o,c)=>{for(let m=0;m<o.length;m++){const b=c(o[m],m);if(b.isSome())return b}return V.none()},Zs=Object.keys,ba=Object.hasOwnProperty,ar=(o,c)=>{const m=Zs(o);for(let b=0,C=m.length;b<C;b++){const x=m[b],M=o[x];c(M,x)}},Ns=(o,c)=>Zr(o,(m,b)=>({k:b,v:c(m,b)})),Zr=(o,c)=>{const m={};return ar(o,(b,C)=>{const x=c(b,C);m[x.k]=x.v}),m},Po=o=>(c,m)=>{o[m]=c},Mo=(o,c,m,b)=>{ar(o,(C,x)=>{(c(C,x)?m:b)(C,x)})},Mr=(o,c)=>{const m={},b={};return Mo(o,c,Po(m),Po(b)),{t:m,f:b}},Ls=(o,c)=>{const m={};return Mo(o,c,Po(m),F),m},na=(o,c)=>{const m=[];return ar(o,(b,C)=>{m.push(c(b,C))}),m},gs=(o,c)=>{const m=Zs(o);for(let b=0,C=m.length;b<C;b++){const x=m[b],M=o[x];if(c(M,x,o))return V.some(M)}return V.none()},va=o=>na(o,we),ln=(o,c)=>ps(o,c)?V.from(o[c]):V.none(),ps=(o,c)=>ba.call(o,c),Li=(o,c)=>ps(o,c)&&o[c]!==void 0&&o[c]!==null,ze=(o,c,m=ye)=>o.exists(b=>m(b,c)),Qe=(o,c,m=ye)=>qn(o,c,m).getOr(o.isNone()&&c.isNone()),Dt=o=>{const c=[],m=b=>{c.push(b)};for(let b=0;b<o.length;b++)o[b].each(m);return c},Wt=o=>{const c=[];for(let m=0;m<o.length;m++){const b=o[m];if(b.isSome())c.push(b.getOrDie());else return V.none()}return V.some(c)},qn=(o,c,m)=>o.isSome()&&c.isSome()?V.some(m(o.getOrDie(),c.getOrDie())):V.none(),uo=(o,c,m,b)=>o.isSome()&&c.isSome()&&m.isSome()?V.some(b(o.getOrDie(),c.getOrDie(),m.getOrDie())):V.none(),po=(o,c)=>o!=null?V.some(c(o)):V.none(),un=(o,c)=>o?V.some(c):V.none(),ns=(o,c)=>o+c,_o=(o,c)=>o.substring(c),cs=(o,c,m)=>c===""||o.length>=c.length&&o.substr(m,m+c.length)===c,Sr=(o,c)=>Ur(o,c)?_o(o,c.length):o,Ir=(o,c)=>Fi(o,c)?o:ns(o,c),Vs=(o,c,m=0,b)=>{const C=o.indexOf(c,m);return C!==-1?N(b)?!0:C+c.length<=b:!1},Ur=(o,c)=>cs(o,c,0),Fi=(o,c)=>cs(o,c,o.length-c.length),mi=(o=>c=>c.replace(o,""))(/^\s+|\s+$/g),Ke=o=>o.length>0,Ge=o=>!Ke(o),It=o=>o.style!==void 0&&z(o.style.getPropertyValue),jt=(o,c)=>{const b=(c||document).createElement("div");if(b.innerHTML=o,!b.hasChildNodes()||b.childNodes.length>1){const C="HTML does not have a single root node";throw console.error(C,o),new Error(C)}return Ko(b.childNodes[0])},fo=(o,c)=>{const b=(c||document).createElement(o);return Ko(b)},Lo=(o,c)=>{const b=(c||document).createTextNode(o);return Ko(b)},Ko=o=>{if(o==null)throw new Error("Node cannot be null or undefined");return{dom:o}},it={fromHtml:jt,fromTag:fo,fromText:Lo,fromDom:Ko,fromPoint:(o,c,m)=>V.from(o.dom.elementFromPoint(c,m)).map(Ko)},Zo=typeof window<"u"?window:Function("return this;")(),Oi=(o,c)=>{let m=c!=null?c:Zo;for(let b=0;b<o.length&&m!==void 0&&m!==null;++b)m=m[o[b]];return m},oa=(o,c)=>{const m=o.split(".");return Oi(m,c)},ua=(o,c)=>oa(o,c),ur=(o,c)=>{const m=ua(o,c);if(m==null)throw new Error(o+" not available on this browser");return m},Dc=Object.getPrototypeOf,gc=o=>ur("HTMLElement",o),Ja=o=>{const c=oa("ownerDocument.defaultView",o);return g(o)&&(gc(c).prototype.isPrototypeOf(o)||/^HTML\w*Element$/.test(Dc(o).constructor.name))},fa=9,Qs=11,xr=1,Ki=3,dl=o=>o.dom.nodeName.toLowerCase(),pc=o=>o.dom.nodeType,Zc=o=>c=>pc(c)===o,gu=o=>pr(o)&&Ja(o.dom),pr=Zc(xr),Qa=Zc(Ki),pu=Zc(fa),qc=Zc(Qs),Vl=o=>c=>pr(c)&&dl(c)===o,Aa=(o,c)=>{const m=o.dom;if(m.nodeType!==xr)return!1;{const b=m;if(b.matches!==void 0)return b.matches(c);if(b.msMatchesSelector!==void 0)return b.msMatchesSelector(c);if(b.webkitMatchesSelector!==void 0)return b.webkitMatchesSelector(c);if(b.mozMatchesSelector!==void 0)return b.mozMatchesSelector(c);throw new Error("Browser lacks native selectors")}},Tr=o=>o.nodeType!==xr&&o.nodeType!==fa&&o.nodeType!==Qs||o.childElementCount===0,Rm=(o,c)=>{const m=c===void 0?document:c.dom;return Tr(m)?[]:qe(m.querySelectorAll(o),it.fromDom)},gf=(o,c)=>{const m=c===void 0?document:c.dom;return Tr(m)?V.none():V.from(m.querySelector(o)).map(it.fromDom)},kr=(o,c)=>o.dom===c.dom,Fa=(o,c)=>{const m=o.dom,b=c.dom;return m===b?!1:m.contains(b)},sa=o=>it.fromDom(o.dom.ownerDocument),Yi=o=>pu(o)?o:sa(o),bu=o=>it.fromDom(Yi(o).dom.documentElement),Oc=o=>it.fromDom(Yi(o).dom.defaultView),Ha=o=>V.from(o.dom.parentNode).map(it.fromDom),Mc=o=>Ha(o),bc=o=>V.from(o.dom.parentElement).map(it.fromDom),gd=(o,c)=>{const m=z(c)?c:Je;let b=o.dom;const C=[];for(;b.parentNode!==null&&b.parentNode!==void 0;){const x=b.parentNode,M=it.fromDom(x);if(C.push(M),m(M)===!0)break;b=x}return C},Bf=o=>V.from(o.dom.offsetParent).map(it.fromDom),vu=o=>V.from(o.dom.nextSibling).map(it.fromDom),Ul=o=>qe(o.dom.childNodes,it.fromDom),Rc=(o,c)=>{const m=o.dom.childNodes;return V.from(m[c]).map(it.fromDom)},pf=o=>Rc(o,0),Gc=(o,c)=>({element:o,offset:c}),pd=(o,c)=>{const m=Ul(o);return m.length>0&&c<m.length?Gc(m[c],0):Gc(o,c)},xe=o=>qc(o)&&j(o.dom.host),tt=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),pt=X(tt),Pt=tt?o=>it.fromDom(o.dom.getRootNode()):Yi,yn=o=>xe(o)?o:it.fromDom(Yi(o).dom.body),Ro=o=>Rr(o).isSome(),Rr=o=>{const c=Pt(o);return xe(c)?V.some(c):V.none()},ys=o=>it.fromDom(o.dom.host),is=o=>{if(pt()&&j(o.target)){const c=it.fromDom(o.target);if(pr(c)&&Ei(c)&&o.composed&&o.composedPath){const m=o.composedPath();if(m)return ds(m)}}return V.from(o.target)},Ei=o=>j(o.dom.shadowRoot),qs=o=>{const c=Qa(o)?o.dom.parentNode:o.dom;if(c==null||c.ownerDocument===null)return!1;const m=c.ownerDocument;return Rr(it.fromDom(c)).fold(()=>m.body.contains(c),se(qs,ys))},Hi=()=>yu(it.fromDom(document)),yu=o=>{const c=o.dom.body;if(c==null)throw new Error("Body is not available yet");return it.fromDom(c)},bd=(o,c,m)=>{if(h(m)||O(m)||q(m))o.setAttribute(c,m+"");else throw console.error("Invalid call to Attribute.set. Key ",c,":: Value ",m,":: Element ",o),new Error("Attribute value was not simple")},Xn=(o,c,m)=>{bd(o.dom,c,m)},Nm=(o,c)=>{const m=o.dom;ar(c,(b,C)=>{bd(m,C,b)})},$i=(o,c)=>{const m=o.dom.getAttribute(c);return m===null?void 0:m},he=(o,c)=>V.from($i(o,c)),Re=(o,c)=>{const m=o.dom;return m&&m.hasAttribute?m.hasAttribute(c):!1},We=(o,c)=>{o.dom.removeAttribute(c)},Bt=o=>ao(o.dom.attributes,(c,m)=>(c[m.name]=m.value,c),{}),Fn=(o,c,m)=>{if(!h(m))throw console.error("Invalid call to CSS.set. Property ",c,":: Value ",m,":: Element ",o),new Error("CSS value must be a string: "+m);It(o)&&o.style.setProperty(c,m)},Jo=(o,c)=>{It(o)&&o.style.removeProperty(c)},so=(o,c,m)=>{const b=o.dom;Fn(b,c,m)},gi=(o,c)=>{const m=o.dom;ar(c,(b,C)=>{Fn(m,C,b)})},hn=(o,c)=>{const m=o.dom;ar(c,(b,C)=>{b.fold(()=>{Jo(m,C)},x=>{Fn(m,C,x)})})},qr=(o,c)=>{const m=o.dom,C=window.getComputedStyle(m).getPropertyValue(c);return C===""&&!qs(o)?Nl(m,c):C},Nl=(o,c)=>It(o)?o.style.getPropertyValue(c):"",Xi=(o,c)=>{const m=o.dom,b=Nl(m,c);return V.from(b).filter(C=>C.length>0)},ni=o=>{const c={},m=o.dom;if(It(m))for(let b=0;b<m.style.length;b++){const C=m.style.item(b);c[C]=m.style[C]}return c},bf=(o,c,m)=>{const b=it.fromTag(o);return so(b,c,m),Xi(b,c).isSome()},Ss=(o,c)=>{const m=o.dom;Jo(m,c),ze(he(o,"style").map(mi),"")&&We(o,"style")},Kc=o=>o.dom.offsetWidth,Ai=(o,c)=>{const m=(I,W)=>{if(!q(W)&&!W.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+W);const J=I.dom;It(J)&&(J.style[o]=W+"px")},b=I=>{const W=c(I);if(W<=0||W===null){const J=qr(I,o);return parseFloat(J)||0}return W},C=b,x=(I,W)=>ao(W,(J,re)=>{const fe=qr(I,re),me=fe===void 0?0:parseInt(fe,10);return isNaN(me)?J:J+me},0);return{set:m,get:b,getOuter:C,aggregate:x,max:(I,W,J)=>{const re=x(I,J);return W>re?W-re:0}}},sc=Ai("height",o=>{const c=o.dom;return qs(o)?c.getBoundingClientRect().height:c.offsetHeight}),Mi=o=>sc.get(o),Lf=o=>sc.getOuter(o),da=(o,c)=>{const m=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],b=sc.max(o,c,m);so(o,"max-height",b+"px")},Ff=(o,c)=>({left:o,top:c,translate:(b,C)=>Ff(o+b,c+C)}),fr=Ff,$u=o=>{const c=o.getBoundingClientRect();return fr(c.left,c.top)},zu=(o,c)=>o!==void 0?o:c!==void 0?c:0,vc=o=>{const c=o.dom.ownerDocument,m=c.body,b=c.defaultView,C=c.documentElement;if(m===o.dom)return fr(m.offsetLeft,m.offsetTop);const x=zu(b==null?void 0:b.pageYOffset,C.scrollTop),M=zu(b==null?void 0:b.pageXOffset,C.scrollLeft),I=zu(C.clientTop,m.clientTop),W=zu(C.clientLeft,m.clientLeft);return Hf(o).translate(M-W,x-I)},Hf=o=>{const c=o.dom,b=c.ownerDocument.body;return b===c?fr(b.offsetLeft,b.offsetTop):qs(o)?$u(c):fr(0,0)},jd=Ai("width",o=>o.dom.offsetWidth),Xr=(o,c)=>jd.set(o,c),Ji=o=>jd.get(o),$a=o=>jd.getOuter(o),U0=(o,c)=>{const m=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],b=jd.max(o,c,m);so(o,"max-width",b+"px")},xi=o=>{let c=!1,m;return(...b)=>(c||(c=!0,m=o.apply(null,b)),m)},_l=(o,c,m,b)=>{const C=o.isiOS()&&/ipad/i.test(m)===!0,x=o.isiOS()&&!C,M=o.isiOS()||o.isAndroid(),I=M||b("(pointer:coarse)"),W=C||!x&&M&&b("(min-device-width:768px)"),J=x||M&&!W,re=c.isSafari()&&o.isiOS()&&/safari/i.test(m)===!1,fe=!J&&!W&&!re;return{isiPad:X(C),isiPhone:X(x),isTablet:X(W),isPhone:X(J),isTouch:X(I),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:X(re),isDesktop:X(fe)}},el=(o,c)=>{for(let m=0;m<o.length;m++){const b=o[m];if(b.test(c))return b}},Ng=(o,c)=>{const m=el(o,c);if(!m)return{major:0,minor:0};const b=C=>Number(c.replace(m,"$"+C));return vf(b(1),b(2))},$f=(o,c)=>{const m=String(c).toLowerCase();return o.length===0?yc():Ng(o,m)},yc=()=>vf(0,0),vf=(o,c)=>({major:o,minor:c}),Dr={nu:vf,detect:$f,unknown:yc},Vu=(o,c)=>Js(c.brands,m=>{const b=m.brand.toLowerCase();return St(o,C=>{var x;return b===((x=C.brand)===null||x===void 0?void 0:x.toLowerCase())}).map(C=>({current:C.name,version:Dr.nu(parseInt(m.version,10),0)}))}),Pl=(o,c)=>{const m=String(c).toLowerCase();return St(o,b=>b.search(m))},za=(o,c)=>Pl(o,c).map(m=>{const b=Dr.detect(m.versionRegexes,c);return{current:m.name,version:b}}),qi=(o,c)=>Pl(o,c).map(m=>{const b=Dr.detect(m.versionRegexes,c);return{current:m.name,version:b}}),zi=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,rc=o=>c=>Vs(c,o),zf=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:o=>Vs(o,"edge/")&&Vs(o,"chrome")&&Vs(o,"safari")&&Vs(o,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zi],search:o=>Vs(o,"chrome")&&!Vs(o,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:o=>Vs(o,"msie")||Vs(o,"trident")},{name:"Opera",versionRegexes:[zi,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:rc("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:rc("firefox")},{name:"Safari",versionRegexes:[zi,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:o=>(Vs(o,"safari")||Vs(o,"mobile/"))&&Vs(o,"applewebkit")}],Zd=[{name:"Windows",search:rc("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:o=>Vs(o,"iphone")||Vs(o,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:rc("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:rc("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:rc("linux"),versionRegexes:[]},{name:"Solaris",search:rc("sunos"),versionRegexes:[]},{name:"FreeBSD",search:rc("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:rc("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Pg={browsers:X(zf),oses:X(Zd)},Pm="Edge",Il="Chromium",Im="IE",tl="Opera",yf="Firefox",zh="Safari",Uu=()=>Vh({current:void 0,version:Dr.unknown()}),Vh=o=>{const c=o.current,m=o.version,b=C=>()=>c===C;return{current:c,version:m,isEdge:b(Pm),isChromium:b(Il),isIE:b(Im),isOpera:b(tl),isFirefox:b(yf),isSafari:b(zh)}},Nc={unknown:Uu,nu:Vh,edge:X(Pm),chromium:X(Il),ie:X(Im),opera:X(tl),firefox:X(yf),safari:X(zh)},Uh="Windows",wf="iOS",Bp="Android",Bm="Linux",Vf="macOS",Wl="Solaris",Ig="FreeBSD",Ye="ChromeOS",qd=()=>wu({current:void 0,version:Dr.unknown()}),wu=o=>{const c=o.current,m=o.version,b=C=>()=>c===C;return{current:c,version:m,isWindows:b(Uh),isiOS:b(wf),isAndroid:b(Bp),isMacOS:b(Vf),isLinux:b(Bm),isSolaris:b(Wl),isFreeBSD:b(Ig),isChromeOS:b(Ye)}},Bg={unknown:qd,nu:wu,windows:X(Uh),ios:X(wf),android:X(Bp),linux:X(Bm),macos:X(Vf),solaris:X(Wl),freebsd:X(Ig),chromeos:X(Ye)},Wh={detect:(o,c,m)=>{const b=Pg.browsers(),C=Pg.oses(),x=c.bind(W=>Vu(b,W)).orThunk(()=>za(b,o)).fold(Nc.unknown,Nc.nu),M=qi(C,o).fold(Bg.unknown,Bg.nu),I=_l(M,x,o,m);return{browser:x,os:M,deviceType:I}}},bt=o=>window.matchMedia(o).matches;let cn=xi(()=>Wh.detect(navigator.userAgent,V.from(navigator.userAgentData),bt));const rn=()=>cn(),To=(o,c,m,b,C,x,M)=>({target:o,x:c,y:m,stop:b,prevent:C,kill:x,raw:M}),er=o=>{const c=it.fromDom(is(o).getOr(o.target)),m=()=>o.stopPropagation(),b=()=>o.preventDefault(),C=te(b,m);return To(c,o.clientX,o.clientY,m,b,C,o)},Wr=(o,c)=>m=>{o(m)&&c(er(m))},ai=(o,c,m,b,C)=>{const x=Wr(m,b);return o.dom.addEventListener(c,x,C),{unbind:Te(W0,o,c,x,C)}},pi=(o,c,m,b)=>ai(o,c,m,b,!1),Gd=(o,c,m,b)=>ai(o,c,m,b,!0),W0=(o,c,m,b)=>{o.dom.removeEventListener(c,m,b)},ya=(o,c)=>{Ha(o).each(b=>{b.dom.insertBefore(c.dom,o.dom)})},vd=(o,c)=>{vu(o).fold(()=>{Ha(o).each(C=>{nl(C,c)})},b=>{ya(b,c)})},Lg=(o,c)=>{pf(o).fold(()=>{nl(o,c)},b=>{o.dom.insertBefore(c.dom,b.dom)})},nl=(o,c)=>{o.dom.appendChild(c.dom)},xa=(o,c,m)=>{Rc(o,m).fold(()=>{nl(o,c)},b=>{ya(b,c)})},Wu=(o,c)=>{gt(c,m=>{nl(o,m)})},oi=o=>{o.dom.textContent="",gt(Ul(o),c=>{_u(c)})},_u=o=>{const c=o.dom;c.parentNode!==null&&c.parentNode.removeChild(c)},ic=o=>{const c=o!==void 0?o.dom:document,m=c.body.scrollLeft||c.documentElement.scrollLeft,b=c.body.scrollTop||c.documentElement.scrollTop;return fr(m,b)},jh=(o,c,m)=>{const C=(m!==void 0?m.dom:document).defaultView;C&&C.scrollTo(o,c)},F1=o=>{const c=o===void 0?window:o;return rn().browser.isFirefox()?V.none():V.from(c.visualViewport)},Kd=(o,c,m,b)=>({x:o,y:c,width:m,height:b,right:o+m,bottom:c+b}),Fg=o=>{const c=o===void 0?window:o,m=c.document,b=ic(it.fromDom(m));return F1(c).fold(()=>{const C=c.document.documentElement,x=C.clientWidth,M=C.clientHeight;return Kd(b.left,b.top,x,M)},C=>Kd(Math.max(C.pageLeft,b.left),Math.max(C.pageTop,b.top),C.width,C.height))},Yd=()=>it.fromDom(document),jl=(o,c)=>o.view(c).fold(X([]),b=>{const C=o.owner(b),x=jl(o,C);return[b].concat(x)}),Zh=(o,c)=>{const m=c.owner(o),b=jl(c,m);return V.some(b)};var Hg=Object.freeze({__proto__:null,view:o=>{var c;return(o.dom===document?V.none():V.from((c=o.dom.defaultView)===null||c===void 0?void 0:c.frameElement)).map(it.fromDom)},owner:o=>sa(o)});const qh=o=>{const c=Yd(),m=ic(c);return Zh(o,Hg).fold(Te(vc,o),C=>{const x=Hf(o),M=Bn(C,(I,W)=>{const J=Hf(W);return{left:I.left+J.left,top:I.top+J.top}},{left:0,top:0});return fr(M.left+x.left+m.left,M.top+x.top+m.top)})},Xd=(o,c,m)=>({point:o,width:c,height:m}),yd=(o,c,m,b)=>({x:o,y:c,width:m,height:b}),si=(o,c,m,b)=>({x:o,y:c,width:m,height:b,right:o+m,bottom:c+b}),li=o=>{const c=vc(o),m=$a(o),b=Lf(o);return si(c.left,c.top,m,b)},Bl=o=>{const c=qh(o),m=$a(o),b=Lf(o);return si(c.left,c.top,m,b)},Lp=(o,c)=>{const m=Math.max(o.x,c.x),b=Math.max(o.y,c.y),C=Math.min(o.right,c.right),x=Math.min(o.bottom,c.bottom),M=C-m,I=x-b;return si(m,b,M,I)},Q=(o,c)=>ao(c,(m,b)=>Lp(m,b),o),ce=()=>Fg(window);var Se=tinymce.util.Tools.resolve("tinymce.ThemeManager");const Xe=o=>{const c=x=>x(o),m=X(o),b=()=>C,C={tag:!0,inner:o,fold:(x,M)=>M(o),isValue:ft,isError:Je,map:x=>Cn.value(x(o)),mapError:b,bind:c,exists:c,forall:c,getOr:m,or:b,getOrThunk:m,orThunk:b,getOrDie:m,each:x=>{x(o)},toOptional:()=>V.some(o)};return C},rt=o=>{const c=()=>m,m={tag:!1,inner:o,fold:(b,C)=>b(o),isValue:Je,isError:ft,map:c,mapError:b=>Cn.error(b(o)),bind:c,exists:Je,forall:ft,getOr:we,or:we,getOrThunk:nt,orThunk:nt,getOrDie:ge(String(o)),each:F,toOptional:V.none};return m},Cn={value:Xe,error:rt,fromOption:(o,c)=>o.fold(()=>rt(c),Xe)};var Yo;(function(o){o[o.Error=0]="Error",o[o.Value=1]="Value"})(Yo||(Yo={}));const os=(o,c,m)=>o.stype===Yo.Error?c(o.serror):m(o.svalue),ho=o=>{const c=[],m=[];return gt(o,b=>{os(b,C=>m.push(C),C=>c.push(C))}),{values:c,errors:m}},Er=(o,c)=>o.stype===Yo.Error?{stype:Yo.Error,serror:c(o.serror)}:o,Zl=(o,c)=>o.stype===Yo.Value?{stype:Yo.Value,svalue:c(o.svalue)}:o,ra=(o,c)=>o.stype===Yo.Value?c(o.svalue):o,Ri=(o,c)=>o.stype===Yo.Error?c(o.serror):o,Cu=o=>({stype:Yo.Value,svalue:o}),Ta=o=>({stype:Yo.Error,serror:o}),Vi={fromResult:o=>o.fold(Ta,Cu),toResult:o=>os(o,Cn.error,Cn.value),svalue:Cu,partition:ho,serror:Ta,bind:ra,bindError:Ri,map:Zl,mapError:Er,fold:os},wa=(o,c,m,b)=>({tag:"field",key:o,newKey:c,presence:m,prop:b}),Yc=(o,c)=>({tag:"custom",newKey:o,instantiator:c}),Jd=(o,c,m)=>{switch(o.tag){case"field":return c(o.key,o.newKey,o.presence,o.prop);case"custom":return m(o.newKey,o.instantiator)}},Qi=(o,c)=>c,j0=(o,c)=>v(o)&&v(c)?Jr(o,c):c,yv=o=>(...c)=>{if(c.length===0)throw new Error("Can't merge zero objects");const m={};for(let b=0;b<c.length;b++){const C=c[b];for(const x in C)ps(C,x)&&(m[x]=o(m[x],C[x]))}return m},Jr=yv(j0),wd=yv(Qi),br=()=>({tag:"required",process:{}}),ql=o=>({tag:"defaultedThunk",process:o}),Uf=o=>ql(X(o)),Qd=()=>({tag:"option",process:{}}),Ae=o=>({tag:"mergeWithThunk",process:o}),_f=o=>Ae(X(o)),$g=(o,c)=>o.length>0?Vi.svalue(Jr(c,wd.apply(void 0,o))):Vi.svalue(c),Su=o=>te(Vi.serror,Tt)(o),$1={consolidateObj:(o,c)=>{const m=Vi.partition(o);return m.errors.length>0?Su(m.errors):$g(m.values,c)},consolidateArr:o=>{const c=Vi.partition(o);return c.errors.length>0?Su(c.errors):Vi.svalue(c.values)}},Z0=o=>g(o)&&Zs(o).length>100?" removed due to size":JSON.stringify(o,null,2),Wf=o=>{const c=o.length>10?o.slice(0,10).concat([{path:[],getErrorInfo:X("... (only showing first ten failures)")}]):o;return qe(c,m=>"Failed path: ("+m.path.join(" > ")+`)
|
|
`+m.getErrorInfo())},Hm=(o,c)=>Vi.serror([{path:o,getErrorInfo:c}]),zg=(o,c,m)=>Hm(o,()=>'Could not find valid *required* value for "'+c+'" in '+Z0(m)),_v=(o,c)=>Hm(o,()=>'Choice schema did not contain choice key: "'+c+'"'),Cf=(o,c,m)=>Hm(o,()=>'The chosen schema: "'+m+'" did not exist in branches: '+Z0(c)),h2=(o,c)=>Hm(o,()=>"There are unsupported fields: ["+c.join(", ")+"] specified"),ku=(o,c)=>Hm(o,X(c)),ju=o=>{const c=(b,C)=>Vi.bindError(o(C),x=>ku(b,x)),m=X("val");return{extract:c,toString:m}},q0=ju(Vi.svalue),G0=(o,c,m,b)=>ln(c,m).fold(()=>zg(o,m,c),b),K0=(o,c,m,b)=>{const C=ln(o,c).getOrThunk(()=>m(o));return b(C)},z1=(o,c,m)=>m(ln(o,c)),jf=(o,c,m,b)=>{const C=ln(o,c).map(x=>x===!0?m(o):x);return b(C)},Y0=(o,c,m,b,C)=>{const x=I=>C.extract(c.concat([b]),I),M=I=>I.fold(()=>Vi.svalue(V.none()),W=>{const J=C.extract(c.concat([b]),W);return Vi.map(J,V.some)});switch(o.tag){case"required":return G0(c,m,b,x);case"defaultedThunk":return K0(m,b,o.process,x);case"option":return z1(m,b,M);case"defaultedOptionThunk":return jf(m,b,o.process,M);case"mergeWithThunk":return K0(m,b,X({}),I=>{const W=Jr(o.process(m),I);return x(W)})}},X0=(o,c,m)=>{const b={},C=[];for(const x of m)Jd(x,(M,I,W,J)=>{const re=Y0(W,o,c,M,J);Vi.fold(re,fe=>{C.push(...fe)},fe=>{b[I]=fe})},(M,I)=>{b[M]=I(c)});return C.length>0?Vi.serror(C):Vi.svalue(b)},hl=o=>({extract:(b,C)=>o().extract(b,C),toString:()=>o().toString()}),m2=o=>Zs(Ls(o,j)),bi=o=>{const c=lo(o),m=Bn(o,(C,x)=>Jd(x,M=>Jr(C,{[M]:!0}),X(C)),{});return{extract:(C,x)=>{const M=O(x)?[]:m2(x),I=Zn(M,W=>!Li(m,W));return I.length===0?c.extract(C,x):h2(C,I)},toString:c.toString}},lo=o=>({extract:(b,C)=>X0(b,C,o),toString:()=>`obj{
|
|
`+qe(o,C=>Jd(C,(x,M,I,W)=>x+" -> "+W.toString(),(x,M)=>"state("+x+")")).join(`
|
|
`)+"}"}),_d=o=>({extract:(b,C)=>{const x=qe(C,(M,I)=>o.extract(b.concat(["["+I+"]"]),M));return $1.consolidateArr(x)},toString:()=>"array("+o.toString()+")"}),Qn=(o,c)=>{const m=c!==void 0?c:we;return{extract:(x,M)=>{const I=[];for(const W of o){const J=W.extract(x,M);if(J.stype===Yo.Value)return{stype:Yo.Value,svalue:m(J.svalue)};I.push(J)}return $1.consolidateArr(I)},toString:()=>"oneOf("+qe(o,x=>x.toString()).join(", ")+")"}},wc=(o,c)=>{const m=(x,M)=>_d(ju(o)).extract(x,M);return{extract:(x,M)=>{const I=Zs(M),W=m(x,I);return Vi.bind(W,J=>{const re=qe(J,fe=>wa(fe,fe,br(),c));return lo(re).extract(x,M)})},toString:()=>"setOf("+c.toString()+")"}},Sf=(o,c)=>{const m=xi(c);return{extract:(x,M)=>m().extract(x,M),toString:()=>m().toString()}},eh=te(_d,lo),Pc=X(q0),Vg=(o,c)=>ju(m=>{const b=typeof m;return o(m)?Vi.svalue(m):Vi.serror(`Expected type: ${c} but got: ${b}`)}),Cd=Vg(q,"number"),ml=Vg(h,"string"),Eu=Vg(O,"boolean"),Fp=Vg(z,"function"),V1=o=>{if(Object(o)!==o)return!0;switch({}.toString.call(o).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(o).every(c=>V1(o[c]));default:return!1}},Sn=ju(o=>V1(o)?Vi.svalue(o):Vi.serror("Expected value to be acceptable for sending via postMessage")),$m=(o,c,m,b)=>ln(m,b).fold(()=>Cf(o,m,b),x=>x.extract(o.concat(["branch: "+b]),c)),Sd=(o,c)=>({extract:(C,x)=>ln(x,o).fold(()=>_v(C,o),I=>$m(C,x,c,I)),toString:()=>"chooseOn("+o+"). Possible values: "+Zs(c)}),th=()=>_d(q0),Zu=o=>ju(c=>o(c).fold(Vi.serror,Vi.svalue)),U1=(o,c)=>wc(m=>Vi.fromResult(o(m)),c),ui=(o,c,m)=>{const b=c.extract([o],m);return Vi.mapError(b,C=>({input:m,errors:C}))},Ui=(o,c,m)=>Vi.toResult(ui(o,c,m)),ha=o=>o.fold(c=>{throw new Error(kd(c))},we),As=(o,c,m)=>ha(Ui(o,c,m)),kd=o=>`Errors:
|
|
`+Wf(o.errors).join(`
|
|
`)+`
|
|
|
|
Input object: `+Z0(o.input),Cl=(o,c)=>Sd(o,Ns(c,lo)),qu=(o,c)=>Sf(o,c),Va=wa,_a=Yc,Hp=o=>Zu(c=>ct(o,c)?Cn.value(c):Cn.error(`Unsupported value: "${c}", choose one of "${o.join(", ")}".`)),Qt=o=>Va(o,o,br(),Pc()),Gr=(o,c)=>Va(o,o,br(),c),J0=o=>Gr(o,Cd),Ca=o=>Gr(o,ml),Ua=(o,c)=>Va(o,o,br(),Hp(c)),Ug=o=>Gr(o,Eu),Ic=o=>Gr(o,Fp),Zf=(o,c)=>Va(o,o,Qd(),ju(m=>Vi.serror("The field: "+o+" is forbidden. "+c))),qf=(o,c)=>Va(o,o,br(),lo(c)),$p=(o,c)=>Va(o,o,br(),eh(c)),Ll=(o,c)=>Va(o,o,br(),_d(c)),Ar=o=>Va(o,o,Qd(),Pc()),Wa=(o,c)=>Va(o,o,Qd(),c),nh=o=>Wa(o,Cd),Gl=o=>Wa(o,ml),Q0=(o,c)=>Wa(o,Hp(c)),zm=o=>Wa(o,Fp),W1=(o,c)=>Wa(o,_d(c)),ja=(o,c)=>Wa(o,lo(c)),ac=(o,c)=>Wa(o,bi(c)),At=(o,c)=>Va(o,o,Uf(c),Pc()),_c=(o,c,m)=>Va(o,o,Uf(c),m),Xc=(o,c)=>_c(o,c,Cd),lc=(o,c)=>_c(o,c,ml),Au=(o,c,m)=>_c(o,c,Hp(m)),Za=(o,c)=>_c(o,c,Eu),qa=(o,c)=>_c(o,c,Fp),Vm=(o,c)=>_c(o,c,Sn),Jc=(o,c,m)=>_c(o,c,_d(m)),eb=(o,c,m)=>_c(o,c,lo(m)),$o=o=>{let c=o;return{get:()=>c,set:C=>{c=C}}},G={generate:o=>{if(!_(o))throw new Error("cases must be an array");if(o.length===0)throw new Error("there must be at least one case");const c=[],m={};return gt(o,(b,C)=>{const x=Zs(b);if(x.length!==1)throw new Error("one and only one name per case");const M=x[0],I=b[M];if(m[M]!==void 0)throw new Error("duplicate key detected:"+M);if(M==="cata")throw new Error("cannot have a case named cata (sorry)");if(!_(I))throw new Error("case arguments must be an array");c.push(M),m[M]=(...W)=>{const J=W.length;if(J!==I.length)throw new Error("Wrong number of arguments to case "+M+". Expected "+I.length+" ("+I+"), got "+J);return{fold:(...fe)=>{if(fe.length!==o.length)throw new Error("Wrong number of arguments to fold. Expected "+o.length+", got "+fe.length);return fe[C].apply(null,W)},match:fe=>{const me=Zs(fe);if(c.length!==me.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+`
|
|
Actual: `+me.join(","));if(!Ut(c,Ne=>ct(me,Ne)))throw new Error("Not all branches were specified when using match. Specified: "+me.join(", ")+`
|
|
Required: `+c.join(", "));return fe[M].apply(null,W)},log:fe=>{console.log(fe,{constructors:c,constructor:M,params:W})}}}}),m}};G.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ve=o=>{const c=[],m=[];return gt(o,b=>{b.fold(C=>{c.push(C)},C=>{m.push(C)})}),{errors:c,values:m}},De=(o,c)=>{const m={};return ar(o,(b,C)=>{ct(c,C)||(m[C]=b)}),m},at=(o,c)=>({[o]:c}),Ft=o=>{const c={};return gt(o,m=>{c[m.key]=m.value}),c},kn=(o,c)=>De(o,c),Ln=(o,c)=>at(o,c),jo=o=>Ft(o),Qo=(o,c)=>o.length===0?Cn.value(c):Cn.value(Jr(c,wd.apply(void 0,o))),vi=o=>Cn.error(Tt(o)),tr=(o,c)=>{const m=ve(o);return m.errors.length>0?vi(m.errors):Qo(m.values,c)},vr=o=>z(o)?o:Je,Bc=(o,c,m)=>{let b=o.dom;const C=vr(m);for(;b.parentNode;){b=b.parentNode;const x=it.fromDom(b),M=c(x);if(M.isSome())return M;if(C(x))break}return V.none()},Qc=(o,c,m)=>{const b=c(o),C=vr(m);return b.orThunk(()=>C(o)?V.none():Bc(o,c,C))},Gu=(o,c)=>kr(o.element,c.event.target),kf={can:ft,abort:Je,run:F},oh=o=>{if(!Li(o,"can")&&!Li(o,"abort")&&!Li(o,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(o,null,2)+" does not have can, abort, or run!");return{...kf,...o}},sh=(o,c)=>(...m)=>ao(o,(b,C)=>b&&c(C).apply(void 0,m),!0),lr=(o,c)=>(...m)=>ao(o,(b,C)=>b||c(C).apply(void 0,m),!1),Um=o=>z(o)?{can:ft,abort:Je,run:o}:o,Wm=o=>{const c=sh(o,C=>C.can),m=lr(o,C=>C.abort);return{can:c,abort:m,run:(...C)=>{gt(o,x=>{x.run.apply(void 0,C)})}}},ea=X,eu=ea("touchstart"),zp=ea("touchmove"),jm=ea("touchend"),Os=ea("touchcancel"),Br=ea("mousedown"),Da=ea("mousemove"),cc=ea("mouseout"),j1=ea("mouseup"),Sl=ea("mouseover"),Gi=ea("focusin"),tu=ea("focusout"),Ef=ea("keydown"),F_=ea("keyup"),Kh=ea("input"),Wg=ea("change"),Yh=ea("click"),Zm=ea("transitioncancel"),jg=ea("transitionend"),tb=ea("transitionstart"),Xh=ea("selectstart"),Oa=o=>X("alloy."+o),rh={tap:Oa("tap")},Ed=Oa("focus"),qm=Oa("blur.post"),Gm=Oa("paste.post"),Jh=Oa("receive"),Ku=Oa("execute"),nb=Oa("focus.item"),Z1=rh.tap,H_=Oa("longpress"),Ma=Oa("sandbox.close"),Zg=Oa("typeahead.cancel"),Km=Oa("system.init"),nu=Oa("system.touchmove"),Af=Oa("system.touchend"),Ym=Oa("system.scroll"),ih=Oa("system.resize"),xu=Oa("system.attached"),Ad=Oa("system.detached"),Xm=Oa("system.dismissRequested"),ob=Oa("system.repositionRequested"),Cv=Oa("focusmanager.shifted"),Sv=Oa("slotcontainer.visibility"),ah=Oa("system.external.element.scroll"),qg=Oa("change.tab"),kv=Oa("dismiss.tab"),Jm=Oa("highlight"),Ev=Oa("dehighlight"),nr=(o,c)=>{Gg(o,o.element,c,{})},Do=(o,c,m)=>{Gg(o,o.element,c,m)},lh=o=>{nr(o,Ku())},q1=(o,c,m)=>{Gg(o,c,m,{})},Gg=(o,c,m,b)=>{const C={target:c,...b};o.getSystem().triggerEvent(m,c,C)},Tk=(o,c,m,b)=>{const C={...b,target:c};o.getSystem().triggerEvent(m,c,C)},Av=(o,c,m,b)=>{o.getSystem().triggerEvent(m,c,b.event)},ri=o=>jo(o),xv=(o,c)=>({key:o,value:oh({abort:c})}),G1=(o,c)=>({key:o,value:oh({can:c})}),g2=o=>({key:o,value:oh({run:(c,m)=>{m.event.prevent()}})}),en=(o,c)=>({key:o,value:oh({run:c})}),xd=(o,c,m)=>({key:o,value:oh({run:(b,C)=>{c.apply(void 0,[b,C].concat(m))}})}),$_=o=>c=>en(o,c),sb=o=>c=>({key:o,value:oh({run:(m,b)=>{Gu(m,b)&&c(m,b)}})}),Dk=(o,c)=>en(o,(m,b)=>{m.getSystem().getByUid(c).each(C=>{Av(C,C.element,o,b)})}),Qm=(o,c,m)=>{const b=c.partUids[m];return Dk(o,b)},p2=(o,c)=>en(o,(m,b)=>{const C=b.event,x=m.getSystem().getByDom(C.target).getOrThunk(()=>Qc(C.target,I=>m.getSystem().getByDom(I).toOptional(),Je).getOr(m));c(m,x,b)}),Qh=o=>en(o,(c,m)=>{m.cut()}),Td=o=>en(o,(c,m)=>{m.stop()}),eg=(o,c)=>sb(o)(c),yi=sb(xu()),Dd=sb(Ad()),Od=sb(Km()),ou=$_(Ku()),Hs=(o,c)=>{const b=(c||document).createElement("div");return b.innerHTML=o,Ul(it.fromDom(b))},Vp=o=>o.dom.innerHTML,ch=(o,c)=>{const b=sa(o).dom,C=it.fromDom(b.createDocumentFragment()),x=Hs(c,b);Wu(C,x),oi(o),nl(o,C)},Kg=o=>{const c=it.fromTag("div"),m=it.fromDom(o.dom.cloneNode(!0));return nl(c,m),Vp(c)},Ok=(o,c)=>it.fromDom(o.dom.cloneNode(c)),rb=o=>Ok(o,!1),Tv=o=>{if(xe(o))return"#shadow-root";{const c=rb(o);return Kg(c)}},kl=o=>Tv(o),o3=(o,c,m)=>kr(c,o.element)&&!kr(c,m),Yg=ri([G1(Ed(),(o,c)=>{const m=c.event,b=m.originator,C=m.target;return o3(o,b,C)?(console.warn(Ed()+` did not get interpreted by the desired target.
|
|
Originator: `+kl(b)+`
|
|
Target: `+kl(C)+`
|
|
Check the `+Ed()+" event handlers"),!1):!0})]);var El=Object.freeze({__proto__:null,events:Yg});let b2=0;const ro=o=>{const m=new Date().getTime(),b=Math.floor(Math.random()*1e9);return b2++,o+"_"+b+b2+String(m)},v2=X("alloy-id-"),Mk=X("data-alloy-id"),y2=v2(),em=Mk(),Yu=(o,c)=>{const m=ro(y2+o);return uh(c,m),m},uh=(o,c)=>{Object.defineProperty(o.dom,em,{value:c,writable:!0})},Xg=o=>{const c=pr(o)?o.dom[em]:null;return V.from(c)},fh=o=>ro(o),ib=we,xf=o=>{const c=C=>`The component must be in a context to execute: ${C}`+(o?`
|
|
`+kl(o().element)+" is not in context.":""),m=C=>()=>{throw new Error(c(C))},b=C=>()=>{console.warn(c(C))};return{debugInfo:X("fake"),triggerEvent:b("triggerEvent"),triggerFocus:b("triggerFocus"),triggerEscape:b("triggerEscape"),broadcast:b("broadcast"),broadcastOn:b("broadcastOn"),broadcastEvent:b("broadcastEvent"),build:m("build"),buildOrPatch:m("buildOrPatch"),addToWorld:m("addToWorld"),removeFromWorld:m("removeFromWorld"),addToGui:m("addToGui"),removeFromGui:m("removeFromGui"),getByUid:m("getByUid"),getByDom:m("getByDom"),isConnected:Je}},Jg=xf(),w2=(o,c,m)=>{const b=m.toString(),C=b.indexOf(")")+1,x=b.indexOf("("),M=b.substring(x+1,C-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:c,parameters:Up(M.slice(0,1).concat(M.slice(3)))}),o},Up=o=>qe(o,c=>Fi(c,"/*")?c.substring(0,c.length-2):c),Gf=(o,c)=>{const m=o.toString(),b=m.indexOf(")")+1,C=m.indexOf("("),x=m.substring(C+1,b-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:c,parameters:Up(x)}),o},_2=(o,c)=>{const m=c.toString(),b=m.indexOf(")")+1,C=m.indexOf("("),x=m.substring(C+1,b-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Up(x.slice(1))}),o},dh=ro("alloy-premade"),Dv=o=>(Object.defineProperty(o.element.dom,dh,{value:o.uid,writable:!0}),Ln(dh,o)),z_=o=>ps(o.dom,dh),C2=o=>ln(o,dh),Qg=o=>_2((c,...m)=>o(c.getApis(),c,...m),o),Tf={init:()=>su({readState:X("No State required")})},su=o=>o,ep=(o,c)=>{const m=qe(c,C=>ja(C.name(),[Qt("config"),At("state",Tf)])),b=Ui("component.behaviours",lo(m),o.behaviours).fold(C=>{throw new Error(kd(C)+`
|
|
Complete spec:
|
|
`+JSON.stringify(o,null,2))},we);return{list:c,data:Ns(b,C=>{const x=C.map(M=>({config:M.config,state:M.state.init(M.config)}));return X(x)})}},S2=o=>o.list,V_=o=>o.data,ab=(o,c)=>{const m={};return ar(o,(b,C)=>{ar(b,(x,M)=>{const I=ln(m,M).getOr([]);m[M]=I.concat([c(C,x)])})}),m},Lc=o=>({classes:N(o.classes)?[]:o.classes,attributes:N(o.attributes)?{}:o.attributes,styles:N(o.styles)?{}:o.styles}),lb=(o,c)=>({...o,attributes:{...o.attributes,...c.attributes},styles:{...o.styles,...c.styles},classes:o.classes.concat(c.classes)}),Xu=(o,c,m,b)=>{const C={...c};gt(m,re=>{C[re.name()]=re.exhibit(o,b)});const x=ab(C,(re,fe)=>({name:re,modification:fe})),M=re=>Bn(re,(fe,me)=>({...me.modification,...fe}),{}),I=Bn(x.classes,(re,fe)=>fe.modification.concat(re),[]),W=M(x.attributes),J=M(x.styles);return Lc({classes:I,attributes:W,styles:J})},tp=(o,c,m,b)=>{try{const C=rs(m,(x,M)=>{const I=x[c],W=M[c],J=b.indexOf(I),re=b.indexOf(W);if(J===-1)throw new Error("The ordering for "+o+" does not have an entry for "+I+`.
|
|
Order specified: `+JSON.stringify(b,null,2));if(re===-1)throw new Error("The ordering for "+o+" does not have an entry for "+W+`.
|
|
Order specified: `+JSON.stringify(b,null,2));return J<re?-1:re<J?1:0});return Cn.value(C)}catch(C){return Cn.error([C])}},tm=(o,c)=>({handler:o,purpose:c}),Ov=(o,c)=>({cHandler:o,purpose:c}),U_=(o,c)=>Ov(Te.apply(void 0,[o.handler].concat(c)),o.purpose),Wp=o=>o.cHandler,k2=(o,c)=>({name:o,handler:c}),np=(o,c)=>{const m={};return gt(o,b=>{m[b.name()]=b.handlers(c)}),m},cb=(o,c,m)=>{const b={...m,...np(c,o)};return ab(b,k2)},K1=(o,c,m,b)=>{const C=cb(o,m,b);return Rk(C,c)},E2=o=>{const c=Um(o);return(m,b,...C)=>{const x=[m,b].concat(C);c.abort.apply(void 0,x)?b.stop():c.can.apply(void 0,x)&&c.run.apply(void 0,x)}},A2=(o,c)=>Cn.error(["The event ("+o+`) has more than one behaviour that listens to it.
|
|
When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).
|
|
The behaviours that can trigger it are: `+JSON.stringify(qe(c,m=>m.name),null,2)]),W_=(o,c,m)=>{const b=c[m];return b?tp("Event: "+m,"name",o,b).map(C=>{const x=qe(C,M=>M.handler);return Wm(x)}):A2(m,o)},Rk=(o,c)=>{const m=na(o,(b,C)=>(b.length===1?Cn.value(b[0].handler):W_(b,c,C)).map(M=>{const I=E2(M),W=b.length>1?Zn(c[C],J=>an(b,re=>re.name===J)).join(" > "):b[0].name;return Ln(C,tm(I,W))}));return tr(m,{})},Lr="alloy.base.behaviour",Mv=lo([Va("dom","dom",br(),lo([Qt("tag"),At("styles",{}),At("classes",[]),At("attributes",{}),Ar("value"),Ar("innerHtml")])),Qt("components"),Qt("uid"),At("events",{}),At("apis",{}),Va("eventOrder","eventOrder",_f({[Ku()]:["disabling",Lr,"toggling","typeaheadevents"],[Ed()]:[Lr,"focusing","keying"],[Km()]:[Lr,"disabling","toggling","representing"],[Kh()]:[Lr,"representing","streaming","invalidating"],[Ad()]:[Lr,"representing","item-events","tooltipping"],[Br()]:["focusing",Lr,"item-type-events"],[eu()]:["focusing",Lr,"item-type-events"],[Sl()]:["item-type-events","tooltipping"],[Jh()]:["receiving","reflecting","tooltipping"]}),Pc()),Ar("domModification")]),x2=o=>Ui("custom.definition",Mv,o),T2=o=>({...o.dom,uid:o.uid,domChildren:qe(o.components,c=>c.element)}),ub=o=>o.domModification.fold(()=>Lc({}),Lc),Nk=o=>o.events,nm=(o,c)=>{const m=$i(o,c);return m===void 0||m===""?[]:m.split(" ")},Ga=(o,c,m)=>{const C=nm(o,c).concat([m]);return Xn(o,c,C.join(" ")),!0},fb=(o,c,m)=>{const b=Zn(nm(o,c),C=>C!==m);return b.length>0?Xn(o,c,b.join(" ")):We(o,c),!1},Y1=o=>o.dom.classList!==void 0,j_=o=>nm(o,"class"),db=(o,c)=>Ga(o,"class",c),D2=(o,c)=>fb(o,"class",c),Ra=(o,c)=>{Y1(o)?o.dom.classList.add(c):db(o,c)},hh=o=>{(Y1(o)?o.dom.classList:j_(o)).length===0&&We(o,"class")},ma=(o,c)=>{Y1(o)?o.dom.classList.remove(c):D2(o,c),hh(o)},Ju=(o,c)=>Y1(o)&&o.dom.classList.contains(c),tg=(o,c)=>{gt(c,m=>{Ra(o,m)})},Fc=(o,c)=>{gt(c,m=>{ma(o,m)})},Pk=(o,c)=>Ut(c,m=>Ju(o,m)),O2=o=>{const c=o.dom.classList,m=new Array(c.length);for(let b=0;b<c.length;b++){const C=c.item(b);C!==null&&(m[b]=C)}return m},Kf=o=>Y1(o)?O2(o):j_(o),Na=o=>o.dom.value,Sa=(o,c)=>{if(c===void 0)throw new Error("Value.set was undefined");o.dom.value=c},Ik=(o,c,m)=>Rc(o,c).map(C=>{if(m.exists(M=>!kr(M,C))){const M=m.map(dl).getOr("span"),I=it.fromTag(M);return ya(C,I),I}else return C}),mh=(o,c,m)=>{m.fold(()=>nl(o,c),b=>{kr(b,c)||(ya(b,c),_u(b))})},hb=(o,c,m)=>{const b=qe(c,m),C=Ul(o);return gt(C.slice(b.length),_u),b},Rv=(o,c,m,b)=>{const C=Rc(o,c),x=b(m,C),M=Ik(o,c,C);return mh(o,x.element,M),x},Yf=(o,c,m)=>hb(o,c,(b,C)=>Rv(o,C,b,m)),Qu=(o,c)=>hb(o,c,(m,b)=>{const C=Rc(o,b);return mh(o,m,C),m}),jp=(o,c)=>{const m=Zs(o),b=Zs(c),C=wt(b,m),x=Mr(o,(M,I)=>!ps(c,I)||M!==c[I]).t;return{toRemove:C,toSet:x}},X1=(o,c)=>{const{class:m,style:b,...C}=Bt(c),{toSet:x,toRemove:M}=jp(o.attributes,C),I=()=>{gt(M,Zt=>We(c,Zt)),Nm(c,x)},W=ni(c),{toSet:J,toRemove:re}=jp(o.styles,W),fe=()=>{gt(re,Zt=>Ss(c,Zt)),gi(c,J)},me=Kf(c),Ce=wt(me,o.classes),Ne=wt(o.classes,me),st=()=>{tg(c,Ne),Fc(c,Ce)},Ht=Zt=>{ch(c,Zt)},dt=()=>{const Zt=o.domChildren;Qu(c,Zt)},lt=()=>{const Zt=c,Ot=o.value.getOrUndefined();Ot!==Na(Zt)&&Sa(Zt,Ot!=null?Ot:"")};return I(),st(),fe(),o.innerHtml.fold(dt,Ht),lt(),c},mb=o=>{const c=it.fromTag(o.tag);Nm(c,o.attributes),tg(c,o.classes),gi(c,o.styles),o.innerHtml.each(b=>ch(c,b));const m=o.domChildren;return Wu(c,m),o.value.each(b=>{Sa(c,b)}),c},gb=(o,c)=>{try{const m=X1(o,c);return V.some(m)}catch{return V.none()}},Z_=o=>o.innerHtml.isSome()&&o.domChildren.length>0,M2=(o,c)=>{const m=C=>dl(C)===o.tag&&!Z_(o)&&!z_(C),b=c.filter(m).bind(C=>gb(o,C)).getOrThunk(()=>mb(o));return uh(b,o.uid),b},Bk=o=>{const c=ln(o,"behaviours").getOr({});return Be(Zs(c),m=>{const b=c[m];return j(b)?[b.me]:[]})},q_=(o,c)=>ep(o,c),G_=o=>{const c=Bk(o);return q_(o,c)},R2=(o,c,m)=>{const b=T2(o),C=ub(o),x={"alloy.base.modification":C},M=c.length>0?Xu(m,x,c,b):C;return lb(b,M)},K_=(o,c,m)=>{const b={"alloy.base.behaviour":Nk(o)};return K1(m,o.eventOrder,c,b).getOrDie()},s3=(o,c)=>{const m=()=>Zt,b=$o(Jg),C=ha(x2(o)),x=G_(o),M=S2(x),I=V_(x),W=R2(C,M,I),J=M2(W,c),re=K_(C,M,I),fe=$o(C.components),me=Ot=>{b.set(Ot)},Ce=()=>{b.set(xf(m))},Ne=()=>{const Ot=Ul(J),An=Be(Ot,mn=>b.get().getByDom(mn).fold(()=>[],vn));fe.set(An)},st=Ot=>{const An=I;return(z(An[Ot.name()])?An[Ot.name()]:()=>{throw new Error("Could not find "+Ot.name()+" in "+JSON.stringify(o,null,2))})()},Ht=Ot=>z(I[Ot.name()]),dt=()=>C.apis,lt=Ot=>I[Ot]().map(An=>An.state.readState()).getOr("not enabled"),Zt={uid:o.uid,getSystem:b.get,config:st,hasConfigured:Ht,spec:o,readState:lt,getApis:dt,connect:me,disconnect:Ce,element:J,syncComponents:Ne,components:fe.get,events:re};return Zt},Nv=(o,c)=>{const m=ln(o,"components").getOr([]);return c.fold(()=>qe(m,uc),b=>qe(m,(C,x)=>ng(C,Rc(b,x))))},Y_=(o,c)=>{const{events:m,...b}=ib(o),C=Nv(b,c),x={...b,events:{...El,...m},components:C};return Cn.value(s3(x,c))},Ni=o=>{const c=it.fromText(o);return Pv({element:c})},Pv=o=>{const c=As("external.component",bi([Qt("element"),Ar("uid")]),o),m=$o(xf()),b=I=>{m.set(I)},C=()=>{m.set(xf(()=>M))},x=c.uid.getOrThunk(()=>fh("external"));uh(c.element,x);const M={uid:x,getSystem:m.get,config:V.none,hasConfigured:Je,connect:b,disconnect:C,getApis:()=>({}),element:c.element,spec:o,readState:X("No state"),syncComponents:F,components:X([]),events:{}};return Dv(M)},N2=fh,X_=o=>ps(o,"uid"),ng=(o,c)=>C2(o).getOrThunk(()=>{const m=X_(o)?o:{uid:N2(""),...o};return Y_(m,c).getOrDie()}),uc=o=>ng(o,V.none()),ru=Dv;var J_=(o,c,m,b,C)=>o(m,b)?V.some(m):z(C)&&C(m)?V.none():c(m,b,C);const P2=(o,c,m)=>{let b=o.dom;const C=z(m)?m:Je;for(;b.parentNode;){b=b.parentNode;const x=it.fromDom(b);if(c(x))return V.some(x);if(C(x))break}return V.none()},op=(o,c,m)=>J_((C,x)=>x(C),P2,o,c,m),sp=(o,c)=>{const m=C=>c(it.fromDom(C));return St(o.dom.childNodes,m).map(it.fromDom)},Zp=(o,c)=>{const m=b=>{for(let C=0;C<b.childNodes.length;C++){const x=it.fromDom(b.childNodes[C]);if(c(x))return V.some(x);const M=m(b.childNodes[C]);if(M.isSome())return M}return V.none()};return m(o.dom)},qp=(o,c,m)=>op(o,c,m).isSome(),og=(o,c,m)=>P2(o,b=>Aa(b,c),m),Iv=(o,c)=>sp(o,m=>Aa(m,c)),ta=(o,c)=>gf(c,o),ef=(o,c,m)=>J_((C,x)=>Aa(C,x),og,o,c,m),J1="aria-controls",Lk=o=>op(o,m=>{if(!pr(m))return!1;const b=$i(m,"id");return b!==void 0&&b.indexOf(J1)>-1}).bind(m=>{const b=$i(m,"id"),C=Pt(m);return ta(C,`[${J1}="${b}"]`)}),I2=()=>{const o=ro(J1);return{id:o,link:b=>{Xn(b,J1,o)},unlink:b=>{We(b,J1)}}},Fk=(o,c)=>Lk(c).exists(m=>Gp(o,m)),Gp=(o,c)=>qp(c,m=>kr(m,o.element),Je)||Fk(o,c),Q1="unknown";var Xf;(function(o){o[o.STOP=0]="STOP",o[o.NORMAL=1]="NORMAL",o[o.LOGGING=2]="LOGGING"})(Xf||(Xf={}));const B2=$o({}),Q_=(o,c)=>{const m=[],b=new Date().getTime();return{logEventCut:(C,x,M)=>{m.push({outcome:"cut",target:x,purpose:M})},logEventStopped:(C,x,M)=>{m.push({outcome:"stopped",target:x,purpose:M})},logNoParent:(C,x,M)=>{m.push({outcome:"no-parent",target:x,purpose:M})},logEventNoHandlers:(C,x)=>{m.push({outcome:"no-handlers-left",target:x})},logEventResponse:(C,x,M)=>{m.push({outcome:"response",purpose:M,target:x})},write:()=>{const C=new Date().getTime();ct(["mousemove","mouseover","mouseout",Km()],o)||console.log(o,{event:o,time:C-b,target:c.dom,sequence:qe(m,x=>ct(["cut","stopped","response"],x.outcome)?"{"+x.purpose+"} "+x.outcome+" at ("+kl(x.target)+")":x.outcome)})}}},eC=(o,c,m)=>{switch(ln(B2.get(),o).orThunk(()=>{const C=Zs(B2.get());return Js(C,x=>o.indexOf(x)>-1?V.some(B2.get()[x]):V.none())}).getOr(Xf.NORMAL)){case Xf.NORMAL:return m(nC());case Xf.LOGGING:{const C=Q_(o,c),x=m(C);return C.write(),x}case Xf.STOP:return!0}},Hk=["alloy/data/Fields","alloy/debugging/Debugging"],tC=()=>{const o=new Error;if(o.stack!==void 0){const c=o.stack.split(`
|
|
`);return St(c,m=>m.indexOf("alloy")>0&&!an(Hk,b=>m.indexOf(b)>-1)).getOr(Q1)}else return Q1},pb={logEventCut:F,logEventStopped:F,logNoParent:F,logEventNoHandlers:F,logEventResponse:F,write:F},bb=(o,c,m)=>eC(o,c,m),nC=X(pb),L2=X([Qt("menu"),Qt("selectedMenu")]),Kp=X([Qt("item"),Qt("selectedItem")]);X(lo(Kp().concat(L2())));const oC=X(lo(Kp())),Yp=qf("initSize",[Qt("numColumns"),Qt("numRows")]),sg=()=>Gr("markers",oC()),Bv=()=>qf("markers",[Qt("backgroundMenu")].concat(L2()).concat(Kp())),tf=o=>qf("markers",qe(o,Qt)),e0=(o,c,m)=>(tC(),Va(c,c,m,Zu(b=>Cn.value((...C)=>b.apply(void 0,C))))),Gs=o=>e0("onHandler",o,Uf(F)),iu=o=>e0("onKeyboardHandler",o,Uf(V.none)),rg=o=>e0("onHandler",o,br()),F2=o=>e0("onKeyboardHandler",o,br()),Wi=(o,c)=>_a(o,X(c)),H2=o=>_a(o,we),ig=X(Yp),ga=(o,c,m,b,C,x,M,I=!1)=>({x:o,y:c,bubble:m,direction:b,placement:C,restriction:x,label:`${M}-${C}`,alwaysFit:I}),om=G.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Vt=(o,c,m,b,C,x,M,I,W)=>o.fold(c,m,b,C,x,M,I,W),vb=(o,c,m,b)=>o.fold(c,c,b,b,c,b,m,m),$2=(o,c,m,b)=>o.fold(c,b,c,b,m,m,c,b),yb=om.southeast,gh=om.southwest,nf=om.northeast,t0=om.northwest,Lv=om.south,z2=om.north,Fv=om.east,wb=om.west,ph=(o,c,m,b)=>{const C=o+c;return C>b?m:C<m?b:C},Jf=(o,c,m)=>Math.min(Math.max(o,c),m),Tu=(o,c)=>{switch(c){case 1:return o.x;case 0:return o.x+o.width;case 2:return o.y;case 3:return o.y+o.height}},Fl=(o,c)=>Yt(["left","right","top","bottom"],m=>ln(c,m).map(b=>Tu(o,b))),V2=(o,c,m)=>{const b=(W,J)=>c[W].map(re=>{const fe=W==="top"||W==="bottom",me=fe?m.top:m.left,Ne=(W==="left"||W==="top"?Math.max:Math.min)(re,J)+me;return fe?Jf(Ne,o.y,o.bottom):Jf(Ne,o.x,o.right)}).getOr(J),C=b("left",o.x),x=b("top",o.y),M=b("right",o.right),I=b("bottom",o.bottom);return si(C,x,M-C,I-x)},rp="layout",sC=o=>o.x,_b=(o,c)=>o.x+o.width/2-c.width/2,Xp=(o,c)=>o.x+o.width-c.width,U2=(o,c)=>o.y-c.height,Hv=o=>o.y+o.height,rC=(o,c)=>o.y+o.height/2-c.height/2,$v=o=>o.x+o.width,W2=(o,c)=>o.x-c.width,gl=(o,c,m)=>ga(sC(o),Hv(o),m.southeast(),yb(),"southeast",Fl(o,{left:1,top:3}),rp),Kl=(o,c,m)=>ga(Xp(o,c),Hv(o),m.southwest(),gh(),"southwest",Fl(o,{right:0,top:3}),rp),Du=(o,c,m)=>ga(sC(o),U2(o,c),m.northeast(),nf(),"northeast",Fl(o,{left:1,bottom:2}),rp),Fr=(o,c,m)=>ga(Xp(o,c),U2(o,c),m.northwest(),t0(),"northwest",Fl(o,{right:0,bottom:2}),rp),Yl=(o,c,m)=>ga(_b(o,c),U2(o,c),m.north(),z2(),"north",Fl(o,{bottom:2}),rp),Hl=(o,c,m)=>ga(_b(o,c),Hv(o),m.south(),Lv(),"south",Fl(o,{top:3}),rp),sm=(o,c,m)=>ga($v(o),rC(o,c),m.east(),Fv(),"east",Fl(o,{left:0}),rp),yr=(o,c,m)=>ga(W2(o,c),rC(o,c),m.west(),wb(),"west",Fl(o,{right:1}),rp),iC=()=>[gl,Kl,Du,Fr,Hl,Yl,sm,yr],au=()=>[Kl,gl,Fr,Du,Hl,Yl,sm,yr],Al=()=>[Du,Fr,gl,Kl,Yl,Hl],j2=()=>[Fr,Du,Kl,gl,Yl,Hl],ag=()=>[gl,Kl,Du,Fr,Hl,Yl],fc=()=>[Kl,gl,Fr,Du,Hl,Yl],r3=(o,c)=>c.universal?o:Zn(o,m=>ct(c.channels,m));var $k=Object.freeze({__proto__:null,events:o=>ri([en(Jh(),(c,m)=>{const b=o.channels,C=Zs(b),x=m,M=r3(C,x);gt(M,I=>{const W=b[I],J=W.schema,re=As("channel["+I+`] data
|
|
Receiver: `+kl(c.element),J,x.data);W.onReceive(c,re)})})])}),zk=[Gr("channels",U1(Cn.value,bi([rg("onReceive"),At("schema",Pc())])))];const Z2=(o,c,m)=>ou(b=>{m(b,o,c)}),q2=(o,c,m)=>Od((b,C)=>{m(b,o,c)}),rm=(o,c,m,b,C,x)=>{const M=bi(o),I=ja(c,[ac("config",o)]);return xl(M,I,c,m,b,C,x)},G2=(o,c,m,b,C,x)=>{const M=o,I=ja(c,[Wa("config",o)]);return xl(M,I,c,m,b,C,x)},Jp=(o,c,m)=>w2((C,...x)=>{const M=[C].concat(x);return C.config({name:X(o)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+m)},I=>{const W=Array.prototype.slice.call(M,1);return c.apply(void 0,[C,I.config,I.state].concat(W))})},m,c),pl=o=>({key:o,value:void 0}),xl=(o,c,m,b,C,x,M)=>{const I=fe=>Li(fe,m)?fe[m]():V.none(),W=Ns(C,(fe,me)=>Jp(m,fe,me)),re={...Ns(x,(fe,me)=>Gf(fe,me)),...W,revoke:Te(pl,m),config:fe=>{const me=As(m+"-config",o,fe);return{key:m,value:{config:me,me:re,configAsRaw:xi(()=>As(m+"-config",o,fe)),initialConfig:fe,state:M}}},schema:X(c),exhibit:(fe,me)=>qn(I(fe),ln(b,"exhibit"),(Ce,Ne)=>Ne(me,Ce.config,Ce.state)).getOrThunk(()=>Lc({})),name:X(m),handlers:fe=>I(fe).map(me=>ln(b,"events").getOr(()=>({}))(me.config,me.state)).getOr({})};return re},Tn=o=>jo(o),Vk=bi([Qt("fields"),Qt("name"),At("active",{}),At("apis",{}),At("state",Tf),At("extra",{})]),Xl=o=>{const c=As("Creating behaviour: "+o.name,Vk,o);return rm(c.fields,c.name,c.active,c.apis,c.extra,c.state)},Uk=bi([Qt("branchKey"),Qt("branches"),Qt("name"),At("active",{}),At("apis",{}),At("state",Tf),At("extra",{})]),K2=o=>{const c=As("Creating behaviour: "+o.name,Uk,o);return G2(Cl(c.branchKey,c.branches),c.name,c.active,c.apis,c.extra,c.state)},oo=X(void 0),Cc=Xl({fields:zk,name:"receiving",active:$k});var n0=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({classes:[],styles:c.useFixed()?{}:{position:"relative"}})});const of=o=>o.dom.focus(),zv=o=>o.dom.blur(),Qp=o=>{const c=Pt(o).dom;return o.dom===c.activeElement},Df=(o=Yd())=>V.from(o.dom.activeElement).map(it.fromDom),ol=o=>Df(Pt(o)).filter(c=>o.dom.contains(c.dom)),Md=(o,c)=>{const m=Pt(c),b=Df(m).bind(x=>{const M=I=>kr(x,I);return M(c)?V.some(c):Zp(c,M)}),C=o(c);return b.each(x=>{Df(m).filter(M=>kr(M,x)).fold(()=>{of(x)},F)}),C},Rd=(o,c,m,b,C)=>{const x=M=>M+"px";return{position:o,left:c.map(x),top:m.map(x),right:b.map(x),bottom:C.map(x)}},Hc=o=>({...o,position:V.some(o.position)}),o0=(o,c)=>{hn(o,Hc(c))},X2=G.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),aC=(o,c,m,b,C,x)=>{const M=c.rect,I=M.x-m,W=M.y-b,J=M.width,re=M.height,fe=C-(I+J),me=x-(W+re),Ce=V.some(I),Ne=V.some(W),st=V.some(fe),Ht=V.some(me),dt=V.none();return Vt(c.direction,()=>Rd(o,Ce,Ne,dt,dt),()=>Rd(o,dt,Ne,st,dt),()=>Rd(o,Ce,dt,dt,Ht),()=>Rd(o,dt,dt,st,Ht),()=>Rd(o,Ce,Ne,dt,dt),()=>Rd(o,Ce,dt,dt,Ht),()=>Rd(o,Ce,Ne,dt,dt),()=>Rd(o,dt,Ne,st,dt))},J2=(o,c)=>o.fold(()=>{const m=c.rect;return Rd("absolute",V.some(m.x),V.some(m.y),V.none(),V.none())},(m,b,C,x)=>aC("absolute",c,m,b,C,x),(m,b,C,x)=>aC("fixed",c,m,b,C,x)),bh=(o,c)=>{const m=Te(qh,c),b=o.fold(m,m,()=>{const M=ic();return qh(c).translate(-M.left,-M.top)}),C=$a(c),x=Lf(c);return si(b.left,b.top,C,x)},jr=(o,c)=>c.fold(()=>o.fold(ce,ce,si),m=>o.fold(X(m),X(m),()=>{const b=Vv(o,m.x,m.y);return si(b.left,b.top,m.width,m.height)})),Vv=(o,c,m)=>{const b=fr(c,m),C=()=>{const x=ic();return b.translate(-x.left,-x.top)};return o.fold(X(b),X(b),C)},Qf=(o,c,m,b)=>o.fold(c,m,b);X2.none;const lC=X2.relative,cC=X2.fixed,ia=(o,c)=>({anchorBox:o,origin:c}),Wk=(o,c)=>ia(o,c),Uv="data-alloy-placement",Wv=(o,c)=>{Xn(o,Uv,c)},uC=o=>he(o,Uv),jk=o=>We(o,Uv),s0=G.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),fC=(o,c)=>{const{x:m,y:b,right:C,bottom:x}=c,{x:M,y:I,right:W,bottom:J,width:re,height:fe}=o,me=M>=m&&M<=C,Ce=I>=b&&I<=x,Ne=me&&Ce,st=W<=C&&W>=m,Ht=J<=x&&J>=b,dt=st&&Ht,lt=Math.min(re,M>=m?C-M:W-m),Zt=Math.min(fe,I>=b?x-I:J-b);return{originInBounds:Ne,sizeInBounds:dt,visibleW:lt,visibleH:Zt}},Zk=(o,c)=>{const{x:m,y:b,right:C,bottom:x}=c,{x:M,y:I,width:W,height:J}=o,re=Math.max(m,C-W),fe=Math.max(b,x-J),me=Jf(M,m,re),Ce=Jf(I,b,fe),Ne=Math.min(me+W,C)-me,st=Math.min(Ce+J,x)-Ce;return si(me,Ce,Ne,st)},dC=(o,c,m)=>{const b=X(c.bottom-m.y),C=X(m.bottom-c.y),x=vb(o,C,C,b),M=X(c.right-m.x),I=X(m.right-c.x);return{maxWidth:$2(o,I,I,M),maxHeight:x}},qk=(o,c,m,b)=>{const C=o.bubble,x=C.offset,M=V2(b,o.restriction,x),I=o.x+x.left,W=o.y+x.top,J=si(I,W,c,m),{originInBounds:re,sizeInBounds:fe,visibleW:me,visibleH:Ce}=fC(J,M),Ne=re&&fe,st=Ne?J:Zk(J,M),Ht=st.width>0&&st.height>0,{maxWidth:dt,maxHeight:lt}=dC(o.direction,st,b),Zt={rect:st,maxHeight:lt,maxWidth:dt,direction:o.direction,placement:o.placement,classes:{on:C.classesOn,off:C.classesOff},layout:o.label,testY:W};return Ne||o.alwaysFit?s0.fit(Zt):s0.nofit(Zt,me,Ce,Ht)},hC=(o,c,m,b,C,x)=>{const M=b.width,I=b.height,W=(re,fe,me,Ce,Ne)=>{const st=re(m,b,C,o,x),Ht=qk(st,M,I,x);return Ht.fold(X(Ht),(dt,lt,Zt,Ot)=>(Ne===Ot?Zt>Ce||lt>me:!Ne&&Ot)?Ht:s0.nofit(fe,me,Ce,Ne))};return ao(c,(re,fe)=>{const me=Te(W,fe);return re.fold(X(re),me)},s0.nofit({rect:m,maxHeight:b.height,maxWidth:b.width,direction:yb(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:m.y},-1,-1,!1)).fold(we,we)},jv=o=>{const c=$o(V.none()),m=()=>c.get().each(o);return{clear:()=>{m(),c.set(V.none())},isSet:()=>c.get().isSome(),get:()=>c.get(),set:I=>{m(),c.set(V.some(I))}}},ip=()=>jv(o=>o.destroy()),r0=()=>jv(o=>o.unbind()),ji=()=>{const o=jv(F);return{...o,on:m=>o.get().each(m)}},Q2=ft,Sc=(o,c,m)=>pi(o,c,Q2,m),i0=(o,c,m)=>Gd(o,c,Q2,m),sl=er,mC=["top","bottom","right","left"],im="data-alloy-transition-timer",Gk=(o,c)=>Pk(o,c.classes),Jl=(o,c,m)=>m.exists(b=>{const C=o.mode;return C==="all"?!0:b[C]!==c[C]}),sf=(o,c)=>{const m=b=>parseFloat(b).toFixed(3);return gs(c,(b,C)=>{const x=o[C].map(m),M=b.map(m);return!Qe(x,M)}).isSome()},Cb=o=>{const c=x=>{const I=qr(o,x).split(/\s*,\s*/);return Zn(I,Ke)},m=x=>{if(h(x)&&/^[\d.]+/.test(x)){const M=parseFloat(x);return Fi(x,"ms")?M:M*1e3}else return 0},b=c("transition-delay"),C=c("transition-duration");return ao(C,(x,M,I)=>{const W=m(b[I])+m(M);return Math.max(x,W)},0)},Kk=(o,c)=>{const m=r0(),b=r0();let C;const x=J=>{var re;const fe=(re=J.raw.pseudoElement)!==null&&re!==void 0?re:"";return kr(J.target,o)&&Ge(fe)&&ct(mC,J.raw.propertyName)},M=J=>{if(L(J)||x(J)){m.clear(),b.clear();const re=J==null?void 0:J.raw.type;(L(re)||re===jg())&&(clearTimeout(C),We(o,im),Fc(o,c.classes))}},I=Sc(o,tb(),J=>{x(J)&&(I.unbind(),m.set(Sc(o,jg(),M)),b.set(Sc(o,Zm(),M)))}),W=Cb(o);requestAnimationFrame(()=>{C=setTimeout(M,W+17),Xn(o,im,C)})},Yk=(o,c)=>{tg(o,c.classes),he(o,im).each(m=>{clearTimeout(parseInt(m,10)),We(o,im)}),Kk(o,c)},gC=(o,c,m,b,C,x)=>{const M=Jl(b,C,x);if(M||Gk(o,b)){so(o,"position",m.position);const I=bh(c,o),W=J2(c,{...C,rect:I}),J=Yt(mC,re=>W[re]);sf(m,J)&&(hn(o,J),M&&Yk(o,b),Kc(o))}else Fc(o,b.classes)},Sb=o=>({width:$a(o),height:Lf(o)}),pC=(o,c,m,b)=>{Ss(c,"max-height"),Ss(c,"max-width");const C=Sb(c);return hC(c,b.preference,o,C,m,b.bounds)},bC=(o,c)=>{const m=c.classes;Fc(o,m.off),tg(o,m.on)},ap=(o,c,m)=>{const b=m.maxHeightFunction;b(o,c.maxHeight)},Xk=(o,c,m)=>{const b=m.maxWidthFunction;b(o,c.maxWidth)},Jk=(o,c,m)=>{const b=J2(m.origin,c);m.transition.each(C=>{gC(o,m.origin,b,C,c,m.lastPlacement)}),o0(o,b)},Qk=(o,c)=>{Wv(o,c.placement)},ew=(o,c)=>{da(o,Math.floor(c))},Zv=X((o,c)=>{ew(o,c),gi(o,{"overflow-x":"hidden","overflow-y":"auto"})}),cg=X((o,c)=>{ew(o,c)}),vC=(o,c,m)=>o[c]===void 0?m:o[c],yC=(o,c,m,b,C,x,M,I)=>{const W=vC(M,"maxHeightFunction",Zv()),J=vC(M,"maxWidthFunction",F),re=o.anchorBox,fe=o.origin,me={bounds:jr(fe,x),origin:fe,preference:b,maxHeightFunction:W,maxWidthFunction:J,lastPlacement:C,transition:I};return qv(re,c,m,me)},qv=(o,c,m,b)=>{const C=pC(o,c,m,b);return Jk(c,C,b),Qk(c,C),bC(c,C),ap(c,C,b),Xk(c,C,b),{layout:C.layout,placement:C.placement}},a0=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],ug=(o,c,m,b=1)=>{const C=o*b,x=c*b,M=W=>ln(m,W).getOr([]),I=(W,J,re)=>{const fe=wt(a0,re);return{offset:fr(W,J),classesOn:Be(re,M),classesOff:Be(fe,M)}};return{southeast:()=>I(-o,c,["top","alignLeft"]),southwest:()=>I(o,c,["top","alignRight"]),south:()=>I(-o/2,c,["top","alignCentre"]),northeast:()=>I(-o,-c,["bottom","alignLeft"]),northwest:()=>I(o,-c,["bottom","alignRight"]),north:()=>I(-o/2,-c,["bottom","alignCentre"]),east:()=>I(o,-c/2,["valignCentre","left"]),west:()=>I(-o,-c/2,["valignCentre","right"]),insetNortheast:()=>I(C,x,["top","alignLeft","inset"]),insetNorthwest:()=>I(-C,x,["top","alignRight","inset"]),insetNorth:()=>I(-C/2,x,["top","alignCentre","inset"]),insetSoutheast:()=>I(C,-x,["bottom","alignLeft","inset"]),insetSouthwest:()=>I(-C,-x,["bottom","alignRight","inset"]),insetSouth:()=>I(-C/2,-x,["bottom","alignCentre","inset"]),insetEast:()=>I(-C,-x/2,["valignCentre","right","inset"]),insetWest:()=>I(C,-x/2,["valignCentre","left","inset"])}},Gv=()=>ug(0,0,{}),Kv=we,kb=(o,c)=>m=>wC(m)==="rtl"?c:o,wC=o=>qr(o,"direction")==="rtl"?"rtl":"ltr";var vh;(function(o){o.TopToBottom="toptobottom",o.BottomToTop="bottomtotop"})(vh||(vh={}));const Eb="data-alloy-vertical-dir",_C=o=>qp(o,c=>pr(c)&&$i(c,"data-alloy-vertical-dir")===vh.BottomToTop),yh=()=>ja("layouts",[Qt("onLtr"),Qt("onRtl"),Ar("onBottomLtr"),Ar("onBottomRtl")]),lp=(o,c,m,b,C,x,M)=>{const I=M.map(_C).getOr(!1),W=c.layouts.map(Ce=>Ce.onLtr(o)),J=c.layouts.map(Ce=>Ce.onRtl(o)),re=I?c.layouts.bind(Ce=>Ce.onBottomLtr.map(Ne=>Ne(o))).or(W).getOr(C):W.getOr(m),fe=I?c.layouts.bind(Ce=>Ce.onBottomRtl.map(Ne=>Ne(o))).or(J).getOr(x):J.getOr(b);return kb(re,fe)(o)},tw=(o,c,m)=>{const b=c.hotspot,C=bh(m,b.element),x=lp(o.element,c,ag(),fc(),Al(),j2(),V.some(c.hotspot.element));return V.some(Kv({anchorBox:C,bubble:c.bubble.getOr(Gv()),overrides:c.overrides,layouts:x}))};var CC=[Qt("hotspot"),Ar("bubble"),At("overrides",{}),yh(),Wi("placement",tw)];const Yv=(o,c,m)=>{const b=Vv(m,c.x,c.y),C=si(b.left,b.top,c.width,c.height),x=lp(o.element,c,iC(),au(),iC(),au(),V.none());return V.some(Kv({anchorBox:C,bubble:c.bubble,overrides:c.overrides,layouts:x}))};var eE=[Qt("x"),Qt("y"),At("height",0),At("width",0),At("bubble",Gv()),At("overrides",{}),yh(),Wi("placement",Yv)];const SC=G.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),tE=o=>o.fold(we,(c,m,b)=>c.translate(-m,-b)),nE=o=>o.fold(we,we),kC=o=>ao(o,(c,m)=>c.translate(m.left,m.top),fr(0,0)),EC=o=>{const c=qe(o,tE);return kC(c)},AC=o=>{const c=qe(o,nE);return kC(c)},oE=SC.screen,sE=SC.absolute,rE=(o,c,m)=>{const b=Oc(m.root).dom,C=x=>{const M=sa(x),I=sa(o.element);return kr(M,I)};return V.from(b.frameElement).map(it.fromDom).filter(C).map(vc)},xC=(o,c,m)=>{const b=sa(o.element),C=ic(b),x=rE(o,c,m).getOr(C);return sE(x,C.left,C.top)},nw=(o,c,m,b)=>{const C=oE(fr(o,c));return V.some(Xd(C,m,b))},ow=(o,c,m,b,C)=>o.map(x=>{const M=[c,x.point],I=Qf(b,()=>AC(M),()=>AC(M),()=>EC(M)),W=yd(I.left,I.top,x.width,x.height),J=m.showAbove?Al():ag(),re=m.showAbove?j2():fc(),fe=lp(C,m,J,re,J,re,V.none());return Kv({anchorBox:W,bubble:m.bubble.getOr(Gv()),overrides:m.overrides,layouts:fe})}),iE=(o,c,m)=>{const b=xC(o,m,c);return c.node.filter(qs).bind(C=>{const x=C.dom.getBoundingClientRect(),M=nw(x.left,x.top,x.width,x.height),I=c.node.getOr(o.element);return ow(M,b,c,m,I)})};var aE=[Qt("node"),Qt("root"),Ar("bubble"),yh(),At("overrides",{}),At("showAbove",!1),Wi("placement",iE)];const Xv="\uFEFF",TC="\xA0",Ab={create:(o,c,m,b)=>({start:o,soffset:c,finish:m,foffset:b})},l0=G.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Qv=(o,c,m,b)=>o.fold(c,m,b),sw=o=>o.fold(we,we,we),DC=l0.before,rw=l0.on,lE=l0.after,ey={before:DC,on:rw,after:lE,cata:Qv,getStart:sw},xb=G.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),cE=o=>xb.exact(o.start,o.soffset,o.finish,o.foffset),ty=o=>o.match({domRange:c=>it.fromDom(c.startContainer),relative:(c,m)=>ey.getStart(c),exact:(c,m,b,C)=>c}),rf=xb.domRange,ny=xb.relative,OC=xb.exact,oy=o=>{const c=ty(o);return Oc(c)},uE=Ab.create,Tb={domRange:rf,relative:ny,exact:OC,exactFromRange:cE,getWin:oy,range:uE},iw=(o,c)=>{c.fold(m=>{o.setStartBefore(m.dom)},(m,b)=>{o.setStart(m.dom,b)},m=>{o.setStartAfter(m.dom)})},fE=(o,c)=>{c.fold(m=>{o.setEndBefore(m.dom)},(m,b)=>{o.setEnd(m.dom,b)},m=>{o.setEndAfter(m.dom)})},sy=(o,c,m)=>{const b=o.document.createRange();return iw(b,c),fE(b,m),b},bl=(o,c,m,b,C)=>{const x=o.document.createRange();return x.setStart(c.dom,m),x.setEnd(b.dom,C),x},dE=o=>({left:o.left,top:o.top,right:o.right,bottom:o.bottom,width:o.width,height:o.height}),c0=o=>{const c=o.getClientRects(),m=c.length>0?c[0]:o.getBoundingClientRect();return m.width>0||m.height>0?V.some(m).map(dE):V.none()},hE=o=>{const c=o.getBoundingClientRect();return c.width>0||c.height>0?V.some(c).map(dE):V.none()},u0=G.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),aw=(o,c,m)=>c(it.fromDom(m.startContainer),m.startOffset,it.fromDom(m.endContainer),m.endOffset),mE=(o,c)=>c.match({domRange:m=>({ltr:X(m),rtl:V.none}),relative:(m,b)=>({ltr:xi(()=>sy(o,m,b)),rtl:xi(()=>V.some(sy(o,b,m)))}),exact:(m,b,C,x)=>({ltr:xi(()=>bl(o,m,b,C,x)),rtl:xi(()=>V.some(bl(o,C,x,m,b)))})}),gE=(o,c)=>{const m=c.ltr();return m.collapsed?c.rtl().filter(C=>C.collapsed===!1).map(C=>u0.rtl(it.fromDom(C.endContainer),C.endOffset,it.fromDom(C.startContainer),C.startOffset)).getOrThunk(()=>aw(o,u0.ltr,m)):aw(o,u0.ltr,m)},Db=(o,c)=>{const m=mE(o,c);return gE(o,m)},am=(o,c)=>Db(o,c).match({ltr:(b,C,x,M)=>{const I=o.document.createRange();return I.setStart(b.dom,C),I.setEnd(x.dom,M),I},rtl:(b,C,x,M)=>{const I=o.document.createRange();return I.setStart(x.dom,M),I.setEnd(b.dom,C),I}});u0.ltr,u0.rtl;const f0=(o,c,m)=>Zn(gd(o,m),c),lu=(o,c)=>Rm(c,o),e1=(o,c,m,b)=>{const x=sa(o).dom.createRange();return x.setStart(o.dom,c),x.setEnd(m.dom,b),x},MC=(o,c,m,b)=>{const C=e1(o,c,m,b),x=kr(o,m)&&c===b;return C.collapsed&&!x},RC=o=>V.from(o.getSelection()),lw=o=>{if(o.rangeCount>0){const c=o.getRangeAt(0),m=o.getRangeAt(o.rangeCount-1);return V.some(Ab.create(it.fromDom(c.startContainer),c.startOffset,it.fromDom(m.endContainer),m.endOffset))}else return V.none()},cw=o=>{if(o.anchorNode===null||o.focusNode===null)return lw(o);{const c=it.fromDom(o.anchorNode),m=it.fromDom(o.focusNode);return MC(c,o.anchorOffset,m,o.focusOffset)?V.some(Ab.create(c,o.anchorOffset,m,o.focusOffset)):lw(o)}},uw=o=>RC(o).filter(c=>c.rangeCount>0).bind(cw),pE=(o,c)=>{const m=am(o,c);return c0(m)},Ob=(o,c)=>{const m=am(o,c);return hE(m)},cp=((o,c)=>{const m=x=>{if(!o(x))throw new Error("Can only get "+c+" value of a "+c+" node");return b(x).getOr("")},b=x=>o(x)?V.from(x.dom.nodeValue):V.none();return{get:m,getOption:b,set:(x,M)=>{if(!o(x))throw new Error("Can only set raw "+c+" value of a "+c+" node");x.dom.nodeValue=M}}})(Qa,"text"),Mb=o=>cp.get(o),wh=(o,c)=>({element:o,offset:c}),bE=(o,c)=>{const m=Ul(o);if(m.length===0)return wh(o,c);if(c<m.length)return wh(m[c],0);{const b=m[m.length-1],C=Qa(b)?Mb(b).length:Ul(b).length;return wh(b,C)}},lm=(o,c)=>Qa(o)?wh(o,c):bE(o,c),Nd=o=>o.foffset!==void 0,d0=(o,c)=>c.getSelection.getOrThunk(()=>()=>uw(o))().map(b=>{if(Nd(b)){const C=lm(b.start,b.soffset),x=lm(b.finish,b.foffset);return Tb.range(C.element,C.offset,x.element,x.offset)}else return b}),fw=(o,c,m)=>{const b=Oc(c.root).dom,C=xC(o,m,c),x=d0(b,c).bind(W=>{if(Nd(W))return Ob(b,Tb.exactFromRange(W)).orThunk(()=>{const re=it.fromText(Xv);ya(W.start,re);const fe=pE(b,Tb.exact(re,0,re,1));return _u(re),fe}).bind(re=>nw(re.left,re.top,re.width,re.height));{const J=Ns(W,fe=>fe.dom.getBoundingClientRect()),re={left:Math.min(J.firstCell.left,J.lastCell.left),right:Math.max(J.firstCell.right,J.lastCell.right),top:Math.min(J.firstCell.top,J.lastCell.top),bottom:Math.max(J.firstCell.bottom,J.lastCell.bottom)};return nw(re.left,re.top,re.right-re.left,re.bottom-re.top)}}),I=d0(b,c).bind(W=>Nd(W)?pr(W.start)?V.some(W.start):bc(W.start):V.some(W.firstCell)).getOr(o.element);return ow(x,C,c,m,I)};var h0=[Ar("getSelection"),Qt("root"),Ar("bubble"),yh(),At("overrides",{}),At("showAbove",!1),Wi("placement",fw)];const fg="link-layout",S=o=>o.x+o.width,T=(o,c)=>o.x-c.width,H=(o,c)=>o.y-c.height+o.height,le=o=>o.y,ke=(o,c,m)=>ga(S(o),le(o),m.southeast(),yb(),"southeast",Fl(o,{left:0,top:2}),fg),Ue=(o,c,m)=>ga(T(o,c),le(o),m.southwest(),gh(),"southwest",Fl(o,{right:1,top:2}),fg),ht=(o,c,m)=>ga(S(o),H(o,c),m.northeast(),nf(),"northeast",Fl(o,{left:0,bottom:3}),fg),Ct=(o,c,m)=>ga(T(o,c),H(o,c),m.northwest(),t0(),"northwest",Fl(o,{right:1,bottom:3}),fg),zt=()=>[ke,Ue,ht,Ct],pn=()=>[Ue,ke,Ct,ht],$n=(o,c,m)=>{const b=bh(m,c.item.element),C=lp(o.element,c,zt(),pn(),zt(),pn(),V.none());return V.some(Kv({anchorBox:b,bubble:Gv(),overrides:c.overrides,layouts:C}))};var Vn=[Qt("item"),yh(),At("overrides",{}),Wi("placement",$n)],Fo=Cl("type",{selection:h0,node:aE,hotspot:CC,submenu:Vn,makeshift:eE});const hs=[Ll("classes",ml),Au("mode","all",["all","layout","placement"])],Ps=[At("useFixed",Je),Ar("getBounds")],Hr=[Gr("anchor",Fo),ja("transition",hs)],$s=()=>{const o=document.documentElement;return cC(0,0,o.clientWidth,o.clientHeight)},fi=o=>{const c=vc(o.element),m=o.element.dom.getBoundingClientRect();return lC(c.left,c.top,m.width,m.height)},wi=(o,c,m,b,C,x)=>{const M=Wk(c.anchorBox,o);return yC(M,b.element,c.bubble,c.layouts,C,m,c.overrides,x)},cu=(o,c,m,b,C)=>{const x=V.none();Ou(o,c,m,b,C,x)},Ou=(o,c,m,b,C,x)=>{const M=As("placement.info",lo(Hr),C),I=M.anchor,W=b.element,J=m.get(b.uid);Md(()=>{so(W,"position","fixed");const re=Xi(W,"visibility");so(W,"visibility","hidden");const fe=c.useFixed()?$s():fi(o);I.placement(o,I,fe).each(me=>{const Ce=x.orThunk(()=>c.getBounds.map(nt)),Ne=wi(fe,me,Ce,b,J,M.transition);m.set(b.uid,Ne)}),re.fold(()=>{Ss(W,"visibility")},me=>{so(W,"visibility",me)}),Xi(W,"left").isNone()&&Xi(W,"top").isNone()&&Xi(W,"right").isNone()&&Xi(W,"bottom").isNone()&&ze(Xi(W,"position"),"fixed")&&Ss(W,"position")},W)};var cm=Object.freeze({__proto__:null,position:cu,positionWithinBounds:Ou,getMode:(o,c,m)=>c.useFixed()?"fixed":"absolute",reset:(o,c,m,b)=>{const C=b.element;gt(["position","left","right","top","bottom"],x=>Ss(C,x)),jk(C),m.clear(b.uid)}}),dw=Object.freeze({__proto__:null,init:()=>{let o={};return su({readState:()=>o,clear:C=>{j(C)?delete o[C]:o={}},set:(C,x)=>{o[C]=x},get:C=>ln(o,C)})}});const uu=Xl({fields:Ps,name:"positioning",active:n0,apis:cm,state:dw}),NC=o=>o.getSystem().isConnected(),Rb=o=>{nr(o,Ad());const c=o.components();gt(c,Rb)},Nb=o=>{const c=o.components();gt(c,Nb),nr(o,xu())},Pd=(o,c)=>{o.getSystem().addToWorld(c),qs(o.element)&&Nb(c)},m0=o=>{Rb(o),o.getSystem().removeFromWorld(o)},vE=(o,c)=>{nl(o.element,c.element)},iy=o=>{gt(o.components(),c=>_u(c.element)),oi(o.element),o.syncComponents()},Mf=(o,c,m)=>{const b=o.components();iy(o);const C=m(c),x=wt(b,C);gt(x,M=>{Rb(M),o.getSystem().removeFromWorld(M)}),gt(C,M=>{NC(M)?vE(o,M):(o.getSystem().addToWorld(M),vE(o,M),qs(o.element)&&Nb(M))}),o.syncComponents()},Mu=(o,c,m)=>{const b=o.components(),C=Be(c,I=>C2(I).toArray());gt(b,I=>{ct(C,I)||m0(I)});const x=m(c),M=wt(b,x);gt(M,I=>{NC(I)&&m0(I)}),gt(x,I=>{NC(I)||Pd(o,I)}),o.syncComponents()},rl=(o,c)=>{Id(o,c,nl)},Id=(o,c,m)=>{o.getSystem().addToWorld(c),m(o.element,c.element),qs(o.element)&&Nb(c),o.syncComponents()},PC=o=>{Rb(o),_u(o.element),o.getSystem().removeFromWorld(o)},$c=o=>{const c=Ha(o.element).bind(m=>o.getSystem().getByDom(m).toOptional());PC(o),c.each(m=>{m.syncComponents()})},g0=o=>{const c=o.components();gt(c,PC),oi(o.element),o.syncComponents()},ay=(o,c)=>{yE(o,c,nl)},hw=(o,c)=>{yE(o,c,vd)},yE=(o,c,m)=>{m(o,c.element);const b=Ul(c.element);gt(b,C=>{c.getByDom(C).each(Nb)})},wE=o=>{const c=Ul(o.element);gt(c,m=>{o.getByDom(m).each(Rb)}),_u(o.element)},t1=(o,c,m,b)=>{m.get().each(M=>{g0(o)});const C=c.getAttachPoint(o);rl(C,o);const x=o.getSystem().build(b);return rl(o,x),m.set(x),x},mw=(o,c,m,b)=>{const C=t1(o,c,m,b);return c.onOpen(o,C),C},dg=(o,c,m,b)=>m.get().map(()=>t1(o,c,m,b)),xO=(o,c,m,b,C)=>{SE(o,c),mw(o,c,m,b),C(),c3(o,c)},_E=(o,c,m)=>{m.get().each(b=>{g0(o),$c(o),c.onClose(o,b),m.clear()})},i3=(o,c,m)=>m.isOpen(),kI=(o,c,m,b)=>i3(o,c,m)&&m.get().exists(C=>c.isPartOf(o,C,b)),a3=(o,c,m)=>m.get(),l3=(o,c,m,b)=>{Xi(o.element,c).fold(()=>{We(o.element,m)},C=>{Xn(o.element,m,C)}),so(o.element,c,b)},CE=(o,c,m)=>{he(o.element,m).fold(()=>Ss(o.element,c),b=>so(o.element,c,b))},SE=(o,c,m)=>{const b=c.getAttachPoint(o);so(o.element,"position",uu.getMode(b)),l3(o,"visibility",c.cloakVisibilityAttr,"hidden")},kE=o=>an(["top","left","right","bottom"],c=>Xi(o,c).isSome()),c3=(o,c,m)=>{kE(o.element)||Ss(o.element,"position"),CE(o,"visibility",c.cloakVisibilityAttr)};var u3=Object.freeze({__proto__:null,cloak:SE,decloak:c3,open:mw,openWhileCloaked:xO,close:_E,isOpen:i3,isPartOf:kI,getState:a3,setContent:dg}),TO=Object.freeze({__proto__:null,events:(o,c)=>ri([en(Ma(),(m,b)=>{_E(m,o,c)})])}),DO=[Gs("onOpen"),Gs("onClose"),Qt("isPartOf"),Qt("getAttachPoint"),At("cloakVisibilityAttr","data-precloak-visibility")],OO=Object.freeze({__proto__:null,init:()=>{const o=ji(),c=X("not-implemented");return su({readState:c,isOpen:o.isSet,clear:o.clear,set:o.set,get:o.get})}});const Ks=Xl({fields:DO,name:"sandboxing",active:TO,apis:u3,state:OO}),_h=X("dismiss.popups"),p0=X("reposition.popups"),EE=X("mouse.released"),d3=bi([At("isExtraPart",Je),ja("fireEventInstead",[At("event",Xm())])]),ly=o=>{const c=As("Dismissal",d3,o);return{[_h()]:{schema:bi([Qt("target")]),onReceive:(m,b)=>{Ks.isOpen(m)&&(Ks.isPartOf(m,b.target)||c.isExtraPart(m,b.target)||c.fireEventInstead.fold(()=>Ks.close(m),x=>nr(m,x.event)))}}}},MO=bi([ja("fireEventInstead",[At("event",ob())]),Ic("doReposition")]),AE=o=>{const c=As("Reposition",MO,o);return{[p0()]:{onReceive:m=>{Ks.isOpen(m)&&c.fireEventInstead.fold(()=>c.doReposition(m),b=>nr(m,b.event))}}}},IC=(o,c,m)=>{c.store.manager.onLoad(o,c,m)},gw=(o,c,m)=>{c.store.manager.onUnload(o,c,m)};var TE=Object.freeze({__proto__:null,onLoad:IC,onUnload:gw,setValue:(o,c,m,b)=>{c.store.manager.setValue(o,c,m,b)},getValue:(o,c,m)=>c.store.manager.getValue(o,c,m),getState:(o,c,m)=>m}),h3=Object.freeze({__proto__:null,events:(o,c)=>{const m=o.resetOnDom?[yi((b,C)=>{IC(b,o,c)}),Dd((b,C)=>{gw(b,o,c)})]:[q2(o,c,IC)];return ri(m)}});const DE=()=>{const o=$o(null),c=()=>({mode:"memory",value:o.get()}),m=()=>o.get()===null,b=()=>{o.set(null)};return su({set:o.set,get:o.get,isNotSet:m,clear:b,readState:c})},cy=()=>su({readState:F}),pw=()=>{const o=$o({}),c=$o({});return su({readState:()=>({mode:"dataset",dataByValue:o.get(),dataByText:c.get()}),lookup:M=>ln(o.get(),M).orThunk(()=>ln(c.get(),M)),update:M=>{const I=o.get(),W=c.get(),J={},re={};gt(M,fe=>{J[fe.value]=fe,ln(fe,"meta").each(me=>{ln(me,"text").each(Ce=>{re[Ce]=fe})})}),o.set({...I,...J}),c.set({...W,...re})},clear:()=>{o.set({}),c.set({})}})};var up=Object.freeze({__proto__:null,memory:DE,dataset:pw,manual:cy,init:o=>o.store.manager.state(o)});const m3=(o,c,m,b)=>{const C=c.store;m.update([b]),C.setValue(o,b),c.onSetValue(o,b)},NO=(o,c,m)=>{const b=c.store,C=b.getDataKey(o);return m.lookup(C).getOrThunk(()=>b.getFallbackEntry(C))},g3=(o,c,m)=>{c.store.initialValue.each(C=>{m3(o,c,m,C)})},OE=(o,c,m)=>{m.clear()};var uy=[Ar("initialValue"),Qt("getFallbackEntry"),Qt("getDataKey"),Qt("setValue"),Wi("manager",{setValue:m3,getValue:NO,onLoad:g3,onUnload:OE,state:pw})];const ME=(o,c,m)=>c.store.getValue(o),LC=(o,c,m,b)=>{c.store.setValue(o,b),c.onSetValue(o,b)},RE=(o,c,m)=>{c.store.initialValue.each(b=>{c.store.setValue(o,b)})};var p3=[Qt("getValue"),At("setValue",F),Ar("initialValue"),Wi("manager",{setValue:LC,getValue:ME,onLoad:RE,onUnload:F,state:Tf.init})];const bw=(o,c,m,b)=>{m.set(b),c.onSetValue(o,b)},NE=(o,c,m)=>m.get(),PO=(o,c,m)=>{c.store.initialValue.each(b=>{m.isNotSet()&&m.set(b)})},um=(o,c,m)=>{m.clear()};var b3=[Ar("initialValue"),Wi("manager",{setValue:bw,getValue:NE,onLoad:PO,onUnload:um,state:DE})],IO=[_c("store",{mode:"memory"},Cl("mode",{memory:b3,manual:p3,dataset:uy})),Gs("onSetValue"),At("resetOnDom",!1)];const Jn=Xl({fields:IO,name:"representing",active:h3,apis:TE,extra:{setValueFrom:(o,c)=>{const m=Jn.getValue(c);Jn.setValue(o,m)}},state:up}),$l=(o,c)=>eb(o,{},qe(c,m=>Zf(m.name(),"Cannot configure "+m.name()+" for "+o)).concat([_a("dump",we)])),fm=o=>o.dump,Ql=(o,c)=>({...Tn(c),...o.dump}),dm={field:$l,augment:Ql,get:fm},v3="placeholder",vw=G.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ch=o=>ps(o,"uiType"),FC=(o,c,m,b)=>o.exists(C=>C!==m.owner)?vw.single(!0,X(m)):ln(b,m.name).fold(()=>{throw new Error("Unknown placeholder component: "+m.name+`
|
|
Known: [`+Zs(b)+`]
|
|
Namespace: `+o.getOr("none")+`
|
|
Spec: `+JSON.stringify(m,null,2))},C=>C.replace()),yw=(o,c,m,b)=>Ch(m)&&m.uiType===v3?FC(o,c,m,b):vw.single(!1,X(m)),ww=(o,c,m,b)=>yw(o,c,m,b).fold((x,M)=>{const I=Ch(m)?M(c,m.config,m.validated):M(c),W=ln(I,"components").getOr([]),J=Be(W,re=>ww(o,c,re,b));return[{...I,components:J}]},(x,M)=>{if(Ch(m)){const I=M(c,m.config,m.validated);return m.validated.preprocess.getOr(we)(I)}else return M(c)}),PE=(o,c,m,b)=>Be(m,C=>ww(o,c,C,b)),_w=(o,c)=>{let m=!1;const b=()=>m,C=()=>{if(m)throw new Error("Trying to use the same placeholder more than once: "+o);return m=!0,c},x=()=>c.fold((M,I)=>M,(M,I)=>M);return{name:X(o),required:x,used:b,replace:C}},HC=(o,c,m,b)=>{const C=Ns(b,(M,I)=>_w(I,M)),x=PE(o,c,m,C);return ar(C,M=>{if(M.used()===!1&&M.required())throw new Error("Placeholder: "+M.name()+` was not found in components list
|
|
Namespace: `+o.getOr("none")+`
|
|
Components: `+JSON.stringify(c.components,null,2))}),x},IE=vw.single,BO=vw.multiple,hm=X(v3),$C=G.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Cw=At("factory",{sketch:we}),td=At("schema",[]),Tl=Qt("name"),BE=Va("pname","pname",ql(o=>"<alloy."+ro(o.name)+">"),Pc()),Sw=_a("schema",()=>[Ar("preprocess")]),Ld=At("defaults",X({})),kw=At("overrides",X({})),LE=lo([Cw,td,Tl,BE,Ld,kw]),FE=lo([Cw,td,Tl,Ld,kw]),LO=lo([Cw,td,Tl,BE,Ld,kw]),y3=lo([Cw,Sw,Tl,Qt("unit"),BE,Ld,kw]),Ew=o=>o.fold(V.some,V.none,V.some,V.some),w3=o=>{const c=m=>m.name;return o.fold(c,c,c,c)},FO=o=>o.fold(we,we,we,we),v0=(o,c)=>m=>{const b=As("Converting part type",c,m);return o(b)},zc=v0($C.required,LE),Sh=v0($C.external,FE),Fd=v0($C.optional,LO),nd=v0($C.group,y3),zC=X("entirety");var Pb=Object.freeze({__proto__:null,required:zc,external:Sh,optional:Fd,group:nd,asNamedPart:Ew,name:w3,asCommon:FO,original:zC});const n1=(o,c,m,b)=>Jr(c.defaults(o,m,b),m,{uid:o.partUids[c.name]},c.overrides(o,m,b)),HO=(o,c,m)=>{const b={},C={};return gt(m,x=>{x.fold(M=>{b[M.pname]=IE(!0,(I,W,J)=>M.factory.sketch(n1(I,M,W,J)))},M=>{const I=c.parts[M.name];C[M.name]=X(M.factory.sketch(n1(c,M,I[zC()]),I))},M=>{b[M.pname]=IE(!1,(I,W,J)=>M.factory.sketch(n1(I,M,W,J)))},M=>{b[M.pname]=BO(!0,(I,W,J)=>{const re=I[M.name];return qe(re,fe=>M.factory.sketch(Jr(M.defaults(I,fe,J),fe,M.overrides(I,fe))))})})}),{internals:X(b),externals:X(C)}},HE=(o,c)=>{const m={};return gt(c,b=>{Ew(b).each(C=>{const x=$O(o,C.pname);m[C.name]=M=>{const I=As("Part: "+C.name+" in "+o,lo(C.schema),M);return{...x,config:M,validated:I}}})}),m},$O=(o,c)=>({uiType:hm(),owner:o,name:c}),_3=(o,c,m)=>({uiType:hm(),owner:o,name:c,config:m,validated:{}}),C3=o=>Be(o,c=>c.fold(V.none,V.some,V.none,V.none).map(m=>qf(m.name,m.schema.concat([H2(zC())]))).toArray()),S3=o=>qe(o,w3),VC=(o,c,m)=>HO(o,c,m),$E=(o,c,m)=>HC(V.some(o),c,c.components,m),Ti=(o,c,m)=>{const b=c.partUids[m];return o.getSystem().getByUid(b).toOptional()},o1=(o,c,m)=>Ti(o,c,m).getOrDie("Could not find part: "+m),fy=(o,c,m)=>{const b={},C=c.partUids,x=o.getSystem();return gt(m,M=>{b[M]=X(x.getByUid(C[M]))}),b},zE=(o,c)=>{const m=o.getSystem();return Ns(c.partUids,(b,C)=>X(m.getByUid(b)))},k3=o=>Zs(o.partUids),VE=(o,c,m)=>{const b={},C=c.partUids,x=o.getSystem();return gt(m,M=>{b[M]=X(x.getByUid(C[M]).getOrDie())}),b},E3=(o,c)=>{const m=S3(c);return jo(qe(m,b=>({key:b,value:o+"-"+b})))},UC=o=>Va("partUids","partUids",Ae(c=>E3(c.uid,o)),Pc());var zO=Object.freeze({__proto__:null,generate:HE,generateOne:_3,schemas:C3,names:S3,substitutes:VC,components:$E,defaultUids:E3,defaultUidsSchema:UC,getAllParts:zE,getAllPartNames:k3,getPart:Ti,getPartOrDie:o1,getParts:fy,getPartsOrDie:VE});const VO=(o,c)=>(o.length>0?[qf("parts",o)]:[]).concat([Qt("uid"),At("dom",{}),At("components",[]),H2("originalSpec"),At("debug.sketcher",{})]).concat(c),A3=(o,c,m,b,C)=>{const x=VO(b,C);return As(o+" [SpecSchema]",bi(x.concat(c)),m)},UO=(o,c,m,b)=>{const C=hy(b),x=A3(o,c,C,[],[]);return m(x,C)},UE=(o,c,m,b,C)=>{const x=hy(C),M=C3(m),I=UC(m),W=A3(o,c,x,M,[I]),J=VC(o,W,m),re=$E(o,W,J.internals());return b(W,re,x,J.externals())},dy=o=>ps(o,"uid"),hy=o=>dy(o)?o:{...o,uid:fh("uid")},WC=o=>o.uid!==void 0,x3=bi([Qt("name"),Qt("factory"),Qt("configFields"),At("apis",{}),At("extraApis",{})]),kh=bi([Qt("name"),Qt("factory"),Qt("configFields"),Qt("partFields"),At("apis",{}),At("extraApis",{})]),Vc=o=>{const c=As("Sketcher for "+o.name,x3,o),m=x=>UO(c.name,c.configFields,c.factory,x),b=Ns(c.apis,Qg),C=Ns(c.extraApis,(x,M)=>Gf(x,M));return{name:c.name,configFields:c.configFields,sketch:m,...b,...C}},fu=o=>{const c=As("Sketcher for "+o.name,kh,o),m=M=>UE(c.name,c.configFields,c.partFields,c.factory,M),b=HE(c.name,c.partFields),C=Ns(c.apis,Qg),x=Ns(c.extraApis,(M,I)=>Gf(M,I));return{name:c.name,partFields:c.partFields,configFields:c.configFields,sketch:m,parts:b,...C,...x}},fp=o=>Vl("input")(o)&&$i(o,"type")!=="radio"||Vl("textarea")(o);var jO=Object.freeze({__proto__:null,getCurrent:(o,c,m)=>c.find(o)});const ZO=[Qt("find")],sr=Xl({fields:ZO,name:"composing",apis:jO}),qO=["input","button","textarea","select"],T3=(o,c,m)=>{(c.disabled()?Aw:WE)(o,c)},jC=(o,c)=>c.useNative===!0&&ct(qO,dl(o.element)),GO=o=>Re(o.element,"disabled"),no=o=>{Xn(o.element,"disabled","disabled")},Ib=o=>{We(o.element,"disabled")},KO=o=>$i(o.element,"aria-disabled")==="true",D3=o=>{Xn(o.element,"aria-disabled","true")},ZC=o=>{Xn(o.element,"aria-disabled","false")},Aw=(o,c,m)=>{c.disableClass.each(C=>{Ra(o.element,C)}),(jC(o,c)?no:D3)(o),c.onDisabled(o)},WE=(o,c,m)=>{c.disableClass.each(C=>{ma(o.element,C)}),(jC(o,c)?Ib:ZC)(o),c.onEnabled(o)},jE=(o,c)=>jC(o,c)?GO(o):KO(o);var AI=Object.freeze({__proto__:null,enable:WE,disable:Aw,isDisabled:jE,onLoad:T3,set:(o,c,m,b)=>{(b?Aw:WE)(o,c)}}),qC=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({classes:c.disabled()?c.disableClass.toArray():[]}),events:(o,c)=>ri([xv(Ku(),(m,b)=>jE(m,o)),q2(o,c,T3)])}),XO=[qa("disabled",Je),At("useNative",!0),Ar("disableClass"),Gs("onDisabled"),Gs("onEnabled")];const Xo=Xl({fields:XO,name:"disabling",active:qC,apis:AI}),JO=(o,c,m,b)=>{const C=lu(o.element,"."+c.highlightClass);gt(C,x=>{an(b,I=>kr(I.element,x))||(ma(x,c.highlightClass),o.getSystem().getByDom(x).each(I=>{c.onDehighlight(o,I),nr(I,Ev())}))})},QO=(o,c,m)=>JO(o,c,m,[]),xI=(o,c,m,b)=>{Tw(o,c,m,b)&&(ma(b.element,c.highlightClass),c.onDehighlight(o,b),nr(b,Ev()))},xw=(o,c,m,b)=>{JO(o,c,m,[b]),Tw(o,c,m,b)||(Ra(b.element,c.highlightClass),c.onHighlight(o,b),nr(b,Jm()))},GC=(o,c,m)=>{qE(o,c).each(b=>{xw(o,c,m,b)})},eM=(o,c,m)=>{GE(o,c).each(b=>{xw(o,c,m,b)})},tM=(o,c,m,b)=>{R3(o,c,m,b).fold(C=>{throw C},C=>{xw(o,c,m,C)})},nM=(o,c,m,b)=>{const C=KE(o,c);St(C,b).each(M=>{xw(o,c,m,M)})},Tw=(o,c,m,b)=>Ju(b.element,c.highlightClass),ZE=(o,c,m)=>ta(o.element,"."+c.highlightClass).bind(b=>o.getSystem().getByDom(b).toOptional()),R3=(o,c,m,b)=>{const C=lu(o.element,"."+c.itemClass);return V.from(C[b]).fold(()=>Cn.error(new Error("No element found with index "+b)),o.getSystem().getByDom)},qE=(o,c,m)=>ta(o.element,"."+c.itemClass).bind(b=>o.getSystem().getByDom(b).toOptional()),GE=(o,c,m)=>{const b=lu(o.element,"."+c.itemClass);return(b.length>0?V.some(b[b.length-1]):V.none()).bind(x=>o.getSystem().getByDom(x).toOptional())},N3=(o,c,m,b)=>{const C=lu(o.element,"."+c.itemClass);return Xt(C,M=>Ju(M,c.highlightClass)).bind(M=>{const I=ph(M,b,0,C.length-1);return o.getSystem().getByDom(C[I]).toOptional()})},s1=(o,c,m)=>N3(o,c,m,-1),my=(o,c,m)=>N3(o,c,m,1),KE=(o,c,m)=>{const b=lu(o.element,"."+c.itemClass);return Dt(qe(b,C=>o.getSystem().getByDom(C).toOptional()))};var oM=Object.freeze({__proto__:null,dehighlightAll:QO,dehighlight:xI,highlight:xw,highlightFirst:GC,highlightLast:eM,highlightAt:tM,highlightBy:nM,isHighlighted:Tw,getHighlighted:ZE,getFirst:qE,getLast:GE,getPrevious:s1,getNext:my,getCandidates:KE}),sM=[Qt("highlightClass"),Qt("itemClass"),Gs("onHighlight"),Gs("onDehighlight")];const Nr=Xl({fields:sM,name:"highlighting",apis:oM}),YE=[8],dp=[9],hp=[13],r1=[27],Ru=[32],KC=[37],gy=[38],YC=[39],Bb=[40],rM=(o,c,m)=>{const b=gn(o.slice(0,c)),C=gn(o.slice(c+1));return St(b.concat(C),m)},TI=(o,c,m)=>{const b=gn(o.slice(0,c));return St(b,m)},iM=(o,c,m)=>{const b=o.slice(0,c),C=o.slice(c+1);return St(C.concat(b),m)},P3=(o,c,m)=>{const b=o.slice(c+1);return St(b,m)},rr=o=>c=>{const m=c.raw;return ct(o,m.which)},mm=o=>c=>Ut(o,m=>m(c)),py=o=>o.raw.shiftKey===!0,aM=o=>o.raw.ctrlKey===!0,Lb=_e(py),cr=(o,c)=>({matches:o,classification:c}),lM=(o,c)=>St(o,b=>b.matches(c)).map(b=>b.classification),XC=(o,c,m)=>{c.exists(C=>m.exists(x=>kr(x,C)))||Do(o,Cv(),{prevFocus:c,newFocus:m})},JC=()=>{const o=m=>ol(m.element);return{get:o,set:(m,b)=>{const C=o(m);m.getSystem().triggerFocus(b,m.element);const x=o(m);XC(m,C,x)}}},QC=()=>{const o=m=>Nr.getHighlighted(m).map(b=>b.element);return{get:o,set:(m,b)=>{const C=o(m);m.getSystem().getByDom(b).fold(F,M=>{Nr.highlight(m,M)});const x=o(m);XC(m,C,x)}}};var i1;(function(o){o.OnFocusMode="onFocus",o.OnEnterOrSpaceMode="onEnterOrSpace",o.OnApiMode="onApi"})(i1||(i1={}));const mp=(o,c,m,b,C)=>{const x=()=>o.concat([At("focusManager",JC()),_c("focusInside","onFocus",Zu(J=>ct(["onFocus","onEnterOrSpace","onApi"],J)?Cn.value(J):Cn.error("Invalid value for focusInside"))),Wi("handler",W),Wi("state",c),Wi("sendFocusIn",C)]),M=(J,re,fe,me,Ce)=>{const Ne=fe(J,re,me,Ce);return lM(Ne,re.event).bind(st=>st(J,re,me,Ce))},W={schema:x,processKey:M,toEvents:(J,re)=>{const fe=J.focusInside!==i1.OnFocusMode?V.none():C(J).map(Ne=>en(Ed(),(st,Ht)=>{Ne(st,J,re),Ht.stop()})),me=(Ne,st)=>{const Ht=rr(Ru.concat(hp))(st.event);J.focusInside===i1.OnEnterOrSpaceMode&&Ht&&Gu(Ne,st)&&C(J).each(dt=>{dt(Ne,J,re),st.stop()})},Ce=[en(Ef(),(Ne,st)=>{M(Ne,st,m,J,re).fold(()=>{me(Ne,st)},Ht=>{st.stop()})}),en(F_(),(Ne,st)=>{M(Ne,st,b,J,re).each(Ht=>{st.stop()})})];return ri(fe.toArray().concat(Ce))}};return W},y=o=>{const c=[Ar("onEscape"),Ar("onEnter"),At("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),At("firstTabstop",0),At("useTabstopAt",ft),Ar("visibilitySelector")].concat([o]),m=(dt,lt)=>{const Zt=dt.visibilitySelector.bind(Ot=>ef(lt,Ot)).getOr(lt);return Mi(Zt)>0},b=(dt,lt)=>{const Zt=lu(dt.element,lt.selector),Ot=Zn(Zt,An=>m(lt,An));return V.from(Ot[lt.firstTabstop])},C=(dt,lt)=>lt.focusManager.get(dt).bind(Zt=>ef(Zt,lt.selector)),x=(dt,lt)=>m(dt,lt)&&dt.useTabstopAt(lt),M=(dt,lt,Zt)=>{b(dt,lt).each(Ot=>{lt.focusManager.set(dt,Ot)})},I=(dt,lt,Zt,Ot,An)=>An(lt,Zt,mn=>x(Ot,mn)).fold(()=>Ot.cyclic?V.some(!0):V.none(),mn=>(Ot.focusManager.set(dt,mn),V.some(!0))),W=(dt,lt,Zt,Ot)=>{const An=lu(dt.element,Zt.selector);return C(dt,Zt).bind(mn=>Xt(An,Te(kr,mn)).bind(Kn=>I(dt,An,Kn,Zt,Ot)))},J=(dt,lt,Zt)=>{const Ot=Zt.cyclic?rM:TI;return W(dt,lt,Zt,Ot)},re=(dt,lt,Zt)=>{const Ot=Zt.cyclic?iM:P3;return W(dt,lt,Zt,Ot)},fe=dt=>Mc(dt).bind(pf).exists(lt=>kr(lt,dt)),me=(dt,lt,Zt)=>C(dt,Zt).filter(Ot=>!Zt.useTabstopAt(Ot)).bind(Ot=>(fe(Ot)?J:re)(dt,lt,Zt)),Ce=(dt,lt,Zt)=>Zt.onEnter.bind(Ot=>Ot(dt,lt)),Ne=(dt,lt,Zt)=>Zt.onEscape.bind(Ot=>Ot(dt,lt)),st=X([cr(mm([py,rr(dp)]),J),cr(rr(dp),re),cr(mm([Lb,rr(hp)]),Ce)]),Ht=X([cr(rr(r1),Ne),cr(rr(dp),me)]);return mp(c,Tf.init,st,Ht,()=>V.some(M))};var k=y(_a("cyclic",Je)),D=y(_a("cyclic",ft));const P=(o,c,m)=>(q1(o,m,Ku()),V.some(!0)),Z=(o,c,m)=>fp(m)&&rr(Ru)(c.event)?V.none():P(o,c,m),ne=(o,c)=>V.some(!0),pe=[At("execute",Z),At("useSpace",!1),At("useEnter",!0),At("useControlEnter",!1),At("useDown",!1)],Ee=(o,c,m)=>m.execute(o,c,o.element),Fe=(o,c,m,b)=>{const C=m.useSpace&&!fp(o.element)?Ru:[],x=m.useEnter?hp:[],M=m.useDown?Bb:[],I=C.concat(x).concat(M);return[cr(rr(I),Ee)].concat(m.useControlEnter?[cr(mm([aM,rr(hp)]),Ee)]:[])},ot=(o,c,m,b)=>m.useSpace&&!fp(o.element)?[cr(rr(Ru),ne)]:[];var _t=mp(pe,Tf.init,Fe,ot,()=>V.none());const fn=()=>{const o=ji();return su({readState:()=>o.get().map(C=>({numRows:String(C.numRows),numColumns:String(C.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(C,x)=>{o.set({numRows:C,numColumns:x})},getNumRows:()=>o.get().map(C=>C.numRows),getNumColumns:()=>o.get().map(C=>C.numColumns)})};var Un=Object.freeze({__proto__:null,flatgrid:fn,init:o=>o.state(o)});const tn=o=>(c,m,b,C)=>{const x=o(c.element);return as(x,c,m,b,C)},Wn=(o,c)=>{const m=kb(o,c);return tn(m)},Jt=(o,c)=>{const m=kb(c,o);return tn(m)},mo=o=>(c,m,b,C)=>as(o,c,m,b,C),as=(o,c,m,b,C)=>b.focusManager.get(c).bind(M=>o(c.element,M,b,C)).map(M=>(b.focusManager.set(c,M),!0)),Ts=mo,aa=mo,Dl=mo,vl=o=>o.offsetWidth<=0&&o.offsetHeight<=0,Nu=o=>!vl(o.dom),Fb=(o,c)=>Xt(o,c).map(m=>({index:m,candidates:o})),Dw=(o,c,m)=>{const b=M=>kr(M,c),C=lu(o,m),x=Zn(C,Nu);return Fb(x,b)},eS=(o,c)=>Xt(o,m=>kr(c,m)),tS=(o,c,m,b)=>{const C=Math.floor(c/m),x=c%m;return b(C,x).bind(M=>{const I=M.row*m+M.column;return I>=0&&I<o.length?V.some(o[I]):V.none()})},_i=(o,c,m,b,C)=>tS(o,c,b,(x,M)=>{const W=x===m-1?o.length-x*b:b,J=ph(M,C,0,W-1);return V.some({row:x,column:J})}),Pu=(o,c,m,b,C)=>tS(o,c,b,(x,M)=>{const I=ph(x,C,0,m-1),J=I===m-1?o.length-I*b:b,re=Jf(M,0,J-1);return V.some({row:I,column:re})}),af=(o,c,m,b)=>_i(o,c,m,b,1),gm=(o,c,m,b)=>_i(o,c,m,b,-1),lf=(o,c,m,b)=>Pu(o,c,m,b,-1),Hb=(o,c,m,b)=>Pu(o,c,m,b,1),Iu=[Qt("selector"),At("execute",Z),iu("onEscape"),At("captureTab",!1),ig()],Ow=(o,c,m)=>{ta(o.element,c.selector).each(b=>{c.focusManager.set(o,b)})},Mw=(o,c)=>c.focusManager.get(o).bind(m=>ef(m,c.selector)),hg=(o,c,m,b)=>Mw(o,m).bind(C=>m.execute(o,c,C)),dc=o=>(c,m,b,C)=>Dw(c,m,b.selector).bind(x=>o(x.candidates,x.index,C.getNumRows().getOr(b.initSize.numRows),C.getNumColumns().getOr(b.initSize.numColumns))),XE=(o,c,m)=>m.captureTab?V.some(!0):V.none(),I3=(o,c,m)=>m.onEscape(o,c),B3=dc(gm),L3=dc(af),cM=dc(lf),JE=dc(Hb),uM=X([cr(rr(KC),Wn(B3,L3)),cr(rr(YC),Jt(B3,L3)),cr(rr(gy),Ts(cM)),cr(rr(Bb),aa(JE)),cr(mm([py,rr(dp)]),XE),cr(mm([Lb,rr(dp)]),XE),cr(rr(Ru.concat(hp)),hg)]),Rw=X([cr(rr(r1),I3),cr(rr(Ru),ne)]);var fM=mp(Iu,fn,uM,Rw,()=>V.some(Ow));const F3=(o,c,m,b,C)=>{const x=I=>dl(I)==="button"&&$i(I,"disabled")==="disabled",M=(I,W,J)=>C(I,W,b,0,J.length-1,J[W],re=>x(J[re])?M(I,re,J):V.from(J[re]));return Dw(o,m,c).bind(I=>{const W=I.index,J=I.candidates;return M(W,W,J)})},DI=(o,c,m,b)=>F3(o,c,m,b,(C,x,M,I,W,J,re)=>{const fe=Jf(x+M,I,W);return fe===C?V.from(J):re(fe)}),dM=(o,c,m,b)=>F3(o,c,m,b,(C,x,M,I,W,J,re)=>{const fe=ph(x,M,I,W);return fe===C?V.none():re(fe)}),OI=[Qt("selector"),At("getInitial",V.none),At("execute",Z),iu("onEscape"),At("executeOnMove",!1),At("allowVertical",!0),At("allowHorizontal",!0),At("cycles",!0)],vU=(o,c)=>c.focusManager.get(o).bind(m=>ef(m,c.selector)),hM=(o,c,m)=>vU(o,m).bind(b=>m.execute(o,c,b)),mg=(o,c,m)=>{c.getInitial(o).orThunk(()=>ta(o.element,c.selector)).each(b=>{c.focusManager.set(o,b)})},MI=(o,c,m)=>(m.cycles?dM:DI)(o,m.selector,c,-1),RI=(o,c,m)=>(m.cycles?dM:DI)(o,m.selector,c,1),NI=o=>(c,m,b,C)=>o(c,m,b,C).bind(()=>b.executeOnMove?hM(c,m,b):V.some(!0)),yU=(o,c,m)=>m.onEscape(o,c),wU=(o,c,m,b)=>{const C=[...m.allowHorizontal?KC:[]].concat(m.allowVertical?gy:[]),x=[...m.allowHorizontal?YC:[]].concat(m.allowVertical?Bb:[]);return[cr(rr(C),NI(Wn(MI,RI))),cr(rr(x),NI(Jt(MI,RI))),cr(rr(hp),hM),cr(rr(Ru),hM)]},nS=X([cr(rr(Ru),ne),cr(rr(r1),yU)]);var mM=mp(OI,Tf.init,wU,nS,()=>V.some(mg));const H3=(o,c,m)=>V.from(o[c]).bind(b=>V.from(b[m]).map(C=>({rowIndex:c,columnIndex:m,cell:C}))),$3=(o,c,m,b)=>{const x=o[c].length,M=ph(m,b,0,x-1);return H3(o,c,M)},QE=(o,c,m,b)=>{const C=ph(m,b,0,o.length-1),x=o[C].length,M=Jf(c,0,x-1);return H3(o,C,M)},z3=(o,c,m,b)=>{const x=o[c].length,M=Jf(m+b,0,x-1);return H3(o,c,M)},PI=(o,c,m,b)=>{const C=Jf(m+b,0,o.length-1),x=o[C].length,M=Jf(c,0,x-1);return H3(o,C,M)},_U=(o,c,m)=>$3(o,c,m,1),CU=(o,c,m)=>$3(o,c,m,-1),SU=(o,c,m)=>QE(o,m,c,-1),kU=(o,c,m)=>QE(o,m,c,1),EU=(o,c,m)=>z3(o,c,m,-1),II=(o,c,m)=>z3(o,c,m,1),gM=(o,c,m)=>PI(o,m,c,-1),AU=(o,c,m)=>PI(o,m,c,1),xU=[qf("selectors",[Qt("row"),Qt("cell")]),At("cycles",!0),At("previousSelector",V.none),At("execute",Z)],TU=(o,c,m)=>{c.previousSelector(o).orThunk(()=>{const C=c.selectors;return ta(o.element,C.cell)}).each(C=>{c.focusManager.set(o,C)})},DU=(o,c,m)=>ol(o.element).bind(b=>m.execute(o,c,b)),Nw=(o,c)=>qe(o,m=>lu(m,c.selectors.cell)),V3=(o,c)=>(m,b,C)=>{const x=C.cycles?o:c;return ef(b,C.selectors.row).bind(M=>{const I=lu(M,C.selectors.cell);return eS(I,b).bind(W=>{const J=lu(m,C.selectors.row);return eS(J,M).bind(re=>{const fe=Nw(J,C);return x(fe,re,W).map(me=>me.cell)})})})},BI=V3(CU,EU),U3=V3(_U,II),OU=V3(SU,gM),LI=V3(kU,AU),FI=X([cr(rr(KC),Wn(BI,U3)),cr(rr(YC),Jt(BI,U3)),cr(rr(gy),Ts(OU)),cr(rr(Bb),aa(LI)),cr(rr(Ru.concat(hp)),DU)]),HI=X([cr(rr(Ru),ne)]);var $I=mp(xU,Tf.init,FI,HI,()=>V.some(TU));const MU=[Qt("selector"),At("execute",Z),At("moveOnTab",!1)],zI=(o,c,m)=>m.focusManager.get(o).bind(b=>m.execute(o,c,b)),RU=(o,c,m)=>{ta(o.element,c.selector).each(b=>{c.focusManager.set(o,b)})},W3=(o,c,m)=>dM(o,m.selector,c,-1),VI=(o,c,m)=>dM(o,m.selector,c,1),NU=(o,c,m,b)=>m.moveOnTab?Dl(W3)(o,c,m,b):V.none(),PU=(o,c,m,b)=>m.moveOnTab?Dl(VI)(o,c,m,b):V.none(),IU=X([cr(rr(gy),Dl(W3)),cr(rr(Bb),Dl(VI)),cr(mm([py,rr(dp)]),NU),cr(mm([Lb,rr(dp)]),PU),cr(rr(hp),zI),cr(rr(Ru),zI)]),UI=X([cr(rr(Ru),ne)]);var BU=mp(MU,Tf.init,IU,UI,()=>V.some(RU));const LU=[iu("onSpace"),iu("onEnter"),iu("onShiftEnter"),iu("onLeft"),iu("onRight"),iu("onTab"),iu("onShiftTab"),iu("onUp"),iu("onDown"),iu("onEscape"),At("stopSpaceKeyup",!1),Ar("focusIn")],FU=(o,c,m)=>[cr(rr(Ru),m.onSpace),cr(mm([Lb,rr(hp)]),m.onEnter),cr(mm([py,rr(hp)]),m.onShiftEnter),cr(mm([py,rr(dp)]),m.onShiftTab),cr(mm([Lb,rr(dp)]),m.onTab),cr(rr(gy),m.onUp),cr(rr(Bb),m.onDown),cr(rr(KC),m.onLeft),cr(rr(YC),m.onRight),cr(rr(Ru),m.onSpace)],WI=(o,c,m)=>[...m.stopSpaceKeyup?[cr(rr(Ru),ne)]:[],cr(rr(r1),m.onEscape)];var HU=mp(LU,Tf.init,FU,WI,o=>o.focusIn);const $U=k.schema(),jI=D.schema(),zU=mM.schema(),VU=fM.schema(),j3=$I.schema(),UU=_t.schema(),ZI=BU.schema(),Hd=HU.schema();var WU=Object.freeze({__proto__:null,acyclic:$U,cyclic:jI,flow:zU,flatgrid:VU,matrix:j3,execution:UU,menu:ZI,special:Hd});const qI=o=>Li(o,"setGridSize"),Io=K2({branchKey:"mode",branches:WU,name:"keying",active:{events:(o,c)=>o.handler.toEvents(o,c)},apis:{focusIn:(o,c,m)=>{c.sendFocusIn(c).fold(()=>{o.getSystem().triggerFocus(o.element,o.element)},b=>{b(o,c,m)})},setGridSize:(o,c,m,b,C)=>{qI(m)?m.setGridSize(b,C):console.error("Layout does not support setGridSize")}},state:Un}),GI=(o,c)=>{Md(()=>{Mf(o,c,()=>qe(c,o.getSystem().build))},o.element)},pM=(o,c)=>{Md(()=>{Mu(o,c,()=>Yf(o.element,c,o.getSystem().buildOrPatch))},o.element)},jU=(o,c,m,b)=>{m0(c);const C=Rv(o.element,m,b,o.getSystem().buildOrPatch);Pd(o,C),o.syncComponents()},Z3=(o,c,m)=>{const b=o.getSystem().build(m);Id(o,b,c)},KI=(o,c,m,b)=>{$c(c),Z3(o,(C,x)=>xa(C,x,m),b)},ZU=(o,c,m,b)=>(c.reuseDom?pM:GI)(o,b),qU=(o,c,m,b)=>{Z3(o,nl,b)},GU=(o,c,m,b)=>{Z3(o,Lg,b)},KU=(o,c,m,b)=>{const C=eA(o);St(C,M=>kr(b.element,M.element)).each($c)},eA=(o,c)=>o.components(),bM=(o,c,m,b,C)=>{const x=eA(o);return V.from(x[b]).map(M=>(C.fold(()=>$c(M),I=>{(c.reuseDom?jU:KI)(o,M,b,I)}),M))};var YI=Object.freeze({__proto__:null,append:qU,prepend:GU,remove:KU,replaceAt:bM,replaceBy:(o,c,m,b,C)=>{const x=eA(o);return Xt(x,b).bind(M=>bM(o,c,m,M,C))},set:ZU,contents:eA});const ms=Xl({fields:[Za("reuseDom",!0)],name:"replacing",apis:YI}),vM=(o,c)=>{const m=ri(c);return Xl({fields:[Qt("enabled")],name:o,active:{events:X(m)}})},ks=(o,c)=>{const m=vM(o,c);return{key:o,value:{config:{},me:m,configAsRaw:X({}),initialConfig:{},state:Tf}}},XI=(o,c)=>{c.ignore||(of(o.element),c.onFocus(o))};var JI=Object.freeze({__proto__:null,focus:XI,blur:(o,c)=>{c.ignore||zv(o.element)},isFocused:o=>Qp(o.element)}),YU=Object.freeze({__proto__:null,exhibit:(o,c)=>{const m=c.ignore?{}:{attributes:{tabindex:"-1"}};return Lc(m)},events:o=>ri([en(Ed(),(c,m)=>{XI(c,o),m.stop()})].concat(o.stopMousedown?[en(Br(),(c,m)=>{m.event.prevent()})]:[]))}),by=[Gs("onFocus"),At("stopMousedown",!1),At("ignore",!1)];const es=Xl({fields:by,name:"focusing",active:YU,apis:JI}),tB=o=>({init:()=>{const m=$o(o);return{get:()=>m.get(),set:I=>m.set(I),clear:()=>m.set(o),readState:()=>m.get()}}}),XU=(o,c,m)=>{const b=c.aria;b.update(o,b,m.get())},JU=(o,c,m)=>{c.toggleClass.each(b=>{m.get()?Ra(o.element,b):ma(o.element,b)})},$b=(o,c,m,b)=>{const C=m.get();m.set(b),JU(o,c,m),XU(o,c,m),C!==b&&c.onToggled(o,b)},oS=(o,c,m)=>{$b(o,c,m,!m.get())},nB=(o,c,m)=>{$b(o,c,m,!0)},oB=(o,c,m)=>{$b(o,c,m,!1)},vy=(o,c,m)=>m.get(),zb=(o,c,m)=>{$b(o,c,m,c.selected)};var QU=Object.freeze({__proto__:null,onLoad:zb,toggle:oS,isOn:vy,on:nB,off:oB,set:$b}),Vb=Object.freeze({__proto__:null,exhibit:()=>Lc({}),events:(o,c)=>{const m=Z2(o,c,oS),b=q2(o,c,zb);return ri(Tt([o.toggleOnExecute?[m]:[],[b]]))}});const yM=(o,c,m)=>{Xn(o.element,"aria-pressed",m),c.syncWithExpanded&&wM(o,c,m)},sB=(o,c,m)=>{Xn(o.element,"aria-selected",m)},rB=(o,c,m)=>{Xn(o.element,"aria-checked",m)},wM=(o,c,m)=>{Xn(o.element,"aria-expanded",m)};var _M=[At("selected",!1),Ar("toggleClass"),At("toggleOnExecute",!0),Gs("onToggled"),_c("aria",{mode:"none"},Cl("mode",{pressed:[At("syncWithExpanded",!1),Wi("update",yM)],checked:[Wi("update",rB)],expanded:[Wi("update",wM)],selected:[Wi("update",sB)],none:[Wi("update",F)]}))];const Ms=Xl({fields:_M,name:"toggling",active:Vb,apis:QU,state:tB(!1)}),iB=()=>{const o=(c,m)=>{m.stop(),lh(c)};return[en(Yh(),o),en(Z1(),o),Qh(eu()),Qh(Br())]},q3=o=>{const c=m=>ou((b,C)=>{m(b),C.stop()});return ri(Tt([o.map(c).toArray(),iB()]))},aB="alloy.item-hover",tA="alloy.item-focus",G3="alloy.item-toggled",K3=o=>{(ol(o.element).isNone()||es.isFocused(o))&&(es.isFocused(o)||es.focus(o),Do(o,aB,{item:o}))},lB=o=>{Do(o,tA,{item:o})},tW=(o,c)=>{Do(o,G3,{item:o,state:c})},CM=X(aB),cB=X(tA),uB=X(G3),fB=o=>o.toggling.map(c=>c.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),nW=o=>({aria:{mode:"checked"},...Ls(o,(c,m)=>m!=="exclusive"),onToggled:(c,m)=>{z(o.onToggled)&&o.onToggled(c,m),tW(c,m)}}),SM=o=>({dom:o.dom,domModification:{...o.domModification,attributes:{role:fB(o),...o.domModification.attributes,"aria-haspopup":o.hasSubmenu,...o.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:dm.augment(o.itemBehaviours,[o.toggling.fold(Ms.revoke,c=>Ms.config(nW(c))),es.config({ignore:o.ignoreFocus,stopMousedown:o.ignoreFocus,onFocus:c=>{lB(c)}}),Io.config({mode:"execution"}),Jn.config({store:{mode:"memory",initialValue:o.data}}),ks("item-type-events",[...iB(),en(Sl(),K3),en(nb(),es.focus)])]),components:o.components,eventOrder:o.eventOrder}),oW=[Qt("data"),Qt("components"),Qt("dom"),At("hasSubmenu",!1),Ar("toggling"),dm.field("itemBehaviours",[Ms,es,Io,Jn]),At("ignoreFocus",!1),At("domModification",{}),Wi("builder",SM),At("eventOrder",{})],sW=o=>({dom:o.dom,components:o.components,events:ri([Td(nb())])}),rW=[Qt("dom"),Qt("components"),Wi("builder",sW)],kM=X("item-widget"),Y3=X([zc({name:"widget",overrides:o=>({behaviours:Tn([Jn.config({store:{mode:"manual",getValue:c=>o.data,setValue:F}})])})})]),iW=o=>{const c=VC(kM(),o,Y3()),m=$E(kM(),o,c.internals()),b=x=>Ti(x,o,"widget").map(M=>(Io.focusIn(M),M)),C=(x,M)=>fp(M.event.target)?V.none():(()=>(o.autofocus&&M.setSource(x.element),V.none()))();return{dom:o.dom,components:m,domModification:o.domModification,events:ri([ou((x,M)=>{b(x).each(I=>{M.stop()})}),en(Sl(),K3),en(nb(),(x,M)=>{o.autofocus?b(x):es.focus(x)})]),behaviours:dm.augment(o.widgetBehaviours,[Jn.config({store:{mode:"memory",initialValue:o.data}}),es.config({ignore:o.ignoreFocus,onFocus:x=>{lB(x)}}),Io.config({mode:"special",focusIn:o.autofocus?x=>{b(x)}:oo(),onLeft:C,onRight:C,onEscape:(x,M)=>!es.isFocused(x)&&!o.autofocus?(es.focus(x),V.some(!0)):(o.autofocus&&M.setSource(x.element),V.none())})])}},aW=[Qt("uid"),Qt("data"),Qt("components"),Qt("dom"),At("autofocus",!1),At("ignoreFocus",!1),dm.field("widgetBehaviours",[Jn,es,Io]),At("domModification",{}),UC(Y3()),Wi("builder",iW)],dB=Cl("type",{widget:aW,item:oW,separator:rW}),nA=(o,c)=>({mode:"flatgrid",selector:"."+o.markers.item,initSize:{numColumns:c.initSize.numColumns,numRows:c.initSize.numRows},focusManager:o.focusManager}),lW=(o,c)=>({mode:"matrix",selectors:{row:c.rowSelector,cell:"."+o.markers.item},previousSelector:c.previousSelector,focusManager:o.focusManager}),oA=(o,c)=>({mode:"menu",selector:"."+o.markers.item,moveOnTab:c.moveOnTab,focusManager:o.focusManager}),EM=X([nd({factory:{sketch:o=>{const c=As("menu.spec item",dB,o);return c.builder(c)}},name:"items",unit:"item",defaults:(o,c)=>ps(c,"uid")?c:{...c,uid:fh("item")},overrides:(o,c)=>({type:c.type,ignoreFocus:o.fakeFocus,domModification:{classes:[o.markers.item]}})})]),hB=X([Qt("value"),Qt("items"),Qt("dom"),Qt("components"),At("eventOrder",{}),$l("menuBehaviours",[Nr,Jn,sr,Io]),_c("movement",{mode:"menu",moveOnTab:!0},Cl("mode",{grid:[ig(),Wi("config",nA)],matrix:[Wi("config",lW),Qt("rowSelector"),At("previousSelector",V.none)],menu:[At("moveOnTab",!0),Wi("config",oA)]})),sg(),At("fakeFocus",!1),At("focusManager",JC()),Gs("onHighlight"),Gs("onDehighlight")]),AM=X("alloy.menu-focus"),cW=(o,c)=>{const m=lu(o.element,'[role="menuitemradio"][aria-checked="true"]');gt(m,b=>{kr(b,c.element)||o.getSystem().getByDom(b).each(C=>{Ms.off(C)})})},uW=(o,c,m,b)=>({uid:o.uid,dom:o.dom,markers:o.markers,behaviours:Ql(o.menuBehaviours,[Nr.config({highlightClass:o.markers.selectedItem,itemClass:o.markers.item,onHighlight:o.onHighlight,onDehighlight:o.onDehighlight}),Jn.config({store:{mode:"memory",initialValue:o.value}}),sr.config({find:V.some}),Io.config(o.movement.config(o,o.movement))]),events:ri([en(cB(),(C,x)=>{const M=x.event;C.getSystem().getByDom(M.target).each(I=>{Nr.highlight(C,I),x.stop(),Do(C,AM(),{menu:C,item:I})})}),en(CM(),(C,x)=>{const M=x.event.item;Nr.highlight(C,M)}),en(uB(),(C,x)=>{const{item:M,state:I}=x.event;I&&$i(M.element,"role")==="menuitemradio"&&cW(C,M)})]),components:c,eventOrder:o.eventOrder,domModification:{attributes:{role:"menu"}}}),yy=fu({name:"Menu",configFields:hB(),partFields:EM(),factory:uW}),fW=o=>Zr(o,(c,m)=>({k:c,v:m})),xM=(o,c,m,b)=>ln(m,b).bind(C=>ln(o,C).bind(x=>{const M=xM(o,c,m,x);return V.some([x].concat(M))})).getOr([]),dW=(o,c)=>{const m={};ar(o,(M,I)=>{gt(M,W=>{m[W]=I})});const b=c,C=fW(c),x=Ns(C,(M,I)=>[I].concat(xM(m,b,C,I)));return Ns(m,M=>ln(x,M).getOr([M]))},hW=()=>{const o=$o({}),c=$o({}),m=$o({}),b=ji(),C=$o({}),x=()=>{o.set({}),c.set({}),m.set({}),b.clear()},M=()=>b.get().isNone(),I=(An,mn)=>{c.set({...c.get(),[An]:{type:"prepared",menu:mn}})},W=(An,mn,In,Kn)=>{b.set(An),o.set(In),c.set(mn),C.set(Kn);const js=dW(Kn,In);m.set(js)},J=An=>gs(o.get(),(mn,In)=>mn===An),re=(An,mn,In)=>st(An).bind(Kn=>J(An).bind(js=>mn(js).map(wo=>({triggeredMenu:Kn,triggeringItem:wo,triggeringPath:In})))),fe=(An,mn)=>{const In=Zn(dt(An).toArray(),Kn=>st(Kn).isSome());return ln(m.get(),An).bind(Kn=>{const js=gn(In.concat(Kn)),wo=Be(js,(_s,fs)=>re(_s,mn,js.slice(0,fs+1)).fold(()=>ze(b.get(),_s)?[]:[V.none()],hr=>[V.some(hr)]));return Wt(wo)})},me=An=>ln(o.get(),An).map(mn=>{const In=ln(m.get(),An).getOr([]);return[mn].concat(In)}),Ce=An=>ln(m.get(),An).bind(mn=>mn.length>1?V.some(mn.slice(1)):V.none()),Ne=An=>ln(m.get(),An),st=An=>Ht(An).bind(TM),Ht=An=>ln(c.get(),An),dt=An=>ln(o.get(),An);return{setMenuBuilt:I,setContents:W,expand:me,refresh:Ne,collapse:Ce,lookupMenu:Ht,lookupItem:dt,otherMenus:An=>{const mn=C.get();return wt(Zs(mn),An)},getPrimary:()=>b.get().bind(st),getMenus:()=>c.get(),clear:x,isClear:M,getTriggeringPath:fe}},TM=o=>o.type==="prepared"?V.some(o.menu):V.none(),sA={init:hW,extractPreparedMenu:TM},X3=ro("tiered-menu-item-highlight"),J3=ro("tiered-menu-item-dehighlight");var od;(function(o){o[o.HighlightMenuAndItem=0]="HighlightMenuAndItem",o[o.HighlightJustMenu=1]="HighlightJustMenu",o[o.HighlightNone=2]="HighlightNone"})(od||(od={}));const mW=(o,c)=>{const m=ji(),b=(Hn,bo,ls)=>Ns(ls,(Xs,Vo)=>{const bs=()=>yy.sketch({...Xs,value:Vo,markers:o.markers,fakeFocus:o.fakeFocus,onHighlight:(Di,$r)=>{Do(Di,X3,{menuComp:Di,itemComp:$r})},onDehighlight:(Di,$r)=>{Do(Di,J3,{menuComp:Di,itemComp:$r})},focusManager:o.fakeFocus?QC():JC()});return Vo===bo?{type:"prepared",menu:Hn.getSystem().build(bs())}:{type:"notbuilt",nbMenu:bs}}),C=sA.init(),x=Hn=>{const bo=b(Hn,o.data.primary,o.data.menus),ls=W();return C.setContents(o.data.primary,bo,o.data.expansions,ls),C.getPrimary()},M=Hn=>Jn.getValue(Hn).value,I=(Hn,bo,ls)=>Js(bo,Xs=>{if(!Xs.getSystem().isConnected())return V.none();const Vo=Nr.getCandidates(Xs);return St(Vo,bs=>M(bs)===ls)}),W=Hn=>Ns(o.data.menus,(bo,ls)=>Be(bo.items,Xs=>Xs.type==="separator"?[]:[Xs.data.value])),J=Nr.highlight,re=(Hn,bo)=>{J(Hn,bo),Nr.getHighlighted(bo).orThunk(()=>Nr.getFirst(bo)).each(ls=>{o.fakeFocus?Nr.highlight(bo,ls):q1(Hn,ls.element,nb())})},fe=(Hn,bo)=>Dt(qe(bo,ls=>Hn.lookupMenu(ls).bind(Xs=>Xs.type==="prepared"?V.some(Xs.menu):V.none()))),me=(Hn,bo,ls)=>{const Xs=fe(bo,bo.otherMenus(ls));gt(Xs,Vo=>{Fc(Vo.element,[o.markers.backgroundMenu]),o.stayInDom||ms.remove(Hn,Vo)})},Ce=Hn=>m.get().getOrThunk(()=>{const bo={},ls=lu(Hn.element,`.${o.markers.item}`),Xs=Zn(ls,Vo=>$i(Vo,"aria-haspopup")==="true");return gt(Xs,Vo=>{Hn.getSystem().getByDom(Vo).each(bs=>{const Di=M(bs);bo[Di]=bs})}),m.set(bo),bo}),Ne=(Hn,bo)=>{const ls=Ce(Hn);ar(ls,(Xs,Vo)=>{const bs=ct(bo,Vo);Xn(Xs.element,"aria-expanded",bs)})},st=(Hn,bo,ls)=>V.from(ls[0]).bind(Xs=>bo.lookupMenu(Xs).bind(Vo=>{if(Vo.type==="notbuilt")return V.none();{const bs=Vo.menu,Di=fe(bo,ls.slice(1));return gt(Di,$r=>{Ra($r.element,o.markers.backgroundMenu)}),qs(bs.element)||ms.append(Hn,ru(bs)),Fc(bs.element,[o.markers.backgroundMenu]),re(Hn,bs),me(Hn,bo,ls),V.some(bs)}}));let Ht;(function(Hn){Hn[Hn.HighlightSubmenu=0]="HighlightSubmenu",Hn[Hn.HighlightParent=1]="HighlightParent"})(Ht||(Ht={}));const dt=(Hn,bo,ls)=>{if(ls.type==="notbuilt"){const Xs=Hn.getSystem().build(ls.nbMenu());return C.setMenuBuilt(bo,Xs),Xs}else return ls.menu},lt=(Hn,bo,ls=Ht.HighlightSubmenu)=>{if(bo.hasConfigured(Xo)&&Xo.isDisabled(bo))return V.some(bo);{const Xs=M(bo);return C.expand(Xs).bind(Vo=>(Ne(Hn,Vo),V.from(Vo[0]).bind(bs=>C.lookupMenu(bs).bind(Di=>{const $r=dt(Hn,bs,Di);return qs($r.element)||ms.append(Hn,ru($r)),o.onOpenSubmenu(Hn,bo,$r,gn(Vo)),ls===Ht.HighlightSubmenu?(Nr.highlightFirst($r),st(Hn,C,Vo)):(Nr.dehighlightAll($r),V.some(bo))}))))}},Zt=(Hn,bo)=>{const ls=M(bo);return C.collapse(ls).bind(Xs=>(Ne(Hn,Xs),st(Hn,C,Xs).map(Vo=>(o.onCollapseMenu(Hn,bo,Vo),Vo))))},Ot=(Hn,bo)=>{const ls=M(bo);return C.refresh(ls).bind(Xs=>(Ne(Hn,Xs),st(Hn,C,Xs)))},An=(Hn,bo)=>fp(bo.element)?V.none():lt(Hn,bo,Ht.HighlightSubmenu),mn=(Hn,bo)=>fp(bo.element)?V.none():Zt(Hn,bo),In=(Hn,bo)=>Zt(Hn,bo).orThunk(()=>o.onEscape(Hn,bo).map(()=>Hn)),Kn=Hn=>(bo,ls)=>ef(ls.getSource(),`.${o.markers.item}`).bind(Xs=>bo.getSystem().getByDom(Xs).toOptional().bind(Vo=>Hn(bo,Vo).map(ft))),js=ri([en(AM(),(Hn,bo)=>{const ls=bo.event.item;C.lookupItem(M(ls)).each(()=>{const Xs=bo.event.menu;Nr.highlight(Hn,Xs);const Vo=M(bo.event.item);C.refresh(Vo).each(bs=>me(Hn,C,bs))})}),ou((Hn,bo)=>{const ls=bo.event.target;Hn.getSystem().getByDom(ls).each(Xs=>{M(Xs).indexOf("collapse-item")===0&&Zt(Hn,Xs),lt(Hn,Xs,Ht.HighlightSubmenu).fold(()=>{o.onExecute(Hn,Xs)},F)})}),yi((Hn,bo)=>{x(Hn).each(ls=>{ms.append(Hn,ru(ls)),o.onOpenMenu(Hn,ls),o.highlightOnOpen===od.HighlightMenuAndItem?re(Hn,ls):o.highlightOnOpen===od.HighlightJustMenu&&J(Hn,ls)})}),en(X3,(Hn,bo)=>{o.onHighlightItem(Hn,bo.event.menuComp,bo.event.itemComp)}),en(J3,(Hn,bo)=>{o.onDehighlightItem(Hn,bo.event.menuComp,bo.event.itemComp)}),...o.navigateOnHover?[en(CM(),(Hn,bo)=>{const ls=bo.event.item;Ot(Hn,ls),lt(Hn,ls,Ht.HighlightParent),o.onHover(Hn,ls)})]:[]]),wo=Hn=>Nr.getHighlighted(Hn).bind(Nr.getHighlighted),_s=Hn=>{wo(Hn).each(bo=>{Zt(Hn,bo)})},fs=Hn=>{C.getPrimary().each(bo=>{re(Hn,bo)})},hr=Hn=>V.from(Hn.components()[0]).filter(bo=>$i(bo.element,"role")==="menu"),ir={collapseMenu:_s,highlightPrimary:fs,repositionMenus:Hn=>{C.getPrimary().bind(ls=>wo(Hn).bind(Xs=>{const Vo=M(Xs),bs=va(C.getMenus()),Di=Dt(qe(bs,sA.extractPreparedMenu));return C.getTriggeringPath(Vo,$r=>I(Hn,Di,$r))}).map(Xs=>({primary:ls,triggeringPath:Xs}))).fold(()=>{hr(Hn).each(ls=>{o.onRepositionMenu(Hn,ls,[])})},({primary:ls,triggeringPath:Xs})=>{o.onRepositionMenu(Hn,ls,Xs)})}};return{uid:o.uid,dom:o.dom,markers:o.markers,behaviours:Ql(o.tmenuBehaviours,[Io.config({mode:"special",onRight:Kn(An),onLeft:Kn(mn),onEscape:Kn(In),focusIn:(Hn,bo)=>{C.getPrimary().each(ls=>{q1(Hn,ls.element,nb())})}}),Nr.config({highlightClass:o.markers.selectedMenu,itemClass:o.markers.menu}),sr.config({find:Hn=>Nr.getHighlighted(Hn)}),ms.config({})]),eventOrder:o.eventOrder,apis:ir,events:js}},gW=X("collapse-item"),pW=(o,c,m)=>({primary:o,menus:c,expansions:m}),mB=(o,c)=>({primary:o,menus:Ln(o,c),expansions:{}}),gB=o=>({value:ro(gW()),meta:{text:o}}),Iw=Vc({name:"TieredMenu",configFields:[F2("onExecute"),F2("onEscape"),rg("onOpenMenu"),rg("onOpenSubmenu"),Gs("onRepositionMenu"),Gs("onCollapseMenu"),At("highlightOnOpen",od.HighlightMenuAndItem),qf("data",[Qt("primary"),Qt("menus"),Qt("expansions")]),At("fakeFocus",!1),Gs("onHighlightItem"),Gs("onDehighlightItem"),Gs("onHover"),Bv(),Qt("dom"),At("navigateOnHover",!0),At("stayInDom",!1),$l("tmenuBehaviours",[Io,Nr,sr,ms]),At("eventOrder",{})],apis:{collapseMenu:(o,c)=>{o.collapseMenu(c)},highlightPrimary:(o,c)=>{o.highlightPrimary(c)},repositionMenus:(o,c)=>{o.repositionMenus(c)}},factory:mW,extraApis:{tieredData:pW,singleData:mB,collapseItem:gB}}),bW=(o,c,m,b,C)=>{const x=()=>o.lazySink(c),M=b.type==="horizontal"?{layouts:{onLtr:()=>ag(),onRtl:()=>fc()}}:{},I=J=>J.length===2,W=J=>I(J)?M:{};return Iw.sketch({dom:{tag:"div"},data:b.data,markers:b.menu.markers,highlightOnOpen:b.menu.highlightOnOpen,fakeFocus:b.menu.fakeFocus,onEscape:()=>(Ks.close(c),o.onEscape.map(J=>J(c)),V.some(!0)),onExecute:()=>V.some(!0),onOpenMenu:(J,re)=>{uu.positionWithinBounds(x().getOrDie(),re,m,C())},onOpenSubmenu:(J,re,fe,me)=>{const Ce=x().getOrDie();uu.position(Ce,fe,{anchor:{type:"submenu",item:re,...W(me)}})},onRepositionMenu:(J,re,fe)=>{const me=x().getOrDie();uu.positionWithinBounds(me,re,m,C()),gt(fe,Ce=>{const Ne=W(Ce.triggeringPath);uu.position(me,Ce.triggeredMenu,{anchor:{type:"submenu",item:Ce.triggeringItem,...Ne}})})}})},vW=(o,c)=>{const m=(me,Ce)=>o.getRelated(me).exists(st=>Gp(st,Ce)),b=(me,Ce)=>{Ks.setContent(me,Ce)},C=(me,Ce,Ne)=>{const st=V.none;x(me,Ce,Ne,st)},x=(me,Ce,Ne,st)=>{const Ht=o.lazySink(me).getOrDie();Ks.openWhileCloaked(me,Ce,()=>uu.positionWithinBounds(Ht,me,Ne,st())),Jn.setValue(me,V.some({mode:"position",config:Ne,getBounds:st}))},M=(me,Ce,Ne)=>{I(me,Ce,Ne,V.none)},I=(me,Ce,Ne,st)=>{const Ht=bW(o,me,Ce,Ne,st);Ks.open(me,Ht),Jn.setValue(me,V.some({mode:"menu",menu:Ht}))},W=me=>{Ks.isOpen(me)&&(Jn.setValue(me,V.none()),Ks.close(me))},J=me=>Ks.getState(me),re=me=>{Ks.isOpen(me)&&Jn.getValue(me).each(Ce=>{switch(Ce.mode){case"menu":Ks.getState(me).each(Iw.repositionMenus);break;case"position":const Ne=o.lazySink(me).getOrDie();uu.positionWithinBounds(Ne,me,Ce.config,Ce.getBounds());break}})},fe={setContent:b,showAt:C,showWithinBounds:x,showMenuAt:M,showMenuWithinBounds:I,hide:W,getContent:J,reposition:re,isOpen:Ks.isOpen};return{uid:o.uid,dom:o.dom,behaviours:Ql(o.inlineBehaviours,[Ks.config({isPartOf:(me,Ce,Ne)=>Gp(Ce,Ne)||m(me,Ne),getAttachPoint:me=>o.lazySink(me).getOrDie(),onOpen:me=>{o.onShow(me)},onClose:me=>{o.onHide(me)}}),Jn.config({store:{mode:"memory",initialValue:V.none()}}),Cc.config({channels:{...ly({isExtraPart:c.isExtraPart,...o.fireDismissalEventInstead.map(me=>({fireEventInstead:{event:me.event}})).getOr({})}),...AE({...o.fireRepositionEventInstead.map(me=>({fireEventInstead:{event:me.event}})).getOr({}),doReposition:re})}})]),eventOrder:o.eventOrder,apis:fe}},Pa=Vc({name:"InlineView",configFields:[Qt("lazySink"),Gs("onShow"),Gs("onHide"),zm("onEscape"),$l("inlineBehaviours",[Ks,Jn,Cc]),ja("fireDismissalEventInstead",[At("event",Xm())]),ja("fireRepositionEventInstead",[At("event",ob())]),At("getRelated",V.none),At("isExtraPart",Je),At("eventOrder",V.none)],factory:vW,apis:{showAt:(o,c,m,b)=>{o.showAt(c,m,b)},showWithinBounds:(o,c,m,b,C)=>{o.showWithinBounds(c,m,b,C)},showMenuAt:(o,c,m,b)=>{o.showMenuAt(c,m,b)},showMenuWithinBounds:(o,c,m,b,C)=>{o.showMenuWithinBounds(c,m,b,C)},hide:(o,c)=>{o.hide(c)},isOpen:(o,c)=>o.isOpen(c),getContent:(o,c)=>o.getContent(c),setContent:(o,c,m)=>{o.setContent(c,m)},reposition:(o,c)=>{o.reposition(c)}}});var Q3=tinymce.util.Tools.resolve("tinymce.util.Delay");const Uc=Vc({name:"Button",factory:o=>{const c=q3(o.action),m=o.dom.tag,b=x=>ln(o.dom,"attributes").bind(M=>ln(M,x)),C=()=>{if(m==="button"){const x=b("type").getOr("button"),M=b("role").map(I=>({role:I})).getOr({});return{type:x,...M}}else return{role:o.role.getOr(b("role").getOr("button"))}};return{uid:o.uid,dom:o.dom,components:o.components,events:c,behaviours:dm.augment(o.buttonBehaviours,[es.config({}),Io.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:C()},eventOrder:o.eventOrder}},configFields:[At("uid",void 0),Qt("dom"),At("components",[]),dm.field("buttonBehaviours",[es,Io]),Ar("action"),Ar("role"),At("eventOrder",{})]}),Qr=o=>{const c=WC(o)&&Li(o,"uid")?o.uid:fh("memento");return{get:x=>x.getSystem().getByUid(c).getOrDie(),getOpt:x=>x.getSystem().getByUid(c).toOptional(),asSpec:()=>({...o,uid:c})}};var pm=tinymce.util.Tools.resolve("tinymce.util.I18n");const yW={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},pB="temporary-placeholder",DM=o=>()=>ln(o,pB).getOr("!not found!"),Ub=(o,c)=>{const m=o.toLowerCase();if(pm.isRtl()){const b=Ir(m,"-rtl");return ps(c,b)?b:m}else return m},bB=(o,c)=>ln(c,Ub(o,c)),vB=(o,c)=>{const m=c();return bB(o,m).getOrThunk(DM(m))},Bw=(o,c,m)=>{const b=c();return bB(o,b).or(m).getOrThunk(DM(b))},yB=o=>pm.isRtl()?ps(yW,o):!1,OM=()=>ks("add-focusable",[yi(o=>{Iv(o.element,"svg").each(c=>Xn(c,"focusable","false"))})]),Wb=(o,c,m,b)=>{var C,x;const M=yB(c)?["tox-icon--flip"]:[],I=ln(m,Ub(c,m)).or(b).getOrThunk(DM(m));return{dom:{tag:o.tag,attributes:(C=o.attributes)!==null&&C!==void 0?C:{},classes:o.classes.concat(M),innerHtml:I},behaviours:Tn([...(x=o.behaviours)!==null&&x!==void 0?x:[],OM()])}},gp=(o,c,m,b=V.none())=>Wb(c,o,m(),b),wW=(o,c,m)=>{const b=m(),C=St(o,x=>ps(b,Ub(x,b)));return Wb(c,C.getOr(pB),b,V.none())},gg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},eT=Vc({name:"Notification",factory:o=>{const c=Qr({dom:{tag:"p",innerHtml:o.translationProvider(o.text)},behaviours:Tn([ms.config({})])}),m=Ce=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${Ce}%`}}}),b=Ce=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${Ce}%`}}),C=Qr({dom:{tag:"div",classes:o.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[m(0)]},b(0)],behaviours:Tn([ms.config({})])}),I={updateProgress:(Ce,Ne)=>{Ce.getSystem().isConnected()&&C.getOpt(Ce).each(st=>{ms.set(st,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[m(Ne)]},b(Ne)])})},updateText:(Ce,Ne)=>{if(Ce.getSystem().isConnected()){const st=c.get(Ce);ms.set(st,[Ni(Ne)])}}},W=Tt([o.icon.toArray(),o.level.toArray(),o.level.bind(Ce=>V.from(gg[Ce])).toArray()]),J=Qr(Uc.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[gp("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":o.translationProvider("Close")}},o.iconProvider)],action:Ce=>{o.onAction(Ce)}})),re=wW(W,{tag:"div",classes:["tox-notification__icon"]},o.iconProvider),fe={dom:{tag:"div",classes:["tox-notification__body"]},components:[c.asSpec()],behaviours:Tn([ms.config({})])},me=[re,fe];return{uid:o.uid,dom:{tag:"div",attributes:{role:"alert"},classes:o.level.map(Ce=>["tox-notification","tox-notification--in",`tox-notification--${Ce}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:Tn([es.config({}),ks("notification-events",[en(Gi(),Ce=>{J.getOpt(Ce).each(es.focus)})])]),components:me.concat(o.progress?[C.asSpec()]:[]).concat(o.closeButton?[J.asSpec()]:[]),apis:I}},configFields:[Ar("level"),Qt("progress"),Ar("icon"),Qt("onAction"),Qt("text"),Qt("iconProvider"),Qt("translationProvider"),Za("closeButton",!0)],apis:{updateProgress:(o,c,m)=>{o.updateProgress(c,m)},updateText:(o,c,m)=>{o.updateText(c,m)}}});var wB=(o,c,m)=>{const b=c.backstage.shared,C=()=>{const W=li(it.fromDom(o.getContentAreaContainer())),J=ce(),re=Jf(J.x,W.x,W.right),fe=Jf(J.y,W.y,W.bottom),me=Math.max(W.right,J.right),Ce=Math.max(W.bottom,J.bottom);return V.some(si(re,fe,me-re,Ce-fe))};return{open:(W,J)=>{const re=()=>{J(),Pa.hide(me)},fe=uc(eT.sketch({text:W.text,level:ct(["success","error","warning","warn","info"],W.type)?W.type:void 0,progress:W.progressBar===!0,icon:W.icon,closeButton:W.closeButton,onAction:re,iconProvider:b.providers.icons,translationProvider:b.providers.translate})),me=uc(Pa.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:b.getSink,fireDismissalEventInstead:{},...b.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));m.add(me),q(W.timeout)&&W.timeout>0&&Q3.setEditorTimeout(o,()=>{re()},W.timeout);const Ne={close:re,reposition:()=>{const st=ru(fe),Ht={maxHeightFunction:cg()},dt=o.notificationManager.getNotifications();if(dt[0]===Ne){const lt={...b.anchors.banner(),overrides:Ht};Pa.showWithinBounds(me,st,{anchor:lt},C)}else He(dt,Ne).each(lt=>{const Zt=dt[lt-1].getEl(),Ot={type:"node",root:Hi(),node:V.some(it.fromDom(Zt)),overrides:Ht,layouts:{onRtl:()=>[Hl],onLtr:()=>[Hl]}};Pa.showWithinBounds(me,st,{anchor:Ot},C)})},text:st=>{eT.updateText(fe,st)},settings:W,getEl:()=>fe.element.dom,progressBar:{value:st=>{eT.updateProgress(fe,st)}}};return Ne},close:W=>{W.close()},getArgs:W=>W.settings}},rA=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),MM=tinymce.util.Tools.resolve("tinymce.EditorManager"),sS=tinymce.util.Tools.resolve("tinymce.Env"),pg;(function(o){o.default="wrap",o.floating="floating",o.sliding="sliding",o.scrolling="scrolling"})(pg||(pg={}));var iA;(function(o){o.auto="auto",o.top="top",o.bottom="bottom"})(iA||(iA={}));const Ci=o=>c=>c.options.get(o),Lw=o=>c=>V.from(o(c)),RM=o=>{const c=sS.deviceType.isPhone(),m=sS.deviceType.isTablet()||c,b=o.options.register,C=M=>h(M)||M===!1,x=M=>h(M)||q(M);b("skin",{processor:M=>h(M)||M===!1,default:"oxide"}),b("skin_url",{processor:"string"}),b("height",{processor:x,default:Math.max(o.getElement().offsetHeight,400)}),b("width",{processor:x,default:rA.DOM.getStyle(o.getElement(),"width")}),b("min_height",{processor:"number",default:100}),b("min_width",{processor:"number"}),b("max_height",{processor:"number"}),b("max_width",{processor:"number"}),b("style_formats",{processor:"object[]"}),b("style_formats_merge",{processor:"boolean",default:!1}),b("style_formats_autohide",{processor:"boolean",default:!1}),b("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),b("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),b("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),b("font_size_input_default_unit",{processor:"string",default:"pt"}),b("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),b("content_langs",{processor:"object[]"}),b("removed_menuitems",{processor:"string",default:""}),b("menubar",{processor:M=>h(M)||O(M),default:!c}),b("menu",{processor:"object",default:{}}),b("toolbar",{processor:M=>O(M)||h(M)||_(M)?{value:M,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),kt(9,M=>{b("toolbar"+(M+1),{processor:"string"})}),b("toolbar_mode",{processor:"string",default:m?"scrolling":"floating"}),b("toolbar_groups",{processor:"object",default:{}}),b("toolbar_location",{processor:"string",default:iA.auto}),b("toolbar_persist",{processor:"boolean",default:!1}),b("toolbar_sticky",{processor:"boolean",default:o.inline}),b("toolbar_sticky_offset",{processor:"number",default:0}),b("fixed_toolbar_container",{processor:"string",default:""}),b("fixed_toolbar_container_target",{processor:"object"}),b("ui_mode",{processor:"string",default:"combined"}),b("file_picker_callback",{processor:"function"}),b("file_picker_validator_handler",{processor:"function"}),b("file_picker_types",{processor:"string"}),b("typeahead_urls",{processor:"boolean",default:!0}),b("anchor_top",{processor:C,default:"#top"}),b("anchor_bottom",{processor:C,default:"#bottom"}),b("draggable_modal",{processor:"boolean",default:!1}),b("statusbar",{processor:"boolean",default:!0}),b("elementpath",{processor:"boolean",default:!0}),b("branding",{processor:"boolean",default:!0}),b("promotion",{processor:"boolean",default:!0}),b("resize",{processor:M=>M==="both"||O(M),default:!sS.deviceType.isTouch()}),b("sidebar_show",{processor:"string"}),b("help_accessibility",{processor:"boolean",default:o.hasPlugin("help")})},NM=Ci("readonly"),tT=Ci("height"),PM=Ci("width"),aA=Lw(Ci("min_width")),IM=Lw(Ci("min_height")),rS=Lw(Ci("max_width")),BM=Lw(Ci("max_height")),iS=Lw(Ci("style_formats")),lA=Ci("style_formats_merge"),LM=Ci("style_formats_autohide"),FM=Ci("content_langs"),_B=Ci("removed_menuitems"),aS=Ci("toolbar_mode"),CB=Ci("toolbar_groups"),HM=Ci("toolbar_location"),$M=Ci("fixed_toolbar_container"),SB=Ci("fixed_toolbar_container_target"),zM=Ci("toolbar_persist"),nT=Ci("toolbar_sticky_offset"),kB=Ci("menubar"),cA=Ci("toolbar"),EB=Ci("file_picker_callback"),AB=Ci("file_picker_validator_handler"),xB=Ci("font_size_input_default_unit"),VM=Ci("file_picker_types"),TB=Ci("typeahead_urls"),DB=Ci("anchor_top"),oT=Ci("anchor_bottom"),UM=Ci("draggable_modal"),WM=Ci("statusbar"),OB=Ci("elementpath"),uA=Ci("branding"),MB=Ci("resize"),RB=Ci("paste_as_text"),NB=Ci("sidebar_show"),PB=Ci("promotion"),IB=Ci("help_accessibility"),sT=o=>o.options.get("skin")===!1,lS=o=>o.options.get("menubar")!==!1,BB=o=>{const c=o.options.get("skin_url");if(sT(o))return c;if(c)return o.documentBaseURI.toAbsolute(c);{const m=o.options.get("skin");return MM.baseURL+"/skins/ui/"+m}},fA=o=>o.options.get("line_height_formats").split(" "),rT=o=>{const c=cA(o),m=h(c),b=_(c)&&c.length>0;return!dA(o)&&(b||m||c===!0)},jM=o=>{const c=kt(9,b=>o.options.get("toolbar"+(b+1))),m=Zn(c,h);return un(m.length>0,m)},dA=o=>jM(o).fold(()=>{const c=cA(o);return ee(c,h)&&c.length>0},ft),ZM=o=>HM(o)===iA.bottom,LB=o=>{var c;if(!o.inline)return V.none();const m=(c=$M(o))!==null&&c!==void 0?c:"";if(m.length>0)return ta(Hi(),m);const b=SB(o);return j(b)?V.some(it.fromDom(b)):V.none()},cS=o=>o.inline&&LB(o).isSome(),iT=o=>LB(o).getOrThunk(()=>yn(Pt(it.fromDom(o.getElement())))),qM=o=>o.inline&&!lS(o)&&!rT(o)&&!dA(o),hA=o=>(o.options.get("toolbar_sticky")||o.inline)&&!cS(o)&&!qM(o),y0=o=>!cS(o)&&o.options.get("ui_mode")==="split",wy=o=>{const c=o.options.get("menu");return Ns(c,m=>({...m,items:m.items}))};var CW=Object.freeze({__proto__:null,get ToolbarMode(){return pg},get ToolbarLocation(){return iA},register:RM,getSkinUrl:BB,isReadOnly:NM,isSkinDisabled:sT,getHeightOption:tT,getWidthOption:PM,getMinWidthOption:aA,getMinHeightOption:IM,getMaxWidthOption:rS,getMaxHeightOption:BM,getUserStyleFormats:iS,shouldMergeStyleFormats:lA,shouldAutoHideStyleFormats:LM,getLineHeightFormats:fA,getContentLanguages:FM,getRemovedMenuItems:_B,isMenubarEnabled:lS,isMultipleToolbars:dA,isToolbarEnabled:rT,isToolbarPersist:zM,getMultipleToolbarsOption:jM,getUiContainer:iT,useFixedContainer:cS,isSplitUiMode:y0,getToolbarMode:aS,isDraggableModal:UM,isDistractionFree:qM,isStickyToolbar:hA,getStickyToolbarOffset:nT,getToolbarLocation:HM,isToolbarLocationBottom:ZM,getToolbarGroups:CB,getMenus:wy,getMenubar:kB,getToolbar:cA,getFilePickerCallback:EB,getFilePickerTypes:VM,useTypeaheadUrls:TB,getAnchorTop:DB,getAnchorBottom:oT,getFilePickerValidatorHandler:AB,getFontSizeInputDefaultUnit:xB,useStatusBar:WM,useElementPath:OB,promotionEnabled:PB,useBranding:uA,getResize:MB,getPasteAsText:RB,getSidebarShow:NB,useHelpAccessibility:IB});const FB="[data-mce-autocompleter]",aT=o=>ef(o,FB),SW=o=>ta(o,FB),EW={setup:(o,c)=>{const m=(C,x)=>{Do(C,Ef(),{raw:x})},b=()=>o.getMenu().bind(Nr.getHighlighted);c.on("keydown",C=>{const x=C.which;!o.isActive()||(o.isMenuOpen()?x===13?(b().each(lh),C.preventDefault()):x===40?(b().fold(()=>{o.getMenu().each(Nr.highlightFirst)},M=>{m(M,C)}),C.preventDefault(),C.stopImmediatePropagation()):(x===37||x===38||x===39)&&b().each(M=>{m(M,C),C.preventDefault(),C.stopImmediatePropagation()}):(x===13||x===38||x===40)&&o.cancelIfNecessary())}),c.on("NodeChange",C=>{o.isActive()&&!o.isProcessingAction()&&aT(it.fromDom(C.element)).isNone()&&o.cancelIfNecessary()})}};var lT;(function(o){o[o.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",o[o.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"})(lT||(lT={}));var pp=lT;const mA="tox-menu-nav__js",cT="tox-collection__item",uT="tox-swatch",AW={normal:mA,color:uT},uS="tox-collection__item--enabled",xW="tox-collection__group-heading",HB="tox-collection__item-icon",gA="tox-collection__item-label",GM="tox-collection__item-accessory",$B="tox-collection__item-caret",zB="tox-collection__item-checkmark",pA="tox-collection__item--active",VB="tox-collection__item-container",KM="tox-collection__item-container--column",UB="tox-collection__item-container--row",TW="tox-collection__item-container--align-right",DW="tox-collection__item-container--align-left",OW="tox-collection__item-container--valign-top",MW="tox-collection__item-container--valign-middle",RW="tox-collection__item-container--valign-bottom",WB=o=>ln(AW,o).getOr(mA),NW=o=>o==="color"?"tox-swatches":"tox-menu",YM=o=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:NW(o),tieredMenu:"tox-tiered-menu"}),Fw=o=>{const c=YM(o);return{backgroundMenu:c.backgroundMenu,selectedMenu:c.selectedMenu,menu:c.menu,selectedItem:c.selectedItem,item:WB(o)}},PW=(o,c,m)=>{const b=YM(m);return{tag:"div",classes:Tt([[b.menu,`tox-menu-${c}-column`],o?[b.hasIcons]:[]])}},IW=[yy.parts.items({})],fS=(o,c,m)=>{const b=YM(m);return{dom:{tag:"div",classes:Tt([[b.tieredMenu]])},markers:Fw(m)}},jB=X([Ar("data"),At("inputAttributes",{}),At("inputStyles",{}),At("tag","input"),At("inputClasses",[]),Gs("onSetValue"),At("styles",{}),At("eventOrder",{}),$l("inputBehaviours",[Jn,es]),At("selectOnFocus",!0)]),ZB=o=>Tn([es.config({onFocus:o.selectOnFocus?c=>{const m=c.element,b=Na(m);m.dom.setSelectionRange(0,b.length)}:F})]),BW=o=>({...ZB(o),...Ql(o.inputBehaviours,[Jn.config({store:{mode:"manual",...o.data.map(c=>({initialValue:c})).getOr({}),getValue:c=>Na(c.element),setValue:(c,m)=>{Na(c.element)!==m&&Sa(c.element,m)}},onSetValue:o.onSetValue})])}),XM=o=>({tag:o.tag,attributes:{type:"text",...o.inputAttributes},styles:o.inputStyles,classes:o.inputClasses}),LW=(o,c)=>({uid:o.uid,dom:XM(o),components:[],behaviours:BW(o),eventOrder:o.eventOrder}),Hw=Vc({name:"Input",configFields:jB(),factory:LW}),qB=ro("refetch-trigger-event"),GB=ro("redirect-menu-item-interaction"),KB="tox-menu__searcher",fT=o=>ta(o.element,`.${KB}`).bind(c=>o.getSystem().getByDom(c).toOptional()),dT=fT,FW=(o,c)=>{Jn.setValue(o,c.fetchPattern),o.element.dom.selectionStart=c.selectionStart,o.element.dom.selectionEnd=c.selectionEnd},YB=o=>{const c=Jn.getValue(o),m=o.element.dom.selectionStart,b=o.element.dom.selectionEnd;return{fetchPattern:c,selectionStart:m,selectionEnd:b}},HW=(o,c)=>{he(c.element,"id").each(m=>Xn(o.element,"aria-activedescendant",m))},$W=o=>{const c=(C,x)=>(x.cut(),V.none()),m=(C,x)=>{const M={interactionEvent:x.event,eventType:x.event.raw.type};return Do(C,GB,M),V.some(!0)},b="searcher-events";return{dom:{tag:"div",classes:[cT]},components:[Hw.sketch({inputClasses:[KB,"tox-textfield"],inputAttributes:{...o.placeholder.map(C=>({placeholder:o.i18n(C)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Tn([ks(b,[en(Kh(),C=>{nr(C,qB)}),en(Ef(),(C,x)=>{x.event.raw.key==="Escape"&&x.stop()})]),Io.config({mode:"special",onLeft:c,onRight:c,onSpace:c,onEnter:m,onEscape:m,onUp:m,onDown:m})]),eventOrder:{keydown:[b,Io.name()]}})]}},hT="tox-collection--results__js",XB=o=>{var c;return o.dom?{...o,dom:{...o.dom,attributes:{...(c=o.dom.attributes)!==null&&c!==void 0?c:{},id:ro("aria-item-search-result-id"),"aria-selected":"false"}}}:o},JM=(o,c)=>m=>{const b=bn(m,c);return qe(b,C=>({dom:o,components:C}))},zW=o=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[yy.parts.items({preprocess:o!=="auto"?JM({tag:"div",classes:["tox-swatches__row"]},o):we})]}]}),VW=o=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[yy.parts.items({preprocess:JM({tag:"div",classes:["tox-collection__group"]},o)})]}),JB=(o,c)=>{const m=[];let b=[];return gt(o,(C,x)=>{c(C,x)?(b.length>0&&m.push(b),b=[],(ps(C.dom,"innerHtml")||C.components&&C.components.length>0)&&b.push(C)):b.push(C)}),b.length>0&&m.push(b),qe(m,C=>({dom:{tag:"div",classes:["tox-collection__group"]},components:C}))},QM=(o,c,m)=>yy.parts.items({preprocess:b=>{const C=qe(b,m);return o!=="auto"&&o>1?JM({tag:"div",classes:["tox-collection__group"]},o)(C):JB(C,(x,M)=>c[M].type==="separator")}}),QB=(o,c,m=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(o===1?["tox-collection--list"]:["tox-collection--grid"])},components:[QM(o,c,we)]}),mT=(o,c,m=!0)=>{const b=ro("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",hT].concat(o===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:b}},components:[QM(o,c,XB)]}},UW=(o,c,m)=>{const b=ro("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(o===1?["tox-collection--list"]:["tox-collection--grid"])},components:[$W({i18n:pm.translate,placeholder:m.placeholder}),{dom:{tag:"div",classes:[...o===1?["tox-collection--list"]:["tox-collection--grid"],hT],attributes:{id:b}},components:[QM(o,c,XB)]}]}},eR=(o,c=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[yy.parts.items({preprocess:m=>JB(m,(b,C)=>o[C].type==="separator")})]}),gT=o=>an(o,c=>"icon"in c&&c.icon!==void 0),jb=o=>(console.error(kd(o)),console.log(o),V.none()),WW=(o,c,m,b,C)=>{const x=eR(m);return{value:o,dom:x.dom,components:x.components,items:m}},tR=(o,c,m,b,C)=>{const x=()=>C.menuType!=="searchable"?QB(b,m):C.searchMode.searchMode==="search-with-field"?UW(b,m,C.searchMode):mT(b,m);if(C.menuType==="color"){const M=zW(b);return{value:o,dom:M.dom,components:M.components,items:m}}else if(C.menuType==="normal"&&b==="auto"){const M=QB(b,m);return{value:o,dom:M.dom,components:M.components,items:m}}else if(C.menuType==="normal"||C.menuType==="searchable"){const M=x();return{value:o,dom:M.dom,components:M.components,items:m}}else if(C.menuType==="listpreview"&&b!=="auto"){const M=VW(b);return{value:o,dom:M.dom,components:M.components,items:m}}else return{value:o,dom:PW(c,b,C.menuType),components:IW,items:m}},Ol=Ca("type"),pT=Ca("name"),nR=Ca("label"),a1=Ca("text"),bT=Ca("title"),oR=Ca("icon"),$w=Ca("value"),vT=Ic("fetch"),e8=Ic("getSubmenuItems"),Eh=Ic("onAction"),sR=Ic("onItemAction"),zw=qa("onSetup",()=>F),jW=Gl("name"),_y=Gl("text"),bg=Gl("icon"),Zb=Gl("tooltip"),rR=Gl("label"),ZW=Gl("shortcut"),t8=zm("select"),bA=Za("active",!1),iR=Za("borderless",!1),bp=Za("enabled",!0),dS=Za("primary",!1),yT=o=>At("columns",o),aR=At("meta",{}),wT=qa("onAction",F),Cy=o=>lc("type",o),lR=o=>Va("name","name",ql(()=>ro(`${o}-name`)),ml),qW=o=>Va("value","value",ql(()=>ro(`${o}-value`)),Pc()),n8=lo([Ol,_y]),GW=o=>Ui("separatormenuitem",n8,o),KW=lo([Cy("autocompleteitem"),bA,bp,aR,$w,_y,bg]),YW=o=>Ui("Autocompleter.Separator",n8,o),o8=o=>Ui("Autocompleter.Item",KW,o),hS=[bp,Zb,bg,_y,zw],XW=lo([Ol,Eh].concat(hS)),cR=o=>Ui("toolbarbutton",XW,o),_T=[bA].concat(hS),vA=lo(_T.concat([Ol,Eh])),uR=o=>Ui("ToggleButton",vA,o),s8=[qa("predicate",Je),Au("scope","node",["node","editor"]),Au("position","selection",["node","selection","line"])],JW=hS.concat([Cy("contextformbutton"),dS,Eh,_a("original",we)]),r8=_T.concat([Cy("contextformbutton"),dS,Eh,_a("original",we)]),QW=hS.concat([Cy("contextformbutton")]),ej=_T.concat([Cy("contextformtogglebutton")]),i8=Cl("type",{contextformbutton:JW,contextformtogglebutton:r8}),a8=lo([Cy("contextform"),qa("initValue",X("")),rR,Ll("commands",i8),Wa("launch",Cl("type",{contextformbutton:QW,contextformtogglebutton:ej}))].concat(s8)),l8=o=>Ui("ContextForm",a8,o),c8=lo([Cy("contexttoolbar"),Ca("items")].concat(s8)),tj=o=>Ui("ContextToolbar",c8,o),nj=[Ol,Ca("src"),Gl("alt"),Jc("classes",[],ml)],u8=lo(nj),fR=[Ol,a1,jW,Jc("classes",["tox-collection__item-label"],ml)],dR=lo(fR),hR=hl(()=>Sd("type",{cardimage:u8,cardtext:dR,cardcontainer:f8})),f8=lo([Ol,lc("direction","horizontal"),lc("align","left"),lc("valign","middle"),Ll("items",hR)]),Vw=[bp,_y,ZW,qW("menuitem"),aR],oj=lo([Ol,rR,Ll("items",hR),zw,wT].concat(Vw)),mR=o=>Ui("cardmenuitem",oj,o),sj=lo([Ol,bA,bg].concat(Vw)),d8=o=>Ui("choicemenuitem",sj,o),gR=[Ol,Ca("fancytype"),wT],Uw=[At("initData",{})].concat(gR),rj=[zm("select"),eb("initData",{},[Za("allowCustomColors",!0),lc("storageKey","default"),W1("colors",Pc())])].concat(gR),pR=Cl("fancytype",{inserttable:Uw,colorswatch:rj}),CT=o=>Ui("fancymenuitem",pR,o),ij=lo([Ol,zw,wT,bg].concat(Vw)),h8=o=>Ui("menuitem",ij,o),m8=lo([Ol,e8,zw,bg].concat(Vw)),g8=o=>Ui("nestedmenuitem",m8,o),bR=lo([Ol,bg,bA,zw,Eh].concat(Vw)),p8=o=>Ui("togglemenuitem",bR,o),vR=(o,c,m)=>{const b=lu(o.element,"."+m);if(b.length>0){const C=Xt(b,x=>{const M=x.dom.getBoundingClientRect().top,I=b[0].dom.getBoundingClientRect().top;return Math.abs(M-I)>c}).getOr(b.length);return V.some({numColumns:C,numRows:Math.ceil(b.length/C)})}else return V.none()},yR=(o,c)=>Tn([ks(o,c)]),mS={namedEvents:yR,unnamedEvents:o=>yR(ro("unnamed-events"),o)},wR=ro("tooltip.exclusive"),yA=ro("tooltip.show"),gS=ro("tooltip.hide"),b8=(o,c,m)=>{o.getSystem().broadcastOn([wR],{})};var lj=Object.freeze({__proto__:null,hideAllExclusive:b8,setComponents:(o,c,m,b)=>{m.getTooltip().each(C=>{C.getSystem().isConnected()&&ms.set(C,b)})}}),v8=Object.freeze({__proto__:null,events:(o,c)=>{const m=C=>{c.getTooltip().each(x=>{$c(x),o.onHide(C,x),c.clearTooltip()}),c.clearTimer()},b=C=>{if(!c.isShowing()){b8(C);const x=o.lazySink(C).getOrDie(),M=C.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:ri(o.mode==="normal"?[en(Sl(),I=>{nr(C,yA)}),en(cc(),I=>{nr(C,gS)})]:[]),behaviours:Tn([ms.config({})])});c.setTooltip(M),rl(x,M),o.onShow(C,M),uu.position(x,M,{anchor:o.anchor(C)})}};return ri(Tt([[en(yA,C=>{c.resetTimer(()=>{b(C)},o.delay)}),en(gS,C=>{c.resetTimer(()=>{m(C)},o.delay)}),en(Jh(),(C,x)=>{const M=x;M.universal||ct(M.channels,wR)&&m(C)}),Dd(C=>{m(C)})],o.mode==="normal"?[en(Gi(),C=>{nr(C,yA)}),en(qm(),C=>{nr(C,gS)}),en(Sl(),C=>{nr(C,yA)}),en(cc(),C=>{nr(C,gS)})]:[en(Jm(),(C,x)=>{nr(C,yA)}),en(Ev(),C=>{nr(C,gS)})]]))}}),wA=[Qt("lazySink"),Qt("tooltipDom"),At("exclusive",!0),At("tooltipComponents",[]),At("delay",300),Au("mode","normal",["normal","follow-highlight"]),At("anchor",o=>({type:"hotspot",hotspot:o,layouts:{onLtr:X([Hl,Yl,gl,Du,Kl,Fr]),onRtl:X([Hl,Yl,gl,Du,Kl,Fr])}})),Gs("onHide"),Gs("onShow")],uj=Object.freeze({__proto__:null,init:()=>{const o=ji(),c=ji(),m=()=>{o.on(clearTimeout)},b=(x,M)=>{m(),o.set(setTimeout(x,M))},C=X("not-implemented");return su({getTooltip:c.get,isShowing:c.isSet,setTooltip:c.set,clearTooltip:c.clear,clearTimer:m,resetTimer:b,readState:C})}});const y8=Xl({fields:wA,name:"tooltipping",active:v8,state:uj,apis:lj}),fj=o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),w8="silver.readonly",dj=lo([Ug("readonly")]),Ww=(o,c)=>{const b=o.mainUi.outerContainer.element,C=[o.mainUi.mothership,...o.uiMotherships];c&>(C,x=>{x.broadcastOn([_h()],{target:b})}),gt(C,x=>{x.broadcastOn([w8],{readonly:c})})},_8=(o,c)=>{o.on("init",()=>{o.mode.isReadOnly()&&Ww(c,!0)}),o.on("SwitchMode",()=>Ww(c,o.mode.isReadOnly())),NM(o)&&o.mode.set("readonly")},ec=()=>Cc.config({channels:{[w8]:{schema:dj,onReceive:(o,c)=>{Xo.set(o,c.readonly)}}}}),vg={item:o=>Xo.config({disabled:o,disableClass:"tox-collection__item--state-disabled"}),button:o=>Xo.config({disabled:o}),splitButton:o=>Xo.config({disabled:o,disableClass:"tox-tbtn--disabled"}),toolbarButton:o=>Xo.config({disabled:o,disableClass:"tox-tbtn--disabled",useNative:!1})},_A=(o,c)=>{const m=o.getApi(c);return b=>{b(m)}},qb=(o,c)=>yi(m=>{_A(o,m)(C=>{const x=o.onSetup(C);z(x)&&c.set(x)})}),Gb=(o,c)=>Dd(m=>_A(o,m)(c.get())),gj=(o,c)=>ou((m,b)=>{_A(o,m)(o.onAction),!o.triggersSubmenu&&c===pp.CLOSE_ON_EXECUTE&&(m.getSystem().isConnected()&&nr(m,Ma()),b.stop())}),pj={[Ku()]:["disabling","alloy.base.behaviour","toggling","item-events"]},pS=Dt,bS=(o,c,m,b)=>{const C=$o(F);return{type:"item",dom:c.dom,components:pS(c.optComponents),data:o.data,eventOrder:pj,hasSubmenu:o.triggersSubmenu,itemBehaviours:Tn([ks("item-events",[gj(o,m),qb(o,C),Gb(o,C)]),vg.item(()=>!o.enabled||b.isDisabled()),ec(),ms.config({})].concat(o.itemBehaviours))}},jw=o=>({value:o.value,meta:{text:o.text.getOr(""),...o.meta}}),_R=o=>{const c=sS.os.isMacOS()||sS.os.isiOS(),C=c?{alt:"\u2325",ctrl:"\u2303",shift:"\u21E7",meta:"\u2318",access:"\u2303\u2325"}:{meta:"Ctrl",access:"Shift+Alt"},x=o.split("+"),M=qe(x,I=>{const W=I.toLowerCase().trim();return ps(C,W)?C[W]:I});return c?M.join(""):M.join("+")},CR=(o,c,m=[HB])=>gp(o,{tag:"div",classes:m},c),C8=o=>({dom:{tag:"div",classes:[gA]},components:[Ni(pm.translate(o))]}),S8=(o,c)=>({dom:{tag:"div",classes:c,innerHtml:o}}),bj=(o,c)=>({dom:{tag:"div",classes:[gA]},components:[{dom:{tag:o.tag,styles:o.styles},components:[Ni(pm.translate(c))]}]}),vj=o=>({dom:{tag:"div",classes:[GM]},components:[Ni(_R(o))]}),SR=o=>CR("checkmark",o,[zB]),yj=o=>CR("chevron-right",o,[$B]),wj=o=>CR("chevron-down",o,[$B]),kR=(o,c)=>{const m=o.direction==="vertical"?KM:UB,b=o.align==="left"?DW:TW;return{dom:{tag:"div",classes:[VB,m,b,(()=>{switch(o.valign){case"top":return OW;case"middle":return MW;case"bottom":return RW}})()]},components:c}},k8=(o,c,m)=>({dom:{tag:"img",classes:c,attributes:{src:o,alt:m.getOr("")}}}),_j=(o,c,m)=>{const b="custom",C="remove",x=o.ariaLabel,M=o.value,I=o.iconContent.map(J=>Bw(J,c.icons,m));return{dom:(()=>{const J=uT,re=I.getOr(""),me={tag:"div",attributes:x.map(Ce=>({title:c.translate(Ce)})).getOr({}),classes:[J]};return M===b?{...me,tag:"button",classes:[...me.classes,"tox-swatches__picker-btn"],innerHtml:re}:M===C?{...me,classes:[...me.classes,"tox-swatch--remove"],innerHtml:re}:j(M)?{...me,attributes:{...me.attributes,"data-mce-color":M},styles:{"background-color":M},innerHtml:re}:me})(),optComponents:[]}},E8=o=>{const c=o.map(m=>({attributes:{title:pm.translate(m),id:ro("menu-item")}})).getOr({});return{tag:"div",classes:[mA,cT],...c}},A8=(o,c,m,b)=>{const C={tag:"div",classes:[HB]},x=me=>gp(me,C,c.icons,b),M=()=>V.some({dom:C}),I=m?o.iconContent.map(x).orThunk(M):V.none(),W=o.checkMark,J=V.from(o.meta).fold(()=>C8,me=>ps(me,"style")?Te(bj,me.style):C8),re=o.htmlContent.fold(()=>o.textContent.map(J),me=>V.some(S8(me,[gA])));return{dom:E8(o.ariaLabel),optComponents:[I,re,o.shortcutContent.map(vj),W,o.caret]}},CA=(o,c,m,b=V.none())=>o.presets==="color"?_j(o,c,b):A8(o,c,m,b),x8=(o,c)=>ln(o,"tooltipWorker").map(m=>[y8.config({lazySink:c.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:b=>({type:"submenu",item:b,overrides:{maxHeightFunction:cg}}),mode:"follow-highlight",onShow:(b,C)=>{m(x=>{y8.setComponents(b,[Pv({element:it.fromDom(x)})])})}})]).getOr([]),T8=o=>rA.DOM.encode(o),ER=(o,c)=>{const m=pm.translate(o),b=T8(m);if(c.length>0){const C=new RegExp(fj(c),"gi");return b.replace(C,x=>`<span class="tox-autocompleter-highlight">${x}</span>`)}else return b},D8=(o,c,m,b,C,x,M,I=!0)=>{const W=CA({presets:b,textContent:V.none(),htmlContent:m?o.text.map(J=>ER(J,c)):V.none(),ariaLabel:o.text,iconContent:o.icon,shortcutContent:V.none(),checkMark:V.none(),caret:V.none(),value:o.value},M.providers,I,o.icon);return bS({data:jw(o),enabled:o.enabled,getApi:X({}),onAction:J=>C(o.value,o.meta),onSetup:X(F),triggersSubmenu:!1,itemBehaviours:x8(o.meta,M)},W,x,M.providers)},O8=(o,c)=>qe(o,m=>{switch(m.type){case"cardcontainer":return kR(m,O8(m.items,c));case"cardimage":return k8(m.src,m.classes,m.alt);case"cardtext":const C=m.name.exists(x=>ct(c.cardText.highlightOn,x))?V.from(c.cardText.matchText).getOr(""):"";return S8(ER(m.text,C),m.classes)}}),Cj=(o,c,m,b)=>{const C=M=>({isEnabled:()=>!Xo.isDisabled(M),setEnabled:I=>{Xo.set(M,!I),gt(lu(M.element,"*"),W=>{M.getSystem().getByDom(W).each(J=>{J.hasConfigured(Xo)&&Xo.set(J,!I)})})}}),x={dom:E8(o.label),optComponents:[V.some({dom:{tag:"div",classes:[VB,UB]},components:O8(o.items,b)})]};return bS({data:jw({text:V.none(),...o}),enabled:o.enabled,getApi:C,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:V.from(b.itemBehaviours).getOr([])},x,c,m.providers)},Sj=(o,c,m,b,C,x,M,I=!0)=>{const W=re=>({setActive:fe=>{Ms.set(re,fe)},isActive:()=>Ms.isOn(re),isEnabled:()=>!Xo.isDisabled(re),setEnabled:fe=>Xo.set(re,!fe)}),J=CA({presets:m,textContent:c?o.text:V.none(),htmlContent:V.none(),ariaLabel:o.text,iconContent:o.icon,shortcutContent:c?o.shortcut:V.none(),checkMark:c?V.some(SR(M.icons)):V.none(),caret:V.none(),value:o.value},M,I);return Jr(bS({data:jw(o),enabled:o.enabled,getApi:W,onAction:re=>b(o.value),onSetup:re=>(re.setActive(C),F),triggersSubmenu:!1,itemBehaviours:[]},J,x,M),{toggling:{toggleClass:uS,toggleOnExecute:!1,selected:o.active,exclusive:!0}})},M8=HE(kM(),Y3()),R8=o=>({value:SA(o)}),Sy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ST=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,N8=o=>Sy.test(o)||ST.test(o),SA=o=>Sr(o,"#").toUpperCase(),l1=o=>N8(o)?V.some({value:SA(o)}):V.none(),kj=o=>({value:o.value.replace(Sy,(m,b,C,x)=>b+b+C+C+x+x)}),Ej=o=>{const c=kj(o),m=ST.exec(c.value);return m===null?["FFFFFF","FF","FF","FF"]:m},AR=o=>{const c=o.toString(16);return(c.length===1?"0"+c:c).toUpperCase()},Zw=o=>{const c=AR(o.red)+AR(o.green)+AR(o.blue);return R8(c)},P8=Math.min,I8=Math.max,kA=Math.round,Aj=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,xj=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,ky=(o,c,m,b)=>({red:o,green:c,blue:m,alpha:b}),sd=o=>{const c=parseInt(o,10);return c.toString()===o&&c>=0&&c<=255},c1=o=>{let c,m,b;const C=(o.hue||0)%360;let x=o.saturation/100,M=o.value/100;if(x=I8(0,P8(x,1)),M=I8(0,P8(M,1)),x===0)return c=m=b=kA(255*M),ky(c,m,b,1);const I=C/60,W=M*x,J=W*(1-Math.abs(I%2-1)),re=M-W;switch(Math.floor(I)){case 0:c=W,m=J,b=0;break;case 1:c=J,m=W,b=0;break;case 2:c=0,m=W,b=J;break;case 3:c=0,m=J,b=W;break;case 4:c=J,m=0,b=W;break;case 5:c=W,m=0,b=J;break;default:c=m=b=0}return c=kA(255*(c+re)),m=kA(255*(m+re)),b=kA(255*(b+re)),ky(c,m,b,1)},EA=o=>{const c=Ej(o),m=parseInt(c[1],16),b=parseInt(c[2],16),C=parseInt(c[3],16);return ky(m,b,C,1)},xR=(o,c,m,b)=>{const C=parseInt(o,10),x=parseInt(c,10),M=parseInt(m,10),I=parseFloat(b);return ky(C,x,M,I)},vS=o=>{if(o==="transparent")return V.some(ky(0,0,0,0));const c=Aj.exec(o);if(c!==null)return V.some(xR(c[1],c[2],c[3],"1"));const m=xj.exec(o);return m!==null?V.some(xR(m[1],m[2],m[3],m[4])):V.none()},kT=o=>`rgba(${o.red},${o.green},${o.blue},${o.alpha})`,B8=ky(255,0,0,1),Tj=o=>{o.dispatch("SkinLoaded")},AA=(o,c)=>{o.dispatch("SkinLoadError",c)},ET=o=>{o.dispatch("ResizeEditor")},TR=(o,c)=>{o.dispatch("ResizeContent",c)},Ey=(o,c)=>{o.dispatch("ScrollContent",c)},L8=(o,c)=>{o.dispatch("TextColorChange",c)},Dj=(o,c)=>{o.dispatch("AfterProgressState",{state:c})},Ah=(o,c)=>o.dispatch("ResolveName",{name:c.nodeName.toLowerCase(),target:c}),DR=(o,c)=>{o.dispatch("ToggleToolbarDrawer",{state:c})},yg=(o,c)=>()=>{o(),c()},Rf=o=>_0(o,"NodeChange",c=>{c.setEnabled(o.selection.isEditable())}),Pi=(o,c)=>m=>{const b=r0(),C=()=>{m.setActive(o.formatter.match(c));const x=o.formatter.formatChanged(c,m.setActive);b.set(x)};return o.initialized?C():o.once("init",C),()=>{o.off("init",C),b.clear()}},w0=(o,c)=>m=>{const b=Rf(o)(m),C=Pi(o,c)(m);return()=>{b(),C()}},_0=(o,c,m)=>b=>{const C=()=>m(b),x=()=>{m(b),o.on(c,C)};return o.initialized?x():o.once("init",x),()=>{o.off("init",x),o.off(c,C)}},OR=o=>c=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("mceToggleFormat",!1,c.format)})},rd=(o,c)=>()=>o.execCommand(c);var Kb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const F8={},MR=(o,c=10)=>{const m=Kb.getItem(o),b=h(m)?JSON.parse(m):[],x=(J=>c-J.length<0?J.slice(0,c):J)(b),M=J=>{He(x,J).each(I),x.unshift(J),x.length>c&&x.pop(),Kb.setItem(o,JSON.stringify(x))},I=J=>{x.splice(J,1)};return{add:M,state:()=>x.slice(0)}},H8=o=>ln(F8,o).getOrThunk(()=>{const c=`tinymce-custom-colors-${o}`,m=Kb.getItem(c);if(L(m)){const C=Kb.getItem("tinymce-custom-colors");Kb.setItem(c,j(C)?C:"[]")}const b=MR(c,10);return F8[o]=b,b}),$8=o=>qe(H8(o).state(),c=>({type:"choiceitem",text:c,icon:"checkmark",value:c})),RR=(o,c)=>{H8(o).add(c)},qw=(o,c,m)=>({hue:o,saturation:c,value:m}),AT=o=>{let c=0,m=0,b=0;const C=o.red/255,x=o.green/255,M=o.blue/255,I=Math.min(C,Math.min(x,M)),W=Math.max(C,Math.max(x,M));if(I===W)return b=I,qw(0,0,b*100);const J=C===I?x-M:M===I?C-x:M-C;return c=C===I?3:M===I?1:5,c=60*(c-J/(W-I)),m=(W-I)/W,b=W,qw(Math.round(c),Math.round(m*100),Math.round(b*100))},xT=o=>AT(EA(o)),z8=o=>Zw(c1(o)),Oj=o=>l1(o).orThunk(()=>vS(o).map(Zw)).getOrThunk(()=>{const c=document.createElement("canvas");c.height=1,c.width=1;const m=c.getContext("2d");m.clearRect(0,0,c.width,c.height),m.fillStyle="#FFFFFF",m.fillStyle=o,m.fillRect(0,0,1,1);const b=m.getImageData(0,0,1,1).data,C=b[0],x=b[1],M=b[2],I=b[3];return Zw(ky(C,x,M,I))}),NR="forecolor",PR="hilitecolor",Mj=5,Rj=o=>{const c=[];for(let m=0;m<o.length;m+=2)c.push({text:o[m+1],value:"#"+Oj(o[m]).value,icon:"checkmark",type:"choiceitem"});return c},C0=o=>c=>c.options.get(o),IR="#000000",Nj=o=>{const c=o.options.register,m=C=>ee(C,h)?{value:Rj(C),valid:!0}:{valid:!1,message:"Must be an array of strings."},b=C=>q(C)&&C>0?{value:C,valid:!0}:{valid:!1,message:"Must be a positive number."};c("color_map",{processor:m,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),c("color_map_background",{processor:m}),c("color_map_foreground",{processor:m}),c("color_cols",{processor:b,default:TT(o)}),c("color_cols_foreground",{processor:b,default:V8(o,NR)}),c("color_cols_background",{processor:b,default:V8(o,PR)}),c("custom_colors",{processor:"boolean",default:!0}),c("color_default_foreground",{processor:"string",default:IR}),c("color_default_background",{processor:"string",default:IR})},BR=(o,c)=>c===NR&&o.options.isSet("color_map_foreground")?C0("color_map_foreground")(o):c===PR&&o.options.isSet("color_map_background")?C0("color_map_background")(o):C0("color_map")(o),TT=(o,c="default")=>Math.max(Mj,Math.ceil(Math.sqrt(BR(o,c).length))),V8=(o,c)=>{const m=C0("color_cols")(o),b=TT(o,c);return m===TT(o)?b:m},LR=(o,c="default")=>Math.round((()=>c===NR?C0("color_cols_foreground")(o):c===PR?C0("color_cols_background")(o):C0("color_cols")(o))()),U8=C0("custom_colors"),Pj=C0("color_default_foreground"),Ij=C0("color_default_background"),Bj="rgba(0, 0, 0, 0)",Lj=o=>vS(o).exists(c=>c.alpha!==0),Fj=o=>Qc(o,c=>{if(pr(c)){const m=qr(c,"background-color");return un(Lj(m),m)}else return V.none()}).getOr(Bj),FR=(o,c)=>{const m=it.fromDom(o.selection.getStart()),b=c==="hilitecolor"?Fj(m):qr(m,"color");return vS(b).map(C=>"#"+Zw(C).value)},u1=(o,c,m)=>{o.undoManager.transact(()=>{o.focus(),o.formatter.apply(c,{value:m}),o.nodeChanged()})},Hj=(o,c)=>{o.undoManager.transact(()=>{o.focus(),o.formatter.remove(c,{value:null},void 0,!0),o.nodeChanged()})},HR=o=>{o.addCommand("mceApplyTextcolor",(c,m)=>{u1(o,c,m)}),o.addCommand("mceRemoveTextcolor",c=>{Hj(o,c)})},$R=o=>{const c="choiceitem",m={type:c,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return o?[m,{type:c,text:"Custom color",icon:"color-picker",value:"custom"}]:[m]},DT=(o,c,m,b)=>{m==="custom"?q8(o)(x=>{x.each(M=>{RR(c,M),o.execCommand("mceApplyTextcolor",c,M),b(M)})},FR(o,c).getOr(IR)):m==="remove"?(b(""),o.execCommand("mceRemoveTextcolor",c)):(b(m),o.execCommand("mceApplyTextcolor",c,m))},zR=(o,c,m)=>o.concat($8(c).concat($R(m))),VR=(o,c,m)=>b=>{b(zR(o,c,m))},OT=(o,c,m)=>{const b=c==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";o.setIconFill(b,m)},W8=(o,c)=>m=>{const b=FR(o,c);return ze(b,m.toUpperCase())},j8=(o,c,m,b,C)=>{o.ui.registry.addSplitButton(c,{tooltip:b,presets:"color",icon:c==="forecolor"?"text-color":"highlight-bg-color",select:W8(o,m),columns:LR(o,m),fetch:VR(BR(o,m),m,U8(o)),onAction:x=>{DT(o,m,C.get(),F)},onItemAction:(x,M)=>{DT(o,m,M,I=>{C.set(I),L8(o,{name:c,color:I})})},onSetup:x=>{OT(x,c,C.get());const M=I=>{I.name===c&&OT(x,I.name,I.color)};return o.on("TextColorChange",M),yg(Rf(o)(x),()=>{o.off("TextColorChange",M)})}})},Z8=(o,c,m,b,C)=>{o.ui.registry.addNestedMenuItem(c,{text:b,icon:c==="forecolor"?"text-color":"highlight-bg-color",onSetup:x=>(OT(x,c,C.get()),Rf(o)(x)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:W8(o,m),initData:{storageKey:m},onAction:x=>{DT(o,m,x.value,M=>{C.set(M),L8(o,{name:c,color:M})})}}]})},q8=o=>(c,m)=>{let b=!1;const C=I=>{const J=I.getData().colorpicker;b?(c(V.from(J)),I.close()):o.windowManager.alert(o.translate(["Invalid hex color code: {0}",J]))},x=(I,W)=>{W.name==="hex-valid"&&(b=W.value)},M={colorpicker:m};o.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:M,onAction:x,onSubmit:C,onClose:F,onCancel:()=>{c(V.none())}})},G8=o=>{HR(o);const c=Pj(o),m=Ij(o),b=$o(c),C=$o(m);j8(o,"forecolor","forecolor","Text color",b),j8(o,"backcolor","hilitecolor","Background color",C),Z8(o,"forecolor","forecolor","Text color",b),Z8(o,"backcolor","hilitecolor","Background color",C)},MT=(o,c,m,b,C,x,M,I)=>{const W=gT(c),re=K8(c,m,b,C!=="color"?"normal":"color",x,M,I);return tR(o,W,re,b,{menuType:C})},K8=(o,c,m,b,C,x,M)=>Dt(qe(o,I=>I.type==="choiceitem"?d8(I).fold(jb,W=>V.some(Sj(W,m===1,b,c,x(W.value),C,M,gT(o)))):V.none())),RT=(o,c)=>{const m=Fw(c);return o===1?{mode:"menu",moveOnTab:!0}:o==="auto"?{mode:"grid",selector:"."+m.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+(c==="color"?"tox-swatches__row":"tox-collection__group"),previousSelector:C=>c==="color"?ta(C.element,"[aria-checked=true]"):V.none()}},$j=(o,c)=>o===1?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:o==="auto"?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:c==="color"?".tox-swatches__row":".tox-collection__group",cell:c==="color"?`.${uT}`:`.${cT}`}},zj=(o,c)=>{const m=yS(o,c),b=c.colorinput.getColorCols(o.initData.storageKey),C="color",M={...MT(ro("menu-value"),m,I=>{o.onAction({value:I})},b,C,pp.CLOSE_ON_EXECUTE,o.select.getOr(Je),c.shared.providers),markers:Fw(C),movement:RT(b,C)};return{type:"widget",data:{value:ro("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[M8.widget(yy.sketch(M))]}},yS=(o,c)=>{const m=o.initData.allowCustomColors&&c.colorinput.hasCustomColors();return o.initData.colors.fold(()=>zR(c.colorinput.getColors(o.initData.storageKey),o.initData.storageKey,m),b=>b.concat($R(m)))},Y8=ro("cell-over"),UR=ro("cell-execute"),X8=o=>(c,m)=>o.shared.providers.translate(`${m} columns, ${c} rows`),J8=(o,c,m)=>{const b=M=>Do(M,Y8,{row:o,col:c}),C=M=>Do(M,UR,{row:o,col:c}),x=(M,I)=>{I.stop(),C(M)};return uc({dom:{tag:"div",attributes:{role:"button",["aria-label"]:m}},behaviours:Tn([ks("insert-table-picker-cell",[en(Sl(),es.focus),en(Ku(),C),en(Yh(),x),en(Z1(),x)]),Ms.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),es.config({onFocus:b})])})},WR=(o,c,m)=>{const b=[];for(let C=0;C<c;C++){const x=[];for(let M=0;M<m;M++){const I=o(C+1,M+1);x.push(J8(C,M,I))}b.push(x)}return b},jR=(o,c,m,b,C)=>{for(let x=0;x<b;x++)for(let M=0;M<C;M++)Ms.set(o[x][M],x<=c&&M<=m)},ZR=o=>Be(o,c=>qe(c,ru)),qR=(o,c)=>Ni(`${c}x${o}`),Q8={inserttable:(o,c)=>{const C=X8(c),x=WR(C,10,10),M=qR(0,0),I=Qr({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[M],behaviours:Tn([ms.config({})])});return{type:"widget",data:{value:ro("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[M8.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:ZR(x).concat(I.asSpec()),behaviours:Tn([ks("insert-table-picker",[yi(W=>{ms.set(I.get(W),[M])}),p2(Y8,(W,J,re)=>{const{row:fe,col:me}=re.event;jR(x,fe,me,10,10),ms.set(I.get(W),[qR(fe+1,me+1)])}),p2(UR,(W,J,re)=>{const{row:fe,col:me}=re.event;o.onAction({numRows:fe+1,numColumns:me+1}),nr(W,Ma())})]),Io.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:zj},Vj=(o,c)=>ln(Q8,o.fancytype).map(m=>m(o,c)),Uj=(o,c,m,b=!0,C=!1)=>{const x=C?wj(m.icons):yj(m.icons),M=W=>({isEnabled:()=>!Xo.isDisabled(W),setEnabled:J=>Xo.set(W,!J),setIconFill:(J,re)=>{ta(W.element,`svg path[class="${J}"], rect[class="${J}"]`).each(fe=>{Xn(fe,"fill",re)})}}),I=CA({presets:"normal",iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,caret:V.some(x),checkMark:V.none(),shortcutContent:o.shortcut},m,b);return bS({data:jw(o),getApi:M,enabled:o.enabled,onAction:F,onSetup:o.onSetup,triggersSubmenu:!0,itemBehaviours:[]},I,c,m)},Wj=(o,c,m,b=!0)=>{const C=M=>({isEnabled:()=>!Xo.isDisabled(M),setEnabled:I=>Xo.set(M,!I)}),x=CA({presets:"normal",iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,caret:V.none(),checkMark:V.none(),shortcutContent:o.shortcut},m,b);return bS({data:jw(o),getApi:C,enabled:o.enabled,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:[]},x,c,m)},eL=o=>({type:"separator",dom:{tag:"div",classes:[cT,xW]},components:o.text.map(Ni).toArray()}),tL=(o,c,m,b=!0)=>{const C=M=>({setActive:I=>{Ms.set(M,I)},isActive:()=>Ms.isOn(M),isEnabled:()=>!Xo.isDisabled(M),setEnabled:I=>Xo.set(M,!I)}),x=CA({iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,checkMark:V.some(SR(m.icons)),caret:V.none(),shortcutContent:o.shortcut,presets:"normal",meta:o.meta},m,b);return Jr(bS({data:jw(o),enabled:o.enabled,getApi:C,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:[]},x,c,m),{toggling:{toggleClass:uS,toggleOnExecute:!1,selected:o.active}})},nL=D8,oL=eL,jj=Wj,Zj=Uj,qj=tL,Gj=Vj,Kj=Cj;var Yj=Object.freeze({__proto__:null,getCoupled:(o,c,m,b)=>m.getOrCreate(o,c,b),getExistingCoupled:(o,c,m,b)=>m.getExisting(o,c,b)}),Xj=[Gr("others",U1(Cn.value,Pc()))],sL=Object.freeze({__proto__:null,init:()=>{const o={},c=(x,M)=>{if(Zs(x.others).length===0)throw new Error("Cannot find any known coupled components");return ln(o,M)},m=(x,M,I)=>c(M,I).getOrThunk(()=>{const J=ln(M.others,I).getOrDie("No information found for coupled component: "+I)(x),re=x.getSystem().build(J);return o[I]=re,re}),b=(x,M,I)=>c(M,I).orThunk(()=>(ln(M.others,I).getOrDie("No information found for coupled component: "+I),V.none())),C=X({});return su({readState:C,getExisting:b,getOrCreate:m})}});const il=Xl({fields:Xj,name:"coupling",apis:Yj,state:sL}),GR=o=>{let c=V.none(),m=[];const b=J=>GR(re=>{C(fe=>{re(J(fe))})}),C=J=>{M()?W(J):m.push(J)},x=J=>{M()||(c=V.some(J),I(m),m=[])},M=()=>c.isSome(),I=J=>{gt(J,W)},W=J=>{c.each(re=>{setTimeout(()=>{J(re)},0)})};return o(x),{get:C,map:b,isReady:M}},Jj={nu:GR,pure:o=>GR(c=>{c(o)})},Qj=o=>{setTimeout(()=>{throw o},0)},Yb=o=>{const c=W=>{o().then(W,Qj)};return{map:W=>Yb(()=>o().then(W)),bind:W=>Yb(()=>o().then(J=>W(J).toPromise())),anonBind:W=>Yb(()=>o().then(()=>W.toPromise())),toLazy:()=>Jj.nu(c),toCached:()=>{let W=null;return Yb(()=>(W===null&&(W=o()),W))},toPromise:o,get:c}},Bu={nu:o=>Yb(()=>new Promise(o)),pure:o=>Yb(()=>Promise.resolve(o))},rL=X("sink"),iL=X(Fd({name:rL(),overrides:X({dom:{tag:"div"},behaviours:Tn([uu.config({useFixed:ft})]),events:ri([Qh(Ef()),Qh(Br()),Qh(Yh())])})})),aL=(o,c)=>{const m=o.getHotspot(c).getOr(c),b="hotspot",C=o.getAnchorOverrides();return o.layouts.fold(()=>({type:b,hotspot:m,overrides:C}),x=>({type:b,hotspot:m,overrides:C,layouts:x}))},tZ=(o,c,m)=>{const b=o.fetch;return b(m).map(c)},KR=(o,c,m,b,C,x,M)=>{const I=tZ(o,c,b),W=uL(b,o);return I.map(J=>J.bind(re=>V.from(Iw.sketch({...x.menu(),uid:fh(""),data:re,highlightOnOpen:M,onOpenMenu:(fe,me)=>{const Ce=W().getOrDie();uu.position(Ce,me,{anchor:m}),Ks.decloak(C)},onOpenSubmenu:(fe,me,Ce)=>{const Ne=W().getOrDie();uu.position(Ne,Ce,{anchor:{type:"submenu",item:me}}),Ks.decloak(C)},onRepositionMenu:(fe,me,Ce)=>{const Ne=W().getOrDie();uu.position(Ne,me,{anchor:m}),gt(Ce,st=>{uu.position(Ne,st.triggeredMenu,{anchor:{type:"submenu",item:st.triggeringItem}})})},onEscape:()=>(es.focus(b),Ks.close(C),V.some(!0))}))))},xA=(o,c,m,b,C,x,M)=>{const I=aL(o,m);return KR(o,c,I,m,b,C,M).map(J=>(J.fold(()=>{Ks.isOpen(b)&&Ks.close(b)},re=>{Ks.cloak(b),Ks.open(b,re),x(b)}),b))},lL=(o,c,m,b,C,x,M)=>(Ks.close(b),Bu.pure(b)),YR=(o,c,m,b,C,x)=>{const M=il.getCoupled(m,"sandbox");return(Ks.isOpen(M)?lL:xA)(o,c,m,M,b,C,x)},cL=(o,c,m)=>{const b=sr.getCurrent(c).getOr(c),C=Ji(o.element);m?so(b.element,"min-width",C+"px"):Xr(b.element,C)},uL=(o,c)=>o.getSystem().getByUid(c.uid+"-"+rL()).map(m=>()=>Cn.value(m)).getOrThunk(()=>c.lazySink.fold(()=>()=>Cn.error(new Error("No internal sink is specified, nor could an external sink be found")),m=>()=>m(o))),fL=o=>{Ks.getState(o).each(c=>{Iw.repositionMenus(c)})},XR=(o,c,m)=>{const b=I2(),C=(I,W)=>{const J=aL(o,c);b.link(c.element),o.matchWidth&&cL(J.hotspot,W,o.useMinWidth),o.onOpen(J,I,W),m!==void 0&&m.onOpen!==void 0&&m.onOpen(I,W)},x=(I,W)=>{b.unlink(c.element),m!==void 0&&m.onClose!==void 0&&m.onClose(I,W)},M=uL(c,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:b.id,role:"listbox"}},behaviours:dm.augment(o.sandboxBehaviours,[Jn.config({store:{mode:"memory",initialValue:c}}),Ks.config({onOpen:C,onClose:x,isPartOf:(I,W,J)=>Gp(W,J)||Gp(c,J),getAttachPoint:()=>M().getOrDie()}),sr.config({find:I=>Ks.getState(I).bind(W=>sr.getCurrent(W))}),Cc.config({channels:{...ly({isExtraPart:Je}),...AE({doReposition:fL})}})])}},dL=o=>{const c=il.getCoupled(o,"sandbox");fL(c)},JR=()=>[At("sandboxClasses",[]),dm.field("sandboxBehaviours",[sr,Cc,Ks,Jn])],nZ=X([Qt("dom"),Qt("fetch"),Gs("onOpen"),iu("onExecute"),At("getHotspot",V.some),At("getAnchorOverrides",X({})),yh(),$l("dropdownBehaviours",[Ms,il,Io,es]),Qt("toggleClass"),At("eventOrder",{}),Ar("lazySink"),At("matchWidth",!1),At("useMinWidth",!1),Ar("role")].concat(JR())),oZ=X([Sh({schema:[Bv(),At("fakeFocus",!1)],name:"menu",defaults:o=>({onExecute:o.onExecute})}),iL()]),sZ=(o,c,m,b)=>{const C=re=>ln(o.dom,"attributes").bind(fe=>ln(fe,re)),x=re=>{Ks.getState(re).each(fe=>{Iw.highlightPrimary(fe)})},M=(re,fe,me)=>YR(o,we,re,b,fe,me),I=re=>{M(re,x,od.HighlightMenuAndItem).get(F)},W={expand:re=>{Ms.isOn(re)||M(re,F,od.HighlightNone).get(F)},open:re=>{Ms.isOn(re)||M(re,F,od.HighlightMenuAndItem).get(F)},refetch:re=>il.getExistingCoupled(re,"sandbox").fold(()=>M(re,F,od.HighlightMenuAndItem).map(F),me=>xA(o,we,re,me,b,F,od.HighlightMenuAndItem).map(F)),isOpen:Ms.isOn,close:re=>{Ms.isOn(re)&&M(re,F,od.HighlightMenuAndItem).get(F)},repositionMenus:re=>{Ms.isOn(re)&&dL(re)}},J=(re,fe)=>(lh(re),V.some(!0));return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.dropdownBehaviours,[Ms.config({toggleClass:o.toggleClass,aria:{mode:"expanded"}}),il.config({others:{sandbox:re=>XR(o,re,{onOpen:()=>Ms.on(re),onClose:()=>Ms.off(re)})}}),Io.config({mode:"special",onSpace:J,onEnter:J,onDown:(re,fe)=>{if(wg.isOpen(re)){const me=il.getCoupled(re,"sandbox");x(me)}else wg.open(re);return V.some(!0)},onEscape:(re,fe)=>wg.isOpen(re)?(wg.close(re),V.some(!0)):V.none()}),es.config({})]),events:q3(V.some(I)),eventOrder:{...o.eventOrder,[Ku()]:["disabling","toggling","alloy.base.behaviour"]},apis:W,domModification:{attributes:{"aria-haspopup":"true",...o.role.fold(()=>({}),re=>({role:re})),...o.dom.tag==="button"?{type:C("type").getOr("button")}:{}}}}},wg=fu({name:"Dropdown",configFields:nZ(),partFields:oZ(),factory:sZ,apis:{open:(o,c)=>o.open(c),refetch:(o,c)=>o.refetch(c),expand:(o,c)=>o.expand(c),close:(o,c)=>o.close(c),isOpen:(o,c)=>o.isOpen(c),repositionMenus:(o,c)=>o.repositionMenus(c)}}),rZ=o=>{switch(o.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:o}}},NT=o=>{const c=Jn.getValue(o),m=fT(o).map(YB);wg.refetch(c).get(()=>{const b=il.getCoupled(c,"sandbox");m.each(C=>fT(b).each(x=>FW(x,C)))})},QR=(o,c)=>{e5(o).each(m=>{Tk(o,m.element,c.event.eventType,c.event.interactionEvent)})},e5=o=>Ks.getState(o).bind(Nr.getHighlighted).bind(Nr.getHighlighted),hL=o=>Ju(o.element,hT)?V.some(o.element):ta(o.element,"."+hT),mL=(o,c,m)=>{dT(o).each(b=>{HW(b,m),hL(c).each(x=>{he(x,"id").each(M=>Xn(b.element,"aria-controls",M))})}),Xn(m.element,"aria-selected","true")},iZ=(o,c,m)=>{Xn(m.element,"aria-selected","false")},t5=o=>{dT(o).each(c=>es.focus(c))},n5=o=>il.getExistingCoupled(o,"sandbox").bind(fT).map(YB).map(m=>m.fetchPattern).getOr("");var Gw;(function(o){o[o.ContentFocus=0]="ContentFocus",o[o.UiFocus=1]="UiFocus"})(Gw||(Gw={}));const gL=(o,c,m,b,C)=>{const x=m.shared.providers,M=I=>C?{...I,shortcut:V.none(),icon:I.text.isSome()?V.none():I.icon}:I;switch(o.type){case"menuitem":return h8(o).fold(jb,I=>V.some(jj(M(I),c,x,b)));case"nestedmenuitem":return g8(o).fold(jb,I=>V.some(Zj(M(I),c,x,b,C)));case"togglemenuitem":return p8(o).fold(jb,I=>V.some(qj(M(I),c,x,b)));case"separator":return GW(o).fold(jb,I=>V.some(oL(I)));case"fancymenuitem":return CT(o).fold(jb,I=>Gj(I,m));default:return console.error("Unknown item in general menu",o),V.none()}},aZ=(o,c,m,b,C,x,M)=>{const I=b===1,W=!I||gT(o);return Dt(qe(o,J=>{switch(J.type){case"separator":return YW(J).fold(jb,re=>V.some(oL(re)));case"cardmenuitem":return mR(J).fold(jb,re=>V.some(Kj({...re,onAction:fe=>{re.onAction(fe),m(re.value,re.meta)}},C,x,{itemBehaviours:x8(re.meta,x),cardText:{matchText:c,highlightOn:M}})));case"autocompleteitem":default:return o8(J).fold(jb,re=>V.some(nL(re,c,I,"normal",m,C,x,W)))}}))},pL=(o,c,m,b,C,x)=>{const M=gT(c),I=Dt(qe(c,re=>{const fe=Ce=>C?!ps(Ce,"text"):M,me=Ce=>gL(Ce,m,b,fe(Ce),C);return re.type==="nestedmenuitem"&&re.getSubmenuItems().length<=0?me({...re,enabled:!1}):me(re)})),W=rZ(x);return(C?WW:tR)(o,M,I,1,W)},o5=o=>Iw.singleData(o.value,o),lZ=(o,c,m,b)=>{const C=RT(c,b),x=Fw(b);return{data:o5({...o,movement:C,menuBehaviours:mS.unnamedEvents(c!=="auto"?[]:[yi((M,I)=>{vR(M,4,x.item).each(({numColumns:W,numRows:J})=>{Io.setGridSize(M,J,W)})})])}),menu:{markers:Fw(b),fakeFocus:m===Gw.ContentFocus}}},cZ=(o,c)=>aT(it.fromDom(c.startContainer)).map(m=>{const b=o.createRng();return b.selectNode(m.dom),b}),uZ={register:(o,c)=>{const m=$o(!1),b=$o(!1),C=uc(Pa.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Tn([ks("dismissAutocompleter",[en(Xm(),()=>J())])]),lazySink:c.getSink})),x=()=>Pa.isOpen(C),M=b.get,I=()=>{x()&&Pa.hide(C)},W=()=>Pa.getContent(C).bind(Ne=>eo(Ne.components(),0)),J=()=>o.execCommand("mceAutocompleterClose"),re=Ne=>{const st=Js(Ne,Ht=>V.from(Ht.columns)).getOr(1);return Be(Ne,Ht=>{const dt=Ht.items;return aZ(dt,Ht.matchText,(lt,Zt)=>{const Ot=o.selection.getRng();cZ(o.dom,Ot).each(An=>{const mn={hide:()=>J(),reload:In=>{I(),o.execCommand("mceAutocompleterReload",!1,{fetchOptions:In})}};m.set(!0),Ht.onAction(mn,An,lt,Zt),m.set(!1)})},st,pp.BUBBLE_TO_SANDBOX,c,Ht.highlightOn)})},fe=(Ne,st)=>{SW(it.fromDom(o.getBody())).each(Ht=>{const dt=Js(Ne,lt=>V.from(lt.columns)).getOr(1);Pa.showMenuAt(C,{anchor:{type:"node",root:it.fromDom(o.getBody()),node:V.from(Ht)}},lZ(tR("autocompleter-value",!0,st,dt,{menuType:"normal"}),dt,Gw.ContentFocus,"normal"))}),W().each(Nr.highlightFirst)},me=Ne=>{const st=re(Ne);st.length>0?fe(Ne,st):I()};o.on("AutocompleterStart",({lookupData:Ne})=>{b.set(!0),m.set(!1),me(Ne)}),o.on("AutocompleterUpdate",({lookupData:Ne})=>me(Ne)),o.on("AutocompleterEnd",()=>{I(),b.set(!1),m.set(!1)});const Ce={cancelIfNecessary:J,isMenuOpen:x,isActive:M,isProcessingAction:m.get,getMenu:W};EW.setup(Ce,o)}},fZ=["visible","hidden","clip"],bL=o=>mi(o).length>0&&!ct(fZ,o),vL=o=>{if(gu(o)){const c=qr(o,"overflow-x"),m=qr(o,"overflow-y");return bL(c)||bL(m)}else return!1},dZ=o=>{const c=f0(o,vL),m=c.length===0?Rr(o).map(ys).map(b=>f0(b,vL)).getOr([]):c;return ds(m).map(b=>({element:b,others:m.slice(1)}))},Kw=(o,c)=>y0(o)?dZ(c):V.none(),wS=o=>{const c=[...qe(o.others,li),ce()];return Q(li(o.element),c)},_S=(o,c,m)=>ef(o,c,m).isSome(),yL=(o,c)=>{let m=null;return{cancel:()=>{m!==null&&(clearTimeout(m),m=null)},schedule:(...x)=>{m=setTimeout(()=>{o.apply(null,x),m=null},c)}}},wL=5,S0=400,_L=o=>{const c=o.raw;return c.touches===void 0||c.touches.length!==1?V.none():V.some(c.touches[0])},hZ=(o,c)=>{const m=Math.abs(o.clientX-c.x),b=Math.abs(o.clientY-c.y);return m>wL||b>wL},s5=o=>{const c=ji(),m=$o(!1),b=yL(J=>{o.triggerEvent(H_(),J),m.set(!0)},S0),C=J=>(_L(J).each(re=>{b.cancel();const fe={x:re.clientX,y:re.clientY,target:J.target};b.schedule(J),m.set(!1),c.set(fe)}),V.none()),x=J=>(b.cancel(),_L(J).each(re=>{c.on(fe=>{hZ(re,fe)&&c.clear()})}),V.none()),M=J=>{b.cancel();const re=fe=>kr(fe.target,J.target);return c.get().filter(re).map(fe=>m.get()?(J.prevent(),!1):o.triggerEvent(Z1(),J))},I=jo([{key:eu(),value:C},{key:zp(),value:x},{key:jm(),value:M}]);return{fireIfReady:(J,re)=>ln(I,re).bind(fe=>fe(J))}},tc=o=>o.raw.which===YE[0]&&!ct(["input","textarea"],dl(o.target))&&!_S(o.target,'[contenteditable="true"]'),mZ=(o,c)=>{const m={stopBackspace:!0,...c},b=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],C=s5(m),x=qe(b.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),Ce=>Sc(o,Ce,Ne=>{C.fireIfReady(Ne,Ce).each(Ht=>{Ht&&Ne.kill()}),m.triggerEvent(Ce,Ne)&&Ne.kill()})),M=ji(),I=Sc(o,"paste",Ce=>{C.fireIfReady(Ce,"paste").each(st=>{st&&Ce.kill()}),m.triggerEvent("paste",Ce)&&Ce.kill(),M.set(setTimeout(()=>{m.triggerEvent(Gm(),Ce)},0))}),W=Sc(o,"keydown",Ce=>{m.triggerEvent("keydown",Ce)?Ce.kill():m.stopBackspace&&tc(Ce)&&Ce.prevent()}),J=Sc(o,"focusin",Ce=>{m.triggerEvent("focusin",Ce)&&Ce.kill()}),re=ji(),fe=Sc(o,"focusout",Ce=>{m.triggerEvent("focusout",Ce)&&Ce.kill(),re.set(setTimeout(()=>{m.triggerEvent(qm(),Ce)},0))});return{unbind:()=>{gt(x,Ce=>{Ce.unbind()}),W.unbind(),J.unbind(),fe.unbind(),I.unbind(),M.on(clearTimeout),re.on(clearTimeout)}}},CL=(o,c)=>{const m=ln(o,"target").getOr(c);return $o(m)},gZ=(o,c)=>{const m=$o(!1),b=$o(!1);return{stop:()=>{m.set(!0)},cut:()=>{b.set(!0)},isStopped:m.get,isCut:b.get,event:o,setSource:c.set,getSource:c.get}},pZ=o=>{const c=$o(!1);return{stop:()=>{c.set(!0)},cut:F,isStopped:c.get,isCut:Je,event:o,setSource:ge("Cannot set source of a broadcasted event"),getSource:ge("Cannot get source of a broadcasted event")}},TA=G.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),SL=(o,c,m,b,C,x)=>{const M=o(c,b),I=gZ(m,C);return M.fold(()=>(x.logEventNoHandlers(c,b),TA.complete()),W=>{const J=W.descHandler;return Wp(J)(I),I.isStopped()?(x.logEventStopped(c,W.element,J.purpose),TA.stopped()):I.isCut()?(x.logEventCut(c,W.element,J.purpose),TA.complete()):Ha(W.element).fold(()=>(x.logNoParent(c,W.element,J.purpose),TA.complete()),fe=>(x.logEventResponse(c,W.element,J.purpose),TA.resume(fe)))})},kL=(o,c,m,b,C,x)=>SL(o,c,m,b,C,x).fold(ft,M=>kL(o,c,m,M,C,x),Je),bZ=(o,c,m,b,C)=>{const x=CL(m,b);return SL(o,c,m,b,x,C)},vZ=(o,c,m)=>{const b=pZ(c);return gt(o,C=>{const x=C.descHandler;Wp(x)(b)}),b.isStopped()},yZ=(o,c,m,b)=>EL(o,c,m,m.target,b),EL=(o,c,m,b,C)=>{const x=CL(m,b);return kL(o,c,m,b,x,C)},wZ=(o,c)=>({element:o,descHandler:c}),_Z=(o,c)=>({id:o,descHandler:c}),CZ=()=>{const o={},c=(M,I,W)=>{ar(W,(J,re)=>{const fe=o[re]!==void 0?o[re]:{};fe[I]=U_(J,M),o[re]=fe})},m=(M,I)=>Xg(I).bind(W=>ln(M,W)).map(W=>wZ(I,W));return{registerId:c,unregisterId:M=>{ar(o,(I,W)=>{ps(I,M)&&delete I[M]})},filterByType:M=>ln(o,M).map(I=>na(I,(W,J)=>_Z(J,W))).getOr([]),find:(M,I,W)=>ln(o,I).bind(J=>Qc(W,re=>m(J,re),M))}},SZ=()=>{const o=CZ(),c={},m=J=>{const re=J.element;return Xg(re).getOrThunk(()=>Yu("uid-",J.element))},b=(J,re)=>{const fe=c[re];if(fe===J)x(J);else throw new Error('The tagId "'+re+'" is already used by: '+kl(fe.element)+`
|
|
Cannot use it for: `+kl(J.element)+`
|
|
The conflicting element is`+(qs(fe.element)?" ":" not ")+"already in the DOM")},C=J=>{const re=m(J);Li(c,re)&&b(J,re);const fe=[J];o.registerId(fe,re,J.events),c[re]=J},x=J=>{Xg(J.element).each(re=>{delete c[re],o.unregisterId(re)})};return{find:(J,re,fe)=>o.find(J,re,fe),filter:J=>o.filterByType(J),register:C,unregister:x,getById:J=>ln(c,J)}},f1=Vc({name:"Container",factory:o=>{const{attributes:c,...m}=o.dom;return{uid:o.uid,dom:{tag:"div",attributes:{role:"presentation",...c},...m},components:o.components,behaviours:fm(o.containerBehaviours),events:o.events,domModification:o.domModification,eventOrder:o.eventOrder}},configFields:[At("components",[]),$l("containerBehaviours",[]),At("events",{}),At("domModification",{}),At("eventOrder",{})]}),r5=o=>{const c=dt=>Ha(o.element).fold(ft,lt=>kr(dt,lt)),m=SZ(),b=(dt,lt)=>m.find(c,dt,lt),C=mZ(o.element,{triggerEvent:(dt,lt)=>bb(dt,lt.target,Zt=>yZ(b,dt,lt,Zt))}),x={debugInfo:X("real"),triggerEvent:(dt,lt,Zt)=>{bb(dt,lt,Ot=>EL(b,dt,Zt,lt,Ot))},triggerFocus:(dt,lt)=>{Xg(dt).fold(()=>{of(dt)},Zt=>{bb(Ed(),dt,Ot=>(bZ(b,Ed(),{originator:lt,kill:F,prevent:F,target:dt},dt,Ot),!1))})},triggerEscape:(dt,lt)=>{x.triggerEvent("keydown",dt.element,lt.event)},getByUid:dt=>st(dt),getByDom:dt=>Ht(dt),build:uc,buildOrPatch:ng,addToGui:dt=>{W(dt)},removeFromGui:dt=>{J(dt)},addToWorld:dt=>{M(dt)},removeFromWorld:dt=>{I(dt)},broadcast:dt=>{me(dt)},broadcastOn:(dt,lt)=>{Ce(dt,lt)},broadcastEvent:(dt,lt)=>{Ne(dt,lt)},isConnected:ft},M=dt=>{dt.connect(x),Qa(dt.element)||(m.register(dt),gt(dt.components(),M),x.triggerEvent(Km(),dt.element,{target:dt.element}))},I=dt=>{Qa(dt.element)||(gt(dt.components(),I),m.unregister(dt)),dt.disconnect()},W=dt=>{rl(o,dt)},J=dt=>{$c(dt)},re=()=>{C.unbind(),_u(o.element)},fe=dt=>{const lt=m.filter(Jh());gt(lt,Zt=>{const Ot=Zt.descHandler;Wp(Ot)(dt)})},me=dt=>{fe({universal:!0,data:dt})},Ce=(dt,lt)=>{fe({universal:!1,channels:dt,data:lt})},Ne=(dt,lt)=>{const Zt=m.filter(dt);return vZ(Zt,lt)},st=dt=>m.getById(dt).fold(()=>Cn.error(new Error('Could not find component with uid: "'+dt+'" in system.')),Cn.value),Ht=dt=>{const lt=Xg(dt).getOr("not found");return st(lt)};return M(o),{root:o,element:o.element,destroy:re,add:W,remove:J,getByUid:st,getByDom:Ht,addToWorld:M,removeFromWorld:I,broadcast:me,broadcastOn:Ce,broadcastEvent:Ne}},kZ=(o,c)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:qe(o.items,c.interpreter)}),EZ=X([At("prefix","form-field"),$l("fieldBehaviours",[sr,Jn])]),AZ=X([Fd({schema:[Qt("dom")],name:"label"}),Fd({factory:{sketch:o=>({uid:o.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:o.text}})},schema:[Qt("text")],name:"aria-descriptor"}),zc({factory:{sketch:o=>{const c=kn(o,["factory"]);return o.factory.sketch(c)}},schema:[Qt("factory")],name:"field"})]),xZ=(o,c,m,b)=>{const C=Ql(o.fieldBehaviours,[sr.config({find:I=>Ti(I,o,"field")}),Jn.config({store:{mode:"manual",getValue:I=>sr.getCurrent(I).bind(Jn.getValue),setValue:(I,W)=>{sr.getCurrent(I).each(J=>{Jn.setValue(J,W)})}}})]),x=ri([yi((I,W)=>{const J=fy(I,o,["label","field","aria-descriptor"]);J.field().each(re=>{const fe=ro(o.prefix);J.label().each(me=>{Xn(me.element,"for",fe),Xn(re.element,"id",fe)}),J["aria-descriptor"]().each(me=>{const Ce=ro(o.prefix);Xn(me.element,"id",Ce),Xn(re.element,"aria-describedby",Ce)})})})]),M={getField:I=>Ti(I,o,"field"),getLabel:I=>Ti(I,o,"label")};return{uid:o.uid,dom:o.dom,components:c,behaviours:C,events:x,apis:M}},ei=fu({name:"FormField",configFields:EZ(),partFields:AZ(),factory:xZ,apis:{getField:(o,c)=>o.getField(c),getLabel:(o,c)=>o.getLabel(c)}});var TZ=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({attributes:jo([{key:c.tabAttr,value:"true"}])})}),AL=[At("tabAttr","data-alloy-tabstop")];const Ka=Xl({fields:AL,name:"tabstopping",active:TZ});var DZ=tinymce.util.Tools.resolve("tinymce.html.Entities");const DA=(o,c,m,b)=>{const C=OZ(o,c,m,b);return ei.sketch(C)},xL=(o,c)=>DA(o,c,[],[]),OZ=(o,c,m,b)=>({dom:TL(m),components:o.toArray().concat([c]),fieldBehaviours:Tn(b)}),MZ=()=>TL([]),TL=o=>({tag:"div",classes:["tox-form__group"].concat(o)}),Xb=(o,c)=>ei.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Ni(c.translate(o))]}),xh=ro("form-component-change"),OA=ro("form-close"),Ay=ro("form-cancel"),k0=ro("form-action"),CS=ro("form-submit"),i5=ro("form-block"),PT=ro("form-unblock"),DL=ro("form-tabchange"),a5=ro("form-resize"),RZ=(o,c,m)=>{const b=o.label.map(fe=>Xb(fe,c)),C=fe=>(me,Ce)=>{ef(Ce.event.target,"[data-collection-item-value]").each(Ne=>{fe(me,Ce,Ne,$i(Ne,"data-collection-item-value"))})},x=(fe,me)=>{const Ce=qe(me,Ht=>{const dt=pm.translate(Ht.text),lt=o.columns===1?`<div class="tox-collection__item-label">${dt}</div>`:"",Zt=`<div class="tox-collection__item-icon">${Ht.icon}</div>`,Ot={_:" "," - ":" ","-":" "},An=dt.replace(/\_| \- |\-/g,In=>Ot[In]);return`<div class="tox-collection__item${c.isDisabled()?" tox-collection__item--state-disabled":""}" tabindex="-1" data-collection-item-value="${DZ.encodeAllRaw(Ht.value)}" title="${An}" aria-label="${An}">${Zt}${lt}</div>`}),Ne=o.columns!=="auto"&&o.columns>1?bn(Ce,o.columns):[Ce],st=qe(Ne,Ht=>`<div class="tox-collection__group">${Ht.join("")}</div>`);ch(fe.element,st.join(""))},M=C((fe,me,Ce,Ne)=>{me.stop(),c.isDisabled()||Do(fe,k0,{name:o.name,value:Ne})}),I=[en(Sl(),C((fe,me,Ce)=>{of(Ce)})),en(Yh(),M),en(Z1(),M),en(Gi(),C((fe,me,Ce)=>{ta(fe.element,"."+pA).each(Ne=>{ma(Ne,pA)}),Ra(Ce,pA)})),en(tu(),C(fe=>{ta(fe.element,"."+pA).each(me=>{ma(me,pA)})})),ou(C((fe,me,Ce,Ne)=>{Do(fe,k0,{name:o.name,value:Ne})}))],W=(fe,me)=>qe(lu(fe.element,".tox-collection__item"),me),J=ei.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(o.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:we},behaviours:Tn([Xo.config({disabled:c.isDisabled,onDisabled:fe=>{W(fe,me=>{Ra(me,"tox-collection__item--state-disabled"),Xn(me,"aria-disabled",!0)})},onEnabled:fe=>{W(fe,me=>{ma(me,"tox-collection__item--state-disabled"),We(me,"aria-disabled")})}}),ec(),ms.config({}),Jn.config({store:{mode:"memory",initialValue:m.getOr([])},onSetValue:(fe,me)=>{x(fe,me),o.columns==="auto"&&vR(fe,5,"tox-collection__item").each(({numRows:Ce,numColumns:Ne})=>{Io.setGridSize(fe,Ce,Ne)}),nr(fe,a5)}}),Ka.config({}),Io.config($j(o.columns,"normal")),ks("collection-events",I)]),eventOrder:{[Ku()]:["disabling","alloy.base.behaviour","collection-events"]}});return DA(b,J,["tox-form__group--collection"],[])},NZ=["input","textarea"],OL=o=>{const c=dl(o);return ct(NZ,c)},ML=(o,c)=>{const m=c.getRoot(o).getOr(o.element);ma(m,c.invalidClass),c.notify.each(b=>{OL(o.element)&&Xn(o.element,"aria-invalid",!1),b.getContainer(o).each(C=>{ch(C,b.validHtml)}),b.onValid(o)})},RL=(o,c,m,b)=>{const C=c.getRoot(o).getOr(o.element);Ra(C,c.invalidClass),c.notify.each(x=>{OL(o.element)&&Xn(o.element,"aria-invalid",!0),x.getContainer(o).each(M=>{ch(M,b)}),x.onInvalid(o,b)})},NL=(o,c,m)=>c.validator.fold(()=>Bu.pure(Cn.value(!0)),b=>b.validate(o)),l5=(o,c,m)=>(c.notify.each(b=>{b.onValidate(o)}),NL(o,c).map(b=>o.getSystem().isConnected()?b.fold(C=>(RL(o,c,m,C),Cn.error(C)),C=>(ML(o,c),Cn.value(C))):Cn.error("No longer in system")));var PZ=Object.freeze({__proto__:null,markValid:ML,markInvalid:RL,query:NL,run:l5,isInvalid:(o,c)=>{const m=c.getRoot(o).getOr(o.element);return Ju(m,c.invalidClass)}}),IZ=Object.freeze({__proto__:null,events:(o,c)=>o.validator.map(m=>ri([en(m.onEvent,b=>{l5(b,o,c).get(we)})].concat(m.validateOnLoad?[yi(b=>{l5(b,o,c).get(F)})]:[]))).getOr({})}),BZ=[Qt("invalidClass"),At("getRoot",V.none),ja("notify",[At("aria","alert"),At("getContainer",V.none),At("validHtml",""),Gs("onValid"),Gs("onInvalid"),Gs("onValidate")]),ja("validator",[Qt("validate"),At("onEvent","input"),At("validateOnLoad",!0)])];const d1=Xl({fields:BZ,name:"invalidating",active:IZ,apis:PZ,extra:{validation:o=>c=>{const m=Jn.getValue(c);return Bu.pure(o(m))}}});var LZ=Object.freeze({__proto__:null,events:()=>ri([xv(Xh(),ft)]),exhibit:()=>Lc({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})});const MA=Xl({fields:[],name:"unselecting",active:LZ}),FZ=(o,c)=>wg.sketch({dom:o.dom,components:o.components,toggleClass:"mce-active",dropdownBehaviours:Tn([vg.button(c.providers.isDisabled),ec(),MA.config({}),Ka.config({})]),layouts:o.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:c.getSink,fetch:m=>Bu.nu(b=>o.fetch(b)).map(b=>V.from(o5(Jr(MT(ro("menu-value"),b,C=>{o.onItemAction(m,C)},o.columns,o.presets,pp.CLOSE_ON_EXECUTE,Je,c.providers),{movement:RT(o.columns,o.presets)})))),parts:{menu:fS(!1,1,o.presets)}}),IT=ro("color-input-change"),PL=ro("color-swatch-change"),IL=ro("color-picker-cancel"),HZ=(o,c,m,b)=>{const C=ei.parts.field({factory:Hw,inputClasses:["tox-textfield"],data:b,onSetValue:J=>d1.run(J).get(F),inputBehaviours:Tn([Xo.config({disabled:c.providers.isDisabled}),ec(),Ka.config({}),d1.config({invalidClass:"tox-textbox-field-invalid",getRoot:J=>bc(J.element),notify:{onValid:J=>{const re=Jn.getValue(J);Do(J,IT,{color:re})}},validator:{validateOnLoad:!1,validate:J=>{const re=Jn.getValue(J);if(re.length===0)return Bu.pure(Cn.value(!0));{const fe=it.fromTag("span");so(fe,"background-color",re);const me=Xi(fe,"background-color").fold(()=>Cn.error("blah"),Ce=>Cn.value(re));return Bu.pure(me)}}}})]),selectOnFocus:!1}),x=o.label.map(J=>Xb(J,c.providers)),M=(J,re)=>{Do(J,PL,{value:re})},I=(J,re)=>{W.getOpt(J).each(fe=>{re==="custom"?m.colorPicker(me=>{me.fold(()=>nr(fe,IL),Ce=>{M(fe,Ce),RR(o.storageKey,Ce)})},"#ffffff"):re==="remove"?M(fe,""):M(fe,re)})},W=Qr(FZ({dom:{tag:"span",attributes:{"aria-label":c.providers.translate("Color swatch")}},layouts:{onRtl:()=>[Kl,gl,Hl],onLtr:()=>[gl,Kl,Hl]},components:[],fetch:VR(m.getColors(o.storageKey),o.storageKey,m.hasCustomColors()),columns:m.getColorCols(o.storageKey),presets:"color",onItemAction:I},c));return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:x.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[C,W.asSpec()]}]),fieldBehaviours:Tn([ks("form-field-events",[en(IT,(J,re)=>{W.getOpt(J).each(fe=>{so(fe.element,"background-color",re.event.color)}),Do(J,xh,{name:o.name})}),en(PL,(J,re)=>{ei.getField(J).each(fe=>{Jn.setValue(fe,re.event.value),sr.getCurrent(J).each(es.focus)})}),en(IL,(J,re)=>{ei.getField(J).each(fe=>{sr.getCurrent(J).each(es.focus)})})])])})},BL=Fd({schema:[Qt("dom")],name:"label"}),Jb=o=>Fd({name:""+o+"-edge",overrides:c=>c.model.manager.edgeActions[o].fold(()=>({}),b=>({events:ri([xd(eu(),(C,x,M)=>b(C,M),[c]),xd(Br(),(C,x,M)=>b(C,M),[c]),xd(Da(),(C,x,M)=>{M.mouseIsDown.get()&&b(C,M)},[c])])}))}),$Z=Jb("top-left"),zZ=Jb("top"),LL=Jb("top-right"),VZ=Jb("right"),UZ=Jb("bottom-right"),WZ=Jb("bottom"),jZ=Jb("bottom-left"),ZZ=Jb("left"),qZ=zc({name:"thumb",defaults:X({dom:{styles:{position:"absolute"}}}),overrides:o=>({events:ri([Qm(eu(),o,"spectrum"),Qm(zp(),o,"spectrum"),Qm(jm(),o,"spectrum"),Qm(Br(),o,"spectrum"),Qm(Da(),o,"spectrum"),Qm(j1(),o,"spectrum")])})}),BT=zc({schema:[_a("mouseIsDown",()=>$o(!1))],name:"spectrum",overrides:o=>{const m=o.model.manager,b=(C,x)=>m.getValueFromEvent(x).map(M=>m.setValueFrom(C,o,M));return{behaviours:Tn([Io.config({mode:"special",onLeft:C=>m.onLeft(C,o),onRight:C=>m.onRight(C,o),onUp:C=>m.onUp(C,o),onDown:C=>m.onDown(C,o)}),es.config({})]),events:ri([en(eu(),b),en(zp(),b),en(Br(),b),en(Da(),(C,x)=>{o.mouseIsDown.get()&&b(C,x)})])}}});var GZ=[BL,ZZ,VZ,zZ,WZ,$Z,LL,jZ,UZ,qZ,BT];const RA=X("slider.change.value"),KZ=o=>o.type.indexOf("touch")!==-1,u5=o=>{const c=o.event.raw;if(KZ(c)){const m=c;return m.touches!==void 0&&m.touches.length===1?V.some(m.touches[0]).map(b=>fr(b.clientX,b.clientY)):V.none()}else{const m=c;return m.clientX!==void 0?V.some(m).map(b=>fr(b.clientX,b.clientY)):V.none()}},YZ="top",Kse="right",LT="bottom",SS="left",xy=o=>o.model.minX,Ty=o=>o.model.minY,FT=o=>o.model.minX-1,HT=o=>o.model.minY-1,Yw=o=>o.model.maxX,Xw=o=>o.model.maxY,$T=o=>o.model.maxX+1,zT=o=>o.model.maxY+1,FL=(o,c,m)=>c(o)-m(o),f5=o=>FL(o,Yw,xy),d5=o=>FL(o,Xw,Ty),HL=o=>f5(o)/2,$L=o=>d5(o)/2,Jw=o=>o.stepSize,Qw=o=>o.snapToGrid,Dy=o=>o.snapStart,zL=o=>o.rounded,NA=(o,c)=>o[c+"-edge"]!==void 0,h5=o=>NA(o,SS),PA=o=>NA(o,Kse),VL=o=>NA(o,YZ),kS=o=>NA(o,LT),_g=o=>o.model.value.get(),Oy=(o,c)=>({x:o,y:c}),vp=(o,c)=>{Do(o,RA(),{value:c})},XZ=(o,c)=>{vp(o,Oy(FT(c),HT(c)))},JZ=(o,c)=>{vp(o,HT(c))},QZ=(o,c)=>{vp(o,Oy(HL(c),HT(c)))},eq=(o,c)=>{vp(o,Oy($T(c),HT(c)))},VT=(o,c)=>{vp(o,$T(c))},tq=(o,c)=>{vp(o,Oy($T(c),$L(c)))},nq=(o,c)=>{vp(o,Oy($T(c),zT(c)))},oq=(o,c)=>{vp(o,zT(c))},UL=(o,c)=>{vp(o,Oy(HL(c),zT(c)))},sq=(o,c)=>{vp(o,Oy(FT(c),zT(c)))},rq=(o,c)=>{vp(o,FT(c))},iq=(o,c)=>{vp(o,Oy(FT(c),$L(c)))},UT=(o,c,m,b)=>o<c?o:o>m?m:o===c?c-1:Math.max(c,o-b),m5=(o,c,m,b)=>o>m?o:o<c?c:o===m?m+1:Math.min(m,o+b),WL=(o,c,m)=>Math.max(c,Math.min(m,o)),aq=(o,c,m,b,C)=>C.fold(()=>{const x=o-c,M=Math.round(x/b)*b;return WL(c+M,c-1,m+1)},x=>{const M=(o-x)%b,I=Math.round(M/b),W=Math.floor((o-x)/b),J=Math.floor((m-x)/b),re=Math.min(J,W+I),fe=x+re*b;return Math.max(x,fe)}),lq=(o,c,m)=>Math.min(m,Math.max(o,c))-c,jL=o=>{const{min:c,max:m,range:b,value:C,step:x,snap:M,snapStart:I,rounded:W,hasMinEdge:J,hasMaxEdge:re,minBound:fe,maxBound:me,screenRange:Ce}=o,Ne=J?c-1:c,st=re?m+1:m;if(C<fe)return Ne;if(C>me)return st;{const Ht=lq(C,fe,me),dt=WL(Ht/Ce*b+c,Ne,st);return M&&dt>=c&&dt<=m?aq(dt,c,m,x,I):W?Math.round(dt):dt}},g5=o=>{const{min:c,max:m,range:b,value:C,hasMinEdge:x,hasMaxEdge:M,maxBound:I,maxOffset:W,centerMinEdge:J,centerMaxEdge:re}=o;return C<c?x?0:J:C>m?M?I:re:(C-c)/b*W},WT="top",ZL="right",qL="bottom",p5="left",cq="width",uq="height",h1=o=>o.element.dom.getBoundingClientRect(),id=(o,c)=>o[c],jT=o=>{const c=h1(o);return id(c,p5)},GL=o=>{const c=h1(o);return id(c,ZL)},ZT=o=>{const c=h1(o);return id(c,WT)},IA=o=>{const c=h1(o);return id(c,qL)},bm=o=>{const c=h1(o);return id(c,cq)},qT=o=>{const c=h1(o);return id(c,uq)},b5=(o,c,m)=>(o+c)/2-m,KL=(o,c)=>{const m=h1(o),b=h1(c),C=id(m,p5),x=id(m,ZL),M=id(b,p5);return b5(C,x,M)},YL=(o,c)=>{const m=h1(o),b=h1(c),C=id(m,WT),x=id(m,qL),M=id(b,WT);return b5(C,x,M)},GT=(o,c)=>{Do(o,RA(),{value:c})},v5=(o,c,m)=>{const b={min:xy(c),max:Yw(c),range:f5(c),value:m,step:Jw(c),snap:Qw(c),snapStart:Dy(c),rounded:zL(c),hasMinEdge:h5(c),hasMaxEdge:PA(c),minBound:jT(o),maxBound:GL(o),screenRange:bm(o)};return jL(b)},XL=(o,c,m)=>{const b=v5(o,c,m);return GT(o,b),b},JL=(o,c)=>{const m=xy(c);GT(o,m)},fq=(o,c)=>{const m=Yw(c);GT(o,m)},dq=(o,c,m)=>{const C=(o>0?m5:UT)(_g(m),xy(m),Yw(m),Jw(m));return GT(c,C),V.some(C)},y5=o=>(c,m)=>dq(o,c,m).map(ft),hq=o=>u5(o).map(m=>m.left),QL=(o,c,m,b,C)=>{const M=bm(o),I=b.bind(re=>V.some(KL(re,o))).getOr(0),W=C.bind(re=>V.some(KL(re,o))).getOr(M),J={min:xy(c),max:Yw(c),range:f5(c),value:m,hasMinEdge:h5(c),hasMaxEdge:PA(c),minBound:jT(o),minOffset:0,maxBound:GL(o),maxOffset:M,centerMinEdge:I,centerMaxEdge:W};return g5(J)},KT=(o,c,m,b,C,x)=>{const M=QL(c,x,m,b,C);return jT(c)-jT(o)+M},eF=(o,c,m,b)=>{const C=_g(m),x=KT(o,b.getSpectrum(o),C,b.getLeftEdge(o),b.getRightEdge(o),m),M=Ji(c.element)/2;so(c.element,"left",x-M+"px")},mq=y5(-1),gq=y5(1),pq=V.none,bq=V.none,vq={"top-left":V.none(),top:V.none(),"top-right":V.none(),right:V.some(VT),"bottom-right":V.none(),bottom:V.none(),"bottom-left":V.none(),left:V.some(rq)};var yq=Object.freeze({__proto__:null,setValueFrom:XL,setToMin:JL,setToMax:fq,findValueOfOffset:v5,getValueFromEvent:hq,findPositionOfValue:KT,setPositionFromValue:eF,onLeft:mq,onRight:gq,onUp:pq,onDown:bq,edgeActions:vq});const ES=(o,c)=>{Do(o,RA(),{value:c})},w5=(o,c,m)=>{const b={min:Ty(c),max:Xw(c),range:d5(c),value:m,step:Jw(c),snap:Qw(c),snapStart:Dy(c),rounded:zL(c),hasMinEdge:VL(c),hasMaxEdge:kS(c),minBound:ZT(o),maxBound:IA(o),screenRange:qT(o)};return jL(b)},tF=(o,c,m)=>{const b=w5(o,c,m);return ES(o,b),b},wq=(o,c)=>{const m=Ty(c);ES(o,m)},_q=(o,c)=>{const m=Xw(c);ES(o,m)},Cq=(o,c,m)=>{const C=(o>0?m5:UT)(_g(m),Ty(m),Xw(m),Jw(m));return ES(c,C),V.some(C)},nF=o=>(c,m)=>Cq(o,c,m).map(ft),Sq=o=>u5(o).map(m=>m.top),kq=(o,c,m,b,C)=>{const M=qT(o),I=b.bind(re=>V.some(YL(re,o))).getOr(0),W=C.bind(re=>V.some(YL(re,o))).getOr(M),J={min:Ty(c),max:Xw(c),range:d5(c),value:m,hasMinEdge:VL(c),hasMaxEdge:kS(c),minBound:ZT(o),minOffset:0,maxBound:IA(o),maxOffset:M,centerMinEdge:I,centerMaxEdge:W};return g5(J)},_5=(o,c,m,b,C,x)=>{const M=kq(c,x,m,b,C);return ZT(c)-ZT(o)+M},oF=(o,c,m,b)=>{const C=_g(m),x=_5(o,b.getSpectrum(o),C,b.getTopEdge(o),b.getBottomEdge(o),m),M=Mi(c.element)/2;so(c.element,"top",x-M+"px")},sF=V.none,Eq=V.none,Aq=nF(-1),xq=nF(1),Tq={"top-left":V.none(),top:V.some(JZ),"top-right":V.none(),right:V.none(),"bottom-right":V.none(),bottom:V.some(oq),"bottom-left":V.none(),left:V.none()};var Dq=Object.freeze({__proto__:null,setValueFrom:tF,setToMin:wq,setToMax:_q,findValueOfOffset:w5,getValueFromEvent:Sq,findPositionOfValue:_5,setPositionFromValue:oF,onLeft:sF,onRight:Eq,onUp:Aq,onDown:xq,edgeActions:Tq});const BA=(o,c)=>{Do(o,RA(),{value:c})},LA=(o,c)=>({x:o,y:c}),rF=(o,c,m)=>{const b=v5(o,c,m.left),C=w5(o,c,m.top),x=LA(b,C);return BA(o,x),x},C5=(o,c,m,b)=>{const C=o>0?m5:UT,x=c?_g(b).x:C(_g(b).x,xy(b),Yw(b),Jw(b)),M=c?C(_g(b).y,Ty(b),Xw(b),Jw(b)):_g(b).y;return BA(m,LA(x,M)),V.some(x)},YT=(o,c)=>(m,b)=>C5(o,c,m,b).map(ft),iF=(o,c)=>{const m=xy(c),b=Ty(c);BA(o,LA(m,b))},Oq=(o,c)=>{const m=Yw(c),b=Xw(c);BA(o,LA(m,b))},Mq=o=>u5(o),Rq=(o,c,m,b)=>{const C=_g(m),x=KT(o,b.getSpectrum(o),C.x,b.getLeftEdge(o),b.getRightEdge(o),m),M=_5(o,b.getSpectrum(o),C.y,b.getTopEdge(o),b.getBottomEdge(o),m),I=Ji(c.element)/2,W=Mi(c.element)/2;so(c.element,"left",x-I+"px"),so(c.element,"top",M-W+"px")},Nq=YT(-1,!1),S5=YT(1,!1),Qb=YT(-1,!0),Pq=YT(1,!0),FA={"top-left":V.some(XZ),top:V.some(QZ),"top-right":V.some(eq),right:V.some(tq),"bottom-right":V.some(nq),bottom:V.some(UL),"bottom-left":V.some(sq),left:V.some(iq)};var Iq=Object.freeze({__proto__:null,setValueFrom:rF,setToMin:iF,setToMax:Oq,getValueFromEvent:Mq,setPositionFromValue:Rq,onLeft:Nq,onRight:S5,onUp:Qb,onDown:Pq,edgeActions:FA});const k5=[At("stepSize",1),At("onChange",F),At("onChoose",F),At("onInit",F),At("onDragStart",F),At("onDragEnd",F),At("snapToGrid",!1),At("rounded",!0),Ar("snapStart"),Gr("model",Cl("mode",{x:[At("minX",0),At("maxX",100),_a("value",o=>$o(o.mode.minX)),Qt("getInitialValue"),Wi("manager",yq)],y:[At("minY",0),At("maxY",100),_a("value",o=>$o(o.mode.minY)),Qt("getInitialValue"),Wi("manager",Dq)],xy:[At("minX",0),At("maxX",100),At("minY",0),At("maxY",100),_a("value",o=>$o({x:o.mode.minX,y:o.mode.minY})),Qt("getInitialValue"),Wi("manager",Iq)]})),$l("sliderBehaviours",[Io,Jn]),_a("mouseIsDown",()=>$o(!1))],yp=fu({name:"Slider",configFields:k5,partFields:GZ,factory:(o,c,m,b)=>{const C=Ot=>o1(Ot,o,"thumb"),x=Ot=>o1(Ot,o,"spectrum"),M=Ot=>Ti(Ot,o,"left-edge"),I=Ot=>Ti(Ot,o,"right-edge"),W=Ot=>Ti(Ot,o,"top-edge"),J=Ot=>Ti(Ot,o,"bottom-edge"),re=o.model,fe=re.manager,me=(Ot,An)=>{fe.setPositionFromValue(Ot,An,o,{getLeftEdge:M,getRightEdge:I,getTopEdge:W,getBottomEdge:J,getSpectrum:x})},Ce=(Ot,An)=>{re.value.set(An);const mn=C(Ot);me(Ot,mn)},Ne=(Ot,An)=>{Ce(Ot,An);const mn=C(Ot);return o.onChange(Ot,mn,An),V.some(!0)},st=Ot=>{fe.setToMin(Ot,o)},Ht=Ot=>{fe.setToMax(Ot,o)},dt=Ot=>{const An=()=>{Ti(Ot,o,"thumb").each(In=>{const Kn=re.value.get();o.onChoose(Ot,In,Kn)})},mn=o.mouseIsDown.get();o.mouseIsDown.set(!1),mn&&An()},lt=(Ot,An)=>{An.stop(),o.mouseIsDown.set(!0),o.onDragStart(Ot,C(Ot))},Zt=(Ot,An)=>{An.stop(),o.onDragEnd(Ot,C(Ot)),dt(Ot)};return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.sliderBehaviours,[Io.config({mode:"special",focusIn:Ot=>Ti(Ot,o,"spectrum").map(Io.focusIn).map(ft)}),Jn.config({store:{mode:"manual",getValue:Ot=>re.value.get(),setValue:Ce}}),Cc.config({channels:{[EE()]:{onReceive:dt}}})]),events:ri([en(RA(),(Ot,An)=>{Ne(Ot,An.event.value)}),yi((Ot,An)=>{const mn=re.getInitialValue();re.value.set(mn);const In=C(Ot);me(Ot,In);const Kn=x(Ot);o.onInit(Ot,In,Kn,re.value.get())}),en(eu(),lt),en(jm(),Zt),en(Br(),lt),en(j1(),Zt)]),apis:{resetToMin:st,resetToMax:Ht,setValue:Ce,refresh:me},domModification:{styles:{position:"relative"}}}},apis:{setValue:(o,c,m)=>{o.setValue(c,m)},resetToMin:(o,c)=>{o.resetToMin(c)},resetToMax:(o,c)=>{o.resetToMax(c)},refresh:(o,c)=>{o.refresh(c)}}}),E5=ro("rgb-hex-update"),A5=ro("slider-update"),aF=ro("palette-update"),x5=(o,c)=>{const m=yp.parts.spectrum({dom:{tag:"div",classes:[c("hue-slider-spectrum")],attributes:{role:"presentation"}}}),b=yp.parts.thumb({dom:{tag:"div",classes:[c("hue-slider-thumb")],attributes:{role:"presentation"}}});return yp.sketch({dom:{tag:"div",classes:[c("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:X(0)},components:[m,b],sliderBehaviours:Tn([es.config({})]),onChange:(C,x,M)=>{Do(C,A5,{value:M})}})},XT="form",T5=[$l("formBehaviours",[Jn])],lF=o=>"<alloy.field."+o+">",vm=o=>{const c=(()=>{const x=[];return{field:(I,W)=>(x.push(I),_3(XT,lF(I),W)),record:X(x)}})(),m=o(c),b=c.record(),C=qe(b,x=>zc({name:x,pname:lF(x)}));return UE(XT,T5,C,Lq,m)},Bq=(o,c)=>o.fold(()=>Cn.error(c),Cn.value),Lq=(o,c)=>({uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.formBehaviours,[Jn.config({store:{mode:"manual",getValue:m=>{const b=zE(m,o);return Ns(b,(C,x)=>C().bind(M=>{const I=sr.getCurrent(M);return Bq(I,new Error(`Cannot find a current component to extract the value from for form part '${x}': `+kl(M.element)))}).map(Jn.getValue))},setValue:(m,b)=>{ar(b,(C,x)=>{Ti(m,o,x).each(M=>{sr.getCurrent(M).each(I=>{Jn.setValue(I,C)})})})}}})]),apis:{getField:(m,b)=>Ti(m,o,b).bind(sr.getCurrent)}}),e_={getField:Qg((o,c,m)=>o.getField(c,m)),sketch:vm},D5=ro("valid-input"),cF=ro("invalid-input"),uF=ro("validating-input"),O5="colorcustom.rgb.",Fq=(o,c,m,b)=>{const C=(me,Ce)=>d1.config({invalidClass:c("invalid"),notify:{onValidate:Ne=>{Do(Ne,uF,{type:me})},onValid:Ne=>{Do(Ne,D5,{type:me,value:Jn.getValue(Ne)})},onInvalid:Ne=>{Do(Ne,cF,{type:me,value:Jn.getValue(Ne)})}},validator:{validate:Ne=>{const st=Jn.getValue(Ne),Ht=Ce(st)?Cn.value(!0):Cn.error(o("aria.input.invalid"));return Bu.pure(Ht)},validateOnLoad:!1}}),x=(me,Ce,Ne,st,Ht)=>{const dt=o(O5+"range"),lt=ei.parts.label({dom:{tag:"label",attributes:{"aria-label":st}},components:[Ni(Ne)]}),Zt=ei.parts.field({data:Ht,factory:Hw,inputAttributes:{type:"text",...Ce==="hex"?{"aria-live":"polite"}:{}},inputClasses:[c("textfield")],inputBehaviours:Tn([C(Ce,me),Ka.config({})]),onSetValue:In=>{d1.isInvalid(In)&&d1.run(In).get(F)}}),Ot=[lt,Zt],An=Ce!=="hex"?[ei.parts["aria-descriptor"]({text:dt})]:[],mn=Ot.concat(An);return{dom:{tag:"div",attributes:{role:"presentation"}},components:mn}},M=(me,Ce)=>{const Ne=Zw(Ce);return e_.getField(me,"hex").each(st=>{es.isFocused(st)||Jn.setValue(me,{hex:Ne.value})}),Ne},I=(me,Ce)=>{const Ne=Ce.red,st=Ce.green,Ht=Ce.blue;Jn.setValue(me,{red:Ne,green:st,blue:Ht})},W=Qr({dom:{tag:"div",classes:[c("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),J=(me,Ce)=>{W.getOpt(me).each(Ne=>{so(Ne.element,"background-color","#"+Ce.value)})};return Vc({factory:()=>{const me={red:$o(V.some(255)),green:$o(V.some(255)),blue:$o(V.some(255)),hex:$o(V.some("ffffff"))},Ce=(fs,hr)=>{const Ho=EA(hr);I(fs,Ho),dt(Ho)},Ne=fs=>me[fs].get(),st=(fs,hr)=>{me[fs].set(hr)},Ht=()=>Ne("red").bind(fs=>Ne("green").bind(hr=>Ne("blue").map(Ho=>ky(fs,hr,Ho,1)))),dt=fs=>{const hr=fs.red,Ho=fs.green,ir=fs.blue;st("red",V.some(hr)),st("green",V.some(Ho)),st("blue",V.some(ir))},lt=(fs,hr)=>{const Ho=hr.event;Ho.type!=="hex"?st(Ho.type,V.none()):b(fs)},Zt=(fs,hr)=>{m(fs);const Ho=R8(hr);st("hex",V.some(Ho.value));const ir=EA(Ho);I(fs,ir),dt(ir),Do(fs,E5,{hex:Ho}),J(fs,Ho)},Ot=(fs,hr,Ho)=>{const ir=parseInt(Ho,10);st(hr,V.some(ir)),Ht().each(Hn=>{const bo=M(fs,Hn);Do(fs,E5,{hex:bo}),J(fs,bo)})},An=fs=>fs.type==="hex",mn=(fs,hr)=>{const Ho=hr.event;An(Ho)?Zt(fs,Ho.value):Ot(fs,Ho.type,Ho.value)},In=fs=>({label:o(O5+fs+".label"),description:o(O5+fs+".description")}),Kn=In("red"),js=In("green"),wo=In("blue"),_s=In("hex");return Jr(e_.sketch(fs=>({dom:{tag:"form",classes:[c("rgb-form")],attributes:{"aria-label":o("aria.color.picker")}},components:[fs.field("red",ei.sketch(x(sd,"red",Kn.label,Kn.description,255))),fs.field("green",ei.sketch(x(sd,"green",js.label,js.description,255))),fs.field("blue",ei.sketch(x(sd,"blue",wo.label,wo.description,255))),fs.field("hex",ei.sketch(x(N8,"hex",_s.label,_s.description,"ffffff"))),W.asSpec()],formBehaviours:Tn([d1.config({invalidClass:c("form-invalid")}),ks("rgb-form-events",[en(D5,mn),en(cF,lt),en(uF,lt)])])})),{apis:{updateHex:(fs,hr)=>{Jn.setValue(fs,{hex:hr.value}),Ce(fs,hr),J(fs,hr)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(me,Ce,Ne)=>{me.updateHex(Ce,Ne)}},extraApis:{}})},Hq=(o,c)=>{const m=yp.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[c("sv-palette-spectrum")]}}),b=yp.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[c("sv-palette-thumb")],innerHtml:`<div class=${c("sv-palette-inner-thumb")} role="presentation"></div>`}}),C=(J,re)=>{const{width:fe,height:me}=J,Ce=J.getContext("2d");if(Ce===null)return;Ce.fillStyle=re,Ce.fillRect(0,0,fe,me);const Ne=Ce.createLinearGradient(0,0,fe,0);Ne.addColorStop(0,"rgba(255,255,255,1)"),Ne.addColorStop(1,"rgba(255,255,255,0)"),Ce.fillStyle=Ne,Ce.fillRect(0,0,fe,me);const st=Ce.createLinearGradient(0,0,0,me);st.addColorStop(0,"rgba(0,0,0,0)"),st.addColorStop(1,"rgba(0,0,0,1)"),Ce.fillStyle=st,Ce.fillRect(0,0,fe,me)},x=(J,re)=>{const fe=J.components()[0].element.dom,me=qw(re,100,100),Ce=c1(me);C(fe,kT(Ce))},M=(J,re)=>{const fe=AT(EA(re));yp.setValue(J,{x:fe.saturation,y:100-fe.value})};return Vc({factory:J=>{const re=X({x:0,y:0}),fe=(Ne,st,Ht)=>{Do(Ne,aF,{value:Ht})},me=(Ne,st,Ht,dt)=>{C(Ht.element.dom,kT(B8))},Ce=Tn([sr.config({find:V.some}),es.config({})]);return yp.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[c("sv-palette")]},model:{mode:"xy",getInitialValue:re},rounded:!1,components:[m,b],onChange:fe,onInit:me,sliderBehaviours:Ce})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(J,re,fe)=>{x(re,fe)},setThumb:(J,re,fe)=>{M(re,fe)}},extraApis:{}})},$q=(o,c)=>{const m=C=>{const x=Fq(o,c,C.onValidHex,C.onInvalidHex),M=Hq(o,c),I=mn=>(100-mn)/100*360,W=mn=>100-mn/360*100,J={paletteRgba:$o(B8),paletteHue:$o(0)},re=Qr(x5(o,c)),fe=Qr(M.sketch({})),me=Qr(x.sketch({})),Ce=(mn,In,Kn)=>{fe.getOpt(mn).each(js=>{M.setHue(js,Kn)})},Ne=(mn,In)=>{me.getOpt(mn).each(Kn=>{x.updateHex(Kn,In)})},st=(mn,In,Kn)=>{re.getOpt(mn).each(js=>{yp.setValue(js,W(Kn))})},Ht=(mn,In)=>{fe.getOpt(mn).each(Kn=>{M.setThumb(Kn,In)})},dt=(mn,In)=>{const Kn=EA(mn);J.paletteRgba.set(Kn),J.paletteHue.set(In)},lt=(mn,In,Kn,js)=>{dt(In,Kn),gt(js,wo=>{wo(mn,In,Kn)})},Zt=()=>{const mn=[Ne];return(In,Kn)=>{const js=Kn.event.value,wo=J.paletteHue.get(),_s=qw(wo,js.x,100-js.y),fs=z8(_s);lt(In,fs,wo,mn)}},Ot=()=>{const mn=[Ce,Ne];return(In,Kn)=>{const js=I(Kn.event.value),wo=J.paletteRgba.get(),_s=AT(wo),fs=qw(js,_s.saturation,_s.value),hr=z8(fs);lt(In,hr,js,mn)}},An=()=>{const mn=[Ce,st,Ht];return(In,Kn)=>{const js=Kn.event.hex,wo=xT(js);lt(In,js,wo.hue,mn)}};return{uid:C.uid,dom:C.dom,components:[fe.asSpec(),re.asSpec(),me.asSpec()],behaviours:Tn([ks("colour-picker-events",[en(E5,An()),en(aF,Zt()),en(A5,Ot())]),sr.config({find:mn=>me.getOpt(mn)}),Io.config({mode:"acyclic"})])}};return Vc({name:"ColourPicker",configFields:[Qt("dom"),At("onValidHex",F),At("onInvalidHex",F)],factory:m})},wp={self:()=>sr.config({find:V.some}),memento:o=>sr.config({find:o.getOpt}),childAt:o=>sr.config({find:c=>Rc(c.element,o).bind(m=>c.getSystem().getByDom(m).toOptional())})},Vq=lo([At("preprocess",we),At("postprocess",we)]),fF=(o,c)=>{const m=As("RepresentingConfigs.memento processors",Vq,c);return Jn.config({store:{mode:"manual",getValue:b=>{const C=o.get(b),x=Jn.getValue(C);return m.postprocess(x)},setValue:(b,C)=>{const x=m.preprocess(C),M=o.get(b);Jn.setValue(M,x)}}})},ev=(o,c,m)=>Jn.config({store:{mode:"manual",...o.map(b=>({initialValue:b})).getOr({}),getValue:c,setValue:m}}),dF=(o,c,m)=>ev(o,b=>c(b.element),(b,C)=>m(b.element,C)),M5=o=>dF(o,Vp,ch),tv=o=>Jn.config({store:{mode:"memory",initialValue:o}}),hF={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},mF=o=>c=>o.translate(hF[c]),gF=(o,c,m)=>{const b=W=>"tox-"+W,C=$q(mF(c),b),x=W=>{Do(W,k0,{name:"hex-valid",value:!0})},M=W=>{Do(W,k0,{name:"hex-valid",value:!1})},I=Qr(C.sketch({dom:{tag:"div",classes:[b("color-picker-container")],attributes:{role:"presentation"}},onValidHex:x,onInvalidHex:M}));return{dom:{tag:"div"},components:[I.asSpec()],behaviours:Tn([ev(m,W=>{const J=I.get(W);return sr.getCurrent(J).bind(me=>Jn.getValue(me).hex).map(me=>"#"+Sr(me,"#")).getOr("")},(W,J)=>{const re=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,fe=V.from(re.exec(J)).bind(Ne=>eo(Ne,1)),me=I.get(W);sr.getCurrent(me).fold(()=>{console.log("Can not find form")},Ne=>{Jn.setValue(Ne,{hex:fe.getOr("")}),e_.getField(Ne,"hex").each(st=>{nr(st,Kh())})})}),wp.self()])}};var Uq=tinymce.util.Tools.resolve("tinymce.Resource");const Wq=o=>ps(o,"init"),JT=o=>{const c=ji(),m=Qr({dom:{tag:o.tag}}),b=ji();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Tn([ks("custom-editor-events",[yi(C=>{m.getOpt(C).each(x=>{(Wq(o)?o.init(x.element.dom):Uq.load(o.scriptId,o.scriptUrl).then(M=>M(x.element.dom,o.settings))).then(M=>{b.on(I=>{M.setValue(I)}),b.clear(),c.set(M)})})})]),ev(V.none(),()=>c.get().fold(()=>b.get().getOr(""),C=>C.getValue()),(C,x)=>{c.get().fold(()=>b.set(x),M=>M.setValue(x))}),wp.self()]),components:[m.asSpec()]}};var nv=tinymce.util.Tools.resolve("tinymce.util.Tools");const jq=(o,c)=>{const m=nv.explode(c.getOption("images_file_types")),b=C=>an(m,x=>Fi(C.name.toLowerCase(),`.${x.toLowerCase()}`));return Zn(Rs(o),b)},pF=(o,c,m)=>{const b=(me,Ce)=>{Ce.stop()},C=me=>(Ce,Ne)=>{gt(me,st=>{st(Ce,Ne)})},x=(me,Ce)=>{var Ne;if(!Xo.isDisabled(me)){const st=Ce.event.raw;I(me,(Ne=st.dataTransfer)===null||Ne===void 0?void 0:Ne.files)}},M=(me,Ce)=>{const Ne=Ce.event.raw.target;I(me,Ne.files)},I=(me,Ce)=>{Ce&&(Jn.setValue(me,jq(Ce,c)),Do(me,xh,{name:o.name}))},W=Qr({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Tn([ks("input-file-events",[Qh(Yh()),Qh(Z1())])])}),J=me=>({uid:me.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Tn([tv(m.getOr([])),wp.self(),Xo.config({}),Ms.config({toggleClass:"dragenter",toggleOnExecute:!1}),ks("dropzone-events",[en("dragenter",C([b,Ms.toggle])),en("dragleave",C([b,Ms.toggle])),en("dragover",b),en("drop",C([b,x])),en(Wg(),M)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Ni(c.translate("Drop an image here"))]},Uc.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Ni(c.translate("Browse for an image")),W.asSpec()],action:Ce=>{W.get(Ce).element.dom.click()},buttonBehaviours:Tn([Ka.config({}),vg.button(c.isDisabled),ec()])})]}]}),re=o.label.map(me=>Xb(me,c)),fe=ei.parts.field({factory:{sketch:J}});return DA(re,fe,["tox-form__group--stretched"],[])},bF=(o,c)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${o.columns}col`]},components:qe(o.items,c.interpreter)}),R5=(o,c)=>{let m=null,b=null;return{cancel:()=>{A(m)||(clearTimeout(m),m=null,b=null)},throttle:(...M)=>{b=M,A(m)&&(m=setTimeout(()=>{const I=b;m=null,b=null,o.apply(null,I)},c))}}},vF=(o,c)=>{let m=null;return{cancel:()=>{A(m)||(clearTimeout(m),m=null)},throttle:(...x)=>{A(m)&&(m=setTimeout(()=>{m=null,o.apply(null,x)},c))}}},cf=(o,c)=>{let m=null;const b=()=>{A(m)||(clearTimeout(m),m=null)};return{cancel:b,throttle:(...x)=>{b(),m=setTimeout(()=>{m=null,o.apply(null,x)},c)}}},QT=ro("alloy-fake-before-tabstop"),N5=ro("alloy-fake-after-tabstop"),yF=o=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:o},behaviours:Tn([es.config({ignore:!0}),Ka.config({})])}),P5=(o,c)=>({dom:{tag:"div",classes:["tox-navobj",...o.getOr([])]},components:[yF([QT]),c,yF([N5])],behaviours:Tn([wp.childAt(1)])}),wF=(o,c)=>{Do(o,Ef(),{raw:{which:9,shiftKey:c}})},Zq=(o,c)=>{const m=c.element;Ju(m,QT)?wF(o,!0):Ju(m,N5)&&wF(o,!1)},HA=o=>_S(o,["."+QT,"."+N5].join(","),Je),e4=ro("update-dialog"),m1=ro("update-title"),t4=ro("update-body"),I5=ro("update-footer"),$A=ro("body-send-message"),AS=ro("dialog-focus-shifted"),B5=rn().browser,zA=B5.isSafari(),qq=B5.isFirefox(),_F=zA||qq,Gq=B5.isChromium(),Kq=({scrollTop:o,scrollHeight:c,clientHeight:m})=>Math.ceil(o)+m>=c,CF=(o,c)=>o.scrollTo(0,c==="bottom"?99999999:c),SF=(o,c)=>{const m=o.body;return V.from(!/^<!DOCTYPE (html|HTML)/.test(c)&&(!Gq&&!zA||j(m)&&(m.scrollTop!==0||Math.abs(m.scrollHeight-m.clientHeight)>1))?m:o.documentElement)},kF=(o,c,m)=>{const b=o.dom;V.from(b.contentDocument).fold(m,C=>{let x=0;const M=SF(C,c).map(W=>(x=W.scrollTop,W)).forall(Kq),I=()=>{const W=b.contentWindow;j(W)&&(M?CF(W,"bottom"):!M&&_F&&x!==0&&CF(W,x))};zA&&b.addEventListener("load",I,{once:!0}),C.open(),C.write(c),C.close(),zA||I()})},n4=un(_F,zA?500:200).map(o=>R5(kF,o)),Yq=(o,c)=>{const m=$o(o.getOr(""));return{getValue:b=>m.get(),setValue:(b,C)=>{if(m.get()!==C){const x=b.element,M=()=>Xn(x,"srcdoc",C);c?n4.fold(X(kF),I=>I.throttle)(x,C,M):M()}m.set(C)}}},Xq=(o,c,m)=>{const b="tox-dialog__iframe",C=o.transparent?[]:[`${b}--opaque`],x=o.border?["tox-navobj-bordered"]:[],M={...o.label.map(fe=>({title:fe})).getOr({}),...m.map(fe=>({srcdoc:fe})).getOr({}),...o.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},I=Yq(m,o.streamContent),W=o.label.map(fe=>Xb(fe,c)),J=fe=>P5(V.from(x),{uid:fe.uid,dom:{tag:"iframe",attributes:M,classes:[b,...C]},behaviours:Tn([Ka.config({}),es.config({}),ev(m,I.getValue,I.setValue),Cc.config({channels:{[AS]:{onReceive:(me,Ce)=>{Ce.newFocus.each(Ne=>{bc(me.element).each(st=>{(kr(me.element,Ne)?Ra:ma)(st,"tox-navobj-bordered-focus")})})}}}})])}),re=ei.parts.field({factory:{sketch:J}});return DA(W,re,["tox-form__group--stretched"],[])},EF=o=>new Promise((c,m)=>{const b=()=>{x(),c(o)},C=[Sc(o,"load",b),Sc(o,"error",()=>{x(),m("Unable to load data from image: "+o.dom.src)})],x=()=>gt(C,M=>M.unbind());o.dom.complete&&b()}),AF=(o,c,m,b,C)=>{const x=m*C,M=b*C,I=Math.max(0,o/2-x/2),W=Math.max(0,c/2-M/2);return{left:I.toString()+"px",top:W.toString()+"px",width:x.toString()+"px",height:M.toString()+"px"}},L5=(o,c,m)=>{const b=Ji(o),C=Mi(o);return Math.min(b/c,C/m,1)},o4=(o,c)=>{const m=$o(c.getOr({url:""})),b=Qr({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:c.map(W=>({src:W.url})).getOr({})}}),C=Qr({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[b.asSpec()]}),x=(W,J)=>{const re={url:J.url};J.zoom.each(me=>re.zoom=me),J.cachedWidth.each(me=>re.cachedWidth=me),J.cachedHeight.each(me=>re.cachedHeight=me),m.set(re);const fe=()=>{const{cachedWidth:me,cachedHeight:Ce,zoom:Ne}=re;if(!N(me)&&!N(Ce)){if(N(Ne)){const Ht=L5(W.element,me,Ce);re.zoom=Ht}const st=AF(Ji(W.element),Mi(W.element),me,Ce,re.zoom);C.getOpt(W).each(Ht=>{gi(Ht.element,st)})}};b.getOpt(W).each(me=>{const Ce=me.element;J.url!==$i(Ce,"src")&&(Xn(Ce,"src",J.url),ma(W.element,"tox-imagepreview__loaded")),fe(),EF(Ce).then(Ne=>{W.getSystem().isConnected()&&(Ra(W.element,"tox-imagepreview__loaded"),re.cachedWidth=Ne.dom.naturalWidth,re.cachedHeight=Ne.dom.naturalHeight,fe())})})},M={};o.height.each(W=>M.height=W);const I=c.map(W=>({url:W.url,zoom:V.from(W.zoom),cachedWidth:V.from(W.cachedWidth),cachedHeight:V.from(W.cachedHeight)}));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:M,attributes:{role:"presentation"}},components:[C.asSpec()],behaviours:Tn([wp.self(),ev(I,()=>m.get(),x)])}},VA=(o,c)=>{const m="tox-label",b=o.align==="center"?[`${m}--center`]:[],C=o.align==="end"?[`${m}--end`]:[],x={dom:{tag:"label",classes:[m,...b,...C]},components:[Ni(c.providers.translate(o.label))]},M=qe(o.items,c.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[x,...M],behaviours:Tn([wp.self(),ms.config({}),M5(V.none()),Io.config({mode:"acyclic"})])}},xS=ro("toolbar.button.execute"),xF=o=>ou((c,m)=>{_A(o,c)(b=>{Do(c,xS,{buttonApi:b}),o.onAction(b)})}),My=ro("common-button-display-events"),F5={[Ku()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],[xu()]:["toolbar-button-events",My],[Br()]:["focusing","alloy.base.behaviour",My]},s4=o=>so(o.element,"width",qr(o.element,"width")),TF=(o,c,m)=>gp(o,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:m},c),H5=(o,c)=>TF(o,c,[]),Ry=(o,c)=>TF(o,c,[ms.config({})]),DF=(o,c,m)=>({dom:{tag:"span",classes:[`${c}__select-label`]},components:[Ni(m.translate(o))],behaviours:Tn([ms.config({})])}),Cg=ro("update-menu-text"),Ny=ro("update-menu-icon"),r4=(o,c,m)=>{const b=$o(F),C=o.text.map(me=>Qr(DF(me,c,m.providers))),x=o.icon.map(me=>Qr(Ry(me,m.providers.icons))),M=(me,Ce)=>{const Ne=Jn.getValue(me);return es.focus(Ne),Do(Ne,"keydown",{raw:Ce.event.raw}),wg.close(Ne),V.some(!0)},I=o.role.fold(()=>({}),me=>({role:me})),W=o.tooltip.fold(()=>({}),me=>{const Ce=m.providers.translate(me);return{title:Ce,"aria-label":Ce}}),J=gp("chevron-down",{tag:"div",classes:[`${c}__select-chevron`]},m.providers.icons),re=ro("common-button-display-events");return Qr(wg.sketch({...o.uid?{uid:o.uid}:{},...I,dom:{tag:"button",classes:[c,`${c}--select`].concat(qe(o.classes,me=>`${c}--${me}`)),attributes:{...W}},components:pS([x.map(me=>me.asSpec()),C.map(me=>me.asSpec()),V.some(J)]),matchWidth:!0,useMinWidth:!0,onOpen:(me,Ce,Ne)=>{o.searchable&&t5(Ne)},dropdownBehaviours:Tn([...o.dropdownBehaviours,vg.button(()=>o.disabled||m.providers.isDisabled()),ec(),MA.config({}),ms.config({}),ks("dropdown-events",[qb(o,b),Gb(o,b)]),ks(re,[yi((me,Ce)=>s4(me))]),ks("menubutton-update-display-text",[en(Cg,(me,Ce)=>{C.bind(Ne=>Ne.getOpt(me)).each(Ne=>{ms.set(Ne,[Ni(m.providers.translate(Ce.event.text))])})}),en(Ny,(me,Ce)=>{x.bind(Ne=>Ne.getOpt(me)).each(Ne=>{ms.set(Ne,[Ry(Ce.event.icon,m.providers.icons)])})})])]),eventOrder:Jr(F5,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[xu()]:["toolbar-button-events","dropdown-events",re]}),sandboxBehaviours:Tn([Io.config({mode:"special",onLeft:M,onRight:M}),ks("dropdown-sandbox-events",[en(qB,(me,Ce)=>{NT(me),Ce.stop()}),en(GB,(me,Ce)=>{QR(me,Ce),Ce.stop()})])]),lazySink:m.getSink,toggleClass:`${c}--active`,parts:{menu:{...fS(!1,o.columns,o.presets),fakeFocus:o.searchable,onHighlightItem:mL,onCollapseMenu:(me,Ce,Ne)=>{Nr.getHighlighted(Ne).each(st=>{mL(me,Ne,st)})},onDehighlightItem:iZ}},getAnchorOverrides:()=>({maxHeightFunction:(me,Ce)=>{Zv()(me,Ce-10)}}),fetch:me=>Bu.nu(Te(o.fetch,me))})).asSpec()},Jq=o=>h(o),$5=o=>o.type==="separator",Qq=o=>ps(o,"getSubmenuItems"),OF={type:"separator"},UA=(o,c)=>{const m=ao(o,(b,C)=>Jq(C)?C===""?b:C==="|"?b.length>0&&!$5(b[b.length-1])?b.concat([OF]):b:ps(c,C.toLowerCase())?b.concat([c[C.toLowerCase()]]):b:b.concat([C]),[]);return m.length>0&&$5(m[m.length-1])&&m.pop(),m},eG=(o,c)=>{const m=o.getSubmenuItems(),b=RF(m,c),C=Jr(b.menus,{[o.value]:b.items}),x=Jr(b.expansions,{[o.value]:o.value});return{item:o,menus:C,expansions:x}},MF=o=>{const c=ln(o,"value").getOrThunk(()=>ro("generated-menu-item"));return Jr({value:c},o)},RF=(o,c)=>{const m=UA(h(o)?o.split(" "):o,c);return Bn(m,(b,C)=>{if(Qq(C)){const x=MF(C),M=eG(x,c);return{menus:Jr(b.menus,M.menus),items:[M.item,...b.items],expansions:Jr(b.expansions,M.expansions)}}else return{...b,items:[C,...b.items]}},{menus:{},expansions:{},items:[]})},tG=o=>o.search.fold(()=>({searchMode:"no-search"}),c=>({searchMode:"search-with-field",placeholder:c.placeholder})),nG=o=>o.search.fold(()=>({searchMode:"no-search"}),c=>({searchMode:"search-with-results"})),TS=(o,c,m,b)=>{const C=ro("primary-menu"),x=RF(o,m.shared.providers.menuItems());if(x.items.length===0)return V.none();const M=tG(b),I=pL(C,x.items,c,m,b.isHorizontalMenu,M),W=nG(b),J=Ns(x.menus,(fe,me)=>pL(me,fe,c,m,!1,W)),re=Jr(J,Ln(C,I));return V.from(Iw.tieredData(C,re,x.expansions))},i4=o=>!ps(o,"items"),NF="data-value",z5=(o,c,m,b)=>qe(m,C=>i4(C)?{type:"togglemenuitem",text:C.text,value:C.value,active:C.value===b,onAction:()=>{Jn.setValue(o,C.value),Do(o,xh,{name:c}),es.focus(o)}}:{type:"nestedmenuitem",text:C.text,getSubmenuItems:()=>z5(o,c,C.items,b)}),WA=(o,c)=>Js(o,m=>i4(m)?un(m.value===c,m):WA(m.items,c)),sv=(o,c,m)=>{const b=c.shared.providers,C=m.bind(W=>WA(o.items,W)).orThunk(()=>ds(o.items).filter(i4)),x=o.label.map(W=>Xb(W,b)),M=ei.parts.field({dom:{},factory:{sketch:W=>r4({uid:W.uid,text:C.map(J=>J.text),icon:V.none(),tooltip:o.label,role:V.none(),fetch:(J,re)=>{const fe=z5(J,o.name,o.items,Jn.getValue(J));re(TS(fe,pp.CLOSE_ON_EXECUTE,c,{isHorizontalMenu:!1,search:V.none()}))},onSetup:X(F),getApi:X({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Ka.config({}),ev(C.map(J=>J.value),J=>$i(J.element,NF),(J,re)=>{WA(o.items,re).each(fe=>{Xn(J.element,NF,fe.value),Do(J,Cg,{text:fe.text})})})]},"tox-listbox",c.shared)}}),I={dom:{tag:"div",classes:["tox-listboxfield"]},components:[M]};return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Tt([x.toArray(),[I]]),fieldBehaviours:Tn([Xo.config({disabled:X(!o.enabled),onDisabled:W=>{ei.getField(W).each(Xo.disable)},onEnabled:W=>{ei.getField(W).each(Xo.enable)}})])})},V5=(o,c)=>({dom:{tag:"div",classes:o.classes},components:qe(o.items,c.shared.interpreter)}),PF=(o,c)=>{const m=qe(o.options,C=>({dom:{tag:"option",value:C.value,innerHtml:C.text}})),b=o.data.map(C=>Ln("initialValue",C)).getOr({});return{uid:o.uid,dom:{tag:"select",classes:o.selectClasses,attributes:o.selectAttributes},components:m,behaviours:Ql(o.selectBehaviours,[es.config({}),Jn.config({store:{mode:"manual",getValue:C=>Na(C.element),setValue:(C,x)=>{const M=ds(o.options);St(o.options,W=>W.value===x).isSome()?Sa(C.element,x):C.element.dom.selectedIndex===-1&&x===""&&M.each(W=>Sa(C.element,W.value))},...b}})])}},IF=Vc({name:"HtmlSelect",configFields:[Qt("options"),$l("selectBehaviours",[es,Jn]),At("selectClasses",[]),At("selectAttributes",{}),Ar("data")],factory:PF}),U5=(o,c,m)=>{const b=qe(o.items,W=>({text:c.translate(W.text),value:W.value})),C=o.label.map(W=>Xb(W,c)),x=ei.parts.field({dom:{},...m.map(W=>({data:W})).getOr({}),selectAttributes:{size:o.size},options:b,factory:IF,selectBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled()}),Ka.config({}),ks("selectbox-change",[en(Wg(),(W,J)=>{Do(W,xh,{name:o.name})})])])}),M=o.size>1?V.none():V.some(gp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},c.icons)),I={dom:{tag:"div",classes:["tox-selectfield"]},components:Tt([[x],M.toArray()])};return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Tt([C.toArray(),[I]]),fieldBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:W=>{ei.getField(W).each(Xo.disable)},onEnabled:W=>{ei.getField(W).each(Xo.enable)}}),ec()])})},BF=X([At("field1Name","field1"),At("field2Name","field2"),rg("onLockedChange"),tf(["lockClass"]),At("locked",!1),dm.field("coupledFieldBehaviours",[sr,Jn])]),a4=(o,c,m)=>Ti(o,c,m).bind(sr.getCurrent),W5=(o,c)=>zc({factory:ei,name:o,overrides:m=>({fieldBehaviours:Tn([ks("coupled-input-behaviour",[en(Kh(),b=>{a4(b,m,c).each(C=>{Ti(b,m,"lock").each(x=>{Ms.isOn(x)&&m.onLockedChange(b,C,x)})})})])])})}),LF=X([W5("field1","field2"),W5("field2","field1"),zc({factory:Uc,schema:[Qt("dom")],name:"lock",overrides:o=>({buttonBehaviours:Tn([Ms.config({selected:o.locked,toggleClass:o.markers.lockClass,aria:{mode:"pressed"}})])})})]),oG=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,behaviours:dm.augment(o.coupledFieldBehaviours,[sr.config({find:V.some}),Jn.config({store:{mode:"manual",getValue:C=>{const x=VE(C,o,["field1","field2"]);return{[o.field1Name]:Jn.getValue(x.field1()),[o.field2Name]:Jn.getValue(x.field2())}},setValue:(C,x)=>{const M=VE(C,o,["field1","field2"]);Li(x,o.field1Name)&&Jn.setValue(M.field1(),x[o.field1Name]),Li(x,o.field2Name)&&Jn.setValue(M.field2(),x[o.field2Name])}}})]),apis:{getField1:C=>Ti(C,o,"field1"),getField2:C=>Ti(C,o,"field2"),getLock:C=>Ti(C,o,"lock")}}),ym=fu({name:"FormCoupledInputs",configFields:BF(),partFields:LF(),factory:oG,apis:{getField1:(o,c)=>o.getField1(c),getField2:(o,c)=>o.getField2(c),getLock:(o,c)=>o.getLock(c)}}),sG=o=>{const c={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},m=C=>C in c?c[C]:1;let b=o.value.toFixed(m(o.unit));return b.indexOf(".")!==-1&&(b=b.replace(/\.?0*$/,"")),b+o.unit},j5=o=>{const m=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(o);if(m!==null){const b=parseFloat(m[1]),C=m[2];return Cn.value({value:b,unit:C})}else return Cn.error(o)},FF=(o,c)=>{const m={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},b=C=>ps(m,C);return o.unit===c?V.some(o.value):b(o.unit)&&b(c)?m[o.unit]===m[c]?V.some(o.value):V.some(o.value/m[o.unit]*m[c]):V.none()},l4=o=>V.none(),HF=(o,c)=>m=>FF(m,c).map(b=>({value:b*o,unit:c})),rG=(o,c)=>{const m=j5(o).toOptional(),b=j5(c).toOptional();return qn(m,b,(C,x)=>FF(C,x.unit).map(M=>x.value/M).map(M=>HF(M,x.unit)).getOr(l4)).getOr(l4)},iG=(o,c)=>{let m=l4;const b=ro("ratio-event"),C=fe=>gp(fe,{tag:"span",classes:["tox-icon","tox-lock-icon__"+fe]},c.icons),x=ym.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:c.translate(o.label.getOr("Constrain proportions"))}},components:[C("lock"),C("unlock")],buttonBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled()}),ec(),Ka.config({})])}),M=fe=>({dom:{tag:"div",classes:["tox-form__group"]},components:fe}),I=fe=>ei.parts.field({factory:Hw,inputClasses:["tox-textfield"],inputBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled()}),ec(),Ka.config({}),ks("size-input-events",[en(Gi(),(me,Ce)=>{Do(me,b,{isField1:fe})}),en(Wg(),(me,Ce)=>{Do(me,xh,{name:o.name})})])]),selectOnFocus:!1}),W=fe=>({dom:{tag:"label",classes:["tox-label"]},components:[Ni(c.translate(fe))]}),J=ym.parts.field1(M([ei.parts.label(W("Width")),I(!0)])),re=ym.parts.field2(M([ei.parts.label(W("Height")),I(!1)]));return ym.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[J,re,M([W(TC),x])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(fe,me,Ce)=>{j5(Jn.getValue(fe)).each(Ne=>{m(Ne).each(st=>{Jn.setValue(me,sG(st))})})},coupledFieldBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:fe=>{ym.getField1(fe).bind(ei.getField).each(Xo.disable),ym.getField2(fe).bind(ei.getField).each(Xo.disable),ym.getLock(fe).each(Xo.disable)},onEnabled:fe=>{ym.getField1(fe).bind(ei.getField).each(Xo.enable),ym.getField2(fe).bind(ei.getField).each(Xo.enable),ym.getLock(fe).each(Xo.enable)}}),ec(),ks("size-input-events2",[en(b,(fe,me)=>{const Ce=me.event.isField1,Ne=Ce?ym.getField1(fe):ym.getField2(fe),st=Ce?ym.getField2(fe):ym.getField1(fe),Ht=Ne.map(Jn.getValue).getOr(""),dt=st.map(Jn.getValue).getOr("");m=rG(Ht,dt)})])])})},aG=(o,c,m)=>{const b=yp.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Ni(c.translate(o.label))]}),C=yp.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),x=yp.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return yp.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o.min,maxX:o.max,getInitialValue:X(m.getOrThunk(()=>(Math.abs(o.max)-Math.abs(o.min))/2))},components:[b,C,x],sliderBehaviours:Tn([wp.self(),es.config({})]),onChoose:(M,I,W)=>{Do(M,xh,{name:o.name,value:W})}})},c4=(o,c)=>{const m=I=>({dom:{tag:"th",innerHtml:c.translate(I)}}),b=I=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:qe(I,m)}]}),C=I=>({dom:{tag:"td",innerHtml:c.translate(I)}}),x=I=>({dom:{tag:"tr"},components:qe(I,C)}),M=I=>({dom:{tag:"tbody"},components:qe(I,x)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[b(o.header),M(o.cells)],behaviours:Tn([Ka.config({}),es.config({})])}},$F=(o,c)=>{const m=o.label.map(Ce=>Xb(Ce,c)),b=[Xo.config({disabled:()=>o.disabled||c.isDisabled()}),ec(),Io.config({mode:"execution",useEnter:o.multiline!==!0,useControlEnter:o.multiline===!0,execute:Ce=>(nr(Ce,CS),V.some(!0))}),ks("textfield-change",[en(Kh(),(Ce,Ne)=>{Do(Ce,xh,{name:o.name})}),en(Gm(),(Ce,Ne)=>{Do(Ce,xh,{name:o.name})})]),Ka.config({})],C=o.validation.map(Ce=>d1.config({getRoot:Ne=>bc(Ne.element),invalidClass:"tox-invalid",validator:{validate:Ne=>{const st=Jn.getValue(Ne),Ht=Ce.validator(st);return Bu.pure(Ht===!0?Cn.value(st):Cn.error(Ht))},validateOnLoad:Ce.validateOnLoad}})).toArray(),x=o.placeholder.fold(X({}),Ce=>({placeholder:c.translate(Ce)})),M=o.inputMode.fold(X({}),Ce=>({inputmode:Ce})),I={...x,...M},W=ei.parts.field({tag:o.multiline===!0?"textarea":"input",...o.data.map(Ce=>({data:Ce})).getOr({}),inputAttributes:I,inputClasses:[o.classname],inputBehaviours:Tn(Tt([b,C])),selectOnFocus:!1,factory:Hw}),J=o.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[W]}:W,fe=(o.flex?["tox-form__group--stretched"]:[]).concat(o.maximized?["tox-form-group--maximize"]:[]),me=[Xo.config({disabled:()=>o.disabled||c.isDisabled(),onDisabled:Ce=>{ei.getField(Ce).each(Xo.disable)},onEnabled:Ce=>{ei.getField(Ce).each(Xo.enable)}}),ec()];return DA(m,J,fe,me)},lG=(o,c,m)=>$F({name:o.name,multiline:!1,label:o.label,inputMode:o.inputMode,placeholder:o.placeholder,flex:!1,disabled:!o.enabled,classname:"tox-textfield",validation:V.none(),maximized:o.maximized,data:m},c),zF=(o,c,m)=>$F({name:o.name,multiline:!0,label:o.label,inputMode:V.none(),placeholder:o.placeholder,flex:!0,disabled:!o.enabled,classname:"tox-textarea",validation:V.none(),maximized:o.maximized,data:m},c),DS=(o,c)=>c.getAnimationRoot.fold(()=>o.element,m=>m(o)),rv=o=>o.dimension.property,t_=(o,c)=>o.dimension.getDimension(c),OS=(o,c)=>{const m=DS(o,c);Fc(m,[c.shrinkingClass,c.growingClass])},Z5=(o,c)=>{ma(o.element,c.openClass),Ra(o.element,c.closedClass),so(o.element,rv(c),"0px"),Kc(o.element)},u4=(o,c)=>{ma(o.element,c.closedClass),Ra(o.element,c.openClass),Ss(o.element,rv(c))},VF=(o,c,m,b)=>{m.setCollapsed(),so(o.element,rv(c),t_(c,o.element)),OS(o,c),Z5(o,c),c.onStartShrink(o),c.onShrunk(o)},cG=(o,c,m,b)=>{const C=b.getOrThunk(()=>t_(c,o.element));m.setCollapsed(),so(o.element,rv(c),C),Kc(o.element);const x=DS(o,c);ma(x,c.growingClass),Ra(x,c.shrinkingClass),Z5(o,c),c.onStartShrink(o)},UF=(o,c,m)=>{const b=t_(c,o.element);(b==="0px"?VF:cG)(o,c,m,V.some(b))},q5=(o,c,m)=>{const b=DS(o,c),C=Ju(b,c.shrinkingClass),x=t_(c,o.element);u4(o,c);const M=t_(c,o.element);(C?()=>{so(o.element,rv(c),x),Kc(o.element)}:()=>{Z5(o,c)})(),ma(b,c.shrinkingClass),Ra(b,c.growingClass),u4(o,c),so(o.element,rv(c),M),m.setExpanded(),c.onStartGrow(o)},WF=(o,c,m)=>{if(m.isExpanded()){Ss(o.element,rv(c));const b=t_(c,o.element);so(o.element,rv(c),b)}},uG=(o,c,m)=>{m.isExpanded()||q5(o,c,m)},fG=(o,c,m)=>{m.isExpanded()&&UF(o,c,m)},dG=(o,c,m)=>{m.isExpanded()&&VF(o,c,m)},hG=(o,c,m)=>m.isExpanded(),jF=(o,c,m)=>m.isCollapsed(),ZF=(o,c,m)=>{const b=DS(o,c);return Ju(b,c.growingClass)===!0},G5=(o,c,m)=>{const b=DS(o,c);return Ju(b,c.shrinkingClass)===!0};var mG=Object.freeze({__proto__:null,refresh:WF,grow:uG,shrink:fG,immediateShrink:dG,hasGrown:hG,hasShrunk:jF,isGrowing:ZF,isShrinking:G5,isTransitioning:(o,c,m)=>ZF(o,c)||G5(o,c),toggleGrow:(o,c,m)=>{(m.isExpanded()?UF:q5)(o,c,m)},disableTransitions:OS,immediateGrow:(o,c,m)=>{m.isExpanded()||(u4(o,c),so(o.element,rv(c),t_(c,o.element)),OS(o,c),m.setExpanded(),c.onStartGrow(o),c.onGrown(o))}}),gG=Object.freeze({__proto__:null,exhibit:(o,c,m)=>{const b=c.expanded;return Lc(b?{classes:[c.openClass],styles:{}}:{classes:[c.closedClass],styles:Ln(c.dimension.property,"0px")})},events:(o,c)=>ri([eg(jg(),(m,b)=>{b.event.raw.propertyName===o.dimension.property&&(OS(m,o),c.isExpanded()&&Ss(m.element,o.dimension.property),(c.isExpanded()?o.onGrown:o.onShrunk)(m))})])}),pG=[Qt("closedClass"),Qt("openClass"),Qt("shrinkingClass"),Qt("growingClass"),Ar("getAnimationRoot"),Gs("onShrunk"),Gs("onStartShrink"),Gs("onGrown"),Gs("onStartGrow"),At("expanded",!1),Gr("dimension",Cl("property",{width:[Wi("property","width"),Wi("getDimension",o=>Ji(o)+"px")],height:[Wi("property","height"),Wi("getDimension",o=>Mi(o)+"px")]}))],K5=Object.freeze({__proto__:null,init:o=>{const c=$o(o.expanded),m=()=>"expanded: "+c.get();return su({isExpanded:()=>c.get()===!0,isCollapsed:()=>c.get()===!1,setCollapsed:Te(c.set,!1),setExpanded:Te(c.set,!0),readState:m})}});const Th=Xl({fields:pG,name:"sliding",active:gG,apis:mG,state:K5}),qF=o=>({isEnabled:()=>!Xo.isDisabled(o),setEnabled:c=>Xo.set(o,!c),setActive:c=>{const m=o.element;c?(Ra(m,"tox-tbtn--enabled"),Xn(m,"aria-pressed",!0)):(ma(m,"tox-tbtn--enabled"),We(m,"aria-pressed"))},isActive:()=>Ju(o.element,"tox-tbtn--enabled"),setText:c=>{Do(o,Cg,{text:c})},setIcon:c=>Do(o,Ny,{icon:c})}),jA=(o,c,m,b,C=!0)=>r4({text:o.text,icon:o.icon,tooltip:o.tooltip,searchable:o.search.isSome(),role:b,fetch:(x,M)=>{const I={pattern:o.search.isSome()?n5(x):""};o.fetch(W=>{M(TS(W,pp.CLOSE_ON_EXECUTE,m,{isHorizontalMenu:!1,search:o.search}))},I,qF(x))},onSetup:o.onSetup,getApi:qF,columns:1,presets:"normal",classes:[],dropdownBehaviours:[...C?[Ka.config({})]:[]]},c,m.shared),ZA=(o,c,m)=>{const b=x=>M=>{const I=!M.isActive();M.setActive(I),x.storage.set(I),m.shared.getSink().each(W=>{c().getOpt(W).each(J=>{of(J.element),Do(J,k0,{name:x.name,value:x.storage.get()})})})},C=x=>M=>{M.setActive(x.storage.get())};return x=>{x(qe(o,M=>{const I=M.text.fold(()=>({}),W=>({text:W}));return{type:M.type,active:!1,...I,onAction:b(M),onSetup:C(M)}}))}},f4=o=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{title:o,"aria-label":o}},components:[Ni(o)]}),GF=ro("leaf-label-event-id"),Y5=({leaf:o,onLeafAction:c,visible:m,treeId:b,selectedId:C,backstage:x})=>{const M=o.menu.map(W=>jA(W,"tox-mbtn",x,V.none(),m)),I=[f4(o.title)];return M.each(W=>I.push(W)),Uc.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(m?["tox-tree--leaf__label--visible"]:[])},components:I,role:"treeitem",action:W=>{c(o.id),W.getSystem().broadcastOn([`update-active-item-${b}`],{value:o.id})},eventOrder:{[Ef()]:[GF,"keying"]},buttonBehaviours:Tn([...m?[Ka.config({})]:[],Ms.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Cc.config({channels:{[`update-active-item-${b}`]:{onReceive:(W,J)=>{(J.value===o.id?Ms.on:Ms.off)(W)}}}}),ks(GF,[yi((W,J)=>{C.each(re=>{(re===o.id?Ms.on:Ms.off)(W)})}),en(Ef(),(W,J)=>{const re=J.event.raw.code==="ArrowLeft",fe=J.event.raw.code==="ArrowRight";re?(og(W.element,".tox-tree--directory").each(me=>{W.getSystem().getByDom(me).each(Ce=>{Iv(me,".tox-tree--directory__label").each(Ne=>{Ce.getSystem().getByDom(Ne).each(es.focus)})})}),J.stop()):fe&&J.stop()})])])})},X5=(o,c,m)=>gp(o,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:m},c),bG=(o,c)=>X5(o,c,[]),d4=ro("directory-label-event-id"),KF=({directory:o,visible:c,noChildren:m,backstage:b})=>{const C=o.menu.map(I=>jA(I,"tox-mbtn",b,V.none())),x=[{dom:{tag:"div",classes:["tox-chevron"]},components:[bG("chevron-right",b.shared.providers.icons)]},f4(o.title)];C.each(I=>{x.push(I)});const M=I=>{og(I.element,".tox-tree--directory").each(W=>{I.getSystem().getByDom(W).each(J=>{const re=!Ms.isOn(J);Ms.toggle(J),Do(I,"expand-tree-node",{expanded:re,node:o.id})})})};return Uc.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(c?["tox-tree--directory__label--visible"]:[])},components:x,action:M,eventOrder:{[Ef()]:[d4,"keying"]},buttonBehaviours:Tn([...c?[Ka.config({})]:[],ks(d4,[en(Ef(),(I,W)=>{const J=W.event.raw.code==="ArrowRight",re=W.event.raw.code==="ArrowLeft";J&&m&&W.stop(),(J||re)&&og(I.element,".tox-tree--directory").each(fe=>{I.getSystem().getByDom(fe).each(me=>{!Ms.isOn(me)&&J||Ms.isOn(me)&&re?(M(I),W.stop()):re&&!Ms.isOn(me)&&(og(me.element,".tox-tree--directory").each(Ce=>{Iv(Ce,".tox-tree--directory__label").each(Ne=>{me.getSystem().getByDom(Ne).each(es.focus)})}),W.stop())})})})])])})},vG=({children:o,onLeafAction:c,visible:m,treeId:b,expandedIds:C,selectedId:x,backstage:M})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:o.map(I=>I.type==="leaf"?Y5({leaf:I,selectedId:x,onLeafAction:c,visible:m,treeId:b,backstage:M}):h4({directory:I,expandedIds:C,selectedId:x,onLeafAction:c,labelTabstopping:m,treeId:b,backstage:M})),behaviours:Tn([Th.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:m}),ms.config({})])}),yG=ro("directory-event-id"),h4=({directory:o,onLeafAction:c,labelTabstopping:m,treeId:b,backstage:C,expandedIds:x,selectedId:M})=>{const{children:I}=o,W=$o(x),J=fe=>I.map(me=>me.type==="leaf"?Y5({leaf:me,selectedId:M,onLeafAction:c,visible:fe,treeId:b,backstage:C}):h4({directory:me,expandedIds:W.get(),selectedId:M,onLeafAction:c,labelTabstopping:fe,treeId:b,backstage:C})),re=x.includes(o.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[KF({directory:o,visible:m,noChildren:o.children.length===0,backstage:C}),vG({children:I,expandedIds:x,selectedId:M,onLeafAction:c,visible:re,treeId:b,backstage:C})],behaviours:Tn([ks(yG,[yi((fe,me)=>{Ms.set(fe,re)}),en("expand-tree-node",(fe,me)=>{const{expanded:Ce,node:Ne}=me.event;W.set(Ce?[...W.get(),Ne]:W.get().filter(st=>st!==Ne))})]),Ms.config({...o.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(fe,me)=>{const Ce=fe.components()[1],Ne=J(me);me?Th.grow(Ce):Th.shrink(Ce),ms.set(Ce,Ne)}})])}},YF=ro("tree-event-id"),wG=(o,c)=>{const m=o.onLeafAction.getOr(F),b=o.onToggleExpand.getOr(F),C=o.defaultExpandedIds,x=$o(C),M=$o(o.defaultSelectedId),I=ro("tree-id"),W=(J,re)=>o.items.map(fe=>fe.type==="leaf"?Y5({leaf:fe,selectedId:J,onLeafAction:m,visible:!0,treeId:I,backstage:c}):h4({directory:fe,selectedId:J,onLeafAction:m,expandedIds:re,labelTabstopping:!0,treeId:I,backstage:c}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:W(M.get(),x.get()),behaviours:Tn([Io.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),ks(YF,[en("expand-tree-node",(J,re)=>{const{expanded:fe,node:me}=re.event;x.set(fe?[...x.get(),me]:x.get().filter(Ce=>Ce!==me)),b(x.get(),{expanded:fe,node:me})})]),Cc.config({channels:{[`update-active-item-${I}`]:{onReceive:(J,re)=>{M.set(V.some(re.value)),ms.set(J,W(V.some(re.value),x.get()))}}}}),ms.config({})])}};var XF=Object.freeze({__proto__:null,events:(o,c)=>{const b=o.stream.streams.setup(o,c);return ri([en(o.event,b),Dd(()=>c.cancel())].concat(o.cancelEvent.map(C=>[en(C,()=>c.cancel())]).getOr([])))}});const JF=o=>{const c=$o(null);return su({readState:()=>({timer:c.get()!==null?"set":"unset"}),setTimer:x=>{c.set(x)},cancel:()=>{const x=c.get();x!==null&&x.cancel()}})};var QF=Object.freeze({__proto__:null,throttle:JF,init:o=>o.stream.streams.state(o)});const e7=(o,c)=>{const m=o.stream,b=cf(o.onStream,m.delay);return c.setTimer(b),(C,x)=>{b.throttle(C,x),m.stopEvent&&x.stop()}};var SG=[Gr("stream",Cl("mode",{throttle:[Qt("delay"),At("stopEvent",!0),Wi("streams",{setup:e7,state:JF})]})),At("event","input"),Ar("cancelEvent"),rg("onStream")];const J5=Xl({fields:SG,name:"streaming",active:XF,state:QF}),m4=(o,c,m)=>{const b=Jn.getValue(m);Jn.setValue(c,b),t7(c)},Q5=(o,c)=>{const m=o.element,b=Na(m),C=m.dom;$i(m,"type")!=="number"&&c(C,b)},t7=o=>{Q5(o,(c,m)=>c.setSelectionRange(m.length,m.length))},n7=(o,c)=>{Q5(o,(m,b)=>m.setSelectionRange(c,b.length))},kG=(o,c,m)=>{if(o.selectsOver){const b=Jn.getValue(c),C=o.getDisplayText(b),x=Jn.getValue(m);return o.getDisplayText(x).indexOf(C)===0?V.some(()=>{m4(o,c,m),n7(c,C.length)}):V.none()}else return V.none()},eN=X("alloy.typeahead.itemexecute"),tN=(o,c,m,b)=>{const C=(fe,me,Ce)=>{o.previewing.set(!1);const Ne=il.getCoupled(fe,"sandbox");if(Ks.isOpen(Ne))sr.getCurrent(Ne).each(st=>{Nr.getHighlighted(st).fold(()=>{Ce(st)},()=>{Av(Ne,st.element,"keydown",me)})});else{const st=Ht=>{sr.getCurrent(Ht).each(Ce)};xA(o,M(fe),fe,Ne,b,st,od.HighlightMenuAndItem).get(F)}},x=ZB(o),M=fe=>me=>me.map(Ce=>{const Ne=va(Ce.menus),st=Be(Ne,dt=>Zn(dt.items,lt=>lt.type==="item"));return Jn.getState(fe).update(qe(st,dt=>dt.data)),Ce}),I=fe=>sr.getCurrent(fe),W="typeaheadevents",J=[es.config({}),Jn.config({onSetValue:o.onSetValue,store:{mode:"dataset",getDataKey:fe=>Na(fe.element),getFallbackEntry:fe=>({value:fe,meta:{}}),setValue:(fe,me)=>{Sa(fe.element,o.model.getDisplayText(me))},...o.initialData.map(fe=>Ln("initialValue",fe)).getOr({})}}),J5.config({stream:{mode:"throttle",delay:o.responseTime,stopEvent:!1},onStream:(fe,me)=>{const Ce=il.getCoupled(fe,"sandbox");if(es.isFocused(fe)&&Na(fe.element).length>=o.minChars){const st=I(Ce).bind(dt=>Nr.getHighlighted(dt).map(Jn.getValue));o.previewing.set(!0);const Ht=dt=>{I(Ce).each(lt=>{st.fold(()=>{o.model.selectsOver&&Nr.highlightFirst(lt)},Zt=>{Nr.highlightBy(lt,Ot=>Jn.getValue(Ot).value===Zt.value),Nr.getHighlighted(lt).orThunk(()=>(Nr.highlightFirst(lt),V.none()))})})};xA(o,M(fe),fe,Ce,b,Ht,od.HighlightJustMenu).get(F)}},cancelEvent:Zg()}),Io.config({mode:"special",onDown:(fe,me)=>(C(fe,me,Nr.highlightFirst),V.some(!0)),onEscape:fe=>{const me=il.getCoupled(fe,"sandbox");return Ks.isOpen(me)?(Ks.close(me),V.some(!0)):V.none()},onUp:(fe,me)=>(C(fe,me,Nr.highlightLast),V.some(!0)),onEnter:fe=>{const me=il.getCoupled(fe,"sandbox"),Ce=Ks.isOpen(me);if(Ce&&!o.previewing.get())return I(me).bind(Ne=>Nr.getHighlighted(Ne)).map(Ne=>(Do(fe,eN(),{item:Ne}),!0));{const Ne=Jn.getValue(fe);return nr(fe,Zg()),o.onExecute(me,fe,Ne),Ce&&Ks.close(me),V.some(!0)}}}),Ms.config({toggleClass:o.markers.openClass,aria:{mode:"expanded"}}),il.config({others:{sandbox:fe=>XR(o,fe,{onOpen:()=>Ms.on(fe),onClose:()=>{o.lazyTypeaheadComp.get().each(me=>We(me.element,"aria-activedescendant")),Ms.off(fe)}})}}),ks(W,[yi(fe=>{o.lazyTypeaheadComp.set(V.some(fe))}),Dd(fe=>{o.lazyTypeaheadComp.set(V.none())}),ou(fe=>{const me=F;YR(o,M(fe),fe,b,me,od.HighlightMenuAndItem).get(F)}),en(eN(),(fe,me)=>{const Ce=il.getCoupled(fe,"sandbox");m4(o.model,fe,me.event.item),nr(fe,Zg()),o.onItemExecute(fe,Ce,me.event.item,Jn.getValue(fe)),Ks.close(Ce),t7(fe)})].concat(o.dismissOnBlur?[en(qm(),fe=>{const me=il.getCoupled(fe,"sandbox");ol(me.element).isNone()&&Ks.close(me)})]:[]))],re={[Ad()]:[Jn.name(),J5.name(),W],...o.eventOrder};return{uid:o.uid,dom:XM(Jr(o,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...x,...Ql(o.typeaheadBehaviours,J)},eventOrder:re}},EG=X([Ar("lazySink"),Qt("fetch"),At("minChars",5),At("responseTime",1e3),Gs("onOpen"),At("getHotspot",V.some),At("getAnchorOverrides",X({})),At("layouts",V.none()),At("eventOrder",{}),eb("model",{},[At("getDisplayText",o=>o.meta!==void 0&&o.meta.text!==void 0?o.meta.text:o.value),At("selectsOver",!0),At("populateFromBrowse",!0)]),Gs("onSetValue"),iu("onExecute"),Gs("onItemExecute"),At("inputClasses",[]),At("inputAttributes",{}),At("inputStyles",{}),At("matchWidth",!0),At("useMinWidth",!1),At("dismissOnBlur",!0),tf(["openClass"]),Ar("initialData"),$l("typeaheadBehaviours",[es,Jn,J5,Io,Ms,il]),_a("lazyTypeaheadComp",()=>$o(V.none)),_a("previewing",()=>$o(!0))].concat(jB()).concat(JR())),AG=X([Sh({schema:[Bv()],name:"menu",overrides:o=>({fakeFocus:!0,onHighlightItem:(c,m,b)=>{o.previewing.get()?o.lazyTypeaheadComp.get().each(C=>{kG(o.model,C,b).fold(()=>{o.model.selectsOver?(Nr.dehighlight(m,b),o.previewing.set(!0)):o.previewing.set(!1)},x=>{x(),o.previewing.set(!1)})}):o.lazyTypeaheadComp.get().each(C=>{o.model.populateFromBrowse&&m4(o.model,C,b),he(b.element,"id").each(x=>Xn(C.element,"aria-activedescendant",x))})},onExecute:(c,m)=>o.lazyTypeaheadComp.get().map(b=>(Do(b,eN(),{item:m}),!0)),onHover:(c,m)=>{o.previewing.set(!1),o.lazyTypeaheadComp.get().each(b=>{o.model.populateFromBrowse&&m4(o.model,b,m)})}})})]),xG=fu({name:"Typeahead",configFields:EG(),partFields:AG(),factory:tN}),Sg=o=>({...o,toCached:()=>Sg(o.toCached()),bindFuture:W=>Sg(o.bind(J=>J.fold(re=>Bu.pure(Cn.error(re)),re=>W(re)))),bindResult:W=>Sg(o.map(J=>J.bind(W))),mapResult:W=>Sg(o.map(J=>J.map(W))),mapError:W=>Sg(o.map(J=>J.mapError(W))),foldResult:(W,J)=>o.map(re=>re.fold(W,J)),withTimeout:(W,J)=>Sg(Bu.nu(re=>{let fe=!1;const me=setTimeout(()=>{fe=!0,re(Cn.error(J()))},W);o.get(Ce=>{fe||(clearTimeout(me),re(Ce))})}))}),o7=o=>Sg(Bu.nu(o)),nN=o=>Sg(Bu.pure(Cn.value(o))),DG={nu:o7,wrap:Sg,pure:nN,value:nN,error:o=>Sg(Bu.pure(Cn.error(o))),fromResult:o=>Sg(Bu.pure(o)),fromFuture:o=>Sg(o.map(Cn.value)),fromPromise:o=>o7(c=>{o.then(m=>{c(Cn.value(m))},m=>{c(Cn.error(m))})})},g4=(o,c,m=[],b,C,x)=>{const M=c.fold(()=>({}),J=>({action:J})),I={buttonBehaviours:Tn([vg.button(()=>!o.enabled||x.isDisabled()),ec(),Ka.config({}),ks("button press",[g2("click"),g2("mousedown")])].concat(m)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...M},W=Jr(I,{dom:b});return Jr(W,{components:C})},s7=(o,c,m,b=[])=>{const C=o.tooltip.map(W=>({"aria-label":m.translate(W),title:m.translate(W)})).getOr({}),x={tag:"button",classes:["tox-tbtn"],attributes:C},M=o.icon.map(W=>H5(W,m.icons)),I=pS([M]);return g4(o,c,b,x,I,m)},oN=o=>{switch(o){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},r7=(o,c,m,b=[],C=[])=>{const x=m.translate(o.text),M=o.icon.map(me=>H5(me,m.icons)),I=[M.getOrThunk(()=>Ni(x))],W=o.buttonType.getOr(!o.primary&&!o.borderless?"secondary":"primary"),fe={tag:"button",classes:[...oN(W),...M.isSome()?["tox-button--icon"]:[],...o.borderless?["tox-button--naked"]:[],...C],attributes:{title:x}};return g4(o,c,b,fe,I,m)},sN=(o,c,m,b=[],C=[])=>{const x=r7(o,V.some(c),m,b,C);return Uc.sketch(x)},i7=(o,c)=>m=>{c==="custom"?Do(m,k0,{name:o,value:{}}):c==="submit"?nr(m,CS):c==="cancel"?nr(m,Ay):console.error("Unknown button type: ",c)},OG=(o,c)=>c==="menu",MG=(o,c)=>c==="custom"||c==="cancel"||c==="submit",a7=(o,c)=>c==="togglebutton",RG=(o,c)=>{var m,b;const C=o.icon.map(lt=>Ry(lt,c.icons)).map(Qr),x=lt=>{Do(lt,k0,{name:o.name,value:{setIcon:Zt=>{C.map(Ot=>Ot.getOpt(lt).each(An=>{ms.set(An,[Ry(Zt,c.icons)])}))}}})},M=o.buttonType.getOr(o.primary?"primary":"secondary"),I={...o,name:(m=o.name)!==null&&m!==void 0?m:"",primary:M==="primary",tooltip:V.from(o.tooltip),enabled:(b=o.enabled)!==null&&b!==void 0?b:!1,borderless:!1},W=I.tooltip.map(lt=>({"aria-label":c.translate(lt),title:c.translate(lt)})).getOr({}),J=oN(M!=null?M:"secondary"),re=o.icon.isSome()&&o.text.isSome(),fe={tag:"button",classes:[...J.concat(o.icon.isSome()?["tox-button--icon"]:[]),...o.active?["tox-button--enabled"]:[],...re?["tox-button--icon-and-text"]:[]],attributes:W},me=[],Ce=c.translate(o.text.getOr("")),Ne=Ni(Ce),Ht=[...pS([C.map(lt=>lt.asSpec())]),...o.text.isSome()?[Ne]:[]],dt=g4(I,V.some(x),me,fe,Ht,c);return Uc.sketch(dt)},p4=(o,c,m)=>{if(OG(o,c)){const b=()=>M,C=o,x={...o,type:"menubutton",search:V.none(),onSetup:I=>(I.setEnabled(o.enabled),F),fetch:ZA(C.items,b,m)},M=Qr(jA(x,"tox-tbtn",m,V.none()));return M.asSpec()}else if(MG(o,c)){const b=i7(o.name,c),C={...o,borderless:!1};return sN(C,b,m.shared.providers,[])}else{if(a7(o,c))return RG(o,m.shared.providers);throw console.error("Unknown footer button type: ",c),new Error("Unknown footer button type")}},NG=(o,c)=>{const m=i7(o.name,"custom");return xL(V.none(),ei.parts.field({factory:Uc,...r7(o,V.some(m),c,[tv(""),wp.self()])}))},l7={type:"separator"},c7=o=>({type:"menuitem",value:o.url,text:o.title,meta:{attach:o.attach},onAction:F}),b4=(o,c)=>({type:"menuitem",value:c,text:o,meta:{attach:void 0},onAction:F}),v4=o=>qe(o,c7),PG=(o,c)=>Zn(c,m=>m.type===o),u7=(o,c)=>v4(PG(o,c)),IG=o=>u7("header",o.targets),BG=o=>u7("anchor",o.targets),f7=o=>V.from(o.anchorTop).map(c=>b4("<top>",c)).toArray(),LG=o=>V.from(o.anchorBottom).map(c=>b4("<bottom>",c)).toArray(),FG=o=>qe(o,c=>b4(c,c)),HG=o=>ao(o,(c,m)=>c.length===0||m.length===0?c.concat(m):c.concat(l7,m),[]),y4=(o,c)=>{const m=o.toLowerCase();return Zn(c,b=>{var C;const x=b.meta!==void 0&&b.meta.text!==void 0?b.meta.text:b.text,M=(C=b.value)!==null&&C!==void 0?C:"";return Vs(x.toLowerCase(),m)||Vs(M.toLowerCase(),m)})},d7=(o,c,m)=>{var b,C;const x=Jn.getValue(c),M=(C=(b=x==null?void 0:x.meta)===null||b===void 0?void 0:b.text)!==null&&C!==void 0?C:x.value;return m.getLinkInformation().fold(()=>[],W=>{const J=y4(M,FG(m.getHistory(o)));return o==="file"?HG([J,y4(M,IG(W)),y4(M,Tt([f7(W),BG(W),LG(W)]))]):J})},h7=ro("aria-invalid"),$G=(o,c,m,b)=>{const C=c.shared.providers,x=lt=>{const Zt=Jn.getValue(lt);m.addToHistory(Zt.value,o.filetype)},M={...b.map(lt=>({initialData:lt})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":h7,type:"url"},minChars:0,responseTime:0,fetch:lt=>{const Zt=d7(o.filetype,lt,m),Ot=TS(Zt,pp.BUBBLE_TO_SANDBOX,c,{isHorizontalMenu:!1,search:V.none()});return Bu.pure(Ot)},getHotspot:lt=>Ne.getOpt(lt),onSetValue:(lt,Zt)=>{lt.hasConfigured(d1)&&d1.run(lt).get(F)},typeaheadBehaviours:Tn([...m.getValidationHandler().map(lt=>d1.config({getRoot:Zt=>bc(Zt.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(Zt,Ot)=>{re.getOpt(Zt).each(An=>{Xn(An.element,"title",C.translate(Ot))})}},validator:{validate:Zt=>{const Ot=Jn.getValue(Zt);return DG.nu(An=>{lt({type:o.filetype,url:Ot.value},mn=>{if(mn.status==="invalid"){const In=Cn.error(mn.message);An(In)}else{const In=Cn.value(mn.message);An(In)}})})},validateOnLoad:!1}})).toArray(),Xo.config({disabled:()=>!o.enabled||C.isDisabled()}),Ka.config({}),ks("urlinput-events",[en(Kh(),lt=>{const Zt=Na(lt.element),Ot=Zt.trim();Ot!==Zt&&Sa(lt.element,Ot),o.filetype==="file"&&Do(lt,xh,{name:o.name})}),en(Wg(),lt=>{Do(lt,xh,{name:o.name}),x(lt)}),en(Gm(),lt=>{Do(lt,xh,{name:o.name}),x(lt)})])]),eventOrder:{[Kh()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:lt=>lt.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:c.shared.getSink,parts:{menu:fS(!1,1,"normal")},onExecute:(lt,Zt,Ot)=>{Do(Zt,CS,{})},onItemExecute:(lt,Zt,Ot,An)=>{x(lt),Do(lt,xh,{name:o.name})}},I=ei.parts.field({...M,factory:xG}),W=o.label.map(lt=>Xb(lt,C)),re=Qr(((lt,Zt,Ot=lt,An=lt)=>gp(Ot,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+lt],attributes:{title:C.translate(An),"aria-live":"polite",...Zt.fold(()=>({}),mn=>({id:mn}))}},C.icons))("invalid",V.some(h7),"warning")),fe=Qr({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[re.asSpec()]}),me=m.getUrlPicker(o.filetype),Ce=ro("browser.url.event"),Ne=Qr({dom:{tag:"div",classes:["tox-control-wrap"]},components:[I,fe.asSpec()],behaviours:Tn([Xo.config({disabled:()=>!o.enabled||C.isDisabled()})])}),st=Qr(sN({name:o.name,icon:V.some("browse"),text:o.label.getOr(""),enabled:o.enabled,primary:!1,buttonType:V.none(),borderless:!0},lt=>nr(lt,Ce),C,[],["tox-browse-url"])),Ht=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Tt([[Ne.asSpec()],me.map(()=>st.asSpec()).toArray()])}),dt=lt=>{sr.getCurrent(lt).each(Zt=>{const Ot=Jn.getValue(Zt),An={fieldname:o.name,...Ot};me.each(mn=>{mn(An).get(In=>{Jn.setValue(Zt,In),Do(lt,xh,{name:o.name})})})})};return ei.sketch({dom:MZ(),components:W.toArray().concat([Ht()]),fieldBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||C.isDisabled(),onDisabled:lt=>{ei.getField(lt).each(Xo.disable),st.getOpt(lt).each(Xo.disable)},onEnabled:lt=>{ei.getField(lt).each(Xo.enable),st.getOpt(lt).each(Xo.enable)}}),ec(),ks("url-input-events",[en(Ce,dt)])])})},m7=(o,c)=>{const m=vB(o.icon,c.icons);return f1.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${o.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:o.url?void 0:m},components:o.url?[Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:m,attributes:{title:c.translate(o.iconTooltip)}},action:b=>Do(b,k0,{name:"alert-banner",value:o.url}),buttonBehaviours:Tn([OM()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:c.translate(o.text)}}]})},zG=(o,c)=>{o.dom.checked=c},VG=o=>o.dom.checked,us=(o,c,m)=>{const b=W=>(W.element.dom.click(),V.some(!0)),C=ei.parts.field({factory:{sketch:we},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Tn([wp.self(),Xo.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:W=>{bc(W.element).each(J=>Ra(J,"tox-checkbox--disabled"))},onEnabled:W=>{bc(W.element).each(J=>ma(J,"tox-checkbox--disabled"))}}),Ka.config({}),es.config({}),dF(m,VG,zG),Io.config({mode:"special",onEnter:b,onSpace:b,stopSpaceKeyup:!0}),ks("checkbox-events",[en(Wg(),(W,J)=>{Do(W,xh,{name:o.name})})])])}),x=ei.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Ni(c.translate(o.label))],behaviours:Tn([MA.config({})])}),M=W=>gp(W==="checked"?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+W]},c.icons),I=Qr({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[M("checked"),M("unchecked")]});return ei.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[C,I.asSpec(),x],fieldBehaviours:Tn([Xo.config({disabled:()=>!o.enabled||c.isDisabled()}),ec()])})},qA=o=>o.presets==="presentation"?f1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:o.html}}):f1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:o.html,attributes:{role:"document"}},containerBehaviours:Tn([Ka.config({}),es.config({})])}),nc=o=>(c,m,b,C)=>ln(m,"name").fold(()=>o(m,C,V.none()),x=>c.field(x,o(m,C,ln(b,x)))),g7=o=>(c,m,b,C)=>{const x=Jr(m,{source:"dynamic"});return nc(o)(c,x,b,C)},p7={bar:nc((o,c)=>kZ(o,c.shared)),collection:nc((o,c,m)=>RZ(o,c.shared.providers,m)),alertbanner:nc((o,c)=>m7(o,c.shared.providers)),input:nc((o,c,m)=>lG(o,c.shared.providers,m)),textarea:nc((o,c,m)=>zF(o,c.shared.providers,m)),label:nc((o,c)=>VA(o,c.shared)),iframe:g7((o,c,m)=>Xq(o,c.shared.providers,m)),button:nc((o,c)=>NG(o,c.shared.providers)),checkbox:nc((o,c,m)=>us(o,c.shared.providers,m)),colorinput:nc((o,c,m)=>HZ(o,c.shared,c.colorinput,m)),colorpicker:nc((o,c,m)=>gF(o,c.shared.providers,m)),dropzone:nc((o,c,m)=>pF(o,c.shared.providers,m)),grid:nc((o,c)=>bF(o,c.shared)),listbox:nc((o,c,m)=>sv(o,c,m)),selectbox:nc((o,c,m)=>U5(o,c.shared.providers,m)),sizeinput:nc((o,c)=>iG(o,c.shared.providers)),slider:nc((o,c,m)=>aG(o,c.shared.providers,m)),urlinput:nc((o,c,m)=>$G(o,c,c.urlinput,m)),customeditor:nc(JT),htmlpanel:nc(qA),imagepreview:nc((o,c,m)=>o4(o,m)),table:nc((o,c)=>c4(o,c.shared.providers)),tree:nc((o,c)=>wG(o,c)),panel:nc((o,c)=>V5(o,c))},b7={field:(o,c)=>c,record:X([])},rN=(o,c,m,b)=>{const C=Jr(b,{shared:{interpreter:x=>v7(o,x,m,C)}});return v7(o,c,m,C)},v7=(o,c,m,b)=>ln(p7,c.type).fold(()=>(console.error(`Unknown factory type "${c.type}", defaulting to container: `,c),c),C=>C(o,c,m,b)),MS=(o,c,m)=>v7(b7,o,c,m),Py="layout-inset",w4=o=>o.x,y7=(o,c)=>o.x+o.width/2-c.width/2,iN=(o,c)=>o.x+o.width-c.width,aN=o=>o.y,_4=(o,c)=>o.y+o.height-c.height,C4=(o,c)=>o.y+o.height/2-c.height/2,GA=(o,c,m)=>ga(iN(o,c),_4(o,c),m.insetSouthwest(),t0(),"southwest",Fl(o,{right:0,bottom:3}),Py),S4=(o,c,m)=>ga(w4(o),_4(o,c),m.insetSoutheast(),nf(),"southeast",Fl(o,{left:1,bottom:3}),Py),KA=(o,c,m)=>ga(iN(o,c),aN(o),m.insetNorthwest(),gh(),"northwest",Fl(o,{right:0,top:2}),Py),YA=(o,c,m)=>ga(w4(o),aN(o),m.insetNortheast(),yb(),"northeast",Fl(o,{left:1,top:2}),Py),_p=(o,c,m)=>ga(y7(o,c),aN(o),m.insetNorth(),Lv(),"north",Fl(o,{top:2}),Py),XA=(o,c,m)=>ga(y7(o,c),_4(o,c),m.insetSouth(),z2(),"south",Fl(o,{bottom:3}),Py),lN=(o,c,m)=>ga(iN(o,c),C4(o,c),m.insetEast(),wb(),"east",Fl(o,{right:0}),Py),w7=(o,c,m)=>ga(w4(o),C4(o,c),m.insetWest(),Fv(),"west",Fl(o,{left:1}),Py),UG=o=>{switch(o){case"north":return _p;case"northeast":return YA;case"northwest":return KA;case"south":return XA;case"southeast":return S4;case"southwest":return GA;case"east":return lN;case"west":return w7}},_7=(o,c,m,b,C)=>uC(b).map(UG).getOr(_p)(o,c,m,b,C),WG=o=>{switch(o){case"north":return XA;case"northeast":return S4;case"northwest":return GA;case"south":return _p;case"southeast":return YA;case"southwest":return KA;case"east":return w7;case"west":return lN}},jG=(o,c,m,b,C)=>uC(b).map(WG).getOr(_p)(o,c,m,b,C),JA={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},ZG=(o,c,m)=>{const C={maxHeightFunction:cg()},x=()=>({type:"node",root:yn(Pt(o())),node:V.from(o()),bubble:ug(12,12,JA),layouts:{onRtl:()=>[YA],onLtr:()=>[KA]},overrides:C}),M=()=>({type:"hotspot",hotspot:c(),bubble:ug(-12,12,JA),layouts:{onRtl:()=>[gl,Kl,Hl],onLtr:()=>[Kl,gl,Hl]},overrides:C});return()=>m()?x():M()},qG=(o,c,m,b)=>{const x={maxHeightFunction:cg()},M=()=>({type:"node",root:yn(Pt(c())),node:V.from(c()),bubble:ug(12,12,JA),layouts:{onRtl:()=>[_p],onLtr:()=>[_p]},overrides:x}),I=()=>o?{type:"node",root:yn(Pt(c())),node:V.from(c()),bubble:ug(0,-Lf(c()),JA),layouts:{onRtl:()=>[Yl],onLtr:()=>[Yl]},overrides:x}:{type:"hotspot",hotspot:m(),bubble:ug(0,0,JA),layouts:{onRtl:()=>[Yl],onLtr:()=>[Yl]},overrides:x};return()=>b()?M():I()},GG=(o,c,m)=>{const b=()=>({type:"node",root:yn(Pt(o())),node:V.from(o()),layouts:{onRtl:()=>[_p],onLtr:()=>[_p]}}),C=()=>({type:"hotspot",hotspot:c(),layouts:{onRtl:()=>[Hl],onLtr:()=>[Hl]}});return()=>m()?b():C()},KG=(o,c)=>()=>({type:"selection",root:c(),getSelection:()=>{const m=o.selection.getRng(),b=o.model.table.getSelectedCells();if(b.length>1){const C=b[0],x=b[b.length-1],M={firstCell:it.fromDom(C),lastCell:it.fromDom(x)};return V.some(M)}return V.some(Tb.range(it.fromDom(m.startContainer),m.startOffset,it.fromDom(m.endContainer),m.endOffset))}}),YG=o=>c=>({type:"node",root:o(),node:c}),C7=(o,c,m,b)=>{const C=cS(o),x=()=>it.fromDom(o.getBody()),M=()=>it.fromDom(o.getContentAreaContainer()),I=()=>C||!b();return{inlineDialog:ZG(M,c,I),inlineBottomDialog:qG(o.inline,M,m,I),banner:GG(M,c,I),cursor:KG(o,x),node:YG(x)}},XG=o=>(c,m)=>{q8(o)(c,m)},JG=o=>()=>U8(o),QG=o=>c=>BR(o,c),eK=o=>c=>LR(o,c),tK=o=>({colorPicker:XG(o),hasCustomColors:JG(o),getColors:QG(o),getColorCols:eK(o)}),nK=o=>()=>UM(o),S7=o=>({isDraggableModal:nK(o)}),oK=o=>{const c=$o(ZM(o)?"bottom":"top");return{isPositionedAtTop:()=>c.get()==="top",getDockingMode:c.get,setDockingMode:c.set}},cN=o=>Li(o,"items"),k7=o=>Li(o,"format"),uN=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],E7=o=>ps(o,"items"),fN=o=>ps(o,"block"),sK=o=>ps(o,"inline"),A7=o=>ps(o,"selector"),dN=o=>ao(o,(c,m)=>{if(E7(m)){const b=dN(m.items);return{customFormats:c.customFormats.concat(b.customFormats),formats:c.formats.concat([{title:m.title,items:b.formats}])}}else if(sK(m)||fN(m)||A7(m)){const C=`custom-${h(m.name)?m.name:m.title.toLowerCase()}`;return{customFormats:c.customFormats.concat([{name:C,format:m}]),formats:c.formats.concat([{title:m.title,format:C,icon:m.icon}])}}else return{...c,formats:c.formats.concat(m)}},{customFormats:[],formats:[]}),rK=(o,c)=>{const m=dN(c),b=C=>{gt(C,x=>{o.formatter.has(x.name)||o.formatter.register(x.name,x.format)})};return o.formatter?b(m.customFormats):o.on("init",()=>{b(m.customFormats)}),m.formats},hN=o=>iS(o).map(c=>{const m=rK(o,c);return lA(o)?uN.concat(m):m}).getOr(uN),iK=o=>{const c=Zs(o);return c.length===1&&ct(c,"title")},x7=(o,c,m)=>({...o,type:"formatter",isSelected:c(o.format),getStylePreview:m(o.format)}),Cp=(o,c,m,b)=>{const C=W=>x7(W,m,b),x=W=>{const J=I(W.items);return{...W,type:"submenu",getStyleItems:X(J)}},M=W=>{const J=h(W.name)?W.name:ro(W.title),re=`custom-${J}`,fe={...W,type:"formatter",format:re,isSelected:m(re),getStylePreview:b(re)};return o.formatter.register(J,fe),fe},I=W=>qe(W,J=>cN(J)?x(J):k7(J)?C(J):iK(J)?{...J,type:"separator"}:M(J));return I(c)},k4=o=>{const c=I=>()=>o.formatter.match(I),m=I=>()=>{const W=o.formatter.get(I);return W!==void 0?V.some({tag:W.length>0&&(W[0].inline||W[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(I))}):V.none()},b=$o([]),C=$o([]),x=$o(!1);return o.on("PreInit",I=>{const W=hN(o),J=Cp(o,W,c,m);b.set(J)}),o.on("addStyleModifications",I=>{const W=Cp(o,I.items,c,m);C.set(W),x.set(I.replace)}),{getData:()=>{const I=x.get()?[]:b.get(),W=C.get();return I.concat(W)}}},E4=o=>j(o)&&o.nodeType===1,aK=nv.trim,A4=o=>c=>!!(E4(c)&&(c.contentEditable===o||c.getAttribute("data-mce-contenteditable")===o)),lK=A4("true"),mN=A4("false"),gN=(o,c,m,b,C)=>({type:o,title:c,url:m,level:b,attach:C}),pN=o=>{let c=o;for(;c=c.parentNode;){const m=c.contentEditable;if(m&&m!=="inherit")return lK(c)}return!1},cK=(o,c)=>qe(lu(it.fromDom(c),o),m=>m.dom),bN=o=>o.innerText||o.textContent,T7=o=>o.id?o.id:ro("h"),vN=o=>o&&o.nodeName==="A"&&(o.id||o.name)!==void 0,uK=o=>vN(o)&&yN(o),D7=o=>o&&/^(H[1-6])$/.test(o.nodeName),yN=o=>pN(o)&&!mN(o),fK=o=>D7(o)&&yN(o),dK=o=>D7(o)?parseInt(o.nodeName.substr(1),10):0,O7=o=>{var c;const m=T7(o),b=()=>{o.id=m};return gN("header",(c=bN(o))!==null&&c!==void 0?c:"","#"+m,dK(o),b)},M7=o=>{const c=o.id||o.name,m=bN(o);return gN("anchor",m||"#"+c,"#"+c,0,F)},hK=o=>qe(Zn(o,fK),O7),mK=o=>qe(Zn(o,uK),M7),gK=o=>cK("h1,h2,h3,h4,h5,h6,a:not([href])",o),pK=o=>aK(o.title).length>0,g1={find:o=>{const c=gK(o);return Zn(hK(c).concat(mK(c)),pK)}},RS="tinymce-url-history",R7=5,N7=o=>h(o)&&/^https?/.test(o),vK=o=>_(o)&&o.length<=R7&&Ut(o,N7),P7=o=>g(o)&&gs(o,c=>!vK(c)).isNone(),I7=()=>{const o=Kb.getItem(RS);if(o===null)return{};let c;try{c=JSON.parse(o)}catch(m){if(m instanceof SyntaxError)return console.log("Local storage "+RS+" was not valid JSON",m),{};throw m}return P7(c)?c:(console.log("Local storage "+RS+" was not valid format",c),{})},B7=o=>{if(!P7(o))throw new Error(`Bad format for history:
|
|
`+JSON.stringify(o));Kb.setItem(RS,JSON.stringify(o))},L7=o=>{const c=I7();return ln(c,o).getOr([])},lre=(o,c)=>{if(!N7(o))return;const m=I7(),b=ln(m,c).getOr([]),C=Zn(b,x=>x!==o);m[c]=[o].concat(C).slice(0,R7),B7(m)},yK=o=>!!o,Lu=o=>Ns(nv.makeMap(o,/[, ]/),yK),QA=o=>V.from(EB(o)),wK=o=>{const c=V.from(VM(o)).filter(yK).map(Lu);return QA(o).fold(Je,m=>c.fold(ft,b=>Zs(b).length>0?b:!1))},x4=(o,c)=>{const m=wK(o);return O(m)?m?QA(o):V.none():m[c]?QA(o):V.none()},_K=(o,c)=>x4(o,c).map(m=>b=>Bu.nu(C=>{const x=(I,W)=>{if(!h(I))throw new Error("Expected value to be string");if(W!==void 0&&!g(W))throw new Error("Expected meta to be a object");C({value:I,meta:W})},M={filetype:c,fieldname:b.fieldname,...V.from(b.meta).getOr({})};m.call(o,x,b.value,M)})),F7=o=>V.from(o).filter(h).getOrUndefined(),CK=o=>TB(o)?V.some({targets:g1.find(o.getBody()),anchorTop:F7(DB(o)),anchorBottom:F7(oT(o))}):V.none(),SK=o=>V.from(AB(o)),kK=o=>({getHistory:L7,addToHistory:lre,getLinkInformation:()=>CK(o),getValidationHandler:()=>SK(o),getUrlPicker:c=>_K(o,c)}),EK=(o,c,m,b)=>{const C=$o(!1),x=oK(c),M={icons:()=>c.ui.registry.getAll().icons,menuItems:()=>c.ui.registry.getAll().menuItems,translate:pm.translate,isDisabled:()=>c.mode.isReadOnly()||!c.ui.isEnabled(),getOption:c.options.get},I=kK(c),W=k4(c),J=tK(c),re=S7(c),fe=()=>C.get(),me=Ht=>C.set(Ht),Ce={shared:{providers:M,anchors:C7(c,m,b,x.isPositionedAtTop),header:x},urlinput:I,styles:W,colorinput:J,dialog:re,isContextMenuOpen:fe,setContextMenuState:me},Ne={...Ce,shared:{...Ce.shared,interpreter:Ht=>MS(Ht,{},Ne),getSink:o.popup}},st={...Ce,shared:{...Ce.shared,interpreter:Ht=>MS(Ht,{},st),getSink:o.dialog}};return{popup:Ne,dialog:st}},AK=(o,c,m)=>{const b=(mn,In)=>{gt([c,...m],Kn=>{Kn.broadcastEvent(mn,In)})},C=(mn,In)=>{gt([c,...m],Kn=>{Kn.broadcastOn([mn],In)})},x=mn=>C(_h(),{target:mn.target}),M=Yd(),I=Sc(M,"touchstart",x),W=Sc(M,"touchmove",mn=>b(nu(),mn)),J=Sc(M,"touchend",mn=>b(Af(),mn)),re=Sc(M,"mousedown",x),fe=Sc(M,"mouseup",mn=>{mn.raw.button===0&&C(EE(),{target:mn.target})}),me=mn=>C(_h(),{target:it.fromDom(mn.target)}),Ce=mn=>{mn.button===0&&C(EE(),{target:it.fromDom(mn.target)})},Ne=()=>{gt(o.editorManager.get(),mn=>{o!==mn&&mn.dispatch("DismissPopups",{relatedTarget:o})})},st=mn=>b(Ym(),sl(mn)),Ht=mn=>{C(p0(),{}),b(ih(),sl(mn))},dt=Pt(it.fromDom(o.getElement())),lt=i0(dt,"scroll",mn=>{requestAnimationFrame(()=>{const In=o.getContainer();if(In!=null){const js=Kw(o,c.element).map(wo=>[wo.element,...wo.others]).getOr([]);an(js,wo=>kr(wo,mn.target))&&(o.dispatch("ElementScroll",{target:mn.target.dom}),b(ah(),mn))}})}),Zt=()=>C(p0(),{}),Ot=mn=>{mn.state&&C(_h(),{target:it.fromDom(o.getContainer())})},An=mn=>{C(_h(),{target:it.fromDom(mn.relatedTarget.getContainer())})};o.on("PostRender",()=>{o.on("click",me),o.on("tap",me),o.on("mouseup",Ce),o.on("mousedown",Ne),o.on("ScrollWindow",st),o.on("ResizeWindow",Ht),o.on("ResizeEditor",Zt),o.on("AfterProgressState",Ot),o.on("DismissPopups",An)}),o.on("remove",()=>{o.off("click",me),o.off("tap",me),o.off("mouseup",Ce),o.off("mousedown",Ne),o.off("ScrollWindow",st),o.off("ResizeWindow",Ht),o.off("ResizeEditor",Zt),o.off("AfterProgressState",Ot),o.off("DismissPopups",An),re.unbind(),I.unbind(),W.unbind(),J.unbind(),fe.unbind(),lt.unbind()}),o.on("detach",()=>{gt([c,...m],wE),gt([c,...m],mn=>mn.destroy())})},kc=zO,p1=Pb,T4=X([At("shell",!1),Qt("makeItem"),At("setupItem",F),dm.field("listBehaviours",[ms])]),H7=Fd({name:"items",overrides:()=>({behaviours:Tn([ms.config({})])})}),xK=X([H7]),$7=X("CustomList"),TK=(o,c,m,b)=>{const C=(I,W)=>{M(I).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},J=>{const re=ms.contents(J),fe=W.length,me=fe-re.length,Ce=me>0?kt(me,()=>o.makeItem()):[],Ne=re.slice(fe);gt(Ne,Ht=>ms.remove(J,Ht)),gt(Ce,Ht=>ms.append(J,Ht));const st=ms.contents(J);gt(st,(Ht,dt)=>{o.setupItem(I,Ht,W[dt],dt)})})},x=o.shell?{behaviours:[ms.config({})],components:[]}:{behaviours:[],components:c},M=I=>o.shell?V.some(I):Ti(I,o,"items");return{uid:o.uid,dom:o.dom,components:x.components,behaviours:Ql(o.listBehaviours,x.behaviours),apis:{setItems:C}}},z7=fu({name:$7(),configFields:T4(),partFields:xK(),factory:TK,apis:{setItems:(o,c,m)=>{o.setItems(c,m)}}}),n_=X([Qt("dom"),At("shell",!0),$l("toolbarBehaviours",[ms])]),ure=X([Fd({name:"groups",overrides:()=>({behaviours:Tn([ms.config({})])})})]),DK=(o,c,m,b)=>{const C=(I,W)=>{x(I).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},J=>{ms.set(J,W)})},x=I=>o.shell?V.some(I):Ti(I,o,"groups"),M=o.shell?{behaviours:[ms.config({})],components:[]}:{behaviours:[],components:c};return{uid:o.uid,dom:o.dom,components:M.components,behaviours:Ql(o.toolbarBehaviours,M.behaviours),apis:{setGroups:C,refresh:F},domModification:{attributes:{role:"group"}}}},b1=fu({name:"Toolbar",configFields:n_(),partFields:ure(),factory:DK,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)}}}),OK=F,V7=Je,D4=X([]);var MK=Object.freeze({__proto__:null,setup:OK,isDocked:V7,getBehaviours:D4});const wN=o=>(ze(Xi(o,"position"),"fixed")?V.none():Bf(o)).orThunk(()=>{const b=it.fromTag("span");return Ha(o).bind(C=>{nl(C,b);const x=Bf(b);return _u(b),x})}),_N=o=>wN(o).map(vc).getOrThunk(()=>fr(0,0)),RK=(o,c)=>{const m=o.element;Ra(m,c.transitionClass),ma(m,c.fadeOutClass),Ra(m,c.fadeInClass),c.onShow(o)},NK=(o,c)=>{const m=o.element;Ra(m,c.transitionClass),ma(m,c.fadeInClass),Ra(m,c.fadeOutClass),c.onHide(o)},PK=(o,c)=>o.y<c.bottom&&o.bottom>c.y,U7=(o,c)=>o.y>=c.y,O4=(o,c)=>o.bottom<=c.bottom,M4=(o,c,m)=>({location:"top",leftX:c,topY:m.bounds.y-o.y}),CN=(o,c,m)=>({location:"bottom",leftX:c,bottomY:o.bottom-m.bounds.bottom}),SN=o=>o.box.x-o.win.x,IK=(o,c,m)=>{const b=c.win,C=c.box,x=SN(c);return Js(o,M=>{switch(M){case"bottom":return O4(C,m.bounds)?V.none():V.some(CN(b,x,m));case"top":return U7(C,m.bounds)?V.none():V.some(M4(b,x,m));default:return V.none()}}).getOr({location:"no-dock"})},BK=(o,c,m)=>Ut(o,b=>{switch(b){case"bottom":return O4(c,m.bounds);case"top":return U7(c,m.bounds)}}),W7=(o,c)=>{const m=c.optScrollEnv.fold(X(o.bounds.y),b=>b.scrollElmTop+(o.bounds.y-b.currentScrollTop));return fr(o.bounds.x,m)},LK=(o,c)=>{const m=c.optScrollEnv.fold(X(o.y),b=>o.y+b.currentScrollTop-b.scrollElmTop);return fr(o.x,m)},NS=(o,c,m)=>m.getInitialPos().map(b=>{const C=W7(b,c);return{box:si(C.left,C.top,Ji(o),Mi(o)),location:b.location}}),j7=(o,c,m,b,C)=>{const x=LK(c,m),M=si(x.left,x.top,c.width,c.height);b.setInitialPos({style:ni(o),position:qr(o,"position")||"static",bounds:M,location:C.location})},R4=(o,c,m,b,C)=>{b.getInitialPos().fold(()=>j7(o,c,m,b,C),()=>F)},Z7=(o,c,m)=>m.getInitialPos().bind(b=>{var C;switch(m.clearInitialPos(),b.position){case"static":return V.some({morph:"static"});case"absolute":const x=wN(o).getOr(Hi()),M=li(x),I=(C=x.dom.scrollTop)!==null&&C!==void 0?C:0;return V.some({morph:"absolute",positionCss:Rd("absolute",ln(b.style,"left").map(W=>c.x-M.x),ln(b.style,"top").map(W=>c.y-M.y+I),ln(b.style,"right").map(W=>M.right-c.right),ln(b.style,"bottom").map(W=>M.bottom-c.bottom))});default:return V.none()}}),kN=(o,c,m)=>NS(o,c,m).filter(({box:b})=>BK(m.getModes(),b,c)).bind(({box:b})=>Z7(o,b,m)),o_=o=>{switch(o.location){case"top":return V.some({morph:"fixed",positionCss:Rd("fixed",V.some(o.leftX),V.some(o.topY),V.none(),V.none())});case"bottom":return V.some({morph:"fixed",positionCss:Rd("fixed",V.some(o.leftX),V.none(),V.none(),V.some(o.bottomY))});default:return V.none()}},q7=(o,c,m)=>{const b=li(o),C=ce(),x=IK(m.getModes(),{win:C,box:b},c);return x.location==="top"||x.location==="bottom"?(j7(o,b,c,m,x),o_(x)):V.none()},FK=(o,c,m)=>kN(o,c,m).orThunk(()=>c.optScrollEnv.bind(b=>NS(o,c,m)).bind(({box:b,location:C})=>{const x=ce(),M=SN({win:x,box:b}),I=C==="top"?M4(x,M,c):CN(x,M,c);return o_(I)})),G7=(o,c,m)=>{const b=o.element;return ze(Xi(b,"position"),"fixed")?FK(b,c,m):q7(b,c,m)},K7=(o,c,m)=>{const b=o.element;return NS(b,c,m).bind(({box:C})=>Z7(b,C,m))},Y7=(o,c,m,b)=>{const C=li(o),x=ce(),M=SN({win:x,box:C}),I=b(x,M,c);return I.location==="bottom"||I.location==="top"?(R4(o,C,c,m,I),o_(I)):V.none()},X7=(o,c,m)=>{m.setDocked(!1),gt(["left","right","top","bottom","position"],b=>Ss(o.element,b)),c.onUndocked(o)},ex=(o,c,m,b)=>{const C=b.position==="fixed";m.setDocked(C),o0(o.element,b),(C?c.onDocked:c.onUndocked)(o)},tx=(o,c,m,b,C=!1)=>{c.contextual.each(x=>{x.lazyContext(o).each(M=>{const I=PK(M,b.bounds);I!==m.isVisible()&&(m.setVisible(I),C&&!I?(tg(o.element,[x.fadeOutClass]),x.onHide(o)):(I?RK:NK)(o,x))})})},J7=(o,c,m,b,C)=>{tx(o,c,m,b,!0),ex(o,c,m,C.positionCss)},HK=(o,c,m,b,C)=>{switch(C.morph){case"static":return X7(o,c,m);case"absolute":return ex(o,c,m,C.positionCss);case"fixed":return J7(o,c,m,b,C)}},PS=(o,c,m)=>{const b=c.lazyViewport(o);tx(o,c,m,b),G7(o,b,m).each(C=>{HK(o,c,m,b,C)})},Q7=(o,c,m)=>{const b=o.element;m.setDocked(!1);const C=c.lazyViewport(o);K7(o,C,m).each(x=>{switch(x.morph){case"static":{X7(o,c,m);break}case"absolute":{ex(o,c,m,x.positionCss);break}}}),m.setVisible(!0),c.contextual.each(x=>{Fc(b,[x.fadeInClass,x.fadeOutClass,x.transitionClass]),x.onShow(o)}),N4(o,c,m)},N4=(o,c,m)=>{o.getSystem().isConnected()&&PS(o,c,m)},EN=(o,c,m)=>{m.isDocked()&&Q7(o,c,m)},P4=o=>(c,m,b)=>{const C=m.lazyViewport(c);Y7(c.element,C,b,o).each(M=>{J7(c,m,b,C,M)})},AN=P4(M4),$K=P4(CN);var zK=Object.freeze({__proto__:null,refresh:N4,reset:EN,isDocked:(o,c,m)=>m.isDocked(),getModes:(o,c,m)=>m.getModes(),setModes:(o,c,m,b)=>m.setModes(b),forceDockToTop:AN,forceDockToBottom:$K}),VK=Object.freeze({__proto__:null,events:(o,c)=>ri([eg(jg(),(m,b)=>{o.contextual.each(C=>{Ju(m.element,C.transitionClass)&&(Fc(m.element,[C.transitionClass,C.fadeInClass]),(c.isVisible()?C.onShown:C.onHidden)(m)),b.stop()})}),en(Ym(),(m,b)=>{N4(m,o,c)}),en(ah(),(m,b)=>{N4(m,o,c)}),en(ih(),(m,b)=>{EN(m,o,c)})])}),UK=[ja("contextual",[Ca("fadeInClass"),Ca("fadeOutClass"),Ca("transitionClass"),Ic("lazyContext"),Gs("onShow"),Gs("onShown"),Gs("onHide"),Gs("onHidden")]),qa("lazyViewport",()=>({bounds:ce(),optScrollEnv:V.none()})),Jc("modes",["top","bottom"],ml),Gs("onDocked"),Gs("onUndocked")],WK=Object.freeze({__proto__:null,init:o=>{const c=$o(!1),m=$o(!0),b=ji(),C=$o(o.modes),x=()=>`docked: ${c.get()}, visible: ${m.get()}, modes: ${C.get().join(",")}`;return su({isDocked:c.get,setDocked:c.set,getInitialPos:b.get,setInitialPos:b.set,clearInitialPos:b.clear,isVisible:m.get,setVisible:m.set,getModes:C.get,setModes:C.set,readState:x})}});const yl=Xl({fields:UK,name:"docking",active:VK,apis:zK,state:WK}),I4=X(ro("toolbar-height-change")),E0={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},IS="tox-tinymce--toolbar-sticky-on",t9="tox-tinymce--toolbar-sticky-off",jK=(o,c)=>{const m=sa(c),C=Oc(c).dom.innerHeight,x=ic(m),M=it.fromDom(o.elm),I=Bl(M),W=Mi(M),J=I.y,re=J+W,fe=vc(c),me=Mi(c),Ce=fe.top,Ne=Ce+me,st=Math.abs(Ce-x.top)<2,Ht=Math.abs(Ne-(x.top+C))<2;if(st&&J<Ne)jh(x.left,J-me,m);else if(Ht&&re>Ce){const dt=J-C+W+me;jh(x.left,dt,m)}},BS=(o,c)=>ct(yl.getModes(o),c),B4=o=>{const c=b=>Lf(b)+(parseInt(qr(b,"margin-top"),10)||0)+(parseInt(qr(b,"margin-bottom"),10)||0),m=o.element;bc(m).each(b=>{const C="padding-"+yl.getModes(o)[0];if(yl.isDocked(o)){const x=Ji(b);so(m,"width",x+"px"),so(b,C,c(m)+"px")}else Ss(m,"width"),Ss(b,C)})},n9=(o,c)=>{c?(ma(o,E0.fadeOutClass),tg(o,[E0.transitionClass,E0.fadeInClass])):(ma(o,E0.fadeInClass),tg(o,[E0.fadeOutClass,E0.transitionClass]))},o9=(o,c)=>{const m=it.fromDom(o.getContainer());c?(Ra(m,IS),ma(m,t9)):(Ra(m,t9),ma(m,IS))},ZK=(o,c)=>{const m=sa(c);Df(m).filter(b=>!kr(c,b)).filter(b=>kr(b,it.fromDom(m.dom.body))||Fa(o,b)).each(()=>of(c))},qK=(o,c)=>ol(o).orThunk(()=>c().toOptional().bind(m=>ol(m.element))),GK=(o,c,m)=>{o.inline||(c.header.isPositionedAtTop()||o.on("ResizeEditor",()=>{m().each(yl.reset)}),o.on("ResizeWindow ResizeEditor",()=>{m().each(B4)}),o.on("SkinLoaded",()=>{m().each(b=>{yl.isDocked(b)?yl.reset(b):yl.refresh(b)})}),o.on("FullscreenStateChanged",()=>{m().each(yl.reset)})),o.on("AfterScrollIntoView",b=>{m().each(C=>{yl.refresh(C);const x=C.element;Nu(x)&&jK(b,x)})}),o.on("PostRender",()=>{o9(o,!1)})},KK=o=>o().map(yl.isDocked).getOr(!1),YK=()=>[Cc.config({channels:{[I4()]:{onReceive:B4}}})],s9=(o,c)=>{const m=ji(),b=c.getSink,C=I=>{b().each(W=>I(W.element))},x=I=>{o.inline||B4(I),o9(o,yl.isDocked(I)),I.getSystem().broadcastOn([p0()],{}),b().each(W=>W.getSystem().broadcastOn([p0()],{}))},M=o.inline?[]:YK();return[es.config({}),yl.config({contextual:{lazyContext:I=>{const W=Lf(I.element),J=o.inline?o.getContentAreaContainer():o.getContainer();return V.from(J).map(re=>{const fe=li(it.fromDom(re));return Kw(o,I.element).fold(()=>{const Ce=fe.height-W,Ne=fe.y+(BS(I,"top")?0:W);return si(fe.x,Ne,fe.width,Ce)},Ce=>{const Ne=Lp(fe,wS(Ce)),st=BS(I,"top")?Ne.y:Ne.y+W;return si(Ne.x,st,Ne.width,Ne.height-W)})})},onShow:()=>{C(I=>n9(I,!0))},onShown:I=>{C(W=>Fc(W,[E0.transitionClass,E0.fadeInClass])),m.get().each(W=>{ZK(I.element,W),m.clear()})},onHide:I=>{qK(I.element,b).fold(m.clear,m.set),C(W=>n9(W,!1))},onHidden:()=>{C(I=>Fc(I,[E0.transitionClass]))},...E0},lazyViewport:I=>Kw(o,I.element).fold(()=>{const J=ce(),re=nT(o),fe=J.y+(BS(I,"top")?re:0),me=J.height-(BS(I,"bottom")?re:0);return{bounds:si(J.x,fe,J.width,me),optScrollEnv:V.none()}},J=>({bounds:wS(J),optScrollEnv:V.some({currentScrollTop:J.element.dom.scrollTop,scrollElmTop:vc(J.element).top})})),modes:[c.header.getDockingMode()],onDocked:x,onUndocked:x}),...M]};var XK=Object.freeze({__proto__:null,setup:GK,isDocked:KK,getBehaviours:s9});const gre=o=>{const c=o.editor,m=o.sticky?s9:D4;return{uid:o.uid,dom:o.dom,components:o.components,behaviours:Tn(m(c,o.sharedBackstage))}},JK=lo([Ol,Gr("items",Qn([eh([pT,Ll("items",ml)]),ml]))].concat(hS)),r9=o=>Ui("GroupToolbarButton",JK,o),i9=[Gl("text"),Gl("tooltip"),Gl("icon"),_c("search",!1,Qn([Eu,lo([Gl("placeholder")])],o=>O(o)?o?V.some({placeholder:V.none()}):V.none():V.some(o))),Ic("fetch"),qa("onSetup",()=>F)],nx=lo([Ol,...i9]),xN=o=>Ui("menubutton",nx,o),QK=lo([Ol,Zb,bg,_y,t8,vT,zw,Au("presets","normal",["normal","color","listpreview"]),yT(1),Eh,sR]),eY=o=>Ui("SplitButton",QK,o);var TN=Vc({factory:(o,c)=>{const m=(C,x)=>{const M=qe(x,I=>{const W={type:"menubutton",text:I.text,fetch:re=>{re(I.getItems())}},J=xN(W).mapError(re=>kd(re)).getOrDie();return jA(J,"tox-mbtn",c.backstage,V.some("menuitem"))});ms.set(C,M)},b={focus:Io.focusIn,setMenus:m};return{uid:o.uid,dom:o.dom,components:[],behaviours:Tn([ms.config({}),ks("menubar-events",[yi(C=>{o.onSetup(C)}),en(Sl(),(C,x)=>{ta(C.element,".tox-mbtn--active").each(M=>{ef(x.event.target,".tox-mbtn").each(I=>{kr(M,I)||C.getSystem().getByDom(M).each(W=>{C.getSystem().getByDom(I).each(J=>{wg.expand(J),wg.close(W),es.focus(J)})})})})}),en(Cv(),(C,x)=>{x.event.prevFocus.bind(M=>C.getSystem().getByDom(M).toOptional()).each(M=>{x.event.newFocus.bind(I=>C.getSystem().getByDom(I).toOptional()).each(I=>{wg.isOpen(M)&&(wg.expand(I),wg.close(M))})})})]),Io.config({mode:"flow",selector:".tox-mbtn",onEscape:C=>(o.onEscape(C),V.some(!0))}),Ka.config({})]),apis:b,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Qt("dom"),Qt("uid"),Qt("onEscape"),Qt("backstage"),At("onSetup",F)],apis:{focus:(o,c)=>{o.focus(c)},setMenus:(o,c,m)=>{o.setMenus(c,m)}}});const tY="\u26A1\uFE0FUpgrade",nY="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_source=TinyMCE&utm_medium=SPAP&utm_campaign=SPAP&utm_id=editorreferral",oY=o=>({uid:o.uid,dom:o.dom,components:[{dom:{tag:"a",attributes:{href:nY,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:tY}}]}),DN="container",a9=[$l("slotBehaviours",[])],l9=o=>"<alloy.field."+o+">",c9=o=>{const c=(()=>{const x=[];return{slot:(I,W)=>(x.push(I),_3(DN,l9(I),W)),record:X(x)}})(),m=o(c),b=c.record(),C=qe(b,x=>zc({name:x,pname:l9(x)}));return UE(DN,a9,C,sY,m)},sY=(o,c)=>{const m=st=>k3(o),b=(st,Ht)=>Ti(st,o,Ht),C=(st,Ht)=>(dt,lt)=>Ti(dt,o,lt).map(Zt=>st(Zt,lt)).getOr(Ht),x=st=>(Ht,dt)=>{gt(dt,lt=>st(Ht,lt))},M=(st,Ht)=>$i(st.element,"aria-hidden")!=="true",I=(st,Ht)=>{if(!M(st)){const dt=st.element;Ss(dt,"display"),We(dt,"aria-hidden"),Do(st,Sv(),{name:Ht,visible:!0})}},W=(st,Ht)=>{if(M(st)){const dt=st.element;so(dt,"display","none"),Xn(dt,"aria-hidden","true"),Do(st,Sv(),{name:Ht,visible:!1})}},J=C(M,!1),re=C(W),fe=x(re),me=st=>fe(st,m()),Ce=C(I),Ne={getSlotNames:m,getSlot:b,isShowing:J,hideSlot:re,hideAllSlots:me,showSlot:Ce};return{uid:o.uid,dom:o.dom,components:c,behaviours:fm(o.slotBehaviours),apis:Ne}},uf={...Ns({getSlotNames:(o,c)=>o.getSlotNames(c),getSlot:(o,c,m)=>o.getSlot(c,m),isShowing:(o,c,m)=>o.isShowing(c,m),hideSlot:(o,c,m)=>o.hideSlot(c,m),hideAllSlots:(o,c)=>o.hideAllSlots(c),showSlot:(o,c,m)=>o.showSlot(c,m)},o=>Qg(o)),sketch:c9},s_=lo([bg,Zb,qa("onShow",F),qa("onHide",F),zw]),u9=o=>Ui("sidebar",s_,o),ox=o=>{const{sidebars:c}=o.ui.registry.getAll();gt(Zs(c),m=>{const b=c[m],C=()=>ze(V.from(o.queryCommandValue("ToggleSidebar")),m);o.ui.registry.addToggleButton(m,{icon:b.icon,tooltip:b.tooltip,onAction:x=>{o.execCommand("ToggleSidebar",!1,m),x.setActive(C())},onSetup:x=>{x.setActive(C());const M=()=>x.setActive(C());return o.on("ToggleSidebar",M),()=>{o.off("ToggleSidebar",M)}}})})},L4=o=>({element:()=>o.element.dom}),f9=(o,c)=>{const m=qe(Zs(c),b=>{const C=c[b],x=ha(u9(C));return{name:b,getApi:L4,onSetup:x.onSetup,onShow:x.onShow,onHide:x.onHide}});return qe(m,b=>{const C=$o(F);return o.slot(b.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:mS.unnamedEvents([qb(b,C),Gb(b,C),en(Sv(),(x,M)=>{const I=M.event;St(m,J=>J.name===I.name).each(J=>{(I.visible?J.onShow:J.onHide)(J.getApi(x))})})])})})},d9=o=>uf.sketch(c=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:f9(c,o),slotBehaviours:mS.unnamedEvents([yi(m=>uf.hideAllSlots(m))])})),h9=(o,c,m)=>{sr.getCurrent(o).each(C=>{ms.set(C,[d9(c)]);const x=m==null?void 0:m.toLowerCase();h(x)&&ps(c,x)&&sr.getCurrent(C).each(M=>{uf.showSlot(M,x),Th.immediateGrow(C),Ss(C.element,"width"),ON(o.element,"region")})})},ON=(o,c)=>{Xn(o,"role",c)},rY=(o,c)=>{sr.getCurrent(o).each(b=>{sr.getCurrent(b).each(x=>{Th.hasGrown(b)?uf.isShowing(x,c)?(Th.shrink(b),ON(o.element,"presentation")):(uf.hideAllSlots(x),uf.showSlot(x,c),ON(o.element,"region")):(uf.hideAllSlots(x),uf.showSlot(x,c),Th.grow(b),ON(o.element,"region"))})})},iY=o=>sr.getCurrent(o).bind(m=>Th.isGrowing(m)||Th.hasGrown(m)?sr.getCurrent(m).bind(x=>St(uf.getSlotNames(x),M=>uf.isShowing(x,M))):V.none()),MN=ro("FixSizeEvent"),RN=ro("AutoSizeEvent"),aY=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Tn([Ka.config({}),es.config({}),Th.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:c=>{sr.getCurrent(c).each(uf.hideAllSlots),nr(c,RN)},onGrown:c=>{nr(c,RN)},onStartGrow:c=>{Do(c,MN,{width:Xi(c.element,"width").getOr("")})},onStartShrink:c=>{Do(c,MN,{width:Ji(c.element)+"px"})}}),ms.config({}),sr.config({find:c=>{const m=ms.contents(c);return ds(m)}})])}],behaviours:Tn([wp.childAt(0),ks("sidebar-sliding-events",[en(MN,(c,m)=>{so(c.element,"width",m.event.width)}),en(RN,(c,m)=>{Ss(c.element,"width")})])])});var lY=Object.freeze({__proto__:null,block:(o,c,m,b)=>{Xn(o.element,"aria-busy",!0);const C=c.getRoot(o).getOr(o),x=Tn([Io.config({mode:"special",onTab:()=>V.some(!0),onShiftTab:()=>V.some(!0)}),es.config({})]),M=b(C,x),I=C.getSystem().build(M);ms.append(C,ru(I)),I.hasConfigured(Io)&&c.focus&&Io.focusIn(I),m.isBlocked()||c.onBlock(o),m.blockWith(()=>ms.remove(C,I))},unblock:(o,c,m)=>{We(o.element,"aria-busy"),m.isBlocked()&&c.onUnblock(o),m.clear()},isBlocked:(o,c,m)=>m.isBlocked()}),cY=[qa("getRoot",V.none),Za("focus",!0),Gs("onBlock"),Gs("onUnblock")],uY=Object.freeze({__proto__:null,init:()=>{const o=ip(),c=m=>{o.set({destroy:m})};return su({readState:o.isSet,blockWith:c,clear:o.clear,isBlocked:o.isSet})}});const Dh=Xl({fields:cY,name:"blocking",apis:lY,state:uY}),p9=o=>{const c=o.dom.attributes!==void 0?o.dom.attributes:[];return ao(c,(m,b)=>b.name==="class"?m:{...m,[b.name]:b.value},{})},fY=o=>Array.prototype.slice.call(o.dom.classList,0),Iy=o=>{const c=it.fromHtml(o),m=Ul(c),b=p9(c),C=fY(c),x=m.length===0?{}:{innerHtml:Vp(c)};return{tag:dl(c),classes:C,attributes:b,...x}},dY=o=>(c,m)=>({dom:{tag:"div",attributes:{"aria-label":o.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Iy('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),b9=o=>sr.getCurrent(o).each(c=>of(c.element)),hY=(o,c)=>{const m="tabindex",b=`data-mce-${m}`;V.from(o.iframeElement).map(it.fromDom).each(C=>{c?(he(C,m).each(x=>Xn(C,b,x)),Xn(C,m,-1)):(We(C,m),he(C,b).each(x=>{Xn(C,m,x),We(C,b)}))})},mY=(o,c,m,b)=>{const C=c.element;if(hY(o,m),m)Dh.block(c,dY(b)),Ss(C,"display"),We(C,"aria-hidden"),o.hasFocus()&&b9(c);else{const x=sr.getCurrent(c).exists(M=>Qp(M.element));Dh.unblock(c),so(C,"display","none"),Xn(C,"aria-hidden","true"),x&&o.focus()}},v9=o=>({uid:o.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Tn([ms.config({}),Dh.config({focus:!1}),sr.config({find:c=>ds(c.components())})]),components:[]}),y9=o=>o.type==="focusin",gY=o=>y9(o)?(o.composed?ds(o.composedPath()):V.from(o.target)).map(it.fromDom).filter(pr).exists(m=>Ju(m,"mce-pastebin")):!1,pY=(o,c,m)=>{const b=$o(!1),C=ji(),x=I=>{b.get()&&!gY(I)&&(I.preventDefault(),b9(c()),o.editorManager.setActive(o))};o.inline||o.on("PreInit",()=>{o.dom.bind(o.getWin(),"focusin",x),o.on("BeforeExecCommand",I=>{I.command.toLowerCase()==="mcefocus"&&I.value!==!0&&x(I)})});const M=I=>{I!==b.get()&&(b.set(I),mY(o,c(),I,m.providers),Dj(o,I))};o.on("ProgressState",I=>{if(C.on(clearTimeout),q(I.time)){const W=Q3.setEditorTimeout(o,()=>M(I.state),I.time);C.set(W)}else M(I.state),C.clear()})},H4=(o,c)=>ao(o,(C,x)=>c(x,C.len).fold(X(C),I=>({len:I.finish,list:C.list.concat([I])})),{len:0,list:[]}).list,LS=(o,c,m)=>({within:o,extra:c,withinWidth:m}),w9=(o,c,m)=>{const b=H4(o,(I,W)=>{const J=m(I);return V.some({element:I,start:W,finish:W+J,width:J})}),C=Zn(b,I=>I.finish<=c),x=Bn(C,(I,W)=>I+W.width,0),M=b.slice(C.length);return{within:C,extra:M,withinWidth:x}},$4=o=>qe(o,c=>c.element),bY=(o,c,m)=>{const b=$4(o.concat(c));return LS(b,[],m)},vY=(o,c,m,b)=>{const C=$4(o).concat([m]);return LS(C,$4(c),b)},NN=(o,c,m)=>LS($4(o),[],m),PN=(o,c,m)=>{const b=w9(c,o,m);return b.extra.length===0?V.some(b):V.none()},yY=(o,c,m,b)=>{const C=PN(o,c,m).getOrThunk(()=>w9(c,o-m(b),m)),x=C.within,M=C.extra,I=C.withinWidth;return M.length===1&&M[0].width<=m(b)?bY(x,M,I):M.length>=1?vY(x,M,b,I):NN(x,M,I)},z4=(o,c)=>{const m=qe(c,b=>ru(b));b1.setGroups(o,m)},wY=o=>Js(o,c=>ol(c.element).bind(m=>c.getSystem().getByDom(m).toOptional())),_9=(o,c,m)=>{const b=c.builtGroups.get();if(b.length===0)return;const C=o1(o,c,"primary"),x=il.getCoupled(o,"overflowGroup");so(C.element,"visibility","hidden");const M=b.concat([x]),I=wY(M);m([]),z4(C,M);const W=Ji(C.element),J=yY(W,c.builtGroups.get(),re=>Ji(re.element),x);J.extra.length===0?(ms.remove(C,x),m([])):(z4(C,J.within),m(J.extra)),Ss(C.element,"visibility"),Kc(C.element),I.each(es.focus)},C9=X([$l("splitToolbarBehaviours",[il]),_a("builtGroups",()=>$o([]))]),_Y=X([tf(["overflowToggledClass"]),zm("getOverflowBounds"),Qt("lazySink"),_a("overflowGroups",()=>$o([])),Gs("onOpened"),Gs("onClosed")].concat(C9())),CY=X([zc({factory:b1,schema:n_(),name:"primary"}),Sh({schema:n_(),name:"overflow"}),Sh({name:"overflow-button"}),Sh({name:"overflow-group"})]),S9=X((o,c)=>{U0(o,Math.floor(c))}),vre=X([tf(["toggledClass"]),Qt("lazySink"),Ic("fetch"),zm("getBounds"),ja("fireDismissalEventInstead",[At("event",Xm())]),yh(),Gs("onToggled")]),k9=X([Sh({name:"button",overrides:o=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Tn([Ms.config({toggleClass:o.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:o.onToggled})])})}),Sh({factory:b1,schema:n_(),name:"toolbar",overrides:o=>({toolbarBehaviours:Tn([Io.config({mode:"cyclic",onEscape:c=>(Ti(c,o,"button").each(es.focus),V.none())})])})})]),V4=ji(),E9=(o,c)=>{V4.set(!0),IN(o,c),V4.clear()},IN=(o,c)=>{const m=il.getCoupled(o,"toolbarSandbox");Ks.isOpen(m)?Ks.close(m):Ks.open(m,c.toolbar())},BN=(o,c,m,b)=>{const C=m.getBounds.map(M=>M()),x=m.lazySink(o).getOrDie();uu.positionWithinBounds(x,c,{anchor:{type:"hotspot",hotspot:o,layouts:b,overrides:{maxWidthFunction:S9()}}},C)},A9=(o,c,m,b,C)=>{b1.setGroups(c,C),BN(o,c,m,b),Ms.on(o)},SY=(o,c,m)=>{const b=I2(),C=(M,I)=>{const W=V4.get().getOr(!1);m.fetch().get(J=>{A9(o,I,m,c.layouts,J),b.link(o.element),W||Io.focusIn(I)})},x=()=>{Ms.off(o),V4.get().getOr(!1)||es.focus(o),b.unlink(o.element)};return{dom:{tag:"div",attributes:{id:b.id}},behaviours:Tn([Io.config({mode:"special",onEscape:M=>(Ks.close(M),V.some(!0))}),Ks.config({onOpen:C,onClose:x,isPartOf:(M,I,W)=>Gp(I,W)||Gp(o,W),getAttachPoint:()=>m.lazySink(o).getOrDie()}),Cc.config({channels:{...ly({isExtraPart:Je,...m.fireDismissalEventInstead.map(M=>({fireEventInstead:{event:M.event}})).getOr({})}),...AE({doReposition:()=>{Ks.getState(il.getCoupled(o,"toolbarSandbox")).each(M=>{BN(o,M,m,c.layouts)})}})}})])}},iv=fu({name:"FloatingToolbarButton",factory:(o,c,m,b)=>({...Uc.sketch({...b.button(),action:C=>{IN(C,b)},buttonBehaviours:dm.augment({dump:b.button().buttonBehaviours},[il.config({others:{toolbarSandbox:C=>SY(C,m,o)}})])}),apis:{setGroups:(C,x)=>{Ks.getState(il.getCoupled(C,"toolbarSandbox")).each(M=>{A9(C,M,o,m.layouts,x)})},reposition:C=>{Ks.getState(il.getCoupled(C,"toolbarSandbox")).each(x=>{BN(C,x,o,m.layouts)})},toggle:C=>{IN(C,b)},toggleWithoutFocusing:C=>{E9(C,b)},getToolbar:C=>Ks.getState(il.getCoupled(C,"toolbarSandbox")),isOpen:C=>Ks.isOpen(il.getCoupled(C,"toolbarSandbox"))}}),configFields:vre(),partFields:k9(),apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},reposition:(o,c)=>{o.reposition(c)},toggle:(o,c)=>{o.toggle(c)},toggleWithoutFocusing:(o,c)=>{o.toggleWithoutFocusing(c)},getToolbar:(o,c)=>o.getToolbar(c),isOpen:(o,c)=>o.isOpen(c)}}),kY=X([Qt("items"),tf(["itemSelector"]),$l("tgroupBehaviours",[Io])]),EY=X([nd({name:"items",unit:"item"})]),AY=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.tgroupBehaviours,[Io.config({mode:"flow",selector:o.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),LN=fu({name:"ToolbarGroup",configFields:kY(),partFields:EY(),factory:AY}),xY=o=>qe(o,c=>ru(c)),FN=(o,c,m)=>{_9(o,m,b=>{m.overflowGroups.set(b),c.getOpt(o).each(C=>{iv.setGroups(C,xY(b))})})},x9=(o,c,m,b)=>{const C=Qr(iv.sketch({fetch:()=>Bu.nu(x=>{x(xY(o.overflowGroups.get()))}),layouts:{onLtr:()=>[Kl,gl],onRtl:()=>[gl,Kl],onBottomLtr:()=>[Fr,Du],onBottomRtl:()=>[Du,Fr]},getBounds:m.getOverflowBounds,lazySink:o.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:o.markers.overflowToggledClass},parts:{button:b["overflow-button"](),toolbar:b.overflow()},onToggled:(x,M)=>o[M?"onOpened":"onClosed"](x)}));return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.splitToolbarBehaviours,[il.config({others:{overflowGroup:()=>LN.sketch({...b["overflow-group"](),items:[C.asSpec()]})}})]),apis:{setGroups:(x,M)=>{o.builtGroups.set(qe(M,x.getSystem().build)),FN(x,C,o)},refresh:x=>FN(x,C,o),toggle:x=>{C.getOpt(x).each(M=>{iv.toggle(M)})},toggleWithoutFocusing:x=>{C.getOpt(x).each(iv.toggleWithoutFocusing)},isOpen:x=>C.getOpt(x).map(iv.isOpen).getOr(!1),reposition:x=>{C.getOpt(x).each(M=>{iv.reposition(M)})},getOverflow:x=>C.getOpt(x).bind(iv.getToolbar)},domModification:{attributes:{role:"group"}}}},T9=fu({name:"SplitFloatingToolbar",configFields:_Y(),partFields:CY(),factory:x9,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},refresh:(o,c)=>{o.refresh(c)},reposition:(o,c)=>{o.reposition(c)},toggle:(o,c)=>{o.toggle(c)},toggleWithoutFocusing:(o,c)=>{o.toggle(c)},isOpen:(o,c)=>o.isOpen(c),getOverflow:(o,c)=>o.getOverflow(c)}}),TY=X([tf(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Gs("onOpened"),Gs("onClosed")].concat(C9())),wm=X([zc({factory:b1,schema:n_(),name:"primary"}),zc({factory:b1,schema:n_(),name:"overflow",overrides:o=>({toolbarBehaviours:Tn([Th.config({dimension:{property:"height"},closedClass:o.markers.closedClass,openClass:o.markers.openClass,shrinkingClass:o.markers.shrinkingClass,growingClass:o.markers.growingClass,onShrunk:c=>{Ti(c,o,"overflow-button").each(m=>{Ms.off(m),es.focus(m)}),o.onClosed(c)},onGrown:c=>{Io.focusIn(c),o.onOpened(c)},onStartGrow:c=>{Ti(c,o,"overflow-button").each(Ms.on)}}),Io.config({mode:"acyclic",onEscape:c=>(Ti(c,o,"overflow-button").each(es.focus),V.some(!0))})])})}),Sh({name:"overflow-button",overrides:o=>({buttonBehaviours:Tn([Ms.config({toggleClass:o.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),Sh({name:"overflow-group"})]),DY=(o,c)=>Ti(o,c,"overflow").map(Th.hasGrown).getOr(!1),HN=(o,c)=>{Ti(o,c,"overflow-button").bind(()=>Ti(o,c,"overflow")).each(m=>{U4(o,c),Th.toggleGrow(m)})},U4=(o,c)=>{Ti(o,c,"overflow").each(m=>{_9(o,c,b=>{const C=qe(b,x=>ru(x));b1.setGroups(m,C)}),Ti(o,c,"overflow-button").each(b=>{Th.hasGrown(m)&&Ms.on(b)}),Th.refresh(m)})},OY=(o,c,m,b)=>{const C="alloy.toolbar.toggle",x=(M,I)=>{const W=qe(I,M.getSystem().build);o.builtGroups.set(W)};return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.splitToolbarBehaviours,[il.config({others:{overflowGroup:M=>LN.sketch({...b["overflow-group"](),items:[Uc.sketch({...b["overflow-button"](),action:I=>{nr(M,C)}})]})}}),ks("toolbar-toggle-events",[en(C,M=>{HN(M,o)})])]),apis:{setGroups:(M,I)=>{x(M,I),U4(M,o)},refresh:M=>U4(M,o),toggle:M=>HN(M,o),isOpen:M=>DY(M,o)},domModification:{attributes:{role:"group"}}}},r_=fu({name:"SplitSlidingToolbar",configFields:TY(),partFields:wm(),factory:OY,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},refresh:(o,c)=>{o.refresh(c)},toggle:(o,c)=>{o.toggle(c)},isOpen:(o,c)=>o.isOpen(c)}}),D9=o=>{const c=o.title.fold(()=>({}),m=>({attributes:{title:m}}));return{dom:{tag:"div",classes:["tox-toolbar__group"],...c},components:[LN.parts.items({})],items:o.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:Tn([Ka.config({}),es.config({})])}},i_=o=>LN.sketch(D9(o)),O9=(o,c)=>{const m=yi(b=>{const C=qe(o.initGroups,i_);b1.setGroups(b,C)});return Tn([vg.toolbarButton(o.providers.isDisabled),ec(),Io.config({mode:c,onEscape:o.onEscape,selector:".tox-toolbar__group"}),ks("toolbar-events",[m])])},rx=o=>{const c=o.cyclicKeying?"cyclic":"acyclic";return{uid:o.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":D9({title:V.none(),items:[]}),"overflow-button":s7({name:"more",icon:V.some("more-drawer"),enabled:!0,tooltip:V.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:V.none(),borderless:!1},V.none(),o.providers)},splitToolbarBehaviours:O9(o,c)}},MY=o=>{const c=rx(o),m=4,b=T9.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return T9.sketch({...c,lazySink:o.getSink,getOverflowBounds:()=>{const C=o.moreDrawerData.lazyHeader().element,x=Bl(C),M=bu(C),I=Bl(M),W=Math.max(M.dom.scrollHeight,I.height);return si(x.x+m,I.y,x.width-m*2,W)},parts:{...c.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:o.attributes}}},components:[b],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:C=>o.onToggled(C,!0),onClosed:C=>o.onToggled(C,!1)})},RY=o=>{const c=r_.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),m=r_.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),b=rx(o);return r_.sketch({...b,components:[c,m],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:C=>{C.getSystem().broadcastOn([I4()],{type:"opened"}),o.onToggled(C,!0)},onClosed:C=>{C.getSystem().broadcastOn([I4()],{type:"closed"}),o.onToggled(C,!1)}})},$d=o=>{const c=o.cyclicKeying?"cyclic":"acyclic";return b1.sketch({uid:o.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(o.type===pg.scrolling?["tox-toolbar--scrolling"]:[])},components:[b1.parts.groups({})],toolbarBehaviours:O9(o,c)})},M9=[_y,bg,Gl("tooltip"),Au("buttonType","secondary",["primary","secondary"]),Za("borderless",!1),Ic("onAction")],W4=[...M9,a1,Ua("type",["button"])],R9=[...M9,Za("active",!1),Ua("type",["togglebutton"])],$N={button:W4,togglebutton:R9},NY=[Ua("type",["group"]),Jc("buttons",[],Cl("type",$N))],N9=Cl("type",{...$N,group:NY}),PY=lo([Jc("buttons",[],N9),Ic("onShow"),Ic("onHide")]),IY=o=>Ui("view",PY,o),BY=(o,c)=>{var m,b;const C=o.type==="togglebutton",x=o.icon.map(Zt=>Ry(Zt,c.icons)).map(Qr),I=(()=>Zt=>{const Ot=In=>{x.map(Kn=>Kn.getOpt(Zt).each(js=>{ms.set(js,[Ry(In,c.icons)])}))},An=In=>{const Kn=Zt.element;In?(Ra(Kn,"tox-button--enabled"),Xn(Kn,"aria-pressed",!0)):(ma(Kn,"tox-button--enabled"),We(Kn,"aria-pressed"))},mn=()=>Ju(Zt.element,"tox-button--enabled");if(C)return o.onAction({setIcon:Ot,setActive:An,isActive:mn});if(o.type==="button")return o.onAction({setIcon:Ot})})(),W={...o,name:C?o.text.getOr(o.icon.getOr("")):(m=o.text)!==null&&m!==void 0?m:o.icon.getOr(""),primary:o.buttonType==="primary",buttonType:V.from(o.buttonType),tooltip:o.tooltip,icon:o.icon,enabled:!0,borderless:o.borderless},J=oN((b=o.buttonType)!==null&&b!==void 0?b:"secondary"),re=C?o.text.map(c.translate):V.some(c.translate(o.text)),fe=re.map(Ni),me=W.tooltip.or(re).map(Zt=>({"aria-label":c.translate(Zt),title:c.translate(Zt)})).getOr({}),Ce=x.map(Zt=>Zt.asSpec()),Ne=pS([Ce,fe]),st=o.icon.isSome()&&fe.isSome(),Ht={tag:"button",classes:J.concat(...o.icon.isSome()&&!st?["tox-button--icon"]:[]).concat(...st?["tox-button--icon-and-text"]:[]).concat(...o.borderless?["tox-button--naked"]:[]).concat(...o.type==="togglebutton"&&o.active?["tox-button--enabled"]:[]),attributes:me},dt=[],lt=g4(W,V.some(I),dt,Ht,Ne,c);return Uc.sketch(lt)},P9=(o,c)=>BY(o,c),LY=(o,c)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:qe(o.buttons,m=>P9(m,c))}),I9=rn().deviceType,FY=I9.isPhone(),B9=I9.isTablet(),L9=o=>{let c=!1;const m=qe(o.buttons,b=>b.type==="group"?(c=!0,LY(b,o.providers)):P9(b,o.providers));return{uid:o.uid,dom:{tag:"div",classes:[c?"tox-view__toolbar":"tox-view__header",...FY||B9?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:Tn([es.config({}),Io.config({mode:"flow",selector:"button, .tox-button",focusInside:i1.OnEnterOrSpaceMode})]),components:c?m:[f1.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),f1.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:m})]}},F9=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-view__pane"]}}),HY=(o,c,m,b)=>{const C={getPane:x=>kc.getPart(x,o,"pane"),getOnShow:x=>o.viewConfig.onShow,getOnHide:x=>o.viewConfig.onHide};return{uid:o.uid,dom:o.dom,components:c,apis:C}};var a_=fu({name:"silver.View",configFields:[Qt("viewConfig")],partFields:[Fd({factory:{sketch:L9},schema:[Qt("buttons"),Qt("providers")],name:"header"}),Fd({factory:{sketch:F9},schema:[],name:"pane"})],factory:HY,apis:{getPane:(o,c)=>o.getPane(c),getOnShow:(o,c)=>o.getOnShow(c),getOnHide:(o,c)=>o.getOnHide(c)}});const H9=(o,c,m)=>na(c,(b,C)=>{const x=ha(IY(b));return o.slot(C,a_.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:x,components:[...x.buttons.length>0?[a_.parts.header({buttons:x.buttons,providers:m})]:[],a_.parts.pane({})]}))}),$9=(o,c)=>uf.sketch(m=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:H9(m,o,c),slotBehaviours:mS.unnamedEvents([yi(b=>uf.hideAllSlots(b))])})),z9=o=>St(uf.getSlotNames(o),c=>uf.isShowing(o,c)),$Y=o=>{const c=o.element;so(c,"display","none"),Xn(c,"aria-hidden","true")},zY=o=>{const c=o.element;Ss(c,"display"),We(c,"aria-hidden")},V9=o=>({getContainer:X(o)}),U9=(o,c,m)=>{uf.getSlot(o,c).each(b=>{a_.getPane(b).each(C=>{m(b)(V9(C.element.dom))})})},VY=(o,c)=>U9(o,c,a_.getOnShow),UY=(o,c)=>U9(o,c,a_.getOnHide);var j4=Vc({factory:(o,c)=>{const x={setViews:(M,I)=>{ms.set(M,[$9(I,c.backstage.shared.providers)])},whichView:M=>sr.getCurrent(M).bind(z9),toggleView:(M,I,W,J)=>sr.getCurrent(M).exists(re=>{const fe=z9(re),me=fe.exists(Ne=>J===Ne),Ce=uf.getSlot(re,J).isSome();return Ce&&(uf.hideAllSlots(re),me?($Y(M),I()):(W(),zY(M),uf.showSlot(re,J),VY(re,J)),fe.each(Ne=>UY(re,Ne))),Ce})};return{uid:o.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Tn([ms.config({}),sr.config({find:M=>{const I=ms.contents(M);return ds(I)}})]),apis:x}},name:"silver.ViewWrapper",configFields:[Qt("backstage")],apis:{setViews:(o,c,m)=>o.setViews(c,m),toggleView:(o,c,m,b,C)=>o.toggleView(c,m,b,C),whichView:(o,c)=>o.whichView(c)}});const WY=(o,c,m)=>{let b=!1;const C={getSocket:x=>kc.getPart(x,o,"socket"),setSidebar:(x,M,I)=>{kc.getPart(x,o,"sidebar").each(W=>h9(W,M,I))},toggleSidebar:(x,M)=>{kc.getPart(x,o,"sidebar").each(I=>rY(I,M))},whichSidebar:x=>kc.getPart(x,o,"sidebar").bind(iY).getOrNull(),getHeader:x=>kc.getPart(x,o,"header"),getToolbar:x=>kc.getPart(x,o,"toolbar"),setToolbar:(x,M)=>{kc.getPart(x,o,"toolbar").each(I=>{const W=qe(M,i_);I.getApis().setGroups(I,W)})},setToolbars:(x,M)=>{kc.getPart(x,o,"multiple-toolbar").each(I=>{const W=qe(M,J=>qe(J,i_));z7.setItems(I,W)})},refreshToolbar:x=>{kc.getPart(x,o,"toolbar").each(I=>I.getApis().refresh(I))},toggleToolbarDrawer:x=>{kc.getPart(x,o,"toolbar").each(M=>{po(M.getApis().toggle,I=>I(M))})},toggleToolbarDrawerWithoutFocusing:x=>{kc.getPart(x,o,"toolbar").each(M=>{po(M.getApis().toggleWithoutFocusing,I=>I(M))})},isToolbarDrawerToggled:x=>kc.getPart(x,o,"toolbar").bind(M=>V.from(M.getApis().isOpen).map(I=>I(M))).getOr(!1),getThrobber:x=>kc.getPart(x,o,"throbber"),focusToolbar:x=>{kc.getPart(x,o,"toolbar").orThunk(()=>kc.getPart(x,o,"multiple-toolbar")).each(I=>{Io.focusIn(I)})},setMenubar:(x,M)=>{kc.getPart(x,o,"menubar").each(I=>{TN.setMenus(I,M)})},focusMenubar:x=>{kc.getPart(x,o,"menubar").each(M=>{TN.focus(M)})},setViews:(x,M)=>{kc.getPart(x,o,"viewWrapper").each(I=>{j4.setViews(I,M)})},toggleView:(x,M)=>kc.getPart(x,o,"viewWrapper").exists(I=>j4.toggleView(I,()=>C.showMainView(x),()=>C.hideMainView(x),M)),whichView:x=>kc.getPart(x,o,"viewWrapper").bind(j4.whichView).getOrNull(),hideMainView:x=>{b=C.isToolbarDrawerToggled(x),b&&C.toggleToolbarDrawer(x),kc.getPart(x,o,"editorContainer").each(M=>{const I=M.element;so(I,"display","none"),Xn(I,"aria-hidden","true")})},showMainView:x=>{b&&C.toggleToolbarDrawer(x),kc.getPart(x,o,"editorContainer").each(M=>{const I=M.element;Ss(I,"display"),We(I,"aria-hidden")})}};return{uid:o.uid,dom:o.dom,components:c,apis:C,behaviours:o.behaviours}},jY=p1.optional({factory:TN,name:"menubar",schema:[Qt("backstage")]}),ZY=o=>o.type===pg.sliding?RY:o.type===pg.floating?MY:$d,qY=p1.optional({factory:{sketch:o=>z7.sketch({uid:o.uid,dom:o.dom,listBehaviours:Tn([Io.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>$d({type:o.type,uid:ro("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:o.providers,onEscape:()=>(o.onEscape(),V.some(!0))}),setupItem:(c,m,b,C)=>{b1.setGroups(m,b)},shell:!0})},name:"multiple-toolbar",schema:[Qt("dom"),Qt("onEscape")]}),GY=p1.optional({factory:{sketch:o=>{const c=ZY(o),m={type:o.type,uid:o.uid,onEscape:()=>(o.onEscape(),V.some(!0)),onToggled:(b,C)=>o.onToolbarToggled(C),cyclicKeying:!1,initGroups:[],getSink:o.getSink,providers:o.providers,moreDrawerData:{lazyToolbar:o.lazyToolbar,lazyMoreButton:o.lazyMoreButton,lazyHeader:o.lazyHeader},attributes:o.attributes};return c(m)}},name:"toolbar",schema:[Qt("dom"),Qt("onEscape"),Qt("getSink")]}),W9=p1.optional({factory:{sketch:gre},name:"header",schema:[Qt("dom")]}),KY=p1.optional({factory:{sketch:oY},name:"promotion",schema:[Qt("dom")]}),YY=p1.optional({name:"socket",schema:[Qt("dom")]}),zN=p1.optional({factory:{sketch:aY},name:"sidebar",schema:[Qt("dom")]}),XY=p1.optional({factory:{sketch:v9},name:"throbber",schema:[Qt("dom")]}),Z4=p1.optional({factory:j4,name:"viewWrapper",schema:[Qt("backstage")]}),JY=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:o.components}),j9=p1.optional({factory:{sketch:JY},name:"editorContainer",schema:[]});var Zi=fu({name:"OuterContainer",factory:WY,configFields:[Qt("dom"),Qt("behaviours")],partFields:[W9,jY,GY,qY,YY,zN,KY,XY,Z4,j9],apis:{getSocket:(o,c)=>o.getSocket(c),setSidebar:(o,c,m,b)=>{o.setSidebar(c,m,b)},toggleSidebar:(o,c,m)=>{o.toggleSidebar(c,m)},whichSidebar:(o,c)=>o.whichSidebar(c),getHeader:(o,c)=>o.getHeader(c),getToolbar:(o,c)=>o.getToolbar(c),setToolbar:(o,c,m)=>{o.setToolbar(c,m)},setToolbars:(o,c,m)=>{o.setToolbars(c,m)},refreshToolbar:(o,c)=>o.refreshToolbar(c),toggleToolbarDrawer:(o,c)=>{o.toggleToolbarDrawer(c)},toggleToolbarDrawerWithoutFocusing:(o,c)=>{o.toggleToolbarDrawerWithoutFocusing(c)},isToolbarDrawerToggled:(o,c)=>o.isToolbarDrawerToggled(c),getThrobber:(o,c)=>o.getThrobber(c),setMenubar:(o,c,m)=>{o.setMenubar(c,m)},focusMenubar:(o,c)=>{o.focusMenubar(c)},focusToolbar:(o,c)=>{o.focusToolbar(c)},setViews:(o,c,m)=>{o.setViews(c,m)},toggleView:(o,c,m)=>o.toggleView(c,m),whichView:(o,c)=>o.whichView(c)}});const QY="file edit view insert format tools table help",eX={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template inserttemplate codesample inserttable accordion | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},tX=(o,c,m)=>{const b=_B(m).split(/[ ,]/);return{text:o.title,getItems:()=>Be(o.items,C=>{const x=C.toLowerCase();return x.trim().length===0?[]:an(b,M=>M===x)?[]:x==="separator"||x==="|"?[{type:"separator"}]:c.menuItems[x]?[c.menuItems[x]]:[]})}},VN=o=>o.split(" "),q4=(o,c)=>{const m={...eX,...c.menus},b=Zs(c.menus).length>0,C=c.menubar===void 0||c.menubar===!0?VN(QY):VN(c.menubar===!1?"":c.menubar),x=Zn(C,I=>{const W=ps(eX,I);return b?W||ln(c.menus,I).exists(J=>ps(J,"items")):W}),M=qe(x,I=>{const W=m[I];return tX({title:W.title,items:VN(W.items)},c,o)});return Zn(M,I=>{const W=J=>h(J)||J.type!=="separator";return I.getItems().length>0&&an(I.getItems(),W)})},Z9=o=>{const c=()=>{o._skinLoaded=!0,Tj(o)};return()=>{o.initialized?c():o.on("init",c)}},G4=(o,c)=>()=>AA(o,{message:c}),UN=(o,c,m)=>(o.on("remove",()=>m.unload(c)),m.load(c)),q9=(o,c)=>{const m=c+"/skin.min.css";return UN(o,m,o.ui.styleSheetLoader)},WN=(o,c)=>{if(Ro(it.fromDom(o.getElement()))){const b=c+"/skin.shadowdom.min.css";return UN(o,b,rA.DOM.styleSheetLoader)}else return Promise.resolve()},G9=(o,c)=>{const m=BB(c);return m&&c.contentCSS.push(m+(o?"/content.inline":"/content")+".min.css"),!sT(c)&&h(m)?Promise.all([q9(c,m),WN(c,m)]).then(Z9(c),G4(c,"Skin could not be loaded")):Promise.resolve(Z9(c)())},K9=Te(G9,!1),FS=Te(G9,!0),Y9=(o,c,m)=>{const b=(I,W,J,re)=>{const fe=c.shared.providers.translate(I.title);if(I.type==="separator")return V.some({type:"separator",text:fe});if(I.type==="submenu"){const me=Be(I.getStyleItems(),Ce=>C(Ce,W,re));return W===0&&me.length<=0?V.none():V.some({type:"nestedmenuitem",text:fe,enabled:me.length>0,getSubmenuItems:()=>Be(I.getStyleItems(),Ce=>C(Ce,W,re))})}else return V.some({type:"togglemenuitem",text:fe,icon:I.icon,active:I.isSelected(re),enabled:!J,onAction:m.onAction(I),...I.getStylePreview().fold(()=>({}),me=>({meta:{style:me}}))})},C=(I,W,J)=>{const re=I.type==="formatter"&&m.isInvalid(I);return W===0?re?[]:b(I,W,!1,J).toArray():b(I,W,re,J).toArray()},x=I=>{const W=m.getCurrentValue(),J=m.shouldHide?0:1;return Be(I,re=>C(re,J,W))};return{validateItems:x,getFetch:(I,W)=>(J,re)=>{const fe=W(),me=x(fe),Ce=TS(me,pp.CLOSE_ON_EXECUTE,I,{isHorizontalMenu:!1,search:V.none()});re(Ce)}}},HS=(o,c,m)=>{const b=m.dataset,C=b.type==="basic"?()=>qe(b.data,x=>x7(x,m.isSelectedFor,m.getPreviewFor)):b.getData;return{items:Y9(o,c,m),getStyleItems:C}},ix=(o,c,m)=>{const{items:b,getStyleItems:C}=HS(o,c,m),x=I=>({getComponent:X(I)}),M=_0(o,"NodeChange",I=>{const W=I.getComponent();m.updateText(W),Xo.set(I.getComponent(),!o.selection.isEditable())});return r4({text:m.icon.isSome()?V.none():m.text,icon:m.icon,tooltip:V.from(m.tooltip),role:V.none(),fetch:b.getFetch(c,C),onSetup:M,getApi:x,columns:1,presets:"normal",classes:m.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",c.shared)},nX=o=>qe(o,c=>{let m=c,b=c;const C=c.split("=");return C.length>1&&(m=C[0],b=C[1]),{title:m,format:b}}),jN=o=>({type:"basic",data:o});var $S;(function(o){o[o.SemiColon=0]="SemiColon",o[o.Space=1]="Space"})($S||($S={}));const oX=(o,c)=>c===$S.SemiColon?o.replace(/;$/,"").split(";"):o.split(" "),K4=(o,c,m)=>{const b=o.options.get(c);return{type:"basic",data:nX(oX(b,m))}},Y4=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],ax=o=>{const c=()=>St(Y4,I=>o.formatter.match(I.format)),m=I=>()=>o.formatter.match(I),b=I=>V.none,C=I=>{const J=c().fold(X("left"),re=>re.title.toLowerCase());Do(I,Ny,{icon:`align-${J}`})},x=jN(Y4),M=I=>()=>St(Y4,W=>W.format===I.format).each(W=>o.execCommand(W.command));return{tooltip:"Align",text:V.none(),icon:V.some("align-left"),isSelectedFor:m,getCurrentValue:V.none,getPreviewFor:b,onAction:M,updateText:C,dataset:x,shouldHide:!1,isInvalid:I=>!o.formatter.canApply(I.format)}},ZN=(o,c)=>ix(o,c,ax(o)),sX=(o,c)=>{const m=HS(o,c,ax(o));o.ui.registry.addNestedMenuItem("align",{text:c.shared.providers.translate("Align"),onSetup:Rf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},X9=(o,c)=>{const m=c(),b=qe(m,C=>C.format);return V.from(o.formatter.closest(b)).bind(C=>St(m,x=>x.format===C)).orThunk(()=>un(o.formatter.match("p"),{title:"Paragraph",format:"p"}))},qN=o=>{const c="Paragraph",m=M=>()=>o.formatter.match(M),b=M=>()=>{const I=o.formatter.get(M);return I?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(M))}):V.none()},C=M=>{const W=X9(o,()=>x.data).fold(X(c),J=>J.title);Do(M,Cg,{text:W})},x=K4(o,"block_formats",$S.SemiColon);return{tooltip:"Blocks",text:V.some(c),icon:V.none(),isSelectedFor:m,getCurrentValue:V.none,getPreviewFor:b,onAction:OR(o),updateText:C,dataset:x,shouldHide:!1,isInvalid:M=>!o.formatter.canApply(M.format)}},rX=(o,c)=>ix(o,c,qN(o)),iX=(o,c)=>{const m=HS(o,c,qN(o));o.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:Rf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},aX=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],GN=o=>{const c=o.split(/\s*,\s*/);return qe(c,m=>m.replace(/^['"]+|['"]+$/g,""))},lX=o=>{const c=()=>{const m=GN(o.toLowerCase());return Ut(aX,b=>m.indexOf(b.toLowerCase())>-1)};return o.indexOf("-apple-system")===0&&c()},J9=o=>{const c="System Font",m=()=>{const J=Ne=>Ne?GN(Ne)[0]:"",re=o.queryCommandValue("FontName"),fe=W.data,me=re?re.toLowerCase():"";return{matchOpt:St(fe,Ne=>{const st=Ne.format;return st.toLowerCase()===me||J(st).toLowerCase()===J(me).toLowerCase()}).orThunk(()=>un(lX(me),{title:c,format:me})),font:re}},b=J=>re=>re.exists(fe=>fe.format===J),C=()=>{const{matchOpt:J}=m();return J},x=J=>()=>V.some({tag:"div",styles:J.indexOf("dings")===-1?{"font-family":J}:{}}),M=J=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("FontName",!1,J.format)})},I=J=>{const{matchOpt:re,font:fe}=m(),me=re.fold(X(fe),Ce=>Ce.title);Do(J,Cg,{text:me})},W=K4(o,"font_family_formats",$S.SemiColon);return{tooltip:"Fonts",text:V.some(c),icon:V.none(),isSelectedFor:b,getCurrentValue:C,getPreviewFor:x,onAction:M,updateText:I,dataset:W,shouldHide:!1,isInvalid:Je}},KN=(o,c)=>ix(o,c,J9(o)),cX=(o,c)=>{const m=HS(o,c,J9(o));o.ui.registry.addNestedMenuItem("fontfamily",{text:c.shared.providers.translate("Fonts"),onSetup:Rf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},uX={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Q9=(()=>{const o="[0-9]+",m="[eE]"+("[+-]?"+o),b="\\.",C=I=>`(?:${I})?`,M=`[+-]?(?:${["Infinity",o+b+C(o)+C(m),b+o+C(m),o+C(m)].join("|")})`;return new RegExp(`^(${M})(.*)$`)})(),fX=(o,c)=>an(c,m=>an(uX[m],b=>o===b)),lx=(o,c)=>V.from(Q9.exec(o)).bind(b=>{const C=Number(b[1]),x=b[2];return fX(x,c)?V.some({value:C,unit:x}):V.none()}),dX=(o,c)=>lx(o,c).map(({value:m,unit:b})=>m+b),YN={tab:X(9),escape:X(27),enter:X(13),backspace:X(8),delete:X(46),left:X(37),up:X(38),right:X(39),down:X(40),space:X(32),home:X(36),end:X(35),pageUp:X(33),pageDown:X(34)},hX=(o,c,m)=>{let b=V.none();const C=lt=>lt.map(Zt=>Jn.getValue(Zt)).getOr(""),x=_0(o,"NodeChange SwitchMode",lt=>{const Zt=lt.getComponent();b=V.some(Zt),m.updateInputValue(Zt),Xo.set(Zt,!o.selection.isEditable())}),M=lt=>({getComponent:X(lt)}),I=$o(F),W=ro("custom-number-input-events"),J=(lt,Zt,Ot)=>{const An=C(b),mn=m.getNewValue(An,lt),In=An.length-`${mn}`.length,Kn=b.map(wo=>wo.element.dom.selectionStart-In),js=b.map(wo=>wo.element.dom.selectionEnd-In);m.onAction(mn,Ot),b.each(wo=>{Jn.setValue(wo,mn),Zt&&(Kn.each(_s=>wo.element.dom.selectionStart=_s),js.each(_s=>wo.element.dom.selectionEnd=_s))})},re=(lt,Zt)=>J((Ot,An)=>Ot-An,lt,Zt),fe=(lt,Zt)=>J((Ot,An)=>Ot+An,lt,Zt),me=lt=>bc(lt.element).fold(V.none,Zt=>(of(Zt),V.some(!0))),Ce=lt=>Qp(lt.element)?(pf(lt.element).each(Zt=>of(Zt)),V.some(!0)):V.none(),Ne=(lt,Zt,Ot,An)=>{const mn=c.shared.providers.translate(Ot),In=ro("altExecuting"),Kn=_0(o,"NodeChange SwitchMode",wo=>{Xo.set(wo.getComponent(),!o.selection.isEditable())}),js=wo=>{Xo.isDisabled(wo)||lt(!0)};return Uc.sketch({dom:{tag:"button",attributes:{title:mn,"aria-label":mn},classes:An.concat(Zt)},components:[H5(Zt,c.shared.providers.icons)],buttonBehaviours:Tn([Xo.config({}),ks(In,[qb({onSetup:Kn,getApi:M},I),Gb({getApi:M},I),en(Ef(),(wo,_s)=>{(_s.event.raw.keyCode===YN.space()||_s.event.raw.keyCode===YN.enter())&&(Xo.isDisabled(wo)||lt(!1))}),en(Yh(),js),en(jm(),js)])]),eventOrder:{[Ef()]:[In,"keying"],[Yh()]:[In,"alloy.base.behaviour"],[jm()]:[In,"alloy.base.behaviour"]}})},st=Qr(Ne(lt=>re(!1,lt),"minus","Decrease font size",["highlight-on-focus"])),Ht=Qr(Ne(lt=>fe(!1,lt),"plus","Increase font size",["highlight-on-focus"])),dt=Qr({dom:{tag:"div",classes:["tox-input-wrapper","highlight-on-focus"]},components:[Hw.sketch({inputBehaviours:Tn([Xo.config({}),ks(W,[qb({onSetup:x,getApi:M},I),Gb({getApi:M},I)]),ks("input-update-display-text",[en(Cg,(lt,Zt)=>{Jn.setValue(lt,Zt.event.text)}),en(tu(),lt=>{m.onAction(Jn.getValue(lt))}),en(Wg(),lt=>{m.onAction(Jn.getValue(lt))})]),Io.config({mode:"special",onEnter:lt=>(J(we,!0,!0),V.some(!0)),onEscape:me,onUp:lt=>(fe(!0,!1),V.some(!0)),onDown:lt=>(re(!0,!1),V.some(!0)),onLeft:(lt,Zt)=>(Zt.cut(),V.none()),onRight:(lt,Zt)=>(Zt.cut(),V.none())})])})],behaviours:Tn([es.config({}),Io.config({mode:"special",onEnter:Ce,onSpace:Ce,onEscape:me}),ks("input-wrapper-events",[en(Sl(),lt=>{gt([st,Ht],Zt=>{const Ot=it.fromDom(Zt.get(lt).element.dom);Qp(Ot)&&zv(Ot)})})])])});return{dom:{tag:"div",classes:["tox-number-input"]},components:[st.asSpec(),dt.asSpec(),Ht.asSpec()],behaviours:Tn([es.config({}),Io.config({mode:"flow",focusInside:i1.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:lt=>Qp(lt.element)?V.none():(of(lt.element),V.some(!0))})])}},mX={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},gX={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},eH=(o,c)=>{const m=Math.pow(10,c);return Math.round(o*m)/m},pX=(o,c)=>/[0-9.]+px$/.test(o)?eH(parseInt(o,10)*72/96,c||0)+"pt":ln(gX,o).getOr(o),bX=o=>ln(mX,o).getOr(""),tH=o=>{const c=()=>{let W=V.none();const J=I.data,re=o.queryCommandValue("FontSize");if(re)for(let fe=3;W.isNone()&&fe>=0;fe--){const me=pX(re,fe),Ce=bX(me);W=St(J,Ne=>Ne.format===re||Ne.format===me||Ne.format===Ce)}return{matchOpt:W,size:re}},m=W=>J=>J.exists(re=>re.format===W),b=()=>{const{matchOpt:W}=c();return W},C=X(V.none),x=W=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("FontSize",!1,W.format)})},M=W=>{const{matchOpt:J,size:re}=c(),fe=J.fold(X(re),me=>me.title);Do(W,Cg,{text:fe})},I=K4(o,"font_size_formats",$S.Space);return{tooltip:"Font sizes",text:V.some("12pt"),icon:V.none(),isSelectedFor:m,getPreviewFor:C,getCurrentValue:b,onAction:x,updateText:M,dataset:I,shouldHide:!1,isInvalid:Je}},XN=(o,c)=>ix(o,c,tH(o)),JN=o=>{var c;const m={step:1};return(c={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[o])!==null&&c!==void 0?c:m},vX=16,yX=o=>o>=0,wX=o=>{const c=()=>o.queryCommandValue("FontSize");return{updateInputValue:b=>Do(b,Cg,{text:c()}),onAction:(b,C)=>o.execCommand("FontSize",!1,b,{skip_focus:!C}),getNewValue:(b,C)=>{lx(b,["unsupportedLength","empty"]);const x=lx(b,["unsupportedLength","empty"]).or(lx(c(),["unsupportedLength","empty"])),M=x.map(re=>re.value).getOr(vX),I=xB(o),W=x.map(re=>re.unit).filter(re=>re!=="").getOr(I),J=C(M,JN(W).step);return`${yX(J)?J:M}${W}`}}},_X=(o,c)=>hX(o,c,wX(o)),CX=(o,c)=>{const m=HS(o,c,tH(o));o.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:Rf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},nH=(o,c)=>{const m="Paragraph",b=M=>()=>o.formatter.match(M),C=M=>()=>{const I=o.formatter.get(M);return I!==void 0?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(M))}):V.none()},x=M=>{const I=fe=>cN(fe)?Be(fe.items,I):k7(fe)?[{title:fe.title,format:fe.format}]:[],W=Be(hN(o),I),re=X9(o,X(W)).fold(X(m),fe=>fe.title);Do(M,Cg,{text:re})};return{tooltip:"Formats",text:V.some(m),icon:V.none(),isSelectedFor:b,getCurrentValue:V.none,getPreviewFor:C,onAction:OR(o),updateText:x,shouldHide:LM(o),isInvalid:M=>!o.formatter.canApply(M.format),dataset:c}},SX=(o,c)=>{const m={type:"advanced",...c.styles};return ix(o,c,nH(o,m))},kX=(o,c)=>{const m={type:"advanced",...c.styles},b=HS(o,c,nH(o,m));o.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:Rf(o),getSubmenuItems:()=>b.items.validateItems(b.getStyleItems())})},EX=X([Qt("toggleClass"),Qt("fetch"),rg("onExecute"),At("getHotspot",V.some),At("getAnchorOverrides",X({})),yh(),rg("onItemExecute"),Ar("lazySink"),Qt("dom"),Gs("onOpen"),$l("splitDropdownBehaviours",[il,Io,es]),At("matchWidth",!1),At("useMinWidth",!1),At("eventOrder",{}),Ar("role")].concat(JR())),oH=zc({factory:Uc,schema:[Qt("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Tn([es.revoke()])}),overrides:o=>({dom:{tag:"span",attributes:{role:"presentation"}},action:c=>{c.getSystem().getByUid(o.uid).each(lh)},buttonBehaviours:Tn([Ms.config({toggleOnExecute:!1,toggleClass:o.toggleClass})])})}),X4=zc({factory:Uc,schema:[Qt("dom")],name:"button",defaults:()=>({buttonBehaviours:Tn([es.revoke()])}),overrides:o=>({dom:{tag:"span",attributes:{role:"presentation"}},action:c=>{c.getSystem().getByUid(o.uid).each(m=>{o.onExecute(m,c)})}})}),QN=X([oH,X4,Fd({factory:{sketch:o=>({uid:o.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:o.text}})},schema:[Qt("text")],name:"aria-descriptor"}),Sh({schema:[Bv()],name:"menu",defaults:o=>({onExecute:(c,m)=>{c.getSystem().getByUid(o.uid).each(b=>{o.onItemExecute(b,c,m)})}})}),iL()]),sH=(o,c,m,b)=>{const C=re=>{sr.getCurrent(re).each(fe=>{Nr.highlightFirst(fe),Io.focusIn(fe)})},x=re=>{YR(o,we,re,b,C,od.HighlightMenuAndItem).get(F)},M=re=>(x(re),V.some(!0)),I=re=>{const fe=o1(re,o,"button");return lh(fe),V.some(!0)},W={...ri([yi((re,fe)=>{Ti(re,o,"aria-descriptor").each(Ce=>{const Ne=ro("aria");Xn(Ce.element,"id",Ne),Xn(re.element,"aria-describedby",Ne)})})]),...q3(V.some(x))},J={repositionMenus:re=>{Ms.isOn(re)&&dL(re)}};return{uid:o.uid,dom:o.dom,components:c,apis:J,eventOrder:{...o.eventOrder,[Ku()]:["disabling","toggling","alloy.base.behaviour"]},events:W,behaviours:Ql(o.splitDropdownBehaviours,[il.config({others:{sandbox:re=>{const fe=o1(re,o,"arrow");return XR(o,re,{onOpen:()=>{Ms.on(fe),Ms.on(re)},onClose:()=>{Ms.off(fe),Ms.off(re)}})}}}),Io.config({mode:"special",onSpace:I,onEnter:I,onDown:M}),es.config({}),Ms.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},v1=fu({name:"SplitDropdown",configFields:EX(),partFields:QN(),factory:sH,apis:{repositionMenus:(o,c)=>o.repositionMenus(c)}}),e6=o=>({isEnabled:()=>!Xo.isDisabled(o),setEnabled:c=>Xo.set(o,!c),setText:c=>Do(o,Cg,{text:c}),setIcon:c=>Do(o,Ny,{icon:c})}),AX=o=>({setActive:c=>{Ms.set(o,c)},isActive:()=>Ms.isOn(o),isEnabled:()=>!Xo.isDisabled(o),setEnabled:c=>Xo.set(o,!c),setText:c=>Do(o,Cg,{text:c}),setIcon:c=>Do(o,Ny,{icon:c})}),rH=(o,c)=>o.map(m=>({"aria-label":c.translate(m),title:c.translate(m)})).getOr({}),iH=ro("focus-button"),t6=(o,c,m,b,C)=>{const x=c.map(I=>Qr(DF(I,"tox-tbtn",C))),M=o.map(I=>Qr(Ry(I,C.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(c.isSome()?["tox-tbtn--select"]:[]),attributes:rH(m,C)},components:pS([M.map(I=>I.asSpec()),x.map(I=>I.asSpec())]),eventOrder:{[Br()]:["focusing","alloy.base.behaviour",My],[xu()]:[My,"toolbar-group-button-events"]},buttonBehaviours:Tn([vg.toolbarButton(C.isDisabled),ec(),ks(My,[yi((I,W)=>s4(I)),en(Cg,(I,W)=>{x.bind(J=>J.getOpt(I)).each(J=>{ms.set(J,[Ni(C.translate(W.event.text))])})}),en(Ny,(I,W)=>{M.bind(J=>J.getOpt(I)).each(J=>{ms.set(J,[Ry(W.event.icon,C.icons)])})}),en(Br(),(I,W)=>{W.event.prevent(),nr(I,iH)})])].concat(b.getOr([])))}},xX=(o,c,m,b)=>{const C=c.shared,x=$o(F),M={toolbarButtonBehaviours:[],getApi:e6,onSetup:o.onSetup},I=[ks("toolbar-group-button-events",[qb(M,x),Gb(M,x)])];return iv.sketch({lazySink:C.getSink,fetch:()=>Bu.nu(W=>{W(qe(m(o.items),i_))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:t6(o.icon,o.text,o.tooltip,V.some(I),C.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:b}}}})},aH=(o,c,m)=>{var b;const C=$o(F),x=t6(o.icon,o.text,o.tooltip,V.none(),m);return Uc.sketch({dom:x.dom,components:x.components,eventOrder:F5,buttonBehaviours:{...Tn([ks("toolbar-button-events",[xF({onAction:o.onAction,getApi:c.getApi}),qb(c,C),Gb(c,C)]),vg.toolbarButton(()=>!o.enabled||m.isDisabled()),ec()].concat(c.toolbarButtonBehaviours)),[My]:(b=x.buttonBehaviours)===null||b===void 0?void 0:b[My]}})},TX=(o,c)=>n6(o,c,[]),n6=(o,c,m)=>aH(o,{toolbarButtonBehaviours:m.length>0?[ks("toolbarButtonWith",m)]:[],getApi:e6,onSetup:o.onSetup},c),DX=(o,c)=>lH(o,c,[]),lH=(o,c,m)=>aH(o,{toolbarButtonBehaviours:[ms.config({}),Ms.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(m.length>0?[ks("toolbarToggleButtonWith",m)]:[]),getApi:AX,onSetup:o.onSetup},c),o6=(o,c,m)=>b=>Bu.nu(C=>c.fetch(C)).map(C=>V.from(o5(Jr(MT(ro("menu-value"),C,x=>{c.onItemAction(o(b),x)},c.columns,c.presets,pp.CLOSE_ON_EXECUTE,c.select.getOr(Je),m),{movement:RT(c.columns,c.presets),menuBehaviours:mS.unnamedEvents(c.columns!=="auto"?[]:[yi((x,M)=>{vR(x,4,WB(c.presets)).each(({numRows:I,numColumns:W})=>{Io.setGridSize(x,I,W)})})])})))),OX=(o,c)=>{const m=x=>({isEnabled:()=>!Xo.isDisabled(x),setEnabled:M=>Xo.set(x,!M),setIconFill:(M,I)=>{ta(x.element,`svg path[class="${M}"], rect[class="${M}"]`).each(W=>{Xn(W,"fill",I)})},setActive:M=>{Xn(x.element,"aria-pressed",M),ta(x.element,"span").each(I=>{x.getSystem().getByDom(I).each(W=>Ms.set(W,M))})},isActive:()=>ta(x.element,"span").exists(M=>x.getSystem().getByDom(M).exists(Ms.isOn)),setText:M=>ta(x.element,"span").each(I=>x.getSystem().getByDom(I).each(W=>Do(W,Cg,{text:M}))),setIcon:M=>ta(x.element,"span").each(I=>x.getSystem().getByDom(I).each(W=>Do(W,Ny,{icon:M})))}),b=$o(F),C={getApi:m,onSetup:o.onSetup};return v1.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...rH(o.tooltip,c.providers)}},onExecute:x=>{const M=m(x);M.isEnabled()&&o.onAction(M)},onItemExecute:(x,M,I)=>{},splitDropdownBehaviours:Tn([vg.splitButton(c.providers.isDisabled),ec(),ks("split-dropdown-events",[yi((x,M)=>s4(x)),en(iH,es.focus),qb(C,b),Gb(C,b)]),MA.config({})]),eventOrder:{[xu()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:c.getSink,fetch:o6(m,o,c.providers),parts:{menu:fS(!1,o.columns,o.presets)},components:[v1.parts.button(t6(o.icon,o.text,V.none(),V.some([Ms.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),c.providers)),v1.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:vB("chevron-down",c.providers.icons)},buttonBehaviours:Tn([vg.splitButton(c.providers.isDisabled),ec(),OM()])}),v1.parts["aria-descriptor"]({text:c.providers.translate("To open the popup, press Shift+Enter")})]})},MX=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],cx=(o,c)=>(m,b,C)=>{const x=o(m).mapError(M=>kd(M)).getOrDie();return c(x,b,C)},RX={button:cx(cR,(o,c)=>TX(o,c.shared.providers)),togglebutton:cx(uR,(o,c)=>DX(o,c.shared.providers)),menubutton:cx(xN,(o,c)=>jA(o,"tox-tbtn",c,V.none(),!1)),splitbutton:cx(eY,(o,c)=>OX(o,c.shared)),grouptoolbarbutton:cx(r9,(o,c,m)=>{const b=m.ui.registry.getAll().buttons,C=M=>J4(m,{buttons:b,toolbar:M,allowToolbarGroups:!1},c,V.none()),x={[Eb]:c.shared.header.isPositionedAtTop()?vh.TopToBottom:vh.BottomToTop};switch(aS(m)){case pg.floating:return xX(o,c,C,x);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})},NX=(o,c,m)=>ln(RX,o.type).fold(()=>(console.error("skipping button defined by",o),V.none()),b=>V.some(b(o,c,m))),cH={styles:SX,fontsize:XN,fontsizeinput:_X,fontfamily:KN,blocks:rX,align:ZN},uH=o=>{const c=qe(MX,m=>{const b=Zn(m.items,C=>ps(o,C)||ps(cH,C));return{name:m.name,items:b}});return Zn(c,m=>m.items.length>0)},fH=o=>{const c=o.split("|");return qe(c,m=>({items:m.trim().split(" ")}))},dH=o=>ee(o,c=>ps(c,"name")&&ps(c,"items")),PX=o=>{const c=o.toolbar,m=o.buttons;return c===!1?[]:c===void 0||c===!0?uH(m):h(c)?fH(c):dH(c)?c:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},hH=(o,c,m,b,C,x)=>ln(c,m.toLowerCase()).orThunk(()=>x.bind(M=>Js(M,I=>ln(c,I+m.toLowerCase())))).fold(()=>ln(cH,m.toLowerCase()).map(M=>M(o,C)),M=>M.type==="grouptoolbarbutton"&&!b?(console.warn(`Ignoring the '${m}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),V.none()):NX(M,C,o)),J4=(o,c,m,b)=>{const C=PX(c),x=qe(C,M=>{const I=Be(M.items,W=>W.trim().length===0?[]:hH(o,c.buttons,W,c.allowToolbarGroups,m,b).toArray());return{title:V.from(o.translate(M.name)),items:I}});return Zn(x,M=>M.items.length>0)},mH=(o,c,m,b)=>{const C=c.mainUi.outerContainer,x=m.toolbar,M=m.buttons;if(ee(x,h)){const I=x.map(W=>{const J={toolbar:W,buttons:M,allowToolbarGroups:m.allowToolbarGroups};return J4(o,J,b,V.none())});Zi.setToolbars(C,I)}else Zi.setToolbar(C,J4(o,m,b,V.none()))},gH=rn(),pH=gH.os.isiOS()&&gH.os.version.major<=12,IX=(o,c)=>{const{uiMotherships:m}=c,b=o.dom;let C=o.getWin();const x=o.getDoc().documentElement,M=$o(fr(C.innerWidth,C.innerHeight)),I=$o(fr(x.offsetWidth,x.offsetHeight)),W=()=>{const me=M.get();(me.left!==C.innerWidth||me.top!==C.innerHeight)&&(M.set(fr(C.innerWidth,C.innerHeight)),TR(o))},J=()=>{const me=o.getDoc().documentElement,Ce=I.get();(Ce.left!==me.offsetWidth||Ce.top!==me.offsetHeight)&&(I.set(fr(me.offsetWidth,me.offsetHeight)),TR(o))},re=me=>{Ey(o,me)};b.bind(C,"resize",W),b.bind(C,"scroll",re);const fe=i0(it.fromDom(o.getBody()),"load",J);o.on("hide",()=>{gt(m,me=>{so(me.element,"display","none")})}),o.on("show",()=>{gt(m,me=>{Ss(me.element,"display")})}),o.on("NodeChange",J),o.on("remove",()=>{fe.unbind(),b.unbind(C,"resize",W),b.unbind(C,"scroll",re),C=null})},bH=(o,c,m)=>{y0(o)&&hw(m.mainUi.mothership.element,m.popupUi.mothership),ay(c,m.dialogUi.mothership)};var BX=Object.freeze({__proto__:null,render:async(o,c,m,b,C)=>{const{mainUi:x,uiMotherships:M}=c,I=$o(0),W=x.outerContainer;await K9(o);const J=it.fromDom(C.targetNode),re=yn(Pt(J));hw(J,x.mothership),bH(o,re,c),o.on("PostRender",()=>{Zi.setSidebar(W,m.sidebar,NB(o)),mH(o,c,m,b),I.set(o.getWin().innerWidth),Zi.setMenubar(W,q4(o,m)),Zi.setViews(W,m.views),IX(o,c)});const fe=Zi.getSocket(W).getOrDie("Could not find expected socket element");if(pH){gi(fe.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const st=vF(()=>{o.dispatch("ScrollContent")},20),Ht=Sc(fe.element,"scroll",st.throttle);o.on("remove",Ht.unbind)}_8(o,c),o.addCommand("ToggleSidebar",(st,Ht)=>{Zi.toggleSidebar(W,Ht),o.dispatch("ToggleSidebar")}),o.addQueryValueHandler("ToggleSidebar",()=>{var st;return(st=Zi.whichSidebar(W))!==null&&st!==void 0?st:""}),o.addCommand("ToggleView",(st,Ht)=>{if(Zi.toggleView(W,Ht)){const dt=W.element;x.mothership.broadcastOn([_h()],{target:dt}),gt(M,lt=>{lt.broadcastOn([_h()],{target:dt})}),A(Zi.whichView(W))&&(o.focus(),o.nodeChanged(),Zi.refreshToolbar(W))}}),o.addQueryValueHandler("ToggleView",()=>{var st;return(st=Zi.whichView(W))!==null&&st!==void 0?st:""});const me=aS(o),Ce=()=>{Zi.refreshToolbar(c.mainUi.outerContainer)};(me===pg.sliding||me===pg.floating)&&o.on("ResizeWindow ResizeEditor ResizeContent",()=>{const st=o.getWin().innerWidth;st!==I.get()&&(Ce(),I.set(st))});const Ne={setEnabled:st=>{Ww(c,!st)},isEnabled:()=>!Xo.isDisabled(W)};return{iframeContainer:fe.element.dom,editorContainer:W.element.dom,api:Ne}}});const s6=o=>/^[0-9\.]+(|px)$/i.test(""+o)?V.some(parseInt(""+o,10)):V.none(),r6=o=>q(o)?o+"px":o,Q4=(o,c,m)=>{const b=c.filter(x=>o<x),C=m.filter(x=>o>x);return b.or(C).getOr(o)},LX=o=>{const c=tT(o),m=IM(o),b=BM(o);return s6(c).map(C=>Q4(C,m,b))},FX=o=>LX(o).getOr(tT(o)),i6=o=>{const c=PM(o),m=aA(o),b=rS(o);return s6(c).map(C=>Q4(C,m,b))},HX=o=>i6(o).getOr(PM(o)),{ToolbarLocation:a6,ToolbarMode:vH}=CW,$X=40,zX=(o,c,m,b,C)=>{const{mainUi:x,uiMotherships:M}=m,I=rA.DOM,W=cS(o),J=hA(o),re=rS(o).or(i6(o)),fe=b.shared.header,me=fe.isPositionedAtTop,Ce=aS(o),Ne=Ce===vH.sliding||Ce===vH.floating,st=$o(!1),Ht=()=>st.get()&&!o.removed,dt=Ho=>Ne?Ho.fold(X(0),ir=>ir.components().length>1?Mi(ir.components()[1].element):0):0,lt=Ho=>{switch(HM(o)){case a6.auto:const ir=Zi.getToolbar(x.outerContainer),Hn=dt(ir),bo=Mi(Ho.element)-Hn,ls=li(c);if(ls.y>bo)return"top";{const Vo=bu(c),bs=Math.max(Vo.dom.scrollHeight,Mi(Vo));return ls.bottom<bs-bo||ce().bottom<ls.bottom-bo?"bottom":"top"}case a6.bottom:return"bottom";case a6.top:default:return"top"}},Zt=Ho=>{C.on(ir=>{yl.setModes(ir,[Ho]),fe.setDockingMode(Ho);const Hn=me()?vh.TopToBottom:vh.BottomToTop;Xn(ir.element,Eb,Hn)})},Ot=()=>{C.on(Ho=>{const ir=re.getOrThunk(()=>{const Hn=s6(qr(Hi(),"margin-left")).getOr(0);return Ji(Hi())-vc(c).left+Hn});so(Ho.element,"max-width",ir+"px")})},An=Ho=>{C.on(ir=>{const Hn=Zi.getToolbar(x.outerContainer),bo=dt(Hn),ls=li(c),{top:Xs,left:Vo}=mn(o,x.outerContainer.element).fold(()=>({top:me()?Math.max(ls.y-Mi(ir.element)+bo,0):ls.bottom,left:ls.x}),$r=>{var ff;const pa=li($r),Ud=(ff=$r.dom.scrollTop)!==null&&ff!==void 0?ff:0,Sp=kr($r,Hi()),Vy=Sp?Math.max(ls.y-Mi(ir.element)+bo,0):ls.y-pa.y+Ud-Mi(ir.element)+bo;return{top:me()?Vy:ls.bottom,left:Sp?ls.x:ls.x-pa.x}}),bs={position:"absolute",left:Math.round(Vo)+"px",top:Math.round(Xs)+"px"},Di=Ho.map($r=>{const ff=ic(),pa=150,Ud=window.innerWidth-(Vo-ff.left);return{width:Math.max(Math.min($r,Ud),pa)+"px"}}).getOr({});gi(x.outerContainer.element,{...bs,...Di})})},mn=(Ho,ir)=>y0(Ho)?wN(ir):V.none(),In=()=>{gt(M,Ho=>{Ho.broadcastOn([p0()],{})})},Kn=()=>{if(W)return V.none();if(vc(x.outerContainer.element).left+$a(x.outerContainer.element)>=window.innerWidth-$X||Xi(x.outerContainer.element,"width").isSome()){so(x.outerContainer.element,"position","absolute"),so(x.outerContainer.element,"left","0px"),Ss(x.outerContainer.element,"width");const ir=$a(x.outerContainer.element);return V.some(ir)}else return V.none()},js=Ho=>{if(!Ht())return;W||Ot();const ir=W?V.none():Kn();Ne&&Zi.refreshToolbar(x.outerContainer),W||An(ir),J&&C.on(Ho),In()},wo=()=>W||!J||!Ht()?!1:C.get().exists(Ho=>{const ir=fe.getDockingMode(),Hn=lt(Ho);return Hn!==ir?(Zt(Hn),!0):!1});return{isVisible:Ht,isPositionedAtTop:me,show:()=>{st.set(!0),so(x.outerContainer.element,"display","flex"),I.addClass(o.getBody(),"mce-edit-focus"),gt(M,Ho=>{Ss(Ho.element,"display")}),wo(),y0(o)?js(Ho=>yl.isDocked(Ho)?yl.reset(Ho):yl.refresh(Ho)):js(yl.refresh)},hide:()=>{st.set(!1),so(x.outerContainer.element,"display","none"),I.removeClass(o.getBody(),"mce-edit-focus"),gt(M,Ho=>{so(Ho.element,"display","none")})},update:js,updateMode:()=>{wo()&&js(yl.reset)},repositionPopups:In}},yH=(o,c)=>{const m=li(o);return{pos:c?m.y:m.bottom,bounds:m}},VX=(o,c,m,b)=>{const C=$o(yH(c,m.isPositionedAtTop())),x=J=>{const{pos:re,bounds:fe}=yH(c,m.isPositionedAtTop()),{pos:me,bounds:Ce}=C.get(),Ne=fe.height!==Ce.height||fe.width!==Ce.width;C.set({pos:re,bounds:fe}),Ne&&TR(o,J),m.isVisible()&&(me!==re?m.update(yl.reset):Ne&&(m.updateMode(),m.repositionPopups()))};b||(o.on("activate",m.show),o.on("deactivate",m.hide)),o.on("SkinLoaded ResizeWindow",()=>m.update(yl.reset)),o.on("NodeChange keydown",J=>{requestAnimationFrame(()=>x(J))});let M=0;const I=cf(()=>m.update(yl.refresh),33);o.on("ScrollWindow",()=>{const J=ic().left;J!==M&&(M=J,I.throttle()),m.updateMode()}),y0(o)&&o.on("ElementScroll",J=>{m.update(yl.refresh)});const W=r0();W.set(i0(it.fromDom(o.getBody()),"load",J=>x(J.raw))),o.on("remove",()=>{W.clear()})};var WX=Object.freeze({__proto__:null,render:async(o,c,m,b,C)=>{const{mainUi:x}=c,M=ji(),I=it.fromDom(C.targetNode),W=zX(o,I,c,b,M),J=zM(o);await FS(o);const re=()=>{if(M.isSet()){W.show();return}M.set(Zi.getHeader(x.outerContainer).getOrDie());const me=iT(o);y0(o)?(hw(I,x.mothership),hw(I,c.popupUi.mothership)):ay(me,x.mothership),ay(me,c.dialogUi.mothership),mH(o,c,m,b),Zi.setMenubar(x.outerContainer,q4(o,m)),W.show(),VX(o,I,W,J),o.nodeChanged()};o.on("show",re),o.on("hide",W.hide),J||(o.on("focus",re),o.on("blur",W.hide)),o.on("init",()=>{(o.hasFocus()||J)&&re()}),_8(o,c);const fe={show:re,hide:W.hide,setEnabled:me=>{Ww(c,!me)},isEnabled:()=>!Xo.isDisabled(x.outerContainer)};return{editorContainer:x.outerContainer.element.dom,api:fe}}});const jX=()=>{const o=ji(),c=ji(),m=ji();return{dialogUi:o,popupUi:c,mainUi:m,getUiMotherships:()=>{const x=o.get().map(I=>I.mothership),M=c.get().map(I=>I.mothership);return x.fold(()=>M.toArray(),I=>M.fold(()=>[I],W=>kr(I.element,W.element)?[I]:[I,W]))},lazyGetInOuterOrDie:(x,M)=>()=>m.get().bind(I=>M(I.outerContainer)).getOrDie(`Could not find ${x} element in OuterContainer`)}},wH="contexttoolbar-show",_H="contexttoolbar-hide",CH=o=>({hide:()=>nr(o,Ma()),getValue:()=>Jn.getValue(o)}),l6=(o,c)=>en(xS,(m,b)=>{const C=o.get(m),x=CH(C);c.onAction(x,b.event.buttonApi)}),ZX=(o,c,m)=>{const{primary:b,...C}=c.original,x=ha(cR({...C,type:"button",onAction:F}));return n6(x,m,[l6(o,c)])},qX=(o,c,m)=>{const{primary:b,...C}=c.original,x=ha(uR({...C,type:"togglebutton",onAction:F}));return lH(x,m,[l6(o,c)])},GX=o=>o.type==="contextformtogglebutton",zS=(o,c,m)=>GX(c)?qX(o,c,m):ZX(o,c,m),KX=(o,c,m)=>{const b=qe(c,M=>Qr(zS(o,M,m)));return{asSpecs:()=>qe(b,M=>M.asSpec()),findPrimary:M=>Js(c,(I,W)=>I.primary?V.from(b[W]).bind(J=>J.getOpt(M)).filter(_e(Xo.isDisabled)):V.none())}},SH=(o,c)=>{const m=o.label.fold(()=>({}),x=>({"aria-label":x})),b=Qr(Hw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:o.initValue(),inputAttributes:m,selectOnFocus:!0,inputBehaviours:Tn([Io.config({mode:"special",onEnter:x=>C.findPrimary(x).map(M=>(lh(M),!0)),onLeft:(x,M)=>(M.cut(),V.none()),onRight:(x,M)=>(M.cut(),V.none())})])})),C=KX(b,o.commands,c);return[{title:V.none(),items:[b.asSpec()]},{title:V.none(),items:C.asSpecs()}]},YX={renderContextForm:(o,c,m)=>$d({type:o,uid:ro("context-toolbar"),initGroups:SH(c,m),onEscape:V.none,cyclicKeying:!0,providers:m}),buildInitGroups:SH},kH=(o,c,m)=>c.bottom-o.y>=m&&o.bottom-c.y>=m,XX=o=>{const c=o.getBoundingClientRect();if(c.height<=0&&c.width<=0){const m=pd(it.fromDom(o.startContainer),o.startOffset).element;return(Qa(m)?Ha(m):V.some(m)).filter(pr).map(C=>C.dom.getBoundingClientRect()).getOr(c)}else return c},c6=o=>{const c=o.selection.getRng(),m=XX(c);if(o.inline){const b=ic();return si(b.left+m.left,b.top+m.top,m.width,m.height)}else{const b=Bl(it.fromDom(o.getBody()));return si(b.x+m.left,b.y+m.top,m.width,m.height)}},JX=(o,c)=>c.filter(m=>qs(m)&&gu(m)).map(Bl).getOrThunk(()=>c6(o)),u6=(o,c,m)=>{const b=Math.max(o.x+m,c.x),C=Math.min(o.right-m,c.right);return{x:b,width:C-b}},QX=(o,c,m,b,C,x)=>{const M=it.fromDom(o.getContainer()),I=ta(M,".tox-editor-header").getOr(M),W=li(I),J=W.y>=c.bottom,re=b&&!J;if(o.inline&&re)return{y:Math.max(W.bottom+x,m.y),bottom:m.bottom};if(o.inline&&!re)return{y:m.y,bottom:Math.min(W.y-x,m.bottom)};const fe=C==="line"?li(M):c;return re?{y:Math.max(W.bottom+x,m.y),bottom:Math.min(fe.bottom-x,m.bottom)}:{y:Math.max(fe.y+x,m.y),bottom:Math.min(W.y-x,m.bottom)}},EH=(o,c,m,b=0)=>{const C=Fg(window),x=li(it.fromDom(o.getContentAreaContainer())),M=lS(o)||rT(o)||dA(o),{x:I,width:W}=u6(x,C,b);if(o.inline&&!M)return si(I,C.y,W,C.height);{const J=c.header.isPositionedAtTop(),{y:re,bottom:fe}=QX(o,x,C,J,m,b);return si(I,re,W,fe-re)}},ux=12,f6={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},AH={maxHeightFunction:cg(),maxWidthFunction:S9()},eJ=(o,c)=>{const m=o.selection.getRng(),b=pd(it.fromDom(m.startContainer),m.startOffset);return m.startContainer===m.endContainer&&m.startOffset===m.endOffset-1&&kr(b.element,c)},tJ=(o,c,m)=>{const b=Xi(o,"position");so(o,"position",c);const C=m(o);return b.each(x=>so(o,"position",x)),C},xH=o=>o==="node",nJ=(o,c,m,b,C)=>{const x=c6(o),M=b.lastElement().exists(I=>kr(m,I));if(eJ(o,m))return M?_7:_p;if(M)return tJ(c,b.getMode(),()=>kH(x,li(c),-20)&&!b.isReposition()?jG:_7);{const I=b.getMode()==="fixed"?C.y+ic().top:C.y,W=Mi(c)+ux;return I+W<=x.y?_p:XA}},oJ=(o,c,m,b)=>{const C=W=>(J,re,fe,me,Ce)=>{const Ne=nJ(o,me,W,m,Ce),st={...J,y:Ce.y,height:Ce.height};return{...Ne(st,re,fe,me,Ce),alwaysFit:!0}},x=W=>xH(b)?[C(W)]:[];return c?{onLtr:W=>[Hl,gl,Kl,Du,Fr,Yl].concat(x(W)),onRtl:W=>[Hl,Kl,gl,Fr,Du,Yl].concat(x(W))}:{onLtr:W=>[Yl,Hl,Du,gl,Fr,Kl].concat(x(W)),onRtl:W=>[Yl,Hl,Fr,Kl,Du,gl].concat(x(W))}},TH=(o,c,m,b)=>c==="line"?{bubble:ug(ux,0,f6),layouts:{onLtr:()=>[sm],onRtl:()=>[yr]},overrides:AH}:{bubble:ug(0,ux,f6,1/ux),layouts:oJ(o,m,b,c),overrides:AH},d6=(o,c)=>{const m=Zn(c,x=>x.predicate(o.dom)),{pass:b,fail:C}=No(m,x=>x.type==="contexttoolbar");return{contextToolbars:b,contextForms:C}},sJ=o=>{if(o.length<=1)return o;{const c=x=>an(o,M=>M.position===x),m=x=>Zn(o,M=>M.position===x),b=c("selection"),C=c("node");if(b||C)if(C&&b){const x=m("node"),M=qe(m("selection"),I=>({...I,position:"node"}));return x.concat(M)}else return m(b?"selection":"node");else return m("line")}},rJ=o=>{if(o.length<=1)return o;{const c=b=>St(o,C=>C.position===b);return c("selection").orThunk(()=>c("node")).orThunk(()=>c("line")).map(b=>b.position).fold(()=>[],b=>Zn(o,C=>C.position===b))}},iJ=(o,c,m)=>{const b=d6(o,c);if(b.contextForms.length>0)return V.some({elem:o,toolbars:[b.contextForms[0]]});{const C=d6(o,m);if(C.contextForms.length>0)return V.some({elem:o,toolbars:[C.contextForms[0]]});if(b.contextToolbars.length>0||C.contextToolbars.length>0){const x=sJ(b.contextToolbars.concat(C.contextToolbars));return V.some({elem:o,toolbars:x})}else return V.none()}},eD=(o,c,m)=>o(c)?V.none():Bc(c,b=>{if(pr(b)){const{contextToolbars:C,contextForms:x}=d6(b,m.inNodeScope),M=x.length>0?x:rJ(C);return M.length>0?V.some({elem:b,toolbars:M}):V.none()}else return V.none()},o),aJ=(o,c)=>{const m=it.fromDom(c.getBody()),b=M=>kr(M,m),C=M=>!b(M)&&!Fa(m,M),x=it.fromDom(c.selection.getNode());return C(x)?V.none():iJ(x,o.inNodeScope,o.inEditorScope).orThunk(()=>eD(b,x,o))},tD=(o,c)=>{const m={},b=[],C=[],x={},M={},I=(re,fe)=>{const me=ha(l8(fe));m[re]=me,me.launch.map(Ce=>{x["form:"+re]={...fe.launch,type:Ce.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{c(me)}}}),me.scope==="editor"?C.push(me):b.push(me),M[re]=me},W=(re,fe)=>{tj(fe).each(me=>{fe.scope==="editor"?C.push(me):b.push(me),M[re]=me})},J=Zs(o);return gt(J,re=>{const fe=o[re];fe.type==="contextform"?I(re,fe):fe.type==="contexttoolbar"&&W(re,fe)}),{forms:m,inNodeScope:b,inEditorScope:C,lookupTable:M,formNavigators:x}},fx=ro("forward-slide"),h6=ro("backward-slide"),m6=ro("change-slide-event"),g6="tox-pop--resizing",lJ=o=>{const c=$o([]);return Pa.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:m=>{c.set([]),Pa.getContent(m).each(b=>{Ss(b.element,"visibility")}),ma(m.element,g6),Ss(m.element,"width")},inlineBehaviours:Tn([ks("context-toolbar-events",[eg(jg(),(m,b)=>{b.event.raw.propertyName==="width"&&(ma(m.element,g6),Ss(m.element,"width"))}),en(m6,(m,b)=>{const C=m.element;Ss(C,"width");const x=Ji(C);Pa.setContent(m,b.event.contents),Ra(C,g6);const M=Ji(C);so(C,"width",x+"px"),Pa.getContent(m).each(I=>{b.event.focus.bind(W=>(of(W),ol(C))).orThunk(()=>(Io.focusIn(I),Df(Pt(C))))}),setTimeout(()=>{so(m.element,"width",M+"px")},0)}),en(fx,(m,b)=>{Pa.getContent(m).each(C=>{c.set(c.get().concat([{bar:C,focus:Df(Pt(m.element))}]))}),Do(m,m6,{contents:b.event.forwardContents,focus:V.none()})}),en(h6,(m,b)=>{Or(c.get()).each(C=>{c.set(c.get().slice(0,c.get().length-1)),Do(m,m6,{contents:ru(C.bar),focus:C.focus})})})]),Io.config({mode:"special",onEscape:m=>Or(c.get()).fold(()=>o.onEscape(),b=>(nr(m,h6),V.some(!0)))})]),lazySink:()=>Cn.value(o.sink)})},p6="tox-pop--transition",cJ=(o,c,m,b)=>{const C=b.backstage,x=C.shared,M=rn().deviceType.isTouch,I=ji(),W=ji(),J=ji(),re=uc(lJ({sink:m,onEscape:()=>(o.focus(),V.some(!0))})),fe=()=>{const wo=J.get().getOr("node"),_s=xH(wo)?1:0;return EH(o,x,wo,_s)},me=()=>!o.removed&&!(M()&&C.isContextMenuOpen()),Ce=wo=>ze(qn(wo,I.get(),kr),!0),Ne=()=>{if(me()){const wo=fe(),_s=ze(J.get(),"node")?JX(o,I.get()):c6(o);return wo.height<=0||!kH(_s,wo,.01)}else return!0},st=()=>{I.clear(),W.clear(),J.clear(),Pa.hide(re)},Ht=()=>{if(Pa.isOpen(re)){const wo=re.element;Ss(wo,"display"),Ne()?so(wo,"display","none"):(W.set(0),Pa.reposition(re))}},dt=wo=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[wo],behaviours:Tn([Io.config({mode:"acyclic"}),ks("pop-dialog-wrap-events",[yi(_s=>{o.shortcuts.add("ctrl+F9","focus statusbar",()=>Io.focusIn(_s))}),Dd(_s=>{o.shortcuts.remove("ctrl+F9")})])])}),lt=xi(()=>tD(c,wo=>{const _s=An([wo]);Do(re,fx,{forwardContents:dt(_s)})})),Zt=(wo,_s)=>J4(o,{buttons:wo,toolbar:_s.items,allowToolbarGroups:!1},b.backstage,V.some(["form:"])),Ot=(wo,_s)=>YX.buildInitGroups(wo,_s),An=wo=>{const{buttons:_s}=o.ui.registry.getAll(),fs=lt(),hr={..._s,...fs.formNavigators},Ho=aS(o)===pg.scrolling?pg.scrolling:pg.default,ir=Tt(qe(wo,Hn=>Hn.type==="contexttoolbar"?Zt(hr,Hn):Ot(Hn,x.providers)));return $d({type:Ho,uid:ro("context-toolbar"),initGroups:ir,onEscape:V.none,cyclicKeying:!0,providers:x.providers})},mn=(wo,_s)=>{const fs=wo==="node"?x.anchors.node(_s):x.anchors.cursor(),hr=TH(o,wo,M(),{lastElement:I.get,isReposition:()=>ze(W.get(),0),getMode:()=>uu.getMode(m)});return Jr(fs,hr)},In=(wo,_s)=>{if(js.cancel(),!me())return;const fs=An(wo),hr=wo[0].position,Ho=mn(hr,_s);J.set(hr),W.set(1);const ir=re.element;Ss(ir,"display"),Ce(_s)||(ma(ir,p6),uu.reset(m,re)),Pa.showWithinBounds(re,dt(fs),{anchor:Ho,transition:{classes:[p6],mode:"placement"}},()=>V.some(fe())),_s.fold(I.clear,I.set),Ne()&&so(ir,"display","none")};let Kn=!1;const js=cf(()=>{if(!(!o.hasFocus()||o.removed||Kn))if(Ju(re.element,p6))js.throttle();else{const wo=lt();aJ(wo,o).fold(st,_s=>{In(_s.toolbars,V.some(_s.elem))})}},17);o.on("init",()=>{o.on("remove",st),o.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",Ht),o.on("click keyup focus SetContent",js.throttle),o.on(_H,st),o.on(wH,wo=>{const _s=lt();ln(_s.lookupTable,wo.toolbarKey).each(fs=>{In([fs],un(wo.target!==o,wo.target)),Pa.getContent(re).each(Io.focusIn)})}),o.on("focusout",wo=>{Q3.setEditorTimeout(o,()=>{ol(m.element).isNone()&&ol(re.element).isNone()&&st()},0)}),o.on("SwitchMode",()=>{o.mode.isReadOnly()&&st()}),o.on("AfterProgressState",wo=>{wo.state?st():o.hasFocus()&&js.throttle()}),o.on("dragstart",()=>{Kn=!0}),o.on("dragend drop",()=>{Kn=!1}),o.on("NodeChange",wo=>{ol(re.element).fold(js.throttle,F)})})},nD=o=>{gt([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],m=>{o.ui.registry.addToggleButton(m.name,{tooltip:m.text,icon:m.icon,onAction:rd(o,m.cmd),onSetup:w0(o,m.name)})}),o.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:Rf(o),onAction:rd(o,"JustifyNone")})},b6=(o,c)=>{const m=()=>{const b=c.getOptions(o),C=c.getCurrent(o).map(c.hash),x=ji();return qe(b,M=>({type:"togglemenuitem",text:c.display(M),onSetup:I=>{const W=re=>{re&&(x.on(fe=>fe.setActive(!1)),x.set(I)),I.setActive(re)};W(ze(C,c.hash(M)));const J=c.watcher(o,M,W);return()=>{x.clear(),J()}},onAction:()=>c.setCurrent(o,M)}))};o.ui.registry.addMenuButton(c.name,{tooltip:c.text,icon:c.icon,fetch:b=>b(m()),onSetup:c.onToolbarSetup}),o.ui.registry.addNestedMenuItem(c.name,{type:"nestedmenuitem",text:c.text,getSubmenuItems:m,onSetup:c.onMenuSetup})},DH=o=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:fA,hash:c=>dX(c,["fixed","relative","empty"]).getOr(c),display:we,watcher:(c,m,b)=>c.formatter.formatChanged("lineheight",b,!1,{value:m}).unbind,getCurrent:c=>V.from(c.queryCommandValue("LineHeight")),setCurrent:(c,m)=>c.execCommand("LineHeight",!1,m),onToolbarSetup:Rf(o),onMenuSetup:Rf(o)}),OH=o=>V.from(FM(o)).map(m=>({name:"language",text:"Language",icon:"language",getOptions:X(m),hash:b=>N(b.customCode)?b.code:`${b.code}/${b.customCode}`,display:b=>b.title,watcher:(b,C,x)=>{var M;return b.formatter.formatChanged("lang",x,!1,{value:C.code,customValue:(M=C.customCode)!==null&&M!==void 0?M:null}).unbind},getCurrent:b=>{const C=it.fromDom(b.selection.getNode());return Qc(C,x=>V.some(x).filter(pr).bind(M=>he(M,"lang").map(W=>{const J=he(M,"data-mce-lang").getOrUndefined();return{code:W,customCode:J,title:""}})))},setCurrent:(b,C)=>b.execCommand("Lang",!1,C),onToolbarSetup:b=>{const C=r0();return b.setActive(o.formatter.match("lang",{},void 0,!0)),C.set(o.formatter.formatChanged("lang",b.setActive,!0)),yg(C.clear,Rf(o)(b))},onMenuSetup:Rf(o)})),MH=o=>{b6(o,DH(o)),OH(o).each(c=>b6(o,c))},uJ=(o,c)=>{sX(o,c),cX(o,c),kX(o,c),iX(o,c),CX(o,c)},RH=o=>_0(o,"NodeChange",c=>{c.setEnabled(o.queryCommandState("outdent")&&o.selection.isEditable())}),fJ=o=>{o.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:RH(o),onAction:rd(o,"outdent")}),o.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:Rf(o),onAction:rd(o,"indent")})},dJ=o=>{fJ(o)},NH=(o,c)=>m=>{m.setActive(c.get());const b=C=>{c.set(C.state),m.setActive(C.state)};return o.on("PastePlainTextToggle",b),yg(()=>o.off("PastePlainTextToggle",b),Rf(o)(m))},hJ=o=>{const c=$o(RB(o)),m=()=>o.execCommand("mceTogglePlainTextPaste");o.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:m,onSetup:NH(o,c)}),o.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:m,onSetup:NH(o,c)})},v6=(o,c)=>()=>{o.execCommand("mceToggleFormat",!1,c)},dx=o=>{nv.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(c,m)=>{o.ui.registry.addToggleButton(c.name,{tooltip:c.text,icon:c.icon,onSetup:w0(o,c.name),onAction:v6(o,c.name)})});for(let c=1;c<=6;c++){const m="h"+c;o.ui.registry.addToggleButton(m,{text:m.toUpperCase(),tooltip:"Heading "+c,onSetup:w0(o,m),onAction:v6(o,m)})}},mJ=o=>{nv.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print"}],c=>{o.ui.registry.addButton(c.name,{tooltip:c.text,icon:c.icon,onAction:rd(o,c.action)})}),nv.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],c=>{o.ui.registry.addButton(c.name,{tooltip:c.text,icon:c.icon,onSetup:Rf(o),onAction:rd(o,c.action)})})},gJ=o=>{nv.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],c=>{o.ui.registry.addToggleButton(c.name,{tooltip:c.text,icon:c.icon,onAction:rd(o,c.action),onSetup:w0(o,c.name)})})},pJ=o=>{dx(o),mJ(o),gJ(o)},PH=o=>{nv.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],c=>{o.ui.registry.addMenuItem(c.name,{text:c.text,icon:c.icon,shortcut:c.shortcut,onAction:rd(o,c.action)})}),nv.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],c=>{o.ui.registry.addMenuItem(c.name,{text:c.text,icon:c.icon,shortcut:c.shortcut,onSetup:Rf(o),onAction:rd(o,c.action)})}),o.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:Rf(o),onAction:v6(o,"code")})},bJ=o=>{pJ(o),PH(o)},hx=(o,c)=>_0(o,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",m=>{m.setEnabled(!o.mode.isReadOnly()&&o.undoManager[c]())}),vJ=o=>{o.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:hx(o,"hasUndo"),onAction:rd(o,"undo")}),o.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:hx(o,"hasRedo"),onAction:rd(o,"redo")})},yJ=o=>{o.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:hx(o,"hasUndo"),onAction:rd(o,"undo")}),o.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:hx(o,"hasRedo"),onAction:rd(o,"redo")})},wJ=o=>{vJ(o),yJ(o)},_J=o=>_0(o,"VisualAid",c=>{c.setActive(o.hasVisual)}),CJ=o=>{o.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:_J(o),onAction:rd(o,"mceToggleVisualAid")})},mx=o=>{o.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:rd(o,"mceToggleVisualAid")})},IH=o=>{mx(o),CJ(o)},SJ=(o,c)=>{nD(o),bJ(o),uJ(o,c),wJ(o),G8(o),IH(o),dJ(o),MH(o),hJ(o)},kJ=o=>h(o)?o.split(/[ ,]/):o,y6=o=>c=>c.options.get(o),w6=o=>{const c=o.options.register;c("contextmenu_avoid_overlap",{processor:"string",default:""}),c("contextmenu_never_use_native",{processor:"boolean",default:!1}),c("contextmenu",{processor:m=>m===!1?{value:[],valid:!0}:h(m)||ee(m,h)?{value:kJ(m),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},_6=y6("contextmenu_never_use_native"),BH=y6("contextmenu_avoid_overlap"),EJ=o=>l_(o).length===0,l_=o=>{const c=o.ui.registry.getAll().contextMenus,m=o.options.get("contextmenu");return o.options.isSet("contextmenu")?m:Zn(m,b=>ps(c,b))},By=(o,c)=>({type:"makeshift",x:o,y:c}),C6=(o,c,m)=>By(o.x+c,o.y+m),S6=o=>o.type==="longpress"||o.type.indexOf("touch")===0,LH=o=>{if(S6(o)){const c=o.touches[0];return By(c.pageX,c.pageY)}else return By(o.pageX,o.pageY)},AJ=o=>{if(S6(o)){const c=o.touches[0];return By(c.clientX,c.clientY)}else return By(o.clientX,o.clientY)},FH=(o,c)=>{const m=rA.DOM.getPos(o);return C6(c,m.x,m.y)},xJ=(o,c)=>c.type==="contextmenu"||c.type==="longpress"?o.inline?LH(c):FH(o.getContentAreaContainer(),AJ(c)):HH(o),HH=o=>({type:"selection",root:it.fromDom(o.selection.getNode())}),TJ=o=>({type:"node",node:V.some(it.fromDom(o.selection.getNode())),root:it.fromDom(o.getBody())}),$H=(o,c,m)=>{switch(m){case"node":return TJ(o);case"point":return xJ(o,c);case"selection":return HH(o)}},DJ=(o,c,m,b,C,x)=>{const M=m(),I=$H(o,c,x);TS(M,pp.CLOSE_ON_EXECUTE,b,{isHorizontalMenu:!1,search:V.none()}).map(W=>{c.preventDefault(),Pa.showMenuAt(C,{anchor:I},{menu:{markers:Fw("normal")},data:W})})},zH={onLtr:()=>[Hl,gl,Kl,Du,Fr,Yl,_p,XA,YA,S4,KA,GA],onRtl:()=>[Hl,Kl,gl,Fr,Du,Yl,_p,XA,KA,GA,YA,S4]},oD=12,VH={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},UH=(o,c)=>{const m=o.selection;if(m.isCollapsed()||c.touches.length<1)return!1;{const b=c.touches[0],C=m.getRng();return pE(o.getWin(),Tb.domRange(C)).exists(M=>M.left<=b.clientX&&M.right>=b.clientX&&M.top<=b.clientY&&M.bottom>=b.clientY)}},k6=o=>{const c=o.selection.getRng(),m=()=>{Q3.setEditorTimeout(o,()=>{o.selection.setRng(c)},10),x()};o.once("touchend",m);const b=M=>{M.preventDefault(),M.stopImmediatePropagation()};o.on("mousedown",b,!0);const C=()=>x();o.once("longpresscancel",C);const x=()=>{o.off("touchend",m),o.off("longpresscancel",C),o.off("mousedown",b)}},OJ=(o,c,m)=>{const b=$H(o,c,m);return{bubble:ug(0,m==="point"?oD:0,VH),layouts:zH,overrides:{maxWidthFunction:S9(),maxHeightFunction:cg()},...b}},WH=(o,c,m,b,C,x,M)=>{const I=OJ(o,c,x);TS(m,pp.CLOSE_ON_EXECUTE,b,{isHorizontalMenu:!0,search:V.none()}).map(W=>{c.preventDefault();const J=M?od.HighlightMenuAndItem:od.HighlightNone;Pa.showMenuWithinBounds(C,{anchor:I},{menu:{markers:Fw("normal"),highlightOnOpen:J},data:W,type:"horizontal"},()=>V.some(EH(o,b.shared,x==="node"?"node":"selection"))),o.dispatch(_H)})},MJ=(o,c,m,b,C,x)=>{const M=rn(),I=M.os.isiOS(),W=M.os.isMacOS(),J=M.os.isAndroid(),re=M.deviceType.isTouch(),fe=()=>!(J||I||W&&re),me=()=>{const Ce=m();WH(o,c,Ce,b,C,x,fe())};if((W||I)&&x!=="node"){const Ce=()=>{k6(o),me()};UH(o,c)?Ce():(o.once("selectionchange",Ce),o.once("touchend",()=>o.off("selectionchange",Ce)))}else me()},jH=o=>h(o)?o==="|":o.type==="separator",VS={type:"separator"},E6=o=>{const c=m=>({text:m.text,icon:m.icon,enabled:m.enabled,shortcut:m.shortcut});if(h(o))return o;switch(o.type){case"separator":return VS;case"submenu":return{type:"nestedmenuitem",...c(o),getSubmenuItems:()=>{const b=o.getSubmenuItems();return h(b)?b:qe(b,E6)}};default:const m=o;return{type:"menuitem",...c(m),onAction:oe(m.onAction)}}},ZH=(o,c)=>{if(c.length===0)return o;const b=Or(o).filter(C=>!jH(C)).fold(()=>[],C=>[VS]);return o.concat(b).concat(c).concat([VS])},RJ=(o,c,m)=>{const b=ao(c,(C,x)=>ln(o,x.toLowerCase()).map(M=>{const I=M.update(m);if(h(I)&&Ke(mi(I)))return ZH(C,I.split(" "));if(_(I)&&I.length>0){const W=qe(I,E6);return ZH(C,W)}else return C}).getOrThunk(()=>C.concat([x])),[]);return b.length>0&&jH(b[b.length-1])&&b.pop(),b},NJ=(o,c)=>c.ctrlKey&&!_6(o),PJ=o=>o.type==="longpress"||ps(o,"touches"),qH=(o,c)=>!PJ(c)&&(c.button!==2||c.target===o.getBody()&&c.pointerType===""),A6=(o,c)=>qH(o,c)?o.selection.getStart(!0):c.target,GH=(o,c)=>{const m=BH(o),b=qH(o,c)?"selection":"point";if(Ke(m)){const C=A6(o,c);return _S(it.fromDom(C),m)?"node":b}else return b},IJ=(o,c,m)=>{const C=rn().deviceType.isTouch,x=uc(Pa.sketch({dom:{tag:"div"},lazySink:c,onEscape:()=>o.focus(),onShow:()=>m.setContextMenuState(!0),onHide:()=>m.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Tn([ks("dismissContextMenu",[en(Xm(),(W,J)=>{Ks.close(W),o.focus()})])])})),M=()=>Pa.hide(x),I=W=>{if(_6(o)&&W.preventDefault(),NJ(o,W)||EJ(o))return;const J=GH(o,W),re=()=>{const me=A6(o,W),Ce=o.ui.registry.getAll(),Ne=l_(o);return RJ(Ce.contextMenus,Ne,me)};(C()?MJ:DJ)(o,W,re,m,x,J)};o.on("init",()=>{const W="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(C()?"":" ResizeWindow");o.on(W,M),o.on("longpress contextmenu",I)})},x6=G.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),gx=o=>c=>c.translate(-o.left,-o.top),sD=o=>c=>c.translate(o.left,o.top),av=o=>(c,m)=>ao(o,(b,C)=>C(b),fr(c,m)),rD=(o,c,m)=>o.fold(av([sD(m),gx(c)]),av([gx(c)]),av([])),US=(o,c,m)=>o.fold(av([sD(m)]),av([]),av([sD(c)])),KH=(o,c,m)=>o.fold(av([]),av([gx(m)]),av([sD(c),gx(m)])),T6=(o,c,m,b,C,x)=>{const M=US(o,C,x),I=US(c,C,x);return Math.abs(M.left-I.left)<=m&&Math.abs(M.top-I.top)<=b},BJ=(o,c,m,b,C,x)=>{const M=US(o,C,x),I=US(c,C,x),W=Math.abs(M.left-I.left),J=Math.abs(M.top-I.top);return fr(W,J)},YH=(o,c,m)=>{const b=o.fold((C,x)=>({position:V.some("absolute"),left:V.some(C+"px"),top:V.some(x+"px")}),(C,x)=>({position:V.some("absolute"),left:V.some(C-m.left+"px"),top:V.some(x-m.top+"px")}),(C,x)=>({position:V.some("fixed"),left:V.some(C+"px"),top:V.some(x+"px")}));return{right:V.none(),bottom:V.none(),...b}},D6=(o,c,m)=>o.fold((b,C)=>px(b+c,C+m),(b,C)=>Ly(b+c,C+m),(b,C)=>c_(b+c,C+m)),iD=(o,c,m,b)=>{const C=(x,M)=>(I,W)=>{const J=x(c,m,b);return M(I.getOr(J.left),W.getOr(J.top))};return o.fold(C(KH,px),C(US,Ly),C(rD,c_))},px=x6.offset,Ly=x6.absolute,c_=x6.fixed,XH=(o,c)=>{const m=$i(o,c);return N(m)?NaN:parseInt(m,10)},LJ=(o,c)=>{const m=o.element,b=XH(m,c.leftAttr),C=XH(m,c.topAttr);return isNaN(b)||isNaN(C)?V.none():V.some(fr(b,C))},FJ=(o,c,m)=>{const b=o.element;Xn(b,c.leftAttr,m.left+"px"),Xn(b,c.topAttr,m.top+"px")},JH=(o,c)=>{const m=o.element;We(m,c.leftAttr),We(m,c.topAttr)},HJ=(o,c,m,b)=>LJ(o,c).fold(()=>m,C=>c_(C.left+b.left,C.top+b.top)),QH=(o,c,m,b,C,x)=>{const M=HJ(o,c,m,b),I=c.mustSnap?O6(o,c,M,C,x):zJ(o,c,M,C,x),W=rD(M,C,x);return FJ(o,c,W),I.fold(()=>({coord:c_(W.left,W.top),extra:V.none()}),J=>({coord:J.output,extra:J.extra}))},$J=(o,c)=>{JH(o,c)},e$=(o,c,m,b)=>Js(o,C=>{const x=C.sensor;return T6(c,x,C.range.left,C.range.top,m,b)?V.some({output:iD(C.output,c,m,b),extra:C.extra}):V.none()}),O6=(o,c,m,b,C)=>{const x=c.getSnapPoints(o);return e$(x,m,b,C).orThunk(()=>ao(x,(W,J)=>{const re=J.sensor,fe=BJ(m,re,J.range.left,J.range.top,b,C);return W.deltas.fold(()=>({deltas:V.some(fe),snap:V.some(J)}),me=>{const Ce=(fe.left+fe.top)/2,Ne=(me.left+me.top)/2;return Ce<=Ne?{deltas:V.some(fe),snap:V.some(J)}:W})},{deltas:V.none(),snap:V.none()}).snap.map(W=>({output:iD(W.output,m,b,C),extra:W.extra})))},zJ=(o,c,m,b,C)=>{const x=c.getSnapPoints(o);return e$(x,m,b,C)},t$=(o,c,m)=>({coord:iD(o.output,o.output,c,m),extra:o.extra});var VJ=Object.freeze({__proto__:null,snapTo:(o,c,m,b)=>{const C=c.getTarget(o.element);if(c.repositionTarget){const x=sa(o.element),M=ic(x),I=_N(C),W=t$(b,M,I),J=YH(W.coord,M,I);hn(C,J)}}});const bx="data-initial-z-index",UJ=o=>{Ha(o.element).filter(pr).each(c=>{he(c,bx).fold(()=>Ss(c,"z-index"),m=>so(c,"z-index",m)),We(c,bx)})},WJ=o=>{Ha(o.element).filter(pr).each(c=>{Xi(c,"z-index").each(m=>{Xn(c,bx,m)}),so(c,"z-index",qr(o.element,"z-index"))})},n$=(o,c)=>{o.getSystem().addToGui(c),WJ(c)},jJ=o=>{UJ(o),o.getSystem().removeFromGui(o)},o$=(o,c,m)=>o.getSystem().build(f1.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[c]},events:m}));var s$=ja("snaps",[Qt("getSnapPoints"),Gs("onSensor"),Qt("leftAttr"),Qt("topAttr"),At("lazyViewport",ce),At("mustSnap",!1)]);const M6=[At("useFixed",Je),Qt("blockerClass"),At("getTarget",we),At("onDrag",F),At("repositionTarget",!0),At("onDrop",F),qa("getBounds",ce),s$],ZJ=o=>uo(Xi(o,"left"),Xi(o,"top"),Xi(o,"position"),(c,m,b)=>(b==="fixed"?c_:px)(parseInt(c,10),parseInt(m,10))).getOrThunk(()=>{const c=vc(o);return Ly(c.left,c.top)}),qJ=(o,c,m,b,C)=>{const x=C.bounds,M=US(c,m,b),I=Jf(M.left,x.x,x.x+x.width-C.width),W=Jf(M.top,x.y,x.y+x.height-C.height),J=Ly(I,W);return c.fold(()=>{const re=KH(J,m,b);return px(re.left,re.top)},X(J),()=>{const re=rD(J,m,b);return c_(re.left,re.top)})},GJ=(o,c,m,b,C,x,M)=>{const I=c.fold(()=>{const W=D6(m,x.left,x.top),J=rD(W,b,C);return c_(J.left,J.top)},W=>{const J=QH(o,W,m,x,b,C);return J.extra.each(re=>{W.onSensor(o,re)}),J.coord});return qJ(o,I,b,C,M)},KJ=(o,c,m,b)=>{const C=c.getTarget(o.element);if(c.repositionTarget){const x=sa(o.element),M=ic(x),I=_N(C),W=ZJ(C),J=GJ(o,c.snaps,W,M,I,b,m),re=YH(J,M,I);hn(C,re)}c.onDrag(o,C,b)},r$=(o,c)=>({bounds:o.getBounds(),height:Lf(c.element),width:$a(c.element)}),R6=(o,c,m,b,C)=>{const x=m.update(b,C),M=m.getStartData().getOrThunk(()=>r$(c,o));x.each(I=>{KJ(o,c,M,I)})},i$=(o,c,m,b)=>{c.each(jJ),m.snaps.each(x=>{$J(o,x)});const C=m.getTarget(o.element);b.reset(),m.onDrop(o,C)},aD=o=>(c,m)=>{const b=C=>{m.setStartData(r$(c,C))};return ri([en(Ym(),C=>{m.getStartData().each(()=>b(C))}),...o(c,m,b)])},YJ=o=>ri([en(Br(),o.forceDrop),en(j1(),o.drop),en(Da(),(c,m)=>{o.move(m.event)}),en(cc(),o.delayDrop)]);var JJ=Object.freeze({__proto__:null,getData:o=>V.from(fr(o.x,o.y)),getDelta:(o,c)=>fr(c.left-o.left,c.top-o.top)});const a$=(o,c,m)=>[en(Br(),(b,C)=>{if(C.event.raw.button!==0)return;C.stop();const M=()=>i$(b,V.some(J),o,c),I=yL(M,200),W={drop:M,delayDrop:I.schedule,forceDrop:M,move:fe=>{I.cancel(),R6(b,o,c,JJ,fe)}},J=o$(b,o.blockerClass,YJ(W));(()=>{m(b),n$(b,J)})()})],u_=[...M6,Wi("dragger",{handlers:aD(a$)})],l$=o=>ri([en(eu(),o.forceDrop),en(jm(),o.drop),en(Os(),o.drop),en(zp(),(c,m)=>{o.move(m.event)})]),QJ=o=>{const c=o[0];return V.some(fr(c.clientX,c.clientY))};var c$=Object.freeze({__proto__:null,getData:o=>{const m=o.raw.touches;return m.length===1?QJ(m):V.none()},getDelta:(o,c)=>fr(c.left-o.left,c.top-o.top)});const N6=(o,c,m)=>{const b=ji(),C=x=>{i$(x,b.get(),o,c),b.clear()};return[en(eu(),(x,M)=>{M.stop();const I=()=>C(x),W={drop:I,delayDrop:F,forceDrop:I,move:fe=>{R6(x,o,c,c$,fe)}},J=o$(x,o.blockerClass,l$(W));b.set(J),(()=>{m(x),n$(x,J)})()}),en(zp(),(x,M)=>{M.stop(),R6(x,o,c,c$,M.event)}),en(jm(),(x,M)=>{M.stop(),C(x)}),en(Os(),C)]},eQ=[...M6,Wi("dragger",{handlers:aD(N6)})],tQ=(o,c,m)=>[...a$(o,c,m),...N6(o,c,m)],nQ=[...M6,Wi("dragger",{handlers:aD(tQ)})];var oQ=Object.freeze({__proto__:null,mouse:u_,touch:eQ,mouseOrTouch:nQ}),sQ=Object.freeze({__proto__:null,init:()=>{let o=V.none(),c=V.none();const m=()=>{o=V.none(),c=V.none()},b=(W,J)=>{const re=o.map(fe=>W.getDelta(fe,J));return o=V.some(J),re},C=(W,J)=>W.getData(J).bind(re=>b(W,re)),x=W=>{c=V.some(W)},M=()=>c,I=X({});return su({readState:I,reset:m,update:C,getStartData:M,setStartData:x})}});const f_=K2({branchKey:"mode",branches:oQ,name:"dragging",active:{events:(o,c)=>o.dragger.handlers(o,c)},extra:{snap:o=>({sensor:o.sensor,range:o.range,output:o.output,extra:V.from(o.extra)})},state:sQ,apis:VJ}),lD=40,vx=lD/2,u$=(o,c,m,b,C,x)=>o.fold(()=>f_.snap({sensor:Ly(m-vx,b-vx),range:fr(C,x),output:Ly(V.some(m),V.some(b)),extra:{td:c}}),M=>{const I=m-vx,W=b-vx,J=lD,re=lD,fe=M.element.dom.getBoundingClientRect();return f_.snap({sensor:Ly(I,W),range:fr(J,re),output:Ly(V.some(m-fe.width/2),V.some(b-fe.height/2)),extra:{td:c}})}),WS=(o,c,m)=>{const b=(C,x)=>C.exists(M=>kr(M,x));return{getSnapPoints:o,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(C,x)=>{const M=x.td;b(c.get(),M)||(c.set(M),m(M))},mustSnap:!0}},f$=o=>Qr(Uc.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Tn([f_.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:o}),MA.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),rQ=(o,c)=>{const m=$o([]),b=$o([]),C=$o(!1),x=ji(),M=ji(),I=In=>{const Kn=Bl(In);return u$(Ce.getOpt(c),In,Kn.x,Kn.y,Kn.width,Kn.height)},W=()=>qe(m.get(),In=>I(In)),J=In=>{const Kn=Bl(In);return u$(Ne.getOpt(c),In,Kn.right,Kn.bottom,Kn.width,Kn.height)},re=()=>qe(b.get(),In=>J(In)),fe=WS(W,x,In=>{M.get().each(Kn=>{o.dispatch("TableSelectorChange",{start:In,finish:Kn})})}),me=WS(re,M,In=>{x.get().each(Kn=>{o.dispatch("TableSelectorChange",{start:Kn,finish:In})})}),Ce=f$(fe),Ne=f$(me),st=uc(Ce.asSpec()),Ht=uc(Ne.asSpec()),dt=(In,Kn,js,wo)=>{const _s=Kn.dom.getBoundingClientRect();Ss(In.element,"display");const fs=Oc(it.fromDom(o.getBody())).dom.innerHeight,hr=js(_s),Ho=wo(_s,fs);(hr||Ho)&&so(In.element,"display","none")},lt=(In,Kn,js,wo)=>{const _s=js(Kn);f_.snapTo(In,_s),dt(In,Kn,Ho=>Ho[wo]<0,(Ho,ir)=>Ho[wo]>ir)},Zt=In=>lt(st,In,I,"top"),Ot=()=>x.get().each(Zt),An=In=>lt(Ht,In,J,"bottom"),mn=()=>M.get().each(An);rn().deviceType.isTouch()&&(o.on("TableSelectionChange",In=>{C.get()||(rl(c,st),rl(c,Ht),C.set(!0)),x.set(In.start),M.set(In.finish),In.otherCells.each(Kn=>{m.set(Kn.upOrLeftCells),b.set(Kn.downOrRightCells),Zt(In.start),An(In.finish)})}),o.on("ResizeEditor ResizeWindow ScrollContent",()=>{Ot(),mn()}),o.on("TableSelectionClear",()=>{C.get()&&($c(st),$c(Ht),C.set(!1)),x.clear(),M.clear()}))};var P6=`<svg width="50px" height="16px" viewBox="0 0 50 16" xmlns="http://www.w3.org/2000/svg">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>
|
|
</svg>
|
|
`;const iQ=o=>o.nodeName==="BR"||!!o.getAttribute("data-mce-bogus")||o.getAttribute("data-mce-type")==="bookmark",aQ=(o,c,m)=>{var b;const C=(b=c.delimiter)!==null&&b!==void 0?b:"\u203A",x=(J,re,fe)=>Uc.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":fe,"aria-level":fe+1}},components:[Ni(J)],action:me=>{o.focus(),o.selection.select(re),o.nodeChanged()},buttonBehaviours:Tn([vg.button(m.isDisabled),ec()])}),M=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Ni(` ${C} `)]}),I=J=>ao(J,(re,fe,me)=>{const Ce=x(fe.name,fe.element,me);return me===0?re.concat([Ce]):re.concat([M(),Ce])},[]),W=J=>{const re=[];let fe=J.length;for(;fe-- >0;){const me=J[fe];if(me.nodeType===1&&!iQ(me)){const Ce=Ah(o,me);if(Ce.isDefaultPrevented()||re.push({name:Ce.name,element:me}),Ce.isPropagationStopped())break}}return re};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Tn([Io.config({mode:"flow",selector:"div[role=button]"}),Xo.config({disabled:m.isDisabled}),ec(),Ka.config({}),ms.config({}),ks("elementPathEvents",[yi((J,re)=>{o.shortcuts.add("alt+F11","focus statusbar elementpath",()=>Io.focusIn(J)),o.on("NodeChange",fe=>{const me=W(fe.parents),Ce=me.length>0?I(me):[];ms.set(J,Ce)})})])]),components:[]}};var Fy;(function(o){o[o.None=0]="None",o[o.Both=1]="Both",o[o.Vertical=2]="Vertical"})(Fy||(Fy={}));const lQ=(o,c,m,b,C)=>{const x={height:Q4(b+c.top,IM(o),BM(o))};return m===Fy.Both&&(x.width=Q4(C+c.left,aA(o),rS(o))),x},d$=(o,c,m)=>{const b=it.fromDom(o.getContainer()),C=lQ(o,c,m,Mi(b),Ji(b));ar(C,(x,M)=>{q(x)&&so(b,M,r6(x))}),ET(o)},cQ=o=>{const c=MB(o);return c===!1?Fy.None:c==="both"?Fy.Both:Fy.Vertical},cD=(o,c,m,b)=>{const x=fr(m*20,b*20);return d$(o,x,c),V.some(!0)},uQ=(o,c)=>{const m=cQ(o);if(m===Fy.None)return V.none();const b=m===Fy.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return V.some(gp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:c.translate("Resize"),"aria-label":c.translate(b)},behaviours:[f_.config({mode:"mouse",repositionTarget:!1,onDrag:(C,x,M)=>d$(o,M,m),blockerClass:"tox-blocker"}),Io.config({mode:"special",onLeft:()=>cD(o,m,-1,0),onRight:()=>cD(o,m,1,0),onUp:()=>cD(o,m,0,-1),onDown:()=>cD(o,m,0,1)}),Ka.config({}),es.config({})]},c.icons))},fQ=(o,c)=>{const m=(b,C,x)=>ms.set(b,[Ni(c.translate(["{0} "+x,C[x]]))]);return Uc.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Tn([vg.button(c.isDisabled),ec(),Ka.config({}),ms.config({}),Jn.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ks("wordcount-events",[ou(b=>{const C=Jn.getValue(b),x=C.mode==="words"?"characters":"words";Jn.setValue(b,{mode:x,count:C.count}),m(b,C.count,x)}),yi(b=>{o.on("wordCountUpdate",C=>{const{mode:x}=Jn.getValue(b);Jn.setValue(b,{mode:x,count:C.wordCount}),m(b,C.wordCount,x)})})])]),eventOrder:{[Ku()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},dQ=(o,c)=>{const m=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v6",rel:"noopener",target:"_blank","aria-label":pm.translate(["Powered by {0}","Tiny"])},innerHtml:P6.trim()},behaviours:Tn([es.config({})])}]}),b=()=>{const I=_R("Alt+0"),W="Press {0} for help";return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Ni(pm.translate([W,I]))]}},C=()=>{const I=[];return o.hasPlugin("wordcount")&&I.push(fQ(o,c)),uA(o)&&I.push(m()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:I}},x=()=>{const I=[],W=IB(o),J=OB(o),re=uA(o)||o.hasPlugin("wordcount"),fe=()=>{const me="tox-statusbar__text-container--flex-start",Ce="tox-statusbar__text-container--flex-end",Ne="tox-statusbar__text-container--space-around";if(W){const st="tox-statusbar__text-container-3-cols";return!re&&!J?[st,Ne]:re&&!J?[st,Ce]:[st,me]}return[re&&!J?Ce:me]};return J&&I.push(aQ(o,{},c)),W&&I.push(b()),re&&I.push(C()),I.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...fe()]},components:I}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const I=x(),W=uQ(o,c);return I.concat(W.toArray())})()}},h$=(o,c)=>c.get().getOrDie(`UI for ${o} has not been rendered`),hQ=(o,c)=>{const m=o.inline,b=m?WX:BX,C=hA(o)?XK:MK,x=jX(),M=ji(),I=ji(),W=ji(),me=rn().deviceType.isTouch()?["tox-platform-touch"]:[],Ce=ZM(o),Ne=aS(o),st=Qr({dom:{tag:"div",classes:["tox-anchorbar"]}}),Ht=Qr({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),dt=()=>x.mainUi.get().map(Vo=>Vo.outerContainer).bind(Zi.getHeader),lt=()=>Cn.fromOption(x.dialogUi.get().map(Vo=>Vo.sink),"UI has not been rendered"),Zt=()=>Cn.fromOption(x.popupUi.get().map(Vo=>Vo.sink),"(popup) UI has not been rendered"),Ot=x.lazyGetInOuterOrDie("anchor bar",st.getOpt),An=x.lazyGetInOuterOrDie("bottom anchor bar",Ht.getOpt),mn=x.lazyGetInOuterOrDie("toolbar",Zi.getToolbar),In=x.lazyGetInOuterOrDie("throbber",Zi.getThrobber),Kn=EK({popup:Zt,dialog:lt},o,Ot,An),js=()=>{const Vo={attributes:{[Eb]:Ce?vh.BottomToTop:vh.TopToBottom}},bs=Zi.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:Kn.popup,onEscape:()=>{o.focus()}}),Di=Zi.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:Kn.popup.shared.getSink,providers:Kn.popup.shared.providers,onEscape:()=>{o.focus()},onToolbarToggled:fv=>{DR(o,fv)},type:Ne,lazyToolbar:mn,lazyHeader:()=>dt().getOrDie("Could not find header element"),...Vo}),$r=Zi.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:Kn.popup.shared.providers,onEscape:()=>{o.focus()},type:Ne}),ff=dA(o),pa=rT(o),Ud=lS(o),Sp=PB(o),Vy=wo(),Uy=ff||pa||Ud,__=()=>ff?[$r]:pa?[Di]:[],Wy=Sp?[Vy,bs]:[bs];return Zi.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(Uy?[]:["tox-editor-header--empty"]),...Vo},components:Tt([Ud?Wy:[],__(),cS(o)?[]:[st.asSpec()]]),sticky:hA(o),editor:o,sharedBackstage:Kn.popup.shared})},wo=()=>Zi.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),_s=()=>{const Vo=Zi.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),bs=Zi.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[Vo,bs]}},fs=()=>{const Vo=iT(o),bs=kr(Hi(),Vo)&&qr(Vo,"display")==="grid",Di={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(me),attributes:{...pm.isRtl()?{dir:"rtl"}:{}}},behaviours:Tn([uu.config({useFixed:()=>C.isDocked(dt)})])},$r={dom:{styles:{width:document.body.clientWidth+"px"}},events:ri([en(ih(),Ud=>{so(Ud.element,"width",document.body.clientWidth+"px")})])},ff=uc(Jr(Di,bs?$r:{})),pa=r5(ff);return I.set(pa),{sink:ff,mothership:pa}},hr=()=>{const Vo={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(me),attributes:{...pm.isRtl()?{dir:"rtl"}:{}}},behaviours:Tn([uu.config({useFixed:()=>C.isDocked(dt),getBounds:()=>c.getPopupSinkBounds()})])},bs=uc(Vo),Di=r5(bs);return W.set(Di),{sink:bs,mothership:Di}},Ho=()=>{const Vo=js(),bs=_s(),Di=Zi.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:Kn.popup}),$r=Zi.parts.viewWrapper({backstage:Kn.popup}),ff=WM(o)&&!m?V.some(dQ(o,Kn.popup.shared.providers)):V.none(),pa=Tt([Ce?[]:[Vo],m?[]:[bs],Ce?[Vo]:[]]),Ud=Zi.parts.editorContainer({components:Tt([pa,m?[]:[Ht.asSpec(),...ff.toArray()]])}),Sp=qM(o),Vy={role:"application",...pm.isRtl()?{dir:"rtl"}:{},...Sp?{"aria-hidden":"true"}:{}},Uy=uc(Zi.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(m?["tox-tinymce-inline"]:[]).concat(Ce?["tox-tinymce--toolbar-bottom"]:[]).concat(me),styles:{visibility:"hidden",...Sp?{opacity:"0",border:"0"}:{}},attributes:Vy},components:[Ud,...m?[]:[$r],Di],behaviours:Tn([ec(),Xo.config({disableClass:"tox-tinymce--disabled"}),Io.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),__=r5(Uy);return M.set(__),{mothership:__,outerContainer:Uy}},ir=Vo=>{const bs=r6(FX(o)),Di=r6(HX(o));return o.inline||(bf("div","width",Di)&&so(Vo.element,"width",Di),bf("div","height",bs)?so(Vo.element,"height",bs):so(Vo.element,"height","400px")),bs},Hn=Vo=>{o.addShortcut("alt+F9","focus menubar",()=>{Zi.focusMenubar(Vo)}),o.addShortcut("alt+F10","focus toolbar",()=>{Zi.focusToolbar(Vo)}),o.addCommand("ToggleToolbarDrawer",(bs,Di)=>{Di!=null&&Di.skipFocus?Zi.toggleToolbarDrawerWithoutFocusing(Vo):Zi.toggleToolbarDrawer(Vo)}),o.addQueryStateHandler("ToggleToolbarDrawer",()=>Zi.isToolbarDrawerToggled(Vo))},bo=Vo=>{const{mainUi:bs,popupUi:Di,uiMotherships:$r}=Vo;Ns(CB(o),(eP,XS)=>{o.ui.registry.addGroupToolbarButton(XS,eP)});const{buttons:ff,menuItems:pa,contextToolbars:Ud,sidebars:Sp,views:Vy}=o.ui.registry.getAll(),Uy=jM(o),__={menuItems:pa,menus:wy(o),menubar:kB(o),toolbar:Uy.getOrThunk(()=>cA(o)),allowToolbarGroups:Ne===pg.floating,buttons:ff,sidebar:Sp,views:Vy};Hn(bs.outerContainer),AK(o,bs.mothership,$r),C.setup(o,Kn.popup.shared,dt),SJ(o,Kn.popup),IJ(o,Kn.popup.shared.getSink,Kn.popup),ox(o),pY(o,In,Kn.popup.shared),cJ(o,Ud,Di.sink,{backstage:Kn.popup}),rQ(o,Di.sink);const Wy=o.getElement(),fv=ir(bs.outerContainer),Q6={targetNode:Wy,height:fv};return b.render(o,Vo,__,Kn.popup,Q6)},ls=Vo=>(W.set(Vo.mothership),Vo),Xs=()=>{const Vo=Ho(),bs=fs(),Di=y0(o)?hr():ls(bs);x.dialogUi.set(bs),x.popupUi.set(Di),x.mainUi.set(Vo);const $r={popupUi:Di,dialogUi:bs,mainUi:Vo,uiMotherships:x.getUiMotherships()};return bo($r)};return{popups:{backstage:Kn.popup,getMothership:()=>h$("popups",W)},dialogs:{backstage:Kn.dialog,getMothership:()=>h$("dialogs",I)},renderUI:Xs}},mQ=(o,c)=>{const m=he(o,"id").fold(()=>{const b=ro("dialog-label");return Xn(c,"id",b),b},we);Xn(o,"aria-labelledby",m)},gQ=X([Qt("lazySink"),Ar("dragBlockClass"),qa("getBounds",ce),At("useTabstopAt",ft),At("firstTabstop",0),At("eventOrder",{}),$l("modalBehaviours",[Io]),iu("onExecute"),F2("onEscape")]),I6={sketch:we},pQ=X([Fd({name:"draghandle",overrides:(o,c)=>({behaviours:Tn([f_.config({mode:"mouse",getTarget:m=>og(m,'[role="dialog"]').getOr(m),blockerClass:o.dragBlockClass.getOrDie(new Error(`The drag blocker class was not specified for a dialog with a drag handle:
|
|
`+JSON.stringify(c,null,2)).message),getBounds:o.getDragBounds})])})}),zc({schema:[Qt("dom")],name:"title"}),zc({factory:I6,schema:[Qt("dom")],name:"close"}),zc({factory:I6,schema:[Qt("dom")],name:"body"}),Fd({factory:I6,schema:[Qt("dom")],name:"footer"}),Sh({factory:{sketch:(o,c)=>({...o,dom:c.dom,components:c.components})},schema:[At("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),At("components",[])],name:"blocker"})]),bQ=(o,c,m,b)=>{const C=ji(),x=Ce=>{C.set(Ce);const Ne=o.lazySink(Ce).getOrDie(),st=b.blocker(),Ht=Ne.getSystem().build({...st,components:st.components.concat([ru(Ce)]),behaviours:Tn([es.config({}),ks("dialog-blocker-events",[eg(Gi(),()=>{Dh.isBlocked(Ce)?F():Io.focusIn(Ce)})])])});rl(Ne,Ht),Io.focusIn(Ce)},M=Ce=>{C.clear(),Ha(Ce.element).each(Ne=>{Ce.getSystem().getByDom(Ne).each(st=>{$c(st)})})},I=Ce=>o1(Ce,o,"body"),W=Ce=>Ti(Ce,o,"footer"),J=(Ce,Ne)=>{Dh.block(Ce,Ne)},re=Ce=>{Dh.unblock(Ce)},fe=ro("modal-events"),me={...o.eventOrder,[xu()]:[fe].concat(o.eventOrder["alloy.system.attached"]||[])};return{uid:o.uid,dom:o.dom,components:c,apis:{show:x,hide:M,getBody:I,getFooter:W,setIdle:re,setBusy:J},eventOrder:me,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Ql(o.modalBehaviours,[ms.config({}),Io.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt,firstTabstop:o.firstTabstop}),Dh.config({getRoot:C.get}),ks(fe,[yi(Ce=>{mQ(Ce.element,o1(Ce,o,"title").element)})])])}},Ml=fu({name:"ModalDialog",configFields:gQ(),partFields:pQ(),factory:bQ,apis:{show:(o,c)=>{o.show(c)},hide:(o,c)=>{o.hide(c)},getBody:(o,c)=>o.getBody(c),getFooter:(o,c)=>o.getFooter(c),setBusy:(o,c,m)=>{o.setBusy(c,m)},setIdle:(o,c)=>{o.setIdle(c)}}}),vQ=lo([Ol,pT].concat(Vw)),yQ=Eu,B6=[lR("button"),bg,Au("align","end",["start","end"]),dS,bp,Q0("buttonType",["primary","secondary"])],m$=[...B6,a1],L6=[Ua("type",["submit","cancel","custom"]),...m$],wQ=[Ua("type",["menu"]),_y,Zb,bg,Ll("items",vQ),...B6],g$=[...B6,Ua("type",["togglebutton"]),Ca("tooltip"),bg,_y,Za("active",!1)],_Q=Cl("type",{submit:L6,cancel:L6,custom:L6,menu:wQ,togglebutton:g$}),CQ=[Ol,a1,Ua("level",["info","warn","error","success"]),oR,At("url","")],SQ=lo(CQ),kQ=o=>[Ol,o],EQ=[Ol,a1,bp,lR("button"),bg,iR,Q0("buttonType",["primary","secondary","toolbar"]),dS],F6=lo(EQ),d_=[Ol,pT],y1=d_.concat([rR]),AQ=d_.concat([nR,bp]),xQ=lo(AQ),TQ=Eu,DQ=y1.concat([yT("auto")]),OQ=lo(DQ),MQ=eh([$w,a1,oR]),RQ=y1.concat([lc("storageKey","default")]),NQ=lo(RQ),PQ=ml,IQ=lo(y1),BQ=ml,LQ=d_.concat([lc("tag","textarea"),Ca("scriptId"),Ca("scriptUrl"),Vm("settings",void 0)]),FQ=d_.concat([lc("tag","textarea"),Ic("init")]),HQ=Zu(o=>Ui("customeditor.old",bi(FQ),o).orThunk(()=>Ui("customeditor.new",bi(LQ),o))),$Q=ml,VQ=lo(y1),UQ=th(),WQ=o=>[Ol,J0("columns"),o],jQ=[Ol,Ca("html"),Au("presets","presentation",["presentation","document"])],ZQ=lo(jQ),qQ=y1.concat([Za("border",!1),Za("sandboxed",!0),Za("streamContent",!1),Za("transparent",!0)]),GQ=lo(qQ),KQ=ml,p$=lo(d_.concat([Gl("height")])),b$=lo([Ca("url"),nh("zoom"),nh("cachedWidth"),nh("cachedHeight")]),h_=y1.concat([Gl("inputMode"),Gl("placeholder"),Za("maximized",!1),bp]),YQ=lo(h_),H6=ml,uD=o=>[Ol,nR,o,Au("align","start",["start","center","end"])],XQ=[a1,$w],JQ=[a1,Ll("items",qu("items",()=>v$))],v$=Qn([lo(XQ),lo(JQ)]),QQ=y1.concat([Ll("items",v$),bp]),eee=lo(QQ),m_=ml,y$=y1.concat([$p("items",[a1,$w]),Xc("size",1),bp]),tee=lo(y$),nee=ml,oee=y1.concat([Za("constrain",!0),bp]),see=lo(oee),w$=lo([Ca("width"),Ca("height")]),ree=d_.concat([nR,Xc("min",0),Xc("max",0)]),iee=lo(ree),aee=Cd,$6=[Ol,Ll("header",ml),Ll("cells",_d(ml))],yx=lo($6),z6=y1.concat([Gl("placeholder"),Za("maximized",!1),bp]),fD=lo(z6),g_=ml,wx=[Ua("type",["directory","leaf"]),bT,Ca("id"),Wa("menu",nx)],V6=lo(wx),_$=wx.concat([Ll("children",qu("children",()=>Sd("type",{directory:U6,leaf:V6})))]),U6=lo(_$),lee=Sd("type",{directory:U6,leaf:V6}),cee=[Ol,Ll("items",lee),zm("onLeafAction"),zm("onToggleExpand"),Jc("defaultExpandedIds",[],ml),Gl("defaultSelectedId")],uee=lo(cee),C$=y1.concat([Au("filetype","file",["image","media","file"]),bp]),S$=lo(C$),W6=lo([$w,aR]),j6=o=>Va("items","items",br(),_d(Zu(c=>Ui(`Checking item of ${o}`,Z6,c).fold(m=>Cn.error(kd(m)),m=>Cn.value(m))))),Z6=hl(()=>Sd("type",{alertbanner:SQ,bar:lo(kQ(j6("bar"))),button:F6,checkbox:xQ,colorinput:NQ,colorpicker:IQ,dropzone:VQ,grid:lo(WQ(j6("grid"))),iframe:GQ,input:YQ,listbox:eee,selectbox:tee,sizeinput:see,slider:iee,textarea:fD,urlinput:S$,customeditor:HQ,htmlpanel:ZQ,imagepreview:p$,collection:OQ,label:lo(uD(j6("label"))),table:yx,tree:uee,panel:q6})),fee=[Ol,At("classes",[]),Ll("items",Z6)],q6=lo(fee),dee=[lR("tab"),bT,Ll("items",Z6)],hee=[Ol,$p("tabs",dee)],mee=lo(hee),G6=m$,K6=_Q,gee=lo([Ca("title"),Gr("body",Sd("type",{panel:q6,tabpanel:mee})),lc("size","normal"),Jc("buttons",[],K6),At("initialData",{}),qa("onAction",F),qa("onChange",F),qa("onSubmit",F),qa("onClose",F),qa("onCancel",F),qa("onTabChange",F)]),k$=o=>Ui("dialog",gee,o),pee=lo([Ua("type",["cancel","custom"]),...G6]),bee=lo([Ca("title"),Ca("url"),nh("height"),nh("width"),W1("buttons",pee),qa("onAction",F),qa("onCancel",F),qa("onClose",F),qa("onMessage",F)]),E$=o=>Ui("dialog",bee,o),Y6=o=>g(o)?[o].concat(Be(va(o),Y6)):_(o)?Be(o,Y6):[],vee=o=>h(o.type)&&h(o.name),p_={checkbox:TQ,colorinput:PQ,colorpicker:BQ,dropzone:UQ,input:H6,iframe:KQ,imagepreview:b$,selectbox:nee,sizeinput:w$,slider:aee,listbox:m_,size:w$,textarea:g_,urlinput:W6,customeditor:$Q,collection:MQ,togglemenuitem:yQ},A$=o=>V.from(p_[o.type]),yee=o=>Zn(Y6(o),vee),dD=o=>{const c=yee(o),m=Be(c,b=>A$(b).fold(()=>[],C=>[Gr(b.name,C)]));return lo(m)},b_=o=>{var c;const m=ha(k$(o)),b=dD(o),C=(c=o.initialData)!==null&&c!==void 0?c:{};return{internalDialog:m,dataValidator:b,initialData:C}},A0={open:(o,c)=>{const m=b_(c);return o(m.internalDialog,m.initialData,m.dataValidator)},openUrl:(o,c)=>{const m=ha(E$(c));return o(m)},redial:o=>b_(o)};var hD=Object.freeze({__proto__:null,events:(o,c)=>{const m=(b,C)=>{o.updateState.each(x=>{const M=x(b,C);c.set(M)}),o.renderComponents.each(x=>{const M=x(C,c.get());(o.reuseDom?pM:GI)(b,M)})};return ri([en(Jh(),(b,C)=>{const x=C;if(!x.universal){const M=o.channel;ct(x.channels,M)&&m(b,x.data)}}),yi((b,C)=>{o.initialData.each(x=>{m(b,x)})})])}}),mD=Object.freeze({__proto__:null,getState:(o,c,m)=>m}),x$=[Qt("channel"),Ar("renderComponents"),Ar("updateState"),Ar("initialData"),Za("reuseDom",!0)],Cee=Object.freeze({__proto__:null,init:()=>{const o=$o(V.none()),c=()=>o.set(V.none());return{readState:()=>o.get().getOr("none"),get:o.get,set:o.set,clear:c}}});const _m=Xl({fields:x$,name:"reflecting",active:hD,apis:mD,state:Cee}),lv=o=>{const c=[],m={};return ar(o,(b,C)=>{b.fold(()=>{c.push(C)},x=>{m[C]=x})}),c.length>0?Cn.error(c):Cn.value(m)},Nre=(o,c,m)=>{const b=Qr(e_.sketch(C=>({dom:{tag:"div",classes:["tox-form"].concat(o.classes)},components:qe(o.items,x=>rN(C,x,c,m))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[b.asSpec()]}],behaviours:Tn([Io.config({mode:"acyclic",useTabstopAt:_e(HA)}),wp.memento(b),fF(b,{postprocess:C=>lv(C).fold(x=>(console.error(x),{}),we)}),ks("dialog-body-panel",[en(Gi(),(C,x)=>{C.getSystem().broadcastOn([AS],{newFocus:V.some(x.event.target)})})])])}},See=(o,c)=>({uid:o.uid,dom:o.dom,components:o.components,events:q3(o.action),behaviours:Ql(o.tabButtonBehaviours,[es.config({}),Io.config({mode:"execution",useSpace:!0,useEnter:!0}),Jn.config({store:{mode:"memory",initialValue:o.value}})]),domModification:o.domModification}),T$=Vc({name:"TabButton",configFields:[At("uid",void 0),Qt("value"),Va("dom","dom",Ae(()=>({attributes:{role:"tab",id:ro("aria"),"aria-selected":"false"}})),Pc()),Ar("action"),At("domModification",{}),$l("tabButtonBehaviours",[es,Io,Jn]),Qt("view")],factory:See}),jS=X([Qt("tabs"),Qt("dom"),At("clickToDismiss",!1),$l("tabbarBehaviours",[Nr,Io]),tf(["tabClass","selectedClass"])]),gD=nd({factory:T$,name:"tabs",unit:"tab",overrides:o=>{const c=(b,C)=>{Nr.dehighlight(b,C),Do(b,kv(),{tabbar:b,button:C})},m=(b,C)=>{Nr.highlight(b,C),Do(b,qg(),{tabbar:b,button:C})};return{action:b=>{const C=b.getSystem().getByUid(o.uid).getOrDie(),x=Nr.isHighlighted(C,b);(()=>x&&o.clickToDismiss?c:x?F:m)()(C,b)},domModification:{classes:[o.markers.tabClass]}}}}),D$=X([gD]),kee=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Ql(o.tabbarBehaviours,[Nr.config({highlightClass:o.markers.selectedClass,itemClass:o.markers.tabClass,onHighlight:(C,x)=>{Xn(x.element,"aria-selected","true")},onDehighlight:(C,x)=>{Xn(x.element,"aria-selected","false")}}),Io.config({mode:"flow",getInitial:C=>Nr.getHighlighted(C).map(x=>x.element),selector:"."+o.markers.tabClass,executeOnMove:!0})])}),O$=fu({name:"Tabbar",configFields:jS(),partFields:D$(),factory:kee}),Eee=(o,c)=>({uid:o.uid,dom:o.dom,behaviours:Ql(o.tabviewBehaviours,[ms.config({})]),domModification:{attributes:{role:"tabpanel"}}}),Aee=Vc({name:"Tabview",configFields:[$l("tabviewBehaviours",[ms])],factory:Eee}),ZS=X([At("selectFirst",!0),Gs("onChangeTab"),Gs("onDismissTab"),At("tabs",[]),$l("tabSectionBehaviours",[])]),Pre=zc({factory:O$,schema:[Qt("dom"),qf("markers",[Qt("tabClass"),Qt("selectedClass")])],name:"tabbar",defaults:o=>({tabs:o.tabs})}),xee=zc({factory:Aee,name:"tabview"}),Tee=X([Pre,xee]),Ire=(o,c,m,b)=>{const C=M=>{const I=Jn.getValue(M);Ti(M,o,"tabview").each(W=>{St(o.tabs,re=>re.value===I).each(re=>{const fe=re.view();he(M.element,"id").each(me=>{Xn(W.element,"aria-labelledby",me)}),ms.set(W,fe),o.onChangeTab(W,M,fe)})})},x=(M,I)=>{Ti(M,o,"tabbar").each(W=>{I(W).each(lh)})};return{uid:o.uid,dom:o.dom,components:c,behaviours:fm(o.tabSectionBehaviours),events:ri(Tt([o.selectFirst?[yi((M,I)=>{x(M,Nr.getFirst)})]:[],[en(qg(),(M,I)=>{const W=I.event.button;C(W)}),en(kv(),(M,I)=>{const W=I.event.button;o.onDismissTab(M,W)})]])),apis:{getViewItems:M=>Ti(M,o,"tabview").map(I=>ms.contents(I)).getOr([]),showTab:(M,I)=>{x(M,J=>{const re=Nr.getCandidates(J);return St(re,me=>Jn.getValue(me)===I).filter(me=>!Nr.isHighlighted(J,me))})}}}},qS=fu({name:"TabSection",configFields:ZS(),partFields:Tee(),factory:Ire,apis:{getViewItems:(o,c)=>o.getViewItems(c),showTab:(o,c,m)=>{o.showTab(c,m)}}}),Dee=(o,c,m)=>qe(o,(b,C)=>{ms.set(m,o[C].view());const x=c.dom.getBoundingClientRect();return ms.set(m,[]),x.height}),_x=o=>ds(rs(o,(c,m)=>c>m?-1:c<m?1:0)),Oee=(o,c,m)=>{const b=bu(o).dom,C=og(o,".tox-dialog-wrap").getOr(o),x=qr(C,"position")==="fixed";let M;x?M=Math.max(b.clientHeight,window.innerHeight):M=Math.max(b.offsetHeight,b.scrollHeight);const I=Mi(c),J=c.dom.offsetLeft>=m.dom.offsetLeft+Ji(m)?Math.max(Mi(m),I):I,re=parseInt(qr(o,"margin-top"),10)||0,fe=parseInt(qr(o,"margin-bottom"),10)||0,Ce=Mi(o)+re+fe-J;return M-Ce},Mee=(o,c)=>{ds(o).each(m=>qS.showTab(c,m.value))},X6=(o,c)=>{so(o,"height",c+"px"),so(o,"flex-basis",c+"px")},pD=(o,c,m)=>{og(o,'[role="dialog"]').each(b=>{ta(b,'[role="tablist"]').each(C=>{m.get().map(x=>(so(c,"height","0"),so(c,"flex-basis","0"),Math.min(x,Oee(b,c,C)))).each(x=>{X6(c,x)})})})},M$=o=>ta(o,'[role="tabpanel"]'),n=o=>{const c=ji();return{extraEvents:[yi(C=>{const x=C.element;M$(x).each(M=>{so(M,"visibility","hidden"),C.getSystem().getByDom(M).toOptional().each(I=>{const W=Dee(o,M,I);_x(W).fold(c.clear,c.set)}),pD(x,M,c),Ss(M,"visibility"),Mee(o,C),requestAnimationFrame(()=>{pD(x,M,c)})})}),en(ih(),C=>{const x=C.element;M$(x).each(M=>{pD(x,M,c)})}),en(a5,(C,x)=>{const M=C.element;M$(M).each(I=>{const W=Df(Pt(I));so(I,"visibility","hidden");const J=Xi(I,"height").map(me=>parseInt(me,10));Ss(I,"height"),Ss(I,"flex-basis");const re=I.dom.getBoundingClientRect().height;J.forall(me=>re>me)?(c.set(re),pD(M,I,c)):J.each(me=>{X6(I,me)}),Ss(I,"visibility"),W.each(of)})})],selectFirst:!1}},i="send-data-to-section",l="send-data-to-view",d=(o,c,m)=>{const b=$o({}),C=J=>{const re=Jn.getValue(J),fe=lv(re).getOr({}),me=b.get(),Ce=Jr(me,fe);b.set(Ce)},x=J=>{const re=b.get();Jn.setValue(J,re)},M=$o(null),I=qe(o.tabs,J=>({value:J.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Ni(m.shared.providers.translate(J.title))],view:()=>[e_.sketch(re=>({dom:{tag:"div",classes:["tox-form"]},components:qe(J.items,fe=>rN(re,fe,c,m)),formBehaviours:Tn([Io.config({mode:"acyclic",useTabstopAt:_e(HA)}),ks("TabView.form.events",[yi(x),Dd(C)]),Cc.config({channels:jo([{key:i,value:{onReceive:C}},{key:l,value:{onReceive:x}}])})])}))]})),W=n(I);return qS.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(J,re,fe)=>{const me=Jn.getValue(re);Do(J,DL,{name:me,oldName:M.get()}),M.set(me)},tabs:I,components:[qS.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[O$.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Tn([Ka.config({})])}),qS.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:W.selectFirst,tabSectionBehaviours:Tn([ks("tabpanel",W.extraEvents),Io.config({mode:"acyclic"}),sr.config({find:J=>ds(qS.getViewItems(J))}),ev(V.none(),J=>(J.getSystem().broadcastOn([i],{}),b.get()),(J,re)=>{b.set(re),J.getSystem().broadcastOn([l],{})})])})},p=(o,c,m,b,C)=>{const x=W=>{const J=W.body;switch(J.type){case"tabpanel":return[d(J,W.initialData,b)];default:return[Nre(J,W.initialData,b)]}},M=(W,J)=>V.some({isTabPanel:()=>J.body.type==="tabpanel"}),I={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...m.map(W=>({id:W})).getOr({}),...C?I:{}}},components:[],behaviours:Tn([wp.childAt(0),_m.config({channel:`${t4}-${c}`,updateState:M,renderComponents:x,initialData:o})])}},w=(o,c,m,b,C)=>p(o,c,V.some(m),b,C),E=(o,c,m)=>{const b=p(o,c,V.none(),m,!1);return Ml.parts.body(b)},R=o=>{const c={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[P5(V.none(),{dom:{tag:"iframe",attributes:{src:o.url}},behaviours:Tn([Ka.config({}),es.config({})])})]}],behaviours:Tn([Io.config({mode:"acyclic",useTabstopAt:_e(HA)})])};return Ml.parts.body(c)};function B(o){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},B(o)}function K(o,c){return K=Object.setPrototypeOf||function(b,C){return b.__proto__=C,b},K(o,c)}function ie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(o,c,m){return ie()?ue=Reflect.construct:ue=function(C,x,M){var I=[null];I.push.apply(I,x);var W=Function.bind.apply(C,I),J=new W;return M&&K(J,M.prototype),J},ue.apply(null,arguments)}function be(o){return Le(o)||je(o)||Me(o)||mt()}function Le(o){if(Array.isArray(o))return Ve(o)}function je(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function Me(o,c){if(!!o){if(typeof o=="string")return Ve(o,c);var m=Object.prototype.toString.call(o).slice(8,-1);if(m==="Object"&&o.constructor&&(m=o.constructor.name),m==="Map"||m==="Set")return Array.from(o);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return Ve(o,c)}}function Ve(o,c){(c==null||c>o.length)&&(c=o.length);for(var m=0,b=new Array(c);m<c;m++)b[m]=o[m];return b}function mt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var vt=Object.hasOwnProperty,yt=Object.setPrototypeOf,Mt=Object.isFrozen,dn=Object.getPrototypeOf,zn=Object.getOwnPropertyDescriptor,Pn=Object.freeze,Lt=Object.seal,$t=Object.create,wn=typeof Reflect<"u"&&Reflect,go=wn.apply,Oo=wn.construct;go||(go=function(c,m,b){return c.apply(m,b)}),Pn||(Pn=function(c){return c}),Lt||(Lt=function(c){return c}),Oo||(Oo=function(c,m){return ue(c,be(m))});var Cs=Is(Array.prototype.forEach),Us=Is(Array.prototype.pop),Pr=Is(Array.prototype.push),di=Is(String.prototype.toLowerCase),al=Is(String.prototype.match),Rl=Is(String.prototype.replace),hc=Is(String.prototype.indexOf),Mn=Is(String.prototype.trim),to=Is(RegExp.prototype.test),wr=yo(TypeError);function Is(o){return function(c){for(var m=arguments.length,b=new Array(m>1?m-1:0),C=1;C<m;C++)b[C-1]=arguments[C];return go(o,c,b)}}function yo(o){return function(){for(var c=arguments.length,m=new Array(c),b=0;b<c;b++)m[b]=arguments[b];return Oo(o,m)}}function Rn(o,c){yt&&yt(o,null);for(var m=c.length;m--;){var b=c[m];if(typeof b=="string"){var C=di(b);C!==b&&(Mt(c)||(c[m]=C),b=C)}o[b]=!0}return o}function Dn(o){var c=$t(null),m;for(m in o)go(vt,o,[m])&&(c[m]=o[m]);return c}function qo(o,c){for(;o!==null;){var m=zn(o,c);if(m){if(m.get)return Is(m.get);if(typeof m.value=="function")return Is(m.value)}o=dn(o)}function b(C){return console.warn("fallback value for",C),null}return b}var Ys=Pn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Kr=Pn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),co=Pn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ws=Pn(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ii=Pn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Ya=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Si=Pn(["#text"]),Ec=Pn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Mh=Pn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zd=Pn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Cm=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hy=Lt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),v_=Lt(/<%[\w\W]*|[\w\W]*%>/gm),$y=Lt(/^data-[\-\w.\u00B7-\uFFFF]/),zy=Lt(/^aria-[\-\w]+$/),bD=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vD=Lt(/^(?:\w+script|data):/i),yD=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Cx=Lt(/^html$/i),Sx=function(){return typeof window>"u"?null:window},kx=function(c,m){if(B(c)!=="object"||typeof c.createPolicy!="function")return null;var b=null,C="data-tt-policy-suffix";m.currentScript&&m.currentScript.hasAttribute(C)&&(b=m.currentScript.getAttribute(C));var x="dompurify"+(b?"#"+b:"");try{return c.createPolicy(x,{createHTML:function(I){return I}})}catch{return console.warn("TrustedTypes policy "+x+" could not be created."),null}};function GS(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sx(),c=function(Gt){return GS(Gt)};if(c.version="2.3.8",c.removed=[],!o||!o.document||o.document.nodeType!==9)return c.isSupported=!1,c;var m=o.document,b=o.document,C=o.DocumentFragment,x=o.HTMLTemplateElement,M=o.Node,I=o.Element,W=o.NodeFilter,J=o.NamedNodeMap,re=J===void 0?o.NamedNodeMap||o.MozNamedAttrMap:J,fe=o.HTMLFormElement,me=o.DOMParser,Ce=o.trustedTypes,Ne=I.prototype,st=qo(Ne,"cloneNode"),Ht=qo(Ne,"nextSibling"),dt=qo(Ne,"childNodes"),lt=qo(Ne,"parentNode");if(typeof x=="function"){var Zt=b.createElement("template");Zt.content&&Zt.content.ownerDocument&&(b=Zt.content.ownerDocument)}var Ot=kx(Ce,m),An=Ot?Ot.createHTML(""):"",mn=b,In=mn.implementation,Kn=mn.createNodeIterator,js=mn.createDocumentFragment,wo=mn.getElementsByTagName,_s=m.importNode,fs={};try{fs=Dn(b).documentMode?b.documentMode:{}}catch{}var hr={};c.isSupported=typeof lt=="function"&&In&&typeof In.createHTMLDocument<"u"&&fs!==9;var Ho=Hy,ir=v_,Hn=$y,bo=zy,ls=vD,Xs=yD,Vo=bD,bs=null,Di=Rn({},[].concat(be(Ys),be(Kr),be(co),be(ii),be(Si))),$r=null,ff=Rn({},[].concat(be(Ec),be(Mh),be(zd),be(Cm))),pa=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ud=null,Sp=null,Vy=!0,Uy=!0,__=!1,Wy=!1,fv=!1,Q6=!1,eP=!1,XS=!1,I$=!1,B$=!1,Hre=!0,Pee=!0,tP=!1,CD={},SD=null,$re=Rn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),zre=null,Vre=Rn({},["audio","video","img","source","image","track"]),Iee=null,Ure=Rn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bee="http://www.w3.org/1998/Math/MathML",Lee="http://www.w3.org/2000/svg",JS="http://www.w3.org/1999/xhtml",L$=JS,Fee=!1,kD,T0e=["application/xhtml+xml","text/html"],D0e="text/html",Rx,ED=null,O0e=b.createElement("form"),Wre=function(Gt){return Gt instanceof RegExp||Gt instanceof Function},Hee=function(Gt){ED&&ED===Gt||((!Gt||B(Gt)!=="object")&&(Gt={}),Gt=Dn(Gt),bs="ALLOWED_TAGS"in Gt?Rn({},Gt.ALLOWED_TAGS):Di,$r="ALLOWED_ATTR"in Gt?Rn({},Gt.ALLOWED_ATTR):ff,Iee="ADD_URI_SAFE_ATTR"in Gt?Rn(Dn(Ure),Gt.ADD_URI_SAFE_ATTR):Ure,zre="ADD_DATA_URI_TAGS"in Gt?Rn(Dn(Vre),Gt.ADD_DATA_URI_TAGS):Vre,SD="FORBID_CONTENTS"in Gt?Rn({},Gt.FORBID_CONTENTS):$re,Ud="FORBID_TAGS"in Gt?Rn({},Gt.FORBID_TAGS):{},Sp="FORBID_ATTR"in Gt?Rn({},Gt.FORBID_ATTR):{},CD="USE_PROFILES"in Gt?Gt.USE_PROFILES:!1,Vy=Gt.ALLOW_ARIA_ATTR!==!1,Uy=Gt.ALLOW_DATA_ATTR!==!1,__=Gt.ALLOW_UNKNOWN_PROTOCOLS||!1,Wy=Gt.SAFE_FOR_TEMPLATES||!1,fv=Gt.WHOLE_DOCUMENT||!1,XS=Gt.RETURN_DOM||!1,I$=Gt.RETURN_DOM_FRAGMENT||!1,B$=Gt.RETURN_TRUSTED_TYPE||!1,eP=Gt.FORCE_BODY||!1,Hre=Gt.SANITIZE_DOM!==!1,Pee=Gt.KEEP_CONTENT!==!1,tP=Gt.IN_PLACE||!1,Vo=Gt.ALLOWED_URI_REGEXP||Vo,L$=Gt.NAMESPACE||JS,Gt.CUSTOM_ELEMENT_HANDLING&&Wre(Gt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(pa.tagNameCheck=Gt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Gt.CUSTOM_ELEMENT_HANDLING&&Wre(Gt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(pa.attributeNameCheck=Gt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Gt.CUSTOM_ELEMENT_HANDLING&&typeof Gt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(pa.allowCustomizedBuiltInElements=Gt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),kD=T0e.indexOf(Gt.PARSER_MEDIA_TYPE)===-1?kD=D0e:kD=Gt.PARSER_MEDIA_TYPE,Rx=kD==="application/xhtml+xml"?function(Co){return Co}:di,Wy&&(Uy=!1),I$&&(XS=!0),CD&&(bs=Rn({},be(Si)),$r=[],CD.html===!0&&(Rn(bs,Ys),Rn($r,Ec)),CD.svg===!0&&(Rn(bs,Kr),Rn($r,Mh),Rn($r,Cm)),CD.svgFilters===!0&&(Rn(bs,co),Rn($r,Mh),Rn($r,Cm)),CD.mathMl===!0&&(Rn(bs,ii),Rn($r,zd),Rn($r,Cm))),Gt.ADD_TAGS&&(bs===Di&&(bs=Dn(bs)),Rn(bs,Gt.ADD_TAGS)),Gt.ADD_ATTR&&($r===ff&&($r=Dn($r)),Rn($r,Gt.ADD_ATTR)),Gt.ADD_URI_SAFE_ATTR&&Rn(Iee,Gt.ADD_URI_SAFE_ATTR),Gt.FORBID_CONTENTS&&(SD===$re&&(SD=Dn(SD)),Rn(SD,Gt.FORBID_CONTENTS)),Pee&&(bs["#text"]=!0),fv&&Rn(bs,["html","head","body"]),bs.table&&(Rn(bs,["tbody"]),delete Ud.tbody),Pn&&Pn(Gt),ED=Gt)},jre=Rn({},["mi","mo","mn","ms","mtext"]),Zre=Rn({},["foreignobject","desc","title","annotation-xml"]),M0e=Rn({},["title","style","font","a","script"]),F$=Rn({},Kr);Rn(F$,co),Rn(F$,Ws);var $ee=Rn({},ii);Rn($ee,Ya);var R0e=function(Gt){var Co=lt(Gt);(!Co||!Co.tagName)&&(Co={namespaceURI:JS,tagName:"template"});var Es=di(Gt.tagName),zl=di(Co.tagName);return Gt.namespaceURI===Lee?Co.namespaceURI===JS?Es==="svg":Co.namespaceURI===Bee?Es==="svg"&&(zl==="annotation-xml"||jre[zl]):Boolean(F$[Es]):Gt.namespaceURI===Bee?Co.namespaceURI===JS?Es==="math":Co.namespaceURI===Lee?Es==="math"&&Zre[zl]:Boolean($ee[Es]):Gt.namespaceURI===JS?Co.namespaceURI===Lee&&!Zre[zl]||Co.namespaceURI===Bee&&!jre[zl]?!1:!$ee[Es]&&(M0e[Es]||!F$[Es]):!1},C_=function(Gt){Pr(c.removed,{element:Gt});try{Gt.parentNode.removeChild(Gt)}catch{try{Gt.outerHTML=An}catch{Gt.remove()}}},H$=function(Gt,Co){try{Pr(c.removed,{attribute:Co.getAttributeNode(Gt),from:Co})}catch{Pr(c.removed,{attribute:null,from:Co})}if(Co.removeAttribute(Gt),Gt==="is"&&!$r[Gt])if(XS||I$)try{C_(Co)}catch{}else try{Co.setAttribute(Gt,"")}catch{}},qre=function(Gt){var Co,Es;if(eP)Gt="<remove></remove>"+Gt;else{var zl=al(Gt,/^[\r\n\t ]+/);Es=zl&&zl[0]}kD==="application/xhtml+xml"&&(Gt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Gt+"</body></html>");var kp=Ot?Ot.createHTML(Gt):Gt;if(L$===JS)try{Co=new me().parseFromString(kp,kD)}catch{}if(!Co||!Co.documentElement){Co=In.createDocument(L$,"template",null);try{Co.documentElement.innerHTML=Fee?"":kp}catch{}}var km=Co.body||Co.documentElement;return Gt&&Es&&km.insertBefore(b.createTextNode(Es),km.childNodes[0]||null),L$===JS?wo.call(Co,fv?"html":"body")[0]:fv?Co.documentElement:km},Gre=function(Gt){return Kn.call(Gt.ownerDocument||Gt,Gt,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT,null,!1)},N0e=function(Gt){return Gt instanceof fe&&(typeof Gt.nodeName!="string"||typeof Gt.textContent!="string"||typeof Gt.removeChild!="function"||!(Gt.attributes instanceof re)||typeof Gt.removeAttribute!="function"||typeof Gt.setAttribute!="function"||typeof Gt.namespaceURI!="string"||typeof Gt.insertBefore!="function")},nP=function(Gt){return B(M)==="object"?Gt instanceof M:Gt&&B(Gt)==="object"&&typeof Gt.nodeType=="number"&&typeof Gt.nodeName=="string"},S_=function(Gt,Co,Es){!hr[Gt]||Cs(hr[Gt],function(zl){zl.call(c,Co,Es,ED)})},Kre=function(Gt){var Co;if(S_("beforeSanitizeElements",Gt,null),N0e(Gt)||to(/[\u0080-\uFFFF]/,Gt.nodeName))return C_(Gt),!0;var Es=Rx(Gt.nodeName);if(S_("uponSanitizeElement",Gt,{tagName:Es,allowedTags:bs}),Gt.hasChildNodes()&&!nP(Gt.firstElementChild)&&(!nP(Gt.content)||!nP(Gt.content.firstElementChild))&&to(/<[/\w]/g,Gt.innerHTML)&&to(/<[/\w]/g,Gt.textContent)||Es==="select"&&to(/<template/i,Gt.innerHTML))return C_(Gt),!0;if(!bs[Es]||Ud[Es]){if(!Ud[Es]&&Xre(Es)&&(pa.tagNameCheck instanceof RegExp&&to(pa.tagNameCheck,Es)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Es)))return!1;if(Pee&&!SD[Es]){var zl=lt(Gt)||Gt.parentNode,kp=dt(Gt)||Gt.childNodes;if(kp&&zl)for(var km=kp.length,Rh=km-1;Rh>=0;--Rh)zl.insertBefore(st(kp[Rh],!0),Ht(Gt))}return C_(Gt),!0}return Gt instanceof I&&!R0e(Gt)||(Es==="noscript"||Es==="noembed")&&to(/<\/no(script|embed)/i,Gt.innerHTML)?(C_(Gt),!0):(Wy&&Gt.nodeType===3&&(Co=Gt.textContent,Co=Rl(Co,Ho," "),Co=Rl(Co,ir," "),Gt.textContent!==Co&&(Pr(c.removed,{element:Gt.cloneNode()}),Gt.textContent=Co)),S_("afterSanitizeElements",Gt,null),!1)},Yre=function(Gt,Co,Es){if(Hre&&(Co==="id"||Co==="name")&&(Es in b||Es in O0e))return!1;if(!(Uy&&!Sp[Co]&&to(Hn,Co))){if(!(Vy&&to(bo,Co))){if(!$r[Co]||Sp[Co]){if(!(Xre(Gt)&&(pa.tagNameCheck instanceof RegExp&&to(pa.tagNameCheck,Gt)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Gt))&&(pa.attributeNameCheck instanceof RegExp&&to(pa.attributeNameCheck,Co)||pa.attributeNameCheck instanceof Function&&pa.attributeNameCheck(Co))||Co==="is"&&pa.allowCustomizedBuiltInElements&&(pa.tagNameCheck instanceof RegExp&&to(pa.tagNameCheck,Es)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Es))))return!1}else if(!Iee[Co]){if(!to(Vo,Rl(Es,Xs,""))){if(!((Co==="src"||Co==="xlink:href"||Co==="href")&&Gt!=="script"&&hc(Es,"data:")===0&&zre[Gt])){if(!(__&&!to(ls,Rl(Es,Xs,"")))){if(Es)return!1}}}}}}return!0},Xre=function(Gt){return Gt.indexOf("-")>0},Jre=function(Gt){var Co,Es,zl,kp;S_("beforeSanitizeAttributes",Gt,null);var km=Gt.attributes;if(!!km){var Rh={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$r};for(kp=km.length;kp--;){Co=km[kp];var $$=Co,Nh=$$.name,Qre=$$.namespaceURI;Es=Nh==="value"?Co.value:Mn(Co.value),zl=Rx(Nh);var I0e=Es;if(Rh.attrName=zl,Rh.attrValue=Es,Rh.keepAttr=!0,Rh.forceKeepAttr=void 0,S_("uponSanitizeAttribute",Gt,Rh),Es=Rh.attrValue,!Rh.forceKeepAttr){if(!Rh.keepAttr){H$(Nh,Gt);continue}if(to(/\/>/i,Es)){H$(Nh,Gt);continue}Wy&&(Es=Rl(Es,Ho," "),Es=Rl(Es,ir," "));var B0e=Rx(Gt.nodeName);if(!Yre(B0e,zl,Es)){H$(Nh,Gt);continue}if(Es!==I0e)try{Qre?Gt.setAttributeNS(Qre,Nh,Es):Gt.setAttribute(Nh,Es)}catch{H$(Nh,Gt)}}}S_("afterSanitizeAttributes",Gt,null)}},P0e=function or(Gt){var Co,Es=Gre(Gt);for(S_("beforeSanitizeShadowDOM",Gt,null);Co=Es.nextNode();)S_("uponSanitizeShadowNode",Co,null),!Kre(Co)&&(Co.content instanceof C&&or(Co.content),Jre(Co));S_("afterSanitizeShadowDOM",Gt,null)};return c.sanitize=function(or,Gt){var Co,Es,zl,kp,km;if(Fee=!or,Fee&&(or="<!-->"),typeof or!="string"&&!nP(or)){if(typeof or.toString!="function")throw wr("toString is not a function");if(or=or.toString(),typeof or!="string")throw wr("dirty is not a string, aborting")}if(!c.isSupported){if(B(o.toStaticHTML)==="object"||typeof o.toStaticHTML=="function"){if(typeof or=="string")return o.toStaticHTML(or);if(nP(or))return o.toStaticHTML(or.outerHTML)}return or}if(Q6||Hee(Gt),c.removed=[],typeof or=="string"&&(tP=!1),tP){if(or.nodeName){var Rh=Rx(or.nodeName);if(!bs[Rh]||Ud[Rh])throw wr("root node is forbidden and cannot be sanitized in-place")}}else if(or instanceof M)Co=qre("<!---->"),Es=Co.ownerDocument.importNode(or,!0),Es.nodeType===1&&Es.nodeName==="BODY"||Es.nodeName==="HTML"?Co=Es:Co.appendChild(Es);else{if(!XS&&!Wy&&!fv&&or.indexOf("<")===-1)return Ot&&B$?Ot.createHTML(or):or;if(Co=qre(or),!Co)return XS?null:B$?An:""}Co&&eP&&C_(Co.firstChild);for(var $$=Gre(tP?or:Co);zl=$$.nextNode();)zl.nodeType===3&&zl===kp||Kre(zl)||(zl.content instanceof C&&P0e(zl.content),Jre(zl),kp=zl);if(kp=null,tP)return or;if(XS){if(I$)for(km=js.call(Co.ownerDocument);Co.firstChild;)km.appendChild(Co.firstChild);else km=Co;return $r.shadowroot&&(km=_s.call(m,km,!0)),km}var Nh=fv?Co.outerHTML:Co.innerHTML;return fv&&bs["!doctype"]&&Co.ownerDocument&&Co.ownerDocument.doctype&&Co.ownerDocument.doctype.name&&to(Cx,Co.ownerDocument.doctype.name)&&(Nh="<!DOCTYPE "+Co.ownerDocument.doctype.name+`>
|
|
`+Nh),Wy&&(Nh=Rl(Nh,Ho," "),Nh=Rl(Nh,ir," ")),Ot&&B$?Ot.createHTML(Nh):Nh},c.setConfig=function(or){Hee(or),Q6=!0},c.clearConfig=function(){ED=null,Q6=!1},c.isValidAttribute=function(or,Gt,Co){ED||Hee({});var Es=Rx(or),zl=Rx(Gt);return Yre(Es,zl,Co)},c.addHook=function(or,Gt){typeof Gt=="function"&&(hr[or]=hr[or]||[],Pr(hr[or],Gt))},c.removeHook=function(or){if(hr[or])return Us(hr[or])},c.removeHooks=function(or){hr[or]&&(hr[or]=[])},c.removeAllHooks=function(){hr={}},c}var w1=GS();const KS=o=>w1().sanitize(o),y_=sS.deviceType.isTouch(),cv=(o,c)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[o,c]}),Ex=(o,c)=>Ml.parts.close(Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":c.translate("Close")}},action:o,buttonBehaviours:Tn([Ka.config({})])})),Ax=()=>Ml.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),x0=(o,c)=>Ml.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Iy(`<p>${KS(c.translate(o))}</p>`)}]}]}),uv=o=>Ml.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:o}),xx=(o,c)=>[f1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:o}),f1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:c})],Tx=o=>{const c="tox-dialog",m=c+"-wrap",b=m+"__backdrop",C=c+"__disable-scroll";return Ml.sketch({lazySink:o.lazySink,onEscape:x=>(o.onEscape(x),V.some(!0)),useTabstopAt:x=>!HA(x),firstTabstop:o.firstTabstop,dom:{tag:"div",classes:[c].concat(o.extraClasses),styles:{position:"relative",...o.extraStyles}},components:[o.header,o.body,...o.footer.toArray()],parts:{blocker:{dom:Iy(`<div class="${m}"></div>`),components:[{dom:{tag:"div",classes:y_?[b,b+"--opaque"]:[b]}}]}},dragBlockClass:m,modalBehaviours:Tn([es.config({}),ks("dialog-events",o.dialogEvents.concat([eg(Gi(),(x,M)=>{Dh.isBlocked(x)?F():Io.focusIn(x)}),en(Cv(),(x,M)=>{x.getSystem().broadcastOn([AS],{newFocus:M.event.newFocus})})])),ks("scroll-lock",[yi(()=>{Ra(Hi(),C)}),Dd(()=>{ma(Hi(),C)})]),...o.extraBehaviours]),eventOrder:{[Ku()]:["dialog-events"],[xu()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Ad()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...o.eventOrder}})},Dx=o=>Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":o.translate("Close"),title:o.translate("Close")}},buttonBehaviours:Tn([Ka.config({})]),components:[gp("close",{tag:"span",classes:["tox-icon"]},o.icons)],action:c=>{nr(c,Ay)}}),wD=(o,c,m,b)=>{const C=x=>[Ni(b.translate(x.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...m.map(x=>({id:x})).getOr({})}},components:[],behaviours:Tn([_m.config({channel:`${m1}-${c}`,initialData:o,renderComponents:C})])}},_D=()=>({dom:Iy('<div class="tox-dialog__draghandle"></div>')}),R$=(o,c,m,b)=>f1.sketch({dom:Iy('<div class="tox-dialog__header"></div>'),components:[wD(o,c,V.some(m),b),_D(),Dx(b)],containerBehaviours:Tn([f_.config({mode:"mouse",blockerClass:"blocker",getTarget:C=>ef(C,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),_1=(o,c,m)=>{const b=Ml.parts.title(wD(o,c,V.none(),m)),C=Ml.parts.draghandle(_D()),x=Ml.parts.close(Dx(m)),M=[b].concat(o.draggable?[C]:[]).concat([x]);return f1.sketch({dom:Iy('<div class="tox-dialog__header"></div>'),components:M})},w_=(o,c,m)=>_1({title:m.shared.providers.translate(o),draggable:m.dialog.isDraggableModal()},c,m.shared.providers),Rt=(o,c,m,b)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":m.translate(o)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${b.getOr(0)}px`,position:"absolute"}},behaviours:c,components:[{dom:Iy('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),Nt=(o,c,m)=>({onClose:()=>m.closeWindow(),onBlock:b=>{const C=ta(o().element,".tox-dialog__header").map(x=>Mi(x));Ml.setBusy(o(),(x,M)=>Rt(b.message,M,c,C))},onUnblock:()=>{Ml.setIdle(o())}}),Nn=(o,c,m,b)=>{const C=(x,M)=>V.some(M);return uc(Tx({...o,firstTabstop:1,lazySink:b.shared.getSink,extraBehaviours:[_m.config({channel:`${e4}-${o.id}`,updateState:C,initialData:c}),tv({}),...o.extraBehaviours],onEscape:x=>{nr(x,Ay)},dialogEvents:m,eventOrder:{[Jh()]:[_m.name(),Cc.name()],[xu()]:["scroll-lock",_m.name(),"messages","dialog-events","alloy.base.behaviour"],[Ad()]:["alloy.base.behaviour","dialog-events","messages",_m.name(),"scroll-lock"]}}))},xn=(o,c={})=>{const m=b=>{const C=qe(b.items,x=>{const M=ln(c,x.name).getOr($o(!1));return{...x,storage:M}});return{...b,items:C}};return qe(o,b=>b.type==="menu"?m(b):b)},Bo=o=>ao(o,(c,m)=>m.type==="menu"?ao(m.items,(C,x)=>(C[x.name]=x.storage,C),c):c,{}),dr=(o,c)=>[p2(Gi(),Zq),o(OA,(m,b,C,x)=>{Df(Pt(x.element)).fold(F,zv),c.onClose(),b.onClose()}),o(Ay,(m,b,C,x)=>{b.onCancel(m),nr(x,OA)}),en(PT,(m,b)=>c.onUnblock()),en(i5,(m,b)=>c.onBlock(b.event))],la=(o,c)=>{const m=(C,x)=>en(C,(M,I)=>{b(M,(W,J)=>{x(o(),W,I.event,M)})}),b=(C,x)=>{_m.getState(C).get().each(M=>{x(M,C)})};return[...dr(m,c),m(k0,(C,x,M)=>{x.onAction(C,{name:M.name})})]},Ac=(o,c,m)=>{const b=(x,M)=>en(x,(I,W)=>{C(I,(J,re)=>{M(o(),J,W.event,I)})}),C=(x,M)=>{_m.getState(x).get().each(I=>{M(I.internalDialog,x)})};return[...dr(b,c),b(CS,(x,M)=>M.onSubmit(x)),b(xh,(x,M,I)=>{M.onChange(x,{name:I.name})}),b(k0,(x,M,I,W)=>{const J=()=>W.getSystem().isConnected()?Io.focusIn(W):void 0,re=Ce=>Re(Ce,"disabled")||he(Ce,"aria-disabled").exists(Ne=>Ne==="true"),fe=Pt(W.element),me=Df(fe);M.onAction(x,{name:I.name,value:I.value}),Df(fe).fold(J,Ce=>{re(Ce)||me.exists(Ne=>Fa(Ce,Ne)&&re(Ne))?J():m().toOptional().filter(Ne=>!Fa(Ne.element,Ce)).each(J)})}),b(DL,(x,M,I)=>{M.onTabChange(x,{newTabName:I.name,oldTabName:I.oldName})}),Dd(x=>{const M=o();Jn.setValue(x,M.getData())})]},du=(o,c)=>p4(o,o.type,c),Ox=(o,c,m)=>St(c,b=>b.name===m).bind(b=>b.memento.getOpt(o)),Mx=(o,c)=>{const m=c.map(I=>I.footerButtons).getOr([]),b=No(m,I=>I.align==="start"),C=(I,W)=>f1.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${I}`]},components:qe(W,J=>J.memento.asSpec())}),x=C("start",b.pass),M=C("end",b.fail);return[x,M]},J6=(o,c,m)=>{const b=(C,x)=>{const M=qe(x.buttons,W=>{const J=Qr(du(W,m));return{name:W.name,align:W.align,memento:J}}),I=W=>Ox(C,M,W);return V.some({lookupByName:I,footerButtons:M})};return{dom:Iy('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Tn([_m.config({channel:`${I5}-${c}`,initialData:o,updateState:b,renderComponents:Mx})])}},Ree=(o,c,m)=>J6(o,c,m),zs=(o,c,m)=>Ml.parts.footer(J6(o,c,m)),qt=(o,c)=>{if(o.getRoot().getSystem().isConnected()){const b=sr.getCurrent(o.getFormWrapper()).getOr(o.getFormWrapper());return e_.getField(b,c).orThunk(()=>o.getFooter().bind(M=>_m.getState(M).get()).bind(M=>M.lookupByName(c)))}else return V.none()},vo=(o,c)=>{const m=o.getRoot();return _m.getState(m).get().map(b=>ha(Ui("data",b.dataValidator,c))).getOr(c)},ws=(o,c,m)=>{const b=Ne=>{const st=o.getRoot();st.getSystem().isConnected()&&Ne(st)},Ce={getData:()=>{const Ne=o.getRoot(),st=Ne.getSystem().isConnected()?o.getFormWrapper():Ne,Ht=Jn.getValue(st),dt=Ns(m,lt=>lt.get());return{...Ht,...dt}},setData:Ne=>{b(st=>{const Ht=Ce.getData(),dt=Jr(Ht,Ne),lt=vo(o,dt),Zt=o.getFormWrapper();Jn.setValue(Zt,lt),ar(m,(Ot,An)=>{ps(dt,An)&&Ot.set(dt[An])})})},setEnabled:(Ne,st)=>{qt(o,Ne).each(st?Xo.enable:Xo.disable)},focus:Ne=>{qt(o,Ne).each(es.focus)},block:Ne=>{if(!h(Ne))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");b(st=>{Do(st,i5,{message:Ne})})},unblock:()=>{b(Ne=>{nr(Ne,PT)})},showTab:Ne=>{b(st=>{const Ht=o.getBody();_m.getState(Ht).get().exists(lt=>lt.isTabPanel())&&sr.getCurrent(Ht).each(lt=>{qS.showTab(lt,Ne)})})},redial:Ne=>{b(st=>{const Ht=o.getId(),dt=c(Ne),lt=xn(dt.internalDialog.buttons,m);st.getSystem().broadcastOn([`${e4}-${Ht}`],dt),st.getSystem().broadcastOn([`${m1}-${Ht}`],dt.internalDialog),st.getSystem().broadcastOn([`${t4}-${Ht}`],dt.internalDialog),st.getSystem().broadcastOn([`${I5}-${Ht}`],{...dt.internalDialog,buttons:lt}),Ce.setData(dt.initialData)})},close:()=>{b(Ne=>{nr(Ne,OA)})},toggleFullscreen:o.toggleFullscreen};return Ce},wl=o=>{switch(o){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},Sm=(o,c,m)=>{const b=ro("dialog"),C=o.internalDialog,x=w_(C.title,b,m),M=E({body:C.body,initialData:C.initialData},b,m),I=xn(C.buttons),W=Bo(I),J=un(I.length!==0,zs({buttons:I},b,m)),re=Ac(()=>st,Nt(()=>Ce,m.shared.providers,c),m.shared.getSink),fe=wl(C.size),Ce=Nn({id:b,header:x,body:M,footer:J,extraClasses:fe,extraBehaviours:[],extraStyles:{}},o,re,m),Ne=(()=>{const Ht=()=>{const lt=Ml.getBody(Ce);return sr.getCurrent(lt).getOr(lt)},dt=()=>{const lt="tox-dialog--fullscreen",Zt=it.fromDom(Ce.element.dom);Ju(Zt,lt)?(ma(Zt,lt),tg(Zt,fe)):(Fc(Zt,fe),Ra(Zt,lt))};return{getId:X(b),getRoot:X(Ce),getBody:()=>Ml.getBody(Ce),getFooter:()=>Ml.getFooter(Ce),getFormWrapper:Ht,toggleFullscreen:dt}})(),st=ws(Ne,c.redial,W);return{dialog:Ce,instanceApi:st}},Vd=o=>{switch(o){case"medium":return V.some("tox-dialog--width-md");default:return V.none()}},Nf=(o,c,m,b=!1)=>{const C=ro("dialog"),x=ro("dialog-label"),M=ro("dialog-content"),I=o.internalDialog,W=Vd(I.size),J=(Ot,An)=>V.some(An),re=Qr(R$({title:I.title,draggable:!0},C,x,m.shared.providers)),fe=Qr(w({body:I.body,initialData:I.initialData},C,M,m,b)),me=xn(I.buttons),Ce=Bo(me),Ne=un(me.length!==0,Qr(Ree({buttons:me},C,m))),st=Ac(()=>Zt,{onBlock:Ot=>{Dh.block(dt,(An,mn)=>{const In=re.getOpt(dt).map(Kn=>Mi(Kn.element));return Rt(Ot.message,mn,m.shared.providers,In)})},onUnblock:()=>{Dh.unblock(dt)},onClose:()=>c.closeWindow()},m.shared.getSink),Ht="tox-dialog-inline",dt=uc({dom:{tag:"div",classes:["tox-dialog",Ht,...W.toArray()],attributes:{role:"dialog",["aria-labelledby"]:x}},eventOrder:{[Jh()]:[_m.name(),Cc.name()],[Ku()]:["execute-on-form"],[xu()]:["reflecting","execute-on-form"]},behaviours:Tn([Io.config({mode:"cyclic",onEscape:Ot=>(nr(Ot,OA),V.some(!0)),useTabstopAt:Ot=>!HA(Ot)&&(dl(Ot)!=="button"||$i(Ot,"disabled")!=="disabled"),firstTabstop:1}),_m.config({channel:`${e4}-${C}`,updateState:J,initialData:o}),es.config({}),ks("execute-on-form",st.concat([eg(Gi(),(Ot,An)=>{Io.focusIn(Ot)}),en(Cv(),(Ot,An)=>{Ot.getSystem().broadcastOn([AS],{newFocus:An.event.newFocus})})])),Dh.config({getRoot:()=>V.some(dt)}),ms.config({}),tv({})]),components:[re.asSpec(),fe.asSpec(),...Ne.map(Ot=>Ot.asSpec()).toArray()]}),lt=()=>{const Ot="tox-dialog--fullscreen",An=it.fromDom(dt.element.dom);Pk(An,[Ot])?(Fc(An,[Ot]),tg(An,[Ht])):(Fc(An,[Ht]),tg(An,[Ot]))},Zt=ws({getId:X(C),getRoot:X(dt),getFooter:()=>Ne.map(Ot=>Ot.get(dt)),getBody:()=>fe.get(dt),getFormWrapper:()=>{const Ot=fe.get(dt);return sr.getCurrent(Ot).getOr(Ot)},toggleFullscreen:lt},c.redial,Ce);return{dialog:dt,instanceApi:Zt}};var YS=tinymce.util.Tools.resolve("tinymce.util.URI");const ad=o=>{const c=M=>{o.getSystem().isConnected()&&M(o)};return{block:M=>{if(!h(M))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");c(I=>{Do(I,i5,{message:M})})},unblock:()=>{c(M=>{nr(M,PT)})},close:()=>{c(M=>{nr(M,OA)})},sendMessage:M=>{c(I=>{I.getSystem().broadcastOn([$A],M)})}}},N$=["insertContent","setContent","execCommand","close","block","unblock"],P$=o=>g(o)&&N$.indexOf(o.mceAction)!==-1,Nee=o=>!P$(o)&&g(o)&&ps(o,"mceAction"),Bre=(o,c,m)=>{switch(m.mceAction){case"insertContent":o.insertContent(m.content);break;case"setContent":o.setContent(m.content);break;case"execCommand":const b=O(m.ui)?m.ui:!1;o.execCommand(m.cmd,b,m.value);break;case"close":c.close();break;case"block":c.block(m.message);break;case"unblock":c.unblock();break}},_0e=(o,c,m,b)=>{const C=ro("dialog"),x=w_(o.title,C,b),M=R(o),I=o.buttons.bind(lt=>lt.length===0?V.none():V.some(zs({buttons:lt},C,b))),W=la(()=>dt,Nt(()=>Ht,b.shared.providers,c)),J={...o.height.fold(()=>({}),lt=>({height:lt+"px","max-height":lt+"px"})),...o.width.fold(()=>({}),lt=>({width:lt+"px","max-width":lt+"px"}))},re=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],fe=new YS(o.url,{base_uri:new YS(window.location.href)}),me=`${fe.protocol}://${fe.host}${fe.port?":"+fe.port:""}`,Ce=r0(),Ne=[ks("messages",[yi(()=>{const lt=Sc(it.fromDom(window),"message",Zt=>{if(fe.isSameOrigin(new YS(Zt.raw.origin))){const Ot=Zt.raw.data;P$(Ot)?Bre(m,dt,Ot):Nee(Ot)&&o.onMessage(dt,Ot)}});Ce.set(lt)}),Dd(Ce.clear)]),Cc.config({channels:{[$A]:{onReceive:(lt,Zt)=>{ta(lt.element,"iframe").each(Ot=>{const An=Ot.dom.contentWindow;j(An)&&An.postMessage(Zt,me)})}}}})],Ht=Nn({id:C,header:x,body:M,footer:I,extraClasses:re,extraBehaviours:Ne,extraStyles:J},o,W,b),dt=ad(Ht);return{dialog:Ht,instanceApi:dt}},C0e=o=>{const c=o.shared;return{open:(b,C)=>{const x=()=>{Ml.hide(J),C()},M=Qr(p4({name:"close-alert",text:"OK",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"cancel",o)),I=Ax(),W=Ex(x,c.providers),J=uc(Tx({lazySink:()=>c.getSink(),header:cv(I,W),body:x0(b,c.providers),footer:V.some(uv(xx([],[M.asSpec()]))),onEscape:x,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[en(Ay,x)],eventOrder:{}}));Ml.show(J);const re=M.get(J);es.focus(re)}}},S0e=o=>{const c=o.shared;return{open:(b,C)=>{const x=me=>{Ml.hide(re),C(me)},M=Qr(p4({name:"yes",text:"Yes",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"submit",o)),I=p4({name:"no",text:"No",primary:!1,buttonType:V.some("secondary"),align:"end",enabled:!0,icon:V.none()},"cancel",o),W=Ax(),J=Ex(()=>x(!1),c.providers),re=uc(Tx({lazySink:()=>c.getSink(),header:cv(W,J),body:x0(b,c.providers),footer:V.some(uv(xx([],[I,M.asSpec()]))),onEscape:()=>x(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[en(Ay,()=>x(!1)),en(CS,()=>x(!0))],eventOrder:{}}));Ml.show(re);const fe=M.get(re);es.focus(fe)}}},Lre=(o,c)=>ha(Ui("data",c,o)),Fre=o=>_S(o,".tox-alert-dialog")||_S(o,".tox-confirm-dialog"),k0e=(o,c,m)=>c&&m?[]:[yl.config({contextual:{lazyContext:()=>V.some(li(it.fromDom(o.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:b=>Kw(o,b.element).map(x=>({bounds:wS(x),optScrollEnv:V.some({currentScrollTop:x.element.dom.scrollTop,scrollElmTop:vc(x.element).top})})).getOrThunk(()=>({bounds:ce(),optScrollEnv:V.none()}))})],E0e=o=>{const c=o.editor,m=hA(c),b=C0e(o.backstages.dialog),C=S0e(o.backstages.dialog),x=(Ne,st,Ht)=>{if(!N(st)){if(st.inline==="toolbar")return J(Ne,o.backstages.popup.shared.anchors.inlineDialog(),Ht,st);if(st.inline==="bottom")return re(Ne,o.backstages.popup.shared.anchors.inlineBottomDialog(),Ht,st);if(st.inline==="cursor")return J(Ne,o.backstages.popup.shared.anchors.cursor(),Ht,st)}return W(Ne,Ht)},M=(Ne,st)=>I(Ne,st),I=(Ne,st)=>{const Ht=dt=>{const lt=_0e(dt,{closeWindow:()=>{Ml.hide(lt.dialog),st(lt.instanceApi)}},c,o.backstages.dialog);return Ml.show(lt.dialog),lt.instanceApi};return A0.openUrl(Ht,Ne)},W=(Ne,st)=>{const Ht=(dt,lt,Zt)=>{const Ot=lt,mn=Sm({dataValidator:Zt,initialData:Ot,internalDialog:dt},{redial:A0.redial,closeWindow:()=>{Ml.hide(mn.dialog),st(mn.instanceApi)}},o.backstages.dialog);return Ml.show(mn.dialog),mn.instanceApi.setData(Ot),mn.instanceApi};return A0.open(Ht,Ne)},J=(Ne,st,Ht,dt)=>{const lt=(Zt,Ot,An)=>{const mn=Lre(Ot,An),In=ji(),Kn=o.backstages.popup.shared.header.isPositionedAtTop(),js={dataValidator:An,initialData:mn,internalDialog:Zt},wo=()=>In.on(Ho=>{Pa.reposition(Ho),yl.refresh(Ho)}),_s=Nf(js,{redial:A0.redial,closeWindow:()=>{In.on(Pa.hide),c.off("ResizeEditor",wo),In.clear(),Ht(_s.instanceApi)}},o.backstages.popup,dt.ariaAttrs),fs=uc(Pa.sketch({lazySink:o.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:dt.persistent?{event:"doNotDismissYet"}:{},...Kn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Tn([ks("window-manager-inline-events",[en(Xm(),(Ho,ir)=>{nr(_s.dialog,Ay)})]),...k0e(c,m,Kn)]),isExtraPart:(Ho,ir)=>Fre(ir)}));In.set(fs);const hr=()=>{const Ho=c.inline?Hi():it.fromDom(c.getContainer()),ir=li(Ho);return V.some(ir)};return Pa.showWithinBounds(fs,ru(_s.dialog),{anchor:st},hr),(!m||!Kn)&&(yl.refresh(fs),c.on("ResizeEditor",wo)),_s.instanceApi.setData(mn),Io.focusIn(_s.dialog),_s.instanceApi};return A0.open(lt,Ne)},re=(Ne,st,Ht,dt)=>{const lt=(Zt,Ot,An)=>{const mn=Lre(Ot,An),In=ji(),Kn=o.backstages.popup.shared.header.isPositionedAtTop(),js={dataValidator:An,initialData:mn,internalDialog:Zt},wo=()=>In.on(Ho=>{Pa.reposition(Ho),yl.refresh(Ho)}),_s=Nf(js,{redial:A0.redial,closeWindow:()=>{In.on(Pa.hide),c.off("ResizeEditor ScrollWindow ElementScroll",wo),In.clear(),Ht(_s.instanceApi)}},o.backstages.popup,dt.ariaAttrs),fs=uc(Pa.sketch({lazySink:o.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:dt.persistent?{event:"doNotDismissYet"}:{},...Kn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Tn([ks("window-manager-inline-events",[en(Xm(),(Ho,ir)=>{nr(_s.dialog,Ay)})]),yl.config({contextual:{lazyContext:()=>V.some(li(it.fromDom(c.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:Ho=>Kw(c,Ho.element).map(Hn=>({bounds:wS(Hn),optScrollEnv:V.some({currentScrollTop:Hn.element.dom.scrollTop,scrollElmTop:vc(Hn.element).top})})).getOrThunk(()=>({bounds:ce(),optScrollEnv:V.none()}))})]),isExtraPart:(Ho,ir)=>Fre(ir)}));In.set(fs);const hr=()=>o.backstages.popup.shared.getSink().toOptional().bind(Ho=>{const ir=Kw(c,Ho.element),Hn=15,bo=ir.map(Vo=>wS(Vo)).getOr(ce()),ls=li(it.fromDom(c.getContentAreaContainer())),Xs=Lp(ls,bo);return V.some(si(Xs.x,Xs.y,Xs.width,Xs.height-Hn))});return Pa.showWithinBounds(fs,ru(_s.dialog),{anchor:st},hr),yl.refresh(fs),c.on("ResizeEditor ScrollWindow ElementScroll",wo),_s.instanceApi.setData(mn),Io.focusIn(_s.dialog),_s.instanceApi};return A0.open(lt,Ne)};return{open:x,openUrl:M,alert:(Ne,st)=>{b.open(Ne,st)},close:Ne=>{Ne.close()},confirm:(Ne,st)=>{C.open(Ne,st)}}},A0e=o=>{RM(o),Nj(o),w6(o)};var x0e=()=>{Se.add("silver",o=>{A0e(o);let c=()=>ce();const{dialogs:m,popups:b,renderUI:C}=hQ(o,{getPopupSinkBounds:()=>c()}),x=async()=>{const W=await C();return Kw(o,b.getMothership().element).each(re=>{c=()=>wS(re)}),W};uZ.register(o,b.backstage.shared);const M=E0e({editor:o,backstages:{popup:b.backstage,dialog:m.backstage}}),I=()=>wB(o,{backstage:b.backstage},b.getMothership());return{renderUI:x,getWindowManagerImpl:X(M),getNotificationManagerImpl:I}})};x0e()})();const wCe=`.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center}.mce-content-body .mce-item-anchor:empty{cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor:not(:empty){background-position-x:2px;display:inline-block;padding-left:12px}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment[contenteditable=false]:not([data-mce-selected]),.tox-comments-visible span.tox-comment img:not([data-mce-selected]),.tox-comments-visible span.tox-comment>audio:not([data-mce-selected]),.tox-comments-visible span.tox-comment>video:not([data-mce-selected]),.tox-comments-visible span.tox-comment span.mce-preview-object:not([data-mce-selected]){outline:3px solid #ffe89d}.tox-comments-visible .tox-comment[contenteditable=false][data-mce-annotation-active=true]:not([data-mce-selected]){outline:3px solid #fed635}.tox-comments-visible span.tox-comment[data-mce-annotation-active=true] img:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]>audio:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]>video:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true] span.mce-preview-object:not([data-mce-selected]){outline:3px solid #fed635}.tox-comments-visible span.tox-comment:not([data-mce-selected]){background-color:#ffe89d;outline:none}.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]:not([data-mce-selected="inline-boundary"]){background-color:#fed635}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden):before{content:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A);cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked:before{content:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A)}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden):before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:none;text-shadow:0 1px white;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,code[class*=language-] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*=language-]::selection,pre[class*=language-] ::selection,code[class*=language-]::selection,code[class*=language-] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body *[data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body *[contentEditable=false]{cursor:default}.mce-content-body *[contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A),default}div.mce-footnotes hr{margin-inline-end:auto;margin-inline-start:0;width:25%}div.mce-footnotes li>a.mce-footnotes-backlink{text-decoration:none}@media print{sup.mce-footnote a{color:#000;text-decoration:none}div.mce-footnotes{break-inside:avoid;width:100%}div.mce-footnotes li>a.mce-footnotes-backlink{display:none}}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-content-body .mce-mergetag{cursor:default!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mce-content-body .mce-mergetag:hover{background-color:#006ce71a}.mce-content-body .mce-mergetag-affix{background-color:#006ce71a;color:#006ce7}.mce-object{background:transparent url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A) no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--21by9,.tiny-pageembed--16by9,.tiny-pageembed--4by3,.tiny-pageembed--1by1{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--21by9 iframe,.tiny-pageembed--16by9 iframe,.tiny-pageembed--4by3 iframe,.tiny-pageembed--1by1 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks):before{color:#222f3eb3;content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks):before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks):before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:1298}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-resize-backdrop{z-index:10000}.mce-content-body .mce-clonedresizable{cursor:default;opacity:.5;outline:1px dashed black;position:absolute;z-index:10001}.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,.mce-content-body .mce-clonedresizable.mce-resizetable-columns td{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10002}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor:before{background-color:inherit;border-radius:50%;content:"";display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover:after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body video[data-mce-selected],.mce-content-body audio[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body details[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body *[contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,.mce-content-body.mce-content-readonly *[contentEditable=true]:hover{outline:none}.mce-content-body *[data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:none}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:none}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]:after,.mce-content-body th[data-mce-selected]:after{background-color:#b4d7ffb3;border:1px solid rgba(180,215,255,.7);bottom:-1px;content:"";left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.mce-content-body td[data-mce-selected]:after,.mce-content-body th[data-mce-selected]:after{border-color:#0054b4b3}}.mce-content-body img[data-mce-selected]::-moz-selection{background:none}.mce-content-body img[data-mce-selected]::selection{background:none}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc ul>li{list-style-type:none}[data-mce-block]{display:block}table[style*="border-width: 0px"],.mce-item-table:not([border]),.mce-item-table[border="0"],table[style*="border-width: 0px"] td,.mce-item-table:not([border]) td,.mce-item-table[border="0"] td,table[style*="border-width: 0px"] th,.mce-item-table:not([border]) th,.mce-item-table[border="0"] th,table[style*="border-width: 0px"] caption,.mce-item-table:not([border]) caption,.mce-item-table[border="0"] caption{border:1px dashed #bbb}.mce-visualblocks p,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks section,.mce-visualblocks article,.mce-visualblocks blockquote,.mce-visualblocks address,.mce-visualblocks pre,.mce-visualblocks figure,.mce-visualblocks figcaption,.mce-visualblocks hgroup,.mce-visualblocks aside,.mce-visualblocks ul,.mce-visualblocks ol,.mce-visualblocks dl{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) ul,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) dl{margin-left:3px}.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] ul,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] dl{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy:after{content:"-"}body{font-family:sans-serif}table{border-collapse:collapse}
|
|
`;(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(xe,tt,pt)=>{var Pt;return pt(xe,tt.prototype)?!0:((Pt=xe.constructor)===null||Pt===void 0?void 0:Pt.name)===tt.name},t=xe=>{const tt=typeof xe;return xe===null?"null":tt==="object"&&Array.isArray(xe)?"array":tt==="object"&&e(xe,String,(pt,Pt)=>Pt.isPrototypeOf(pt))?"string":tt},s=xe=>tt=>t(tt)===xe,a=xe=>tt=>typeof tt===xe,u=xe=>tt=>xe===tt,f=s("string"),h=s("object"),g=s("array"),v=u(null),_=a("boolean"),A=xe=>xe==null,O=xe=>!A(xe),N=a("function"),L=(xe,tt)=>{if(g(xe)){for(let pt=0,Pt=xe.length;pt<Pt;++pt)if(!tt(xe[pt]))return!1;return!0}return!1},j=()=>{},z=xe=>()=>xe,q=(xe,tt)=>xe===tt;class ee{constructor(tt,pt){this.tag=tt,this.value=pt}static some(tt){return new ee(!0,tt)}static none(){return ee.singletonNone}fold(tt,pt){return this.tag?pt(this.value):tt()}isSome(){return this.tag}isNone(){return!this.tag}map(tt){return this.tag?ee.some(tt(this.value)):ee.none()}bind(tt){return this.tag?tt(this.value):ee.none()}exists(tt){return this.tag&&tt(this.value)}forall(tt){return!this.tag||tt(this.value)}filter(tt){return!this.tag||tt(this.value)?this:ee.none()}getOr(tt){return this.tag?this.value:tt}or(tt){return this.tag?this:tt}getOrThunk(tt){return this.tag?this.value:tt()}orThunk(tt){return this.tag?this:tt()}getOrDie(tt){if(this.tag)return this.value;throw new Error(tt!=null?tt:"Called getOrDie on None")}static from(tt){return O(tt)?ee.some(tt):ee.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(tt){this.tag&&tt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ee.singletonNone=new ee(!1);const F=Array.prototype.indexOf,oe=Array.prototype.push,te=(xe,tt)=>F.call(xe,tt),se=(xe,tt)=>te(xe,tt)>-1,X=(xe,tt)=>{const pt=xe.length,Pt=new Array(pt);for(let yn=0;yn<pt;yn++){const Ro=xe[yn];Pt[yn]=tt(Ro,yn)}return Pt},we=(xe,tt)=>{for(let pt=0,Pt=xe.length;pt<Pt;pt++){const yn=xe[pt];tt(yn,pt)}},ye=(xe,tt,pt)=>(we(xe,(Pt,yn)=>{pt=tt(pt,Pt,yn)}),pt),Te=xe=>{const tt=[];for(let pt=0,Pt=xe.length;pt<Pt;++pt){if(!g(xe[pt]))throw new Error("Arr.flatten item "+pt+" was not an array, input: "+xe);oe.apply(tt,xe[pt])}return tt},_e=(xe,tt)=>Te(X(xe,tt)),ge=(xe,tt)=>{for(let pt=0;pt<xe.length;pt++){const Pt=tt(xe[pt],pt);if(Pt.isSome())return Pt}return ee.none()},nt=(xe,tt,pt=q)=>xe.exists(Pt=>pt(Pt,tt)),Je=xe=>{const tt=[],pt=Pt=>{tt.push(Pt)};for(let Pt=0;Pt<xe.length;Pt++)xe[Pt].each(pt);return tt},ft=(xe,tt)=>xe?ee.some(tt):ee.none(),V=xe=>tt=>tt.options.get(xe),ut=xe=>{const tt=xe.options.register;tt("link_assume_external_targets",{processor:pt=>{const Pt=f(pt)||_(pt);return Pt?pt===!0?{value:1,valid:Pt}:pt==="http"||pt==="https"?{value:pt,valid:Pt}:{value:0,valid:Pt}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),tt("link_context_toolbar",{processor:"boolean",default:!1}),tt("link_list",{processor:pt=>f(pt)||N(pt)||L(pt,h)}),tt("link_default_target",{processor:"string"}),tt("link_default_protocol",{processor:"string",default:"https"}),tt("link_target_list",{processor:pt=>_(pt)||L(pt,h),default:!0}),tt("link_rel_list",{processor:"object[]",default:[]}),tt("link_class_list",{processor:"object[]",default:[]}),tt("link_title",{processor:"boolean",default:!0}),tt("allow_unsafe_link_target",{processor:"boolean",default:!1}),tt("link_quicklink",{processor:"boolean",default:!1})},et=V("link_assume_external_targets"),Et=V("link_context_toolbar"),xt=V("link_list"),He=V("link_default_target"),ct=V("link_default_protocol"),an=V("link_target_list"),kt=V("link_rel_list"),bn=V("link_class_list"),qe=V("link_title"),gt=V("allow_unsafe_link_target"),de=V("link_quicklink");var No=tinymce.util.Tools.resolve("tinymce.util.Tools");const Zn=xe=>f(xe.value)?xe.value:"",Bn=xe=>f(xe.text)?xe.text:f(xe.title)?xe.title:"",ao=(xe,tt)=>{const pt=[];return No.each(xe,Pt=>{const yn=Bn(Pt);if(Pt.menu!==void 0){const Ro=ao(Pt.menu,tt);pt.push({text:yn,items:Ro})}else{const Ro=tt(Pt);pt.push({text:yn,value:Ro})}}),pt},Wo=(xe=Zn)=>tt=>ee.from(tt).map(pt=>ao(pt,xe)),Tt={sanitize:xe=>Wo(Zn)(xe),sanitizeWith:Wo,createUi:(xe,tt)=>pt=>({name:xe,type:"listbox",label:tt,items:pt}),getValue:Zn},Be=Object.keys,Ut=Object.hasOwnProperty,gn=(xe,tt)=>{const pt=Be(xe);for(let Pt=0,yn=pt.length;Pt<yn;Pt++){const Ro=pt[Pt],Rr=xe[Ro];tt(Rr,Ro)}},wt=xe=>(tt,pt)=>{xe[pt]=tt},Yt=(xe,tt,pt,Pt)=>{gn(xe,(yn,Ro)=>{(tt(yn,Ro)?pt:Pt)(yn,Ro)})},vn=(xe,tt)=>{const pt={};return Yt(xe,tt,wt(pt),j),pt},rs=(xe,tt)=>Ut.call(xe,tt),eo=(xe,tt)=>rs(xe,tt)&&xe[tt]!==void 0&&xe[tt]!==null;var ds=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Or=tinymce.util.Tools.resolve("tinymce.util.URI");const Rs=xe=>O(xe)&&xe.nodeName.toLowerCase()==="a",Js=xe=>Rs(xe)&&!!ar(xe),Zs=(xe,tt)=>{if(xe.collapsed)return[];{const pt=xe.cloneContents(),Pt=pt.firstChild,yn=new ds(Pt,pt),Ro=[];let Rr=Pt;do tt(Rr)&&Ro.push(Rr);while(Rr=yn.next());return Ro}},ba=xe=>/^\w+:/i.test(xe),ar=xe=>{var tt,pt;return(pt=(tt=xe.getAttribute("data-mce-href"))!==null&&tt!==void 0?tt:xe.getAttribute("href"))!==null&&pt!==void 0?pt:""},Ns=(xe,tt)=>{const pt=["noopener"],Pt=xe?xe.split(/\s+/):[],yn=is=>No.trim(is.sort().join(" ")),Ro=is=>(is=Rr(is),is.length>0?is.concat(pt):pt),Rr=is=>is.filter(Ei=>No.inArray(pt,Ei)===-1),ys=tt?Ro(Pt):Rr(Pt);return ys.length>0?yn(ys):""},Zr=xe=>xe.replace(/\uFEFF/g,""),Po=(xe,tt)=>(tt=tt||Ls(xe.selection.getRng())[0]||xe.selection.getNode(),ps(tt)?ee.from(xe.dom.select("a[href]",tt)[0]):ee.from(xe.dom.getParent(tt,"a[href]"))),Mo=(xe,tt)=>Po(xe,tt).isSome(),Mr=(xe,tt)=>{const pt=tt.fold(()=>xe.getContent({format:"text"}),Pt=>Pt.innerText||Pt.textContent||"");return Zr(pt)},Ls=xe=>Zs(xe,Js),na=xe=>No.grep(xe,Js),gs=xe=>na(xe).length>0,va=xe=>Ls(xe).length>0,ln=xe=>{const tt=xe.schema.getTextInlineElements(),pt=Ro=>Ro.nodeType===1&&!Rs(Ro)&&!rs(tt,Ro.nodeName.toLowerCase());if(Po(xe).exists(Ro=>Ro.hasAttribute("data-mce-block")))return!1;const yn=xe.selection.getRng();return yn.collapsed?!0:Zs(yn,pt).length===0},ps=xe=>O(xe)&&xe.nodeName==="FIGURE"&&/\bimage\b/i.test(xe.className),Li=xe=>ye(["title","rel","class","target"],(pt,Pt)=>(xe[Pt].each(yn=>{pt[Pt]=yn.length>0?yn:null}),pt),{href:xe.href}),ze=(xe,tt)=>(tt==="http"||tt==="https")&&!ba(xe)?tt+"://"+xe:xe,Qe=(xe,tt)=>{const pt={...tt};if(kt(xe).length===0&&!gt(xe)){const Pt=Ns(pt.rel,pt.target==="_blank");pt.rel=Pt||null}return ee.from(pt.target).isNone()&&an(xe)===!1&&(pt.target=He(xe)),pt.href=ze(pt.href,et(xe)),pt},Dt=(xe,tt,pt,Pt)=>{pt.each(yn=>{rs(tt,"innerText")?tt.innerText=yn:tt.textContent=yn}),xe.dom.setAttribs(tt,Pt),xe.selection.select(tt)},Wt=(xe,tt,pt,Pt)=>{const yn=xe.dom;ps(tt)?Ir(yn,tt,Pt):pt.fold(()=>{xe.execCommand("mceInsertLink",!1,Pt)},Ro=>{xe.insertContent(yn.createHTML("a",Pt,yn.encode(Ro)))})},qn=(xe,tt,pt)=>{const Pt=xe.selection.getNode(),yn=Po(xe,Pt),Ro=Qe(xe,Li(pt));xe.undoManager.transact(()=>{pt.href===tt.href&&tt.attach(),yn.fold(()=>{Wt(xe,Pt,pt.text,Ro)},Rr=>{xe.focus(),Dt(xe,Rr,pt.text,Ro)})})},uo=xe=>{const tt=xe.dom,pt=xe.selection,Pt=pt.getBookmark(),yn=pt.getRng().cloneRange(),Ro=tt.getParent(yn.startContainer,"a[href]",xe.getBody()),Rr=tt.getParent(yn.endContainer,"a[href]",xe.getBody());Ro&&yn.setStartBefore(Ro),Rr&&yn.setEndAfter(Rr),pt.setRng(yn),xe.execCommand("unlink"),pt.moveToBookmark(Pt)},po=xe=>{xe.undoManager.transact(()=>{const tt=xe.selection.getNode();ps(tt)?Sr(xe,tt):uo(xe),xe.focus()})},un=xe=>{const{class:tt,href:pt,rel:Pt,target:yn,text:Ro,title:Rr}=xe;return vn({class:tt.getOrNull(),href:pt,rel:Pt.getOrNull(),target:yn.getOrNull(),text:Ro.getOrNull(),title:Rr.getOrNull()},(ys,is)=>v(ys)===!1)},ns=(xe,tt)=>{const pt=xe.options.get,Pt={allow_html_data_urls:pt("allow_html_data_urls"),allow_script_urls:pt("allow_script_urls"),allow_svg_data_urls:pt("allow_svg_data_urls")},yn=tt.href;return{...tt,href:Or.isDomSafe(yn,"a",Pt)?yn:""}},_o=(xe,tt,pt)=>{const Pt=ns(xe,pt);xe.hasPlugin("rtc",!0)?xe.execCommand("createlink",!1,un(Pt)):qn(xe,tt,Pt)},cs=xe=>{xe.hasPlugin("rtc",!0)?xe.execCommand("unlink"):po(xe)},Sr=(xe,tt)=>{var pt;const Pt=xe.dom.select("img",tt)[0];if(Pt){const yn=xe.dom.getParents(Pt,"a[href]",tt)[0];yn&&((pt=yn.parentNode)===null||pt===void 0||pt.insertBefore(Pt,yn),xe.dom.remove(yn))}},Ir=(xe,tt,pt)=>{var Pt;const yn=xe.select("img",tt)[0];if(yn){const Ro=xe.create("a",pt);(Pt=yn.parentNode)===null||Pt===void 0||Pt.insertBefore(Ro,yn),Ro.appendChild(yn)}},Vs=xe=>eo(xe,"items"),Ur=(xe,tt)=>ge(tt,pt=>Vs(pt)?Ur(xe,pt.items):ft(pt.value===xe,pt)),Fi=(xe,tt,pt,Pt)=>{const yn=Pt[tt],Ro=xe.length>0;return yn!==void 0?Ur(yn,pt).map(Rr=>({url:{value:Rr.value,meta:{text:Ro?xe:Rr.text,attach:j}},text:Ro?xe:Rr.text})):ee.none()},La=(xe,tt)=>tt==="link"?xe.link:tt==="anchor"?xe.anchor:ee.none(),Ke={init:(xe,tt)=>{const pt={text:xe.text,title:xe.title},Pt=is=>{var Ei;return ft(pt.title.length<=0,ee.from((Ei=is.meta)===null||Ei===void 0?void 0:Ei.title).getOr(""))},yn=is=>{var Ei;return ft(pt.text.length<=0,ee.from((Ei=is.meta)===null||Ei===void 0?void 0:Ei.text).getOr(is.value))},Ro=is=>{const Ei=yn(is.url),qs=Pt(is.url);return Ei.isSome()||qs.isSome()?ee.some({...Ei.map(Hi=>({text:Hi})).getOr({}),...qs.map(Hi=>({title:Hi})).getOr({})}):ee.none()},Rr=(is,Ei)=>{const qs=La(tt,Ei).getOr([]);return Fi(pt.text,Ei,qs,is)};return{onChange:(is,Ei)=>{const qs=Ei.name;return qs==="url"?Ro(is()):se(["anchor","link"],qs)?Rr(is(),qs):((qs==="text"||qs==="title")&&(pt[qs]=is()[qs]),ee.none())}}},getDelta:Fi};var Ge=tinymce.util.Tools.resolve("tinymce.util.Delay");const It=(xe,tt,pt)=>{const Pt=xe.selection.getRng();Ge.setEditorTimeout(xe,()=>{xe.windowManager.confirm(tt,yn=>{xe.selection.setRng(Pt),pt(yn)})})},jt=xe=>{const tt=xe.href;return tt.indexOf("@")>0&&tt.indexOf("/")===-1&&tt.indexOf("mailto:")===-1?ee.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:Pt=>({...Pt,href:"mailto:"+tt})}):ee.none()},fo=(xe,tt)=>pt=>{const Pt=pt.href;return xe===1&&!ba(Pt)||xe===0&&/^\s*www(\.|\d\.)/i.test(Pt)?ee.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${tt}:// prefix?`,preprocess:Ro=>({...Ro,href:tt+"://"+Pt})}):ee.none()},Ko={preprocess:(xe,tt)=>ge([jt,fo(et(xe),ct(xe))],pt=>pt(tt)).fold(()=>Promise.resolve(tt),pt=>new Promise(Pt=>{It(xe,pt.message,yn=>{Pt(yn?pt.preprocess(tt):tt)})}))},it={getAnchors:xe=>{const tt=xe.dom.select("a:not([href])"),pt=_e(tt,Pt=>{const yn=Pt.name||Pt.id;return yn?[{text:yn,value:"#"+yn}]:[]});return pt.length>0?ee.some([{text:"None",value:""}].concat(pt)):ee.none()}},Oi={getClasses:xe=>{const tt=bn(xe);return tt.length>0?Tt.sanitize(tt):ee.none()}},oa=xe=>{try{return ee.some(JSON.parse(xe))}catch{return ee.none()}},ur={getLinks:xe=>{const tt=Pt=>xe.convertURL(Pt.value||Pt.url||"","href"),pt=xt(xe);return new Promise(Pt=>{f(pt)?fetch(pt).then(yn=>yn.ok?yn.text().then(oa):Promise.reject()).then(Pt,()=>Pt(ee.none())):N(pt)?pt(yn=>Pt(ee.some(yn))):Pt(ee.from(pt))}).then(Pt=>Pt.bind(Tt.sanitizeWith(tt)).map(yn=>yn.length>0?[{text:"None",value:""}].concat(yn):yn))}},gc={getRels:(xe,tt)=>{const pt=kt(xe);if(pt.length>0){const Pt=nt(tt,"_blank"),yn=gt(xe)===!1,Ro=ys=>Ns(Tt.getValue(ys),Pt);return(yn?Tt.sanitizeWith(Ro):Tt.sanitize)(pt)}return ee.none()}},Ja=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Qs={getTargets:xe=>{const tt=an(xe);return g(tt)?Tt.sanitize(tt).orThunk(()=>ee.some(Ja)):tt===!1?ee.none():ee.some(Ja)}},xr=(xe,tt,pt)=>{const Pt=xe.getAttrib(tt,pt);return Pt!==null&&Pt.length>0?ee.some(Pt):ee.none()},Ki=(xe,tt)=>{const pt=xe.dom,yn=ln(xe)?ee.some(Mr(xe.selection,tt)):ee.none(),Ro=tt.bind(qs=>ee.from(pt.getAttrib(qs,"href"))),Rr=tt.bind(qs=>ee.from(pt.getAttrib(qs,"target"))),ys=tt.bind(qs=>xr(pt,qs,"rel")),is=tt.bind(qs=>xr(pt,qs,"class")),Ei=tt.bind(qs=>xr(pt,qs,"title"));return{url:Ro,text:yn,title:Ei,target:Rr,rel:ys,linkClass:is}},pc={collect:(xe,tt)=>ur.getLinks(xe).then(pt=>{const Pt=Ki(xe,tt);return{anchor:Pt,catalogs:{targets:Qs.getTargets(xe),rels:gc.getRels(xe,Pt.target),classes:Oi.getClasses(xe),anchor:it.getAnchors(xe),link:pt},optNode:tt,flags:{titleEnabled:qe(xe)}}})},Zc=(xe,tt)=>pt=>{const Pt=pt.getData();if(!Pt.url.value){cs(xe),pt.close();return}const yn=ys=>ee.from(Pt[ys]).filter(is=>!nt(tt.anchor[ys],is)),Ro={href:Pt.url.value,text:yn("text"),target:yn("target"),rel:yn("rel"),class:yn("linkClass"),title:yn("title")},Rr={href:Pt.url.value,attach:Pt.url.meta!==void 0&&Pt.url.meta.attach?Pt.url.meta.attach:j};Ko.preprocess(xe,Ro).then(ys=>{_o(xe,Rr,ys)}),pt.close()},gu=xe=>{const tt=Po(xe);return pc.collect(xe,tt)},pr=(xe,tt)=>{const pt=xe.anchor,Pt=pt.url.getOr("");return{url:{value:Pt,meta:{original:{value:Pt}}},text:pt.text.getOr(""),title:pt.title.getOr(""),anchor:Pt,link:Pt,rel:pt.rel.getOr(""),target:pt.target.or(tt).getOr(""),linkClass:pt.linkClass.getOr("")}},Qa=(xe,tt,pt)=>{const Pt=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],yn=xe.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),Ro=xe.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],Rr=ee.from(He(pt)),ys=pr(xe,Rr),is=xe.catalogs,Ei=Ke.init(ys,is);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:Te([Pt,yn,Ro,Je([is.anchor.map(Tt.createUi("anchor","Anchors")),is.rels.map(Tt.createUi("rel","Rel")),is.targets.map(Tt.createUi("target","Open link in...")),is.link.map(Tt.createUi("link","Link list")),is.classes.map(Tt.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ys,onChange:(Hi,{name:yu})=>{Ei.onChange(Hi.getData,{name:yu}).each(bd=>{Hi.setData(bd)})},onSubmit:tt}},pu=xe=>{gu(xe).then(pt=>{const Pt=Zc(xe,pt);return Qa(pt,Pt,xe)}).then(pt=>{xe.windowManager.open(pt)})},qc=xe=>{xe.addCommand("mceLink",(tt,pt)=>{(pt==null?void 0:pt.dialog)===!0||!de(xe)?pu(xe):xe.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"})})};var Vl=tinymce.util.Tools.resolve("tinymce.util.VK");const Aa=(xe,tt)=>{document.body.appendChild(xe),xe.dispatchEvent(tt),document.body.removeChild(xe)},Tr=xe=>{const tt=document.createElement("a");tt.target="_blank",tt.href=xe,tt.rel="noreferrer noopener";const pt=document.createEvent("MouseEvents");pt.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Aa(tt,pt)},Rm=(xe,tt)=>xe.dom.getParent(tt,"a[href]"),gf=xe=>Rm(xe,xe.selection.getStart()),kr=xe=>xe.altKey===!0&&xe.shiftKey===!1&&xe.ctrlKey===!1&&xe.metaKey===!1,Fa=(xe,tt)=>{if(tt){const pt=ar(tt);if(/^#/.test(pt)){const Pt=xe.dom.select(pt);Pt.length&&xe.selection.scrollIntoView(Pt[0],!0)}else Tr(tt.href)}},sa=xe=>()=>{xe.execCommand("mceLink",!1,{dialog:!0})},Yi=xe=>()=>{Fa(xe,gf(xe))},bu=xe=>{xe.on("click",tt=>{const pt=Rm(xe,tt.target);pt&&Vl.metaKeyPressed(tt)&&(tt.preventDefault(),Fa(xe,pt))}),xe.on("keydown",tt=>{if(!tt.isDefaultPrevented()&&tt.keyCode===13&&kr(tt)){const pt=gf(xe);pt&&(tt.preventDefault(),Fa(xe,pt))}})},Oc=(xe,tt)=>(xe.on("NodeChange",tt),()=>xe.off("NodeChange",tt)),Ha=xe=>tt=>{const pt=()=>{tt.setActive(!xe.mode.isReadOnly()&&Mo(xe,xe.selection.getNode())),tt.setEnabled(xe.selection.isEditable())};return pt(),Oc(xe,pt)},Mc=xe=>tt=>{const pt=()=>{tt.setEnabled(xe.selection.isEditable())};return pt(),Oc(xe,pt)},bc=xe=>(xe.selection.isCollapsed()?na(xe.dom.getParents(xe.selection.getStart())):Ls(xe.selection.getRng())).length===1,gd=xe=>tt=>{const pt=()=>tt.setEnabled(bc(xe));return pt(),Oc(xe,pt)},Bf=xe=>tt=>{const pt=Ro=>gs(Ro)||va(xe.selection.getRng()),Pt=xe.dom.getParents(xe.selection.getStart()),yn=Ro=>{tt.setEnabled(pt(Ro)&&xe.selection.isEditable())};return yn(Pt),Oc(xe,Ro=>yn(Ro.parents))},vu=xe=>{xe.addShortcut("Meta+K","",()=>{xe.execCommand("mceLink")})},Ul=xe=>{xe.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:sa(xe),onSetup:Ha(xe)}),xe.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Yi(xe),onSetup:gd(xe)}),xe.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>cs(xe),onSetup:Bf(xe)})},Rc=xe=>{xe.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Yi(xe),onSetup:gd(xe)}),xe.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:Mc(xe),onAction:sa(xe)}),xe.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>cs(xe),onSetup:Bf(xe)})},pf=xe=>{const tt="link unlink openlink",pt="link";xe.ui.registry.addContextMenu("link",{update:Pt=>xe.dom.isEditable(Pt)?gs(xe.dom.getParents(Pt,"a"))?tt:pt:""})},Gc=xe=>{const tt=yn=>{yn.selection.collapse(!1)},pt=yn=>{const Ro=xe.selection.getNode();return yn.setEnabled(Mo(xe,Ro)),j},Pt=yn=>{const Ro=Po(xe),Rr=ln(xe);if(Ro.isNone()&&Rr){const ys=Mr(xe.selection,Ro);return ft(ys.length===0,yn)}else return ee.none()};xe.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ha(xe)},label:"Link",predicate:yn=>Et(xe)&&Mo(xe,yn),initValue:()=>Po(xe).fold(z(""),ar),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:yn=>{const Ro=xe.selection.getNode();return yn.setActive(Mo(xe,Ro)),Ha(xe)(yn)},onAction:yn=>{const Ro=yn.getValue(),Rr=Pt(Ro);_o(xe,{href:Ro,attach:j},{href:Ro,text:Rr,title:ee.none(),rel:ee.none(),target:ee.none(),class:ee.none()}),tt(xe),yn.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:pt,onAction:yn=>{cs(xe),yn.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:pt,onAction:yn=>{Yi(xe)(),yn.hide()}}]})};var pd=()=>{r.add("link",xe=>{ut(xe),Ul(xe),Rc(xe),pf(xe),Gc(xe),bu(xe),qc(xe),vu(xe)})};pd()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(h,g)=>{h.focus(),h.undoManager.transact(()=>{h.setContent(g)}),h.selection.setCursorLocation(),h.nodeChanged()},t=h=>h.getContent({source_view:!0}),s=h=>{const g=t(h);h.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:g},onSubmit:v=>{e(h,v.getData().code),v.close()}})},a=h=>{h.addCommand("mceCodeEditor",()=>{s(h)})},u=h=>{const g=()=>h.execCommand("mceCodeEditor");h.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:g}),h.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:g})};var f=()=>{r.add("code",h=>(a(h),u(h),{}))};f()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=Object.getPrototypeOf,t=(he,Re,We)=>{var Bt;return We(he,Re.prototype)?!0:((Bt=he.constructor)===null||Bt===void 0?void 0:Bt.name)===Re.name},s=he=>{const Re=typeof he;return he===null?"null":Re==="object"&&Array.isArray(he)?"array":Re==="object"&&t(he,String,(We,Bt)=>Bt.isPrototypeOf(We))?"string":Re},a=he=>Re=>s(Re)===he,u=he=>Re=>typeof Re===he,f=he=>Re=>he===Re,h=(he,Re)=>v(he)&&t(he,Re,(We,Bt)=>e(We)===Bt),g=a("string"),v=a("object"),_=he=>h(he,Object),A=a("array"),O=f(null),N=u("boolean"),L=he=>he==null,j=he=>!L(he),z=u("function"),q=u("number"),ee=(he,Re)=>{if(A(he)){for(let We=0,Bt=he.length;We<Bt;++We)if(!Re(he[We]))return!1;return!0}return!1},F=()=>{};class oe{constructor(Re,We){this.tag=Re,this.value=We}static some(Re){return new oe(!0,Re)}static none(){return oe.singletonNone}fold(Re,We){return this.tag?We(this.value):Re()}isSome(){return this.tag}isNone(){return!this.tag}map(Re){return this.tag?oe.some(Re(this.value)):oe.none()}bind(Re){return this.tag?Re(this.value):oe.none()}exists(Re){return this.tag&&Re(this.value)}forall(Re){return!this.tag||Re(this.value)}filter(Re){return!this.tag||Re(this.value)?this:oe.none()}getOr(Re){return this.tag?this.value:Re}or(Re){return this.tag?this:Re}getOrThunk(Re){return this.tag?this.value:Re()}orThunk(Re){return this.tag?this:Re()}getOrDie(Re){if(this.tag)return this.value;throw new Error(Re!=null?Re:"Called getOrDie on None")}static from(Re){return j(Re)?oe.some(Re):oe.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Re){this.tag&&Re(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}oe.singletonNone=new oe(!1);const te=Object.keys,se=Object.hasOwnProperty,X=(he,Re)=>{const We=te(he);for(let Bt=0,Fn=We.length;Bt<Fn;Bt++){const Jo=We[Bt],so=he[Jo];Re(so,Jo)}},we=he=>(Re,We)=>{he[We]=Re},ye=(he,Re,We,Bt)=>{X(he,(Fn,Jo)=>{(Re(Fn,Jo)?We:Bt)(Fn,Jo)})},Te=(he,Re)=>{const We={};return ye(he,Re,we(We),F),We},_e=(he,Re)=>se.call(he,Re),ge=(he,Re)=>_e(he,Re)&&he[Re]!==void 0&&he[Re]!==null,nt=Array.prototype.push,Je=he=>{const Re=[];for(let We=0,Bt=he.length;We<Bt;++We){if(!A(he[We]))throw new Error("Arr.flatten item "+We+" was not an array, input: "+he);nt.apply(Re,he[We])}return Re},ft=(he,Re)=>Re>=0&&Re<he.length?oe.some(he[Re]):oe.none(),V=he=>ft(he,0),ut=(he,Re)=>{for(let We=0;We<he.length;We++){const Bt=Re(he[We],We);if(Bt.isSome())return Bt}return oe.none()};typeof window<"u"||Function("return this;")();const et=(he,Re,We)=>{if(g(We)||N(We)||q(We))he.setAttribute(Re,We+"");else throw console.error("Invalid call to Attribute.set. Key ",Re,":: Value ",We,":: Element ",he),new Error("Attribute value was not simple")},Et=(he,Re,We)=>{et(he.dom,Re,We)},xt=(he,Re)=>{he.dom.removeAttribute(Re)},He=(he,Re)=>{const Bt=(Re||document).createElement("div");if(Bt.innerHTML=he,!Bt.hasChildNodes()||Bt.childNodes.length>1){const Fn="HTML does not have a single root node";throw console.error(Fn,he),new Error(Fn)}return kt(Bt.childNodes[0])},ct=(he,Re)=>{const Bt=(Re||document).createElement(he);return kt(Bt)},an=(he,Re)=>{const Bt=(Re||document).createTextNode(he);return kt(Bt)},kt=he=>{if(he==null)throw new Error("Node cannot be null or undefined");return{dom:he}},qe={fromHtml:He,fromTag:ct,fromText:an,fromDom:kt,fromPoint:(he,Re,We)=>oe.from(he.dom.elementFromPoint(Re,We)).map(kt)};var gt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),de=tinymce.util.Tools.resolve("tinymce.util.URI");const No=he=>he.length>0,Zn=he=>Re=>Re.options.get(he),Bn=he=>{const Re=he.options.register;Re("image_dimensions",{processor:"boolean",default:!0}),Re("image_advtab",{processor:"boolean",default:!1}),Re("image_uploadtab",{processor:"boolean",default:!0}),Re("image_prepend_url",{processor:"string",default:""}),Re("image_class_list",{processor:"object[]"}),Re("image_description",{processor:"boolean",default:!0}),Re("image_title",{processor:"boolean",default:!1}),Re("image_caption",{processor:"boolean",default:!1}),Re("image_list",{processor:We=>{const Bt=We===!1||g(We)||ee(We,v)||z(We);return Bt?{value:We,valid:Bt}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},ao=Zn("image_dimensions"),Wo=Zn("image_advtab"),St=Zn("image_uploadtab"),Xt=Zn("image_prepend_url"),Tt=Zn("image_class_list"),Be=Zn("image_description"),Ut=Zn("image_title"),gn=Zn("image_caption"),wt=Zn("image_list"),Yt=Zn("a11y_advanced_options"),vn=Zn("automatic_uploads"),rs=he=>No(he.options.get("images_upload_url")),eo=he=>j(he.options.get("images_upload_handler")),ds=(he,Re)=>Math.max(parseInt(he,10),parseInt(Re,10)),Or=he=>new Promise(Re=>{const We=document.createElement("img"),Bt=Jo=>{We.onload=We.onerror=null,We.parentNode&&We.parentNode.removeChild(We),Re(Jo)};We.onload=()=>{const Jo=ds(We.width,We.clientWidth),so=ds(We.height,We.clientHeight),gi={width:Jo,height:so};Bt(Promise.resolve(gi))},We.onerror=()=>{Bt(Promise.reject(`Failed to get image dimensions for: ${he}`))};const Fn=We.style;Fn.visibility="hidden",Fn.position="fixed",Fn.bottom=Fn.left="0px",Fn.width=Fn.height="auto",document.body.appendChild(We),We.src=he}),Rs=he=>(he&&(he=he.replace(/px$/,"")),he),Js=he=>(he.length>0&&/^[0-9]+$/.test(he)&&(he+="px"),he),Zs=he=>{if(he.margin){const Re=String(he.margin).split(" ");switch(Re.length){case 1:he["margin-top"]=he["margin-top"]||Re[0],he["margin-right"]=he["margin-right"]||Re[0],he["margin-bottom"]=he["margin-bottom"]||Re[0],he["margin-left"]=he["margin-left"]||Re[0];break;case 2:he["margin-top"]=he["margin-top"]||Re[0],he["margin-right"]=he["margin-right"]||Re[1],he["margin-bottom"]=he["margin-bottom"]||Re[0],he["margin-left"]=he["margin-left"]||Re[1];break;case 3:he["margin-top"]=he["margin-top"]||Re[0],he["margin-right"]=he["margin-right"]||Re[1],he["margin-bottom"]=he["margin-bottom"]||Re[2],he["margin-left"]=he["margin-left"]||Re[1];break;case 4:he["margin-top"]=he["margin-top"]||Re[0],he["margin-right"]=he["margin-right"]||Re[1],he["margin-bottom"]=he["margin-bottom"]||Re[2],he["margin-left"]=he["margin-left"]||Re[3]}delete he.margin}return he},ba=(he,Re)=>{const We=wt(he);g(We)?fetch(We).then(Bt=>{Bt.ok&&Bt.json().then(Re)}):z(We)?We(Re):Re(We)},ar=(he,Re,We)=>{const Bt=()=>{We.onload=We.onerror=null,he.selection&&(he.selection.select(We),he.nodeChanged())};We.onload=()=>{!Re.width&&!Re.height&&ao(he)&&he.dom.setAttribs(We,{width:String(We.clientWidth),height:String(We.clientHeight)}),Bt()},We.onerror=Bt},Ns=he=>new Promise((Re,We)=>{const Bt=new FileReader;Bt.onload=()=>{Re(Bt.result)},Bt.onerror=()=>{var Fn;We((Fn=Bt.error)===null||Fn===void 0?void 0:Fn.message)},Bt.readAsDataURL(he)}),Zr=he=>he.nodeName==="IMG"&&(he.hasAttribute("data-mce-object")||he.hasAttribute("data-mce-placeholder")),Po=(he,Re)=>{const We=he.options.get;return de.isDomSafe(Re,"img",{allow_html_data_urls:We("allow_html_data_urls"),allow_script_urls:We("allow_script_urls"),allow_svg_data_urls:We("allow_svg_data_urls")})},Mo=gt.DOM,Mr=he=>he.style.marginLeft&&he.style.marginRight&&he.style.marginLeft===he.style.marginRight?Rs(he.style.marginLeft):"",Ls=he=>he.style.marginTop&&he.style.marginBottom&&he.style.marginTop===he.style.marginBottom?Rs(he.style.marginTop):"",na=he=>he.style.borderWidth?Rs(he.style.borderWidth):"",gs=(he,Re)=>{var We;return he.hasAttribute(Re)&&(We=he.getAttribute(Re))!==null&&We!==void 0?We:""},va=he=>he.parentNode!==null&&he.parentNode.nodeName==="FIGURE",ln=(he,Re,We)=>{We===""||We===null?he.removeAttribute(Re):he.setAttribute(Re,We)},ps=he=>{const Re=Mo.create("figure",{class:"image"});Mo.insertAfter(Re,he),Re.appendChild(he),Re.appendChild(Mo.create("figcaption",{contentEditable:"true"},"Caption")),Re.contentEditable="false"},Li=he=>{const Re=he.parentNode;j(Re)&&(Mo.insertAfter(he,Re),Mo.remove(Re))},ze=he=>{va(he)?Li(he):ps(he)},Qe=(he,Re)=>{const We=he.getAttribute("style"),Bt=Re(We!==null?We:"");Bt.length>0?(he.setAttribute("style",Bt),he.setAttribute("data-mce-style",Bt)):he.removeAttribute("style")},Dt=(he,Re)=>(We,Bt,Fn)=>{const Jo=We.style;Jo[Bt]?(Jo[Bt]=Js(Fn),Qe(We,Re)):ln(We,Bt,Fn)},Wt=(he,Re)=>he.style[Re]?Rs(he.style[Re]):gs(he,Re),qn=(he,Re)=>{const We=Js(Re);he.style.marginLeft=We,he.style.marginRight=We},uo=(he,Re)=>{const We=Js(Re);he.style.marginTop=We,he.style.marginBottom=We},po=(he,Re)=>{const We=Js(Re);he.style.borderWidth=We},un=(he,Re)=>{he.style.borderStyle=Re},ns=he=>{var Re;return(Re=he.style.borderStyle)!==null&&Re!==void 0?Re:""},_o=he=>j(he)&&he.nodeName==="FIGURE",cs=he=>he.nodeName==="IMG",Sr=he=>Mo.getAttrib(he,"alt").length===0&&Mo.getAttrib(he,"role")==="presentation",Ir=he=>Sr(he)?"":gs(he,"alt"),Vs=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),Ur=(he,Re)=>{var We;const Bt=document.createElement("img");return ln(Bt,"style",Re.style),(Mr(Bt)||Re.hspace!=="")&&qn(Bt,Re.hspace),(Ls(Bt)||Re.vspace!=="")&&uo(Bt,Re.vspace),(na(Bt)||Re.border!=="")&&po(Bt,Re.border),(ns(Bt)||Re.borderStyle!=="")&&un(Bt,Re.borderStyle),he((We=Bt.getAttribute("style"))!==null&&We!==void 0?We:"")},Fi=(he,Re)=>{const We=document.createElement("img");if(jt(he,{...Re,caption:!1},We),Ke(We,Re.alt,Re.isDecorative),Re.caption){const Bt=Mo.create("figure",{class:"image"});return Bt.appendChild(We),Bt.appendChild(Mo.create("figcaption",{contentEditable:"true"},"Caption")),Bt.contentEditable="false",Bt}else return We},La=(he,Re)=>({src:gs(Re,"src"),alt:Ir(Re),title:gs(Re,"title"),width:Wt(Re,"width"),height:Wt(Re,"height"),class:gs(Re,"class"),style:he(gs(Re,"style")),caption:va(Re),hspace:Mr(Re),vspace:Ls(Re),border:na(Re),borderStyle:ns(Re),isDecorative:Sr(Re)}),mi=(he,Re,We,Bt,Fn)=>{We[Bt]!==Re[Bt]&&Fn(he,Bt,String(We[Bt]))},Ke=(he,Re,We)=>{if(We){Mo.setAttrib(he,"role","presentation");const Bt=qe.fromDom(he);Et(Bt,"alt","")}else{if(O(Re)){const Bt=qe.fromDom(he);xt(Bt,"alt")}else{const Bt=qe.fromDom(he);Et(Bt,"alt",Re)}Mo.getAttrib(he,"role")==="presentation"&&Mo.setAttrib(he,"role","")}},Ge=(he,Re,We)=>{(We.alt!==Re.alt||We.isDecorative!==Re.isDecorative)&&Ke(he,We.alt,We.isDecorative)},It=(he,Re)=>(We,Bt,Fn)=>{he(We,Fn),Qe(We,Re)},jt=(he,Re,We)=>{const Bt=La(he,We);mi(We,Bt,Re,"caption",(Fn,Jo,so)=>ze(Fn)),mi(We,Bt,Re,"src",ln),mi(We,Bt,Re,"title",ln),mi(We,Bt,Re,"width",Dt("width",he)),mi(We,Bt,Re,"height",Dt("height",he)),mi(We,Bt,Re,"class",ln),mi(We,Bt,Re,"style",It((Fn,Jo)=>ln(Fn,"style",Jo),he)),mi(We,Bt,Re,"hspace",It(qn,he)),mi(We,Bt,Re,"vspace",It(uo,he)),mi(We,Bt,Re,"border",It(po,he)),mi(We,Bt,Re,"borderStyle",It(un,he)),Ge(We,Bt,Re)},fo=(he,Re)=>{const We=he.dom.styles.parse(Re),Bt=Zs(We),Fn=he.dom.styles.parse(he.dom.styles.serialize(Bt));return he.dom.styles.serialize(Fn)},Lo=he=>{const Re=he.selection.getNode(),We=he.dom.getParent(Re,"figure.image");return We?he.dom.select("img",We)[0]:Re&&(Re.nodeName!=="IMG"||Zr(Re))?null:Re},Ko=(he,Re)=>{var We;const Bt=he.dom,Fn=Te(he.schema.getTextBlockElements(),(so,gi)=>!he.schema.isValidChild(gi,"figure")),Jo=Bt.getParent(Re.parentNode,so=>ge(Fn,so.nodeName),he.getBody());return Jo&&(We=Bt.split(Jo,Re))!==null&&We!==void 0?We:Re},Yr=he=>{const Re=Lo(he);return Re?La(We=>fo(he,We),Re):Vs()},it=(he,Re)=>{const We=Fi(Fn=>fo(he,Fn),Re);he.dom.setAttrib(We,"data-mce-id","__mcenew"),he.focus(),he.selection.setContent(We.outerHTML);const Bt=he.dom.select('*[data-mce-id="__mcenew"]')[0];if(he.dom.setAttrib(Bt,"data-mce-id",null),_o(Bt)){const Fn=Ko(he,Bt);he.selection.select(Fn)}else he.selection.select(Bt)},Zo=(he,Re)=>{he.dom.setAttrib(Re,"src",Re.getAttribute("src"))},Oi=(he,Re)=>{if(Re){const We=he.dom.is(Re.parentNode,"figure.image")?Re.parentNode:Re;he.dom.remove(We),he.focus(),he.nodeChanged(),he.dom.isEmpty(he.getBody())&&(he.setContent(""),he.selection.setCursorLocation())}},oa=(he,Re)=>{const We=Lo(he);if(We)if(jt(Bt=>fo(he,Bt),Re,We),Zo(he,We),_o(We.parentNode)){const Bt=We.parentNode;Ko(he,Bt),he.selection.select(We.parentNode)}else he.selection.select(We),ar(he,Re,We)},ua=(he,Re)=>{const We=Re.src;return{...Re,src:Po(he,We)?We:""}},ur=(he,Re)=>{const We=Lo(he);if(We){const Fn={...La(so=>fo(he,so),We),...Re},Jo=ua(he,Fn);Fn.src?oa(he,Jo):Oi(he,We)}else Re.src&&it(he,{...Vs(),...Re})},Ja=(he=>(...Re)=>{if(Re.length===0)throw new Error("Can't merge zero objects");const We={};for(let Bt=0;Bt<Re.length;Bt++){const Fn=Re[Bt];for(const Jo in Fn)_e(Fn,Jo)&&(We[Jo]=he(We[Jo],Fn[Jo]))}return We})((he,Re)=>_(he)&&_(Re)?Ja(he,Re):Re);var fa=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Qs=tinymce.util.Tools.resolve("tinymce.util.Tools");const xr=he=>g(he.value)?he.value:"",Ki=he=>g(he.text)?he.text:g(he.title)?he.title:"",dl=(he,Re)=>{const We=[];return Qs.each(he,Bt=>{const Fn=Ki(Bt);if(Bt.menu!==void 0){const Jo=dl(Bt.menu,Re);We.push({text:Fn,items:Jo})}else{const Jo=Re(Bt);We.push({text:Fn,value:Jo})}}),We},pc=(he=xr)=>Re=>Re?oe.from(Re).map(We=>dl(We,he)):oe.none(),Zc=he=>pc(xr)(he),gu=he=>_e(he,"items"),pr=(he,Re)=>ut(he,We=>gu(We)?pr(We.items,Re):We.value===Re?oe.some(We):oe.none()),pu={sanitizer:pc,sanitize:Zc,findEntry:(he,Re)=>he.bind(We=>pr(We,Re))},Vl={makeTab:he=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]})},Aa=he=>{const Re=pu.sanitizer(Ai=>he.convertURL(Ai.value||Ai.url||"","src")),We=new Promise(Ai=>{ba(he,sc=>{Ai(Re(sc).map(Mi=>Je([[{text:"None",value:""}],Mi])))})}),Bt=pu.sanitize(Tt(he)),Fn=Wo(he),Jo=St(he),so=rs(he),gi=eo(he),hn=Yr(he),qr=Be(he),Nl=Ut(he),Xi=ao(he),ni=gn(he),bf=Yt(he),Ss=vn(he),Kc=oe.some(Xt(he)).filter(Ai=>g(Ai)&&Ai.length>0);return We.then(Ai=>({image:hn,imageList:Ai,classList:Bt,hasAdvTab:Fn,hasUploadTab:Jo,hasUploadUrl:so,hasUploadHandler:gi,hasDescription:qr,hasImageTitle:Nl,hasDimensions:Xi,hasImageCaption:ni,prependURL:Kc,hasAccessibilityOptions:bf,automaticUploads:Ss}))},Tr=he=>{const Re={name:"src",type:"urlinput",filetype:"image",label:"Source"},We=he.imageList.map(Nl=>({name:"images",type:"listbox",label:"Image list",items:Nl})),Bt={name:"alt",type:"input",label:"Alternative description",enabled:!(he.hasAccessibilityOptions&&he.image.isDecorative)},Fn={name:"title",type:"input",label:"Image title"},Jo={name:"dimensions",type:"sizeinput"},so={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},gi=he.classList.map(Nl=>({name:"classes",type:"listbox",label:"Class",items:Nl})),hn={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},qr=Nl=>Nl?{type:"grid",columns:2}:{type:"panel"};return Je([[Re],We.toArray(),he.hasAccessibilityOptions&&he.hasDescription?[so]:[],he.hasDescription?[Bt]:[],he.hasImageTitle?[Fn]:[],he.hasDimensions?[Jo]:[],[{...qr(he.classList.isSome()&&he.hasImageCaption),items:Je([gi.toArray(),he.hasImageCaption?[hn]:[]])}]])},gf={makeTab:he=>({title:"General",name:"general",items:Tr(he)}),makeItems:Tr},Fa={makeTab:he=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},sa=he=>({prevImage:pu.findEntry(he.imageList,he.image.src),prevAlt:he.image.alt,open:!0}),Yi=he=>({src:{value:he.src,meta:{}},images:he.src,alt:he.alt,title:he.title,dimensions:{width:he.width,height:he.height},classes:he.class,caption:he.caption,style:he.style,vspace:he.vspace,border:he.border,hspace:he.hspace,borderstyle:he.borderStyle,fileinput:[],isDecorative:he.isDecorative}),bu=(he,Re)=>({src:he.src.value,alt:(he.alt===null||he.alt.length===0)&&Re?null:he.alt,title:he.title,width:he.dimensions.width,height:he.dimensions.height,class:he.classes,style:he.style,caption:he.caption,hspace:he.hspace,vspace:he.vspace,border:he.border,borderStyle:he.borderstyle,isDecorative:he.isDecorative}),Oc=(he,Re)=>/^(?:[a-zA-Z]+:)?\/\//.test(Re)?oe.none():he.prependURL.bind(We=>Re.substring(0,We.length)!==We?oe.some(We+Re):oe.none()),Ha=(he,Re)=>{const We=Re.getData();Oc(he,We.src.value).each(Bt=>{Re.setData({src:{value:Bt,meta:We.src.meta}})})},Mc=(he,Re,We)=>{he.hasDescription&&g(We.alt)&&(Re.alt=We.alt),he.hasAccessibilityOptions&&(Re.isDecorative=We.isDecorative||Re.isDecorative||!1),he.hasImageTitle&&g(We.title)&&(Re.title=We.title),he.hasDimensions&&(g(We.width)&&(Re.dimensions.width=We.width),g(We.height)&&(Re.dimensions.height=We.height)),g(We.class)&&pu.findEntry(he.classList,We.class).each(Bt=>{Re.classes=Bt.value}),he.hasImageCaption&&N(We.caption)&&(Re.caption=We.caption),he.hasAdvTab&&(g(We.style)&&(Re.style=We.style),g(We.vspace)&&(Re.vspace=We.vspace),g(We.border)&&(Re.border=We.border),g(We.hspace)&&(Re.hspace=We.hspace),g(We.borderstyle)&&(Re.borderstyle=We.borderstyle))},bc=(he,Re)=>{const We=Re.getData(),Bt=We.src.meta;if(Bt!==void 0){const Fn=Ja({},We);Mc(he,Fn,Bt),Re.setData(Fn)}},gd=(he,Re,We,Bt)=>{const Fn=Bt.getData(),Jo=Fn.src.value,so=Fn.src.meta||{};!so.width&&!so.height&&Re.hasDimensions&&(No(Jo)?he.imageSize(Jo).then(gi=>{We.open&&Bt.setData({dimensions:gi})}).catch(gi=>console.error(gi)):Bt.setData({dimensions:{width:"",height:""}}))},Bf=(he,Re,We)=>{const Bt=We.getData(),Fn=pu.findEntry(he.imageList,Bt.src.value);Re.prevImage=Fn,We.setData({images:Fn.map(Jo=>Jo.value).getOr("")})},vu=(he,Re,We,Bt)=>{Ha(Re,Bt),bc(Re,Bt),gd(he,Re,We,Bt),Bf(Re,We,Bt)},Ul=(he,Re,We,Bt)=>{const Fn=Bt.getData(),Jo=pu.findEntry(Re.imageList,Fn.images);Jo.each(so=>{Fn.alt===""||We.prevImage.map(hn=>hn.text===Fn.alt).getOr(!1)?so.value===""?Bt.setData({src:so,alt:We.prevAlt}):Bt.setData({src:so,alt:so.text}):Bt.setData({src:so})}),We.prevImage=Jo,vu(he,Re,We,Bt)},Rc=(he,Re,We,Bt)=>{const Fn=Bt.getData();Bt.block("Uploading image"),V(Fn.fileinput).fold(()=>{Bt.unblock()},Jo=>{const so=URL.createObjectURL(Jo),gi=()=>{Bt.unblock(),URL.revokeObjectURL(so)},hn=qr=>{Bt.setData({src:{value:qr,meta:{}}}),Bt.showTab("general"),vu(he,Re,We,Bt)};Ns(Jo).then(qr=>{const Nl=he.createBlobCache(Jo,so,qr);Re.automaticUploads?he.uploadImage(Nl).then(Xi=>{hn(Xi.url),gi()}).catch(Xi=>{gi(),he.alertErr(Xi)}):(he.addToBlobCache(Nl),hn(Nl.blobUri()),Bt.unblock())})})},pf=(he,Re,We)=>(Bt,Fn)=>{Fn.name==="src"?vu(he,Re,We,Bt):Fn.name==="images"?Ul(he,Re,We,Bt):Fn.name==="alt"?We.prevAlt=Bt.getData().alt:Fn.name==="fileinput"?Rc(he,Re,We,Bt):Fn.name==="isDecorative"&&Bt.setEnabled("alt",!Bt.getData().isDecorative)},Gc=he=>()=>{he.open=!1},pd=he=>he.hasAdvTab||he.hasUploadUrl||he.hasUploadHandler?{type:"tabpanel",tabs:Je([[gf.makeTab(he)],he.hasAdvTab?[Vl.makeTab(he)]:[],he.hasUploadTab&&(he.hasUploadUrl||he.hasUploadHandler)?[Fa.makeTab(he)]:[]])}:{type:"panel",items:gf.makeItems(he)},xe=(he,Re,We)=>Bt=>{const Fn=Ja(Yi(Re.image),Bt.getData()),Jo={...Fn,style:Ur(We.normalizeCss,bu(Fn,!1))};he.execCommand("mceUpdateImage",!1,bu(Jo,Re.hasAccessibilityOptions)),he.editorUpload.uploadImagesAuto(),Bt.close()},tt=he=>Re=>Po(he,Re)?Or(he.documentBaseURI.toAbsolute(Re)).then(We=>({width:String(We.width),height:String(We.height)})):Promise.resolve({width:"",height:""}),pt=he=>(Re,We,Bt)=>{var Fn;return he.editorUpload.blobCache.create({blob:Re,blobUri:We,name:(Fn=Re.name)===null||Fn===void 0?void 0:Fn.replace(/\.[^\.]+$/,""),filename:Re.name,base64:Bt.split(",")[1]})},Pt=he=>Re=>{he.editorUpload.blobCache.add(Re)},yn=he=>Re=>{he.windowManager.alert(Re)},Ro=he=>Re=>fo(he,Re),Rr=he=>Re=>he.dom.parseStyle(Re),ys=he=>(Re,We)=>he.dom.serializeStyle(Re,We),is=he=>Re=>fa(he).upload([Re],!1).then(We=>{var Bt;return We.length===0?Promise.reject("Failed to upload image"):We[0].status===!1?Promise.reject((Bt=We[0].error)===null||Bt===void 0?void 0:Bt.message):We[0]}),Ei=he=>{const Re={imageSize:tt(he),addToBlobCache:Pt(he),createBlobCache:pt(he),alertErr:yn(he),normalizeCss:Ro(he),parseStyle:Rr(he),serializeStyle:ys(he),uploadImage:is(he)};return{open:()=>{Aa(he).then(Bt=>{const Fn=sa(Bt);return{title:"Insert/Edit Image",size:"normal",body:pd(Bt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Yi(Bt.image),onSubmit:xe(he,Bt,Re),onChange:pf(Re,Bt,Fn),onClose:Gc(Fn)}}).then(he.windowManager.open)}}},qs=he=>{he.addCommand("mceImage",Ei(he).open),he.addCommand("mceUpdateImage",(Re,We)=>{he.undoManager.transact(()=>ur(he,We))})},Hi=he=>{const Re=he.attr("class");return j(Re)&&/\bimage\b/.test(Re)},yu=he=>Re=>{let We=Re.length;const Bt=Fn=>{Fn.attr("contenteditable",he?"true":null)};for(;We--;){const Fn=Re[We];Hi(Fn)&&(Fn.attr("contenteditable",he?"false":null),Qs.each(Fn.getAll("figcaption"),Bt))}},bd=he=>{he.on("PreInit",()=>{he.parser.addNodeFilter("figure",yu(!0)),he.serializer.addNodeFilter("figure",yu(!1))})},Xn=he=>Re=>{const We=()=>{Re.setEnabled(he.selection.isEditable())};return he.on("NodeChange",We),We(),()=>{he.off("NodeChange",We)}},Nm=he=>{he.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Ei(he).open,onSetup:Re=>{Re.setActive(j(Lo(he)));const We=he.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",Re.setActive).unbind,Bt=Xn(he)(Re);return()=>{We(),Bt()}}}),he.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Ei(he).open,onSetup:Xn(he)}),he.ui.registry.addContextMenu("image",{update:Re=>he.selection.isEditable()&&(_o(Re)||cs(Re)&&!Zr(Re))?["image"]:[]})};var $i=()=>{r.add("image",he=>{Bn(he),bd(he),Nm(he),qs(he)})};$i()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=($,G,ve)=>{var De;return ve($,G.prototype)?!0:((De=$.constructor)===null||De===void 0?void 0:De.name)===G.name},t=$=>{const G=typeof $;return $===null?"null":G==="object"&&Array.isArray($)?"array":G==="object"&&e($,String,(ve,De)=>De.isPrototypeOf(ve))?"string":G},s=$=>G=>t(G)===$,a=$=>G=>typeof G===$,u=$=>G=>$===G,f=s("string"),h=s("array"),g=a("boolean"),v=u(void 0),_=$=>$==null,A=$=>!_($),O=a("function"),N=a("number"),L=()=>{},j=($,G)=>ve=>$(G(ve)),z=$=>()=>$,q=$=>$,ee=($,G)=>$===G;function F($,...G){return(...ve)=>{const De=G.concat(ve);return $.apply(null,De)}}const oe=$=>{$()},te=z(!1),se=z(!0);class X{constructor(G,ve){this.tag=G,this.value=ve}static some(G){return new X(!0,G)}static none(){return X.singletonNone}fold(G,ve){return this.tag?ve(this.value):G()}isSome(){return this.tag}isNone(){return!this.tag}map(G){return this.tag?X.some(G(this.value)):X.none()}bind(G){return this.tag?G(this.value):X.none()}exists(G){return this.tag&&G(this.value)}forall(G){return!this.tag||G(this.value)}filter(G){return!this.tag||G(this.value)?this:X.none()}getOr(G){return this.tag?this.value:G}or(G){return this.tag?this:G}getOrThunk(G){return this.tag?this.value:G()}orThunk(G){return this.tag?this:G()}getOrDie(G){if(this.tag)return this.value;throw new Error(G!=null?G:"Called getOrDie on None")}static from(G){return A(G)?X.some(G):X.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(G){this.tag&&G(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}X.singletonNone=new X(!1);const we=Object.keys,ye=Object.hasOwnProperty,Te=($,G)=>{const ve=we($);for(let De=0,at=ve.length;De<at;De++){const Ft=ve[De],kn=$[Ft];G(kn,Ft)}},_e=$=>(G,ve)=>{$[ve]=G},ge=($,G,ve,De)=>{Te($,(at,Ft)=>{(G(at,Ft)?ve:De)(at,Ft)})},nt=($,G)=>{const ve={};return ge($,G,_e(ve),L),ve},Je=($,G)=>{const ve=[];return Te($,(De,at)=>{ve.push(G(De,at))}),ve},ft=$=>Je($,q),V=$=>we($).length,ut=($,G)=>et($,G)?X.from($[G]):X.none(),et=($,G)=>ye.call($,G),Et=($,G)=>et($,G)&&$[G]!==void 0&&$[G]!==null,xt=$=>{for(const G in $)if(ye.call($,G))return!1;return!0},He=Array.prototype.indexOf,ct=Array.prototype.push,an=($,G)=>He.call($,G),kt=($,G)=>an($,G)>-1,bn=($,G)=>{for(let ve=0,De=$.length;ve<De;ve++){const at=$[ve];if(G(at,ve))return!0}return!1},qe=($,G)=>{const ve=[];for(let De=0;De<$;De++)ve.push(G(De));return ve},gt=($,G)=>{const ve=$.length,De=new Array(ve);for(let at=0;at<ve;at++){const Ft=$[at];De[at]=G(Ft,at)}return De},de=($,G)=>{for(let ve=0,De=$.length;ve<De;ve++){const at=$[ve];G(at,ve)}},No=($,G)=>{for(let ve=$.length-1;ve>=0;ve--){const De=$[ve];G(De,ve)}},Zn=($,G)=>{const ve=[],De=[];for(let at=0,Ft=$.length;at<Ft;at++){const kn=$[at];(G(kn,at)?ve:De).push(kn)}return{pass:ve,fail:De}},Bn=($,G)=>{const ve=[];for(let De=0,at=$.length;De<at;De++){const Ft=$[De];G(Ft,De)&&ve.push(Ft)}return ve},ao=($,G,ve)=>(No($,(De,at)=>{ve=G(ve,De,at)}),ve),Wo=($,G,ve)=>(de($,(De,at)=>{ve=G(ve,De,at)}),ve),St=($,G,ve)=>{for(let De=0,at=$.length;De<at;De++){const Ft=$[De];if(G(Ft,De))return X.some(Ft);if(ve(Ft,De))break}return X.none()},Xt=($,G)=>St($,G,te),Tt=$=>{const G=[];for(let ve=0,De=$.length;ve<De;++ve){if(!h($[ve]))throw new Error("Arr.flatten item "+ve+" was not an array, input: "+$);ct.apply(G,$[ve])}return G},Be=($,G)=>Tt(gt($,G)),Ut=($,G)=>{for(let ve=0,De=$.length;ve<De;++ve){const at=$[ve];if(G(at,ve)!==!0)return!1}return!0},gn=($,G)=>{const ve={};for(let De=0,at=$.length;De<at;De++){const Ft=$[De];ve[String(Ft)]=G(Ft,De)}return ve},wt=($,G)=>G>=0&&G<$.length?X.some($[G]):X.none(),Yt=$=>wt($,0),vn=$=>wt($,$.length-1),rs=($,G)=>{for(let ve=0;ve<$.length;ve++){const De=G($[ve],ve);if(De.isSome())return De}return X.none()},eo=8,ds=9,Or=11,Rs=1,Js=3,Zs=($,G)=>{const De=(G||document).createElement("div");if(De.innerHTML=$,!De.hasChildNodes()||De.childNodes.length>1){const at="HTML does not have a single root node";throw console.error(at,$),new Error(at)}return Ns(De.childNodes[0])},ba=($,G)=>{const De=(G||document).createElement($);return Ns(De)},ar=($,G)=>{const De=(G||document).createTextNode($);return Ns(De)},Ns=$=>{if($==null)throw new Error("Node cannot be null or undefined");return{dom:$}},Po={fromHtml:Zs,fromTag:ba,fromText:ar,fromDom:Ns,fromPoint:($,G,ve)=>X.from($.dom.elementFromPoint(G,ve)).map(Ns)},Mo=($,G)=>{const ve=$.dom;if(ve.nodeType!==Rs)return!1;{const De=ve;if(De.matches!==void 0)return De.matches(G);if(De.msMatchesSelector!==void 0)return De.msMatchesSelector(G);if(De.webkitMatchesSelector!==void 0)return De.webkitMatchesSelector(G);if(De.mozMatchesSelector!==void 0)return De.mozMatchesSelector(G);throw new Error("Browser lacks native selectors")}},Mr=$=>$.nodeType!==Rs&&$.nodeType!==ds&&$.nodeType!==Or||$.childElementCount===0,Ls=($,G)=>{const ve=G===void 0?document:G.dom;return Mr(ve)?[]:gt(ve.querySelectorAll($),Po.fromDom)},na=($,G)=>{const ve=G===void 0?document:G.dom;return Mr(ve)?X.none():X.from(ve.querySelector($)).map(Po.fromDom)},gs=($,G)=>$.dom===G.dom,va=Mo;typeof window<"u"||Function("return this;")();const ln=$=>$.dom.nodeName.toLowerCase(),ps=$=>$.dom.nodeType,Li=$=>G=>ps(G)===$,ze=$=>ps($)===eo||ln($)==="#comment",Qe=Li(Rs),Dt=Li(Js),Wt=Li(ds),qn=Li(Or),uo=$=>G=>Qe(G)&&ln(G)===$,po=$=>Po.fromDom($.dom.ownerDocument),un=$=>Wt($)?$:po($),ns=$=>X.from($.dom.parentNode).map(Po.fromDom),_o=($,G)=>{const ve=O(G)?G:te;let De=$.dom;const at=[];for(;De.parentNode!==null&&De.parentNode!==void 0;){const Ft=De.parentNode,kn=Po.fromDom(Ft);if(at.push(kn),ve(kn)===!0)break;De=Ft}return at},cs=$=>X.from($.dom.previousSibling).map(Po.fromDom),Sr=$=>X.from($.dom.nextSibling).map(Po.fromDom),Ir=$=>gt($.dom.childNodes,Po.fromDom),Vs=($,G)=>{const ve=$.dom.childNodes;return X.from(ve[G]).map(Po.fromDom)},Ur=$=>Vs($,0),Fi=$=>qn($)&&A($.dom.host),mi=O(Element.prototype.attachShadow)&&O(Node.prototype.getRootNode)?$=>Po.fromDom($.dom.getRootNode()):un,Ke=$=>{const G=mi($);return Fi(G)?X.some(G):X.none()},Ge=$=>Po.fromDom($.dom.host),It=$=>{const G=Dt($)?$.dom.parentNode:$.dom;if(G==null||G.ownerDocument===null)return!1;const ve=G.ownerDocument;return Ke(Po.fromDom(G)).fold(()=>ve.body.contains(G),j(It,Ge))};var jt=($,G,ve,De,at)=>$(ve,De)?X.some(ve):O(at)&&at(ve)?X.none():G(ve,De,at);const fo=($,G,ve)=>{let De=$.dom;const at=O(ve)?ve:te;for(;De.parentNode;){De=De.parentNode;const Ft=Po.fromDom(De);if(G(Ft))return X.some(Ft);if(at(Ft))break}return X.none()},Lo=($,G,ve)=>jt((at,Ft)=>Ft(at),fo,$,G,ve),Ko=($,G)=>{const ve=at=>G(Po.fromDom(at));return Xt($.dom.childNodes,ve).map(Po.fromDom)},Yr=($,G,ve)=>fo($,De=>Mo(De,G),ve),it=($,G)=>Ko($,ve=>Mo(ve,G)),Zo=($,G)=>na(G,$),Oi=($,G,ve)=>jt((at,Ft)=>Mo(at,Ft),Yr,$,G,ve),oa=$=>Oi($,"[contenteditable]"),ua=($,G=!1)=>It($)?$.dom.isContentEditable:oa($).fold(z(G),ve=>ur(ve)==="true"),ur=$=>$.dom.contentEditable,Dc=$=>$.nodeName.toLowerCase(),gc=$=>Po.fromDom($.getBody()),Ja=$=>G=>gs(G,gc($)),fa=$=>$?$.replace(/px$/,""):"",Qs=$=>/^\d+(\.\d+)?$/.test($)?$+"px":$,xr=$=>Po.fromDom($.selection.getStart()),Ki=$=>Po.fromDom($.selection.getEnd()),dl=$=>Lo($,uo("table")).forall(ua),pc=($,G)=>Bn(Ir($),G),Zc=($,G)=>{let ve=[];return de(Ir($),De=>{G(De)&&(ve=ve.concat([De])),ve=ve.concat(Zc(De,G))}),ve},gu=($,G)=>pc($,ve=>Mo(ve,G)),pr=($,G)=>Ls(G,$),Qa=($,G,ve)=>{if(f(ve)||g(ve)||N(ve))$.setAttribute(G,ve+"");else throw console.error("Invalid call to Attribute.set. Key ",G,":: Value ",ve,":: Element ",$),new Error("Attribute value was not simple")},pu=($,G,ve)=>{Qa($.dom,G,ve)},qc=($,G)=>{const ve=$.dom;Te(G,(De,at)=>{Qa(ve,at,De)})},Vl=($,G)=>{const ve=$.dom.getAttribute(G);return ve===null?void 0:ve},Aa=($,G)=>X.from(Vl($,G)),Tr=($,G)=>{$.dom.removeAttribute(G)},Rm=$=>Wo($.dom.attributes,(G,ve)=>(G[ve.name]=ve.value,G),{}),gf=($,G,ve=ee)=>$.exists(De=>ve(De,G)),kr=$=>{const G=[],ve=De=>{G.push(De)};for(let De=0;De<$.length;De++)$[De].each(ve);return G},Fa=($,G,ve)=>$.isSome()&&G.isSome()?X.some(ve($.getOrDie(),G.getOrDie())):X.none(),sa=$=>$.bind(q),Yi=($,G)=>$?X.some(G):X.none(),bu=($,G)=>$.substring(G),Oc=($,G,ve)=>G===""||$.length>=G.length&&$.substr(ve,ve+G.length)===G,Ha=($,G)=>Mc($,G)?bu($,G.length):$,Mc=($,G)=>Oc($,G,0),gd=($=>G=>G.replace($,""))(/^\s+|\s+$/g),Bf=$=>$.length>0,vu=$=>!Bf($),Ul=($,G=10)=>{const ve=parseInt($,G);return isNaN(ve)?X.none():X.some(ve)},Rc=$=>{const G=parseFloat($);return isNaN(G)?X.none():X.some(G)},pf=$=>$.style!==void 0&&O($.style.getPropertyValue),Gc=($,G,ve)=>{if(!f(ve))throw console.error("Invalid call to CSS.set. Property ",G,":: Value ",ve,":: Element ",$),new Error("CSS value must be a string: "+ve);pf($)&&$.style.setProperty(G,ve)},pd=($,G)=>{pf($)&&$.style.removeProperty(G)},xe=($,G,ve)=>{const De=$.dom;Gc(De,G,ve)},tt=($,G)=>{const ve=$.dom,at=window.getComputedStyle(ve).getPropertyValue(G);return at===""&&!It($)?pt(ve,G):at},pt=($,G)=>pf($)?$.style.getPropertyValue(G):"",Pt=($,G)=>{const ve=$.dom,De=pt(ve,G);return X.from(De).filter(at=>at.length>0)},yn=($,G)=>{const ve=$.dom;pd(ve,G),gf(Aa($,"style").map(gd),"")&&Tr($,"style")},Ro=($,G,ve=0)=>Aa($,G).map(De=>parseInt(De,10)).getOr(ve),Rr=($,G)=>ys($,G,se),ys=($,G,ve)=>Be(Ir($),De=>Mo(De,G)?ve(De)?[De]:[]:ys(De,G,ve)),is=["tfoot","thead","tbody","colgroup"],Ei=$=>kt(is,$),qs=($,G)=>({rows:$,columns:G}),Hi=($,G,ve)=>({element:$,rowspan:G,colspan:ve}),yu=($,G,ve,De,at,Ft)=>({element:$,rowspan:G,colspan:ve,row:De,column:at,isLocked:Ft}),bd=($,G,ve)=>({element:$,cells:G,section:ve}),Xn=($,G,ve,De)=>({startRow:$,startCol:G,finishRow:ve,finishCol:De}),Nm=($,G,ve)=>({element:$,colspan:G,column:ve}),$i=($,G)=>({element:$,columns:G}),he=($,G,ve=te)=>{if(ve(G))return X.none();if(kt($,ln(G)))return X.some(G);const De=at=>Mo(at,"table")||ve(at);return Yr(G,$.join(","),De)},Re=($,G)=>he(["td","th"],$,G),We=$=>Rr($,"th,td"),Bt=$=>Mo($,"colgroup")?gu($,"col"):Be(so($),G=>gu(G,"col")),Fn=($,G)=>Oi($,"table",G),Jo=$=>Rr($,"tr"),so=$=>Fn($).fold(z([]),G=>gu(G,"colgroup")),gi=($,G)=>gt($,ve=>{if(ln(ve)==="colgroup"){const De=gt(Bt(ve),at=>{const Ft=Ro(at,"span",1);return Hi(at,1,Ft)});return bd(ve,De,"colgroup")}else{const De=gt(We(ve),at=>{const Ft=Ro(at,"rowspan",1),kn=Ro(at,"colspan",1);return Hi(at,Ft,kn)});return bd(ve,De,G(ve))}}),hn=$=>ns($).map(G=>{const ve=ln(G);return Ei(ve)?ve:"tbody"}).getOr("tbody"),qr=$=>{const G=Jo($),De=[...so($),...G];return gi(De,hn)},Nl="data-snooker-locked-cols",Xi=$=>Aa($,Nl).bind(G=>X.from(G.match(/\d+/g))).map(G=>gn(G,se)),ni=($,G)=>$+","+G,bf=($,G,ve)=>X.from($.access[ni(G,ve)]),Ss=($,G,ve)=>{const De=Kc($,at=>ve(G,at.element));return De.length>0?X.some(De[0]):X.none()},Kc=($,G)=>{const ve=Be($.all,De=>De.cells);return Bn(ve,G)},Ai=$=>{const G={};let ve=0;return de($.cells,De=>{const at=De.colspan;qe(at,Ft=>{const kn=ve+Ft;G[kn]=Nm(De.element,at,kn)}),ve+=at}),G},sc=$=>{const G={},ve=[],at=Yt($).map(Bc=>Bc.element).bind(Fn).bind(Xi).getOr({});let Ft=0,kn=0,Ln=0;const{pass:jo,fail:Qo}=Zn($,Bc=>Bc.section==="colgroup");de(Qo,Bc=>{const Qc=[];de(Bc.cells,Gu=>{let kf=0;for(;G[ni(Ln,kf)]!==void 0;)kf++;const oh=Et(at,kf.toString()),sh=yu(Gu.element,Gu.rowspan,Gu.colspan,Ln,kf,oh);for(let lr=0;lr<Gu.colspan;lr++)for(let Um=0;Um<Gu.rowspan;Um++){const Wm=Ln+Um,ea=kf+lr,eu=ni(Wm,ea);G[eu]=sh,kn=Math.max(kn,ea+1)}Qc.push(sh)}),Ft++,ve.push(bd(Bc.element,Qc,Bc.section)),Ln++});const{columns:vi,colgroups:tr}=vn(jo).map(Bc=>{const Qc=Ai(Bc);return{colgroups:[$i(Bc.element,ft(Qc))],columns:Qc}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:qs(Ft,kn),access:G,all:ve,columns:vi,colgroups:tr}},$u={fromTable:$=>{const G=qr($);return sc(G)},generate:sc,getAt:bf,findItem:Ss,filterItems:Kc,justCells:$=>Be($.all,G=>G.cells),justColumns:$=>ft($.columns),hasColumns:$=>we($.columns).length>0,getColumnAt:($,G)=>X.from($.columns[G])};var zu=tinymce.util.Tools.resolve("tinymce.util.Tools");const vc=($,G,ve)=>{const De=$.select("td,th",G);let at;for(let Ft=0;Ft<De.length;Ft++){const kn=$.getStyle(De[Ft],ve);if(v(at)&&(at=kn),at!==kn)return""}return at},Hf=($,G,ve)=>{zu.each("left center right".split(" "),De=>{De!==ve&&$.formatter.remove("align"+De,{},G)}),ve&&$.formatter.apply("align"+ve,{},G)},jd=($,G,ve)=>{zu.each("top middle bottom".split(" "),De=>{De!==ve&&$.formatter.remove("valign"+De,{},G)}),ve&&$.formatter.apply("valign"+ve,{},G)},Xr=($,G,ve)=>{$.dispatch("TableModified",{...ve,table:G})},Ji=($,G)=>Rc($).getOr(G),$a=($,G,ve)=>Ji(tt($,G),ve),U0=($,G,ve,De)=>{const at=$a($,`padding-${ve}`,0),Ft=$a($,`padding-${De}`,0),kn=$a($,`border-${ve}-width`,0),Ln=$a($,`border-${De}-width`,0);return G-at-Ft-kn-Ln},xi=($,G)=>{const ve=$.dom,De=ve.getBoundingClientRect().width||ve.offsetWidth;return G==="border-box"?De:U0($,De,"left","right")},el=$=>xi($,"content-box");var Ng=tinymce.util.Tools.resolve("tinymce.Env");const $f="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",yc=qe(5,$=>{const G=`${$+1}px`;return{title:G,value:G}}),vf=gt(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],$=>({title:$,value:$.toLowerCase()})),Dr="100%",Vu=$=>{var G;const ve=$.dom,De=(G=ve.getParent($.selection.getStart(),ve.isBlock))!==null&&G!==void 0?G:$.getBody();return el(Po.fromDom(De))+"px"},Pl=($,G)=>Bm($)||!yf($)?G:Bp($)?{...G,width:Vu($)}:{...G,width:Dr},za=($,G)=>Bm($)||yf($)?G:Bp($)?{...G,width:Vu($)}:{...G,width:Dr},qi=$=>G=>G.options.get($),zi=$=>{const G=$.options.register;G("table_border_widths",{processor:"object[]",default:yc}),G("table_border_styles",{processor:"object[]",default:vf}),G("table_cell_advtab",{processor:"boolean",default:!0}),G("table_row_advtab",{processor:"boolean",default:!0}),G("table_advtab",{processor:"boolean",default:!0}),G("table_appearance_options",{processor:"boolean",default:!0}),G("table_grid",{processor:"boolean",default:!Ng.deviceType.isTouch()}),G("table_cell_class_list",{processor:"object[]",default:[]}),G("table_row_class_list",{processor:"object[]",default:[]}),G("table_class_list",{processor:"object[]",default:[]}),G("table_toolbar",{processor:"string",default:$f}),G("table_background_color_map",{processor:"object[]",default:[]}),G("table_border_color_map",{processor:"object[]",default:[]})},rc=qi("table_sizing_mode"),zf=qi("table_border_widths"),Zd=qi("table_border_styles"),Pg=qi("table_cell_advtab"),Pm=qi("table_row_advtab"),Il=qi("table_advtab"),Im=qi("table_appearance_options"),tl=qi("table_grid"),yf=qi("table_style_by_css"),zh=qi("table_cell_class_list"),Uu=qi("table_row_class_list"),Vh=qi("table_class_list"),Nc=qi("table_toolbar"),Uh=qi("table_background_color_map"),wf=qi("table_border_color_map"),Bp=$=>rc($)==="fixed",Bm=$=>rc($)==="responsive",Vf=$=>{const G=$.options,ve=G.get("table_default_styles");return G.isSet("table_default_styles")?ve:Pl($,ve)},Wl=$=>{const G=$.options,ve=G.get("table_default_attributes");return G.isSet("table_default_attributes")?ve:za($,ve)},Ig=($,G)=>G.column>=$.startCol&&G.column+G.colspan-1<=$.finishCol&&G.row>=$.startRow&&G.row+G.rowspan-1<=$.finishRow,Ye=($,G)=>{let ve=!0;const De=F(Ig,G);for(let at=G.startRow;at<=G.finishRow;at++)for(let Ft=G.startCol;Ft<=G.finishCol;Ft++)ve=ve&&$u.getAt($,at,Ft).exists(De);return ve?X.some(G):X.none()},qd=($,G)=>Xn(Math.min($.row,G.row),Math.min($.column,G.column),Math.max($.row+$.rowspan-1,G.row+G.rowspan-1),Math.max($.column+$.colspan-1,G.column+G.colspan-1)),wu=($,G,ve)=>{const De=$u.findItem($,G,gs),at=$u.findItem($,ve,gs);return De.bind(Ft=>at.map(kn=>qd(Ft,kn)))},Bg=($,G,ve)=>wu($,G,ve).bind(De=>Ye($,De)),L1=($,G,ve)=>{const De=Wh($);return Bg(De,G,ve)},Wh=$u.fromTable,bt=($,G)=>{ns($).each(De=>{De.dom.insertBefore(G.dom,$.dom)})},cn=($,G)=>{Sr($).fold(()=>{ns($).each(at=>{To(at,G)})},De=>{bt(De,G)})},rn=($,G)=>{Ur($).fold(()=>{To($,G)},De=>{$.dom.insertBefore(G.dom,De.dom)})},To=($,G)=>{$.dom.appendChild(G.dom)},er=($,G)=>{bt($,G),To(G,$)},Wr=($,G)=>{de(G,(ve,De)=>{const at=De===0?$:G[De-1];cn(at,ve)})},ai=($,G)=>{de(G,ve=>{To($,ve)})},pi=$=>{const G=$.dom;G.parentNode!==null&&G.parentNode.removeChild(G)},Gd=$=>{const G=Ir($);G.length>0&&Wr($,G),pi($)},ya=(($,G)=>{const ve=Ft=>{if(!$(Ft))throw new Error("Can only get "+G+" value of a "+G+" node");return De(Ft).getOr("")},De=Ft=>$(Ft)?X.from(Ft.dom.nodeValue):X.none();return{get:ve,getOption:De,set:(Ft,kn)=>{if(!$(Ft))throw new Error("Can only set raw "+G+" value of a "+G+" node");Ft.dom.nodeValue=kn}}})(Dt,"text"),vd=$=>ya.get($),Lg=($,G)=>ya.set($,G);var nl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],xa=()=>{const $=Qo=>Po.fromDom(Qo.dom.cloneNode(!1)),G=Qo=>un(Qo).dom,ve=Qo=>Qe(Qo)?ln(Qo)==="body"?!0:kt(nl,ln(Qo)):!1,De=Qo=>Qe(Qo)?kt(["br","img","hr","input"],ln(Qo)):!1,at=Qo=>Qe(Qo)&&Vl(Qo,"contenteditable")==="false",Ft=(Qo,vi)=>Qo.dom.compareDocumentPosition(vi.dom),kn=(Qo,vi)=>{const tr=Rm(Qo);qc(vi,tr)},Ln=Qo=>{const vi=ln(Qo);return kt(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],vi)},jo=Qo=>Qe(Qo)?Aa(Qo,"lang"):X.none();return{up:z({selector:Yr,closest:Oi,predicate:fo,all:_o}),down:z({selector:pr,predicate:Zc}),styles:z({get:tt,getRaw:Pt,set:xe,remove:yn}),attrs:z({get:Vl,set:pu,remove:Tr,copyTo:kn}),insert:z({before:bt,after:cn,afterAll:Wr,append:To,appendAll:ai,prepend:rn,wrap:er}),remove:z({unwrap:Gd,remove:pi}),create:z({nu:Po.fromTag,clone:$,text:Po.fromText}),query:z({comparePosition:Ft,prevSibling:cs,nextSibling:Sr}),property:z({children:Ir,name:ln,parent:ns,document:G,isText:Dt,isComment:ze,isElement:Qe,isSpecial:Ln,getLanguage:jo,getText:vd,setText:Lg,isBoundary:ve,isEmptyTag:De,isNonEditable:at}),eq:gs,is:va}};const Wu=($,G,ve,De)=>{const at=ve[0],Ft=ve.slice(1);return De($,G,at,Ft)},oi=($,G,ve)=>ve.length>0?Wu($,G,ve,_u):X.none(),_u=($,G,ve,De)=>{const at=G($,ve);return ao(De,(Ft,kn)=>{const Ln=G($,kn);return ic($,Ft,Ln)},at)},ic=($,G,ve)=>G.bind(De=>ve.filter(F($.eq,De))),jh=oi,F1=xa(),Kd=($,G)=>jh(F1,(ve,De)=>$(De),G),Fg=$=>Yr($,"table"),Yd=($,G)=>{const ve=pr($,G);return ve.length>0?X.some(ve):X.none()},jl=($,G,ve)=>Zo($,G).bind(De=>Zo($,ve).bind(at=>Kd(Fg,[De,at]).map(Ft=>({first:De,last:at,table:Ft})))),Zh=($,G)=>Yd($,G),H1=($,G,ve)=>jl($,G,ve).bind(De=>{const at=jo=>gs($,jo),Ft="thead,tfoot,tbody,table",kn=Yr(De.first,Ft,at),Ln=Yr(De.last,Ft,at);return kn.bind(jo=>Ln.bind(Qo=>gs(jo,Qo)?L1(De.table,De.first,De.last):X.none()))}),Lm=$=>gt($,Po.fromDom),Hg="data-mce-selected",qh="td["+Hg+"],th["+Hg+"]",Xd="data-mce-first-selected",yd="td["+Xd+"],th["+Xd+"]",si="data-mce-last-selected",li="td["+si+"],th["+si+"]",Bl={selected:Hg,selectedSelector:qh,firstSelected:Xd,firstSelectedSelector:yd,lastSelected:si,lastSelectedSelector:li},Lp=$=>Fn($).bind(G=>Zh(G,Bl.firstSelectedSelector)).fold(z($),G=>G[0]),Q=$=>(G,ve)=>{const De=ln(G),at=De==="col"||De==="colgroup"?Lp(G):G;return Oi(at,$,ve)},ce=Q("th,td,caption"),Se=Q("th,td"),Xe=$=>Lm($.model.table.getSelectedCells()),rt=($,G)=>{const ve=Se($),De=ve.bind(at=>Fn(at)).map(at=>Jo(at));return Fa(ve,De,(at,Ft)=>Bn(Ft,kn=>bn(Lm(kn.dom.cells),Ln=>Vl(Ln,G)==="1"||gs(Ln,at)))).getOr([])},On=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Cn=$=>({value:Er($)}),Yo=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,os=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ho=$=>Yo.test($)||os.test($),Er=$=>Ha($,"#").toUpperCase(),Zl=$=>ho($)?X.some({value:Er($)}):X.none(),ra=$=>{const G=$.toString(16);return(G.length===1?"0"+G:G).toUpperCase()},Ri=$=>{const G=ra($.red)+ra($.green)+ra($.blue);return Cn(G)},Cu=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Ta=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Gh=($,G,ve,De)=>({red:$,green:G,blue:ve,alpha:De}),Fm=($,G,ve,De)=>{const at=parseInt($,10),Ft=parseInt(G,10),kn=parseInt(ve,10),Ln=parseFloat(De);return Gh(at,Ft,kn,Ln)},Vi=$=>{if($==="transparent")return X.some(Gh(0,0,0,0));const G=Cu.exec($);if(G!==null)return X.some(Fm(G[1],G[2],G[3],"1"));const ve=Ta.exec($);return ve!==null?X.some(Fm(ve[1],ve[2],ve[3],ve[4])):X.none()},wa=$=>Zl($).orThunk(()=>Vi($).map(Ri)).getOrThunk(()=>{const G=document.createElement("canvas");G.height=1,G.width=1;const ve=G.getContext("2d");ve.clearRect(0,0,G.width,G.height),ve.fillStyle="#FFFFFF",ve.fillStyle=$,ve.fillRect(0,0,1,1);const De=ve.getImageData(0,0,1,1).data,at=De[0],Ft=De[1],kn=De[2],Ln=De[3];return Ri(Gh(at,Ft,kn,Ln))}),Yc=$=>Vi($).map(Ri).map(G=>"#"+G.value).getOr($),Jd=$=>{let G=$;return{get:()=>G,set:at=>{G=at}}},Qi=$=>{const G=Jd(X.none()),ve=()=>G.get().each($);return{clear:()=>{ve(),G.set(X.none())},isSet:()=>G.get().isSome(),get:()=>G.get(),set:Ln=>{ve(),G.set(X.some(Ln))}}},j0=()=>Qi($=>$.unbind()),yv=($,G,ve)=>De=>{const at=j0(),Ft=vu(ve),kn=()=>{const Ln=Xe($),jo=Qo=>$.formatter.match(G,{value:ve},Qo.dom,Ft);Ft?(De.setActive(!bn(Ln,jo)),at.set($.formatter.formatChanged(G,Qo=>De.setActive(!Qo),!0))):(De.setActive(Ut(Ln,jo)),at.set($.formatter.formatChanged(G,De.setActive,!1,{value:ve})))};return $.initialized?kn():$.on("init",kn),at.clear},Jr=$=>Et($,"menu"),wd=$=>gt($,G=>{const ve=G.text||G.title||"";return Jr(G)?{text:ve,items:wd(G.menu)}:{text:ve,value:G.value}}),br=($,G,ve,De)=>gt(G,at=>{const Ft=at.text||at.title;return Jr(at)?{type:"nestedmenuitem",text:Ft,getSubmenuItems:()=>br($,at.menu,ve,De)}:{text:Ft,type:"togglemenuitem",onAction:()=>De(at.value),onSetup:yv($,ve,at.value)}}),ql=($,G)=>ve=>{$.execCommand("mceTableApplyCellStyle",!1,{[G]:ve})},Uf=$=>Be($,G=>Jr(G)?[{...G,menu:Uf(G.menu)}]:Bf(G.value)?[G]:[]),Qd=($,G,ve,De)=>at=>at(br($,G,ve,De)),Ae=($,G,ve)=>{const De=gt(G,at=>({text:at.title,value:"#"+wa(at.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:De.length>0?De:void 0,allowCustomColors:!1},onAction:at=>{const Ft=at.value==="remove"?"":at.value;$.execCommand("mceTableApplyCellStyle",!1,{[ve]:Ft})}}]},_f=$=>()=>{const ve=$.queryCommandValue("mceTableRowType")==="header"?"body":"header";$.execCommand("mceTableRowType",!1,{type:ve})},$g=$=>()=>{const ve=$.queryCommandValue("mceTableColType")==="th"?"td":"th";$.execCommand("mceTableColType",!1,{type:ve})},Su=$=>{const G=wd(zh($));return G.length>0?X.some({name:"class",type:"listbox",label:"Class",items:G}):X.none()},ci=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:On}],wv=$=>ci.concat(Su($).toArray()),$1=($,G)=>{const De=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(wd(Zd($)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:G==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(De):De}},Wf={normal:($,G)=>{const ve=$.dom;return{setAttrib:(kn,Ln)=>{ve.setAttrib(G,kn,Ln)},setStyle:(kn,Ln)=>{ve.setStyle(G,kn,Ln)},setFormat:(kn,Ln)=>{Ln===""?$.formatter.remove(kn,{value:null},G,!0):$.formatter.apply(kn,{value:Ln},G)}}}},Hm=uo("th"),zg=($,G)=>$&&G?"sectionCells":$?"section":"cells",_v=$=>{const G=$.section==="thead",ve=gf(Cf($.cells),"th");return $.section==="tfoot"?{type:"footer"}:G||ve?{type:"header",subType:zg(G,ve)}:{type:"body"}},Cf=$=>{const G=Bn($,ve=>Hm(ve.element));return G.length===0?X.some("td"):G.length===$.length?X.some("th"):X.none()},h2=$=>{const G=gt($,at=>_v(at).type),ve=kt(G,"header"),De=kt(G,"footer");if(!ve&&!De)return X.some("body");{const at=kt(G,"body");return ve&&!at&&!De?X.some("header"):!ve&&!at&&De?X.some("footer"):X.none()}},ku=$=>{let G=!1,ve;return(...De)=>(G||(G=!0,ve=$.apply(null,De)),ve)},ju=($,G)=>rs($.all,ve=>Xt(ve.cells,De=>gs(G,De.element))),q0=($,G,ve)=>{const De=gt(G.selection,Ft=>Re(Ft).bind(kn=>ju($,kn)).filter(ve)),at=kr(De);return Yi(at.length>0,at)},G0=($,G)=>G.mergable,K0=($,G)=>G.unmergable,z1=($,G)=>q0($,G,se),jf=($,G)=>ju($,G).exists(ve=>!ve.isLocked),Y0=($,G)=>Ut(G,ve=>jf($,ve)),X0=($,G)=>G0($,G).filter(ve=>Y0($,ve.cells)),hl=($,G)=>K0($,G).filter(ve=>Y0($,ve));({...{generate:$=>{if(!h($))throw new Error("cases must be an array");if($.length===0)throw new Error("there must be at least one case");const G=[],ve={};return de($,(De,at)=>{const Ft=we(De);if(Ft.length!==1)throw new Error("one and only one name per case");const kn=Ft[0],Ln=De[kn];if(ve[kn]!==void 0)throw new Error("duplicate key detected:"+kn);if(kn==="cata")throw new Error("cannot have a case named cata (sorry)");if(!h(Ln))throw new Error("case arguments must be an array");G.push(kn),ve[kn]=(...jo)=>{const Qo=jo.length;if(Qo!==Ln.length)throw new Error("Wrong number of arguments to case "+kn+". Expected "+Ln.length+" ("+Ln+"), got "+Qo);return{fold:(...tr)=>{if(tr.length!==$.length)throw new Error("Wrong number of arguments to fold. Expected "+$.length+", got "+tr.length);return tr[at].apply(null,jo)},match:tr=>{const vr=we(tr);if(G.length!==vr.length)throw new Error("Wrong number of arguments to match. Expected: "+G.join(",")+`
|
|
Actual: `+vr.join(","));if(!Ut(G,Qc=>kt(vr,Qc)))throw new Error("Not all branches were specified when using match. Specified: "+vr.join(", ")+`
|
|
Required: `+G.join(", "));return tr[kn].apply(null,jo)},log:tr=>{console.log(tr,{constructors:G,constructor:kn,params:jo})}}}}),ve}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Qn=($,G)=>{const ve=$u.fromTable($);return z1(ve,G).bind(at=>{const Ft=at[at.length-1],kn=at[0].row,Ln=Ft.row+Ft.rowspan,jo=ve.all.slice(kn,Ln);return h2(jo)}).getOr("")},wc=$=>Mc($,"rgb")?Yc($):$,Sf=$=>{const G=Po.fromDom($);return{borderwidth:Pt(G,"border-width").getOr(""),borderstyle:Pt(G,"border-style").getOr(""),bordercolor:Pt(G,"border-color").map(wc).getOr(""),backgroundcolor:Pt(G,"background-color").map(wc).getOr("")}},eh=$=>{const G=$[0],ve=$.slice(1);return de(ve,De=>{de(we(G),at=>{Te(De,(Ft,kn)=>{const Ln=G[at];Ln!==""&&at===kn&&Ln!==Ft&&(G[at]="")})})}),G},Pc=($,G,ve,De)=>Xt($,at=>!v(ve.formatter.matchNode(De,G+at))).getOr(""),Vg=F(Pc,["left","center","right"],"align"),Cd=F(Pc,["top","middle","bottom"],"valign"),ml=($,G)=>{const ve=Vf($),De=Wl($),at=()=>({borderstyle:ut(ve,"border-style").getOr(""),bordercolor:wc(ut(ve,"border-color").getOr("")),backgroundcolor:wc(ut(ve,"background-color").getOr(""))}),Ft={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},kn=()=>{const vi=ve["border-width"];return yf($)&&vi?{border:vi}:ut(De,"border").fold(()=>({}),tr=>({border:tr}))},Ln=G?at():{},jo=()=>{const vi=ut(ve,"border-spacing").or(ut(De,"cellspacing")).fold(()=>({}),vr=>({cellspacing:vr})),tr=ut(ve,"border-padding").or(ut(De,"cellpadding")).fold(()=>({}),vr=>({cellpadding:vr}));return{...vi,...tr}};return{...Ft,...ve,...De,...Ln,...kn(),...jo()}},Eu=$=>Fn(Po.fromDom($)).map(G=>{const ve={selection:Lm($.cells)};return Qn(G,ve)}).getOr(""),Fp=($,G,ve)=>{const De=(Ln,jo)=>{const Qo=Pt(Po.fromDom(jo),"border-width");return yf($)&&Qo.isSome()?Qo.getOr(""):Ln.getAttrib(jo,"border")||vc($.dom,jo,"border-width")||vc($.dom,jo,"border")||""},at=$.dom,Ft=yf($)?at.getStyle(G,"border-spacing")||at.getAttrib(G,"cellspacing"):at.getAttrib(G,"cellspacing")||at.getStyle(G,"border-spacing"),kn=yf($)?vc(at,G,"padding")||at.getAttrib(G,"cellpadding"):at.getAttrib(G,"cellpadding")||vc(at,G,"padding");return{width:at.getStyle(G,"width")||at.getAttrib(G,"width"),height:at.getStyle(G,"height")||at.getAttrib(G,"height"),cellspacing:Ft!=null?Ft:"",cellpadding:kn!=null?kn:"",border:De(at,G),caption:!!at.select("caption",G)[0],class:at.getAttrib(G,"class",""),align:Vg($,G),...ve?Sf(G):{}}},V1=($,G,ve)=>{const De=$.dom;return{height:De.getStyle(G,"height")||De.getAttrib(G,"height"),class:De.getAttrib(G,"class",""),type:Eu(G),align:Vg($,G),...ve?Sf(G):{}}},Sn=($,G,ve,De)=>{const at=$.dom,Ft=De.getOr(G),kn=(Ln,jo)=>at.getStyle(Ln,jo)||at.getAttrib(Ln,jo);return{width:kn(Ft,"width"),height:kn(G,"height"),scope:at.getAttrib(G,"scope"),celltype:Dc(G),class:at.getAttrib(G,"class",""),halign:Vg($,G),valign:Cd($,G),...ve?Sf(G):{}}},$m=($,G)=>{const ve=$u.fromTable($),De=$u.justCells(ve),at=Bn(De,Ft=>bn(G,kn=>gs(Ft.element,kn)));return gt(at,Ft=>({element:Ft.element.dom,column:$u.getColumnAt(ve,Ft.column).map(kn=>kn.element.dom)}))},Sd=($,G,ve,De)=>{De("scope")&&$.setAttrib("scope",ve.scope),De("class")&&$.setAttrib("class",ve.class),De("height")&&$.setStyle("height",Qs(ve.height)),De("width")&&G.setStyle("width",Qs(ve.width))},th=($,G,ve)=>{ve("backgroundcolor")&&$.setFormat("tablecellbackgroundcolor",G.backgroundcolor),ve("bordercolor")&&$.setFormat("tablecellbordercolor",G.bordercolor),ve("borderstyle")&&$.setFormat("tablecellborderstyle",G.borderstyle),ve("borderwidth")&&$.setFormat("tablecellborderwidth",Qs(G.borderwidth))},Zu=($,G,ve,De)=>{const at=G.length===1;de(G,Ft=>{const kn=Ft.element,Ln=at?se:De,jo=Wf.normal($,kn),Qo=Ft.column.map(vi=>Wf.normal($,vi)).getOr(jo);Sd(jo,Qo,ve,Ln),Pg($)&&th(jo,ve,Ln),De("halign")&&Hf($,kn,ve.halign),De("valign")&&jd($,kn,ve.valign)})},U1=($,G)=>{$.execCommand("mceTableCellType",!1,{type:G.celltype,no_events:!0})},ui=($,G,ve,De)=>{const at=nt(De,(Ft,kn)=>ve[kn]!==Ft);V(at)>0&&G.length>=1&&Fn(G[0]).each(Ft=>{const kn=$m(Ft,G),Ln=V(nt(at,(Qo,vi)=>vi!=="scope"&&vi!=="celltype"))>0,jo=et(at,"celltype");(Ln||et(at,"scope"))&&Zu($,kn,De,F(et,at)),jo&&U1($,De),Xr($,Ft.dom,{structure:jo,style:Ln})})},Ui=($,G,ve,De)=>{const at=De.getData();De.close(),$.undoManager.transact(()=>{ui($,G,ve,at),$.focus()})},ha=($,G)=>{const ve=Fn(G[0]).map(De=>gt($m(De,G),at=>Sn($,at.element,Pg($),at.column)));return eh(ve.getOrDie())},As=$=>{const G=Xe($);if(G.length===0)return;const ve=ha($,G),De={type:"tabpanel",tabs:[{title:"General",name:"general",items:wv($)},$1($,"cell")]},at={type:"panel",items:[{type:"grid",columns:2,items:wv($)}]};$.windowManager.open({title:"Cell Properties",size:"normal",body:Pg($)?De:at,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ve,onSubmit:F(Ui,$,G,ve)})},kd=$=>{const G=wd(Uu($));return G.length>0?X.some({name:"class",type:"listbox",label:"Class",items:G}):X.none()},Cl=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],qu=$=>Cl.concat(kd($).toArray()),Va=($,G,ve)=>{ve("class")&&$.setAttrib("class",G.class),ve("height")&&$.setStyle("height",Qs(G.height))},_a=($,G,ve)=>{ve("backgroundcolor")&&$.setStyle("background-color",G.backgroundcolor),ve("bordercolor")&&$.setStyle("border-color",G.bordercolor),ve("borderstyle")&&$.setStyle("border-style",G.borderstyle)},Hp=($,G,ve,De)=>{const Ft=G.length===1?se:De;de(G,kn=>{const Ln=Wf.normal($,kn);Va(Ln,ve,Ft),Pm($)&&_a(Ln,ve,Ft),De("align")&&Hf($,kn,ve.align)})},Qt=($,G)=>{$.execCommand("mceTableRowType",!1,{type:G.type,no_events:!0})},Gr=($,G,ve,De)=>{const at=nt(De,(Ft,kn)=>ve[kn]!==Ft);if(V(at)>0){const Ft=et(at,"type"),kn=Ft?V(at)>1:!0;kn&&Hp($,G,De,F(et,at)),Ft&&Qt($,De),Fn(Po.fromDom(G[0])).each(Ln=>Xr($,Ln.dom,{structure:Ft,style:kn}))}},J0=($,G,ve,De)=>{const at=De.getData();De.close(),$.undoManager.transact(()=>{Gr($,G,ve,at),$.focus()})},Ca=$=>{const G=rt(xr($),Bl.selected);if(G.length===0)return;const ve=gt(G,kn=>V1($,kn.dom,Pm($))),De=eh(ve),at={type:"tabpanel",tabs:[{title:"General",name:"general",items:qu($)},$1($,"row")]},Ft={type:"panel",items:[{type:"grid",columns:2,items:qu($)}]};$.windowManager.open({title:"Row Properties",size:"normal",body:Pm($)?at:Ft,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:De,onSubmit:F(J0,$,gt(G,kn=>kn.dom),De)})},Ua=($,G,ve)=>{const De=ve?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],at=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],Ft=Im($)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],kn=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],Ln=G.length>0?[{type:"listbox",name:"class",label:"Class",items:G}]:[];return De.concat(at).concat(Ft).concat(kn).concat(Ln)},Ug=($,G,ve,De)=>{if(G.tagName==="TD"||G.tagName==="TH")f(ve)&&A(De)?$.setStyle(G,ve,De):$.setStyles(G,ve);else if(G.children)for(let at=0;at<G.children.length;at++)Ug($,G.children[at],ve,De)},Ic=($,G,ve,De)=>{const at=$.dom,Ft={},kn={},Ln=yf($),jo=Il($);if(v(ve.class)||(Ft.class=ve.class),kn.height=Qs(ve.height),Ln?kn.width=Qs(ve.width):at.getAttrib(G,"width")&&(Ft.width=fa(ve.width)),Ln?(kn["border-width"]=Qs(ve.border),kn["border-spacing"]=Qs(ve.cellspacing)):(Ft.border=ve.border,Ft.cellpadding=ve.cellpadding,Ft.cellspacing=ve.cellspacing),Ln&&G.children){const Qo={};if(De.border&&(Qo["border-width"]=Qs(ve.border)),De.cellpadding&&(Qo.padding=Qs(ve.cellpadding)),jo&&De.bordercolor&&(Qo["border-color"]=ve.bordercolor),!xt(Qo))for(let vi=0;vi<G.children.length;vi++)Ug(at,G.children[vi],Qo)}if(jo){const Qo=ve;kn["background-color"]=Qo.backgroundcolor,kn["border-color"]=Qo.bordercolor,kn["border-style"]=Qo.borderstyle}at.setStyles(G,{...Vf($),...kn}),at.setAttribs(G,{...Wl($),...Ft})},Zf=($,G,ve,De)=>{const at=$.dom,Ft=De.getData(),kn=nt(Ft,(Ln,jo)=>ve[jo]!==Ln);De.close(),Ft.class===""&&delete Ft.class,$.undoManager.transact(()=>{if(!G){const Ln=Ul(Ft.cols).getOr(1),jo=Ul(Ft.rows).getOr(1);$.execCommand("mceInsertTable",!1,{rows:jo,columns:Ln}),G=Se(xr($),Ja($)).bind(Qo=>Fn(Qo,Ja($))).map(Qo=>Qo.dom).getOrDie()}if(V(kn)>0){const Ln={border:et(kn,"border"),bordercolor:et(kn,"bordercolor"),cellpadding:et(kn,"cellpadding")};Ic($,G,Ft,Ln);const jo=at.select("caption",G)[0];(jo&&!Ft.caption||!jo&&Ft.caption)&&$.execCommand("mceTableToggleCaption"),Hf($,G,Ft.align)}if($.focus(),$.addVisual(),V(kn)>0){const Ln=et(kn,"caption"),jo=Ln?V(kn)>1:!0;Xr($,G,{structure:Ln,style:jo})}})},qf=($,G)=>{const ve=$.dom;let De,at=ml($,Il($));G?(at.cols="1",at.rows="1",Il($)&&(at.borderstyle="",at.bordercolor="",at.backgroundcolor="")):(De=ve.getParent($.selection.getStart(),"table",$.getBody()),De?at=Fp($,De,Il($)):Il($)&&(at.borderstyle="",at.bordercolor="",at.backgroundcolor=""));const Ft=wd(Vh($));Ft.length>0&&at.class&&(at.class=at.class.replace(/\s*mce\-item\-table\s*/g,""));const kn={type:"grid",columns:2,items:Ua($,Ft,G)},Ln=()=>({type:"panel",items:[kn]}),jo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[kn]},$1($,"table")]}),Qo=Il($)?jo():Ln();$.windowManager.open({title:"Table Properties",size:"normal",body:Qo,onSubmit:F(Zf,$,De,at),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:at})},$p=$=>{const G=ve=>{dl(xr($))&&ve()};Te({mceTableProps:F(qf,$,!1),mceTableRowProps:F(Ca,$),mceTableCellProps:F(As,$),mceInsertTableDialog:F(qf,$,!0)},(ve,De)=>$.addCommand(De,()=>G(ve)))},Ll=($,G)=>it($,G).isSome(),Ar=q,Wa=$=>{const G=(De,at)=>Aa(De,at).exists(Ft=>parseInt(Ft,10)>1),ve=De=>G(De,"rowspan")||G(De,"colspan");return $.length>0&&Ut($,ve)?X.some($):X.none()},nh=($,G,ve)=>G.length<=1?X.none():H1($,ve.firstSelectedSelector,ve.lastSelectedSelector).map(De=>({bounds:De,cells:G})),Gl=$=>({element:$,mergable:X.none(),unmergable:X.none(),selection:[$]}),Q0=($,G,ve)=>({element:ve,mergable:nh(G,$,Bl),unmergable:Wa($),selection:Ar($)}),zm=$=>{const G=Jd(X.none()),ve=Jd([]);let De=X.none();const at=uo("caption"),Ft=Os=>De.forall(Br=>!Br[Os]),kn=()=>ce(xr($),Ja($)),Ln=()=>ce(Ki($),Ja($)),jo=()=>kn().bind(Os=>sa(Fa(Fn(Os),Ln().bind(Fn),(Br,Da)=>gs(Br,Da)?at(Os)?X.some(Gl(Os)):X.some(Q0(Xe($),Br,Os)):X.none()))),Qo=Os=>Fn(Os.element).map(Da=>{const cc=$u.fromTable(Da),j1=z1(cc,Os).getOr([]),Sl=Wo(j1,(Gi,tu)=>(tu.isLocked&&(Gi.onAny=!0,tu.column===0?Gi.onFirst=!0:tu.column+tu.colspan>=cc.grid.columns&&(Gi.onLast=!0)),Gi),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:X0(cc,Os).isSome(),unmergeable:hl(cc,Os).isSome(),locked:Sl}}),vi=()=>{G.set(ku(jo)()),De=G.get().bind(Qo),de(ve.get(),oe)},tr=Os=>(Os(),ve.set(ve.get().concat([Os])),()=>{ve.set(Bn(ve.get(),Br=>Br!==Os))}),vr=(Os,Br)=>tr(()=>G.get().fold(()=>{Os.setEnabled(!1)},Da=>{Os.setEnabled(!Br(Da)&&$.selection.isEditable())})),Bc=(Os,Br,Da)=>tr(()=>G.get().fold(()=>{Os.setEnabled(!1),Os.setActive(!1)},cc=>{Os.setEnabled(!Br(cc)&&$.selection.isEditable()),Os.setActive(Da(cc))})),Qc=Os=>De.exists(Br=>Br.locked[Os]),Gu=Os=>vr(Os,Br=>!1),kf=Os=>vr(Os,Br=>at(Br.element)),oh=Os=>Br=>vr(Br,Da=>at(Da.element)||Qc(Os)),sh=Os=>Br=>vr(Br,Da=>at(Da.element)||Os().isNone()),lr=(Os,Br)=>Da=>vr(Da,cc=>at(cc.element)||Os().isNone()||Qc(Br)),Um=Os=>vr(Os,Br=>Ft("mergeable")),Wm=Os=>vr(Os,Br=>Ft("unmergeable")),ea=Os=>Bc(Os,te,Br=>Fn(Br.element,Ja($)).exists(cc=>Ll(cc,"caption"))),eu=(Os,Br)=>Da=>Bc(Da,cc=>at(cc.element),()=>$.queryCommandValue(Os)===Br),zp=eu("mceTableRowType","header"),jm=eu("mceTableColType","th");return $.on("NodeChange ExecCommand TableSelectorChange",vi),{onSetupTable:Gu,onSetupCellOrRow:kf,onSetupColumn:oh,onSetupPasteable:sh,onSetupPasteableColumn:lr,onSetupMergeable:Um,onSetupUnmergeable:Wm,resetTargets:vi,onSetupTableWithCaption:ea,onSetupTableRowHeaders:zp,onSetupTableColumnHeaders:jm,targets:G.get}};var W1=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const ja="x-tinymce/dom-table-",ac=ja+"rows",At=ja+"columns",_c=$=>{var G;const ve=(G=W1.read())!==null&&G!==void 0?G:[];return rs(ve,De=>X.from(De.getType($)))},Xc=()=>_c(ac),lc=()=>_c(At),Au=$=>G=>{const ve=()=>{G.setEnabled($.selection.isEditable())};return $.on("NodeChange",ve),ve(),()=>{$.off("NodeChange",ve)}},Za=($,G)=>{$.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:Au($),fetch:Ln=>Ln("inserttable | cell row column | advtablesort | tableprops deletetable")});const ve=Ln=>()=>$.execCommand(Ln),De=(Ln,jo)=>{$.queryCommandSupported(jo.command)&&$.ui.registry.addButton(Ln,{...jo,onAction:O(jo.onAction)?jo.onAction:ve(jo.command)})},at=(Ln,jo)=>{$.queryCommandSupported(jo.command)&&$.ui.registry.addToggleButton(Ln,{...jo,onAction:O(jo.onAction)?jo.onAction:ve(jo.command)})};De("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:G.onSetupTable}),De("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:G.onSetupTable}),De("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:G.onSetupCellOrRow}),De("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:G.onSetupMergeable}),De("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:G.onSetupUnmergeable}),De("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:G.onSetupCellOrRow}),De("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:G.onSetupCellOrRow}),De("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:G.onSetupCellOrRow}),De("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:G.onSetupCellOrRow}),De("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:G.onSetupColumn("onFirst")}),De("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:G.onSetupColumn("onLast")}),De("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:G.onSetupColumn("onAny")}),De("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:G.onSetupCellOrRow}),De("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:G.onSetupCellOrRow}),De("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:G.onSetupPasteable(Xc)}),De("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:G.onSetupPasteable(Xc)}),De("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:G.onSetupColumn("onAny")}),De("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:G.onSetupColumn("onAny")}),De("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:G.onSetupPasteableColumn(lc,"onFirst")}),De("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:G.onSetupPasteableColumn(lc,"onLast")}),De("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:Au($)});const Ft=Uf(Vh($));Ft.length!==0&&$.queryCommandSupported("mceTableToggleClass")&&$.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Qd($,Ft,"tableclass",Ln=>$.execCommand("mceTableToggleClass",!1,Ln)),onSetup:G.onSetupTable});const kn=Uf(zh($));kn.length!==0&&$.queryCommandSupported("mceTableCellToggleClass")&&$.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Qd($,kn,"tablecellclass",Ln=>$.execCommand("mceTableCellToggleClass",!1,Ln)),onSetup:G.onSetupCellOrRow}),$.queryCommandSupported("mceTableApplyCellStyle")&&($.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Qd($,On,"tablecellverticalalign",ql($,"vertical-align")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Qd($,zf($),"tablecellborderwidth",ql($,"border-width")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Qd($,Zd($),"tablecellborderstyle",ql($,"border-style")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:Ln=>Ln(Ae($,Uh($),"background-color")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:Ln=>Ln(Ae($,wf($),"border-color")),onSetup:G.onSetupCellOrRow})),at("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:G.onSetupTableWithCaption}),at("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:_f($),onSetup:G.onSetupTableRowHeaders}),at("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$g($),onSetup:G.onSetupTableColumnHeaders})},qa=$=>{const G=De=>$.dom.is(De,"table")&&$.getBody().contains(De)&&$.dom.isEditable(De.parentNode),ve=Nc($);ve.length>0&&$.ui.registry.addContextToolbar("table",{predicate:G,items:ve,scope:"node",position:"node"})},Vm=$=>G=>{const ve=()=>{G.setEnabled($.selection.isEditable())};return $.on("NodeChange",ve),ve(),()=>{$.off("NodeChange",ve)}},Jc=($,G)=>{const ve=tr=>()=>$.execCommand(tr),De=(tr,vr)=>$.queryCommandSupported(vr.command)?($.ui.registry.addMenuItem(tr,{...vr,onAction:O(vr.onAction)?vr.onAction:ve(vr.command)}),!0):!1,at=(tr,vr)=>{$.queryCommandSupported(vr.command)&&$.ui.registry.addToggleMenuItem(tr,{...vr,onAction:O(vr.onAction)?vr.onAction:ve(vr.command)})},Ft=tr=>{$.execCommand("mceInsertTable",!1,{rows:tr.numRows,columns:tr.numColumns})},kn=[De("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:G.onSetupCellOrRow}),De("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:G.onSetupCellOrRow}),De("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:G.onSetupCellOrRow}),De("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:G.onSetupCellOrRow}),De("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:G.onSetupCellOrRow}),De("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:G.onSetupCellOrRow}),De("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:G.onSetupPasteable(Xc)}),De("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:G.onSetupPasteable(Xc)})],Ln=[De("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:G.onSetupColumn("onFirst")}),De("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:G.onSetupColumn("onLast")}),De("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:G.onSetupColumn("onAny")}),De("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:G.onSetupColumn("onAny")}),De("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:G.onSetupColumn("onAny")}),De("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:G.onSetupPasteableColumn(lc,"onFirst")}),De("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:G.onSetupPasteableColumn(lc,"onLast")})],jo=[De("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:G.onSetupCellOrRow}),De("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:G.onSetupMergeable}),De("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:G.onSetupUnmergeable})];tl($)?$.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:Ft}],onSetup:Vm($)}):$.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:ve("mceInsertTableDialog"),onSetup:Vm($)}),$.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:ve("mceInsertTableDialog"),onSetup:Vm($)}),De("tableprops",{text:"Table properties",onSetup:G.onSetupTable,command:"mceTableProps"}),De("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:G.onSetupTable,command:"mceTableDelete"}),kt(kn,!0)&&$.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:z("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),kt(Ln,!0)&&$.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:z("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),kt(jo,!0)&&$.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:z("tablecellprops tablemergecells tablesplitcells")}),$.ui.registry.addContextMenu("table",{update:()=>(G.resetTargets(),G.targets().fold(z(""),tr=>ln(tr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const Qo=Uf(Vh($));Qo.length!==0&&$.queryCommandSupported("mceTableToggleClass")&&$.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>br($,Qo,"tableclass",tr=>$.execCommand("mceTableToggleClass",!1,tr)),onSetup:G.onSetupTable});const vi=Uf(zh($));vi.length!==0&&$.queryCommandSupported("mceTableCellToggleClass")&&$.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>br($,vi,"tablecellclass",tr=>$.execCommand("mceTableCellToggleClass",!1,tr)),onSetup:G.onSetupCellOrRow}),$.queryCommandSupported("mceTableApplyCellStyle")&&($.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>br($,On,"tablecellverticalalign",ql($,"vertical-align")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>br($,zf($),"tablecellborderwidth",ql($,"border-width")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>br($,Zd($),"tablecellborderstyle",ql($,"border-style")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Ae($,Uh($),"background-color"),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Ae($,wf($),"border-color"),onSetup:G.onSetupCellOrRow})),at("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:G.onSetupTableWithCaption}),at("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:_f($),onSetup:G.onSetupTableRowHeaders}),at("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$g($),onSetup:G.onSetupTableRowHeaders})},eb=$=>{const G=zm($);zi($),$p($),Jc($,G),Za($,G),qa($)};var $o=()=>{r.add("table",eb)};$o()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=V=>V==null,t=V=>!e(V),s=()=>{},a=V=>()=>V;class u{constructor(ut,et){this.tag=ut,this.value=et}static some(ut){return new u(!0,ut)}static none(){return u.singletonNone}fold(ut,et){return this.tag?et(this.value):ut()}isSome(){return this.tag}isNone(){return!this.tag}map(ut){return this.tag?u.some(ut(this.value)):u.none()}bind(ut){return this.tag?ut(this.value):u.none()}exists(ut){return this.tag&&ut(this.value)}forall(ut){return!this.tag||ut(this.value)}filter(ut){return!this.tag||ut(this.value)?this:u.none()}getOr(ut){return this.tag?this.value:ut}or(ut){return this.tag?this:ut}getOrThunk(ut){return this.tag?this.value:ut()}orThunk(ut){return this.tag?this:ut()}getOrDie(ut){if(this.tag)return this.value;throw new Error(ut!=null?ut:"Called getOrDie on None")}static from(ut){return t(ut)?u.some(ut):u.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ut){this.tag&&ut(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}u.singletonNone=new u(!1);const f=(V,ut)=>ut>=0&&ut<V.length?u.some(V[ut]):u.none(),h=V=>f(V,0);var g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const v=typeof window<"u"?window:Function("return this;")(),_=function(V,ut,et){const Et=window.Prism;window.Prism={manual:!0};var xt=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},He=function(ct){var an=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,kt=0,bn={},qe={manual:ct.Prism&&ct.Prism.manual,disableWorkerMessageHandler:ct.Prism&&ct.Prism.disableWorkerMessageHandler,util:{encode:function Be(Ut){return Ut instanceof gt?new gt(Ut.type,Be(Ut.content),Ut.alias):Array.isArray(Ut)?Ut.map(Be):Ut.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(Be){return Object.prototype.toString.call(Be).slice(8,-1)},objId:function(Be){return Be.__id||Object.defineProperty(Be,"__id",{value:++kt}),Be.__id},clone:function Be(Ut,gn){gn=gn||{};var wt,Yt;switch(qe.util.type(Ut)){case"Object":if(Yt=qe.util.objId(Ut),gn[Yt])return gn[Yt];wt={},gn[Yt]=wt;for(var vn in Ut)Ut.hasOwnProperty(vn)&&(wt[vn]=Be(Ut[vn],gn));return wt;case"Array":return Yt=qe.util.objId(Ut),gn[Yt]?gn[Yt]:(wt=[],gn[Yt]=wt,Ut.forEach(function(rs,eo){wt[eo]=Be(rs,gn)}),wt);default:return Ut}},getLanguage:function(Be){for(;Be;){var Ut=an.exec(Be.className);if(Ut)return Ut[1].toLowerCase();Be=Be.parentElement}return"none"},setLanguage:function(Be,Ut){Be.className=Be.className.replace(RegExp(an,"gi"),""),Be.classList.add("language-"+Ut)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(wt){var Be=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(wt.stack)||[])[1];if(Be){var Ut=document.getElementsByTagName("script");for(var gn in Ut)if(Ut[gn].src==Be)return Ut[gn]}return null}},isActive:function(Be,Ut,gn){for(var wt="no-"+Ut;Be;){var Yt=Be.classList;if(Yt.contains(Ut))return!0;if(Yt.contains(wt))return!1;Be=Be.parentElement}return!!gn}},languages:{plain:bn,plaintext:bn,text:bn,txt:bn,extend:function(Be,Ut){var gn=qe.util.clone(qe.languages[Be]);for(var wt in Ut)gn[wt]=Ut[wt];return gn},insertBefore:function(Be,Ut,gn,wt){wt=wt||qe.languages;var Yt=wt[Be],vn={};for(var rs in Yt)if(Yt.hasOwnProperty(rs)){if(rs==Ut)for(var eo in gn)gn.hasOwnProperty(eo)&&(vn[eo]=gn[eo]);gn.hasOwnProperty(rs)||(vn[rs]=Yt[rs])}var ds=wt[Be];return wt[Be]=vn,qe.languages.DFS(qe.languages,function(Or,Rs){Rs===ds&&Or!=Be&&(this[Or]=vn)}),vn},DFS:function Be(Ut,gn,wt,Yt){Yt=Yt||{};var vn=qe.util.objId;for(var rs in Ut)if(Ut.hasOwnProperty(rs)){gn.call(Ut,rs,Ut[rs],wt||rs);var eo=Ut[rs],ds=qe.util.type(eo);ds==="Object"&&!Yt[vn(eo)]?(Yt[vn(eo)]=!0,Be(eo,gn,null,Yt)):ds==="Array"&&!Yt[vn(eo)]&&(Yt[vn(eo)]=!0,Be(eo,gn,rs,Yt))}}},plugins:{},highlightAll:function(Be,Ut){qe.highlightAllUnder(document,Be,Ut)},highlightAllUnder:function(Be,Ut,gn){var wt={callback:gn,container:Be,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};qe.hooks.run("before-highlightall",wt),wt.elements=Array.prototype.slice.apply(wt.container.querySelectorAll(wt.selector)),qe.hooks.run("before-all-elements-highlight",wt);for(var Yt=0,vn;vn=wt.elements[Yt++];)qe.highlightElement(vn,Ut===!0,wt.callback)},highlightElement:function(Be,Ut,gn){var wt=qe.util.getLanguage(Be),Yt=qe.languages[wt];qe.util.setLanguage(Be,wt);var vn=Be.parentElement;vn&&vn.nodeName.toLowerCase()==="pre"&&qe.util.setLanguage(vn,wt);var rs=Be.textContent,eo={element:Be,language:wt,grammar:Yt,code:rs};function ds(Rs){eo.highlightedCode=Rs,qe.hooks.run("before-insert",eo),eo.element.innerHTML=eo.highlightedCode,qe.hooks.run("after-highlight",eo),qe.hooks.run("complete",eo),gn&&gn.call(eo.element)}if(qe.hooks.run("before-sanity-check",eo),vn=eo.element.parentElement,vn&&vn.nodeName.toLowerCase()==="pre"&&!vn.hasAttribute("tabindex")&&vn.setAttribute("tabindex","0"),!eo.code){qe.hooks.run("complete",eo),gn&&gn.call(eo.element);return}if(qe.hooks.run("before-highlight",eo),!eo.grammar){ds(qe.util.encode(eo.code));return}if(Ut&&ct.Worker){var Or=new Worker(qe.filename);Or.onmessage=function(Rs){ds(Rs.data)},Or.postMessage(JSON.stringify({language:eo.language,code:eo.code,immediateClose:!0}))}else ds(qe.highlight(eo.code,eo.grammar,eo.language))},highlight:function(Be,Ut,gn){var wt={code:Be,grammar:Ut,language:gn};if(qe.hooks.run("before-tokenize",wt),!wt.grammar)throw new Error('The language "'+wt.language+'" has no grammar.');return wt.tokens=qe.tokenize(wt.code,wt.grammar),qe.hooks.run("after-tokenize",wt),gt.stringify(qe.util.encode(wt.tokens),wt.language)},tokenize:function(Be,Ut){var gn=Ut.rest;if(gn){for(var wt in gn)Ut[wt]=gn[wt];delete Ut.rest}var Yt=new Zn;return Bn(Yt,Yt.head,Be),No(Be,Yt,Ut,Yt.head,0),Wo(Yt)},hooks:{all:{},add:function(Be,Ut){var gn=qe.hooks.all;gn[Be]=gn[Be]||[],gn[Be].push(Ut)},run:function(Be,Ut){var gn=qe.hooks.all[Be];if(!(!gn||!gn.length))for(var wt=0,Yt;Yt=gn[wt++];)Yt(Ut)}},Token:gt};ct.Prism=qe;function gt(Be,Ut,gn,wt){this.type=Be,this.content=Ut,this.alias=gn,this.length=(wt||"").length|0}gt.stringify=function Be(Ut,gn){if(typeof Ut=="string")return Ut;if(Array.isArray(Ut)){var wt="";return Ut.forEach(function(ds){wt+=Be(ds,gn)}),wt}var Yt={type:Ut.type,content:Be(Ut.content,gn),tag:"span",classes:["token",Ut.type],attributes:{},language:gn},vn=Ut.alias;vn&&(Array.isArray(vn)?Array.prototype.push.apply(Yt.classes,vn):Yt.classes.push(vn)),qe.hooks.run("wrap",Yt);var rs="";for(var eo in Yt.attributes)rs+=" "+eo+'="'+(Yt.attributes[eo]||"").replace(/"/g,""")+'"';return"<"+Yt.tag+' class="'+Yt.classes.join(" ")+'"'+rs+">"+Yt.content+"</"+Yt.tag+">"};function de(Be,Ut,gn,wt){Be.lastIndex=Ut;var Yt=Be.exec(gn);if(Yt&&wt&&Yt[1]){var vn=Yt[1].length;Yt.index+=vn,Yt[0]=Yt[0].slice(vn)}return Yt}function No(Be,Ut,gn,wt,Yt,vn){for(var rs in gn)if(!(!gn.hasOwnProperty(rs)||!gn[rs])){var eo=gn[rs];eo=Array.isArray(eo)?eo:[eo];for(var ds=0;ds<eo.length;++ds){if(vn&&vn.cause==rs+","+ds)return;var Or=eo[ds],Rs=Or.inside,Js=!!Or.lookbehind,Zs=!!Or.greedy,ba=Or.alias;if(Zs&&!Or.pattern.global){var ar=Or.pattern.toString().match(/[imsuy]*$/)[0];Or.pattern=RegExp(Or.pattern.source,ar+"g")}for(var Ns=Or.pattern||Or,Zr=wt.next,Po=Yt;Zr!==Ut.tail&&!(vn&&Po>=vn.reach);Po+=Zr.value.length,Zr=Zr.next){var Mo=Zr.value;if(Ut.length>Be.length)return;if(!(Mo instanceof gt)){var Mr=1,Ls;if(Zs){if(Ls=de(Ns,Po,Be,Js),!Ls||Ls.index>=Be.length)break;var ln=Ls.index,na=Ls.index+Ls[0].length,gs=Po;for(gs+=Zr.value.length;ln>=gs;)Zr=Zr.next,gs+=Zr.value.length;if(gs-=Zr.value.length,Po=gs,Zr.value instanceof gt)continue;for(var va=Zr;va!==Ut.tail&&(gs<na||typeof va.value=="string");va=va.next)Mr++,gs+=va.value.length;Mr--,Mo=Be.slice(Po,gs),Ls.index-=Po}else if(Ls=de(Ns,0,Mo,Js),!Ls)continue;var ln=Ls.index,ps=Ls[0],Li=Mo.slice(0,ln),ze=Mo.slice(ln+ps.length),Qe=Po+Mo.length;vn&&Qe>vn.reach&&(vn.reach=Qe);var Dt=Zr.prev;Li&&(Dt=Bn(Ut,Dt,Li),Po+=Li.length),ao(Ut,Dt,Mr);var Wt=new gt(rs,Rs?qe.tokenize(ps,Rs):ps,ba,ps);if(Zr=Bn(Ut,Dt,Wt),ze&&Bn(Ut,Zr,ze),Mr>1){var qn={cause:rs+","+ds,reach:Qe};No(Be,Ut,gn,Zr.prev,Po,qn),vn&&qn.reach>vn.reach&&(vn.reach=qn.reach)}}}}}}function Zn(){var Be={value:null,prev:null,next:null},Ut={value:null,prev:Be,next:null};Be.next=Ut,this.head=Be,this.tail=Ut,this.length=0}function Bn(Be,Ut,gn){var wt=Ut.next,Yt={value:gn,prev:Ut,next:wt};return Ut.next=Yt,wt.prev=Yt,Be.length++,Yt}function ao(Be,Ut,gn){for(var wt=Ut.next,Yt=0;Yt<gn&&wt!==Be.tail;Yt++)wt=wt.next;Ut.next=wt,wt.prev=Ut,Be.length-=Yt}function Wo(Be){for(var Ut=[],gn=Be.head.next;gn!==Be.tail;)Ut.push(gn.value),gn=gn.next;return Ut}if(!ct.document)return ct.addEventListener&&(qe.disableWorkerMessageHandler||ct.addEventListener("message",function(Be){var Ut=JSON.parse(Be.data),gn=Ut.language,wt=Ut.code,Yt=Ut.immediateClose;ct.postMessage(qe.highlight(wt,qe.languages[gn],gn)),Yt&&ct.close()},!1)),qe;var St=qe.util.currentScript();St&&(qe.filename=St.src,St.hasAttribute("data-manual")&&(qe.manual=!0));function Xt(){qe.manual||qe.highlightAll()}if(!qe.manual){var Tt=document.readyState;Tt==="loading"||Tt==="interactive"&&St&&St.defer?document.addEventListener("DOMContentLoaded",Xt):window.requestAnimationFrame?window.requestAnimationFrame(Xt):window.setTimeout(Xt,16)}return qe}(xt);return typeof ut<"u"&&ut.exports&&(ut.exports=He),typeof V<"u"&&(V.Prism=He),He.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(ct){function an(kt,bn){return"___"+kt.toUpperCase()+bn+"___"}Object.defineProperties(ct.languages["markup-templating"]={},{buildPlaceholders:{value:function(kt,bn,qe,gt){if(kt.language===bn){var de=kt.tokenStack=[];kt.code=kt.code.replace(qe,function(No){if(typeof gt=="function"&&!gt(No))return No;for(var Zn=de.length,Bn;kt.code.indexOf(Bn=an(bn,Zn))!==-1;)++Zn;return de[Zn]=No,Bn}),kt.grammar=ct.languages.markup}}},tokenizePlaceholders:{value:function(kt,bn){if(kt.language!==bn||!kt.tokenStack)return;kt.grammar=ct.languages[bn];var qe=0,gt=Object.keys(kt.tokenStack);function de(No){for(var Zn=0;Zn<No.length&&!(qe>=gt.length);Zn++){var Bn=No[Zn];if(typeof Bn=="string"||Bn.content&&typeof Bn.content=="string"){var ao=gt[qe],Wo=kt.tokenStack[ao],St=typeof Bn=="string"?Bn:Bn.content,Xt=an(bn,ao),Tt=St.indexOf(Xt);if(Tt>-1){++qe;var Be=St.substring(0,Tt),Ut=new ct.Token(bn,ct.tokenize(Wo,kt.grammar),"language-"+bn,Wo),gn=St.substring(Tt+Xt.length),wt=[];Be&&wt.push.apply(wt,de([Be])),wt.push(Ut),gn&&wt.push.apply(wt,de([gn])),typeof Bn=="string"?No.splice.apply(No,[Zn,1].concat(wt)):Bn.content=wt}}else Bn.content&&de(Bn.content)}return No}de(kt.tokens)}}})}(He),He.languages.c=He.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),He.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),He.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},He.languages.c.string],char:He.languages.c.char,comment:He.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:He.languages.c}}}}),He.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete He.languages.c.boolean,function(ct){var an=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,kt=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return an.source});ct.languages.cpp=ct.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return an.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:an,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),ct.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return kt})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),ct.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:ct.languages.cpp}}}}),ct.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),ct.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:ct.languages.extend("cpp",{})}}),ct.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},ct.languages.cpp["base-clause"])}(He),function(ct){function an(Ls,na){return Ls.replace(/<<(\d+)>>/g,function(gs,va){return"(?:"+na[+va]+")"})}function kt(Ls,na,gs){return RegExp(an(Ls,na),gs||"")}function bn(Ls,na){for(var gs=0;gs<na;gs++)Ls=Ls.replace(/<<self>>/g,function(){return"(?:"+Ls+")"});return Ls.replace(/<<self>>/g,"[^\\s\\S]")}var qe={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function gt(Ls){return"\\b(?:"+Ls.trim().replace(/ /g,"|")+")\\b"}var de=gt(qe.typeDeclaration),No=RegExp(gt(qe.type+" "+qe.typeDeclaration+" "+qe.contextual+" "+qe.other)),Zn=gt(qe.typeDeclaration+" "+qe.contextual+" "+qe.other),Bn=gt(qe.type+" "+qe.typeDeclaration+" "+qe.other),ao=bn(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),Wo=bn(/\((?:[^()]|<<self>>)*\)/.source,2),St=/@?\b[A-Za-z_]\w*\b/.source,Xt=an(/<<0>>(?:\s*<<1>>)?/.source,[St,ao]),Tt=an(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[Zn,Xt]),Be=/\[\s*(?:,\s*)*\]/.source,Ut=an(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[Tt,Be]),gn=an(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[ao,Wo,Be]),wt=an(/\(<<0>>+(?:,<<0>>+)+\)/.source,[gn]),Yt=an(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[wt,Tt,Be]),vn={keyword:No,punctuation:/[<>()?,.:[\]]/},rs=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,eo=/"(?:\\.|[^\\"\r\n])*"/.source,ds=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;ct.languages.csharp=ct.languages.extend("clike",{string:[{pattern:kt(/(^|[^$\\])<<0>>/.source,[ds]),lookbehind:!0,greedy:!0},{pattern:kt(/(^|[^@$\\])<<0>>/.source,[eo]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:kt(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[Tt]),lookbehind:!0,inside:vn},{pattern:kt(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[St,Yt]),lookbehind:!0,inside:vn},{pattern:kt(/(\busing\s+)<<0>>(?=\s*=)/.source,[St]),lookbehind:!0},{pattern:kt(/(\b<<0>>\s+)<<1>>/.source,[de,Xt]),lookbehind:!0,inside:vn},{pattern:kt(/(\bcatch\s*\(\s*)<<0>>/.source,[Tt]),lookbehind:!0,inside:vn},{pattern:kt(/(\bwhere\s+)<<0>>/.source,[St]),lookbehind:!0},{pattern:kt(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[Ut]),lookbehind:!0,inside:vn},{pattern:kt(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[Yt,Bn,St]),inside:vn}],keyword:No,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),ct.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),ct.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:kt(/([(,]\s*)<<0>>(?=\s*:)/.source,[St]),lookbehind:!0,alias:"punctuation"}}),ct.languages.insertBefore("csharp","class-name",{namespace:{pattern:kt(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[St]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:kt(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[Wo]),lookbehind:!0,alias:"class-name",inside:vn},"return-type":{pattern:kt(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[Yt,Tt]),inside:vn,alias:"class-name"},"constructor-invocation":{pattern:kt(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[Yt]),lookbehind:!0,inside:vn,alias:"class-name"},"generic-method":{pattern:kt(/<<0>>\s*<<1>>(?=\s*\()/.source,[St,ao]),inside:{function:kt(/^<<0>>/.source,[St]),generic:{pattern:RegExp(ao),alias:"class-name",inside:vn}}},"type-list":{pattern:kt(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[de,Xt,St,Yt,No.source,Wo,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:kt(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[Xt,Wo]),lookbehind:!0,greedy:!0,inside:ct.languages.csharp},keyword:No,"class-name":{pattern:RegExp(Yt),greedy:!0,inside:vn},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var Or=eo+"|"+rs,Rs=an(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[Or]),Js=bn(an(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[Rs]),2),Zs=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,ba=an(/<<0>>(?:\s*\(<<1>>*\))?/.source,[Tt,Js]);ct.languages.insertBefore("csharp","class-name",{attribute:{pattern:kt(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[Zs,ba]),lookbehind:!0,greedy:!0,inside:{target:{pattern:kt(/^<<0>>(?=\s*:)/.source,[Zs]),alias:"keyword"},"attribute-arguments":{pattern:kt(/\(<<0>>*\)/.source,[Js]),inside:ct.languages.csharp},"class-name":{pattern:RegExp(Tt),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var ar=/:[^}\r\n]+/.source,Ns=bn(an(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[Rs]),2),Zr=an(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Ns,ar]),Po=bn(an(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[Or]),2),Mo=an(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Po,ar]);function Mr(Ls,na){return{interpolation:{pattern:kt(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[Ls]),lookbehind:!0,inside:{"format-string":{pattern:kt(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[na,ar]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:ct.languages.csharp}}},string:/[\s\S]+/}}ct.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:kt(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[Zr]),lookbehind:!0,greedy:!0,inside:Mr(Zr,Ns)},{pattern:kt(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Mo]),lookbehind:!0,greedy:!0,inside:Mr(Mo,Po)}],char:{pattern:RegExp(rs),greedy:!0}}),ct.languages.dotnet=ct.languages.cs=ct.languages.csharp}(He),function(ct){var an=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;ct.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+an.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+an.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+an.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+an.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:an,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},ct.languages.css.atrule.inside.rest=ct.languages.css;var kt=ct.languages.markup;kt&&(kt.tag.addInlined("style","css"),kt.tag.addAttribute("style","css"))}(He),function(ct){var an=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,kt=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,bn={pattern:RegExp(/(^|[^\w.])/.source+kt+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};ct.languages.java=ct.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[bn,{pattern:RegExp(/(^|[^\w.])/.source+kt+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:bn.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+kt+/[A-Z]\w*\b/.source),lookbehind:!0,inside:bn.inside}],keyword:an,function:[ct.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),ct.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),ct.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":bn,keyword:an,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+kt+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:bn.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+kt+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:bn.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return an.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(He),He.languages.javascript=He.languages.extend("clike",{"class-name":[He.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),He.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,He.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:He.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:He.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:He.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:He.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:He.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),He.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:He.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),He.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),He.languages.markup&&(He.languages.markup.tag.addInlined("script","javascript"),He.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),He.languages.js=He.languages.javascript,He.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},He.languages.markup.tag.inside["attr-value"].inside.entity=He.languages.markup.entity,He.languages.markup.doctype.inside["internal-subset"].inside=He.languages.markup,He.hooks.add("wrap",function(ct){ct.type==="entity"&&(ct.attributes.title=ct.content.replace(/&/,"&"))}),Object.defineProperty(He.languages.markup.tag,"addInlined",{value:function(an,kt){var bn={};bn["language-"+kt]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:He.languages[kt]},bn.cdata=/^<!\[CDATA\[|\]\]>$/i;var qe={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:bn}};qe["language-"+kt]={pattern:/[\s\S]+/,inside:He.languages[kt]};var gt={};gt[an]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return an}),"i"),lookbehind:!0,greedy:!0,inside:qe},He.languages.insertBefore("markup","cdata",gt)}}),Object.defineProperty(He.languages.markup.tag,"addAttribute",{value:function(ct,an){He.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+ct+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[an,"language-"+an],inside:He.languages[an]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),He.languages.html=He.languages.markup,He.languages.mathml=He.languages.markup,He.languages.svg=He.languages.markup,He.languages.xml=He.languages.extend("markup",{}),He.languages.ssml=He.languages.xml,He.languages.atom=He.languages.xml,He.languages.rss=He.languages.xml,function(ct){var an=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,kt=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],bn=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,qe=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,gt=/[{}\[\](),:;]/;ct.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:an,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:kt,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:bn,operator:qe,punctuation:gt};var de={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:ct.languages.php},No=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:de}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:de}}];ct.languages.insertBefore("php","variable",{string:No,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:an,string:No,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:kt,number:bn,operator:qe,punctuation:gt}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),ct.hooks.add("before-tokenize",function(Zn){if(!!/<\?/.test(Zn.code)){var Bn=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;ct.languages["markup-templating"].buildPlaceholders(Zn,"php",Bn)}}),ct.hooks.add("after-tokenize",function(Zn){ct.languages["markup-templating"].tokenizePlaceholders(Zn,"php")})}(He),He.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},He.languages.python["string-interpolation"].inside.interpolation.inside.rest=He.languages.python,He.languages.py=He.languages.python,function(ct){ct.languages.ruby=ct.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),ct.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var an={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:ct.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete ct.languages.ruby.function;var kt="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",bn=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;ct.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+kt+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:an,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:an,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+bn),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+bn+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),ct.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+kt),greedy:!0,inside:{interpolation:an,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:an,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:an,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+kt),greedy:!0,inside:{interpolation:an,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:an,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete ct.languages.ruby.string,ct.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),ct.languages.rb=ct.languages.ruby}(He),window.Prism=Et,He}(void 0,void 0),A=V=>ut=>ut.options.get(V),O=V=>{const ut=V.options.register;ut("codesample_languages",{processor:"object[]"}),ut("codesample_global_prismjs",{processor:"boolean",default:!1})},N=A("codesample_languages"),L=A("codesample_global_prismjs"),j=V=>v.Prism&&L(V)?v.Prism:_,z=V=>t(V)&&V.nodeName==="PRE"&&V.className.indexOf("language-")!==-1,q=V=>{const ut=V.selection?V.selection.getNode():null;return z(ut)?u.some(ut):u.none()},ee=(V,ut,et)=>{const Et=V.dom;V.undoManager.transact(()=>{const xt=q(V);return et=g.DOM.encode(et),xt.fold(()=>{V.insertContent('<pre id="__new" class="language-'+ut+'">'+et+"</pre>");const He=Et.select("#__new")[0];Et.setAttrib(He,"id",null),V.selection.select(He)},He=>{Et.setAttrib(He,"class","language-"+ut),He.innerHTML=et,j(V).highlightElement(He),V.selection.select(He)})})},F=V=>q(V).bind(et=>u.from(et.textContent)).getOr(""),oe=V=>{const ut=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],et=N(V);return et||ut},te=(V,ut)=>q(V).fold(()=>ut,Et=>{const xt=Et.className.match(/language-(\w+)/);return xt?xt[1]:ut}),se=V=>{const ut=oe(V),et=h(ut).fold(a(""),He=>He.value),Et=te(V,et),xt=F(V);V.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"listbox",name:"language",label:"Language",items:ut},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:Et,code:xt},onSubmit:He=>{const ct=He.getData();ee(V,ct.language,ct.code),He.close()}})},X=V=>{V.addCommand("codesample",()=>{const ut=V.selection.getNode();V.selection.isCollapsed()||z(ut)?se(V):V.formatter.toggle("code")})},ye=(V=>ut=>ut.replace(V,""))(/^\s+|\s+$/g);var Te=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=V=>{V.on("PreProcess",ut=>{const et=V.dom,Et=et.select("pre[contenteditable=false]",ut.node);Te.each(Te.grep(Et,z),xt=>{const He=xt.textContent;et.setAttrib(xt,"class",ye(et.getAttrib(xt,"class"))),et.setAttrib(xt,"contentEditable",null),et.setAttrib(xt,"data-mce-highlighted",null);let ct;for(;ct=xt.firstChild;)xt.removeChild(ct);const an=et.add(xt,"code");an.textContent=He})}),V.on("SetContent",()=>{const ut=V.dom,et=Te.grep(ut.select("pre"),Et=>z(Et)&&ut.getAttrib(Et,"data-mce-highlighted")!=="true");et.length&&V.undoManager.transact(()=>{Te.each(et,Et=>{var xt;Te.each(ut.select("br",Et),He=>{ut.replace(V.getDoc().createTextNode(`
|
|
`),He)}),Et.innerHTML=ut.encode((xt=Et.textContent)!==null&&xt!==void 0?xt:""),j(V).highlightElement(Et),ut.setAttrib(Et,"data-mce-highlighted",!0),Et.className=ye(Et.className)})})}),V.on("PreInit",()=>{V.parser.addNodeFilter("pre",ut=>{var et;for(let Et=0,xt=ut.length;Et<xt;Et++){const He=ut[Et];((et=He.attr("class"))!==null&&et!==void 0?et:"").indexOf("language-")!==-1&&(He.attr("contenteditable","false"),He.attr("data-mce-highlighted","false"))}})})},ge=(V,ut=s)=>et=>{const Et=()=>{et.setEnabled(V.selection.isEditable()),ut(et)};return V.on("NodeChange",Et),Et(),()=>{V.off("NodeChange",Et)}},nt=V=>{const ut=V.selection.getStart();return V.dom.is(ut,'pre[class*="language-"]')},Je=V=>{const ut=()=>V.execCommand("codesample");V.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:ut,onSetup:ge(V,et=>{et.setActive(nt(V))})}),V.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:ut,onSetup:ge(V)})};var ft=()=>{r.add("codesample",V=>{O(V),_e(V),Je(V),X(V),V.on("dblclick",ut=>{z(ut.target)&&se(V)})})};ft()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ke,Ge,It)=>{var jt;return It(Ke,Ge.prototype)?!0:((jt=Ke.constructor)===null||jt===void 0?void 0:jt.name)===Ge.name},t=Ke=>{const Ge=typeof Ke;return Ke===null?"null":Ge==="object"&&Array.isArray(Ke)?"array":Ge==="object"&&e(Ke,String,(It,jt)=>jt.isPrototypeOf(It))?"string":Ge},s=Ke=>Ge=>t(Ge)===Ke,a=s("string"),u=s("object"),f=s("array"),h=Ke=>Ke==null,g=Ke=>!h(Ke);class v{constructor(Ge,It){this.tag=Ge,this.value=It}static some(Ge){return new v(!0,Ge)}static none(){return v.singletonNone}fold(Ge,It){return this.tag?It(this.value):Ge()}isSome(){return this.tag}isNone(){return!this.tag}map(Ge){return this.tag?v.some(Ge(this.value)):v.none()}bind(Ge){return this.tag?Ge(this.value):v.none()}exists(Ge){return this.tag&&Ge(this.value)}forall(Ge){return!this.tag||Ge(this.value)}filter(Ge){return!this.tag||Ge(this.value)?this:v.none()}getOr(Ge){return this.tag?this.value:Ge}or(Ge){return this.tag?this:Ge}getOrThunk(Ge){return this.tag?this.value:Ge()}orThunk(Ge){return this.tag?this:Ge()}getOrDie(Ge){if(this.tag)return this.value;throw new Error(Ge!=null?Ge:"Called getOrDie on None")}static from(Ge){return g(Ge)?v.some(Ge):v.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ge){this.tag&&Ge(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}v.singletonNone=new v(!1);const _=Array.prototype.push,A=(Ke,Ge)=>{for(let It=0,jt=Ke.length;It<jt;It++){const fo=Ke[It];Ge(fo,It)}},O=Ke=>{const Ge=[];for(let It=0,jt=Ke.length;It<jt;++It){if(!f(Ke[It]))throw new Error("Arr.flatten item "+It+" was not an array, input: "+Ke);_.apply(Ge,Ke[It])}return Ge},N=Ke=>{let Ge=Ke;return{get:()=>Ge,set:fo=>{Ge=fo}}},L=Object.keys,j=Object.hasOwnProperty,z=(Ke,Ge)=>{const It=L(Ke);for(let jt=0,fo=It.length;jt<fo;jt++){const Lo=It[jt],Ko=Ke[Lo];Ge(Ko,Lo)}},q=(Ke,Ge)=>ee(Ke,Ge)?v.from(Ke[Ge]):v.none(),ee=(Ke,Ge)=>j.call(Ke,Ge),F=Ke=>Ge=>Ge.options.get(Ke),oe=Ke=>{const Ge=Ke.options.register;Ge("audio_template_callback",{processor:"function"}),Ge("video_template_callback",{processor:"function"}),Ge("iframe_template_callback",{processor:"function"}),Ge("media_live_embeds",{processor:"boolean",default:!0}),Ge("media_filter_html",{processor:"boolean",default:!0}),Ge("media_url_resolver",{processor:"function"}),Ge("media_alt_source",{processor:"boolean",default:!0}),Ge("media_poster",{processor:"boolean",default:!0}),Ge("media_dimensions",{processor:"boolean",default:!0})},te=F("audio_template_callback"),se=F("video_template_callback"),X=F("iframe_template_callback"),we=F("media_live_embeds"),ye=F("media_filter_html"),Te=F("media_url_resolver"),_e=F("media_alt_source"),ge=F("media_poster"),nt=F("media_dimensions");var Je=tinymce.util.Tools.resolve("tinymce.util.Tools"),ft=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),V=tinymce.util.Tools.resolve("tinymce.html.DomParser");const ut=ft.DOM,et=Ke=>Ke.replace(/px$/,""),Et=Ke=>{const Ge=Ke.attr("style"),It=Ge?ut.parseStyle(Ge):{};return{type:"ephox-embed-iri",source:Ke.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:q(It,"max-width").map(et).getOr(""),height:q(It,"max-height").map(et).getOr("")}},xt=(Ke,Ge)=>{let It={};const fo=V({validate:!1,forced_root_block:!1},Ge).parse(Ke);for(let Lo=fo;Lo;Lo=Lo.walk())if(Lo.type===1){const Ko=Lo.name;if(Lo.attr("data-ephox-embed-iri")){It=Et(Lo);break}else!It.source&&Ko==="param"&&(It.source=Lo.attr("movie")),(Ko==="iframe"||Ko==="object"||Ko==="embed"||Ko==="video"||Ko==="audio")&&(It.type||(It.type=Ko),It=Je.extend(Lo.attributes.map,It)),Ko==="source"&&(It.source?It.altsource||(It.altsource=Lo.attr("src")):It.source=Lo.attr("src")),Ko==="img"&&!It.poster&&(It.poster=Lo.attr("src"))}return It.source=It.source||It.src||"",It.altsource=It.altsource||"",It.poster=It.poster||"",It},He=Ke=>{var Ge;const It={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},jt=(Ge=Ke.toLowerCase().split(".").pop())!==null&&Ge!==void 0?Ge:"";return q(It,jt).getOr("")};var ct=tinymce.util.Tools.resolve("tinymce.html.Node"),an=tinymce.util.Tools.resolve("tinymce.html.Serializer");const kt=(Ke,Ge={})=>V({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...Ge},Ke),bn=ft.DOM,qe=Ke=>/^[0-9.]+$/.test(Ke)?Ke+"px":Ke,gt=(Ke,Ge)=>{const It=Ge.attr("style"),jt=It?bn.parseStyle(It):{};g(Ke.width)&&(jt["max-width"]=qe(Ke.width)),g(Ke.height)&&(jt["max-height"]=qe(Ke.height)),Ge.attr("style",bn.serializeStyle(jt))},de=["source","altsource"],No=(Ke,Ge,It,jt)=>{let fo=0,Lo=0;const Ko=kt(jt);Ko.addNodeFilter("source",it=>fo=it.length);const Yr=Ko.parse(Ke);for(let it=Yr;it;it=it.walk())if(it.type===1){const Zo=it.name;if(it.attr("data-ephox-embed-iri")){gt(Ge,it);break}else{switch(Zo){case"video":case"object":case"embed":case"img":case"iframe":Ge.height!==void 0&&Ge.width!==void 0&&(it.attr("width",Ge.width),it.attr("height",Ge.height));break}if(It)switch(Zo){case"video":it.attr("poster",Ge.poster),it.attr("src",null);for(let oa=fo;oa<2;oa++)if(Ge[de[oa]]){const ua=new ct("source",1);ua.attr("src",Ge[de[oa]]),ua.attr("type",Ge[de[oa]+"mime"]||null),it.append(ua)}break;case"iframe":it.attr("src",Ge.source);break;case"object":const Oi=it.getAll("img").length>0;if(Ge.poster&&!Oi){it.attr("src",Ge.poster);const oa=new ct("img",1);oa.attr("src",Ge.poster),oa.attr("width",Ge.width),oa.attr("height",Ge.height),it.append(oa)}break;case"source":if(Lo<2&&(it.attr("src",Ge[de[Lo]]),it.attr("type",Ge[de[Lo]+"mime"]||null),!Ge[de[Lo]])){it.remove();continue}Lo++;break;case"img":Ge.poster||it.remove();break}}}return an({},jt).serialize(Yr)},Zn=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],Bn=Ke=>{const Ge=Ke.match(/^(https?:\/\/|www\.)(.+)$/i);return Ge&&Ge.length>1?Ge[1]==="www."?"https://":Ge[1]:"https://"},ao=(Ke,Ge)=>{const It=Bn(Ge),jt=Ke.regex.exec(Ge);let fo=It+Ke.url;if(g(jt))for(let Lo=0;Lo<jt.length;Lo++)fo=fo.replace("$"+Lo,()=>jt[Lo]?jt[Lo]:"");return fo.replace(/\?$/,"")},Wo=Ke=>{const Ge=Zn.filter(It=>It.regex.test(Ke));return Ge.length>0?Je.extend({},Ge[0],{url:ao(Ge[0],Ke)}):null},St=(Ke,Ge)=>{if(Ge)return Ge(Ke);{const It=Ke.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+Ke.source+'" width="'+Ke.width+'" height="'+Ke.height+'"'+It+"></iframe>"}},Xt=Ke=>{let Ge='<object data="'+Ke.source+'" width="'+Ke.width+'" height="'+Ke.height+'" type="application/x-shockwave-flash">';return Ke.poster&&(Ge+='<img src="'+Ke.poster+'" width="'+Ke.width+'" height="'+Ke.height+'" />'),Ge+="</object>",Ge},Tt=(Ke,Ge)=>Ge?Ge(Ke):'<audio controls="controls" src="'+Ke.source+'">'+(Ke.altsource?`
|
|
<source src="`+Ke.altsource+'"'+(Ke.altsourcemime?' type="'+Ke.altsourcemime+'"':"")+` />
|
|
`:"")+"</audio>",Be=(Ke,Ge)=>Ge?Ge(Ke):'<video width="'+Ke.width+'" height="'+Ke.height+'"'+(Ke.poster?' poster="'+Ke.poster+'"':"")+` controls="controls">
|
|
<source src="`+Ke.source+'"'+(Ke.sourcemime?' type="'+Ke.sourcemime+'"':"")+` />
|
|
`+(Ke.altsource?'<source src="'+Ke.altsource+'"'+(Ke.altsourcemime?' type="'+Ke.altsourcemime+'"':"")+` />
|
|
`:"")+"</video>",Ut=(Ke,Ge)=>{var It;const jt=Je.extend({},Ge);if(!jt.source&&(Je.extend(jt,xt((It=jt.embed)!==null&&It!==void 0?It:"",Ke.schema)),!jt.source))return"";jt.altsource||(jt.altsource=""),jt.poster||(jt.poster=""),jt.source=Ke.convertURL(jt.source,"source"),jt.altsource=Ke.convertURL(jt.altsource,"source"),jt.sourcemime=He(jt.source),jt.altsourcemime=He(jt.altsource),jt.poster=Ke.convertURL(jt.poster,"poster");const fo=Wo(jt.source);if(fo&&(jt.source=fo.url,jt.type=fo.type,jt.allowfullscreen=fo.allowFullscreen,jt.width=jt.width||String(fo.w),jt.height=jt.height||String(fo.h)),jt.embed)return No(jt.embed,jt,!0,Ke.schema);{const Lo=te(Ke),Ko=se(Ke),Yr=X(Ke);return jt.width=jt.width||"300",jt.height=jt.height||"150",Je.each(jt,(it,Zo)=>{jt[Zo]=Ke.dom.encode(""+it)}),jt.type==="iframe"?St(jt,Yr):jt.sourcemime==="application/x-shockwave-flash"?Xt(jt):jt.sourcemime.indexOf("audio")!==-1?Tt(jt,Lo):Be(jt,Ko)}},gn=Ke=>Ke.hasAttribute("data-mce-object")||Ke.hasAttribute("data-ephox-embed-iri"),wt=Ke=>{Ke.on("click keyup touchend",()=>{const Ge=Ke.selection.getNode();Ge&&Ke.dom.hasClass(Ge,"mce-preview-object")&&Ke.dom.getAttrib(Ge,"data-mce-selected")&&Ge.setAttribute("data-mce-selected","2")}),Ke.on("ObjectResized",Ge=>{const It=Ge.target;if(It.getAttribute("data-mce-object")){let jt=It.getAttribute("data-mce-html");jt&&(jt=unescape(jt),It.setAttribute("data-mce-html",escape(No(jt,{width:String(Ge.width),height:String(Ge.height)},!1,Ke.schema))))}})},Yt={},vn=(Ke,Ge,It)=>new Promise((jt,fo)=>{const Lo=Ko=>(Ko.html&&(Yt[Ke.source]=Ko),jt({url:Ke.source,html:Ko.html?Ko.html:Ge(Ke)}));Yt[Ke.source]?Lo(Yt[Ke.source]):It({url:Ke.source},Lo,fo)}),rs=(Ke,Ge)=>Promise.resolve({html:Ge(Ke),url:Ke.source}),eo=Ke=>Ge=>Ut(Ke,Ge),ds=(Ke,Ge)=>{const It=Te(Ke);return It?vn(Ge,eo(Ke),It):rs(Ge,eo(Ke))},Or=Ke=>ee(Yt,Ke),Rs=(Ke,Ge)=>q(Ge,Ke).bind(It=>q(It,"meta")),Js=(Ke,Ge,It)=>jt=>{const fo=()=>q(Ke,jt),Lo=()=>q(Ge,jt),Ko=Zo=>q(Zo,"value").bind(Oi=>Oi.length>0?v.some(Oi):v.none()),Yr=()=>fo().bind(Zo=>u(Zo)?Ko(Zo).orThunk(Lo):Lo().orThunk(()=>v.from(Zo))),it=()=>Lo().orThunk(()=>fo().bind(Zo=>u(Zo)?Ko(Zo):v.from(Zo)));return{[jt]:(jt===It?Yr():it()).getOr("")}},Zs=(Ke,Ge)=>{const It={};return q(Ke,"dimensions").each(jt=>{A(["width","height"],fo=>{q(Ge,fo).orThunk(()=>q(jt,fo)).each(Lo=>It[fo]=Lo)})}),It},ba=(Ke,Ge)=>{const It=Ge&&Ge!=="dimensions"?Rs(Ge,Ke).getOr({}):{},jt=Js(Ke,It,Ge);return{...jt("source"),...jt("altsource"),...jt("poster"),...jt("embed"),...Zs(Ke,It)}},ar=Ke=>{const Ge={...Ke,source:{value:q(Ke,"source").getOr("")},altsource:{value:q(Ke,"altsource").getOr("")},poster:{value:q(Ke,"poster").getOr("")}};return A(["width","height"],It=>{q(Ke,It).each(jt=>{const fo=Ge.dimensions||{};fo[It]=jt,Ge.dimensions=fo})}),Ge},Ns=Ke=>Ge=>{const It=Ge&&Ge.msg?"Media embed handler error: "+Ge.msg:"Media embed handler threw unknown error.";Ke.notificationManager.open({type:"error",text:It})},Zr=Ke=>{const Ge=Ke.selection.getNode(),It=gn(Ge)?Ke.serializer.serialize(Ge,{selection:!0}):"",jt=xt(It,Ke.schema),Lo=(()=>{if(Ls(jt.source,jt.type)){const Ko=Ke.dom.getRect(Ge);return{width:Ko.w.toString().replace(/px$/,""),height:Ko.h.toString().replace(/px$/,"")}}else return{}})();return{embed:It,...jt,...Lo}},Po=(Ke,Ge)=>It=>{if(a(It.url)&&It.url.trim().length>0){const jt=It.html,Lo={...xt(jt,Ge.schema),source:It.url,embed:jt};Ke.setData(ar(Lo))}},Mo=(Ke,Ge)=>{const It=Ke.dom.select("*[data-mce-object]");for(let jt=0;jt<Ge.length;jt++)for(let fo=It.length-1;fo>=0;fo--)Ge[jt]===It[fo]&&It.splice(fo,1);Ke.selection.select(It[0])},Mr=(Ke,Ge)=>{const It=Ke.dom.select("*[data-mce-object]");Ke.insertContent(Ge),Mo(Ke,It),Ke.nodeChanged()},Ls=(Ke,Ge)=>g(Ge)&&Ge==="ephox-embed-iri"&&g(Wo(Ke)),na=(Ke,Ge)=>((jt,fo)=>jt.width!==fo.width||jt.height!==fo.height)(Ke,Ge)&&Ls(Ge.source,Ke.type),gs=(Ke,Ge,It)=>{var jt;Ge.embed=na(Ke,Ge)&&nt(It)?Ut(It,{...Ge,embed:""}):No((jt=Ge.embed)!==null&&jt!==void 0?jt:"",Ge,!1,It.schema),Ge.embed&&(Ke.source===Ge.source||Or(Ge.source))?Mr(It,Ge.embed):ds(It,Ge).then(fo=>{Mr(It,fo.html)}).catch(Ns(It))},va=Ke=>{const Ge=Zr(Ke),It=N(Ge),jt=ar(Ge),fo=(fa,Qs)=>{const xr=ba(Qs.getData(),"source");fa.source!==xr.source&&(Po(Ja,Ke)({url:xr.source,html:""}),ds(Ke,xr).then(Po(Ja,Ke)).catch(Ns(Ke)))},Lo=fa=>{var Qs;const xr=ba(fa.getData()),Ki=xt((Qs=xr.embed)!==null&&Qs!==void 0?Qs:"",Ke.schema);fa.setData(ar(Ki))},Ko=(fa,Qs,xr)=>{const Ki=ba(fa.getData(),Qs),dl=na(xr,Ki)&&nt(Ke)?{...Ki,embed:""}:Ki,pc=Ut(Ke,dl);fa.setData(ar({...dl,embed:pc}))},Yr=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],it=nt(Ke)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Zo={title:"General",name:"general",items:O([Yr,it])},oa={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ua=[];_e(Ke)&&ua.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ge(Ke)&&ua.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const ur={title:"Advanced",name:"advanced",items:ua},Dc=[Zo,oa];ua.length>0&&Dc.push(ur);const gc={type:"tabpanel",tabs:Dc},Ja=Ke.windowManager.open({title:"Insert/Edit Media",size:"normal",body:gc,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:fa=>{const Qs=ba(fa.getData());gs(It.get(),Qs,Ke),fa.close()},onChange:(fa,Qs)=>{switch(Qs.name){case"source":fo(It.get(),fa);break;case"embed":Lo(fa);break;case"dimensions":case"altsource":case"poster":Ko(fa,Qs.name,It.get());break}It.set(ba(fa.getData()))},initialData:jt})},ln=Ke=>({showDialog:()=>{va(Ke)}}),ps=Ke=>{const Ge=()=>{va(Ke)};Ke.addCommand("mceMedia",Ge)},Li=(Ke,Ge,It)=>Ge===""||Ke.length>=Ge.length&&Ke.substr(It,It+Ge.length)===Ge,ze=(Ke,Ge)=>Li(Ke,Ge,0);var Qe=tinymce.util.Tools.resolve("tinymce.Env");const Dt=Ke=>{const Ge=Ke.name;return Ge==="iframe"||Ge==="video"||Ge==="audio"},Wt=(Ke,Ge,It,jt=null)=>{const fo=Ke.attr(It);return g(fo)?fo:ee(Ge,It)?null:jt},qn=(Ke,Ge,It)=>{const jt=Ge.name==="img"||Ke.name==="video",fo=jt?"300":null,Lo=Ke.name==="audio"?"30":"150",Ko=jt?Lo:null;Ge.attr({width:Wt(Ke,It,"width",fo),height:Wt(Ke,It,"height",Ko)})},uo=(Ke,Ge,It,jt)=>{const fo=kt(Ke.schema).parse(jt,{context:Ge});for(;fo.firstChild;)It.append(fo.firstChild)},po=(Ke,Ge)=>{const It=Ge.name,jt=new ct("img",1);return ns(Ke,Ge,jt),qn(Ge,jt,{}),jt.attr({style:Ge.attr("style"),src:Qe.transparentSrc,"data-mce-object":It,class:"mce-object mce-object-"+It}),jt},un=(Ke,Ge)=>{var It;const jt=Ge.name,fo=new ct("span",1);fo.attr({contentEditable:"false",style:Ge.attr("style"),"data-mce-object":jt,class:"mce-preview-object mce-object-"+jt}),ns(Ke,Ge,fo);const Lo=Ke.dom.parseStyle((It=Ge.attr("style"))!==null&&It!==void 0?It:""),Ko=new ct(jt,1);if(qn(Ge,Ko,Lo),Ko.attr({src:Ge.attr("src"),style:Ge.attr("style"),class:Ge.attr("class")}),jt==="iframe")Ko.attr({allowfullscreen:Ge.attr("allowfullscreen"),frameborder:"0"});else{A(["controls","crossorigin","currentTime","loop","muted","poster","preload"],Oi=>{Ko.attr(Oi,Ge.attr(Oi))});const Zo=fo.attr("data-mce-html");g(Zo)&&uo(Ke,jt,Ko,unescape(Zo))}const Yr=new ct("span",1);return Yr.attr("class","mce-shim"),fo.append(Ko),fo.append(Yr),fo},ns=(Ke,Ge,It)=>{var jt;const fo=(jt=Ge.attributes)!==null&&jt!==void 0?jt:[];let Lo=fo.length;for(;Lo--;){const Zo=fo[Lo].name;let Oi=fo[Lo].value;Zo!=="width"&&Zo!=="height"&&Zo!=="style"&&!ze(Zo,"data-mce-")&&((Zo==="data"||Zo==="src")&&(Oi=Ke.convertURL(Oi,Zo)),It.attr("data-mce-p-"+Zo,Oi))}const Ko=an({inner:!0},Ke.schema),Yr=new ct("div",1);A(Ge.children(),Zo=>Yr.append(Zo));const it=Ko.serialize(Yr);it&&(It.attr("data-mce-html",escape(it)),It.empty())},_o=Ke=>{const Ge=Ke.attr("class");return a(Ge)&&/\btiny-pageembed\b/.test(Ge)},cs=Ke=>{let Ge=Ke;for(;Ge=Ge.parent;)if(Ge.attr("data-ephox-embed-iri")||_o(Ge))return!0;return!1},Sr=Ke=>Ge=>{let It=Ge.length,jt;for(;It--;)jt=Ge[It],jt.parent&&(jt.parent.attr("data-mce-object")||(Dt(jt)&&we(Ke)?cs(jt)||jt.replace(un(Ke,jt)):cs(jt)||jt.replace(po(Ke,jt))))},Ir=(Ke,Ge,It)=>{const jt=Ke.options.get,fo=jt("xss_sanitization"),Lo=ye(Ke);return kt(Ke.schema,{sanitize:fo,validate:Lo}).parse(It,{context:Ge})},Vs=Ke=>{Ke.on("PreInit",()=>{const{schema:Ge,serializer:It,parser:jt}=Ke,fo=Ge.getBoolAttrs();A("webkitallowfullscreen mozallowfullscreen".split(" "),Lo=>{fo[Lo]={}}),z({embed:["wmode"]},(Lo,Ko)=>{const Yr=Ge.getElementRule(Ko);Yr&&A(Lo,it=>{Yr.attributes[it]={},Yr.attributesOrder.push(it)})}),jt.addNodeFilter("iframe,video,audio,object,embed",Sr(Ke)),It.addAttributeFilter("data-mce-object",(Lo,Ko)=>{var Yr;let it=Lo.length;for(;it--;){const Zo=Lo[it];if(!Zo.parent)continue;const Oi=Zo.attr(Ko),oa=new ct(Oi,1);if(Oi!=="audio"){const gc=Zo.attr("class");gc&&gc.indexOf("mce-preview-object")!==-1&&Zo.firstChild?oa.attr({width:Zo.firstChild.attr("width"),height:Zo.firstChild.attr("height")}):oa.attr({width:Zo.attr("width"),height:Zo.attr("height")})}oa.attr({style:Zo.attr("style")});const ua=(Yr=Zo.attributes)!==null&&Yr!==void 0?Yr:[];let ur=ua.length;for(;ur--;){const gc=ua[ur].name;gc.indexOf("data-mce-p-")===0&&oa.attr(gc.substr(11),ua[ur].value)}const Dc=Zo.attr("data-mce-html");if(Dc){const gc=Ir(Ke,Oi,unescape(Dc));A(gc.children(),Ja=>oa.append(Ja))}Zo.replace(oa)}})}),Ke.on("SetContent",()=>{const Ge=Ke.dom;A(Ge.select("span.mce-preview-object"),It=>{Ge.select("span.mce-shim",It).length===0&&Ge.add(It,"span",{class:"mce-shim"})})})},Ur=Ke=>{Ke.on("ResolveName",Ge=>{let It;Ge.target.nodeType===1&&(It=Ge.target.getAttribute("data-mce-object"))&&(Ge.name=It)})},Fi=Ke=>Ge=>{const It=()=>{Ge.setEnabled(Ke.selection.isEditable())};return Ke.on("NodeChange",It),It(),()=>{Ke.off("NodeChange",It)}},La=Ke=>{const Ge=()=>Ke.execCommand("mceMedia");Ke.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:Ge,onSetup:It=>{const jt=Ke.selection;It.setActive(gn(jt.getNode()));const fo=jt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",It.setActive).unbind,Lo=Fi(Ke)(It);return()=>{fo(),Lo()}}}),Ke.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:Ge,onSetup:Fi(Ke)})};var mi=()=>{r.add("media",Ke=>(oe(Ke),ps(Ke),La(Ke),Ur(Ke),Vs(Ke),wt(Ke),ln(Ke)))};mi()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Q,ce,Se)=>{var Xe;return Se(Q,ce.prototype)?!0:((Xe=Q.constructor)===null||Xe===void 0?void 0:Xe.name)===ce.name},t=Q=>{const ce=typeof Q;return Q===null?"null":ce==="object"&&Array.isArray(Q)?"array":ce==="object"&&e(Q,String,(Se,Xe)=>Xe.isPrototypeOf(Se))?"string":ce},s=Q=>ce=>t(ce)===Q,a=Q=>ce=>typeof ce===Q,u=s("string"),f=s("object"),h=s("array"),g=a("boolean"),v=Q=>Q==null,_=Q=>!v(Q),A=a("function"),O=a("number"),N=()=>{},L=Q=>()=>Q,j=(Q,ce)=>Q===ce;function z(Q,...ce){return(...Se)=>{const Xe=ce.concat(Se);return Q.apply(null,Xe)}}const q=Q=>ce=>!Q(ce),ee=L(!1);class F{constructor(ce,Se){this.tag=ce,this.value=Se}static some(ce){return new F(!0,ce)}static none(){return F.singletonNone}fold(ce,Se){return this.tag?Se(this.value):ce()}isSome(){return this.tag}isNone(){return!this.tag}map(ce){return this.tag?F.some(ce(this.value)):F.none()}bind(ce){return this.tag?ce(this.value):F.none()}exists(ce){return this.tag&&ce(this.value)}forall(ce){return!this.tag||ce(this.value)}filter(ce){return!this.tag||ce(this.value)?this:F.none()}getOr(ce){return this.tag?this.value:ce}or(ce){return this.tag?this:ce}getOrThunk(ce){return this.tag?this.value:ce()}orThunk(ce){return this.tag?this:ce()}getOrDie(ce){if(this.tag)return this.value;throw new Error(ce!=null?ce:"Called getOrDie on None")}static from(ce){return _(ce)?F.some(ce):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ce){this.tag&&ce(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const oe=Array.prototype.slice,te=Array.prototype.indexOf,se=Array.prototype.push,X=(Q,ce)=>te.call(Q,ce),we=(Q,ce)=>X(Q,ce)>-1,ye=(Q,ce)=>{for(let Se=0,Xe=Q.length;Se<Xe;Se++){const rt=Q[Se];if(ce(rt,Se))return!0}return!1},Te=(Q,ce)=>{const Se=Q.length,Xe=new Array(Se);for(let rt=0;rt<Se;rt++){const On=Q[rt];Xe[rt]=ce(On,rt)}return Xe},_e=(Q,ce)=>{for(let Se=0,Xe=Q.length;Se<Xe;Se++){const rt=Q[Se];ce(rt,Se)}},ge=(Q,ce)=>{const Se=[];for(let Xe=0,rt=Q.length;Xe<rt;Xe++){const On=Q[Xe];ce(On,Xe)&&Se.push(On)}return Se},nt=(Q,ce)=>{if(Q.length===0)return[];{let Se=ce(Q[0]);const Xe=[];let rt=[];for(let On=0,Cn=Q.length;On<Cn;On++){const Yo=Q[On],os=ce(Yo);os!==Se&&(Xe.push(rt),rt=[]),Se=os,rt.push(Yo)}return rt.length!==0&&Xe.push(rt),Xe}},Je=(Q,ce,Se)=>(_e(Q,(Xe,rt)=>{Se=ce(Se,Xe,rt)}),Se),ft=(Q,ce,Se)=>{for(let Xe=0,rt=Q.length;Xe<rt;Xe++){const On=Q[Xe];if(ce(On,Xe))return F.some(On);if(Se(On,Xe))break}return F.none()},V=(Q,ce)=>ft(Q,ce,ee),ut=Q=>{const ce=[];for(let Se=0,Xe=Q.length;Se<Xe;++Se){if(!h(Q[Se]))throw new Error("Arr.flatten item "+Se+" was not an array, input: "+Q);se.apply(ce,Q[Se])}return ce},et=(Q,ce)=>ut(Te(Q,ce)),Et=Q=>{const ce=oe.call(Q,0);return ce.reverse(),ce},xt=(Q,ce)=>ce>=0&&ce<Q.length?F.some(Q[ce]):F.none(),He=Q=>xt(Q,0),ct=Q=>xt(Q,Q.length-1),an=(Q,ce)=>{const Se=[],Xe=A(ce)?rt=>ye(Se,On=>ce(On,rt)):rt=>we(Se,rt);for(let rt=0,On=Q.length;rt<On;rt++){const Cn=Q[rt];Xe(Cn)||Se.push(Cn)}return Se},kt=(Q,ce,Se=j)=>Q.exists(Xe=>Se(Xe,ce)),bn=(Q,ce,Se=j)=>qe(Q,ce,Se).getOr(Q.isNone()&&ce.isNone()),qe=(Q,ce,Se)=>Q.isSome()&&ce.isSome()?F.some(Se(Q.getOrDie(),ce.getOrDie())):F.none(),gt=1,de=(Q,ce)=>{const Xe=(ce||document).createElement("div");if(Xe.innerHTML=Q,!Xe.hasChildNodes()||Xe.childNodes.length>1){const rt="HTML does not have a single root node";throw console.error(rt,Q),new Error(rt)}return Bn(Xe.childNodes[0])},No=(Q,ce)=>{const Xe=(ce||document).createElement(Q);return Bn(Xe)},Zn=(Q,ce)=>{const Xe=(ce||document).createTextNode(Q);return Bn(Xe)},Bn=Q=>{if(Q==null)throw new Error("Node cannot be null or undefined");return{dom:Q}},Wo={fromHtml:de,fromTag:No,fromText:Zn,fromDom:Bn,fromPoint:(Q,ce,Se)=>F.from(Q.dom.elementFromPoint(ce,Se)).map(Bn)},St=(Q,ce)=>{const Se=Q.dom;if(Se.nodeType!==gt)return!1;{const Xe=Se;if(Xe.matches!==void 0)return Xe.matches(ce);if(Xe.msMatchesSelector!==void 0)return Xe.msMatchesSelector(ce);if(Xe.webkitMatchesSelector!==void 0)return Xe.webkitMatchesSelector(ce);if(Xe.mozMatchesSelector!==void 0)return Xe.mozMatchesSelector(ce);throw new Error("Browser lacks native selectors")}},Xt=(Q,ce)=>Q.dom===ce.dom,Tt=(Q,ce)=>{const Se=Q.dom,Xe=ce.dom;return Se===Xe?!1:Se.contains(Xe)},Be=St;var Ut=(Q,ce,Se,Xe,rt)=>Q(Se,Xe)?F.some(Se):A(rt)&&rt(Se)?F.none():ce(Se,Xe,rt);typeof window<"u"||Function("return this;")();const gn=Q=>Q.dom.nodeName.toLowerCase(),wt=Q=>Q.dom.nodeType,vn=(Q=>ce=>wt(ce)===Q)(gt),rs=Q=>ce=>vn(ce)&&gn(ce)===Q,eo=Q=>F.from(Q.dom.parentNode).map(Wo.fromDom),ds=Q=>F.from(Q.dom.parentElement).map(Wo.fromDom),Or=Q=>F.from(Q.dom.nextSibling).map(Wo.fromDom),Rs=Q=>Te(Q.dom.childNodes,Wo.fromDom),Js=(Q,ce)=>{const Se=Q.dom.childNodes;return F.from(Se[ce]).map(Wo.fromDom)},Zs=Q=>Js(Q,0),ba=Q=>Js(Q,Q.dom.childNodes.length-1),ar=(Q,ce,Se)=>{let Xe=Q.dom;const rt=A(Se)?Se:ee;for(;Xe.parentNode;){Xe=Xe.parentNode;const On=Wo.fromDom(Xe);if(ce(On))return F.some(On);if(rt(On))break}return F.none()},Ns=(Q,ce,Se)=>Ut((rt,On)=>On(rt),ar,Q,ce,Se),Zr=(Q,ce)=>{eo(Q).each(Xe=>{Xe.dom.insertBefore(ce.dom,Q.dom)})},Po=(Q,ce)=>{Or(Q).fold(()=>{eo(Q).each(rt=>{Mo(rt,ce)})},Xe=>{Zr(Xe,ce)})},Mo=(Q,ce)=>{Q.dom.appendChild(ce.dom)},Mr=(Q,ce)=>{_e(ce,Se=>{Zr(Q,Se)})},Ls=(Q,ce)=>{_e(ce,Se=>{Mo(Q,Se)})},na=Q=>{Q.dom.textContent="",_e(Rs(Q),ce=>{gs(ce)})},gs=Q=>{const ce=Q.dom;ce.parentNode!==null&&ce.parentNode.removeChild(ce)};var va=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ln=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ps=tinymce.util.Tools.resolve("tinymce.util.VK");const Li=Q=>Te(Q,Wo.fromDom),ze=Object.keys,Qe=(Q,ce)=>{const Se=ze(Q);for(let Xe=0,rt=Se.length;Xe<rt;Xe++){const On=Se[Xe],Cn=Q[On];ce(Cn,On)}},Dt=Q=>(ce,Se)=>{Q[Se]=ce},Wt=(Q,ce,Se,Xe)=>{Qe(Q,(rt,On)=>{(ce(rt,On)?Se:Xe)(rt,On)})},qn=(Q,ce)=>{const Se={};return Wt(Q,ce,Dt(Se),N),Se},uo=(Q,ce,Se)=>{if(u(Se)||g(Se)||O(Se))Q.setAttribute(ce,Se+"");else throw console.error("Invalid call to Attribute.set. Key ",ce,":: Value ",Se,":: Element ",Q),new Error("Attribute value was not simple")},po=(Q,ce)=>{const Se=Q.dom;Qe(ce,(Xe,rt)=>{uo(Se,rt,Xe)})},un=Q=>Je(Q.dom.attributes,(ce,Se)=>(ce[Se.name]=Se.value,ce),{}),ns=(Q,ce)=>Wo.fromDom(Q.dom.cloneNode(ce)),_o=Q=>ns(Q,!0),cs=(Q,ce)=>{const Se=Wo.fromTag(ce),Xe=un(Q);return po(Se,Xe),Se},Sr=(Q,ce)=>{const Se=cs(Q,ce);Po(Q,Se);const Xe=Rs(Q);return Ls(Se,Xe),gs(Q),Se};var Ir=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vs=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ur=Q=>ce=>_(ce)&&ce.nodeName.toLowerCase()===Q,Fi=Q=>ce=>_(ce)&&Q.test(ce.nodeName),La=Q=>_(Q)&&Q.nodeType===3,mi=Q=>_(Q)&&Q.nodeType===1,Ke=Fi(/^(OL|UL|DL)$/),Ge=Fi(/^(OL|UL)$/),It=Ur("ol"),jt=Fi(/^(LI|DT|DD)$/),fo=Fi(/^(DT|DD)$/),Lo=Fi(/^(TH|TD)$/),Ko=Ur("br"),Yr=Q=>{var ce;return((ce=Q.parentNode)===null||ce===void 0?void 0:ce.firstChild)===Q},it=(Q,ce)=>_(ce)&&ce.nodeName in Q.schema.getTextBlockElements(),Zo=(Q,ce)=>_(Q)&&Q.nodeName in ce,Oi=(Q,ce)=>_(ce)&&ce.nodeName in Q.schema.getVoidElements(),oa=(Q,ce)=>Ko(ce)?Q.isBlock(ce.nextSibling)&&!Ko(ce.previousSibling):!1,ua=(Q,ce,Se)=>{const Xe=Q.isEmpty(ce);return Se&&Q.select("span[data-mce-type=bookmark]",ce).length>0?!1:Xe},ur=(Q,ce)=>Q.isChildOf(ce,Q.getRoot()),Dc=Q=>ce=>ce.options.get(Q),gc=Q=>{const ce=Q.options.register;ce("lists_indent_on_tab",{processor:"boolean",default:!0})},Ja=Dc("lists_indent_on_tab"),fa=Dc("forced_root_block"),Qs=Dc("forced_root_block_attrs"),xr=(Q,ce)=>{const Se=Q.dom,Xe=Q.schema.getBlockElements(),rt=Se.createFragment(),On=fa(Q),Cn=Qs(Q);let Yo,os,ho=!1;for(os=Se.create(On,Cn),Zo(ce.firstChild,Xe)||rt.appendChild(os);Yo=ce.firstChild;){const Er=Yo.nodeName;!ho&&(Er!=="SPAN"||Yo.getAttribute("data-mce-type")!=="bookmark")&&(ho=!0),Zo(Yo,Xe)?(rt.appendChild(Yo),os=null):(os||(os=Se.create(On,Cn),rt.appendChild(os)),os.appendChild(Yo))}return!ho&&os&&os.appendChild(Se.create("br",{"data-mce-bogus":"1"})),rt},Ki=Ir.DOM,dl=(Q,ce,Se)=>{const Xe=ho=>{const Er=ho.parentNode;Er&&Vs.each(rt,Zl=>{Er.insertBefore(Zl,Se.parentNode)}),Ki.remove(ho)},rt=Ki.select('span[data-mce-type="bookmark"]',ce),On=xr(Q,Se),Cn=Ki.createRng();Cn.setStartAfter(Se),Cn.setEndAfter(ce);const Yo=Cn.extractContents();for(let ho=Yo.firstChild;ho;ho=ho.firstChild)if(ho.nodeName==="LI"&&Q.dom.isEmpty(ho)){Ki.remove(ho);break}Q.dom.isEmpty(Yo)||Ki.insertAfter(Yo,ce),Ki.insertAfter(On,ce);const os=Se.parentElement;os&&ua(Q.dom,os)&&Xe(os),Ki.remove(Se),ua(Q.dom,ce)&&Ki.remove(ce)},pc=rs("dd"),Zc=rs("dt"),gu=(Q,ce)=>{pc(ce)?Sr(ce,"dt"):Zc(ce)&&ds(ce).each(Se=>dl(Q,Se.dom,ce.dom))},pr=Q=>{Zc(Q)&&Sr(Q,"dd")},Qa=(Q,ce,Se)=>{ce==="Indent"?_e(Se,pr):_e(Se,Xe=>gu(Q,Xe))},pu=(Q,ce)=>{if(La(Q))return{container:Q,offset:ce};const Se=va.getNode(Q,ce);return La(Se)?{container:Se,offset:ce>=Q.childNodes.length?Se.data.length:0}:Se.previousSibling&&La(Se.previousSibling)?{container:Se.previousSibling,offset:Se.previousSibling.data.length}:Se.nextSibling&&La(Se.nextSibling)?{container:Se.nextSibling,offset:0}:{container:Q,offset:ce}},qc=Q=>{const ce=Q.cloneRange(),Se=pu(Q.startContainer,Q.startOffset);ce.setStart(Se.container,Se.offset);const Xe=pu(Q.endContainer,Q.endOffset);return ce.setEnd(Xe.container,Xe.offset),ce},Vl=["OL","UL","DL"],Aa=Vl.join(","),Tr=(Q,ce)=>{const Se=ce||Q.selection.getStart(!0);return Q.dom.getParent(Se,Aa,Ha(Q,Se))},Rm=(Q,ce)=>_(Q)&&ce.length===1&&ce[0]===Q,gf=Q=>ge(Q.querySelectorAll(Aa),Ke),kr=Q=>{const ce=Tr(Q),Se=Q.selection.getSelectedBlocks();return Rm(ce,Se)?gf(ce):ge(Se,Xe=>Ke(Xe)&&ce!==Xe)},Fa=(Q,ce)=>{const Se=Vs.map(ce,Xe=>{const rt=Q.dom.getParent(Xe,"li,dd,dt",Ha(Q,Xe));return rt||Xe});return an(Se)},sa=Q=>{const ce=Q.selection.getSelectedBlocks();return ge(Fa(Q,ce),jt)},Yi=Q=>ge(sa(Q),fo),bu=(Q,ce)=>{const Se=Q.dom.getParents(ce,"TD,TH");return Se.length>0?Se[0]:Q.getBody()},Oc=(Q,ce)=>!Ke(ce)&&!jt(ce)&&ye(Vl,Se=>Q.isValidChild(ce.nodeName,Se)),Ha=(Q,ce)=>{const Se=Q.dom.getParents(ce,Q.dom.isBlock);return V(Se,rt=>Oc(Q.schema,rt)).getOr(Q.getBody())},Mc=(Q,ce)=>{const Se=Q.dom.getParents(ce,"ol,ul",Ha(Q,ce));return ct(Se)},bc=Q=>{const ce=Mc(Q,Q.selection.getStart()),Se=ge(Q.selection.getSelectedBlocks(),Ge);return ce.toArray().concat(Se)},gd=Q=>{const ce=bc(Q);return Bf(Q,ce)},Bf=(Q,ce)=>{const Se=Te(ce,Xe=>Mc(Q,Xe).getOr(Xe));return an(Se)},vu=Q=>/\btox\-/.test(Q.className),Ul=(Q,ce)=>ft(Q,Ke,Lo).exists(Se=>Se.nodeName===ce&&!vu(Se)),Rc=(Q,ce)=>ce!==null&&!Q.dom.isEditable(ce),pf=Q=>{const ce=Tr(Q);return Rc(Q,ce)},Gc=(Q,ce)=>{const Se=Q.dom.getParent(ce,"ol,ul,dl");return Rc(Q,Se)},pd=(Q,ce)=>{const Se=Q.selection.getNode();return ce({parents:Q.dom.getParents(Se),element:Se}),Q.on("NodeChange",ce),()=>Q.off("NodeChange",ce)},xe=(Q,ce)=>{const Xe=(ce||document).createDocumentFragment();return _e(Q,rt=>{Xe.appendChild(rt.dom)}),Wo.fromDom(Xe)},tt=(Q,ce,Se)=>Q.dispatch("ListMutation",{action:ce,element:Se}),Pt=(Q=>ce=>ce.replace(Q,""))(/^\s+|\s+$/g),yn=Q=>Q.length>0,Ro=Q=>!yn(Q),Rr=Q=>Q.style!==void 0&&A(Q.style.getPropertyValue),ys=(Q,ce,Se)=>{if(!u(Se))throw console.error("Invalid call to CSS.set. Property ",ce,":: Value ",Se,":: Element ",Q),new Error("CSS value must be a string: "+Se);Rr(Q)&&Q.style.setProperty(ce,Se)},is=(Q,ce,Se)=>{const Xe=Q.dom;ys(Xe,ce,Se)},Ei=(Q,ce)=>{Mo(Q.item,ce.list)},qs=Q=>{for(let ce=1;ce<Q.length;ce++)Ei(Q[ce-1],Q[ce])},Hi=(Q,ce)=>{qe(ct(Q),He(ce),Ei)},yu=(Q,ce)=>{const Se={list:Wo.fromTag(ce,Q),item:Wo.fromTag("li",Q)};return Mo(Se.list,Se.item),Se},bd=(Q,ce,Se)=>{const Xe=[];for(let rt=0;rt<Se;rt++)Xe.push(yu(Q,ce.listType));return Xe},Xn=(Q,ce)=>{for(let Se=0;Se<Q.length-1;Se++)is(Q[Se].item,"list-style-type","none");ct(Q).each(Se=>{po(Se.list,ce.listAttributes),po(Se.item,ce.itemAttributes),Ls(Se.item,ce.content)})},Nm=(Q,ce)=>{gn(Q.list)!==ce.listType&&(Q.list=Sr(Q.list,ce.listType)),po(Q.list,ce.listAttributes)},$i=(Q,ce,Se)=>{const Xe=Wo.fromTag("li",Q);return po(Xe,ce),Ls(Xe,Se),Xe},he=(Q,ce)=>{Mo(Q.list,ce),Q.item=ce},Re=(Q,ce,Se)=>{const Xe=ce.slice(0,Se.depth);return ct(Xe).each(rt=>{const On=$i(Q,Se.itemAttributes,Se.content);he(rt,On),Nm(rt,Se)}),Xe},We=(Q,ce,Se)=>{const Xe=bd(Q,Se,Se.depth-ce.length);return qs(Xe),Xn(Xe,Se),Hi(ce,Xe),ce.concat(Xe)},Bt=(Q,ce)=>{const Se=Je(ce,(Xe,rt)=>rt.depth>Xe.length?We(Q,Xe,rt):Re(Q,Xe,rt),[]);return He(Se).map(Xe=>Xe.list)},Fn=Q=>Be(Q,"OL,UL"),Jo=Q=>Zs(Q).exists(Fn),so=Q=>ba(Q).exists(Fn),gi=Q=>Q.depth>0,hn=Q=>Q.isSelected,qr=Q=>{const ce=Rs(Q),Se=so(Q)?ce.slice(0,-1):ce;return Te(Se,_o)},Nl=(Q,ce,Se)=>eo(Q).filter(vn).map(Xe=>({depth:ce,dirty:!1,isSelected:Se,content:qr(Q),itemAttributes:un(Q),listAttributes:un(Xe),listType:gn(Xe)})),Xi=(Q,ce)=>{switch(Q){case"Indent":ce.depth++;break;case"Outdent":ce.depth--;break;case"Flatten":ce.depth=0}ce.dirty=!0},ni=(Q,ce)=>{Q.listType=ce.listType,Q.listAttributes={...ce.listAttributes}},bf=Q=>{Q.listAttributes=qn(Q.listAttributes,(ce,Se)=>Se!=="start")},Ss=(Q,ce)=>{const Se=Q[ce].depth,Xe=On=>On.depth===Se&&!On.dirty,rt=On=>On.depth<Se;return ft(Et(Q.slice(0,ce)),Xe,rt).orThunk(()=>ft(Q.slice(ce+1),Xe,rt))},Kc=Q=>(_e(Q,(ce,Se)=>{Ss(Q,Se).fold(()=>{ce.dirty&&bf(ce)},Xe=>ni(ce,Xe))}),Q),Ai=Q=>{let ce=Q;return{get:()=>ce,set:rt=>{ce=rt}}},sc=(Q,ce,Se,Xe)=>Zs(Xe).filter(Fn).fold(()=>{ce.each(Cn=>{Xt(Cn.start,Xe)&&Se.set(!0)});const rt=Nl(Xe,Q,Se.get());ce.each(Cn=>{Xt(Cn.end,Xe)&&Se.set(!1)});const On=ba(Xe).filter(Fn).map(Cn=>Mi(Q,ce,Se,Cn)).getOr([]);return rt.toArray().concat(On)},rt=>Mi(Q,ce,Se,rt)),Mi=(Q,ce,Se,Xe)=>et(Rs(Xe),rt=>{const On=Fn(rt)?Mi:sc,Cn=Q+1;return On(Cn,ce,Se,rt)}),Lf=(Q,ce)=>{const Se=Ai(!1),Xe=0;return Te(Q,rt=>({sourceList:rt,entries:Mi(Xe,ce,Se,rt)}))},da=(Q,ce)=>{const Se=Kc(ce);return Te(Se,Xe=>{const rt=xe(Xe.content);return Wo.fromDom(xr(Q,rt.dom))})},Ff=(Q,ce)=>{const Se=Kc(ce);return Bt(Q.contentDocument,Se).toArray()},fr=(Q,ce)=>et(nt(ce,gi),Se=>He(Se).exists(gi)?Ff(Q,Se):da(Q,Se)),$u=(Q,ce)=>{_e(ge(Q,hn),Se=>Xi(ce,Se))},zu=Q=>{const ce=Te(sa(Q),Wo.fromDom);return qe(V(ce,q(Jo)),V(Et(ce),q(Jo)),(Se,Xe)=>({start:Se,end:Xe}))},vc=(Q,ce,Se)=>{const Xe=Lf(ce,zu(Q));_e(Xe,rt=>{$u(rt.entries,Se);const On=fr(Q,rt.entries);_e(On,Cn=>{tt(Q,Se==="Indent"?"IndentList":"OutdentList",Cn.dom)}),Mr(rt.sourceList,On),gs(rt.sourceList)})},Hf=(Q,ce)=>{const Se=Li(gd(Q)),Xe=Li(Yi(Q));let rt=!1;if(Se.length||Xe.length){const On=Q.selection.getBookmark();vc(Q,Se,ce),Qa(Q,ce,Xe),Q.selection.moveToBookmark(On),Q.selection.setRng(qc(Q.selection.getRng())),Q.nodeChanged(),rt=!0}return rt},jd=(Q,ce)=>!pf(Q)&&Hf(Q,ce),Xr=Q=>jd(Q,"Indent"),Ji=Q=>jd(Q,"Outdent"),$a=Q=>jd(Q,"Flatten"),U0="\uFEFF",xi=Q=>Q===U0,_l=(Q,ce,Se)=>ar(Q,ce,Se).isSome(),el=(Q,ce)=>_l(Q,z(Xt,ce));var Ng=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const $f=Ir.DOM,yc=Q=>{const ce={},Se=Xe=>{let rt=Q[Xe?"startContainer":"endContainer"],On=Q[Xe?"startOffset":"endOffset"];if(mi(rt)){const Cn=$f.create("span",{"data-mce-type":"bookmark"});rt.hasChildNodes()?(On=Math.min(On,rt.childNodes.length-1),Xe?rt.insertBefore(Cn,rt.childNodes[On]):$f.insertAfter(Cn,rt.childNodes[On])):rt.appendChild(Cn),rt=Cn,On=0}ce[Xe?"startContainer":"endContainer"]=rt,ce[Xe?"startOffset":"endOffset"]=On};return Se(!0),Q.collapsed||Se(),ce},vf=Q=>{const ce=Xe=>{const rt=Yo=>{var os;let ho=(os=Yo.parentNode)===null||os===void 0?void 0:os.firstChild,Er=0;for(;ho;){if(ho===Yo)return Er;(!mi(ho)||ho.getAttribute("data-mce-type")!=="bookmark")&&Er++,ho=ho.nextSibling}return-1};let On=Q[Xe?"startContainer":"endContainer"],Cn=Q[Xe?"startOffset":"endOffset"];if(!!On){if(mi(On)&&On.parentNode){const Yo=On;Cn=rt(On),On=On.parentNode,$f.remove(Yo),!On.hasChildNodes()&&$f.isBlock(On)&&On.appendChild($f.create("br"))}Q[Xe?"startContainer":"endContainer"]=On,Q[Xe?"startOffset":"endOffset"]=Cn}};ce(!0),ce();const Se=$f.createRng();return Se.setStart(Q.startContainer,Q.startOffset),Q.endContainer&&Se.setEnd(Q.endContainer,Q.endOffset),qc(Se)},Dr=Q=>{switch(Q){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Vu=(Q,ce,Se)=>{const Xe=Se["list-style-type"]?Se["list-style-type"]:null;Q.setStyle(ce,"list-style-type",Xe)},Pl=(Q,ce)=>{Vs.each(ce,(Se,Xe)=>{Q.setAttribute(Xe,Se)})},za=(Q,ce,Se)=>{Pl(ce,Se["list-attributes"]),Vs.each(Q.select("li",ce),Xe=>{Pl(Xe,Se["list-item-attributes"])})},qi=(Q,ce,Se)=>{Vu(Q,ce,Se),za(Q,ce,Se)},zi=(Q,ce,Se)=>{Vs.each(Se,Xe=>Q.setStyle(ce,Xe,""))},rc=(Q,ce)=>_(ce)&&!Zo(ce,Q.schema.getBlockElements()),zf=(Q,ce,Se,Xe)=>{let rt=ce[Se?"startContainer":"endContainer"];const On=ce[Se?"startOffset":"endOffset"];mi(rt)&&(rt=rt.childNodes[Math.min(On,rt.childNodes.length-1)]||rt),!Se&&Ko(rt.nextSibling)&&(rt=rt.nextSibling);const Cn=os=>{for(;!Q.dom.isBlock(os)&&os.parentNode&&Xe!==os;)os=os.parentNode;return os},Yo=(os,ho)=>{var Er;const Zl=new ln(os,Cn(os)),ra=ho?"next":"prev";let Ri;for(;Ri=Zl[ra]();)if(!(Oi(Q,Ri)||xi(Ri.textContent)||((Er=Ri.textContent)===null||Er===void 0?void 0:Er.length)===0))return F.some(Ri);return F.none()};if(Se&&La(rt))if(xi(rt.textContent))rt=Yo(rt,!1).getOr(rt);else for(rt.parentNode!==null&&rc(Q,rt.parentNode)&&(rt=rt.parentNode);rt.previousSibling!==null&&(rc(Q,rt.previousSibling)||La(rt.previousSibling));)rt=rt.previousSibling;if(!Se&&La(rt))if(xi(rt.textContent))rt=Yo(rt,!0).getOr(rt);else for(rt.parentNode!==null&&rc(Q,rt.parentNode)&&(rt=rt.parentNode);rt.nextSibling!==null&&(rc(Q,rt.nextSibling)||La(rt.nextSibling));)rt=rt.nextSibling;for(;rt.parentNode!==Xe;){const os=rt.parentNode;if(it(Q,rt)||/^(TD|TH)$/.test(os.nodeName))return rt;rt=os}return rt},Zd=(Q,ce,Se)=>{const Xe=[],rt=Q.dom,On=zf(Q,ce,!0,Se),Cn=zf(Q,ce,!1,Se);let Yo;const os=[];for(let ho=On;ho&&(os.push(ho),ho!==Cn);ho=ho.nextSibling);return Vs.each(os,ho=>{var Er;if(it(Q,ho)){Xe.push(ho),Yo=null;return}if(rt.isBlock(ho)||Ko(ho)){Ko(ho)&&rt.remove(ho),Yo=null;return}const Zl=ho.nextSibling;if(Ng.isBookmarkNode(ho)&&(Ke(Zl)||it(Q,Zl)||!Zl&&ho.parentNode===Se)){Yo=null;return}Yo||(Yo=rt.create("p"),(Er=ho.parentNode)===null||Er===void 0||Er.insertBefore(Yo,ho),Xe.push(Yo)),Yo.appendChild(ho)}),Xe},Pg=(Q,ce,Se)=>{const Xe=Q.getStyle(ce,"list-style-type");let rt=Se?Se["list-style-type"]:"";return rt=rt===null?"":rt,Xe===rt},Pm=(Q,ce)=>{const Se=Q.selection.getStart(!0),Xe=zf(Q,ce,!0,Q.getBody());return el(Wo.fromDom(Xe),Wo.fromDom(ce.commonAncestorContainer))?ce.commonAncestorContainer:Se},Il=(Q,ce,Se)=>{const Xe=Q.selection.getRng();let rt="LI";const On=Ha(Q,Pm(Q,Xe)),Cn=Q.dom;if(Cn.getContentEditable(Q.selection.getNode())==="false")return;ce=ce.toUpperCase(),ce==="DL"&&(rt="DT");const Yo=yc(Xe),os=ge(Zd(Q,Xe,On),Q.dom.isEditable);Vs.each(os,ho=>{let Er;const Zl=ho.previousSibling,ra=ho.parentNode;jt(ra)||(Zl&&Ke(Zl)&&Zl.nodeName===ce&&Pg(Cn,Zl,Se)?(Er=Zl,ho=Cn.rename(ho,rt),Zl.appendChild(ho)):(Er=Cn.create(ce),ra.insertBefore(Er,ho),Er.appendChild(ho),ho=Cn.rename(ho,rt)),zi(Cn,ho,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),qi(Cn,Er,Se),Uu(Q.dom,Er))}),Q.selection.setRng(vf(Yo))},Im=(Q,ce)=>Ke(Q)&&Q.nodeName===(ce==null?void 0:ce.nodeName),tl=(Q,ce,Se)=>{const Xe=Q.getStyle(ce,"list-style-type",!0),rt=Q.getStyle(Se,"list-style-type",!0);return Xe===rt},yf=(Q,ce)=>Q.className===ce.className,zh=(Q,ce,Se)=>Im(ce,Se)&&tl(Q,ce,Se)&&yf(ce,Se),Uu=(Q,ce)=>{let Se,Xe=ce.nextSibling;if(zh(Q,ce,Xe)){const rt=Xe;for(;Se=rt.firstChild;)ce.appendChild(Se);Q.remove(rt)}if(Xe=ce.previousSibling,zh(Q,ce,Xe)){const rt=Xe;for(;Se=rt.lastChild;)ce.insertBefore(Se,ce.firstChild);Q.remove(rt)}},Vh=(Q,ce,Se,Xe)=>{if(ce.nodeName!==Se){const rt=Q.dom.rename(ce,Se);qi(Q.dom,rt,Xe),tt(Q,Dr(Se),rt)}else qi(Q.dom,ce,Xe),tt(Q,Dr(Se),ce)},Nc=(Q,ce,Se,Xe)=>{if(ce.classList.forEach((rt,On,Cn)=>{rt.startsWith("tox-")&&(Cn.remove(rt),Cn.length===0&&ce.removeAttribute("class"))}),ce.nodeName!==Se){const rt=Q.dom.rename(ce,Se);qi(Q.dom,rt,Xe),tt(Q,Dr(Se),rt)}else qi(Q.dom,ce,Xe),tt(Q,Dr(Se),ce)},Uh=(Q,ce,Se,Xe,rt)=>{const On=Ke(ce);if(On&&ce.nodeName===Xe&&!wf(rt)&&!vu(ce))$a(Q);else{Il(Q,Xe,rt);const Cn=yc(Q.selection.getRng()),Yo=On?[ce,...Se]:Se,os=On&&vu(ce)?Nc:Vh;Vs.each(Yo,ho=>{os(Q,ho,Xe,rt)}),Q.selection.setRng(vf(Cn))}},wf=Q=>"list-style-type"in Q,Bp=(Q,ce,Se,Xe)=>{if(ce!==Q.getBody())if(ce)if(ce.nodeName===Se&&!wf(Xe)&&!vu(ce))$a(Q);else{const rt=yc(Q.selection.getRng());vu(ce)&&ce.classList.forEach((Cn,Yo,os)=>{Cn.startsWith("tox-")&&(os.remove(Cn),os.length===0&&ce.removeAttribute("class"))}),qi(Q.dom,ce,Xe);const On=Q.dom.rename(ce,Se);Uu(Q.dom,On),Q.selection.setRng(vf(rt)),Il(Q,Se,Xe),tt(Q,Dr(Se),On)}else Il(Q,Se,Xe),tt(Q,Dr(Se),ce)},Bm=(Q,ce,Se)=>{const Xe=Tr(Q);if(Gc(Q,Xe))return;const rt=kr(Q),On=f(Se)?Se:{};rt.length>0?Uh(Q,Xe,rt,ce,On):Bp(Q,Xe,ce,On)},Vf=Ir.DOM,Wl=(Q,ce)=>{const Se=ce.parentElement;if(Se&&Se.nodeName==="LI"&&Se.firstChild===ce){const Xe=Se.previousSibling;Xe&&Xe.nodeName==="LI"?(Xe.appendChild(ce),ua(Q,Se)&&Vf.remove(Se)):Vf.setStyle(Se,"listStyleType","none")}if(Ke(Se)){const Xe=Se.previousSibling;Xe&&Xe.nodeName==="LI"&&Xe.appendChild(ce)}},Ig=(Q,ce)=>{const Se=Vs.grep(Q.select("ol,ul",ce));Vs.each(Se,Xe=>{Wl(Q,Xe)})},Ye=(Q,ce,Se,Xe)=>{let rt=ce.startContainer;const On=ce.startOffset;if(La(rt)&&(Se?On<rt.data.length:On>0))return rt;const Cn=Q.schema.getNonEmptyElements();mi(rt)&&(rt=va.getNode(rt,On));const Yo=new ln(rt,Xe);Se&&oa(Q.dom,rt)&&Yo.next();const os=Se?Yo.next.bind(Yo):Yo.prev2.bind(Yo);for(;rt=os();)if(rt.nodeName==="LI"&&!rt.hasChildNodes()||Cn[rt.nodeName]||La(rt)&&rt.data.length>0)return rt;return null},qd=(Q,ce)=>{const Se=ce.childNodes;return Se.length===1&&!Ke(Se[0])&&Q.isBlock(Se[0])},wu=(Q,ce)=>{qd(Q,ce)&&Q.remove(ce.firstChild,!0)},Bg=(Q,ce,Se)=>{let Xe;const rt=qd(Q,Se)?Se.firstChild:Se;if(wu(Q,ce),!ua(Q,ce,!0))for(;Xe=ce.firstChild;)rt.appendChild(Xe)},L1=(Q,ce,Se)=>{let Xe;const rt=ce.parentNode;if(!ur(Q,ce)||!ur(Q,Se))return;Ke(Se.lastChild)&&(Xe=Se.lastChild),rt===Se.lastChild&&Ko(rt.previousSibling)&&Q.remove(rt.previousSibling);const On=Se.lastChild;On&&Ko(On)&&ce.hasChildNodes()&&Q.remove(On),ua(Q,Se,!0)&&na(Wo.fromDom(Se)),Bg(Q,ce,Se),Xe&&Se.appendChild(Xe);const Yo=Tt(Wo.fromDom(Se),Wo.fromDom(ce))?Q.getParents(ce,Ke,Se):[];Q.remove(ce),_e(Yo,os=>{ua(Q,os)&&os!==Q.getRoot()&&Q.remove(os)})},Wh=(Q,ce,Se)=>{na(Wo.fromDom(Se)),L1(Q.dom,ce,Se),Q.selection.setCursorLocation(Se,0)},bt=(Q,ce,Se,Xe)=>{const rt=Q.dom;if(rt.isEmpty(Xe))Wh(Q,Se,Xe);else{const On=yc(ce);L1(rt,Se,Xe),Q.selection.setRng(vf(On))}},cn=(Q,ce,Se,Xe)=>{const rt=yc(ce);L1(Q.dom,Se,Xe);const On=vf(rt);Q.selection.setRng(On)},rn=(Q,ce)=>{const Se=Q.dom,Xe=Q.selection,rt=Xe.getStart(),On=bu(Q,rt),Cn=Se.getParent(Xe.getStart(),"LI",On);if(Cn){const Yo=Cn.parentElement;if(Yo===Q.getBody()&&ua(Se,Yo))return!0;const os=qc(Xe.getRng()),ho=Se.getParent(Ye(Q,os,ce,On),"LI",On);if(ho&&ho!==Cn)return Q.undoManager.transact(()=>{ce?bt(Q,os,ho,Cn):Yr(Cn)?Ji(Q):cn(Q,os,Cn,ho)}),!0;if(!ho&&!ce&&os.startOffset===0&&os.endOffset===0)return Q.undoManager.transact(()=>{$a(Q)}),!0}return!1},To=(Q,ce,Se)=>{const Xe=Q.getParent(ce.parentNode,Q.isBlock,Se);Q.remove(ce),Xe&&Q.isEmpty(Xe)&&Q.remove(Xe)},er=(Q,ce)=>{const Se=Q.dom,Xe=Q.selection.getStart(),rt=bu(Q,Xe),On=Se.getParent(Xe,Se.isBlock,rt);if(On&&Se.isEmpty(On)){const Cn=qc(Q.selection.getRng()),Yo=Se.getParent(Ye(Q,Cn,ce,rt),"LI",rt);if(Yo){const os=ra=>we(["td","th","caption"],gn(ra)),ho=ra=>ra.dom===rt,Er=Ns(Wo.fromDom(Yo),os,ho),Zl=Ns(Wo.fromDom(Cn.startContainer),os,ho);return bn(Er,Zl,Xt)?(Q.undoManager.transact(()=>{const ra=Yo.parentNode;To(Se,On,rt),Uu(Se,ra),Q.selection.select(Yo,!0),Q.selection.collapse(ce)}),!0):!1}}return!1},Wr=(Q,ce)=>rn(Q,ce)||er(Q,ce),ai=Q=>{const ce=Q.selection.getStart(),Se=bu(Q,ce);return Q.dom.getParent(ce,"LI,DT,DD",Se)||sa(Q).length>0},pi=Q=>ai(Q)?(Q.undoManager.transact(()=>{Q.execCommand("Delete"),Ig(Q.dom,Q.getBody())}),!0):!1,Gd=(Q,ce)=>{const Se=Q.selection;return!Gc(Q,Se.getNode())&&(Se.isCollapsed()?Wr(Q,ce):pi(Q))},W0=Q=>{Q.on("ExecCommand",ce=>{const Se=ce.command.toLowerCase();(Se==="delete"||Se==="forwarddelete")&&ai(Q)&&Ig(Q.dom,Q.getBody())}),Q.on("keydown",ce=>{ce.keyCode===ps.BACKSPACE?Gd(Q,!1)&&ce.preventDefault():ce.keyCode===ps.DELETE&&Gd(Q,!0)&&ce.preventDefault()})},ya=Q=>({backspaceDelete:ce=>{Gd(Q,ce)}}),vd=(Q,ce)=>{const Se=Tr(Q);Se===null||Gc(Q,Se)||Q.undoManager.transact(()=>{f(ce.styles)&&Q.dom.setStyles(Se,ce.styles),f(ce.attrs)&&Qe(ce.attrs,(Xe,rt)=>Q.dom.setAttrib(Se,rt,Xe))})},Lg=Q=>{const ce=Et(Pt(Q).split("")),Se=Te(ce,(Xe,rt)=>{const On=Xe.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,rt)*On});return Je(Se,(Xe,rt)=>Xe+rt,0)},nl=Q=>{if(Q--,Q<0)return"";{const ce=Q%26,Se=Math.floor(Q/26),Xe=nl(Se),rt=String.fromCharCode("A".charCodeAt(0)+ce);return Xe+rt}},xa=Q=>/^[A-Z]+$/.test(Q),Wu=Q=>/^[a-z]+$/.test(Q),oi=Q=>/^[0-9]+$/.test(Q),_u=Q=>oi(Q)?2:xa(Q)?0:Wu(Q)?1:Ro(Q)?3:4,ic=Q=>{switch(_u(Q)){case 2:return F.some({listStyleType:F.none(),start:Q});case 0:return F.some({listStyleType:F.some("upper-alpha"),start:Lg(Q).toString()});case 1:return F.some({listStyleType:F.some("lower-alpha"),start:Lg(Q).toString()});case 3:return F.some({listStyleType:F.none(),start:""});case 4:return F.none()}},jh=Q=>{const ce=parseInt(Q.start,10);return kt(Q.listStyleType,"upper-alpha")?nl(ce):kt(Q.listStyleType,"lower-alpha")?nl(ce).toLowerCase():Q.start},F1=Q=>{const ce=Tr(Q);!It(ce)||Gc(Q,ce)||Q.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:jh({start:Q.dom.getAttrib(ce,"start","1"),listStyleType:F.from(Q.dom.getStyle(ce,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Se=>{const Xe=Se.getData();ic(Xe.start).each(rt=>{Q.execCommand("mceListUpdate",!1,{attrs:{start:rt.start==="1"?"":rt.start},styles:{"list-style-type":rt.listStyleType.getOr("")}})}),Se.close()}})},Kd=(Q,ce)=>()=>{const Se=Tr(Q);return _(Se)&&Se.nodeName===ce},Fg=Q=>{Q.addCommand("mceListProps",()=>{F1(Q)})},Yd=Q=>{Q.on("BeforeExecCommand",ce=>{const Se=ce.command.toLowerCase();Se==="indent"?Xr(Q):Se==="outdent"&&Ji(Q)}),Q.addCommand("InsertUnorderedList",(ce,Se)=>{Bm(Q,"UL",Se)}),Q.addCommand("InsertOrderedList",(ce,Se)=>{Bm(Q,"OL",Se)}),Q.addCommand("InsertDefinitionList",(ce,Se)=>{Bm(Q,"DL",Se)}),Q.addCommand("RemoveList",()=>{$a(Q)}),Fg(Q),Q.addCommand("mceListUpdate",(ce,Se)=>{f(Se)&&vd(Q,Se)}),Q.addQueryStateHandler("InsertUnorderedList",Kd(Q,"UL")),Q.addQueryStateHandler("InsertOrderedList",Kd(Q,"OL")),Q.addQueryStateHandler("InsertDefinitionList",Kd(Q,"DL"))};var jl=tinymce.util.Tools.resolve("tinymce.html.Node");const Zh=Q=>Q.type===3,H1=Q=>Q.length===0,Lm=Q=>{const ce=(rt,On)=>{const Cn=jl.create("li");_e(rt,Yo=>Cn.append(Yo)),On?Q.insert(Cn,On,!0):Q.append(Cn)},Se=(rt,On)=>Zh(On)?[...rt,On]:!H1(rt)&&!Zh(On)?(ce(rt,On),[]):rt,Xe=Je(Q.children(),Se,[]);H1(Xe)||ce(Xe)},Hg=Q=>{Q.on("PreInit",()=>{const{parser:ce}=Q;ce.addNodeFilter("ul,ol",Se=>_e(Se,Lm))})},qh=Q=>{Q.on("keydown",ce=>{ce.keyCode!==ps.TAB||ps.metaKeyPressed(ce)||Q.undoManager.transact(()=>{(ce.shiftKey?Ji(Q):Xr(Q))&&ce.preventDefault()})})},Xd=Q=>{Ja(Q)&&qh(Q),W0(Q)},yd=(Q,ce)=>Se=>{const Xe=rt=>{Se.setActive(Ul(rt.parents,ce)),Se.setEnabled(!Gc(Q,rt.element)&&Q.selection.isEditable())};return Se.setEnabled(Q.selection.isEditable()),pd(Q,Xe)},si=Q=>{const ce=Se=>()=>Q.execCommand(Se);Q.hasPlugin("advlist")||(Q.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:ce("InsertOrderedList"),onSetup:yd(Q,"OL")}),Q.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:ce("InsertUnorderedList"),onSetup:yd(Q,"UL")}))},li=(Q,ce)=>Se=>pd(Q,rt=>Se.setEnabled(Ul(rt.parents,ce)&&!Gc(Q,rt.element))),Bl=Q=>{const ce={text:"List properties...",icon:"ordered-list",onAction:()=>Q.execCommand("mceListProps"),onSetup:li(Q,"OL")};Q.ui.registry.addMenuItem("listprops",ce),Q.ui.registry.addContextMenu("lists",{update:Se=>{const Xe=Tr(Q,Se);return It(Xe)?["listprops"]:[]}})};var Lp=()=>{r.add("lists",Q=>(gc(Q),Hg(Q),Q.hasPlugin("rtc",!0)?Fg(Q):(Xd(Q),Yd(Q)),si(Q),Bl(Q),ya(Q)))};Lp()})();(function(){const r=F=>{let oe=F;return{get:()=>oe,set:X=>{oe=X}}};var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=F=>()=>F;var s=tinymce.util.Tools.resolve("tinymce.Env");const a=F=>F.dispatch("ResizeEditor"),u=F=>oe=>oe.options.get(F),f=F=>{const oe=F.options.register;oe("autoresize_overflow_padding",{processor:"number",default:1}),oe("autoresize_bottom_margin",{processor:"number",default:50})},h=u("min_height"),g=u("max_height"),v=u("autoresize_overflow_padding"),_=u("autoresize_bottom_margin"),A=F=>F.plugins.fullscreen&&F.plugins.fullscreen.isFullscreen(),O=(F,oe)=>{const te=F.getBody();te&&(te.style.overflowY=oe?"":"hidden",oe||(te.scrollTop=0))},N=(F,oe,te,se)=>{var X;const we=parseInt((X=F.getStyle(oe,te,se))!==null&&X!==void 0?X:"",10);return isNaN(we)?0:we},L=F=>{if((F==null?void 0:F.type.toLowerCase())==="setcontent"){const oe=F;return oe.selection===!0||oe.paste===!0}else return!1},j=(F,oe,te,se)=>{var X;const we=F.dom,ye=F.getDoc();if(!ye)return;if(A(F)){O(F,!0);return}const Te=ye.documentElement,_e=se?se():v(F),ge=(X=h(F))!==null&&X!==void 0?X:F.getElement().offsetHeight;let nt=ge;const Je=N(we,Te,"margin-top",!0),ft=N(we,Te,"margin-bottom",!0);let V=Te.offsetHeight+Je+ft+_e;V<0&&(V=0);const ut=F.getContainer().offsetHeight,et=F.getContentAreaContainer().offsetHeight,Et=ut-et;V+Et>ge&&(nt=V+Et);const xt=g(F);if(xt&&nt>xt?(nt=xt,O(F,!0)):O(F,!1),nt!==oe.get()){const He=nt-oe.get();if(we.setStyle(F.getContainer(),"height",nt+"px"),oe.set(nt),a(F),s.browser.isSafari()&&(s.os.isMacOS()||s.os.isiOS())){const ct=F.getWin();ct.scrollTo(ct.pageXOffset,ct.pageYOffset)}F.hasFocus()&&L(te)&&F.selection.scrollIntoView(),(s.browser.isSafari()||s.browser.isChromium())&&He<0&&j(F,oe,te,se)}},z=(F,oe)=>{let te=()=>_(F),se,X;F.on("init",we=>{se=0;const ye=v(F),Te=F.dom;Te.setStyles(F.getDoc().documentElement,{height:"auto"}),s.browser.isEdge()||s.browser.isIE()?Te.setStyles(F.getBody(),{paddingLeft:ye,paddingRight:ye,"min-height":0}):Te.setStyles(F.getBody(),{paddingLeft:ye,paddingRight:ye}),j(F,oe,we,te),se+=1}),F.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",we=>{if(se===1)X=F.getContainer().offsetHeight,j(F,oe,we,te),se+=1;else if(se===2){const ye=X<F.getContainer().offsetHeight;if(ye){const Te=F.dom,_e=F.getDoc();Te.setStyles(_e.documentElement,{"min-height":0}),Te.setStyles(F.getBody(),{"min-height":"inherit"})}te=ye?t(0):te,se+=1}else j(F,oe,we,te)})},q=(F,oe)=>{F.addCommand("mceAutoResize",()=>{j(F,oe)})};var ee=()=>{e.add("autoresize",F=>{if(f(F),F.options.isSet("resize")||F.options.set("resize",!1),!F.inline){const oe=r(0);q(F,oe),z(F,oe)}})};ee()})();(function(){var r=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(St=>Xt=>St===Xt)(null),s=St=>St,a=(St,Xt)=>{const Tt=St.length,Be=new Array(Tt);for(let Ut=0;Ut<Tt;Ut++){const gn=St[Ut];Be[Ut]=Xt(gn,Ut)}return Be},f={aletter:"[A-Za-z\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-\u05F3\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\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\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\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\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1A00-\u1A16\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BC0-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\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\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790\uA791\uA7A0-\uA7A9\uA7FA-\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\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\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\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]",midnumlet:"[-'\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]",midletter:"[:\xB7\xB7\u05F4\u2027\uFE13\uFE55\uFF1A]",midnum:"[\xB1+*/,;;\u0589\u060C\u060D\u066C\u07F8\u2044\uFE10\uFE14\uFE50\uFE54\uFF0C\uFF1B]",numeric:"[0-9\u0660-\u0669\u066B\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9]",cr:"\\r",lf:"\\n",newline:"[\v\f\x85\u2028\u2029]",extend:"[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B6-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAA\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2\u1DC0-\u1DE6\u1DFC-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA67C\uA67D\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26\uFF9E\uFF9F]",format:"[\xAD\u0600-\u0603\u06DD\u070F\u17B4\u17B5\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB]",katakana:"[\u3031-\u3035\u309B\u309C\u30A0-\u30FA\u30FC-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF9D]",extendnumlet:"[=_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F\u2200-\u22FF<>]",punctuation:"[~\u2116|!-*+-\\/:;?@\\[-`{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]"},h={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},g=[new RegExp(f.aletter),new RegExp(f.midnumlet),new RegExp(f.midletter),new RegExp(f.midnum),new RegExp(f.numeric),new RegExp(f.cr),new RegExp(f.lf),new RegExp(f.newline),new RegExp(f.extend),new RegExp(f.format),new RegExp(f.katakana),new RegExp(f.extendnumlet),new RegExp("@")],v="",_=new RegExp("^"+f.punctuation+"$"),A=/^\s+$/,O=g,N=h.OTHER,L=St=>{let Xt=N;const Tt=O.length;for(let Be=0;Be<Tt;++Be){const Ut=O[Be];if(Ut&&Ut.test(St)){Xt=Be;break}}return Xt},j=St=>{const Xt={};return Tt=>{if(Xt[Tt])return Xt[Tt];{const Be=St(Tt);return Xt[Tt]=Be,Be}}},z=St=>{const Xt=j(L);return a(St,Xt)},q=(St,Xt)=>{const Tt=St[Xt],Be=St[Xt+1];if(Xt<0||Xt>St.length-1&&Xt!==0||Tt===h.ALETTER&&Be===h.ALETTER)return!1;const Ut=St[Xt+2];if(Tt===h.ALETTER&&(Be===h.MIDLETTER||Be===h.MIDNUMLET||Be===h.AT)&&Ut===h.ALETTER)return!1;const gn=St[Xt-1];return(Tt===h.MIDLETTER||Tt===h.MIDNUMLET||Be===h.AT)&&Be===h.ALETTER&&gn===h.ALETTER||(Tt===h.NUMERIC||Tt===h.ALETTER)&&(Be===h.NUMERIC||Be===h.ALETTER)||(Tt===h.MIDNUM||Tt===h.MIDNUMLET)&&Be===h.NUMERIC&&gn===h.NUMERIC||Tt===h.NUMERIC&&(Be===h.MIDNUM||Be===h.MIDNUMLET)&&Ut===h.NUMERIC||(Tt===h.EXTEND||Tt===h.FORMAT)&&(Be===h.ALETTER||Be===h.NUMERIC||Be===h.KATAKANA||Be===h.EXTEND||Be===h.FORMAT)||(Be===h.EXTEND||Be===h.FORMAT&&(Ut===h.ALETTER||Ut===h.NUMERIC||Ut===h.KATAKANA||Ut===h.EXTEND||Ut===h.FORMAT))&&(Tt===h.ALETTER||Tt===h.NUMERIC||Tt===h.KATAKANA||Tt===h.EXTEND||Tt===h.FORMAT)||Tt===h.CR&&Be===h.LF?!1:Tt===h.NEWLINE||Tt===h.CR||Tt===h.LF||Be===h.NEWLINE||Be===h.CR||Be===h.LF?!0:!(Tt===h.KATAKANA&&Be===h.KATAKANA||Be===h.EXTENDNUMLET&&(Tt===h.ALETTER||Tt===h.NUMERIC||Tt===h.KATAKANA||Tt===h.EXTENDNUMLET)||Tt===h.EXTENDNUMLET&&(Be===h.ALETTER||Be===h.NUMERIC||Be===h.KATAKANA)||Tt===h.AT)},ee=v,F=A,oe=_,te=St=>St==="http"||St==="https",se=(St,Xt)=>{let Tt;for(Tt=Xt;Tt<St.length&&!F.test(St[Tt]);Tt++);return Tt},X=(St,Xt)=>{const Tt=se(St,Xt+1);return St.slice(Xt+1,Tt).join(ee).substr(0,3)==="://"?Tt:Xt},we=(St,Xt,Tt,Be)=>{const Ut=[],gn=[];let wt=[];for(let Yt=0;Yt<Tt.length;++Yt)if(wt.push(St[Yt]),q(Tt,Yt)){const vn=Xt[Yt];if((Be.includeWhitespace||!F.test(vn))&&(Be.includePunctuation||!oe.test(vn))){const rs=Yt-wt.length+1,eo=Yt+1,ds=Xt.slice(rs,eo).join(ee);if(te(ds)){const Or=X(Xt,Yt),Rs=St.slice(eo,Or);Array.prototype.push.apply(wt,Rs),Yt=Or}Ut.push(wt),gn.push({start:rs,end:eo})}wt=[]}return{words:Ut,indices:gn}},ye=()=>({includeWhitespace:!1,includePunctuation:!1}),Te=(St,Xt,Tt)=>{Tt={...ye(),...Tt};const Be=a(St,Xt),Ut=z(Be);return we(St,Be,Ut,Tt)},ge=(St,Xt,Tt)=>Te(St,Xt,Tt).words,nt=St=>St.replace(/\uFEFF/g,"");var Je=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const ft=(St,Xt)=>{const Tt=Xt.getBlockElements(),Be=Xt.getVoidElements(),Ut=rs=>Tt[rs.nodeName]||Be[rs.nodeName],gn=[];let wt="";const Yt=new Je(St,St);let vn;for(;vn=Yt.next();)vn.nodeType===3?wt+=nt(vn.data):Ut(vn)&&wt.length&&(gn.push(wt),wt="");return wt.length&&gn.push(wt),gn},V=St=>St.replace(/\u200B/g,""),ut=St=>St.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,et=(St,Xt)=>{const Tt=V(ft(St,Xt).join(`
|
|
`));return ge(Tt.split(""),s).length},Et=(St,Xt)=>{const Tt=ft(St,Xt).join("");return ut(Tt)},xt=(St,Xt)=>{const Tt=ft(St,Xt).join("").replace(/\s/g,"");return ut(Tt)},He=(St,Xt)=>()=>Xt(St.getBody(),St.schema),ct=(St,Xt)=>()=>Xt(St.selection.getRng().cloneContents(),St.schema),an=St=>He(St,et),kt=St=>({body:{getWordCount:an(St),getCharacterCount:He(St,Et),getCharacterCountWithoutSpaces:He(St,xt)},selection:{getWordCount:ct(St,et),getCharacterCount:ct(St,Et),getCharacterCountWithoutSpaces:ct(St,xt)},getCount:an(St)}),bn=(St,Xt)=>{St.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(Xt.body.getWordCount()),String(Xt.selection.getWordCount())],["Characters (no spaces)",String(Xt.body.getCharacterCountWithoutSpaces()),String(Xt.selection.getCharacterCountWithoutSpaces())],["Characters",String(Xt.body.getCharacterCount()),String(Xt.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},qe=(St,Xt)=>{St.addCommand("mceWordCount",()=>bn(St,Xt))},gt=(St,Xt)=>{let Tt=null;return{cancel:()=>{t(Tt)||(clearTimeout(Tt),Tt=null)},throttle:(...gn)=>{t(Tt)&&(Tt=setTimeout(()=>{Tt=null,St.apply(null,gn)},Xt))}}};var de=tinymce.util.Tools.resolve("tinymce.util.Delay");const No=(St,Xt)=>{St.dispatch("wordCountUpdate",{wordCount:{words:Xt.body.getWordCount(),characters:Xt.body.getCharacterCount(),charactersWithoutSpaces:Xt.body.getCharacterCountWithoutSpaces()}})},Zn=(St,Xt)=>{No(St,Xt)},Bn=(St,Xt,Tt)=>{const Be=gt(()=>Zn(St,Xt),Tt);St.on("init",()=>{Zn(St,Xt),de.setEditorTimeout(St,()=>{St.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Be.throttle)},0),St.on("remove",Be.cancel)})},ao=St=>{const Xt=()=>St.execCommand("mceWordCount");St.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:Xt}),St.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:Xt})};var Wo=(St=300)=>{r.add("wordcount",Xt=>{const Tt=kt(Xt);return qe(Xt,Tt),ao(Xt),Bn(Xt,Tt,St),Tt})};Wo()})();function _Ce(r){let e,t;return{c(){e=ae("div"),t=ae("div"),U(t,"class","form-control"),U(e,"class","tox-wrapper")},m(s,a){Ie(s,e,a),Y(e,t),t.innerHTML=r[0],r[4](t),r[5](e)},p(s,[a]){a&1&&(t.innerHTML=s[0])},i:_n,o:_n,d(s){s&&Pe(e),r[4](null),r[5](null)}}}const CCe="bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";function SCe(r,e,t){let{value:s=""}=e,{additionalConfig:a={}}=e,u="",f,h,g;const v=["autoresize","code","image","table","codesample","link","lists","media","wordcount"];The(()=>{h&&h.destroy()}),H0(()=>{const O={target:f,toolbar_mode:"sliding",toolbar_sticky:!0,skin:!1,content_css:!1,content_style:wCe.toString(),branding:!1,inline:!1,plugins:v,contextmenu:!1,menubar:!1,statusbar:!1,entity_encoding:"raw",convert_urls:!1,toolbar:CCe,image_caption:!0,relative_urls:!1,browser_spellcheck:!0,max_height:600,content_style:"img {max-width: 100%;height: auto;",setup(N){h=N,N.on("init",function(L){N.setContent(s!=null?s:"")}),N.on("change input undo redo",function(L){u=N.getContent(),u!==s&&t(0,s=u)})}};yCe.init({...O,...a})});function _(O){ts[O?"unshift":"push"](()=>{f=O,t(1,f)})}function A(O){ts[O?"unshift":"push"](()=>{g=O,t(2,g)})}return r.$$set=O=>{"value"in O&&t(0,s=O.value),"additionalConfig"in O&&t(3,a=O.additionalConfig)},[s,f,g,a,_,A]}class hme extends xo{constructor(e){super(),Ao(this,e,SCe,_Ce,Eo,{value:0,additionalConfig:3})}}function kCe(r){let e,t,s,a;function u(h){r[2](h)}let f={additionalConfig:r[1]};return r[0].value!==void 0&&(f.value=r[0].value),t=new hme({props:f}),ts.push(()=>gr(t,"value",u)),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","mb-0")},m(h,g){Ie(h,e,g),nn(t,e,null),a=!0},p(h,[g]){const v={};!s&&g&1&&(s=!0,v.value=h[0].value,Cr(()=>s=!1)),t.$set(v)},i(h){a||(Oe(t.$$.fragment,h),a=!0)},o(h){$e(t.$$.fragment,h),a=!1},d(h){h&&Pe(e),on(t)}}}function ECe(r,e,t){let{block:s}=e,a={};function u(f){r.$$.not_equal(s.value,f)&&(s.value=f,t(0,s))}return r.$$set=f=>{"block"in f&&t(0,s=f.block)},[s,a,u]}class ACe extends xo{constructor(e){super(),Ao(this,e,ECe,kCe,Eo,{block:0})}}function Wle(r,e,t){const s=r.slice();return s[11]=e[t],s}function jle(r){let e,t;return e=new hI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[xCe]},$$scope:{ctx:r}}}),e.$on("update",r[3]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&16385&&(u.$$scope={dirty:a,ctx:s}),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Zle(r,e){let t,s,a,u;return s=new cI({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[2]),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),a=Ze(),U(t,"class","col mb-3"),this.first=t},m(f,h){Ie(f,t,h),nn(s,t,null),Y(t,a),u=!0},p(f,h){e=f;const g={};h&1&&(g.record=e[11]),s.$set(g)},i(f){u||(Oe(s.$$.fragment,f),u=!0)},o(f){$e(s.$$.fragment,f),u=!1},d(f){f&&Pe(t),on(s)}}}function xCe(r){let e=[],t=new Map,s,a,u=r[0];const f=h=>h[11].id;for(let h=0;h<u.length;h+=1){let g=Wle(r,u,h),v=f(g);t.set(v,e[h]=Zle(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){g&5&&(u=h[0],So(),e=$h(e,g,f,1,h,u,t,s.parentNode,gv,Zle,s,Wle),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function TCe(r){let e,t,s,a,u;t=new uI({props:{buttonClass:"mt-2",recordId:null,schemas:r[1]}}),t.$on("insert",r[4]),t.$on("save",r[4]);let f=r[0].length>0&&jle(r);return{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),f&&f.c(),a=Bs(),U(e,"class","inline-card-wrapper")},m(h,g){Ie(h,e,g),nn(t,e,null),Ie(h,s,g),f&&f.m(h,g),Ie(h,a,g),u=!0},p(h,[g]){h[0].length>0?f?(f.p(h,g),g&1&&Oe(f,1)):(f=jle(h),f.c(),Oe(f,1),f.m(a.parentNode,a)):f&&(So(),$e(f,1,1,()=>{f=null}),ko())},i(h){u||(Oe(t.$$.fragment,h),Oe(f),u=!0)},o(h){$e(t.$$.fragment,h),$e(f),u=!1},d(h){h&&Pe(e),on(t),h&&Pe(s),f&&f.d(h),h&&Pe(a)}}}function DCe(r,e,t){let s;const a=hi("channel");let{block:u}=e,{record:f}=e,{field:h}=e,{graph:g}=e,v=h.name+":"+u.id,_=a.schemas.filter(L=>u.meta.collections.includes(L.name));function A(L){var j;L.preventDefault(),t(5,g.edges=g.edges.filter(z=>!(z.target===L.detail&&z.field===v)),g),t(6,u.value=(j=g.edges.filter(z=>z.field===v))!=null?j:[],u)}function O(L){t(5,g.edges=yO(L.detail.source,L.detail.target,g.edges,v),g)}function N(L){L.preventDefault(),t(5,g=lI(g,f,L.detail.records,v,L.detail.action))}return r.$$set=L=>{"block"in L&&t(6,u=L.block),"record"in L&&t(7,f=L.record),"field"in L&&t(8,h=L.field),"graph"in L&&t(5,g=L.graph)},r.$$.update=()=>{var L;r.$$.dirty&160&&t(0,s=(L=g.edges.filter(j=>j.field===v).map(j=>g.records.find(z=>z.id===j.target&&f.id===j.source)).filter(j=>!!(j!=null&&j.id)))!=null?L:[])},[s,_,A,O,N,g,u,f,h]}class OCe extends xo{constructor(e){super(),Ao(this,e,DCe,TCe,Eo,{block:6,record:7,field:8,graph:5})}}function qle(r,e,t){const s=r.slice();return s[16]=e[t],s}function Gle(r,e,t){const s=r.slice();return s[19]=e[t],s}function MCe(r){let e,t,s,a,u=r[3],f=[];for(let h=0;h<u.length;h+=1)f[h]=Kle(Gle(r,u,h));return{c(){e=ae("div"),t=ae("button"),t.textContent="Browse",s=Ze(),a=ae("ul");for(let h=0;h<f.length;h+=1)f[h].c();U(t,"class","btn btn-outline-primary btn-sm"),U(t,"type","button"),U(t,"data-bs-toggle","dropdown"),U(t,"aria-expanded","false"),U(a,"class","dropdown-menu"),U(e,"class","dropdown d-inline-block")},m(h,g){Ie(h,e,g),Y(e,t),Y(e,s),Y(e,a);for(let v=0;v<f.length;v+=1)f[v]&&f[v].m(a,null)},p(h,g){if(g&40){u=h[3];let v;for(v=0;v<u.length;v+=1){const _=Gle(h,u,v);f[v]?f[v].p(_,g):(f[v]=Kle(_),f[v].c(),f[v].m(a,null))}for(;v<f.length;v+=1)f[v].d(1);f.length=u.length}},d(h){h&&Pe(e),Ba(f,h)}}}function RCe(r){let e,t,s;return{c(){e=ae("button"),e.textContent="Browse",U(e,"class","btn btn-outline-primary")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",r[11]),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function Kle(r){let e,t,s=r[19].label+"",a,u,f,h;function g(...v){return r[12](r[19],...v)}return{c(){e=ae("li"),t=ae("a"),a=Kt(s),u=Ze(),U(t,"class","dropdown-item"),U(t,"href","/")},m(v,_){Ie(v,e,_),Y(e,t),Y(t,a),Y(e,u),f||(h=En(t,"click",g),f=!0)},p(v,_){r=v},d(v){v&&Pe(e),f=!1,h()}}}function Yle(r){let e,t;return e=new hI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[NCe]},$$scope:{ctx:r}}}),e.$on("update",r[6]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&4194308&&(u.$$scope={dirty:a,ctx:s}),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function Xle(r,e){let t,s,a,u;return s=new cI({props:{classes:"h-100",record:e[16],hasDelete:!0}}),s.$on("remove",e[4]),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),a=Ze(),U(t,"class","col mb-3"),this.first=t},m(f,h){Ie(f,t,h),nn(s,t,null),Y(t,a),u=!0},p(f,h){e=f;const g={};h&4&&(g.record=e[16]),s.$set(g)},i(f){u||(Oe(s.$$.fragment,f),u=!0)},o(f){$e(s.$$.fragment,f),u=!1},d(f){f&&Pe(t),on(s)}}}function NCe(r){let e=[],t=new Map,s,a,u=r[2];const f=h=>h[16].id;for(let h=0;h<u.length;h+=1){let g=qle(r,u,h),v=f(g);t.set(v,e[h]=Xle(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){g&20&&(u=h[2],So(),e=$h(e,g,f,1,h,u,t,s.parentNode,gv,Xle,s,qle),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function PCe(r){let e,t,s,a,u;function f(A,O){return A[0].meta.collections.length===1?RCe:MCe}let h=f(r),g=h(r),v=r[2].length>0&&Yle(r),_={};return a=new Ooe({props:_}),r[13](a),a.$on("insert",r[7]),{c(){e=ae("div"),g.c(),t=Ze(),v&&v.c(),s=Ze(),sn(a.$$.fragment),U(e,"class","mb-0")},m(A,O){Ie(A,e,O),g.m(e,null),Ie(A,t,O),v&&v.m(A,O),Ie(A,s,O),nn(a,A,O),u=!0},p(A,[O]){h===(h=f(A))&&g?g.p(A,O):(g.d(1),g=h(A),g&&(g.c(),g.m(e,null))),A[2].length>0?v?(v.p(A,O),O&4&&Oe(v,1)):(v=Yle(A),v.c(),Oe(v,1),v.m(s.parentNode,s)):v&&(So(),$e(v,1,1,()=>{v=null}),ko());const N={};a.$set(N)},i(A){u||(Oe(v),Oe(a.$$.fragment,A),u=!0)},o(A){$e(v),$e(a.$$.fragment,A),u=!1},d(A){A&&Pe(e),g.d(),A&&Pe(t),v&&v.d(A),A&&Pe(s),r[13](null),on(a,A)}}}function ICe(r,e,t){let s;const a=hi("channel");let{block:u}=e,{record:f}=e,{field:h}=e,{graph:g}=e,v,_=h.name+":"+u.id,A=a.schemas.filter(F=>u.meta.collections.includes(F.name));function O(F){var oe;F.preventDefault(),t(8,g.edges=g.edges.filter(te=>!(te.target===F.detail&&te.field===_)),g),t(0,u.value=(oe=g.edges.filter(te=>te.field===_))!=null?oe:[],u)}function N(F,oe){F.preventDefault(),v.open(oe)}function L(F){t(8,g.edges=yO(F.detail.source,F.detail.target,g.edges,_),g)}function j(F){F.preventDefault(),v.close(),t(8,g=lI(g,f,F.detail.records,_,F.detail.action))}const z=F=>N(F,A[0].name),q=(F,oe)=>N(oe,F.name);function ee(F){ts[F?"unshift":"push"](()=>{v=F,t(1,v)})}return r.$$set=F=>{"block"in F&&t(0,u=F.block),"record"in F&&t(9,f=F.record),"field"in F&&t(10,h=F.field),"graph"in F&&t(8,g=F.graph)},r.$$.update=()=>{var F;r.$$.dirty&768&&t(2,s=(F=g.edges.filter(oe=>oe.field===_).map(oe=>g.records.find(te=>te.id===oe.target&&f.id===oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?F:[])},[u,v,s,A,O,N,L,j,g,f,h,z,q,ee]}class BCe extends xo{constructor(e){super(),Ao(this,e,ICe,PCe,Eo,{block:0,record:9,field:10,graph:8})}}function Jle(r,e,t){const s=r.slice();return s[18]=e[t],s}function Qle(r){let e,t=r[18].label+"",s,a,u,f;function h(...g){return r[9](r[18],...g)}return{c(){e=ae("button"),s=Kt(t),a=Ze(),U(e,"class","dropdown-item")},m(g,v){Ie(g,e,v),Y(e,s),Y(e,a),u||(f=En(e,"click",h),u=!0)},p(g,v){r=g},d(g){g&&Pe(e),u=!1,f()}}}function LCe(r){let e,t,s,a;function u(g){r[15](g)}function f(g){r[16](g)}let h={record:r[2],field:r[3]};return r[0]!==void 0&&(h.graph=r[0]),r[1]!==void 0&&(h.block=r[1]),e=new OCe({props:h}),ts.push(()=>gr(e,"graph",u)),ts.push(()=>gr(e,"block",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&4&&(_.record=g[2]),v&8&&(_.field=g[3]),!t&&v&1&&(t=!0,_.graph=g[0],Cr(()=>t=!1)),!s&&v&2&&(s=!0,_.block=g[1],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function FCe(r){let e,t,s,a;function u(g){r[13](g)}function f(g){r[14](g)}let h={record:r[2],field:r[3]};return r[0]!==void 0&&(h.graph=r[0]),r[1]!==void 0&&(h.block=r[1]),e=new BCe({props:h}),ts.push(()=>gr(e,"graph",u)),ts.push(()=>gr(e,"block",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&4&&(_.record=g[2]),v&8&&(_.field=g[3]),!t&&v&1&&(t=!0,_.graph=g[0],Cr(()=>t=!1)),!s&&v&2&&(s=!0,_.block=g[1],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function HCe(r){let e,t,s;function a(f){r[12](f)}let u={};return r[1]!==void 0&&(u.block=r[1]),e=new ACe({props:u}),ts.push(()=>gr(e,"block",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function $Ce(r){let e,t,s;function a(f){r[11](f)}let u={};return r[1]!==void 0&&(u.block=r[1]),e=new vCe({props:u}),ts.push(()=>gr(e,"block",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function zCe(r){let e,t,s;function a(f){r[10](f)}let u={};return r[1]!==void 0&&(u.block=r[1]),e=new gCe({props:u}),ts.push(()=>gr(e,"block",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function VCe(r){let e,t,s,a=r[1].meta.label+"",u,f,h,g=r[1].meta.info.name+"",v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye,Te,_e,ge,nt,Je,ft,V,ut,et,Et,xt,He;N=new fl({props:{icon:"ellipsis"}});let ct=r[4].fields,an=[];for(let gt=0;gt<ct.length;gt+=1)an[gt]=Qle(Jle(r,ct,gt));const kt=[zCe,$Ce,HCe,FCe,LCe],bn=[];function qe(gt,de){return gt[1].meta.info.name==="heading"?0:gt[1].meta.info.name==="textarea"?1:gt[1].meta.info.name==="rich"?2:gt[1].meta.info.name==="file"?3:gt[1].meta.info.name==="reference"?4:-1}return~(ut=qe(r))&&(et=bn[ut]=kt[ut](r)),{c(){e=ae("div"),t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),h=ae("i"),v=Kt(g),_=Ze(),A=ae("div"),O=ae("button"),sn(N.$$.fragment),L=Ze(),j=ae("div"),z=ae("h6"),q=Kt("Block id: "),ee=ae("input"),oe=Kt(`
|
|
Block name: `),te=ae("input"),X=Ze(),we=ae("li"),we.innerHTML='<hr class="dropdown-divider"/>',ye=Ze(),Te=ae("h6"),Te.textContent="Actions",_e=Ze(),ge=ae("button"),ge.textContent="Delete",nt=Ze(),Je=ae("h6"),Je.textContent="Insert after",ft=Ze();for(let gt=0;gt<an.length;gt+=1)an[gt].c();V=Ze(),et&&et.c(),U(s,"class","text-muted d-block fs-6 mb-1"),U(O,"class","btn btn-link btn-sm"),U(O,"type","button"),U(O,"data-bs-toggle","dropdown"),U(O,"aria-expanded","false"),U(ee,"class","form-control-plaintext"),ee.readOnly=!0,ee.value=F=r[1].id,U(te,"class","form-control-plaintext"),te.readOnly=!0,te.value=se=r[1].meta.name,U(z,"class","dropdown-header"),U(Te,"class","dropdown-header"),U(ge,"class","dropdown-item text-danger"),U(Je,"class","dropdown-header"),U(j,"class","dropdown-menu"),U(A,"class","dropdown d-inline-block"),U(t,"class","d-flex justify-content-between"),U(e,"class","card editor-field d-flex")},m(gt,de){Ie(gt,e,de),Y(e,t),Y(t,s),Y(s,u),Y(s,f),Y(s,h),Y(h,v),Y(t,_),Y(t,A),Y(A,O),nn(N,O,null),Y(A,L),Y(A,j),Y(j,z),Y(z,q),Y(z,ee),Y(z,oe),Y(z,te),Y(j,X),Y(j,we),Y(j,ye),Y(j,Te),Y(j,_e),Y(j,ge),Y(j,nt),Y(j,Je),Y(j,ft);for(let No=0;No<an.length;No+=1)an[No]&&an[No].m(j,null);Y(e,V),~ut&&bn[ut].m(e,null),Et=!0,xt||(He=En(ge,"click",r[8]),xt=!0)},p(gt,[de]){if((!Et||de&2)&&a!==(a=gt[1].meta.label+"")&&jn(u,a),(!Et||de&2)&&g!==(g=gt[1].meta.info.name+"")&&jn(v,g),(!Et||de&2&&F!==(F=gt[1].id)&&ee.value!==F)&&(ee.value=F),(!Et||de&2&&se!==(se=gt[1].meta.name)&&te.value!==se)&&(te.value=se),de&50){ct=gt[4].fields;let Zn;for(Zn=0;Zn<ct.length;Zn+=1){const Bn=Jle(gt,ct,Zn);an[Zn]?an[Zn].p(Bn,de):(an[Zn]=Qle(Bn),an[Zn].c(),an[Zn].m(j,null))}for(;Zn<an.length;Zn+=1)an[Zn].d(1);an.length=ct.length}let No=ut;ut=qe(gt),ut===No?~ut&&bn[ut].p(gt,de):(et&&(So(),$e(bn[No],1,1,()=>{bn[No]=null}),ko()),~ut?(et=bn[ut],et?et.p(gt,de):(et=bn[ut]=kt[ut](gt),et.c()),Oe(et,1),et.m(e,null)):et=null)},i(gt){Et||(Oe(N.$$.fragment,gt),Oe(et),Et=!0)},o(gt){$e(N.$$.fragment,gt),$e(et),Et=!1},d(gt){gt&&Pe(e),on(N),Ba(an,gt),~ut&&bn[ut].d(),xt=!1,He()}}}function UCe(r,e,t){const s=hi("channel");let{record:a}=e,{blockData:u}=e,{field:f}=e,{graph:h}=e,{block:g}=e,v=s.schemas.find(te=>te.name===f.schema);function _(te,se,X){te.preventDefault(),t(7,u=ume(u,se,X))}function A(te,se){te.preventDefault(),t(7,u=u.filter(X=>X.id!==se))}const O=te=>A(te,g.id),N=(te,se)=>_(se,te,g.id);function L(te){g=te,t(1,g)}function j(te){g=te,t(1,g)}function z(te){g=te,t(1,g)}function q(te){h=te,t(0,h)}function ee(te){g=te,t(1,g)}function F(te){h=te,t(0,h)}function oe(te){g=te,t(1,g)}return r.$$set=te=>{"record"in te&&t(2,a=te.record),"blockData"in te&&t(7,u=te.blockData),"field"in te&&t(3,f=te.field),"graph"in te&&t(0,h=te.graph),"block"in te&&t(1,g=te.block)},[h,g,a,f,v,_,A,u,O,N,L,j,z,q,ee,F,oe]}class WCe extends xo{constructor(e){super(),Ao(this,e,UCe,VCe,Eo,{record:2,blockData:7,field:3,graph:0,block:1})}}function ece(r,e,t){const s=r.slice();return s[10]=e[t],s[11]=e,s[12]=t,s}function tce(r,e){let t,s,a,u,f,h,g,v=_n,_;function A(j){e[6](j,e[10],e[11],e[12])}function O(j){e[7](j)}function N(j){e[8](j)}let L={record:e[2],field:e[3]};return e[10]!==void 0&&(L.block=e[10]),e[0]!==void 0&&(L.blockData=e[0]),e[1]!==void 0&&(L.graph=e[1]),s=new WCe({props:L}),ts.push(()=>gr(s,"block",A)),ts.push(()=>gr(s,"blockData",O)),ts.push(()=>gr(s,"graph",N)),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),h=Ze(),U(t,"class","block-field-wrapper"),this.first=t},m(j,z){Ie(j,t,z),nn(s,t,null),Y(t,h),_=!0},p(j,z){e=j;const q={};z&4&&(q.record=e[2]),z&8&&(q.field=e[3]),!a&&z&1&&(a=!0,q.block=e[10],Cr(()=>a=!1)),!u&&z&1&&(u=!0,q.blockData=e[0],Cr(()=>u=!1)),!f&&z&2&&(f=!0,q.graph=e[1],Cr(()=>f=!1)),s.$set(q)},r(){g=t.getBoundingClientRect()},f(){Ahe(t),v()},a(){v(),v=Ehe(t,g,cme,{delay:250,duration:250,easing:Rhe})},i(j){_||(Oe(s.$$.fragment,j),_=!0)},o(j){$e(s.$$.fragment,j),_=!1},d(j){j&&Pe(t),on(s)}}}function jCe(r){let e,t,s,a,u,f=[],h=new Map,g;function v(N){r[5](N)}let _={blockSchema:r[4]};r[0]!==void 0&&(_.blockData=r[0]),s=new dCe({props:_}),ts.push(()=>gr(s,"blockData",v));let A=r[0];const O=N=>N[10].id;for(let N=0;N<A.length;N+=1){let L=ece(r,A,N),j=O(L);h.set(j,f[N]=tce(j,L))}return{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),u=Ze();for(let N=0;N<f.length;N+=1)f[N].c();U(t,"class","inline-card-wrapper"),U(e,"class","bg-light lx-card")},m(N,L){Ie(N,e,L),Y(e,t),nn(s,t,null),Y(e,u);for(let j=0;j<f.length;j+=1)f[j]&&f[j].m(e,null);g=!0},p(N,[L]){const j={};if(!a&&L&1&&(a=!0,j.blockData=N[0],Cr(()=>a=!1)),s.$set(j),L&15){A=N[0],So();for(let z=0;z<f.length;z+=1)f[z].r();f=$h(f,L,O,1,N,A,h,e,Ohe,tce,null,ece);for(let z=0;z<f.length;z+=1)f[z].a();ko()}},i(N){if(!g){Oe(s.$$.fragment,N);for(let L=0;L<A.length;L+=1)Oe(f[L]);g=!0}},o(N){$e(s.$$.fragment,N);for(let L=0;L<f.length;L+=1)$e(f[L]);g=!1},d(N){N&&Pe(e),on(s);for(let L=0;L<f.length;L+=1)f[L].d()}}}function ZCe(r,e,t){const s=hi("channel");let{record:a}=e,{field:u}=e,{value:f=[]}=e,{graph:h}=e,g=s.schemas.find(N=>N.name===u.schema);function v(N){f=N,t(0,f)}function _(N,L,j,z){j[z]=N,t(0,f)}function A(N){f=N,t(0,f)}function O(N){h=N,t(1,h)}return r.$$set=N=>{"record"in N&&t(2,a=N.record),"field"in N&&t(3,u=N.field),"value"in N&&t(0,f=N.value),"graph"in N&&t(1,h=N.graph)},[f,h,a,u,g,v,_,A,O]}class qCe extends xo{constructor(e){super(),Ao(this,e,ZCe,jCe,Eo,{record:2,field:3,value:0,graph:1})}}function nce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[4]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&16&&jn(t,s[4])},d(s){s&&Pe(e)}}}function GCe(r){let e,t,s,a,u,f,h,g,v,_,A,O=r[4]&&nce(r);return{c(){e=ae("div"),t=ae("div"),s=ae("div"),a=ae("input"),f=Ze(),h=ae("input"),v=Ze(),O&&O.c(),U(a,"type","color"),U(a,"id",r[3]),U(a,"class","form-control form-control-color"),a.disabled=u=r[1].readonly&&!r[2],ss(s,"width","64px"),U(h,"type","text"),U(h,"id",r[3]),U(h,"class","form-control"),h.readOnly=g=r[1].readonly&&!r[2],vs(h,"is-invalid",r[4]),U(t,"class","input-group "),U(e,"class","mb-0")},m(N,L){Ie(N,e,L),Y(e,t),Y(t,s),Y(s,a),_r(a,r[0]),Y(t,f),Y(t,h),_r(h,r[0]),Y(e,v),O&&O.m(e,null),_||(A=[En(a,"input",r[6]),En(h,"input",r[7])],_=!0)},p(N,[L]){L&8&&U(a,"id",N[3]),L&6&&u!==(u=N[1].readonly&&!N[2])&&(a.disabled=u),L&1&&_r(a,N[0]),L&8&&U(h,"id",N[3]),L&6&&g!==(g=N[1].readonly&&!N[2])&&(h.readOnly=g),L&1&&h.value!==N[0]&&_r(h,N[0]),L&16&&vs(h,"is-invalid",N[4]),N[4]?O?O.p(N,L):(O=nce(N),O.c(),O.m(e,null)):O&&(O.d(1),O=null)},i:_n,o:_n,d(N){N&&Pe(e),O&&O.d(),_=!1,Bi(A)}}}function KCe(r,e,t){let s,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,{id:g}=e;function v(){u=this.value,t(0,u)}function _(){u=this.value,t(0,u)}return r.$$set=A=>{"field"in A&&t(1,a=A.field),"value"in A&&t(0,u=A.value),"isCreateMode"in A&&t(2,f=A.isCreateMode),"validationErrors"in A&&t(5,h=A.validationErrors),"id"in A&&t(3,g=A.id)},r.$$.update=()=>{r.$$.dirty&34&&t(4,s=Rg(h,a.name))},[u,a,f,g,s,h,v,_]}class YCe extends xo{constructor(e){super(),Ao(this,e,KCe,GCe,Eo,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function oce(r){let e,t,s,a,u,f,h,g,v,_,A;return v=Toe(r[7][0]),{c(){e=ae("div"),t=ae("input"),u=Ze(),f=ae("label"),h=Kt("Don't Know"),U(t,"class","form-check-input"),U(t,"id",s=r[1]+"-3"),U(t,"type","radio"),t.__value=null,t.value=t.__value,t.disabled=a=r[2].readonly&&!r[3],vs(t,"is-invalid",r[4]),U(f,"class","form-check-label"),U(f,"for",g=r[1]+"-3"),U(e,"class","form-check form-check-inline"),v.p(t)},m(O,N){Ie(O,e,N),Y(e,t),t.checked=t.__value===r[0],Y(e,u),Y(e,f),Y(f,h),_||(A=En(t,"change",r[9]),_=!0)},p(O,N){N&2&&s!==(s=O[1]+"-3")&&U(t,"id",s),N&12&&a!==(a=O[2].readonly&&!O[3])&&(t.disabled=a),N&1&&(t.checked=t.__value===O[0]),N&16&&vs(t,"is-invalid",O[4]),N&2&&g!==(g=O[1]+"-3")&&U(f,"for",g)},d(O){O&&Pe(e),v.r(),_=!1,A()}}}function sce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[4]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&16&&jn(t,s[4])},d(s){s&&Pe(e)}}}function XCe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye=r[2].nullable&&oce(r),Te=r[4]&&sce(r);return se=Toe(r[7][0]),{c(){e=ae("div"),t=ae("div"),s=ae("input"),f=Ze(),h=ae("label"),g=Kt("Yes"),_=Ze(),A=ae("div"),O=ae("input"),j=Ze(),z=ae("label"),q=Kt("No"),F=Ze(),ye&&ye.c(),oe=Ze(),Te&&Te.c(),te=Bs(),U(s,"class","form-check-input"),U(s,"type","radio"),U(s,"id",a=r[1]+"-1"),s.__value=!0,s.value=s.__value,s.disabled=u=r[2].readonly&&!r[3],vs(s,"is-invalid",r[4]),U(h,"class","form-check-label"),U(h,"for",v=r[1]+"-1"),U(t,"class","form-check form-check-inline"),U(O,"class","form-check-input"),U(O,"type","radio"),U(O,"id",N=r[1]+"-2"),O.__value=!1,O.value=O.__value,O.disabled=L=r[2].readonly&&!r[3],vs(O,"is-invalid",r[4]),U(z,"class","form-check-label"),U(z,"for",ee=r[1]+"-2"),U(A,"class","form-check form-check-inline"),se.p(s,O)},m(_e,ge){Ie(_e,e,ge),Y(e,t),Y(t,s),s.checked=s.__value===r[0],Y(t,f),Y(t,h),Y(h,g),Y(e,_),Y(e,A),Y(A,O),O.checked=O.__value===r[0],Y(A,j),Y(A,z),Y(z,q),Y(e,F),ye&&ye.m(e,null),Ie(_e,oe,ge),Te&&Te.m(_e,ge),Ie(_e,te,ge),X||(we=[En(s,"change",r[6]),En(O,"change",r[8])],X=!0)},p(_e,[ge]){ge&2&&a!==(a=_e[1]+"-1")&&U(s,"id",a),ge&12&&u!==(u=_e[2].readonly&&!_e[3])&&(s.disabled=u),ge&1&&(s.checked=s.__value===_e[0]),ge&16&&vs(s,"is-invalid",_e[4]),ge&2&&v!==(v=_e[1]+"-1")&&U(h,"for",v),ge&2&&N!==(N=_e[1]+"-2")&&U(O,"id",N),ge&12&&L!==(L=_e[2].readonly&&!_e[3])&&(O.disabled=L),ge&1&&(O.checked=O.__value===_e[0]),ge&16&&vs(O,"is-invalid",_e[4]),ge&2&&ee!==(ee=_e[1]+"-2")&&U(z,"for",ee),_e[2].nullable?ye?ye.p(_e,ge):(ye=oce(_e),ye.c(),ye.m(e,null)):ye&&(ye.d(1),ye=null),_e[4]?Te?Te.p(_e,ge):(Te=sce(_e),Te.c(),Te.m(te.parentNode,te)):Te&&(Te.d(1),Te=null)},i:_n,o:_n,d(_e){_e&&Pe(e),ye&&ye.d(),_e&&Pe(oe),Te&&Te.d(_e),_e&&Pe(te),se.r(),X=!1,Bi(we)}}}function JCe(r,e,t){let s,{id:a}=e,{field:u}=e,{value:f}=e,{isCreateMode:h}=e,{validationErrors:g}=e;const v=[[]];function _(){f=this.__value,t(0,f)}function A(){f=this.__value,t(0,f)}function O(){f=this.__value,t(0,f)}return r.$$set=N=>{"id"in N&&t(1,a=N.id),"field"in N&&t(2,u=N.field),"value"in N&&t(0,f=N.value),"isCreateMode"in N&&t(3,h=N.isCreateMode),"validationErrors"in N&&t(5,g=N.validationErrors)},r.$$.update=()=>{r.$$.dirty&36&&t(4,s=Rg(g,u.name))},[f,a,u,h,s,g,_,v,A,O]}class QCe extends xo{constructor(e){super(),Ao(this,e,JCe,XCe,Eo,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function eSe(r){let e,t,s,a;return{c(){e=ae("input"),U(e,"type","number"),U(e,"id",r[4]),U(e,"class","form-control"),U(e,"autocomplete","off"),e.readOnly=t=r[1].readonly&&!r[3],vs(e,"is-invalid",r[7])},m(u,f){Ie(u,e,f),_r(e,r[0]),s||(a=[En(e,"change",r[9]),En(e,"input",r[16])],s=!0)},p(u,f){f&16&&U(e,"id",u[4]),f&10&&t!==(t=u[1].readonly&&!u[3])&&(e.readOnly=t),f&1&&Yz(e.value)!==u[0]&&_r(e,u[0]),f&128&&vs(e,"is-invalid",u[7])},i:_n,o:_n,d(u){u&&Pe(e),s=!1,Bi(a)}}}function tSe(r){let e,t,s,a,u,f,h,g,v,_,A=r[1].optionsFrom&&rce(r),O=r[0]&&ice(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("ul"),A&&A.c(),f=Ze(),O&&O.c(),h=Bs(),U(t,"type","number"),U(t,"id",r[4]),U(t,"placeholder","Search for options"),U(t,"class","form-control dropdown-toggle"),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[3],vs(t,"is-invalid",r[7]),U(u,"class","dropdown-menu w-100"),U(e,"class","dropdown")},m(N,L){Ie(N,e,L),Y(e,t),_r(t,r[8]),Y(e,a),Y(e,u),A&&A.m(u,null),Ie(N,f,L),O&&O.m(N,L),Ie(N,h,L),g=!0,v||(_=[En(t,"keyup",function(){B0(r[5].update)&&r[5].update.apply(this,arguments)}),En(t,"focus",function(){B0(r[5].update)&&r[5].update.apply(this,arguments)}),En(t,"input",r[11])],v=!0)},p(N,L){r=N,(!g||L&16)&&U(t,"id",r[4]),(!g||L&10&&s!==(s=r[1].readonly&&!r[3]))&&(t.readOnly=s),L&256&&Yz(t.value)!==r[8]&&_r(t,r[8]),(!g||L&128)&&vs(t,"is-invalid",r[7]),r[1].optionsFrom?A?(A.p(r,L),L&2&&Oe(A,1)):(A=rce(r),A.c(),Oe(A,1),A.m(u,null)):A&&(So(),$e(A,1,1,()=>{A=null}),ko()),r[0]?O?O.p(r,L):(O=ice(r),O.c(),O.m(h.parentNode,h)):O&&(O.d(1),O=null)},i(N){g||(Oe(A),g=!0)},o(N){$e(A),g=!1},d(N){N&&Pe(e),A&&A.d(),N&&Pe(f),O&&O.d(N),N&&Pe(h),v=!1,Bi(_)}}}function rce(r){let e,t,s,a;function u(g){r[13](g)}function f(g){r[14](g)}let h={field:r[1],schemas:r[2]};return r[0]!==void 0&&(h.value=r[0]),r[8]!==void 0&&(h.search=r[8]),e=new ZV({props:h}),r[12](e),ts.push(()=>gr(e,"value",u)),ts.push(()=>gr(e,"search",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&2&&(_.field=g[1]),v&4&&(_.schemas=g[2]),!t&&v&1&&(t=!0,_.value=g[0],Cr(()=>t=!1)),!s&&v&256&&(s=!0,_.search=g[8],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){r[12](null),on(e,g)}}}function ice(r){let e,t,s,a,u,f,h;return{c(){e=ae("span"),t=ae("div"),s=Kt(r[0]),a=Ze(),u=ae("button"),U(u,"type","button"),U(u,"class","btn-close btn-sm ms-1"),ss(u,"font-size","10px"),U(u,"aria-label","Close"),U(t,"class","d-flex align-items-center "),U(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,v){Ie(g,e,v),Y(e,t),Y(t,s),Y(t,a),Y(t,u),f||(h=En(u,"click",Hu(r[15])),f=!0)},p(g,v){v&1&&jn(s,g[0])},d(g){g&&Pe(e),f=!1,h()}}}function ace(r){let e,t;return{c(){e=ae("div"),t=Kt(r[7]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&128&&jn(t,s[7])},d(s){s&&Pe(e)}}}function nSe(r){let e,t,s,a,u;const f=[tSe,eSe],h=[];function g(_,A){return _[6]?0:1}t=g(r),s=h[t]=f[t](r);let v=r[7]&&ace(r);return{c(){e=ae("div"),s.c(),a=Ze(),v&&v.c(),U(e,"class","mb-0")},m(_,A){Ie(_,e,A),h[t].m(e,null),Y(e,a),v&&v.m(e,null),u=!0},p(_,[A]){let O=t;t=g(_),t===O?h[t].p(_,A):(So(),$e(h[O],1,1,()=>{h[O]=null}),ko(),s=h[t],s?s.p(_,A):(s=h[t]=f[t](_),s.c()),Oe(s,1),s.m(e,a)),_[7]?v?v.p(_,A):(v=ace(_),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(_){u||(Oe(s),u=!0)},o(_){$e(s),u=!1},d(_){_&&Pe(e),h[t].d(),v&&v.d()}}}function oSe(r,e,t){let s,a,u,{field:f}=e,{value:h}=e,{schemas:g}=e,{validationErrors:v}=e,{isCreateMode:_}=e,{id:A}=e,O;function N(te){const se=te.currentTarget.value,X=L(se);t(0,h=isNaN(X)?null:X)}function L(te){return parseFloat(te).toFixed(f.decimals)}function j(){s=Yz(this.value),t(8,s)}function z(te){ts[te?"unshift":"push"](()=>{O=te,t(5,O)})}function q(te){h=te,t(0,h)}function ee(te){s=te,t(8,s)}const F=te=>t(0,h="");function oe(){h=Yz(this.value),t(0,h)}return r.$$set=te=>{"field"in te&&t(1,f=te.field),"value"in te&&t(0,h=te.value),"schemas"in te&&t(2,g=te.schemas),"validationErrors"in te&&t(10,v=te.validationErrors),"isCreateMode"in te&&t(3,_=te.isCreateMode),"id"in te&&t(4,A=te.id)},r.$$.update=()=>{r.$$.dirty&1026&&t(7,a=Rg(v,f.name)),r.$$.dirty&10&&t(6,u=f.optionsFrom&&!(f.readonly&&!_))},t(8,s=""),[h,f,g,_,A,O,u,a,s,N,v,j,z,q,ee,F,oe]}class sSe extends xo{constructor(e){super(),Ao(this,e,oSe,nSe,Eo,{field:1,value:0,schemas:2,validationErrors:10,isCreateMode:3,id:4})}}function lce(r){let e,t=r[1].help+"",s;return{c(){e=ae("small"),s=Kt(t),U(e,"class","text-primary opacity-50")},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&2&&t!==(t=a[1].help+"")&&jn(s,t)},d(a){a&&Pe(e)}}}function rSe(r){let e,t,s,a=r[1].label+"",u,f,h,g,v=r[1].name+"",_,A,O,N,L,j,z,q=r[1].help&&lce(r);return{c(){e=ae("div"),t=ae("div"),s=ae("label"),u=Kt(a),f=Ze(),h=ae("a"),g=ae("code"),_=Kt(v),O=Ze(),N=ae("input"),L=Ze(),q&&q.c(),U(s,"for",r[4]),U(s,"class","form-label"),U(g,"class","text-primary opacity-50"),U(h,"class","text-decoration-none"),U(h,"href",A=r[3]+"/schemas/"+r[2].name+"/fields/edit/"+r[1].name),U(t,"class","d-flex justify-content-between"),U(N,"type","url"),U(N,"id",r[4]),U(N,"class","form-control"),U(N,"placeholder","https://www.example.com"),U(e,"class","mb-0")},m(ee,F){Ie(ee,e,F),Y(e,t),Y(t,s),Y(s,u),Y(t,f),Y(t,h),Y(h,g),Y(g,_),Y(e,O),Y(e,N),_r(N,r[0]),Y(e,L),q&&q.m(e,null),j||(z=En(N,"input",r[5]),j=!0)},p(ee,[F]){F&2&&a!==(a=ee[1].label+"")&&jn(u,a),F&2&&v!==(v=ee[1].name+"")&&jn(_,v),F&6&&A!==(A=ee[3]+"/schemas/"+ee[2].name+"/fields/edit/"+ee[1].name)&&U(h,"href",A),F&1&&N.value!==ee[0]&&_r(N,ee[0]),ee[1].help?q?q.p(ee,F):(q=lce(ee),q.c(),q.m(e,null)):q&&(q.d(1),q=null)},i:_n,o:_n,d(ee){ee&&Pe(e),q&&q.d(),j=!1,z()}}}function iSe(r,e,t){const s=hi("channelurl");let{field:a}=e,{value:u}=e,{schema:f}=e,h=fd.exports.uniqueId();function g(){u=this.value,t(0,u)}return r.$$set=v=>{"field"in v&&t(1,a=v.field),"value"in v&&t(0,u=v.value),"schema"in v&&t(2,f=v.schema)},[u,a,f,s,h,g]}class aSe extends xo{constructor(e){super(),Ao(this,e,iSe,rSe,Eo,{field:1,value:0,schema:2})}}var wte=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],KD={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(r){return typeof console<"u"&&console.warn(r)},getWeek:function(r){var e=new Date(r.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},LP={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(r){var e=r%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ap=function(r,e){return e===void 0&&(e=2),("000"+r).slice(e*-1)},T0=function(r){return r===!0?1:0};function cce(r,e){var t;return function(){var s=this,a=arguments;clearTimeout(t),t=setTimeout(function(){return r.apply(s,a)},e)}}var _te=function(r){return r instanceof Array?r:[r]};function kg(r,e,t){if(t===!0)return r.classList.add(e);r.classList.remove(e)}function ll(r,e,t){var s=window.document.createElement(r);return e=e||"",t=t||"",s.className=e,t!==void 0&&(s.textContent=t),s}function q$(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function mme(r,e){if(e(r))return r;if(r.parentNode)return mme(r.parentNode,e)}function G$(r,e){var t=ll("div","numInputWrapper"),s=ll("input","numInput "+r),a=ll("span","arrowUp"),u=ll("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?s.type="number":(s.type="text",s.pattern="\\d*"),e!==void 0)for(var f in e)s.setAttribute(f,e[f]);return t.appendChild(s),t.appendChild(a),t.appendChild(u),t}function S1(r){try{if(typeof r.composedPath=="function"){var e=r.composedPath();return e[0]}return r.target}catch{return r.target}}var Cte=function(){},aV=function(r,e,t){return t.months[e?"shorthand":"longhand"][r]},lSe={D:Cte,F:function(r,e,t){r.setMonth(t.months.longhand.indexOf(e))},G:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},H:function(r,e){r.setHours(parseFloat(e))},J:function(r,e){r.setDate(parseFloat(e))},K:function(r,e,t){r.setHours(r.getHours()%12+12*T0(new RegExp(t.amPM[1],"i").test(e)))},M:function(r,e,t){r.setMonth(t.months.shorthand.indexOf(e))},S:function(r,e){r.setSeconds(parseFloat(e))},U:function(r,e){return new Date(parseFloat(e)*1e3)},W:function(r,e,t){var s=parseInt(e),a=new Date(r.getFullYear(),0,2+(s-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+t.firstDayOfWeek),a},Y:function(r,e){r.setFullYear(parseFloat(e))},Z:function(r,e){return new Date(e)},d:function(r,e){r.setDate(parseFloat(e))},h:function(r,e){r.setHours((r.getHours()>=12?12:0)+parseFloat(e))},i:function(r,e){r.setMinutes(parseFloat(e))},j:function(r,e){r.setDate(parseFloat(e))},l:Cte,m:function(r,e){r.setMonth(parseFloat(e)-1)},n:function(r,e){r.setMonth(parseFloat(e)-1)},s:function(r,e){r.setSeconds(parseFloat(e))},u:function(r,e){return new Date(parseFloat(e))},w:Cte,y:function(r,e){r.setFullYear(2e3+parseFloat(e))}},Lx={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},TP={Z:function(r){return r.toISOString()},D:function(r,e,t){return e.weekdays.shorthand[TP.w(r,e,t)]},F:function(r,e,t){return aV(TP.n(r,e,t)-1,!1,e)},G:function(r,e,t){return Ap(TP.h(r,e,t))},H:function(r){return Ap(r.getHours())},J:function(r,e){return e.ordinal!==void 0?r.getDate()+e.ordinal(r.getDate()):r.getDate()},K:function(r,e){return e.amPM[T0(r.getHours()>11)]},M:function(r,e){return aV(r.getMonth(),!0,e)},S:function(r){return Ap(r.getSeconds())},U:function(r){return r.getTime()/1e3},W:function(r,e,t){return t.getWeek(r)},Y:function(r){return Ap(r.getFullYear(),4)},d:function(r){return Ap(r.getDate())},h:function(r){return r.getHours()%12?r.getHours()%12:12},i:function(r){return Ap(r.getMinutes())},j:function(r){return r.getDate()},l:function(r,e){return e.weekdays.longhand[r.getDay()]},m:function(r){return Ap(r.getMonth()+1)},n:function(r){return r.getMonth()+1},s:function(r){return r.getSeconds()},u:function(r){return r.getTime()},w:function(r){return r.getDay()},y:function(r){return String(r.getFullYear()).substring(2)}},gme=function(r){var e=r.config,t=e===void 0?KD:e,s=r.l10n,a=s===void 0?LP:s,u=r.isMobile,f=u===void 0?!1:u;return function(h,g,v){var _=v||a;return t.formatDate!==void 0&&!f?t.formatDate(h,g,_):g.split("").map(function(A,O,N){return TP[A]&&N[O-1]!=="\\"?TP[A](h,_,t):A!=="\\"?A:""}).join("")}},Cne=function(r){var e=r.config,t=e===void 0?KD:e,s=r.l10n,a=s===void 0?LP:s;return function(u,f,h,g){if(!(u!==0&&!u)){var v=g||a,_,A=u;if(u instanceof Date)_=new Date(u.getTime());else if(typeof u!="string"&&u.toFixed!==void 0)_=new Date(u);else if(typeof u=="string"){var O=f||(t||KD).dateFormat,N=String(u).trim();if(N==="today")_=new Date,h=!0;else if(t&&t.parseDate)_=t.parseDate(u,O);else if(/Z$/.test(N)||/GMT$/.test(N))_=new Date(u);else{for(var L=void 0,j=[],z=0,q=0,ee="";z<O.length;z++){var F=O[z],oe=F==="\\",te=O[z-1]==="\\"||oe;if(Lx[F]&&!te){ee+=Lx[F];var se=new RegExp(ee).exec(u);se&&(L=!0)&&j[F!=="Y"?"push":"unshift"]({fn:lSe[F],val:se[++q]})}else oe||(ee+=".")}_=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),j.forEach(function(X){var we=X.fn,ye=X.val;return _=we(_,ye,v)||_}),_=L?_:void 0}}if(!(_ instanceof Date&&!isNaN(_.getTime()))){t.errorHandler(new Error("Invalid date provided: "+A));return}return h===!0&&_.setHours(0,0,0,0),_}}};function x1(r,e,t){return t===void 0&&(t=!0),t!==!1?new Date(r.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):r.getTime()-e.getTime()}var cSe=function(r,e,t){return r>Math.min(e,t)&&r<Math.max(e,t)},Ste=function(r,e,t){return r*3600+e*60+t},uSe=function(r){var e=Math.floor(r/3600),t=(r-e*3600)/60;return[e,t,r-e*3600-t*60]},fSe={DAY:864e5};function kte(r){var e=r.defaultHour,t=r.defaultMinute,s=r.defaultSeconds;if(r.minDate!==void 0){var a=r.minDate.getHours(),u=r.minDate.getMinutes(),f=r.minDate.getSeconds();e<a&&(e=a),e===a&&t<u&&(t=u),e===a&&t===u&&s<f&&(s=r.minDate.getSeconds())}if(r.maxDate!==void 0){var h=r.maxDate.getHours(),g=r.maxDate.getMinutes();e=Math.min(e,h),e===h&&(t=Math.min(g,t)),e===h&&t===g&&(s=r.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:s}}typeof Object.assign!="function"&&(Object.assign=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!r)throw TypeError("Cannot convert undefined or null to object");for(var s=function(h){h&&Object.keys(h).forEach(function(g){return r[g]=h[g]})},a=0,u=e;a<u.length;a++){var f=u[a];s(f)}return r});var Am=globalThis&&globalThis.__assign||function(){return Am=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},Am.apply(this,arguments)},uce=globalThis&&globalThis.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var s=Array(r),a=0,e=0;e<t;e++)for(var u=arguments[e],f=0,h=u.length;f<h;f++,a++)s[a]=u[f];return s},dSe=300;function hSe(r,e){var t={config:Am(Am({},KD),hf.defaultConfig),l10n:LP};t.parseDate=Cne({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=j,t._setHoursFromDate=O,t._positionCalendar=gn,t.changeMonth=He,t.changeYear=gt,t.clear=ct,t.close=an,t.onMouseOver=ao,t._createElement=ll,t.createDay=se,t.destroy=kt,t.isEnabled=de,t.jumpToDate=ee,t.updateValue=ln,t.open=St,t.redraw=vn,t.set=Or,t.setDate=Js,t.toggle=Po;function s(){t.utils={getDaysInMonth:function(ze,Qe){return ze===void 0&&(ze=t.currentMonth),Qe===void 0&&(Qe=t.currentYear),ze===1&&(Qe%4===0&&Qe%100!==0||Qe%400===0)?29:t.l10n.daysInMonth[ze]}}}function a(){t.element=t.input=r,t.isOpen=!1,Tt(),Ut(),ar(),ba(),s(),t.isMobile||te(),q(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&O(t.config.noCalendar?t.latestSelectedDateObj:void 0),ln(!1)),h();var ze=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&ze&&gn(),Mo("onReady")}function u(){var ze;return((ze=t.calendarContainer)===null||ze===void 0?void 0:ze.getRootNode()).activeElement||document.activeElement}function f(ze){return ze.bind(t)}function h(){var ze=t.config;ze.weekNumbers===!1&&ze.showMonths===1||ze.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var Qe=(t.days.offsetWidth+1)*ze.showMonths;t.daysContainer.style.width=Qe+"px",t.calendarContainer.style.width=Qe+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function g(ze){if(t.selectedDates.length===0){var Qe=t.config.minDate===void 0||x1(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),Dt=kte(t.config);Qe.setHours(Dt.hours,Dt.minutes,Dt.seconds,Qe.getMilliseconds()),t.selectedDates=[Qe],t.latestSelectedDateObj=Qe}ze!==void 0&&ze.type!=="blur"&&Li(ze);var Wt=t._input.value;A(),ln(),t._input.value!==Wt&&t._debouncedChange()}function v(ze,Qe){return ze%12+12*T0(Qe===t.l10n.amPM[1])}function _(ze){switch(ze%24){case 0:case 12:return 12;default:return ze%12}}function A(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var ze=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,Qe=(parseInt(t.minuteElement.value,10)||0)%60,Dt=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(ze=v(ze,t.amPM.textContent));var Wt=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&x1(t.latestSelectedDateObj,t.config.minDate,!0)===0,qn=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&x1(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var uo=Ste(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),po=Ste(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),un=Ste(ze,Qe,Dt);if(un>po&&un<uo){var ns=uSe(uo);ze=ns[0],Qe=ns[1],Dt=ns[2]}}else{if(qn){var _o=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;ze=Math.min(ze,_o.getHours()),ze===_o.getHours()&&(Qe=Math.min(Qe,_o.getMinutes())),Qe===_o.getMinutes()&&(Dt=Math.min(Dt,_o.getSeconds()))}if(Wt){var cs=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;ze=Math.max(ze,cs.getHours()),ze===cs.getHours()&&Qe<cs.getMinutes()&&(Qe=cs.getMinutes()),Qe===cs.getMinutes()&&(Dt=Math.max(Dt,cs.getSeconds()))}}N(ze,Qe,Dt)}}function O(ze){var Qe=ze||t.latestSelectedDateObj;Qe&&Qe instanceof Date&&N(Qe.getHours(),Qe.getMinutes(),Qe.getSeconds())}function N(ze,Qe,Dt){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(ze%24,Qe,Dt||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Ap(t.config.time_24hr?ze:(12+ze)%12+12*T0(ze%12===0)),t.minuteElement.value=Ap(Qe),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[T0(ze>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ap(Dt)))}function L(ze){var Qe=S1(ze),Dt=parseInt(Qe.value)+(ze.delta||0);(Dt/1e3>1||ze.key==="Enter"&&!/[^\d]/.test(Dt.toString()))&>(Dt)}function j(ze,Qe,Dt,Wt){if(Qe instanceof Array)return Qe.forEach(function(qn){return j(ze,qn,Dt,Wt)});if(ze instanceof Array)return ze.forEach(function(qn){return j(qn,Qe,Dt,Wt)});ze.addEventListener(Qe,Dt,Wt),t._handlers.push({remove:function(){return ze.removeEventListener(Qe,Dt,Wt)}})}function z(){Mo("onChange")}function q(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(Dt){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+Dt+"]"),function(Wt){return j(Wt,"click",t[Dt])})}),t.isMobile){Zr();return}var ze=cce(Wo,50);if(t._debouncedChange=cce(z,dSe),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&j(t.daysContainer,"mouseover",function(Dt){t.config.mode==="range"&&ao(S1(Dt))}),j(t._input,"keydown",Bn),t.calendarContainer!==void 0&&j(t.calendarContainer,"keydown",Bn),!t.config.inline&&!t.config.static&&j(window,"resize",ze),window.ontouchstart!==void 0?j(window.document,"touchstart",qe):j(window.document,"mousedown",qe),j(window.document,"focus",qe,{capture:!0}),t.config.clickOpens===!0&&(j(t._input,"focus",t.open),j(t._input,"click",t.open)),t.daysContainer!==void 0&&(j(t.monthNav,"click",ps),j(t.monthNav,["keyup","increment"],L),j(t.daysContainer,"click",eo)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Qe=function(Dt){return S1(Dt).select()};j(t.timeContainer,["increment"],g),j(t.timeContainer,"blur",g,{capture:!0}),j(t.timeContainer,"click",F),j([t.hourElement,t.minuteElement],["focus","click"],Qe),t.secondElement!==void 0&&j(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&j(t.amPM,"click",function(Dt){g(Dt)})}t.config.allowInput&&j(t._input,"blur",Zn)}function ee(ze,Qe){var Dt=ze!==void 0?t.parseDate(ze):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),Wt=t.currentYear,qn=t.currentMonth;try{Dt!==void 0&&(t.currentYear=Dt.getFullYear(),t.currentMonth=Dt.getMonth())}catch(uo){uo.message="Invalid date supplied: "+Dt,t.config.errorHandler(uo)}Qe&&t.currentYear!==Wt&&(Mo("onYearChange"),nt()),Qe&&(t.currentYear!==Wt||t.currentMonth!==qn)&&Mo("onMonthChange"),t.redraw()}function F(ze){var Qe=S1(ze);~Qe.className.indexOf("arrow")&&oe(ze,Qe.classList.contains("arrowUp")?1:-1)}function oe(ze,Qe,Dt){var Wt=ze&&S1(ze),qn=Dt||Wt&&Wt.parentNode&&Wt.parentNode.firstChild,uo=Mr("increment");uo.delta=Qe,qn&&qn.dispatchEvent(uo)}function te(){var ze=window.document.createDocumentFragment();if(t.calendarContainer=ll("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(ze.appendChild(V()),t.innerContainer=ll("div","flatpickr-innerContainer"),t.config.weekNumbers){var Qe=xt(),Dt=Qe.weekWrapper,Wt=Qe.weekNumbers;t.innerContainer.appendChild(Dt),t.weekNumbers=Wt,t.weekWrapper=Dt}t.rContainer=ll("div","flatpickr-rContainer"),t.rContainer.appendChild(et()),t.daysContainer||(t.daysContainer=ll("div","flatpickr-days"),t.daysContainer.tabIndex=-1),ge(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),ze.appendChild(t.innerContainer)}t.config.enableTime&&ze.appendChild(ut()),kg(t.calendarContainer,"rangeMode",t.config.mode==="range"),kg(t.calendarContainer,"animate",t.config.animate===!0),kg(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(ze);var qn=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!qn&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var uo=ll("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(uo,t.element),uo.appendChild(t.element),t.altInput&&uo.appendChild(t.altInput),uo.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function se(ze,Qe,Dt,Wt){var qn=de(Qe,!0),uo=ll("span",ze,Qe.getDate().toString());return uo.dateObj=Qe,uo.$i=Wt,uo.setAttribute("aria-label",t.formatDate(Qe,t.config.ariaDateFormat)),ze.indexOf("hidden")===-1&&x1(Qe,t.now)===0&&(t.todayDateElem=uo,uo.classList.add("today"),uo.setAttribute("aria-current","date")),qn?(uo.tabIndex=-1,Ls(Qe)&&(uo.classList.add("selected"),t.selectedDateElem=uo,t.config.mode==="range"&&(kg(uo,"startRange",t.selectedDates[0]&&x1(Qe,t.selectedDates[0],!0)===0),kg(uo,"endRange",t.selectedDates[1]&&x1(Qe,t.selectedDates[1],!0)===0),ze==="nextMonthDay"&&uo.classList.add("inRange")))):uo.classList.add("flatpickr-disabled"),t.config.mode==="range"&&na(Qe)&&!Ls(Qe)&&uo.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&ze!=="prevMonthDay"&&Wt%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(Qe)+"</span>"),Mo("onDayCreate",uo),uo}function X(ze){ze.focus(),t.config.mode==="range"&&ao(ze)}function we(ze){for(var Qe=ze>0?0:t.config.showMonths-1,Dt=ze>0?t.config.showMonths:-1,Wt=Qe;Wt!=Dt;Wt+=ze)for(var qn=t.daysContainer.children[Wt],uo=ze>0?0:qn.children.length-1,po=ze>0?qn.children.length:-1,un=uo;un!=po;un+=ze){var ns=qn.children[un];if(ns.className.indexOf("hidden")===-1&&de(ns.dateObj))return ns}}function ye(ze,Qe){for(var Dt=ze.className.indexOf("Month")===-1?ze.dateObj.getMonth():t.currentMonth,Wt=Qe>0?t.config.showMonths:-1,qn=Qe>0?1:-1,uo=Dt-t.currentMonth;uo!=Wt;uo+=qn)for(var po=t.daysContainer.children[uo],un=Dt-t.currentMonth===uo?ze.$i+Qe:Qe<0?po.children.length-1:0,ns=po.children.length,_o=un;_o>=0&&_o<ns&&_o!=(Qe>0?ns:-1);_o+=qn){var cs=po.children[_o];if(cs.className.indexOf("hidden")===-1&&de(cs.dateObj)&&Math.abs(ze.$i-_o)>=Math.abs(Qe))return X(cs)}t.changeMonth(qn),Te(we(qn),0)}function Te(ze,Qe){var Dt=u(),Wt=No(Dt||document.body),qn=ze!==void 0?ze:Wt?Dt:t.selectedDateElem!==void 0&&No(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&No(t.todayDateElem)?t.todayDateElem:we(Qe>0?1:-1);qn===void 0?t._input.focus():Wt?ye(qn,Qe):X(qn)}function _e(ze,Qe){for(var Dt=(new Date(ze,Qe,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Wt=t.utils.getDaysInMonth((Qe-1+12)%12,ze),qn=t.utils.getDaysInMonth(Qe,ze),uo=window.document.createDocumentFragment(),po=t.config.showMonths>1,un=po?"prevMonthDay hidden":"prevMonthDay",ns=po?"nextMonthDay hidden":"nextMonthDay",_o=Wt+1-Dt,cs=0;_o<=Wt;_o++,cs++)uo.appendChild(se("flatpickr-day "+un,new Date(ze,Qe-1,_o),_o,cs));for(_o=1;_o<=qn;_o++,cs++)uo.appendChild(se("flatpickr-day",new Date(ze,Qe,_o),_o,cs));for(var Sr=qn+1;Sr<=42-Dt&&(t.config.showMonths===1||cs%7!==0);Sr++,cs++)uo.appendChild(se("flatpickr-day "+ns,new Date(ze,Qe+1,Sr%qn),Sr,cs));var Ir=ll("div","dayContainer");return Ir.appendChild(uo),Ir}function ge(){if(t.daysContainer!==void 0){q$(t.daysContainer),t.weekNumbers&&q$(t.weekNumbers);for(var ze=document.createDocumentFragment(),Qe=0;Qe<t.config.showMonths;Qe++){var Dt=new Date(t.currentYear,t.currentMonth,1);Dt.setMonth(t.currentMonth+Qe),ze.appendChild(_e(Dt.getFullYear(),Dt.getMonth()))}t.daysContainer.appendChild(ze),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&ao()}}function nt(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var ze=function(Wt){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&Wt<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&Wt>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Qe=0;Qe<12;Qe++)if(!!ze(Qe)){var Dt=ll("option","flatpickr-monthDropdown-month");Dt.value=new Date(t.currentYear,Qe).getMonth().toString(),Dt.textContent=aV(Qe,t.config.shorthandCurrentMonth,t.l10n),Dt.tabIndex=-1,t.currentMonth===Qe&&(Dt.selected=!0),t.monthsDropdownContainer.appendChild(Dt)}}}function Je(){var ze=ll("div","flatpickr-month"),Qe=window.document.createDocumentFragment(),Dt;t.config.showMonths>1||t.config.monthSelectorType==="static"?Dt=ll("span","cur-month"):(t.monthsDropdownContainer=ll("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),j(t.monthsDropdownContainer,"change",function(po){var un=S1(po),ns=parseInt(un.value,10);t.changeMonth(ns-t.currentMonth),Mo("onMonthChange")}),nt(),Dt=t.monthsDropdownContainer);var Wt=G$("cur-year",{tabindex:"-1"}),qn=Wt.getElementsByTagName("input")[0];qn.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&qn.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(qn.setAttribute("max",t.config.maxDate.getFullYear().toString()),qn.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var uo=ll("div","flatpickr-current-month");return uo.appendChild(Dt),uo.appendChild(Wt),Qe.appendChild(uo),ze.appendChild(Qe),{container:ze,yearElement:qn,monthElement:Dt}}function ft(){q$(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var ze=t.config.showMonths;ze--;){var Qe=Je();t.yearElements.push(Qe.yearElement),t.monthElements.push(Qe.monthElement),t.monthNav.appendChild(Qe.container)}t.monthNav.appendChild(t.nextMonthNav)}function V(){return t.monthNav=ll("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ll("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ll("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,ft(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(ze){t.__hidePrevMonthArrow!==ze&&(kg(t.prevMonthNav,"flatpickr-disabled",ze),t.__hidePrevMonthArrow=ze)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(ze){t.__hideNextMonthArrow!==ze&&(kg(t.nextMonthNav,"flatpickr-disabled",ze),t.__hideNextMonthArrow=ze)}}),t.currentYearElement=t.yearElements[0],gs(),t.monthNav}function ut(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var ze=kte(t.config);t.timeContainer=ll("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var Qe=ll("span","flatpickr-time-separator",":"),Dt=G$("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=Dt.getElementsByTagName("input")[0];var Wt=G$("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Wt.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ap(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?ze.hours:_(ze.hours)),t.minuteElement.value=Ap(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():ze.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Dt),t.timeContainer.appendChild(Qe),t.timeContainer.appendChild(Wt),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var qn=G$("flatpickr-second");t.secondElement=qn.getElementsByTagName("input")[0],t.secondElement.value=Ap(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():ze.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ll("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(qn)}return t.config.time_24hr||(t.amPM=ll("span","flatpickr-am-pm",t.l10n.amPM[T0((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function et(){t.weekdayContainer?q$(t.weekdayContainer):t.weekdayContainer=ll("div","flatpickr-weekdays");for(var ze=t.config.showMonths;ze--;){var Qe=ll("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Qe)}return Et(),t.weekdayContainer}function Et(){if(!!t.weekdayContainer){var ze=t.l10n.firstDayOfWeek,Qe=uce(t.l10n.weekdays.shorthand);ze>0&&ze<Qe.length&&(Qe=uce(Qe.splice(ze,Qe.length),Qe.splice(0,ze)));for(var Dt=t.config.showMonths;Dt--;)t.weekdayContainer.children[Dt].innerHTML=`
|
|
<span class='flatpickr-weekday'>
|
|
`+Qe.join("</span><span class='flatpickr-weekday'>")+`
|
|
</span>
|
|
`}}function xt(){t.calendarContainer.classList.add("hasWeeks");var ze=ll("div","flatpickr-weekwrapper");ze.appendChild(ll("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Qe=ll("div","flatpickr-weeks");return ze.appendChild(Qe),{weekWrapper:ze,weekNumbers:Qe}}function He(ze,Qe){Qe===void 0&&(Qe=!0);var Dt=Qe?ze:ze-t.currentMonth;Dt<0&&t._hidePrevMonthArrow===!0||Dt>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Dt,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Mo("onYearChange"),nt()),ge(),Mo("onMonthChange"),gs())}function ct(ze,Qe){if(ze===void 0&&(ze=!0),Qe===void 0&&(Qe=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Qe===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Dt=kte(t.config),Wt=Dt.hours,qn=Dt.minutes,uo=Dt.seconds;N(Wt,qn,uo)}t.redraw(),ze&&Mo("onChange")}function an(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Mo("onClose")}function kt(){t.config!==void 0&&Mo("onDestroy");for(var ze=t._handlers.length;ze--;)t._handlers[ze].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Qe=t.calendarContainer.parentNode;if(Qe.lastChild&&Qe.removeChild(Qe.lastChild),Qe.parentNode){for(;Qe.firstChild;)Qe.parentNode.insertBefore(Qe.firstChild,Qe);Qe.parentNode.removeChild(Qe)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(Dt){try{delete t[Dt]}catch{}})}function bn(ze){return t.calendarContainer.contains(ze)}function qe(ze){if(t.isOpen&&!t.config.inline){var Qe=S1(ze),Dt=bn(Qe),Wt=Qe===t.input||Qe===t.altInput||t.element.contains(Qe)||ze.path&&ze.path.indexOf&&(~ze.path.indexOf(t.input)||~ze.path.indexOf(t.altInput)),qn=!Wt&&!Dt&&!bn(ze.relatedTarget),uo=!t.config.ignoredFocusElements.some(function(po){return po.contains(Qe)});qn&&uo&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&g(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function gt(ze){if(!(!ze||t.config.minDate&&ze<t.config.minDate.getFullYear()||t.config.maxDate&&ze>t.config.maxDate.getFullYear())){var Qe=ze,Dt=t.currentYear!==Qe;t.currentYear=Qe||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),Dt&&(t.redraw(),Mo("onYearChange"),nt())}}function de(ze,Qe){var Dt;Qe===void 0&&(Qe=!0);var Wt=t.parseDate(ze,void 0,Qe);if(t.config.minDate&&Wt&&x1(Wt,t.config.minDate,Qe!==void 0?Qe:!t.minDateHasTime)<0||t.config.maxDate&&Wt&&x1(Wt,t.config.maxDate,Qe!==void 0?Qe:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Wt===void 0)return!1;for(var qn=!!t.config.enable,uo=(Dt=t.config.enable)!==null&&Dt!==void 0?Dt:t.config.disable,po=0,un=void 0;po<uo.length;po++){if(un=uo[po],typeof un=="function"&&un(Wt))return qn;if(un instanceof Date&&Wt!==void 0&&un.getTime()===Wt.getTime())return qn;if(typeof un=="string"){var ns=t.parseDate(un,void 0,!0);return ns&&ns.getTime()===Wt.getTime()?qn:!qn}else if(typeof un=="object"&&Wt!==void 0&&un.from&&un.to&&Wt.getTime()>=un.from.getTime()&&Wt.getTime()<=un.to.getTime())return qn}return!qn}function No(ze){return t.daysContainer!==void 0?ze.className.indexOf("hidden")===-1&&ze.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(ze):!1}function Zn(ze){var Qe=ze.target===t._input,Dt=t._input.value.trimEnd()!==va();Qe&&Dt&&!(ze.relatedTarget&&bn(ze.relatedTarget))&&t.setDate(t._input.value,!0,ze.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Bn(ze){var Qe=S1(ze),Dt=t.config.wrap?r.contains(Qe):Qe===t._input,Wt=t.config.allowInput,qn=t.isOpen&&(!Wt||!Dt),uo=t.config.inline&&Dt&&!Wt;if(ze.keyCode===13&&Dt){if(Wt)return t.setDate(t._input.value,!0,Qe===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Qe.blur();t.open()}else if(bn(Qe)||qn||uo){var po=!!t.timeContainer&&t.timeContainer.contains(Qe);switch(ze.keyCode){case 13:po?(ze.preventDefault(),g(),rs()):eo(ze);break;case 27:ze.preventDefault(),rs();break;case 8:case 46:Dt&&!t.config.allowInput&&(ze.preventDefault(),t.clear());break;case 37:case 39:if(!po&&!Dt){ze.preventDefault();var un=u();if(t.daysContainer!==void 0&&(Wt===!1||un&&No(un))){var ns=ze.keyCode===39?1:-1;ze.ctrlKey?(ze.stopPropagation(),He(ns),Te(we(1),0)):Te(void 0,ns)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:ze.preventDefault();var _o=ze.keyCode===40?1:-1;t.daysContainer&&Qe.$i!==void 0||Qe===t.input||Qe===t.altInput?ze.ctrlKey?(ze.stopPropagation(),gt(t.currentYear-_o),Te(we(1),0)):po||Te(void 0,_o*7):Qe===t.currentYearElement?gt(t.currentYear-_o):t.config.enableTime&&(!po&&t.hourElement&&t.hourElement.focus(),g(ze),t._debouncedChange());break;case 9:if(po){var cs=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Vs){return Vs}),Sr=cs.indexOf(Qe);if(Sr!==-1){var Ir=cs[Sr+(ze.shiftKey?-1:1)];ze.preventDefault(),(Ir||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(Qe)&&ze.shiftKey&&(ze.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Qe===t.amPM)switch(ze.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],A(),ln();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],A(),ln();break}(Dt||bn(Qe))&&Mo("onKeyDown",ze)}function ao(ze,Qe){if(Qe===void 0&&(Qe="flatpickr-day"),!(t.selectedDates.length!==1||ze&&(!ze.classList.contains(Qe)||ze.classList.contains("flatpickr-disabled")))){for(var Dt=ze?ze.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Wt=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),qn=Math.min(Dt,t.selectedDates[0].getTime()),uo=Math.max(Dt,t.selectedDates[0].getTime()),po=!1,un=0,ns=0,_o=qn;_o<uo;_o+=fSe.DAY)de(new Date(_o),!0)||(po=po||_o>qn&&_o<uo,_o<Wt&&(!un||_o>un)?un=_o:_o>Wt&&(!ns||_o<ns)&&(ns=_o));var cs=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+Qe));cs.forEach(function(Sr){var Ir=Sr.dateObj,Vs=Ir.getTime(),Ur=un>0&&Vs<un||ns>0&&Vs>ns;if(Ur){Sr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Fi){Sr.classList.remove(Fi)});return}else if(po&&!Ur)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Fi){Sr.classList.remove(Fi)}),ze!==void 0&&(ze.classList.add(Dt<=t.selectedDates[0].getTime()?"startRange":"endRange"),Wt<Dt&&Vs===Wt?Sr.classList.add("startRange"):Wt>Dt&&Vs===Wt&&Sr.classList.add("endRange"),Vs>=un&&(ns===0||Vs<=ns)&&cSe(Vs,Wt,Dt)&&Sr.classList.add("inRange"))})}}function Wo(){t.isOpen&&!t.config.static&&!t.config.inline&&gn()}function St(ze,Qe){if(Qe===void 0&&(Qe=t._positionElement),t.isMobile===!0){if(ze){ze.preventDefault();var Dt=S1(ze);Dt&&Dt.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Mo("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Wt=t.isOpen;t.isOpen=!0,Wt||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Mo("onOpen"),gn(Qe)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(ze===void 0||!t.timeContainer.contains(ze.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Xt(ze){return function(Qe){var Dt=t.config["_"+ze+"Date"]=t.parseDate(Qe,t.config.dateFormat),Wt=t.config["_"+(ze==="min"?"max":"min")+"Date"];Dt!==void 0&&(t[ze==="min"?"minDateHasTime":"maxDateHasTime"]=Dt.getHours()>0||Dt.getMinutes()>0||Dt.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(qn){return de(qn)}),!t.selectedDates.length&&ze==="min"&&O(Dt),ln()),t.daysContainer&&(vn(),Dt!==void 0?t.currentYearElement[ze]=Dt.getFullYear().toString():t.currentYearElement.removeAttribute(ze),t.currentYearElement.disabled=!!Wt&&Dt!==void 0&&Wt.getFullYear()===Dt.getFullYear())}}function Tt(){var ze=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Qe=Am(Am({},JSON.parse(JSON.stringify(r.dataset||{}))),e),Dt={};t.config.parseDate=Qe.parseDate,t.config.formatDate=Qe.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(cs){t.config._enable=Zs(cs)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(cs){t.config._disable=Zs(cs)}});var Wt=Qe.mode==="time";if(!Qe.dateFormat&&(Qe.enableTime||Wt)){var qn=hf.defaultConfig.dateFormat||KD.dateFormat;Dt.dateFormat=Qe.noCalendar||Wt?"H:i"+(Qe.enableSeconds?":S":""):qn+" H:i"+(Qe.enableSeconds?":S":"")}if(Qe.altInput&&(Qe.enableTime||Wt)&&!Qe.altFormat){var uo=hf.defaultConfig.altFormat||KD.altFormat;Dt.altFormat=Qe.noCalendar||Wt?"h:i"+(Qe.enableSeconds?":S K":" K"):uo+(" h:i"+(Qe.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Xt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Xt("max")});var po=function(cs){return function(Sr){t.config[cs==="min"?"_minTime":"_maxTime"]=t.parseDate(Sr,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:po("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:po("max")}),Qe.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,Dt,Qe);for(var un=0;un<ze.length;un++)t.config[ze[un]]=t.config[ze[un]]===!0||t.config[ze[un]]==="true";wte.filter(function(cs){return t.config[cs]!==void 0}).forEach(function(cs){t.config[cs]=_te(t.config[cs]||[]).map(f)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var un=0;un<t.config.plugins.length;un++){var ns=t.config.plugins[un](t)||{};for(var _o in ns)wte.indexOf(_o)>-1?t.config[_o]=_te(ns[_o]).map(f).concat(t.config[_o]):typeof Qe[_o]>"u"&&(t.config[_o]=ns[_o])}Qe.altInputClass||(t.config.altInputClass=Be().className+" "+t.config.altInputClass),Mo("onParseConfig")}function Be(){return t.config.wrap?r.querySelector("[data-input]"):r}function Ut(){typeof t.config.locale!="object"&&typeof hf.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Am(Am({},hf.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?hf.l10ns[t.config.locale]:void 0),Lx.D="("+t.l10n.weekdays.shorthand.join("|")+")",Lx.l="("+t.l10n.weekdays.longhand.join("|")+")",Lx.M="("+t.l10n.months.shorthand.join("|")+")",Lx.F="("+t.l10n.months.longhand.join("|")+")",Lx.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var ze=Am(Am({},e),JSON.parse(JSON.stringify(r.dataset||{})));ze.time_24hr===void 0&&hf.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=gme(t),t.parseDate=Cne({config:t.config,l10n:t.l10n})}function gn(ze){if(typeof t.config.position=="function")return void t.config.position(t,ze);if(t.calendarContainer!==void 0){Mo("onPreCalendarPosition");var Qe=ze||t._positionElement,Dt=Array.prototype.reduce.call(t.calendarContainer.children,function(Ko,Yr){return Ko+Yr.offsetHeight},0),Wt=t.calendarContainer.offsetWidth,qn=t.config.position.split(" "),uo=qn[0],po=qn.length>1?qn[1]:null,un=Qe.getBoundingClientRect(),ns=window.innerHeight-un.bottom,_o=uo==="above"||uo!=="below"&&ns<Dt&&un.top>Dt,cs=window.pageYOffset+un.top+(_o?-Dt-2:Qe.offsetHeight+2);if(kg(t.calendarContainer,"arrowTop",!_o),kg(t.calendarContainer,"arrowBottom",_o),!t.config.inline){var Sr=window.pageXOffset+un.left,Ir=!1,Vs=!1;po==="center"?(Sr-=(Wt-un.width)/2,Ir=!0):po==="right"&&(Sr-=Wt-un.width,Vs=!0),kg(t.calendarContainer,"arrowLeft",!Ir&&!Vs),kg(t.calendarContainer,"arrowCenter",Ir),kg(t.calendarContainer,"arrowRight",Vs);var Ur=window.document.body.offsetWidth-(window.pageXOffset+un.right),Fi=Sr+Wt>window.document.body.offsetWidth,La=Ur+Wt>window.document.body.offsetWidth;if(kg(t.calendarContainer,"rightMost",Fi),!t.config.static)if(t.calendarContainer.style.top=cs+"px",!Fi)t.calendarContainer.style.left=Sr+"px",t.calendarContainer.style.right="auto";else if(!La)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ur+"px";else{var mi=wt();if(mi===void 0)return;var Ke=window.document.body.offsetWidth,Ge=Math.max(0,Ke/2-Wt/2),It=".flatpickr-calendar.centerMost:before",jt=".flatpickr-calendar.centerMost:after",fo=mi.cssRules.length,Lo="{left:"+un.left+"px;right:auto;}";kg(t.calendarContainer,"rightMost",!1),kg(t.calendarContainer,"centerMost",!0),mi.insertRule(It+","+jt+Lo,fo),t.calendarContainer.style.left=Ge+"px",t.calendarContainer.style.right="auto"}}}}function wt(){for(var ze=null,Qe=0;Qe<document.styleSheets.length;Qe++){var Dt=document.styleSheets[Qe];if(!!Dt.cssRules){try{Dt.cssRules}catch{continue}ze=Dt;break}}return ze!=null?ze:Yt()}function Yt(){var ze=document.createElement("style");return document.head.appendChild(ze),ze.sheet}function vn(){t.config.noCalendar||t.isMobile||(nt(),gs(),ge())}function rs(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function eo(ze){ze.preventDefault(),ze.stopPropagation();var Qe=function(cs){return cs.classList&&cs.classList.contains("flatpickr-day")&&!cs.classList.contains("flatpickr-disabled")&&!cs.classList.contains("notAllowed")},Dt=mme(S1(ze),Qe);if(Dt!==void 0){var Wt=Dt,qn=t.latestSelectedDateObj=new Date(Wt.dateObj.getTime()),uo=(qn.getMonth()<t.currentMonth||qn.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Wt,t.config.mode==="single")t.selectedDates=[qn];else if(t.config.mode==="multiple"){var po=Ls(qn);po?t.selectedDates.splice(parseInt(po),1):t.selectedDates.push(qn)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=qn,t.selectedDates.push(qn),x1(qn,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(cs,Sr){return cs.getTime()-Sr.getTime()}));if(A(),uo){var un=t.currentYear!==qn.getFullYear();t.currentYear=qn.getFullYear(),t.currentMonth=qn.getMonth(),un&&(Mo("onYearChange"),nt()),Mo("onMonthChange")}if(gs(),ge(),ln(),!uo&&t.config.mode!=="range"&&t.config.showMonths===1?X(Wt):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ns=t.config.mode==="single"&&!t.config.enableTime,_o=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ns||_o)&&rs()}z()}}var ds={locale:[Ut,Et],showMonths:[ft,h,et],minDate:[ee],maxDate:[ee],positionElement:[Ns],clickOpens:[function(){t.config.clickOpens===!0?(j(t._input,"focus",t.open),j(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Or(ze,Qe){if(ze!==null&&typeof ze=="object"){Object.assign(t.config,ze);for(var Dt in ze)ds[Dt]!==void 0&&ds[Dt].forEach(function(Wt){return Wt()})}else t.config[ze]=Qe,ds[ze]!==void 0?ds[ze].forEach(function(Wt){return Wt()}):wte.indexOf(ze)>-1&&(t.config[ze]=_te(Qe));t.redraw(),ln(!0)}function Rs(ze,Qe){var Dt=[];if(ze instanceof Array)Dt=ze.map(function(Wt){return t.parseDate(Wt,Qe)});else if(ze instanceof Date||typeof ze=="number")Dt=[t.parseDate(ze,Qe)];else if(typeof ze=="string")switch(t.config.mode){case"single":case"time":Dt=[t.parseDate(ze,Qe)];break;case"multiple":Dt=ze.split(t.config.conjunction).map(function(Wt){return t.parseDate(Wt,Qe)});break;case"range":Dt=ze.split(t.l10n.rangeSeparator).map(function(Wt){return t.parseDate(Wt,Qe)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(ze)));t.selectedDates=t.config.allowInvalidPreload?Dt:Dt.filter(function(Wt){return Wt instanceof Date&&de(Wt,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Wt,qn){return Wt.getTime()-qn.getTime()})}function Js(ze,Qe,Dt){if(Qe===void 0&&(Qe=!1),Dt===void 0&&(Dt=t.config.dateFormat),ze!==0&&!ze||ze instanceof Array&&ze.length===0)return t.clear(Qe);Rs(ze,Dt),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),ee(void 0,Qe),O(),t.selectedDates.length===0&&t.clear(!1),ln(Qe),Qe&&Mo("onChange")}function Zs(ze){return ze.slice().map(function(Qe){return typeof Qe=="string"||typeof Qe=="number"||Qe instanceof Date?t.parseDate(Qe,void 0,!0):Qe&&typeof Qe=="object"&&Qe.from&&Qe.to?{from:t.parseDate(Qe.from,void 0),to:t.parseDate(Qe.to,void 0)}:Qe}).filter(function(Qe){return Qe})}function ba(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var ze=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);ze&&Rs(ze,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function ar(){if(t.input=Be(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ll(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Ns()}function Ns(){t._positionElement=t.config.positionElement||t._input}function Zr(){var ze=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ll("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=ze,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=ze==="datetime-local"?"Y-m-d\\TH:i:S":ze==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}j(t.mobileInput,"change",function(Qe){t.setDate(S1(Qe).value,!1,t.mobileFormatStr),Mo("onChange"),Mo("onClose")})}function Po(ze){if(t.isOpen===!0)return t.close();t.open(ze)}function Mo(ze,Qe){if(t.config!==void 0){var Dt=t.config[ze];if(Dt!==void 0&&Dt.length>0)for(var Wt=0;Dt[Wt]&&Wt<Dt.length;Wt++)Dt[Wt](t.selectedDates,t.input.value,t,Qe);ze==="onChange"&&(t.input.dispatchEvent(Mr("change")),t.input.dispatchEvent(Mr("input")))}}function Mr(ze){var Qe=document.createEvent("Event");return Qe.initEvent(ze,!0,!0),Qe}function Ls(ze){for(var Qe=0;Qe<t.selectedDates.length;Qe++){var Dt=t.selectedDates[Qe];if(Dt instanceof Date&&x1(Dt,ze)===0)return""+Qe}return!1}function na(ze){return t.config.mode!=="range"||t.selectedDates.length<2?!1:x1(ze,t.selectedDates[0])>=0&&x1(ze,t.selectedDates[1])<=0}function gs(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(ze,Qe){var Dt=new Date(t.currentYear,t.currentMonth,1);Dt.setMonth(t.currentMonth+Qe),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Qe].textContent=aV(Dt.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=Dt.getMonth().toString(),ze.value=Dt.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function va(ze){var Qe=ze||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(Dt){return t.formatDate(Dt,Qe)}).filter(function(Dt,Wt,qn){return t.config.mode!=="range"||t.config.enableTime||qn.indexOf(Dt)===Wt}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function ln(ze){ze===void 0&&(ze=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=va(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=va(t.config.altFormat)),ze!==!1&&Mo("onValueUpdate")}function ps(ze){var Qe=S1(ze),Dt=t.prevMonthNav.contains(Qe),Wt=t.nextMonthNav.contains(Qe);Dt||Wt?He(Dt?-1:1):t.yearElements.indexOf(Qe)>=0?Qe.select():Qe.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Qe.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Li(ze){ze.preventDefault();var Qe=ze.type==="keydown",Dt=S1(ze),Wt=Dt;t.amPM!==void 0&&Dt===t.amPM&&(t.amPM.textContent=t.l10n.amPM[T0(t.amPM.textContent===t.l10n.amPM[0])]);var qn=parseFloat(Wt.getAttribute("min")),uo=parseFloat(Wt.getAttribute("max")),po=parseFloat(Wt.getAttribute("step")),un=parseInt(Wt.value,10),ns=ze.delta||(Qe?ze.which===38?1:-1:0),_o=un+po*ns;if(typeof Wt.value<"u"&&Wt.value.length===2){var cs=Wt===t.hourElement,Sr=Wt===t.minuteElement;_o<qn?(_o=uo+_o+T0(!cs)+(T0(cs)&&T0(!t.amPM)),Sr&&oe(void 0,-1,t.hourElement)):_o>uo&&(_o=Wt===t.hourElement?_o-uo-T0(!t.amPM):qn,Sr&&oe(void 0,1,t.hourElement)),t.amPM&&cs&&(po===1?_o+un===23:Math.abs(_o-un)>po)&&(t.amPM.textContent=t.l10n.amPM[T0(t.amPM.textContent===t.l10n.amPM[0])]),Wt.value=Ap(_o)}}return a(),t}function YD(r,e){for(var t=Array.prototype.slice.call(r).filter(function(f){return f instanceof HTMLElement}),s=[],a=0;a<t.length;a++){var u=t[a];try{if(u.getAttribute("data-fp-omit")!==null)continue;u._flatpickr!==void 0&&(u._flatpickr.destroy(),u._flatpickr=void 0),u._flatpickr=hSe(u,e||{}),s.push(u._flatpickr)}catch(f){console.error(f)}}return s.length===1?s[0]:s}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(r){return YD(this,r)},HTMLElement.prototype.flatpickr=function(r){return YD([this],r)});var hf=function(r,e){return typeof r=="string"?YD(window.document.querySelectorAll(r),e):r instanceof Node?YD([r],e):YD(r,e)};hf.defaultConfig={};hf.l10ns={en:Am({},LP),default:Am({},LP)};hf.localize=function(r){hf.l10ns.default=Am(Am({},hf.l10ns.default),r)};hf.setDefaults=function(r){hf.defaultConfig=Am(Am({},hf.defaultConfig),r)};hf.parseDate=Cne({});hf.formatDate=gme({});hf.compareDates=x1;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(r){return YD(this,r)});Date.prototype.fp_incr=function(r){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof r=="string"?parseInt(r,10):r))};typeof window<"u"&&(window.flatpickr=hf);function mSe(r){let e,t,s,a;return{c(){e=ae("input"),U(e,"type","text"),U(e,"id",r[2]),U(e,"class","form-control"),U(e,"autocomplete","off"),e.readOnly=t=r[1].readonly&&!r[3],vs(e,"is-invalid",r[8])},m(u,f){Ie(u,e,f),_r(e,r[0]),r[19](e),s||(a=En(e,"input",r[18]),s=!0)},p(u,f){f&4&&U(e,"id",u[2]),f&10&&t!==(t=u[1].readonly&&!u[3])&&(e.readOnly=t),f&1&&e.value!==u[0]&&_r(e,u[0]),f&256&&vs(e,"is-invalid",u[8])},i:_n,o:_n,d(u){u&&Pe(e),r[19](null),s=!1,a()}}}function gSe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N;f=new fl({props:{icon:"calendar"}});let L=r[1].optionsFrom&&fce(r),j=r[0]&&dce(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("button"),sn(f.$$.fragment),h=Ze(),g=ae("ul"),L&&L.c(),v=Ze(),j&&j.c(),_=Bs(),U(t,"type","search"),U(t,"id",r[2]),U(t,"class","form-control dropdown-toggle"),U(t,"placeholder","Search for options"),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[3],vs(t,"is-invalid",r[8]),U(u,"class","btn btn-light ms-1"),U(g,"class","dropdown-menu w-100"),U(e,"class","dropdown d-flex")},m(z,q){Ie(z,e,q),Y(e,t),_r(t,r[9]),r[12](t),Y(e,a),Y(e,u),nn(f,u,null),Y(e,h),Y(e,g),L&&L.m(g,null),Ie(z,v,q),j&&j.m(z,q),Ie(z,_,q),A=!0,O||(N=[En(t,"keyup",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"focus",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"input",r[11]),En(u,"click",Hu(r[13]))],O=!0)},p(z,q){r=z,(!A||q&4)&&U(t,"id",r[2]),(!A||q&10&&s!==(s=r[1].readonly&&!r[3]))&&(t.readOnly=s),q&512&&t.value!==r[9]&&_r(t,r[9]),(!A||q&256)&&vs(t,"is-invalid",r[8]),r[1].optionsFrom?L?(L.p(r,q),q&2&&Oe(L,1)):(L=fce(r),L.c(),Oe(L,1),L.m(g,null)):L&&(So(),$e(L,1,1,()=>{L=null}),ko()),r[0]?j?j.p(r,q):(j=dce(r),j.c(),j.m(_.parentNode,_)):j&&(j.d(1),j=null)},i(z){A||(Oe(f.$$.fragment,z),Oe(L),A=!0)},o(z){$e(f.$$.fragment,z),$e(L),A=!1},d(z){z&&Pe(e),r[12](null),on(f),L&&L.d(),z&&Pe(v),j&&j.d(z),z&&Pe(_),O=!1,Bi(N)}}}function fce(r){let e,t,s,a;function u(g){r[15](g)}function f(g){r[16](g)}let h={field:r[1]};return r[0]!==void 0&&(h.value=r[0]),r[9]!==void 0&&(h.search=r[9]),e=new ZV({props:h}),r[14](e),ts.push(()=>gr(e,"value",u)),ts.push(()=>gr(e,"search",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&2&&(_.field=g[1]),!t&&v&1&&(t=!0,_.value=g[0],Cr(()=>t=!1)),!s&&v&512&&(s=!0,_.search=g[9],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){r[14](null),on(e,g)}}}function dce(r){let e,t,s,a,u,f,h;return{c(){e=ae("span"),t=ae("div"),s=Kt(r[0]),a=Ze(),u=ae("button"),U(u,"type","button"),U(u,"class","btn-close btn-sm ms-1"),ss(u,"font-size","10px"),U(u,"aria-label","Close"),U(t,"class","d-flex align-items-center "),U(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,v){Ie(g,e,v),Y(e,t),Y(t,s),Y(t,a),Y(t,u),f||(h=En(u,"click",Hu(r[17])),f=!0)},p(g,v){v&1&&jn(s,g[0])},d(g){g&&Pe(e),f=!1,h()}}}function hce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[8]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&256&&jn(t,s[8])},d(s){s&&Pe(e)}}}function pSe(r){let e,t,s,a,u;const f=[gSe,mSe],h=[];function g(_,A){return _[7]?0:1}t=g(r),s=h[t]=f[t](r);let v=r[8]&&hce(r);return{c(){e=ae("div"),s.c(),a=Ze(),v&&v.c(),U(e,"class","mb-0")},m(_,A){Ie(_,e,A),h[t].m(e,null),Y(e,a),v&&v.m(e,null),u=!0},p(_,[A]){let O=t;t=g(_),t===O?h[t].p(_,A):(So(),$e(h[O],1,1,()=>{h[O]=null}),ko(),s=h[t],s?s.p(_,A):(s=h[t]=f[t](_),s.c()),Oe(s,1),s.m(e,a)),_[8]?v?v.p(_,A):(v=hce(_),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(_){u||(Oe(s),u=!0)},o(_){$e(s),u=!1},d(_){_&&Pe(e),h[t].d(),v&&v.d()}}}function bSe(r,e,t){let s,a,u,{field:f}=e,{value:h}=e,{id:g}=e,{isCreateMode:v}=e,{validationErrors:_}=e,A,O,N,L={enableTime:!1,allowInput:!0,dateFormat:"Y-m-d"};f.min&&(L.minDate=f.min),f.max&&(L.maxDate=f.max),H0(()=>{(!f.readonly||v)&&(a&&(L.clickOpens=!1),t(6,N=hf(O,L)))});function j(){s=this.value,t(9,s)}function z(we){ts[we?"unshift":"push"](()=>{O=we,t(5,O)})}const q=we=>N.open();function ee(we){ts[we?"unshift":"push"](()=>{A=we,t(4,A)})}function F(we){h=we,t(0,h)}function oe(we){s=we,t(9,s)}const te=we=>t(0,h="");function se(){h=this.value,t(0,h)}function X(we){ts[we?"unshift":"push"](()=>{O=we,t(5,O)})}return r.$$set=we=>{"field"in we&&t(1,f=we.field),"value"in we&&t(0,h=we.value),"id"in we&&t(2,g=we.id),"isCreateMode"in we&&t(3,v=we.isCreateMode),"validationErrors"in we&&t(10,_=we.validationErrors)},r.$$.update=()=>{r.$$.dirty&10&&t(7,a=f.optionsFrom&&!(f.readonly&&!v)),r.$$.dirty&1026&&t(8,u=Rg(_,f.name))},t(9,s=""),[h,f,g,v,A,O,N,a,u,s,_,j,z,q,ee,F,oe,te,se,X]}class vSe extends xo{constructor(e){super(),Ao(this,e,bSe,pSe,Eo,{field:1,value:0,id:2,isCreateMode:3,validationErrors:10})}}var K$,ySe=new Uint8Array(16);function wSe(){if(!K$&&(K$=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!K$))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K$(ySe)}const _Se=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function CSe(r){return typeof r=="string"&&_Se.test(r)}var Ph=[];for(var Ete=0;Ete<256;++Ete)Ph.push((Ete+256).toString(16).substr(1));function SSe(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Ph[r[e+0]]+Ph[r[e+1]]+Ph[r[e+2]]+Ph[r[e+3]]+"-"+Ph[r[e+4]]+Ph[r[e+5]]+"-"+Ph[r[e+6]]+Ph[r[e+7]]+"-"+Ph[r[e+8]]+Ph[r[e+9]]+"-"+Ph[r[e+10]]+Ph[r[e+11]]+Ph[r[e+12]]+Ph[r[e+13]]+Ph[r[e+14]]+Ph[r[e+15]]).toLowerCase();if(!CSe(t))throw TypeError("Stringified UUID is invalid");return t}function kSe(r,e,t){r=r||{};var s=r.random||(r.rng||wSe)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(var a=0;a<16;++a)e[t+a]=s[a];return e}return SSe(s)}function ESe(r){let e,t,s,a,u;return t=new fl({props:{icon:"dice"}}),{c(){e=ae("button"),sn(t.$$.fragment),U(e,"class","btn btn-primary ms-2"),U(e,"title","Generate a new UUIDv4")},m(f,h){Ie(f,e,h),nn(t,e,null),s=!0,a||(u=En(e,"click",r[4]),a=!0)},p:_n,i(f){s||(Oe(t.$$.fragment,f),s=!0)},o(f){$e(t.$$.fragment,f),s=!1},d(f){f&&Pe(e),on(t),a=!1,u()}}}function mce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[2]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&4&&jn(t,s[2])},d(s){s&&Pe(e)}}}function ASe(r){let e,t,s,a,u,f,h,g,v=!r[3]&&ESe(r),_=r[2]&&mce(r);return{c(){e=ae("div"),t=ae("div"),s=ae("input"),a=Ze(),v&&v.c(),u=Ze(),_&&_.c(),U(s,"type","text"),U(s,"id",r[1]),U(s,"class","form-control"),U(s,"autocomplete","off"),s.readOnly=r[3],vs(s,"is-invalid",r[2]),U(t,"class","d-flex justify-content-between"),U(e,"class","mb-0")},m(A,O){Ie(A,e,O),Y(e,t),Y(t,s),_r(s,r[0]),Y(t,a),v&&v.m(t,null),Y(e,u),_&&_.m(e,null),f=!0,h||(g=En(s,"input",r[8]),h=!0)},p(A,[O]){(!f||O&2)&&U(s,"id",A[1]),O&1&&s.value!==A[0]&&_r(s,A[0]),(!f||O&4)&&vs(s,"is-invalid",A[2]),A[3]||v.p(A,O),A[2]?_?_.p(A,O):(_=mce(A),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(A){f||(Oe(v),f=!0)},o(A){$e(v),f=!1},d(A){A&&Pe(e),v&&v.d(),_&&_.d(),h=!1,g()}}}function xSe(r,e,t){let s;hi("channelurl");let{validationErrors:a}=e,{field:u}=e,{value:f}=e,{id:h}=e,{isCreateMode:g}=e,v=u.readonly&&!g;function _(O){O.preventDefault(),t(0,f=kSe())}function A(){f=this.value,t(0,f)}return r.$$set=O=>{"validationErrors"in O&&t(5,a=O.validationErrors),"field"in O&&t(6,u=O.field),"value"in O&&t(0,f=O.value),"id"in O&&t(1,h=O.id),"isCreateMode"in O&&t(7,g=O.isCreateMode)},r.$$.update=()=>{r.$$.dirty&96&&t(2,s=Rg(a,u.name))},[f,h,s,v,_,a,u,g,A]}class TSe extends xo{constructor(e){super(),Ao(this,e,xSe,ASe,Eo,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function gce(r,e,t){const s=r.slice();return s[14]=e[t],s}function pce(r,e,t){const s=r.slice();return s[17]=e[t],s}function DSe(r){let e,t,s,a,u=r[3],f=[];for(let h=0;h<u.length;h+=1)f[h]=bce(pce(r,u,h));return{c(){e=ae("div"),t=ae("button"),t.textContent="Browse",s=Ze(),a=ae("ul");for(let h=0;h<f.length;h+=1)f[h].c();U(t,"class","btn btn-outline-primary btn-sm"),U(t,"type","button"),U(t,"data-bs-toggle","dropdown"),U(t,"aria-expanded","false"),U(a,"class","dropdown-menu"),U(e,"class","dropdown d-inline-block")},m(h,g){Ie(h,e,g),Y(e,t),Y(e,s),Y(e,a);for(let v=0;v<f.length;v+=1)f[v]&&f[v].m(a,null)},p(h,g){if(g&40){u=h[3];let v;for(v=0;v<u.length;v+=1){const _=pce(h,u,v);f[v]?f[v].p(_,g):(f[v]=bce(_),f[v].c(),f[v].m(a,null))}for(;v<f.length;v+=1)f[v].d(1);f.length=u.length}},d(h){h&&Pe(e),Ba(f,h)}}}function OSe(r){let e,t,s;return{c(){e=ae("button"),e.textContent="Browse",U(e,"class","btn btn-outline-primary")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",r[10]),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function bce(r){let e,t,s=r[17].label+"",a,u,f,h;function g(...v){return r[11](r[17],...v)}return{c(){e=ae("li"),t=ae("a"),a=Kt(s),u=Ze(),U(t,"class","dropdown-item"),U(t,"href","/")},m(v,_){Ie(v,e,_),Y(e,t),Y(t,a),Y(e,u),f||(h=En(t,"click",g),f=!0)},p(v,_){r=v},d(v){v&&Pe(e),f=!1,h()}}}function vce(r){let e,t;return e=new hI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[MSe]},$$scope:{ctx:r}}}),e.$on("update",r[6]),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&1048580&&(u.$$scope={dirty:a,ctx:s}),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function yce(r,e){let t,s,a,u;return s=new cI({props:{classes:"h-100",record:e[14],hasDelete:!0}}),s.$on("remove",e[4]),{key:r,first:null,c(){t=ae("div"),sn(s.$$.fragment),a=Ze(),U(t,"class","col mb-3"),this.first=t},m(f,h){Ie(f,t,h),nn(s,t,null),Y(t,a),u=!0},p(f,h){e=f;const g={};h&4&&(g.record=e[14]),s.$set(g)},i(f){u||(Oe(s.$$.fragment,f),u=!0)},o(f){$e(s.$$.fragment,f),u=!1},d(f){f&&Pe(t),on(s)}}}function MSe(r){let e=[],t=new Map,s,a,u=r[2];const f=h=>h[14].id;for(let h=0;h<u.length;h+=1){let g=gce(r,u,h),v=f(g);t.set(v,e[h]=yce(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){g&20&&(u=h[2],So(),e=$h(e,g,f,1,h,u,t,s.parentNode,gv,yce,s,gce),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function RSe(r){let e,t,s,a,u;function f(A,O){return A[0].collections.length===1?OSe:DSe}let h=f(r),g=h(r),v=r[2].length>0&&vce(r),_={};return a=new Ooe({props:_}),r[12](a),a.$on("insert",r[7]),{c(){e=ae("div"),g.c(),t=Ze(),v&&v.c(),s=Ze(),sn(a.$$.fragment),U(e,"class","mb-0")},m(A,O){Ie(A,e,O),g.m(e,null),Ie(A,t,O),v&&v.m(A,O),Ie(A,s,O),nn(a,A,O),u=!0},p(A,[O]){h===(h=f(A))&&g?g.p(A,O):(g.d(1),g=h(A),g&&(g.c(),g.m(e,null))),A[2].length>0?v?(v.p(A,O),O&4&&Oe(v,1)):(v=vce(A),v.c(),Oe(v,1),v.m(s.parentNode,s)):v&&(So(),$e(v,1,1,()=>{v=null}),ko());const N={};a.$set(N)},i(A){u||(Oe(v),Oe(a.$$.fragment,A),u=!0)},o(A){$e(v),$e(a.$$.fragment,A),u=!1},d(A){A&&Pe(e),g.d(),A&&Pe(t),v&&v.d(A),A&&Pe(s),r[12](null),on(a,A)}}}function NSe(r,e,t){let s;const a=hi("channel");let{field:u}=e,{record:f}=e,{graph:h}=e,g,v=a.schemas.filter(q=>u.collections.includes(q.name));function _(q){q.preventDefault(),t(8,h.edges=h.edges.filter(ee=>!(ee.target===q.detail&&ee.field===u.name)),h)}function A(q,ee){q.preventDefault(),g.open(ee)}async function O(q){console.log(q.detail),t(8,h.edges=await yO(q.detail.source,q.detail.target,h.edges,u.name),h)}function N(q){var se;q.preventDefault(),g.close();const ee=q.detail.records,F=q.detail.action;let oe=ee.map(X=>({target:X.id,source:f.id,sourceSchema:f.schema,targetSchema:X.schema,field:u.name,rank:""})),te=(se=h.edges)!=null?se:[];F==="replace"&&(te=te.filter(X=>X.field!==u.name)),t(8,h.records=fd.exports.uniqBy([...h.records,...ee],X=>X.id),h),t(8,h.edges=fd.exports.uniqBy([...te,...oe],X=>X.target+X.field),h)}const L=q=>A(q,v[0].name),j=(q,ee)=>A(ee,q.name);function z(q){ts[q?"unshift":"push"](()=>{g=q,t(1,g)})}return r.$$set=q=>{"field"in q&&t(0,u=q.field),"record"in q&&t(9,f=q.record),"graph"in q&&t(8,h=q.graph)},r.$$.update=()=>{var q;r.$$.dirty&769&&t(2,s=(q=h==null?void 0:h.edges.filter(ee=>ee.field===u.name).map(ee=>h.records.find(F=>F.id==ee.target&&f.id==ee.source)).filter(ee=>!!(ee!=null&&ee.id)))!=null?q:[])},[u,g,s,v,_,A,O,N,h,f,L,j,z]}class PSe extends xo{constructor(e){super(),Ao(this,e,NSe,RSe,Eo,{field:0,record:9,graph:8})}}function wce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[5]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&32&&jn(t,s[5])},d(s){s&&Pe(e)}}}function ISe(r){let e,t,s,a,u,f,h=r[5]&&wce(r);return{c(){e=ae("div"),t=ae("textarea"),a=Ze(),h&&h.c(),U(t,"id",r[3]),U(t,"class","form-control svelte-1er4ovm"),U(t,"rows","2"),t.readOnly=s=r[1].readonly&&!r[2],vs(t,"is-invalid",r[5]),U(e,"class","mb-0")},m(g,v){Ie(g,e,v),Y(e,t),_r(t,r[0]),r[8](t),Y(e,a),h&&h.m(e,null),u||(f=[En(t,"input",r[7]),En(t,"input",Sne),En(t,"focus",Sne)],u=!0)},p(g,[v]){v&8&&U(t,"id",g[3]),v&6&&s!==(s=g[1].readonly&&!g[2])&&(t.readOnly=s),v&1&&_r(t,g[0]),v&32&&vs(t,"is-invalid",g[5]),g[5]?h?h.p(g,v):(h=wce(g),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:_n,o:_n,d(g){g&&Pe(e),r[8](null),h&&h.d(),u=!1,Bi(f)}}}function Sne(r){let e;r.target?e=r.target:e=r,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function BSe(r,e,t){let s,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,g,{id:v}=e;H0(()=>{Sne(g)});function _(){u=this.value,t(0,u)}function A(O){ts[O?"unshift":"push"](()=>{g=O,t(4,g)})}return r.$$set=O=>{"field"in O&&t(1,a=O.field),"value"in O&&t(0,u=O.value),"isCreateMode"in O&&t(2,f=O.isCreateMode),"validationErrors"in O&&t(6,h=O.validationErrors),"id"in O&&t(3,v=O.id)},r.$$.update=()=>{r.$$.dirty&66&&t(5,s=Rg(h,a.name))},[u,a,f,v,g,s,h,_,A]}class pme extends xo{constructor(e){super(),Ao(this,e,BSe,ISe,Eo,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function LSe(r){let e,t,s,a;return{c(){e=ae("input"),U(e,"type","text"),U(e,"id",r[3]),U(e,"class","form-control"),U(e,"autocomplete","off"),e.readOnly=t=r[1].readonly&&!r[2],vs(e,"is-invalid",r[8])},m(u,f){Ie(u,e,f),_r(e,r[0]),r[20](e),s||(a=En(e,"input",r[19]),s=!0)},p(u,f){f&8&&U(e,"id",u[3]),f&6&&t!==(t=u[1].readonly&&!u[2])&&(e.readOnly=t),f&1&&e.value!==u[0]&&_r(e,u[0]),f&256&&vs(e,"is-invalid",u[8])},i:_n,o:_n,d(u){u&&Pe(e),r[20](null),s=!1,a()}}}function FSe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N;f=new fl({props:{icon:"calendar"}});let L=r[1].optionsFrom&&_ce(r),j=r[0]&&Cce(r);return{c(){e=ae("div"),t=ae("input"),a=Ze(),u=ae("button"),sn(f.$$.fragment),h=Ze(),g=ae("ul"),L&&L.c(),v=Ze(),j&&j.c(),_=Bs(),U(t,"type","search"),U(t,"id",r[3]),U(t,"class","form-control dropdown-toggle"),U(t,"placeholder","Search for options"),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=s=r[1].readonly&&!r[2],vs(t,"is-invalid",r[8]),U(u,"class","btn btn-light ms-1"),U(g,"class","dropdown-menu w-100"),U(e,"class","dropdown d-flex")},m(z,q){Ie(z,e,q),Y(e,t),_r(t,r[9]),r[13](t),Y(e,a),Y(e,u),nn(f,u,null),Y(e,h),Y(e,g),L&&L.m(g,null),Ie(z,v,q),j&&j.m(z,q),Ie(z,_,q),A=!0,O||(N=[En(t,"keyup",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"focus",function(){B0(r[4].update)&&r[4].update.apply(this,arguments)}),En(t,"input",r[12]),En(u,"click",Hu(r[14]))],O=!0)},p(z,q){r=z,(!A||q&8)&&U(t,"id",r[3]),(!A||q&6&&s!==(s=r[1].readonly&&!r[2]))&&(t.readOnly=s),q&512&&t.value!==r[9]&&_r(t,r[9]),(!A||q&256)&&vs(t,"is-invalid",r[8]),r[1].optionsFrom?L?(L.p(r,q),q&2&&Oe(L,1)):(L=_ce(r),L.c(),Oe(L,1),L.m(g,null)):L&&(So(),$e(L,1,1,()=>{L=null}),ko()),r[0]?j?j.p(r,q):(j=Cce(r),j.c(),j.m(_.parentNode,_)):j&&(j.d(1),j=null)},i(z){A||(Oe(f.$$.fragment,z),Oe(L),A=!0)},o(z){$e(f.$$.fragment,z),$e(L),A=!1},d(z){z&&Pe(e),r[13](null),on(f),L&&L.d(),z&&Pe(v),j&&j.d(z),z&&Pe(_),O=!1,Bi(N)}}}function _ce(r){let e,t,s,a;function u(g){r[16](g)}function f(g){r[17](g)}let h={field:r[1]};return r[0]!==void 0&&(h.value=r[0]),r[9]!==void 0&&(h.search=r[9]),e=new ZV({props:h}),r[15](e),ts.push(()=>gr(e,"value",u)),ts.push(()=>gr(e,"search",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&2&&(_.field=g[1]),!t&&v&1&&(t=!0,_.value=g[0],Cr(()=>t=!1)),!s&&v&512&&(s=!0,_.search=g[9],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){r[15](null),on(e,g)}}}function Cce(r){let e,t,s,a,u,f,h;return{c(){e=ae("span"),t=ae("div"),s=Kt(r[0]),a=Ze(),u=ae("button"),U(u,"type","button"),U(u,"class","btn-close btn-sm ms-1"),ss(u,"font-size","10px"),U(u,"aria-label","Close"),U(t,"class","d-flex align-items-center "),U(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,v){Ie(g,e,v),Y(e,t),Y(t,s),Y(t,a),Y(t,u),f||(h=En(u,"click",Hu(r[18])),f=!0)},p(g,v){v&1&&jn(s,g[0])},d(g){g&&Pe(e),f=!1,h()}}}function Sce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[8]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&256&&jn(t,s[8])},d(s){s&&Pe(e)}}}function HSe(r){let e,t,s,a,u,f,h;const g=[FSe,LSe],v=[];function _(O,N){return O[7]?0:1}t=_(r),s=v[t]=g[t](r);let A=r[8]&&Sce(r);return{c(){e=ae("div"),s.c(),a=Ze(),u=ae("small"),u.textContent=`Dates are displayed according to your timezone: ${r[10]}`,f=Ze(),A&&A.c(),U(u,"class","text-primary opacity-50"),U(e,"class","mb-0")},m(O,N){Ie(O,e,N),v[t].m(e,null),Y(e,a),Y(e,u),Y(e,f),A&&A.m(e,null),h=!0},p(O,[N]){let L=t;t=_(O),t===L?v[t].p(O,N):(So(),$e(v[L],1,1,()=>{v[L]=null}),ko(),s=v[t],s?s.p(O,N):(s=v[t]=g[t](O),s.c()),Oe(s,1),s.m(e,a)),O[8]?A?A.p(O,N):(A=Sce(O),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i(O){h||(Oe(s),h=!0)},o(O){$e(s),h=!1},d(O){O&&Pe(e),v[t].d(),A&&A.d()}}}function $Se(r,e,t){let s,a,u,{field:f}=e,{value:h}=e,{isCreateMode:g}=e,{validationErrors:v}=e;const _=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:A}=e,O,N,L,j={enableTime:!1,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};f.min&&(j.minDate=f.min),f.max&&(j.maxDate=f.max),H0(()=>{(!f.readonly||g)&&(a&&(j.clickOpens=!1),t(6,L=hf(N,j)))});function z(){s=this.value,t(9,s)}function q(ye){ts[ye?"unshift":"push"](()=>{N=ye,t(5,N)})}const ee=ye=>L.open();function F(ye){ts[ye?"unshift":"push"](()=>{O=ye,t(4,O)})}function oe(ye){h=ye,t(0,h)}function te(ye){s=ye,t(9,s)}const se=ye=>t(0,h="");function X(){h=this.value,t(0,h)}function we(ye){ts[ye?"unshift":"push"](()=>{N=ye,t(5,N)})}return r.$$set=ye=>{"field"in ye&&t(1,f=ye.field),"value"in ye&&t(0,h=ye.value),"isCreateMode"in ye&&t(2,g=ye.isCreateMode),"validationErrors"in ye&&t(11,v=ye.validationErrors),"id"in ye&&t(3,A=ye.id)},r.$$.update=()=>{r.$$.dirty&6&&t(7,a=f.optionsFrom&&!(f.readonly&&!g)),r.$$.dirty&2050&&t(8,u=Rg(v,f.name))},t(9,s=""),[h,f,g,A,O,N,L,a,u,s,_,v,z,q,ee,F,oe,te,se,X,we]}class zSe extends xo{constructor(e){super(),Ao(this,e,$Se,HSe,Eo,{field:1,value:0,isCreateMode:2,validationErrors:11,id:3})}}function kce(r){let e,t;return{c(){e=ae("div"),t=Kt(r[2]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&4&&jn(t,s[2])},d(s){s&&Pe(e)}}}function VSe(r){let e,t,s,a,u;function f(v){r[7](v)}let h={additionalConfig:r[3],schema:r[1]};r[0]!==void 0&&(h.value=r[0]),t=new hme({props:h}),ts.push(()=>gr(t,"value",f));let g=r[2]&&kce(r);return{c(){e=ae("div"),sn(t.$$.fragment),a=Ze(),g&&g.c(),U(e,"class","mb-0")},m(v,_){Ie(v,e,_),nn(t,e,null),Y(e,a),g&&g.m(e,null),u=!0},p(v,[_]){const A={};_&2&&(A.schema=v[1]),!s&&_&1&&(s=!0,A.value=v[0],Cr(()=>s=!1)),t.$set(A),v[2]?g?g.p(v,_):(g=kce(v),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(v){u||(Oe(t.$$.fragment,v),u=!0)},o(v){$e(t.$$.fragment,v),u=!1},d(v){v&&Pe(e),on(t),g&&g.d()}}}function USe(r,e,t){let s,{value:a}=e,{field:u}=e,{isCreateMode:f}=e,{schema:h}=e,{validationErrors:g}=e,v={readonly:u.readonly&&!f};function _(A){a=A,t(0,a)}return r.$$set=A=>{"value"in A&&t(0,a=A.value),"field"in A&&t(4,u=A.field),"isCreateMode"in A&&t(5,f=A.isCreateMode),"schema"in A&&t(1,h=A.schema),"validationErrors"in A&&t(6,g=A.validationErrors)},r.$$.update=()=>{r.$$.dirty&80&&t(2,s=Rg(g,u.name))},[a,h,s,v,u,f,g,_]}class WSe extends xo{constructor(e){super(),Ao(this,e,USe,VSe,Eo,{value:0,field:4,isCreateMode:5,schema:1,validationErrors:6})}}class ul{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,s){let a=[];return this.decompose(0,e,a,2),s.length&&s.decompose(0,s.length,a,3),this.decompose(t,this.length,a,1),Xy.from(a,this.length-(t-e)+s.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let s=[];return this.decompose(e,t,s,0),Xy.from(s,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),s=this.length-this.scanIdentical(e,-1),a=new DP(this),u=new DP(e);for(let f=t,h=t;;){if(a.next(f),u.next(f),f=0,a.lineBreak!=u.lineBreak||a.done!=u.done||a.value!=u.value)return!1;if(h+=a.value.length,a.done||h>=s)return!0}}iter(e=1){return new DP(this,e)}iterRange(e,t=this.length){return new bme(this,e,t)}iterLines(e,t){let s;if(e==null)s=this.iter();else{t==null&&(t=this.lines+1);let a=this.line(e).from;s=this.iterRange(a,Math.max(a,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new vme(s)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ul.empty:e.length<=32?new df(e):Xy.from(df.split(e,[]))}}class df extends ul{constructor(e,t=jSe(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,s,a){for(let u=0;;u++){let f=this.text[u],h=a+f.length;if((t?s:h)>=e)return new ZSe(a,h,s,f);a=h+1,s++}}decompose(e,t,s,a){let u=e<=0&&t>=this.length?this:new df(Ece(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(a&1){let f=s.pop(),h=Bz(u.text,f.text.slice(),0,u.length);if(h.length<=32)s.push(new df(h,f.length+u.length));else{let g=h.length>>1;s.push(new df(h.slice(0,g)),new df(h.slice(g)))}}else s.push(u)}replace(e,t,s){if(!(s instanceof df))return super.replace(e,t,s);let a=Bz(this.text,Bz(s.text,Ece(this.text,0,e)),t),u=this.length+s.length-(t-e);return a.length<=32?new df(a,u):Xy.from(df.split(a,[]),u)}sliceString(e,t=this.length,s=`
|
|
`){let a="";for(let u=0,f=0;u<=t&&f<this.text.length;f++){let h=this.text[f],g=u+h.length;u>e&&f&&(a+=s),e<g&&t>u&&(a+=h.slice(Math.max(0,e-u),t-u)),u=g+1}return a}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let s=[],a=-1;for(let u of e)s.push(u),a+=u.length+1,s.length==32&&(t.push(new df(s,a)),s=[],a=-1);return a>-1&&t.push(new df(s,a)),t}}class Xy extends ul{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let s of e)this.lines+=s.lines}lineInner(e,t,s,a){for(let u=0;;u++){let f=this.children[u],h=a+f.length,g=s+f.lines-1;if((t?g:h)>=e)return f.lineInner(e,t,s,a);a=h+1,s=g+1}}decompose(e,t,s,a){for(let u=0,f=0;f<=t&&u<this.children.length;u++){let h=this.children[u],g=f+h.length;if(e<=g&&t>=f){let v=a&((f<=e?1:0)|(g>=t?2:0));f>=e&&g<=t&&!v?s.push(h):h.decompose(e-f,t-f,s,v)}f=g+1}}replace(e,t,s){if(s.lines<this.lines)for(let a=0,u=0;a<this.children.length;a++){let f=this.children[a],h=u+f.length;if(e>=u&&t<=h){let g=f.replace(e-u,t-u,s),v=this.lines-f.lines+g.lines;if(g.lines<v>>5-1&&g.lines>v>>5+1){let _=this.children.slice();return _[a]=g,new Xy(_,this.length-(t-e)+s.length)}return super.replace(u,h,g)}u=h+1}return super.replace(e,t,s)}sliceString(e,t=this.length,s=`
|
|
`){let a="";for(let u=0,f=0;u<this.children.length&&f<=t;u++){let h=this.children[u],g=f+h.length;f>e&&u&&(a+=s),e<g&&t>f&&(a+=h.sliceString(e-f,t-f,s)),f=g+1}return a}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Xy))return 0;let s=0,[a,u,f,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;a+=t,u+=t){if(a==f||u==h)return s;let g=this.children[a],v=e.children[u];if(g!=v)return s+g.scanIdentical(v,t);s+=g.length+1}}static from(e,t=e.reduce((s,a)=>s+a.length+1,-1)){let s=0;for(let N of e)s+=N.lines;if(s<32){let N=[];for(let L of e)L.flatten(N);return new df(N,t)}let a=Math.max(32,s>>5),u=a<<1,f=a>>1,h=[],g=0,v=-1,_=[];function A(N){let L;if(N.lines>u&&N instanceof Xy)for(let j of N.children)A(j);else N.lines>f&&(g>f||!g)?(O(),h.push(N)):N instanceof df&&g&&(L=_[_.length-1])instanceof df&&N.lines+L.lines<=32?(g+=N.lines,v+=N.length+1,_[_.length-1]=new df(L.text.concat(N.text),L.length+1+N.length)):(g+N.lines>a&&O(),g+=N.lines,v+=N.length+1,_.push(N))}function O(){g!=0&&(h.push(_.length==1?_[0]:Xy.from(_,v)),v=-1,g=_.length=0)}for(let N of e)A(N);return O(),h.length==1?h[0]:new Xy(h,t)}}ul.empty=new df([""],0);function jSe(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Bz(r,e,t=0,s=1e9){for(let a=0,u=0,f=!0;u<r.length&&a<=s;u++){let h=r[u],g=a+h.length;g>=t&&(g>s&&(h=h.slice(0,s-a)),a<t&&(h=h.slice(t-a)),f?(e[e.length-1]+=h,f=!1):e.push(h)),a=g+1}return e}function Ece(r,e,t){return Bz(r,[""],e,t)}class DP{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof df?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let s=this.nodes.length-1,a=this.nodes[s],u=this.offsets[s],f=u>>1,h=a instanceof df?a.text.length:a.children.length;if(f==(t>0?h:0)){if(s==0)return this.done=!0,this.value="",this;t>0&&this.offsets[s-1]++,this.nodes.pop(),this.offsets.pop()}else if((u&1)==(t>0?0:1)){if(this.offsets[s]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
`,this;e--}else if(a instanceof df){let g=a.text[f+(t<0?-1:0)];if(this.offsets[s]+=t,g.length>Math.max(0,e))return this.value=e==0?g:t>0?g.slice(e):g.slice(0,g.length-e),this;e-=g.length}else{let g=a.children[f+(t<0?-1:0)];e>g.length?(e-=g.length,this.offsets[s]+=t):(t<0&&this.offsets[s]--,this.nodes.push(g),this.offsets.push(t>0?1:(g instanceof df?g.text.length:g.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class bme{constructor(e,t,s){this.value="",this.done=!1,this.cursor=new DP(e,t>s?-1:1),this.pos=t>s?e.length:0,this.from=Math.min(t,s),this.to=Math.max(t,s)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let s=t<0?this.pos-this.from:this.to-this.pos;e>s&&(e=s),s-=e;let{value:a}=this.cursor.next(e);return this.pos+=(a.length+e)*t,this.value=a.length<=s?a:t<0?a.slice(a.length-s):a.slice(0,s),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class vme{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:s,value:a}=this.inner.next(e);return t?(this.done=!0,this.value=""):s?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=a,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ul.prototype[Symbol.iterator]=function(){return this.iter()},DP.prototype[Symbol.iterator]=bme.prototype[Symbol.iterator]=vme.prototype[Symbol.iterator]=function(){return this});class ZSe{constructor(e,t,s,a){this.from=e,this.to=t,this.number=s,this.text=a}get length(){return this.to-this.from}}let XD="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(r=>r?parseInt(r,36):1);for(let r=1;r<XD.length;r++)XD[r]+=XD[r-1];function qSe(r){for(let e=1;e<XD.length;e+=2)if(XD[e]>r)return XD[e-1]<=r;return!1}function Ace(r){return r>=127462&&r<=127487}const xce=8205;function Dm(r,e,t=!0,s=!0){return(t?yme:GSe)(r,e,s)}function yme(r,e,t){if(e==r.length)return e;e&&wme(r.charCodeAt(e))&&_me(r.charCodeAt(e-1))&&e--;let s=Lh(r,e);for(e+=O0(s);e<r.length;){let a=Lh(r,e);if(s==xce||a==xce||t&&qSe(a))e+=O0(a),s=a;else if(Ace(a)){let u=0,f=e-2;for(;f>=0&&Ace(Lh(r,f));)u++,f-=2;if(u%2==0)break;e+=2}else break}return e}function GSe(r,e,t){for(;e>0;){let s=yme(r,e-2,t);if(s<e)return s;e--}return 0}function wme(r){return r>=56320&&r<57344}function _me(r){return r>=55296&&r<56320}function Lh(r,e){let t=r.charCodeAt(e);if(!_me(t)||e+1==r.length)return t;let s=r.charCodeAt(e+1);return wme(s)?(t-55296<<10)+(s-56320)+65536:t}function Poe(r){return r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10)+55296,(r&1023)+56320))}function O0(r){return r<65536?1:2}const kne=/\r\n?|\n/;var Ag=function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r}(Ag||(Ag={}));class o2{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let s=this.sections[t+1];e+=s<0?this.sections[t]:s}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,s=0,a=0;t<this.sections.length;){let u=this.sections[t++],f=this.sections[t++];f<0?(e(s,a,u),a+=u):a+=f,s+=u}}iterChangedRanges(e,t=!1){Ene(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let s=this.sections[t++],a=this.sections[t++];a<0?e.push(s,a):e.push(a,s)}return new o2(e)}composeDesc(e){return this.empty?e:e.empty?this:Cme(this,e)}mapDesc(e,t=!1){return e.empty?this:Ane(this,e,t)}mapPos(e,t=-1,s=Ag.Simple){let a=0,u=0;for(let f=0;f<this.sections.length;){let h=this.sections[f++],g=this.sections[f++],v=a+h;if(g<0){if(v>e)return u+(e-a);u+=h}else{if(s!=Ag.Simple&&v>=e&&(s==Ag.TrackDel&&a<e&&v>e||s==Ag.TrackBefore&&a<e||s==Ag.TrackAfter&&v>e))return null;if(v>e||v==e&&t<0&&!h)return e==a||t<0?u:u+g;u+=g}a=v}if(e>a)throw new RangeError(`Position ${e} is out of range for changeset of length ${a}`);return u}touchesRange(e,t=e){for(let s=0,a=0;s<this.sections.length&&a<=t;){let u=this.sections[s++],f=this.sections[s++],h=a+u;if(f>=0&&a<=t&&h>=e)return a<e&&h>t?"cover":!0;a=h}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let s=this.sections[t++],a=this.sections[t++];e+=(e?" ":"")+s+(a>=0?":"+a:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new o2(e)}static create(e){return new o2(e)}}class ud extends o2{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Ene(this,(t,s,a,u,f)=>e=e.replace(a,a+(s-t),f),!1),e}mapDesc(e,t=!1){return Ane(this,e,t,!0)}invert(e){let t=this.sections.slice(),s=[];for(let a=0,u=0;a<t.length;a+=2){let f=t[a],h=t[a+1];if(h>=0){t[a]=h,t[a+1]=f;let g=a>>1;for(;s.length<g;)s.push(ul.empty);s.push(f?e.slice(u,u+f):ul.empty)}u+=f}return new ud(t,s)}compose(e){return this.empty?e:e.empty?this:Cme(this,e,!0)}map(e,t=!1){return e.empty?this:Ane(this,e,t,!0)}iterChanges(e,t=!1){Ene(this,e,t)}get desc(){return o2.create(this.sections)}filter(e){let t=[],s=[],a=[],u=new FP(this);e:for(let f=0,h=0;;){let g=f==e.length?1e9:e[f++];for(;h<g||h==g&&u.len==0;){if(u.done)break e;let _=Math.min(u.len,g-h);xm(a,_,-1);let A=u.ins==-1?-1:u.off==0?u.ins:0;xm(t,_,A),A>0&&ik(s,t,u.text),u.forward(_),h+=_}let v=e[f++];for(;h<v;){if(u.done)break e;let _=Math.min(u.len,v-h);xm(t,_,-1),xm(a,_,u.ins==-1?-1:u.off==0?u.ins:0),u.forward(_),h+=_}}return{changes:new ud(t,s),filtered:o2.create(a)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let s=this.sections[t],a=this.sections[t+1];a<0?e.push(s):a==0?e.push([s]):e.push([s].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,s){let a=[],u=[],f=0,h=null;function g(_=!1){if(!_&&!a.length)return;f<t&&xm(a,t-f,-1);let A=new ud(a,u);h=h?h.compose(A.map(h)):A,a=[],u=[],f=0}function v(_){if(Array.isArray(_))for(let A of _)v(A);else if(_ instanceof ud){if(_.length!=t)throw new RangeError(`Mismatched change set length (got ${_.length}, expected ${t})`);g(),h=h?h.compose(_.map(h)):_}else{let{from:A,to:O=A,insert:N}=_;if(A>O||A<0||O>t)throw new RangeError(`Invalid change range ${A} to ${O} (in doc of length ${t})`);let L=N?typeof N=="string"?ul.of(N.split(s||kne)):N:ul.empty,j=L.length;if(A==O&&j==0)return;A<f&&g(),A>f&&xm(a,A-f,-1),xm(a,O-A,j),ik(u,a,L),f=O}}return v(e),g(!h),h}static empty(e){return new ud(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],s=[];for(let a=0;a<e.length;a++){let u=e[a];if(typeof u=="number")t.push(u,-1);else{if(!Array.isArray(u)||typeof u[0]!="number"||u.some((f,h)=>h&&typeof f!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(u.length==1)t.push(u[0],0);else{for(;s.length<a;)s.push(ul.empty);s[a]=ul.of(u.slice(1)),t.push(u[0],s[a].length)}}}return new ud(t,s)}static createSet(e,t){return new ud(e,t)}}function xm(r,e,t,s=!1){if(e==0&&t<=0)return;let a=r.length-2;a>=0&&t<=0&&t==r[a+1]?r[a]+=e:e==0&&r[a]==0?r[a+1]+=t:s?(r[a]+=e,r[a+1]+=t):r.push(e,t)}function ik(r,e,t){if(t.length==0)return;let s=e.length-2>>1;if(s<r.length)r[r.length-1]=r[r.length-1].append(t);else{for(;r.length<s;)r.push(ul.empty);r.push(t)}}function Ene(r,e,t){let s=r.inserted;for(let a=0,u=0,f=0;f<r.sections.length;){let h=r.sections[f++],g=r.sections[f++];if(g<0)a+=h,u+=h;else{let v=a,_=u,A=ul.empty;for(;v+=h,_+=g,g&&s&&(A=A.append(s[f-2>>1])),!(t||f==r.sections.length||r.sections[f+1]<0);)h=r.sections[f++],g=r.sections[f++];e(a,v,u,_,A),a=v,u=_}}}function Ane(r,e,t,s=!1){let a=[],u=s?[]:null,f=new FP(r),h=new FP(e);for(let g=-1;;)if(f.ins==-1&&h.ins==-1){let v=Math.min(f.len,h.len);xm(a,v,-1),f.forward(v),h.forward(v)}else if(h.ins>=0&&(f.ins<0||g==f.i||f.off==0&&(h.len<f.len||h.len==f.len&&!t))){let v=h.len;for(xm(a,h.ins,-1);v;){let _=Math.min(f.len,v);f.ins>=0&&g<f.i&&f.len<=_&&(xm(a,0,f.ins),u&&ik(u,a,f.text),g=f.i),f.forward(_),v-=_}h.next()}else if(f.ins>=0){let v=0,_=f.len;for(;_;)if(h.ins==-1){let A=Math.min(_,h.len);v+=A,_-=A,h.forward(A)}else if(h.ins==0&&h.len<_)_-=h.len,h.next();else break;xm(a,v,g<f.i?f.ins:0),u&&g<f.i&&ik(u,a,f.text),g=f.i,f.forward(f.len-_)}else{if(f.done&&h.done)return u?ud.createSet(a,u):o2.create(a);throw new Error("Mismatched change set lengths")}}function Cme(r,e,t=!1){let s=[],a=t?[]:null,u=new FP(r),f=new FP(e);for(let h=!1;;){if(u.done&&f.done)return a?ud.createSet(s,a):o2.create(s);if(u.ins==0)xm(s,u.len,0,h),u.next();else if(f.len==0&&!f.done)xm(s,0,f.ins,h),a&&ik(a,s,f.text),f.next();else{if(u.done||f.done)throw new Error("Mismatched change set lengths");{let g=Math.min(u.len2,f.len),v=s.length;if(u.ins==-1){let _=f.ins==-1?-1:f.off?0:f.ins;xm(s,g,_,h),a&&_&&ik(a,s,f.text)}else f.ins==-1?(xm(s,u.off?0:u.len,g,h),a&&ik(a,s,u.textBit(g))):(xm(s,u.off?0:u.len,f.off?0:f.ins,h),a&&!f.off&&ik(a,s,f.text));h=(u.ins>g||f.ins>=0&&f.len>g)&&(h||s.length>v),u.forward2(g),f.forward(g)}}}}class FP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?ul.empty:e[t]}textBit(e){let{inserted:t}=this.set,s=this.i-2>>1;return s>=t.length&&!e?ul.empty:t[s].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class $x{constructor(e,t,s){this.from=e,this.to=t,this.flags=s}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let s,a;return this.empty?s=a=e.mapPos(this.from,t):(s=e.mapPos(this.from,1),a=e.mapPos(this.to,-1)),s==this.from&&a==this.to?this:new $x(s,a,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Yn.range(e,t);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Yn.range(this.anchor,s)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Yn.range(e.anchor,e.head)}static create(e,t,s){return new $x(e,t,s)}}class Yn{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Yn.create(this.ranges.map(s=>s.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Yn([this.main],0)}addRange(e,t=!0){return Yn.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let s=this.ranges.slice();return s[t]=e,Yn.create(s,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Yn(e.ranges.map(t=>$x.fromJSON(t)),e.main)}static single(e,t=e){return new Yn([Yn.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let s=0,a=0;a<e.length;a++){let u=e[a];if(u.empty?u.from<=s:u.from<s)return Yn.normalized(e.slice(),t);s=u.to}return new Yn(e,t)}static cursor(e,t=0,s,a){return $x.create(e,e,(t==0?0:t<0?4:8)|(s==null?3:Math.min(2,s))|(a!=null?a:33554431)<<5)}static range(e,t,s,a){let u=(s!=null?s:33554431)<<5|(a==null?3:Math.min(2,a));return t<e?$x.create(t,e,24|u):$x.create(e,t,(t>e?4:0)|u)}static normalized(e,t=0){let s=e[t];e.sort((a,u)=>a.from-u.from),t=e.indexOf(s);for(let a=1;a<e.length;a++){let u=e[a],f=e[a-1];if(u.empty?u.from<=f.to:u.from<f.to){let h=f.from,g=Math.max(u.to,f.to);a<=t&&t--,e.splice(--a,2,u.anchor>u.head?Yn.range(g,h):Yn.range(h,g))}}return new Yn(e,t)}}function Sme(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Ioe=0;class Ds{constructor(e,t,s,a,u){this.combine=e,this.compareInput=t,this.compare=s,this.isStatic=a,this.id=Ioe++,this.default=e([]),this.extensions=typeof u=="function"?u(this):u}static define(e={}){return new Ds(e.combine||(t=>t),e.compareInput||((t,s)=>t===s),e.compare||(e.combine?(t,s)=>t===s:Boe),!!e.static,e.enables)}of(e){return new Lz([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lz(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Lz(e,this,2,t)}from(e,t){return t||(t=s=>s),this.compute([e],s=>t(s.field(e)))}}function Boe(r,e){return r==e||r.length==e.length&&r.every((t,s)=>t===e[s])}class Lz{constructor(e,t,s,a){this.dependencies=e,this.facet=t,this.type=s,this.value=a,this.id=Ioe++}dynamicSlot(e){var t;let s=this.value,a=this.facet.compareInput,u=this.id,f=e[u]>>1,h=this.type==2,g=!1,v=!1,_=[];for(let A of this.dependencies)A=="doc"?g=!0:A=="selection"?v=!0:(((t=e[A.id])!==null&&t!==void 0?t:1)&1)==0&&_.push(e[A.id]);return{create(A){return A.values[f]=s(A),1},update(A,O){if(g&&O.docChanged||v&&(O.docChanged||O.selection)||xne(A,_)){let N=s(A);if(h?!Tce(N,A.values[f],a):!a(N,A.values[f]))return A.values[f]=N,1}return 0},reconfigure:(A,O)=>{let N,L=O.config.address[u];if(L!=null){let j=cV(O,L);if(this.dependencies.every(z=>z instanceof Ds?O.facet(z)===A.facet(z):z instanceof md?O.field(z,!1)==A.field(z,!1):!0)||(h?Tce(N=s(A),j,a):a(N=s(A),j)))return A.values[f]=j,0}else N=s(A);return A.values[f]=N,1}}}}function Tce(r,e,t){if(r.length!=e.length)return!1;for(let s=0;s<r.length;s++)if(!t(r[s],e[s]))return!1;return!0}function xne(r,e){let t=!1;for(let s of e)OP(r,s)&1&&(t=!0);return t}function KSe(r,e,t){let s=t.map(g=>r[g.id]),a=t.map(g=>g.type),u=s.filter(g=>!(g&1)),f=r[e.id]>>1;function h(g){let v=[];for(let _=0;_<s.length;_++){let A=cV(g,s[_]);if(a[_]==2)for(let O of A)v.push(O);else v.push(A)}return e.combine(v)}return{create(g){for(let v of s)OP(g,v);return g.values[f]=h(g),1},update(g,v){if(!xne(g,u))return 0;let _=h(g);return e.compare(_,g.values[f])?0:(g.values[f]=_,1)},reconfigure(g,v){let _=xne(g,s),A=v.config.facets[e.id],O=v.facet(e);if(A&&!_&&Boe(t,A))return g.values[f]=O,0;let N=h(g);return e.compare(N,O)?(g.values[f]=O,0):(g.values[f]=N,1)}}}const Dce=Ds.define({static:!0});class md{constructor(e,t,s,a,u){this.id=e,this.createF=t,this.updateF=s,this.compareF=a,this.spec=u,this.provides=void 0}static define(e){let t=new md(Ioe++,e.create,e.update,e.compare||((s,a)=>s===a),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dce).find(s=>s.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:s=>(s.values[t]=this.create(s),1),update:(s,a)=>{let u=s.values[t],f=this.updateF(u,a);return this.compareF(u,f)?0:(s.values[t]=f,1)},reconfigure:(s,a)=>a.config.address[this.id]!=null?(s.values[t]=a.field(this),0):(s.values[t]=this.create(s),1)}}init(e){return[this,Dce.of({field:this,create:e})]}get extension(){return this}}const Fx={lowest:4,low:3,default:2,high:1,highest:0};function aP(r){return e=>new kme(e,r)}const wO={highest:aP(Fx.highest),high:aP(Fx.high),default:aP(Fx.default),low:aP(Fx.low),lowest:aP(Fx.lowest)};class kme{constructor(e,t){this.inner=e,this.prec=t}}class rO{of(e){return new Tne(this,e)}reconfigure(e){return rO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Tne{constructor(e,t){this.compartment=e,this.inner=t}}class lV{constructor(e,t,s,a,u,f){for(this.base=e,this.compartments=t,this.dynamicSlots=s,this.address=a,this.staticValues=u,this.facets=f,this.statusTemplate=[];this.statusTemplate.length<s.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,s){let a=[],u=Object.create(null),f=new Map;for(let O of YSe(e,t,f))O instanceof md?a.push(O):(u[O.facet.id]||(u[O.facet.id]=[])).push(O);let h=Object.create(null),g=[],v=[];for(let O of a)h[O.id]=v.length<<1,v.push(N=>O.slot(N));let _=s==null?void 0:s.config.facets;for(let O in u){let N=u[O],L=N[0].facet,j=_&&_[O]||[];if(N.every(z=>z.type==0))if(h[L.id]=g.length<<1|1,Boe(j,N))g.push(s.facet(L));else{let z=L.combine(N.map(q=>q.value));g.push(s&&L.compare(z,s.facet(L))?s.facet(L):z)}else{for(let z of N)z.type==0?(h[z.id]=g.length<<1|1,g.push(z.value)):(h[z.id]=v.length<<1,v.push(q=>z.dynamicSlot(q)));h[L.id]=v.length<<1,v.push(z=>KSe(z,L,N))}}let A=v.map(O=>O(h));return new lV(e,f,A,h,g,u)}}function YSe(r,e,t){let s=[[],[],[],[],[]],a=new Map;function u(f,h){let g=a.get(f);if(g!=null){if(g<=h)return;let v=s[g].indexOf(f);v>-1&&s[g].splice(v,1),f instanceof Tne&&t.delete(f.compartment)}if(a.set(f,h),Array.isArray(f))for(let v of f)u(v,h);else if(f instanceof Tne){if(t.has(f.compartment))throw new RangeError("Duplicate use of compartment in extensions");let v=e.get(f.compartment)||f.inner;t.set(f.compartment,v),u(v,h)}else if(f instanceof kme)u(f.inner,f.prec);else if(f instanceof md)s[h].push(f),f.provides&&u(f.provides,h);else if(f instanceof Lz)s[h].push(f),f.facet.extensions&&u(f.facet.extensions,Fx.default);else{let v=f.extension;if(!v)throw new Error(`Unrecognized extension value in extension set (${f}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);u(v,h)}}return u(r,Fx.default),s.reduce((f,h)=>f.concat(h))}function OP(r,e){if(e&1)return 2;let t=e>>1,s=r.status[t];if(s==4)throw new Error("Cyclic dependency between fields and/or facets");if(s&2)return s;r.status[t]=4;let a=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|a}function cV(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const Eme=Ds.define(),Ame=Ds.define({combine:r=>r.some(e=>e),static:!0}),xme=Ds.define({combine:r=>r.length?r[0]:void 0,static:!0}),Tme=Ds.define(),Dme=Ds.define(),Ome=Ds.define(),Mme=Ds.define({combine:r=>r.length?r[0]:!1});class B_{constructor(e,t){this.type=e,this.value=t}static define(){return new XSe}}class XSe{of(e){return new B_(this,e)}}class JSe{constructor(e){this.map=e}of(e){return new Ii(this,e)}}class Ii{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ii(this.type,t)}is(e){return this.type==e}static define(e={}){return new JSe(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let s=[];for(let a of e){let u=a.map(t);u&&s.push(u)}return s}}Ii.reconfigure=Ii.define();Ii.appendConfig=Ii.define();class hd{constructor(e,t,s,a,u,f){this.startState=e,this.changes=t,this.selection=s,this.effects=a,this.annotations=u,this.scrollIntoView=f,this._doc=null,this._state=null,s&&Sme(s,t.newLength),u.some(h=>h.type==hd.time)||(this.annotations=u.concat(hd.time.of(Date.now())))}static create(e,t,s,a,u,f){return new hd(e,t,s,a,u,f)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(hd.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hd.time=B_.define();hd.userEvent=B_.define();hd.addToHistory=B_.define();hd.remote=B_.define();function QSe(r,e){let t=[];for(let s=0,a=0;;){let u,f;if(s<r.length&&(a==e.length||e[a]>=r[s]))u=r[s++],f=r[s++];else if(a<e.length)u=e[a++],f=e[a++];else return t;!t.length||t[t.length-1]<u?t.push(u,f):t[t.length-1]<f&&(t[t.length-1]=f)}}function Rme(r,e,t){var s;let a,u,f;return t?(a=e.changes,u=ud.empty(e.changes.length),f=r.changes.compose(e.changes)):(a=e.changes.map(r.changes),u=r.changes.mapDesc(e.changes,!0),f=r.changes.compose(a)),{changes:f,selection:e.selection?e.selection.map(u):(s=r.selection)===null||s===void 0?void 0:s.map(a),effects:Ii.mapEffects(r.effects,a).concat(Ii.mapEffects(e.effects,u)),annotations:r.annotations.length?r.annotations.concat(e.annotations):e.annotations,scrollIntoView:r.scrollIntoView||e.scrollIntoView}}function Dne(r,e,t){let s=e.selection,a=JD(e.annotations);return e.userEvent&&(a=a.concat(hd.userEvent.of(e.userEvent))),{changes:e.changes instanceof ud?e.changes:ud.of(e.changes||[],t,r.facet(xme)),selection:s&&(s instanceof Yn?s:Yn.single(s.anchor,s.head)),effects:JD(e.effects),annotations:a,scrollIntoView:!!e.scrollIntoView}}function Nme(r,e,t){let s=Dne(r,e.length?e[0]:{},r.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let u=1;u<e.length;u++){e[u].filter===!1&&(t=!1);let f=!!e[u].sequential;s=Rme(s,Dne(r,e[u],f?s.changes.newLength:r.doc.length),f)}let a=hd.create(r,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return tke(t?eke(a):a)}function eke(r){let e=r.startState,t=!0;for(let a of e.facet(Tme)){let u=a(r);if(u===!1){t=!1;break}Array.isArray(u)&&(t=t===!0?u:QSe(t,u))}if(t!==!0){let a,u;if(t===!1)u=r.changes.invertedDesc,a=ud.empty(e.doc.length);else{let f=r.changes.filter(t);a=f.changes,u=f.filtered.mapDesc(f.changes).invertedDesc}r=hd.create(e,a,r.selection&&r.selection.map(u),Ii.mapEffects(r.effects,u),r.annotations,r.scrollIntoView)}let s=e.facet(Dme);for(let a=s.length-1;a>=0;a--){let u=s[a](r);u instanceof hd?r=u:Array.isArray(u)&&u.length==1&&u[0]instanceof hd?r=u[0]:r=Nme(e,JD(u),!1)}return r}function tke(r){let e=r.startState,t=e.facet(Ome),s=r;for(let a=t.length-1;a>=0;a--){let u=t[a](r);u&&Object.keys(u).length&&(s=Rme(s,Dne(e,u,r.changes.newLength),!0))}return s==r?r:hd.create(e,r.changes,r.selection,s.effects,s.annotations,s.scrollIntoView)}const nke=[];function JD(r){return r==null?nke:Array.isArray(r)?r:[r]}var jc=function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r}(jc||(jc={}));const oke=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let One;try{One=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ske(r){if(One)return One.test(r);for(let e=0;e<r.length;e++){let t=r[e];if(/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||oke.test(t)))return!0}return!1}function rke(r){return e=>{if(!/\S/.test(e))return jc.Space;if(ske(e))return jc.Word;for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>-1)return jc.Word;return jc.Other}}class Ea{constructor(e,t,s,a,u,f){this.config=e,this.doc=t,this.selection=s,this.values=a,this.status=e.statusTemplate.slice(),this.computeSlot=u,f&&(f._state=this);for(let h=0;h<this.config.dynamicSlots.length;h++)OP(this,h<<1);this.computeSlot=null}field(e,t=!0){let s=this.config.address[e.id];if(s==null){if(t)throw new RangeError("Field is not present in this state");return}return OP(this,s),cV(this,s)}update(...e){return Nme(this,e,!0)}applyTransaction(e){let t=this.config,{base:s,compartments:a}=t;for(let f of e.effects)f.is(rO.reconfigure)?(t&&(a=new Map,t.compartments.forEach((h,g)=>a.set(g,h)),t=null),a.set(f.value.compartment,f.value.extension)):f.is(Ii.reconfigure)?(t=null,s=f.value):f.is(Ii.appendConfig)&&(t=null,s=JD(s).concat(f.value));let u;t?u=e.startState.values.slice():(t=lV.resolve(s,a,this),u=new Ea(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(h,g)=>g.reconfigure(h,this),null).values),new Ea(t,e.newDoc,e.newSelection,u,(f,h)=>h.update(f,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Yn.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,s=e(t.ranges[0]),a=this.changes(s.changes),u=[s.range],f=JD(s.effects);for(let h=1;h<t.ranges.length;h++){let g=e(t.ranges[h]),v=this.changes(g.changes),_=v.map(a);for(let O=0;O<h;O++)u[O]=u[O].map(_);let A=a.mapDesc(v,!0);u.push(g.range.map(A)),a=a.compose(_),f=Ii.mapEffects(f,_).concat(Ii.mapEffects(JD(g.effects),A))}return{changes:a,selection:Yn.create(u,t.mainIndex),effects:f}}changes(e=[]){return e instanceof ud?e:ud.of(e,this.doc.length,this.facet(Ea.lineSeparator))}toText(e){return ul.of(e.split(this.facet(Ea.lineSeparator)||kne))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(OP(this,t),cV(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let s in e){let a=e[s];a instanceof md&&this.config.address[a.id]!=null&&(t[s]=a.spec.toJSON(this.field(e[s]),this))}return t}static fromJSON(e,t={},s){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let a=[];if(s){for(let u in s)if(Object.prototype.hasOwnProperty.call(e,u)){let f=s[u],h=e[u];a.push(f.init(g=>f.spec.fromJSON(h,g)))}}return Ea.create({doc:e.doc,selection:Yn.fromJSON(e.selection),extensions:t.extensions?a.concat([t.extensions]):a})}static create(e={}){let t=lV.resolve(e.extensions||[],new Map),s=e.doc instanceof ul?e.doc:ul.of((e.doc||"").split(t.staticFacet(Ea.lineSeparator)||kne)),a=e.selection?e.selection instanceof Yn?e.selection:Yn.single(e.selection.anchor,e.selection.head):Yn.single(0);return Sme(a,s.length),t.staticFacet(Ame)||(a=a.asSingle()),new Ea(t,s,a,t.dynamicSlots.map(()=>null),(u,f)=>f.create(u),null)}get tabSize(){return this.facet(Ea.tabSize)}get lineBreak(){return this.facet(Ea.lineSeparator)||`
|
|
`}get readOnly(){return this.facet(Mme)}phrase(e,...t){for(let s of this.facet(Ea.phrases))if(Object.prototype.hasOwnProperty.call(s,e)){e=s[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(s,a)=>{if(a=="$")return"$";let u=+(a||1);return!u||u>t.length?s:t[u-1]})),e}languageDataAt(e,t,s=-1){let a=[];for(let u of this.facet(Eme))for(let f of u(this,t,s))Object.prototype.hasOwnProperty.call(f,e)&&a.push(f[e]);return a}charCategorizer(e){return rke(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:s,length:a}=this.doc.lineAt(e),u=this.charCategorizer(e),f=e-s,h=e-s;for(;f>0;){let g=Dm(t,f,!1);if(u(t.slice(g,f))!=jc.Word)break;f=g}for(;h<a;){let g=Dm(t,h);if(u(t.slice(h,g))!=jc.Word)break;h=g}return f==h?null:Yn.range(f+s,h+s)}}Ea.allowMultipleSelections=Ame;Ea.tabSize=Ds.define({combine:r=>r.length?r[0]:4});Ea.lineSeparator=xme;Ea.readOnly=Mme;Ea.phrases=Ds.define({compare(r,e){let t=Object.keys(r),s=Object.keys(e);return t.length==s.length&&t.every(a=>r[a]==e[a])}});Ea.languageData=Eme;Ea.changeFilter=Tme;Ea.transactionFilter=Dme;Ea.transactionExtender=Ome;rO.reconfigure=Ii.define();function pv(r,e,t={}){let s={};for(let a of r)for(let u of Object.keys(a)){let f=a[u],h=s[u];if(h===void 0)s[u]=f;else if(!(h===f||f===void 0))if(Object.hasOwnProperty.call(t,u))s[u]=t[u](h,f);else throw new Error("Config merge conflict for field "+u)}for(let a in e)s[a]===void 0&&(s[a]=e[a]);return s}class Gx{eq(e){return this==e}range(e,t=e){return HP.create(e,t,this)}}Gx.prototype.startSide=Gx.prototype.endSide=0;Gx.prototype.point=!1;Gx.prototype.mapMode=Ag.TrackDel;class HP{constructor(e,t,s){this.from=e,this.to=t,this.value=s}static create(e,t,s){return new HP(e,t,s)}}function Mne(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}class Loe{constructor(e,t,s,a){this.from=e,this.to=t,this.value=s,this.maxPoint=a}get length(){return this.to[this.to.length-1]}findIndex(e,t,s,a=0){let u=s?this.to:this.from;for(let f=a,h=u.length;;){if(f==h)return f;let g=f+h>>1,v=u[g]-e||(s?this.value[g].endSide:this.value[g].startSide)-t;if(g==f)return v>=0?f:h;v>=0?h=g:f=g+1}}between(e,t,s,a){for(let u=this.findIndex(t,-1e9,!0),f=this.findIndex(s,1e9,!1,u);u<f;u++)if(a(this.from[u]+e,this.to[u]+e,this.value[u])===!1)return!1}map(e,t){let s=[],a=[],u=[],f=-1,h=-1;for(let g=0;g<this.value.length;g++){let v=this.value[g],_=this.from[g]+e,A=this.to[g]+e,O,N;if(_==A){let L=t.mapPos(_,v.startSide,v.mapMode);if(L==null||(O=N=L,v.startSide!=v.endSide&&(N=t.mapPos(_,v.endSide),N<O)))continue}else if(O=t.mapPos(_,v.startSide),N=t.mapPos(A,v.endSide),O>N||O==N&&v.startSide>0&&v.endSide<=0)continue;(N-O||v.endSide-v.startSide)<0||(f<0&&(f=O),v.point&&(h=Math.max(h,N-O)),s.push(v),a.push(O-f),u.push(N-f))}return{mapped:s.length?new Loe(a,u,s,h):null,pos:f}}}class Xa{constructor(e,t,s,a){this.chunkPos=e,this.chunk=t,this.nextLayer=s,this.maxPoint=a}static create(e,t,s,a){return new Xa(e,t,s,a)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:s=!1,filterFrom:a=0,filterTo:u=this.length}=e,f=e.filter;if(t.length==0&&!f)return this;if(s&&(t=t.slice().sort(Mne)),this.isEmpty)return t.length?Xa.of(t):this;let h=new Pme(this,null,-1).goto(0),g=0,v=[],_=new mk;for(;h.value||g<t.length;)if(g<t.length&&(h.from-t[g].from||h.startSide-t[g].value.startSide)>=0){let A=t[g++];_.addInner(A.from,A.to,A.value)||v.push(A)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(g==t.length||this.chunkEnd(h.chunkIndex)<t[g].from)&&(!f||a>this.chunkEnd(h.chunkIndex)||u<this.chunkPos[h.chunkIndex])&&_.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!f||a>h.to||u<h.from||f(h.from,h.to,h.value))&&(_.addInner(h.from,h.to,h.value)||v.push(HP.create(h.from,h.to,h.value))),h.next());return _.finishInner(this.nextLayer.isEmpty&&!v.length?Xa.empty:this.nextLayer.update({add:v,filter:f,filterFrom:a,filterTo:u}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],s=[],a=-1;for(let f=0;f<this.chunk.length;f++){let h=this.chunkPos[f],g=this.chunk[f],v=e.touchesRange(h,h+g.length);if(v===!1)a=Math.max(a,g.maxPoint),t.push(g),s.push(e.mapPos(h));else if(v===!0){let{mapped:_,pos:A}=g.map(h,e);_&&(a=Math.max(a,_.maxPoint),t.push(_),s.push(A))}}let u=this.nextLayer.map(e);return t.length==0?u:new Xa(s,t,u||Xa.empty,a)}between(e,t,s){if(!this.isEmpty){for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a];if(t>=u&&e<=u+f.length&&f.between(u,e-u,t-u,s)===!1)return}this.nextLayer.between(e,t,s)}}iter(e=0){return $P.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return $P.from(e).goto(t)}static compare(e,t,s,a,u=-1){let f=e.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=u),h=t.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=u),g=Oce(f,h,s),v=new lP(f,g,u),_=new lP(h,g,u);s.iterGaps((A,O,N)=>Mce(v,A,_,O,N,a)),s.empty&&s.length==0&&Mce(v,0,_,0,0,a)}static eq(e,t,s=0,a){a==null&&(a=1e9-1);let u=e.filter(_=>!_.isEmpty&&t.indexOf(_)<0),f=t.filter(_=>!_.isEmpty&&e.indexOf(_)<0);if(u.length!=f.length)return!1;if(!u.length)return!0;let h=Oce(u,f),g=new lP(u,h,0).goto(s),v=new lP(f,h,0).goto(s);for(;;){if(g.to!=v.to||!Rne(g.active,v.active)||g.point&&(!v.point||!g.point.eq(v.point)))return!1;if(g.to>a)return!0;g.next(),v.next()}}static spans(e,t,s,a,u=-1){let f=new lP(e,null,u).goto(t),h=t,g=f.openStart;for(;;){let v=Math.min(f.to,s);if(f.point){let _=f.activeForPoint(f.to),A=f.pointFrom<t?_.length+1:Math.min(_.length,g);a.point(h,v,f.point,_,A,f.pointRank),g=Math.min(f.openEnd(v),_.length)}else v>h&&(a.span(h,v,f.active,g),g=f.openEnd(v));if(f.to>s)return g+(f.point&&f.to>s?1:0);h=f.to,f.next()}}static of(e,t=!1){let s=new mk;for(let a of e instanceof HP?[e]:t?ike(e):e)s.add(a.from,a.to,a.value);return s.finish()}}Xa.empty=new Xa([],[],null,-1);function ike(r){if(r.length>1)for(let e=r[0],t=1;t<r.length;t++){let s=r[t];if(Mne(e,s)>0)return r.slice().sort(Mne);e=s}return r}Xa.empty.nextLayer=Xa.empty;class mk{finishChunk(e){this.chunks.push(new Loe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,s){this.addInner(e,t,s)||(this.nextLayer||(this.nextLayer=new mk)).add(e,t,s)}addInner(e,t,s){let a=e-this.lastTo||s.startSide-this.last.endSide;if(a<=0&&(e-this.lastFrom||s.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return a<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=s,this.lastFrom=e,this.lastTo=t,this.value.push(s),s.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let s=t.value.length-1;return this.last=t.value[s],this.lastFrom=t.from[s]+e,this.lastTo=t.to[s]+e,!0}finish(){return this.finishInner(Xa.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Xa.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oce(r,e,t){let s=new Map;for(let u of r)for(let f=0;f<u.chunk.length;f++)u.chunk[f].maxPoint<=0&&s.set(u.chunk[f],u.chunkPos[f]);let a=new Set;for(let u of e)for(let f=0;f<u.chunk.length;f++){let h=s.get(u.chunk[f]);h!=null&&(t?t.mapPos(h):h)==u.chunkPos[f]&&!(t!=null&&t.touchesRange(h,h+u.chunk[f].length))&&a.add(u.chunk[f])}return a}class Pme{constructor(e,t,s,a=0){this.layer=e,this.skip=t,this.minPoint=s,this.rank=a}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,s){for(;this.chunkIndex<this.layer.chunk.length;){let a=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(a)||this.layer.chunkEnd(this.chunkIndex)<e||a.maxPoint<this.minPoint))break;this.chunkIndex++,s=!1}if(this.chunkIndex<this.layer.chunk.length){let a=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!s||this.rangeIndex<a)&&this.setRangeIndex(a)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],s=e+t.from[this.rangeIndex];if(this.from=s,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class $P{constructor(e){this.heap=e}static from(e,t=null,s=-1){let a=[];for(let u=0;u<e.length;u++)for(let f=e[u];!f.isEmpty;f=f.nextLayer)f.maxPoint>=s&&a.push(new Pme(f,t,s,u));return a.length==1?a[0]:new $P(a)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let s of this.heap)s.goto(e,t);for(let s=this.heap.length>>1;s>=0;s--)Ate(this.heap,s);return this.next(),this}forward(e,t){for(let s of this.heap)s.forward(e,t);for(let s=this.heap.length>>1;s>=0;s--)Ate(this.heap,s);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ate(this.heap,0)}}}function Ate(r,e){for(let t=r[e];;){let s=(e<<1)+1;if(s>=r.length)break;let a=r[s];if(s+1<r.length&&a.compare(r[s+1])>=0&&(a=r[s+1],s++),t.compare(a)<0)break;r[s]=t,r[e]=a,e=s}}class lP{constructor(e,t,s){this.minPoint=s,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=$P.from(e,t,s)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Y$(this.active,e),Y$(this.activeTo,e),Y$(this.activeRank,e),this.minActive=Rce(this.active,this.activeTo)}addActive(e){let t=0,{value:s,to:a,rank:u}=this.cursor;for(;t<this.activeRank.length&&this.activeRank[t]<=u;)t++;X$(this.active,t,s),X$(this.activeTo,t,a),X$(this.activeRank,t,u),e&&X$(e,t,this.cursor.from),this.minActive=Rce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let s=this.openStart<0?[]:null;for(;;){let a=this.minActive;if(a>-1&&(this.activeTo[a]-this.cursor.from||this.active[a].endSide-this.cursor.startSide)<0){if(this.activeTo[a]>e){this.to=this.activeTo[a],this.endSide=this.active[a].endSide;break}this.removeActive(a),s&&Y$(s,a)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let u=this.cursor.value;if(!u.point)this.addActive(s),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=u,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=u.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(s){this.openStart=0;for(let a=s.length-1;a>=0&&s[a]<e;a--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let s=this.active.length-1;s>=0&&!(this.activeRank[s]<this.pointRank);s--)(this.activeTo[s]>e||this.activeTo[s]==e&&this.active[s].endSide>=this.point.endSide)&&t.push(this.active[s]);return t.reverse()}openEnd(e){let t=0;for(let s=this.activeTo.length-1;s>=0&&this.activeTo[s]>e;s--)t++;return t}}function Mce(r,e,t,s,a,u){r.goto(e),t.goto(s);let f=s+a,h=s,g=s-e;for(;;){let v=r.to+g-t.to||r.endSide-t.endSide,_=v<0?r.to+g:t.to,A=Math.min(_,f);if(r.point||t.point?r.point&&t.point&&(r.point==t.point||r.point.eq(t.point))&&Rne(r.activeForPoint(r.to),t.activeForPoint(t.to))||u.comparePoint(h,A,r.point,t.point):A>h&&!Rne(r.active,t.active)&&u.compareRange(h,A,r.active,t.active),_>f)break;h=_,v<=0&&r.next(),v>=0&&t.next()}}function Rne(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=e[t]&&!r[t].eq(e[t]))return!1;return!0}function Y$(r,e){for(let t=e,s=r.length-1;t<s;t++)r[t]=r[t+1];r.pop()}function X$(r,e,t){for(let s=r.length-1;s>=e;s--)r[s+1]=r[s];r[e]=t}function Rce(r,e){let t=-1,s=1e9;for(let a=0;a<e.length;a++)(e[a]-s||r[a].endSide-r[t].endSide)<0&&(t=a,s=e[a]);return t}function _O(r,e,t=r.length){let s=0;for(let a=0;a<t;)r.charCodeAt(a)==9?(s+=e-s%e,a++):(s++,a=Dm(r,a));return s}function Nne(r,e,t,s){for(let a=0,u=0;;){if(u>=e)return a;if(a==r.length)break;u+=r.charCodeAt(a)==9?t-u%t:1,a=Dm(r,a)}return s===!0?-1:r.length}const Pne="\u037C",Nce=typeof Symbol>"u"?"__"+Pne:Symbol.for(Pne),Ine=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Pce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class gk{constructor(e,t){this.rules=[];let{finish:s}=t||{};function a(f){return/^@/.test(f)?[f]:f.split(/,\s*/)}function u(f,h,g,v){let _=[],A=/^@(\w+)\b/.exec(f[0]),O=A&&A[1]=="keyframes";if(A&&h==null)return g.push(f[0]+";");for(let N in h){let L=h[N];if(/&/.test(N))u(N.split(/,\s*/).map(j=>f.map(z=>j.replace(/&/,z))).reduce((j,z)=>j.concat(z)),L,g);else if(L&&typeof L=="object"){if(!A)throw new RangeError("The value of a property ("+N+") should be a primitive value.");u(a(N),L,_,O)}else L!=null&&_.push(N.replace(/_.*/,"").replace(/[A-Z]/g,j=>"-"+j.toLowerCase())+": "+L+";")}(_.length||O)&&g.push((s&&!A&&!v?f.map(s):f).join(", ")+" {"+_.join(" ")+"}")}for(let f in e)u(a(f),e[f],this.rules)}getRules(){return this.rules.join(`
|
|
`)}static newName(){let e=Pce[Nce]||1;return Pce[Nce]=e+1,Pne+e.toString(36)}static mount(e,t,s){let a=e[Ine],u=s&&s.nonce;a?u&&a.setNonce(u):a=new ake(e,u),a.mount(Array.isArray(t)?t:[t])}}let Ice=new Map;class ake{constructor(e,t){let s=e.ownerDocument||e,a=s.defaultView;if(!e.head&&e.adoptedStyleSheets&&a.CSSStyleSheet){let u=Ice.get(s);if(u)return e.adoptedStyleSheets=[u.sheet,...e.adoptedStyleSheets],e[Ine]=u;this.sheet=new a.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ice.set(s,this)}else{this.styleTag=s.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let u=e.head||e;u.insertBefore(this.styleTag,u.firstChild)}this.modules=[],e[Ine]=this}mount(e){let t=this.sheet,s=0,a=0;for(let u=0;u<e.length;u++){let f=e[u],h=this.modules.indexOf(f);if(h<a&&h>-1&&(this.modules.splice(h,1),a--,h=-1),h==-1){if(this.modules.splice(a++,0,f),t)for(let g=0;g<f.rules.length;g++)t.insertRule(f.rules[g],s++)}else{for(;a<h;)s+=this.modules[a++].rules.length;s+=f.rules.length,a++}}if(!t){let u="";for(let f=0;f<this.modules.length;f++)u+=this.modules[f].getRules()+`
|
|
`;this.styleTag.textContent=u}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var pk={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:"'"},zP={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lke=typeof navigator<"u"&&/Mac/.test(navigator.platform),cke=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fh=0;Fh<10;Fh++)pk[48+Fh]=pk[96+Fh]=String(Fh);for(var Fh=1;Fh<=24;Fh++)pk[Fh+111]="F"+Fh;for(var Fh=65;Fh<=90;Fh++)pk[Fh]=String.fromCharCode(Fh+32),zP[Fh]=String.fromCharCode(Fh);for(var xte in pk)zP.hasOwnProperty(xte)||(zP[xte]=pk[xte]);function uke(r){var e=lke&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||cke&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?zP:pk)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function uV(r){let e;return r.nodeType==11?e=r.getSelection?r:r.ownerDocument:e=r,e.getSelection()}function Bne(r,e){return e?r==e||r.contains(e.nodeType!=1?e.parentNode:e):!1}function fke(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Fz(r,e){if(!e.anchorNode)return!1;try{return Bne(r,e.anchorNode)}catch{return!1}}function VP(r){return r.nodeType==3?Kx(r,0,r.nodeValue.length).getClientRects():r.nodeType==1?r.getClientRects():[]}function fV(r,e,t,s){return t?Bce(r,e,t,s,-1)||Bce(r,e,t,s,1):!1}function UP(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e}function Bce(r,e,t,s,a){for(;;){if(r==t&&e==s)return!0;if(e==(a<0?0:O_(r))){if(r.nodeName=="DIV")return!1;let u=r.parentNode;if(!u||u.nodeType!=1)return!1;e=UP(r)+(a<0?0:1),r=u}else if(r.nodeType==1){if(r=r.childNodes[e+(a<0?-1:0)],r.nodeType==1&&r.contentEditable=="false")return!1;e=a<0?O_(r):0}else return!1}}function O_(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Foe(r,e){let t=e?r.left:r.right;return{left:t,right:t,top:r.top,bottom:r.bottom}}function dke(r){return{left:0,right:r.innerWidth,top:0,bottom:r.innerHeight}}function hke(r,e,t,s,a,u,f,h){let g=r.ownerDocument,v=g.defaultView||window;for(let _=r,A=!1;_&&!A;)if(_.nodeType==1){let O,N=_==g.body,L=1,j=1;if(N)O=dke(v);else{if(/^(fixed|sticky)$/.test(getComputedStyle(_).position)&&(A=!0),_.scrollHeight<=_.clientHeight&&_.scrollWidth<=_.clientWidth){_=_.assignedSlot||_.parentNode;continue}let ee=_.getBoundingClientRect();L=ee.width/_.offsetWidth,j=ee.height/_.offsetHeight,O={left:ee.left,right:ee.left+_.clientWidth*L,top:ee.top,bottom:ee.top+_.clientHeight*j}}let z=0,q=0;if(a=="nearest")e.top<O.top?(q=-(O.top-e.top+f),t>0&&e.bottom>O.bottom+q&&(q=e.bottom-O.bottom+q+f)):e.bottom>O.bottom&&(q=e.bottom-O.bottom+f,t<0&&e.top-q<O.top&&(q=-(O.top+q-e.top+f)));else{let ee=e.bottom-e.top,F=O.bottom-O.top;q=(a=="center"&&ee<=F?e.top+ee/2-F/2:a=="start"||a=="center"&&t<0?e.top-f:e.bottom-F+f)-O.top}if(s=="nearest"?e.left<O.left?(z=-(O.left-e.left+u),t>0&&e.right>O.right+z&&(z=e.right-O.right+z+u)):e.right>O.right&&(z=e.right-O.right+u,t<0&&e.left<O.left+z&&(z=-(O.left+z-e.left+u))):z=(s=="center"?e.left+(e.right-e.left)/2-(O.right-O.left)/2:s=="start"==h?e.left-u:e.right-(O.right-O.left)+u)-O.left,z||q)if(N)v.scrollBy(z,q);else{let ee=0,F=0;if(q){let oe=_.scrollTop;_.scrollTop+=q/j,F=(_.scrollTop-oe)*j}if(z){let oe=_.scrollLeft;_.scrollLeft+=z/L,ee=(_.scrollLeft-oe)*L}e={left:e.left-ee,top:e.top-F,right:e.right-ee,bottom:e.bottom-F},ee&&Math.abs(ee-z)<1&&(s="nearest"),F&&Math.abs(F-q)<1&&(a="nearest")}if(N)break;_=_.assignedSlot||_.parentNode}else if(_.nodeType==11)_=_.host;else break}function mke(r){let e=r.ownerDocument;for(let t=r.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class gke{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:s}=e;this.set(t,Math.min(e.anchorOffset,t?O_(t):0),s,Math.min(e.focusOffset,s?O_(s):0))}set(e,t,s,a){this.anchorNode=e,this.anchorOffset=t,this.focusNode=s,this.focusOffset=a}}let MD=null;function Ime(r){if(r.setActive)return r.setActive();if(MD)return r.focus(MD);let e=[];for(let t=r;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(r.focus(MD==null?{get preventScroll(){return MD={preventScroll:!0},!0}}:void 0),!MD){MD=!1;for(let t=0;t<e.length;){let s=e[t++],a=e[t++],u=e[t++];s.scrollTop!=a&&(s.scrollTop=a),s.scrollLeft!=u&&(s.scrollLeft=u)}}}let Lce;function Kx(r,e,t=e){let s=Lce||(Lce=document.createRange());return s.setEnd(r,t),s.setStart(r,e),s}function QD(r,e,t){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0},a=new KeyboardEvent("keydown",s);a.synthetic=!0,r.dispatchEvent(a);let u=new KeyboardEvent("keyup",s);return u.synthetic=!0,r.dispatchEvent(u),a.defaultPrevented||u.defaultPrevented}function pke(r){for(;r;){if(r&&(r.nodeType==9||r.nodeType==11&&r.host))return r;r=r.assignedSlot||r.parentNode}return null}function Bme(r){for(;r.attributes.length;)r.removeAttributeNode(r.attributes[0])}function bke(r,e){let t=e.focusNode,s=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=s)return!1;for(s=Math.min(s,O_(t));;)if(s){if(t.nodeType!=1)return!1;let a=t.childNodes[s-1];a.contentEditable=="false"?s--:(t=a,s=O_(t))}else{if(t==r)return!0;s=UP(t),t=t.parentNode}}function Lme(r){return r.scrollTop>Math.max(1,r.scrollHeight-r.clientHeight-4)}class Tm{constructor(e,t,s=!0){this.node=e,this.offset=t,this.precise=s}static before(e,t){return new Tm(e.parentNode,UP(e),t)}static after(e,t){return new Tm(e.parentNode,UP(e)+1,t)}}const Hoe=[];class Tc{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let s of this.children){if(s==e)return t;t+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let s=this.dom,a=null,u;for(let f of this.children){if(f.flags&7){if(!f.dom&&(u=a?a.nextSibling:s.firstChild)){let h=Tc.get(u);(!h||!h.parent&&h.canReuseDOM(f))&&f.reuseDOM(u)}f.sync(e,t),f.flags&=-8}if(u=a?a.nextSibling:s.firstChild,t&&!t.written&&t.node==s&&u!=f.dom&&(t.written=!0),f.dom.parentNode==s)for(;u&&u!=f.dom;)u=Fce(u);else s.insertBefore(f.dom,u);a=f.dom}for(u=a?a.nextSibling:s.firstChild,u&&t&&t.node==s&&(t.written=!0);u;)u=Fce(u)}else if(this.flags&1)for(let s of this.children)s.flags&7&&(s.sync(e,t),s.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let s;if(e==this.dom)s=this.dom.childNodes[t];else{let a=O_(e)==0?0:t==0?-1:1;for(;;){let u=e.parentNode;if(u==this.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?s=e:s=e.nextSibling}if(s==this.dom.firstChild)return 0;for(;s&&!Tc.get(s);)s=s.nextSibling;if(!s)return this.length;for(let a=0,u=0;;a++){let f=this.children[a];if(f.dom==s)return u;u+=f.length+f.breakAfter}}domBoundsAround(e,t,s=0){let a=-1,u=-1,f=-1,h=-1;for(let g=0,v=s,_=s;g<this.children.length;g++){let A=this.children[g],O=v+A.length;if(v<e&&O>t)return A.domBoundsAround(e,t,v);if(O>=e&&a==-1&&(a=g,u=v),v>t&&A.dom.parentNode==this.dom){f=g,h=_;break}_=O,v=O+A.breakAfter}return{from:u,to:h<0?s+this.length:h,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:f<this.children.length&&f>=0?this.children[f].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,s=Hoe){this.markDirty();for(let a=e;a<t;a++){let u=this.children[a];u.parent==this&&u.destroy()}this.children.splice(e,t-e,...s);for(let a=0;a<s.length;a++)s[a].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Fme(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,s,a,u,f){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){this.parent=null}}Tc.prototype.breakAfter=0;function Fce(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Fme{constructor(e,t,s){this.children=e,this.pos=t,this.i=s,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let s=this.children[--this.i];this.pos-=s.length+s.breakAfter}}}function Hme(r,e,t,s,a,u,f,h,g){let{children:v}=r,_=v.length?v[e]:null,A=u.length?u[u.length-1]:null,O=A?A.breakAfter:f;if(!(e==s&&_&&!f&&!O&&u.length<2&&_.merge(t,a,u.length?A:null,t==0,h,g))){if(s<v.length){let N=v[s];N&&(a<N.length||N.breakAfter&&(A==null?void 0:A.breakAfter))?(e==s&&(N=N.split(a),a=0),!O&&A&&N.merge(0,a,A,!0,0,g)?u[u.length-1]=N:(a&&N.merge(0,a,null,!1,0,g),u.push(N))):N!=null&&N.breakAfter&&(A?A.breakAfter=1:f=1),s++}for(_&&(_.breakAfter=f,t>0&&(!f&&u.length&&_.merge(t,_.length,u[0],!1,h,0)?_.breakAfter=u.shift().breakAfter:(t<_.length||_.children.length&&_.children[_.children.length-1].length==0)&&_.merge(t,_.length,null,!1,h,0),e++));e<s&&u.length;)if(v[s-1].become(u[u.length-1]))s--,u.pop(),g=u.length?0:h;else if(v[e].become(u[0]))e++,u.shift(),h=u.length?0:g;else break;!u.length&&e&&s<v.length&&!v[e-1].breakAfter&&v[s].merge(0,0,v[e-1],!1,h,g)&&e--,(e<s||u.length)&&r.replaceChildren(e,s,u)}}function $me(r,e,t,s,a,u){let f=r.childCursor(),{i:h,off:g}=f.findPos(t,1),{i:v,off:_}=f.findPos(e,-1),A=e-t;for(let O of s)A+=O.length;r.length+=A,Hme(r,v,_,h,g,s,0,a,u)}let R1=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Lne=typeof document<"u"?document:{documentElement:{style:{}}};const Fne=/Edge\/(\d+)/.exec(R1.userAgent),zme=/MSIE \d/.test(R1.userAgent),Hne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(R1.userAgent),GV=!!(zme||Hne||Fne),Hce=!GV&&/gecko\/(\d+)/i.test(R1.userAgent),Tte=!GV&&/Chrome\/(\d+)/.exec(R1.userAgent),$ce="webkitFontSmoothing"in Lne.documentElement.style,Vme=!GV&&/Apple Computer/.test(R1.vendor),zce=Vme&&(/Mobile\/\w+/.test(R1.userAgent)||R1.maxTouchPoints>2);var Fs={mac:zce||/Mac/.test(R1.platform),windows:/Win/.test(R1.platform),linux:/Linux|X11/.test(R1.platform),ie:GV,ie_version:zme?Lne.documentMode||6:Hne?+Hne[1]:Fne?+Fne[1]:0,gecko:Hce,gecko_version:Hce?+(/Firefox\/(\d+)/.exec(R1.userAgent)||[0,0])[1]:0,chrome:!!Tte,chrome_version:Tte?+Tte[1]:0,ios:zce,android:/Android\b/.test(R1.userAgent),webkit:$ce,safari:Vme,webkit_version:$ce?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Lne.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const vke=256;class M_ extends Tc{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,s){return this.flags&8||s&&(!(s instanceof M_)||this.length-(t-e)+s.length>vke||s.flags&8)?!1:(this.text=this.text.slice(0,e)+(s?s.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new M_(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Tm(this.dom,e)}domBoundsAround(e,t,s){return{from:s,to:s+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return yke(this.dom,e,t)}}class R_ extends Tc{constructor(e,t=[],s=0){super(),this.mark=e,this.children=t,this.length=s;for(let a of t)a.setParent(this)}setAttrs(e){if(Bme(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,s,a,u,f){return s&&(!(s instanceof R_&&s.mark.eq(this.mark))||e&&u<=0||t<this.length&&f<=0)?!1:($me(this,e,t,s?s.children:[],u-1,f-1),this.markDirty(),!0)}split(e){let t=[],s=0,a=-1,u=0;for(let h of this.children){let g=s+h.length;g>e&&t.push(s<e?h.split(e-s):h),a<0&&s>=e&&(a=u),s=g,u++}let f=this.length-e;return this.length=e,a>-1&&(this.children.length=a,this.markDirty()),new R_(this.mark,t,f)}domAtPos(e){return Ume(this,e)}coordsAt(e,t){return jme(this,e,t)}}function yke(r,e,t){let s=r.nodeValue.length;e>s&&(e=s);let a=e,u=e,f=0;e==0&&t<0||e==s&&t>=0?Fs.chrome||Fs.gecko||(e?(a--,f=1):u<s&&(u++,f=-1)):t<0?a--:u<s&&u++;let h=Kx(r,a,u).getClientRects();if(!h.length)return null;let g=h[(f?f<0:t>=0)?0:h.length-1];return Fs.safari&&!f&&g.width==0&&(g=Array.prototype.find.call(h,v=>v.width)||g),f?Foe(g,f<0):g||null}class ak extends Tc{static create(e,t,s){return new ak(e,t,s)}constructor(e,t,s){super(),this.widget=e,this.length=t,this.side=s,this.prevWidget=null}split(e){let t=ak.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,s,a,u,f){return s&&(!(s instanceof ak)||!this.widget.compare(s.widget)||e>0&&u<=0||t<this.length&&f<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}become(e){return e instanceof ak&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return ul.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,s=t&&t.state.doc,a=this.posAtStart;return s?s.slice(a,a+this.length):ul.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Tm.before(this.dom):Tm.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let s=this.widget.coordsAt(this.dom,e,t);if(s)return s;let a=this.dom.getClientRects(),u=null;if(!a.length)return null;let f=this.side?this.side<0:e>0;for(let h=f?a.length-1:0;u=a[h],!(e>0?h==0:h==a.length-1||u.top<u.bottom);h+=f?-1:1);return Foe(u,!f)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class iO extends Tc{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof iO&&e.side==this.side}split(){return new iO(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Tm.before(this.dom):Tm.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ul.empty}get isHidden(){return!0}}M_.prototype.children=ak.prototype.children=iO.prototype.children=Hoe;function Ume(r,e){let t=r.dom,{children:s}=r,a=0;for(let u=0;a<s.length;a++){let f=s[a],h=u+f.length;if(!(h==u&&f.getSide()<=0)){if(e>u&&e<h&&f.dom.parentNode==t)return f.domAtPos(e-u);if(e<=u)break;u=h}}for(let u=a;u>0;u--){let f=s[u-1];if(f.dom.parentNode==t)return f.domAtPos(f.length)}for(let u=a;u<s.length;u++){let f=s[u];if(f.dom.parentNode==t)return f.domAtPos(0)}return new Tm(t,0)}function Wme(r,e,t){let s,{children:a}=r;t>0&&e instanceof R_&&a.length&&(s=a[a.length-1])instanceof R_&&s.mark.eq(e.mark)?Wme(s,e.children[0],t-1):(a.push(e),e.setParent(r)),r.length+=e.length}function jme(r,e,t){let s=null,a=-1,u=null,f=-1;function h(v,_){for(let A=0,O=0;A<v.children.length&&O<=_;A++){let N=v.children[A],L=O+N.length;L>=_&&(N.children.length?h(N,_-O):(!u||u.isHidden&&t>0)&&(L>_||O==L&&N.getSide()>0)?(u=N,f=_-O):(O<_||O==L&&N.getSide()<0&&!N.isHidden)&&(s=N,a=_-O)),O=L}}h(r,e);let g=(t<0?s:u)||s||u;return g?g.coordsAt(Math.max(0,g==s?a:f),t):wke(r)}function wke(r){let e=r.dom.lastChild;if(!e)return r.dom.getBoundingClientRect();let t=VP(e);return t[t.length-1]||null}function $ne(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}const Vce=Object.create(null);function $oe(r,e,t){if(r==e)return!0;r||(r=Vce),e||(e=Vce);let s=Object.keys(r),a=Object.keys(e);if(s.length-(t&&s.indexOf(t)>-1?1:0)!=a.length-(t&&a.indexOf(t)>-1?1:0))return!1;for(let u of s)if(u!=t&&(a.indexOf(u)==-1||r[u]!==e[u]))return!1;return!0}function zne(r,e,t){let s=!1;if(e)for(let a in e)t&&a in t||(s=!0,a=="style"?r.style.cssText="":r.removeAttribute(a));if(t)for(let a in t)e&&e[a]==t[a]||(s=!0,a=="style"?r.style.cssText=t[a]:r.setAttribute(a,t[a]));return s}function _ke(r){let e=Object.create(null);for(let t=0;t<r.attributes.length;t++){let s=r.attributes[t];e[s.name]=s.value}return e}class ld extends Tc{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,s,a,u,f){if(s){if(!(s instanceof ld))return!1;this.dom||s.transferDOM(this)}return a&&this.setDeco(s?s.attrs:null),$me(this,e,t,s?s.children:[],u,f),!0}split(e){let t=new ld;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:s,off:a}=this.childPos(e);a&&(t.append(this.children[s].split(a),0),this.children[s].merge(a,this.children[s].length,null,!1,0,0),s++);for(let u=s;u<this.children.length;u++)t.append(this.children[u],0);for(;s>0&&this.children[s-1].length==0;)this.children[--s].destroy();return this.children.length=s,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){$oe(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Wme(this,e,t)}addLineDeco(e){let t=e.spec.attributes,s=e.spec.class;t&&(this.attrs=$ne(t,this.attrs||{})),s&&(this.attrs=$ne({class:s},this.attrs||{}))}domAtPos(e){return Ume(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var s;this.dom?this.flags&4&&(Bme(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(zne(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let a=this.dom.lastChild;for(;a&&Tc.get(a)instanceof R_;)a=a.lastChild;if(!a||!this.length||a.nodeName!="BR"&&((s=Tc.get(a))===null||s===void 0?void 0:s.isEditable)==!1&&(!Fs.ios||!this.children.some(u=>u instanceof M_))){let u=document.createElement("BR");u.cmIgnore=!0,this.dom.appendChild(u)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let s of this.children){if(!(s instanceof M_)||/[^ -~]/.test(s.text))return null;let a=VP(s.dom);if(a.length!=1)return null;e+=a[0].width,t=a[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let s=jme(this,e,t);if(!this.children.length&&s&&this.parent){let{heightOracle:a}=this.parent.view.viewState,u=s.bottom-s.top;if(Math.abs(u-a.lineHeight)<2&&a.textHeight<u){let f=(u-a.textHeight)/2;return{top:s.top+f,bottom:s.bottom-f,left:s.left,right:s.left}}}return s}become(e){return!1}covers(){return!0}static find(e,t){for(let s=0,a=0;s<e.children.length;s++){let u=e.children[s],f=a+u.length;if(f>=t){if(u instanceof ld)return u;if(f>t)break}a=f+u.breakAfter}return null}}class jx extends Tc{constructor(e,t,s){super(),this.widget=e,this.length=t,this.deco=s,this.breakAfter=0,this.prevWidget=null}merge(e,t,s,a,u,f){return s&&(!(s instanceof jx)||!this.widget.compare(s.widget)||e>0&&u<=0||t<this.length&&f<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Tm.before(this.dom):Tm.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let s=new jx(this.widget,t,this.deco);return s.breakAfter=this.breakAfter,s}get children(){return Hoe}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):ul.empty}domBoundsAround(){return null}become(e){return e instanceof jx&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:s}=this.deco;return t==s?!1:e<0?t<0:s>0}}class Sk{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,s){return null}get isHidden(){return!1}destroy(e){}}var xg=function(r){return r[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r}(xg||(xg={}));class ti extends Gx{constructor(e,t,s,a){super(),this.startSide=e,this.endSide=t,this.widget=s,this.spec=a}get heightRelevant(){return!1}static mark(e){return new mI(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),s=!!e.block;return t+=s&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bk(e,t,t,s,e.widget||null,!1)}static replace(e){let t=!!e.block,s,a;if(e.isBlockGap)s=-5e8,a=4e8;else{let{start:u,end:f}=Zme(e,t);s=(u?t?-3e8:-1:5e8)-1,a=(f?t?2e8:1:-6e8)+1}return new bk(e,s,a,t,e.widget||null,!0)}static line(e){return new gI(e)}static set(e,t=!1){return Xa.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ti.none=Xa.empty;class mI extends ti{constructor(e){let{start:t,end:s}=Zme(e);super(t?-1:5e8,s?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,s;return this==e||e instanceof mI&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((s=e.attrs)===null||s===void 0?void 0:s.class))&&$oe(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}mI.prototype.point=!1;class gI extends ti{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gI&&this.spec.class==e.spec.class&&$oe(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}gI.prototype.mapMode=Ag.TrackBefore;gI.prototype.point=!0;class bk extends ti{constructor(e,t,s,a,u,f){super(t,s,u,e),this.block=a,this.isReplace=f,this.mapMode=a?t<=0?Ag.TrackBefore:Ag.TrackAfter:Ag.TrackDel}get type(){return this.startSide!=this.endSide?xg.WidgetRange:this.startSide<=0?xg.WidgetBefore:xg.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bk&&Cke(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bk.prototype.point=!0;function Zme(r,e=!1){let{inclusiveStart:t,inclusiveEnd:s}=r;return t==null&&(t=r.inclusive),s==null&&(s=r.inclusive),{start:t!=null?t:e,end:s!=null?s:e}}function Cke(r,e){return r==e||!!(r&&e&&r.compare(e))}function Vne(r,e,t,s=0){let a=t.length-1;a>=0&&t[a]+s>=r?t[a]=Math.max(t[a],e):t.push(r,e)}class MP{constructor(e,t,s,a){this.doc=e,this.pos=t,this.end=s,this.disallowBlockEffectsFor=a,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof jx&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ld),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(J$(new iO(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!e&&!this.posCovered()&&this.getLine()}buildText(e,t,s){for(;e>0;){if(this.textOff==this.text.length){let{value:u,lineBreak:f,done:h}=this.cursor.next(this.skip);if(this.skip=0,h)throw new Error("Ran out of text content when drawing inline views");if(f){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=u,this.textOff=0}let a=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-s)),this.getLine().append(J$(new M_(this.text.slice(this.textOff,this.textOff+a)),t),s),this.atCursorPos=!0,this.textOff+=a,e-=a,s=0}}span(e,t,s,a){this.buildText(t-e,s,a),this.pos=t,this.openStart<0&&(this.openStart=a)}point(e,t,s,a,u,f){if(this.disallowBlockEffectsFor[f]&&s instanceof bk){if(s.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let h=t-e;if(s instanceof bk)if(s.block)s.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new jx(s.widget||new Uce("div"),h,s));else{let g=ak.create(s.widget||new Uce("span"),h,h?0:s.startSide),v=this.atCursorPos&&!g.isEditable&&u<=a.length&&(e<t||s.startSide>0),_=!g.isEditable&&(e<t||u>a.length||s.startSide<=0),A=this.getLine();this.pendingBuffer==2&&!v&&!g.isEditable&&(this.pendingBuffer=0),this.flushBuffer(a),v&&(A.append(J$(new iO(1),a),u),u=a.length+Math.max(0,u-a.length)),A.append(J$(g,a),u),this.atCursorPos=_,this.pendingBuffer=_?e<t||u>a.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=a.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(s);h&&(this.textOff+h<=this.text.length?this.textOff+=h:(this.skip+=h-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=u)}static build(e,t,s,a,u){let f=new MP(e,t,s,u);return f.openEnd=Xa.spans(a,t,s,f),f.openStart<0&&(f.openStart=f.openEnd),f.finish(f.openEnd),f}}function J$(r,e){for(let t of e)r=new R_(t,[r],r.length);return r}class Uce extends Sk{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const qme=Ds.define(),Gme=Ds.define(),Kme=Ds.define(),Yme=Ds.define(),Une=Ds.define(),Xme=Ds.define(),Jme=Ds.define(),Qme=Ds.define({combine:r=>r.some(e=>e)}),ege=Ds.define({combine:r=>r.some(e=>e)});class dV{constructor(e,t="nearest",s="nearest",a=5,u=5){this.range=e,this.y=t,this.x=s,this.yMargin=a,this.xMargin=u}map(e){return e.empty?this:new dV(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Wce=Ii.define({map:(r,e)=>r.map(e)});function R0(r,e,t){let s=r.facet(Yme);s.length?s[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const KV=Ds.define({combine:r=>r.length?r[0]:!0});let Ske=0;const bP=Ds.define();class mf{constructor(e,t,s,a,u){this.id=e,this.create=t,this.domEventHandlers=s,this.domEventObservers=a,this.extension=u(this)}static define(e,t){const{eventHandlers:s,eventObservers:a,provide:u,decorations:f}=t||{};return new mf(Ske++,e,s,a,h=>{let g=[bP.of(h)];return f&&g.push(WP.of(v=>{let _=v.plugin(h);return _?f(_):ti.none})),u&&g.push(u(h)),g})}static fromClass(e,t){return mf.define(s=>new e(s),t)}}class Dte{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(s){if(R0(t.state,s,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){R0(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(s){R0(e.state,s,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const tge=Ds.define(),zoe=Ds.define(),WP=Ds.define(),Voe=Ds.define(),nge=Ds.define();function jce(r,e,t){let s=r.state.facet(nge);if(!s.length)return s;let a=s.map(f=>f instanceof Function?f(r):f),u=[];return Xa.spans(a,e,t,{point(){},span(f,h,g,v){let _=u;for(let A=g.length-1;A>=0;A--,v--){let O=g[A].spec.bidiIsolate,N;if(O!=null)if(v>0&&_.length&&(N=_[_.length-1]).to==f&&N.direction==O)N.to=h,_=N.inner;else{let L={from:f,to:h,direction:O,inner:[]};_.push(L),_=L.inner}}}}),u}const oge=Ds.define();function sge(r){let e=0,t=0,s=0,a=0;for(let u of r.state.facet(oge)){let f=u(r);f&&(f.left!=null&&(e=Math.max(e,f.left)),f.right!=null&&(t=Math.max(t,f.right)),f.top!=null&&(s=Math.max(s,f.top)),f.bottom!=null&&(a=Math.max(a,f.bottom)))}return{left:e,right:t,top:s,bottom:a}}const vP=Ds.define();class N0{constructor(e,t,s,a){this.fromA=e,this.toA=t,this.fromB=s,this.toB=a}join(e){return new N0(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,s=this;for(;t>0;t--){let a=e[t-1];if(!(a.fromA>s.toA)){if(a.toA<s.fromA)break;s=s.join(a),e.splice(t-1,1)}}return e.splice(t,0,s),e}static extendWithRanges(e,t){if(t.length==0)return e;let s=[];for(let a=0,u=0,f=0,h=0;;a++){let g=a==e.length?null:e[a],v=f-h,_=g?g.fromB:1e9;for(;u<t.length&&t[u]<_;){let A=t[u],O=t[u+1],N=Math.max(h,A),L=Math.min(_,O);if(N<=L&&new N0(N+v,L+v,N,L).addToSet(s),O>_)break;u+=2}if(!g)return s;new N0(g.fromA,g.toA,g.fromB,g.toB).addToSet(s),f=g.toA,h=g.toB}}}class hV{constructor(e,t,s){this.view=e,this.state=t,this.transactions=s,this.flags=0,this.startState=e.state,this.changes=ud.empty(this.startState.doc.length);for(let u of s)this.changes=this.changes.compose(u.changes);let a=[];this.changes.iterChangedRanges((u,f,h,g)=>a.push(new N0(u,f,h,g))),this.changedRanges=a}static create(e,t,s){return new hV(e,t,s)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var mu=function(r){return r[r.LTR=0]="LTR",r[r.RTL=1]="RTL",r}(mu||(mu={}));const jP=mu.LTR,rge=mu.RTL;function ige(r){let e=[];for(let t=0;t<r.length;t++)e.push(1<<+r[t]);return e}const kke=ige("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Eke=ige("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Wne=Object.create(null),jy=[];for(let r of["()","[]","{}"]){let e=r.charCodeAt(0),t=r.charCodeAt(1);Wne[e]=t,Wne[t]=-e}function Ake(r){return r<=247?kke[r]:1424<=r&&r<=1524?2:1536<=r&&r<=1785?Eke[r-1536]:1774<=r&&r<=2220?4:8192<=r&&r<=8203?256:64336<=r&&r<=65023?4:r==8204?256:1}const xke=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class lk{get dir(){return this.level%2?rge:jP}constructor(e,t,s){this.from=e,this.to=t,this.level=s}side(e,t){return this.dir==t==e?this.to:this.from}static find(e,t,s,a){let u=-1;for(let f=0;f<e.length;f++){let h=e[f];if(h.from<=t&&h.to>=t){if(h.level==s)return f;(u<0||(a!=0?a<0?h.from<t:h.to>t:e[u].level>h.level))&&(u=f)}}if(u<0)throw new RangeError("Index out of range");return u}}function age(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++){let s=r[t],a=e[t];if(s.from!=a.from||s.to!=a.to||s.direction!=a.direction||!age(s.inner,a.inner))return!1}return!0}const oc=[];function Tke(r,e,t,s,a){for(let u=0;u<=s.length;u++){let f=u?s[u-1].to:e,h=u<s.length?s[u].from:t,g=u?256:a;for(let v=f,_=g,A=g;v<h;v++){let O=Ake(r.charCodeAt(v));O==512?O=_:O==8&&A==4&&(O=16),oc[v]=O==4?2:O,O&7&&(A=O),_=O}for(let v=f,_=g,A=g;v<h;v++){let O=oc[v];if(O==128)v<h-1&&_==oc[v+1]&&_&24?O=oc[v]=_:oc[v]=256;else if(O==64){let N=v+1;for(;N<h&&oc[N]==64;)N++;let L=v&&_==8||N<t&&oc[N]==8?A==1?1:8:256;for(let j=v;j<N;j++)oc[j]=L;v=N-1}else O==8&&A==1&&(oc[v]=1);_=O,O&7&&(A=O)}}}function Dke(r,e,t,s,a){let u=a==1?2:1;for(let f=0,h=0,g=0;f<=s.length;f++){let v=f?s[f-1].to:e,_=f<s.length?s[f].from:t;for(let A=v,O,N,L;A<_;A++)if(N=Wne[O=r.charCodeAt(A)])if(N<0){for(let j=h-3;j>=0;j-=3)if(jy[j+1]==-N){let z=jy[j+2],q=z&2?a:z&4?z&1?u:a:0;q&&(oc[A]=oc[jy[j]]=q),h=j;break}}else{if(jy.length==189)break;jy[h++]=A,jy[h++]=O,jy[h++]=g}else if((L=oc[A])==2||L==1){let j=L==a;g=j?0:1;for(let z=h-3;z>=0;z-=3){let q=jy[z+2];if(q&2)break;if(j)jy[z+2]|=2;else{if(q&4)break;jy[z+2]|=4}}}}}function Oke(r,e,t,s){for(let a=0,u=s;a<=t.length;a++){let f=a?t[a-1].to:r,h=a<t.length?t[a].from:e;for(let g=f;g<h;){let v=oc[g];if(v==256){let _=g+1;for(;;)if(_==h){if(a==t.length)break;_=t[a++].to,h=a<t.length?t[a].from:e}else if(oc[_]==256)_++;else break;let A=u==1,O=(_<e?oc[_]:s)==1,N=A==O?A?1:2:s;for(let L=_,j=a,z=j?t[j-1].to:r;L>g;)L==z&&(L=t[--j].from,z=j?t[j-1].to:r),oc[--L]=N;g=_}else u=v,g++}}}function jne(r,e,t,s,a,u,f){let h=s%2?2:1;if(s%2==a%2)for(let g=e,v=0;g<t;){let _=!0,A=!1;if(v==u.length||g<u[v].from){let j=oc[g];j!=h&&(_=!1,A=j==16)}let O=!_&&h==1?[]:null,N=_?s:s+1,L=g;e:for(;;)if(v<u.length&&L==u[v].from){if(A)break e;let j=u[v];if(!_)for(let z=j.to,q=v+1;;){if(z==t)break e;if(q<u.length&&u[q].from==z)z=u[q++].to;else{if(oc[z]==h)break e;break}}if(v++,O)O.push(j);else{j.from>g&&f.push(new lk(g,j.from,N));let z=j.direction==jP!=!(N%2);Zne(r,z?s+1:s,a,j.inner,j.from,j.to,f),g=j.to}L=j.to}else{if(L==t||(_?oc[L]!=h:oc[L]==h))break;L++}O?jne(r,g,L,s+1,a,O,f):g<L&&f.push(new lk(g,L,N)),g=L}else for(let g=t,v=u.length;g>e;){let _=!0,A=!1;if(!v||g>u[v-1].to){let j=oc[g-1];j!=h&&(_=!1,A=j==16)}let O=!_&&h==1?[]:null,N=_?s:s+1,L=g;e:for(;;)if(v&&L==u[v-1].to){if(A)break e;let j=u[--v];if(!_)for(let z=j.from,q=v;;){if(z==e)break e;if(q&&u[q-1].to==z)z=u[--q].from;else{if(oc[z-1]==h)break e;break}}if(O)O.push(j);else{j.to<g&&f.push(new lk(j.to,g,N));let z=j.direction==jP!=!(N%2);Zne(r,z?s+1:s,a,j.inner,j.from,j.to,f),g=j.from}L=j.from}else{if(L==e||(_?oc[L-1]!=h:oc[L-1]==h))break;L--}O?jne(r,L,g,s+1,a,O,f):L<g&&f.push(new lk(L,g,N)),g=L}}function Zne(r,e,t,s,a,u,f){let h=e%2?2:1;Tke(r,a,u,s,h),Dke(r,a,u,s,h),Oke(a,u,s,h),jne(r,a,u,e,t,s,f)}function Mke(r,e,t){if(!r)return[new lk(0,0,e==rge?1:0)];if(e==jP&&!t.length&&!xke.test(r))return lge(r.length);if(t.length)for(;r.length>oc.length;)oc[oc.length]=256;let s=[],a=e==jP?0:1;return Zne(r,a,a,t,0,r.length,s),s}function lge(r){return[new lk(0,r,0)]}let cge="";function Rke(r,e,t,s,a){var u;let f=s.head-r.from,h=-1;if(f==0){if(!a||!r.length)return null;e[0].level!=t&&(f=e[0].side(!1,t),h=0)}else if(f==r.length){if(a)return null;let O=e[e.length-1];O.level!=t&&(f=O.side(!0,t),h=e.length-1)}h<0&&(h=lk.find(e,f,(u=s.bidiLevel)!==null&&u!==void 0?u:-1,s.assoc));let g=e[h];f==g.side(a,t)&&(g=e[h+=a?1:-1],f=g.side(!a,t));let v=a==(g.dir==t),_=Dm(r.text,f,v);if(cge=r.text.slice(Math.min(f,_),Math.max(f,_)),_!=g.side(a,t))return Yn.cursor(_+r.from,v?-1:1,g.level);let A=h==(a?e.length-1:0)?null:e[h+(a?1:-1)];return!A&&g.level!=t?Yn.cursor(a?r.to:r.from,a?-1:1,t):A&&A.level<g.level?Yn.cursor(A.side(!a,t)+r.from,a?1:-1,A.level):Yn.cursor(_+r.from,a?-1:1,g.level)}class Zce extends Tc{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ld],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new N0(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let s=e.changedRanges;this.minWidth>0&&s.length&&(s.every(({fromA:v,toA:_})=>_<this.minWidthFrom||v>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let a=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?a=this.domChanged.newSel.head:!Hke(e.changes,this.hasComposition)&&!e.selectionSet&&(a=e.state.selection.main.head));let u=a>-1?Pke(this.view,e.changes,a):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:v,to:_}=this.hasComposition;s=new N0(v,_,e.changes.mapPos(v,-1),e.changes.mapPos(_,1)).addToSet(s.slice())}this.hasComposition=u?{from:u.range.fromB,to:u.range.toB}:null,(Fs.ie||Fs.chrome)&&!u&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let f=this.decorations,h=this.updateDeco(),g=Lke(f,h,e.changes);return s=N0.extendWithRanges(s,g),!(this.flags&7)&&s.length==0?!1:(this.updateInner(s,e.startState.doc.length,u),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,s){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,s);let{observer:a}=this.view;a.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let f=Fs.chrome||Fs.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,f),this.flags&=-8,f&&(f.written||a.selectionRange.focusNode!=f.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(f=>f.flags&=-9);let u=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let f of this.children)f instanceof jx&&f.widget instanceof qce&&u.push(f.dom);a.updateGaps(u)}updateChildren(e,t,s){let a=s?s.range.addToSet(e.slice()):e,u=this.childCursor(t);for(let f=a.length-1;;f--){let h=f>=0?a[f]:null;if(!h)break;let{fromA:g,toA:v,fromB:_,toB:A}=h,O,N,L,j;if(s&&s.range.fromB<A&&s.range.toB>_){let oe=MP.build(this.view.state.doc,_,s.range.fromB,this.decorations,this.dynamicDecorationMap),te=MP.build(this.view.state.doc,s.range.toB,A,this.decorations,this.dynamicDecorationMap);N=oe.breakAtStart,L=oe.openStart,j=te.openEnd;let se=this.compositionView(s);te.breakAtStart?se.breakAfter=1:te.content.length&&se.merge(se.length,se.length,te.content[0],!1,te.openStart,0)&&(se.breakAfter=te.content[0].breakAfter,te.content.shift()),oe.content.length&&se.merge(0,0,oe.content[oe.content.length-1],!0,0,oe.openEnd)&&oe.content.pop(),O=oe.content.concat(se).concat(te.content)}else({content:O,breakAtStart:N,openStart:L,openEnd:j}=MP.build(this.view.state.doc,_,A,this.decorations,this.dynamicDecorationMap));let{i:z,off:q}=u.findPos(v,1),{i:ee,off:F}=u.findPos(g,-1);Hme(this,ee,F,z,q,O,N,L,j)}s&&this.fixCompositionDOM(s)}compositionView(e){let t=new M_(e.text.nodeValue);t.flags|=8;for(let{deco:a}of e.marks)t=new R_(a,[t],t.length);let s=new ld;return s.append(t,0),s}fixCompositionDOM(e){let t=(u,f)=>{f.flags|=8|(f.children.some(g=>g.flags&7)?1:0),this.markedForComposition.add(f);let h=Tc.get(u);h&&h!=f&&(h.dom=null),f.setDOM(u)},s=this.childPos(e.range.fromB,1),a=this.children[s.i];t(e.line,a);for(let u=e.marks.length-1;u>=-1;u--)s=a.childPos(s.off,1),a=a.children[s.i],t(u>=0?e.marks[u].node:e.text,a)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let s=this.view.root.activeElement,a=s==this.dom,u=!a&&Fz(this.dom,this.view.observer.selectionRange)&&!(s&&this.dom.contains(s));if(!(a||t||u))return;let f=this.forceSelection;this.forceSelection=!1;let h=this.view.state.selection.main,g=this.moveToLine(this.domAtPos(h.anchor)),v=h.empty?g:this.moveToLine(this.domAtPos(h.head));if(Fs.gecko&&h.empty&&!this.hasComposition&&Nke(g)){let A=document.createTextNode("");this.view.observer.ignore(()=>g.node.insertBefore(A,g.node.childNodes[g.offset]||null)),g=v=new Tm(A,0),f=!0}let _=this.view.observer.selectionRange;(f||!_.focusNode||!fV(g.node,g.offset,_.anchorNode,_.anchorOffset)||!fV(v.node,v.offset,_.focusNode,_.focusOffset))&&(this.view.observer.ignore(()=>{Fs.android&&Fs.chrome&&this.dom.contains(_.focusNode)&&Fke(_.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let A=uV(this.view.root);if(A)if(h.empty){if(Fs.gecko){let O=Ike(g.node,g.offset);if(O&&O!=3){let N=fge(g.node,g.offset,O==1?1:-1);N&&(g=new Tm(N.node,N.offset))}}A.collapse(g.node,g.offset),h.bidiLevel!=null&&A.caretBidiLevel!==void 0&&(A.caretBidiLevel=h.bidiLevel)}else if(A.extend){A.collapse(g.node,g.offset);try{A.extend(v.node,v.offset)}catch{}}else{let O=document.createRange();h.anchor>h.head&&([g,v]=[v,g]),O.setEnd(v.node,v.offset),O.setStart(g.node,g.offset),A.removeAllRanges(),A.addRange(O)}u&&this.view.root.activeElement==this.dom&&(this.dom.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(g,v)),this.impreciseAnchor=g.precise?null:new Tm(_.anchorNode,_.anchorOffset),this.impreciseHead=v.precise?null:new Tm(_.focusNode,_.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,s=uV(e.root),{anchorNode:a,anchorOffset:u}=e.observer.selectionRange;if(!s||!t.empty||!t.assoc||!s.modify)return;let f=ld.find(this,t.head);if(!f)return;let h=f.posAtStart;if(t.head==h||t.head==h+f.length)return;let g=this.coordsAt(t.head,-1),v=this.coordsAt(t.head,1);if(!g||!v||g.bottom>v.top)return;let _=this.domAtPos(t.head+t.assoc);s.collapse(_.node,_.offset),s.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let A=e.observer.selectionRange;e.docView.posFromDOM(A.anchorNode,A.anchorOffset)!=t.from&&s.collapse(a,u)}moveToLine(e){let t=this.dom,s;if(e.node!=t)return e;for(let a=e.offset;!s&&a<t.childNodes.length;a++){let u=Tc.get(t.childNodes[a]);u instanceof ld&&(s=u.domAtPos(0))}for(let a=e.offset-1;!s&&a>=0;a--){let u=Tc.get(t.childNodes[a]);u instanceof ld&&(s=u.domAtPos(u.length))}return s?new Tm(s.node,s.offset,!0):e}nearest(e){for(let t=e;t;){let s=Tc.get(t);if(s&&s.rootView==this)return s;t=t.parentNode}return null}posFromDOM(e,t){let s=this.nearest(e);if(!s)throw new RangeError("Trying to find position for a DOM position outside of the document");return s.localPosFromDOM(e,t)+s.posAtStart}domAtPos(e){let{i:t,off:s}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let a=this.children[t];if(s<a.length||a instanceof ld)break;t++,s=0}return this.children[t].domAtPos(s)}coordsAt(e,t){let s=null,a=0;for(let u=this.length,f=this.children.length-1;f>=0;f--){let h=this.children[f],g=u-h.breakAfter,v=g-h.length;if(g<e)break;v<=e&&(v<e||h.covers(-1))&&(g>e||h.covers(1))&&(!s||h instanceof ld&&!(s instanceof ld&&t>=0))&&(s=h,a=v),u=v}return s?s.coordsAt(e-a,t):null}coordsForChar(e){let{i:t,off:s}=this.childPos(e,1),a=this.children[t];if(!(a instanceof ld))return null;for(;a.children.length;){let{i:h,off:g}=a.childPos(s,1);for(;;h++){if(h==a.children.length)return null;if((a=a.children[h]).length)break}s=g}if(!(a instanceof M_))return null;let u=Dm(a.text,s);if(u==s)return null;let f=Kx(a.dom,s,u).getClientRects();return!f.length||f[0].top>=f[0].bottom?null:f[0]}measureVisibleLineHeights(e){let t=[],{from:s,to:a}=e,u=this.view.contentDOM.clientWidth,f=u>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,h=-1,g=this.view.textDirection==mu.LTR;for(let v=0,_=0;_<this.children.length;_++){let A=this.children[_],O=v+A.length;if(O>a)break;if(v>=s){let N=A.dom.getBoundingClientRect();if(t.push(N.height),f){let L=A.dom.lastChild,j=L?VP(L):[];if(j.length){let z=j[j.length-1],q=g?z.right-N.left:N.right-z.left;q>h&&(h=q,this.minWidth=u,this.minWidthFrom=v,this.minWidthTo=O)}}}v=O+A.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?mu.RTL:mu.LTR}measureTextSize(){for(let u of this.children)if(u instanceof ld){let f=u.measureTextSize();if(f)return f}let e=document.createElement("div"),t,s,a;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let u=VP(e.firstChild)[0];t=e.getBoundingClientRect().height,s=u?u.width/27:7,a=u?u.height:t,e.remove()}),{lineHeight:t,charWidth:s,textHeight:a}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Fme(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let s=0,a=0;;a++){let u=a==t.viewports.length?null:t.viewports[a],f=u?u.from-1:this.length;if(f>s){let h=(t.lineBlockAt(f).bottom-t.lineBlockAt(s).top)/this.view.scaleY;e.push(ti.replace({widget:new qce(h),block:!0,inclusive:!0,isBlockGap:!0}).range(s,f))}if(!u)break;s=u.to+1}return ti.set(e)}updateDeco(){let e=this.view.state.facet(WP).map((t,s)=>(this.dynamicDecorationMap[s]=typeof t=="function")?t(this.view):t);for(let t=e.length;t<e.length+3;t++)this.dynamicDecorationMap[t]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){let{range:t}=e,s=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),a;if(!s)return;!t.empty&&(a=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(s={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top),right:Math.max(s.right,a.right),bottom:Math.max(s.bottom,a.bottom)});let u=sge(this.view),f={left:s.left-u.left,top:s.top-u.top,right:s.right+u.right,bottom:s.bottom+u.bottom};hke(this.view.scrollDOM,f,t.head<t.anchor?-1:1,e.x,e.y,e.xMargin,e.yMargin,this.view.textDirection==mu.LTR)}}function Nke(r){return r.node.nodeType==1&&r.node.firstChild&&(r.offset==0||r.node.childNodes[r.offset-1].contentEditable=="false")&&(r.offset==r.node.childNodes.length||r.node.childNodes[r.offset].contentEditable=="false")}class qce extends Sk{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}function uge(r,e){let t=r.observer.selectionRange,s=t.focusNode&&fge(t.focusNode,t.focusOffset,0);if(!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function Pke(r,e,t){let s=uge(r,t);if(!s)return null;let{node:a,from:u,to:f}=s,h=a.nodeValue;if(/[\n\r]/.test(h)||r.state.doc.sliceString(s.from,s.to)!=h)return null;let g=e.invertedDesc,v=new N0(g.mapPos(u),g.mapPos(f),u,f),_=[];for(let A=a.parentNode;;A=A.parentNode){let O=Tc.get(A);if(O instanceof R_)_.push({node:A,deco:O.mark});else{if(O instanceof ld||A.nodeName=="DIV"&&A.parentNode==r.contentDOM)return{range:v,text:a,marks:_,line:A};if(A!=r.contentDOM)_.push({node:A,deco:new mI({inclusive:!0,attributes:_ke(A),tagName:A.tagName.toLowerCase()})});else return null}}}function fge(r,e,t){if(t<=0)for(let s=r,a=e;;){if(s.nodeType==3)return{node:s,offset:a};if(s.nodeType==1&&a>0)s=s.childNodes[a-1],a=O_(s);else break}if(t>=0)for(let s=r,a=e;;){if(s.nodeType==3)return{node:s,offset:a};if(s.nodeType==1&&a<s.childNodes.length&&t>=0)s=s.childNodes[a],a=0;else break}return null}function Ike(r,e){return r.nodeType!=1?0:(e&&r.childNodes[e-1].contentEditable=="false"?1:0)|(e<r.childNodes.length&&r.childNodes[e].contentEditable=="false"?2:0)}let Bke=class{constructor(){this.changes=[]}compareRange(e,t){Vne(e,t,this.changes)}comparePoint(e,t){Vne(e,t,this.changes)}};function Lke(r,e,t){let s=new Bke;return Xa.compare(r,e,t,s),s.changes}function Fke(r,e){for(let t=r;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Hke(r,e){let t=!1;return e&&r.iterChangedRanges((s,a)=>{s<e.to&&a>e.from&&(t=!0)}),t}function $ke(r,e,t=1){let s=r.charCategorizer(e),a=r.doc.lineAt(e),u=e-a.from;if(a.length==0)return Yn.cursor(e);u==0?t=1:u==a.length&&(t=-1);let f=u,h=u;t<0?f=Dm(a.text,u,!1):h=Dm(a.text,u);let g=s(a.text.slice(f,h));for(;f>0;){let v=Dm(a.text,f,!1);if(s(a.text.slice(v,f))!=g)break;f=v}for(;h<a.length;){let v=Dm(a.text,h);if(s(a.text.slice(h,v))!=g)break;h=v}return Yn.range(f+a.from,h+a.from)}function zke(r,e){return e.left>r?e.left-r:Math.max(0,r-e.right)}function Vke(r,e){return e.top>r?e.top-r:Math.max(0,r-e.bottom)}function Ote(r,e){return r.top<e.bottom-1&&r.bottom>e.top+1}function Gce(r,e){return e<r.top?{top:e,left:r.left,right:r.right,bottom:r.bottom}:r}function Kce(r,e){return e>r.bottom?{top:r.top,left:r.left,right:r.right,bottom:e}:r}function qne(r,e,t){let s,a,u,f,h=!1,g,v,_,A;for(let L=r.firstChild;L;L=L.nextSibling){let j=VP(L);for(let z=0;z<j.length;z++){let q=j[z];a&&Ote(a,q)&&(q=Gce(Kce(q,a.bottom),a.top));let ee=zke(e,q),F=Vke(t,q);if(ee==0&&F==0)return L.nodeType==3?Yce(L,e,t):qne(L,e,t);if(!s||f>F||f==F&&u>ee){s=L,a=q,u=ee,f=F;let oe=F?t<q.top?-1:1:ee?e<q.left?-1:1:0;h=!oe||(oe>0?z<j.length-1:z>0)}ee==0?t>q.bottom&&(!_||_.bottom<q.bottom)?(g=L,_=q):t<q.top&&(!A||A.top>q.top)&&(v=L,A=q):_&&Ote(_,q)?_=Kce(_,q.bottom):A&&Ote(A,q)&&(A=Gce(A,q.top))}}if(_&&_.bottom>=t?(s=g,a=_):A&&A.top<=t&&(s=v,a=A),!s)return{node:r,offset:0};let O=Math.max(a.left,Math.min(a.right,e));if(s.nodeType==3)return Yce(s,O,t);if(h&&s.contentEditable!="false")return qne(s,O,t);let N=Array.prototype.indexOf.call(r.childNodes,s)+(e>=(a.left+a.right)/2?1:0);return{node:r,offset:N}}function Yce(r,e,t){let s=r.nodeValue.length,a=-1,u=1e9,f=0;for(let h=0;h<s;h++){let g=Kx(r,h,h+1).getClientRects();for(let v=0;v<g.length;v++){let _=g[v];if(_.top==_.bottom)continue;f||(f=e-_.left);let A=(_.top>t?_.top-t:t-_.bottom)-1;if(_.left-1<=e&&_.right+1>=e&&A<u){let O=e>=(_.left+_.right)/2,N=O;if((Fs.chrome||Fs.gecko)&&Kx(r,h).getBoundingClientRect().left==_.right&&(N=!O),A<=0)return{node:r,offset:h+(N?1:0)};a=h+(N?1:0),u=A}}}return{node:r,offset:a>-1?a:f>0?r.nodeValue.length:0}}function dge(r,e,t,s=-1){var a,u;let f=r.contentDOM.getBoundingClientRect(),h=f.top+r.viewState.paddingTop,g,{docHeight:v}=r.viewState,{x:_,y:A}=e,O=A-h;if(O<0)return 0;if(O>v)return r.state.doc.length;for(let oe=r.viewState.heightOracle.textHeight/2,te=!1;g=r.elementAtHeight(O),g.type!=xg.Text;)for(;O=s>0?g.bottom+oe:g.top-oe,!(O>=0&&O<=v);){if(te)return t?null:0;te=!0,s=-s}A=h+O;let N=g.from;if(N<r.viewport.from)return r.viewport.from==0?0:t?null:Xce(r,f,g,_,A);if(N>r.viewport.to)return r.viewport.to==r.state.doc.length?r.state.doc.length:t?null:Xce(r,f,g,_,A);let L=r.dom.ownerDocument,j=r.root.elementFromPoint?r.root:L,z=j.elementFromPoint(_,A);z&&!r.contentDOM.contains(z)&&(z=null),z||(_=Math.max(f.left+1,Math.min(f.right-1,_)),z=j.elementFromPoint(_,A),z&&!r.contentDOM.contains(z)&&(z=null));let q,ee=-1;if(z&&((a=r.docView.nearest(z))===null||a===void 0?void 0:a.isEditable)!=!1){if(L.caretPositionFromPoint){let oe=L.caretPositionFromPoint(_,A);oe&&({offsetNode:q,offset:ee}=oe)}else if(L.caretRangeFromPoint){let oe=L.caretRangeFromPoint(_,A);oe&&({startContainer:q,startOffset:ee}=oe,(!r.contentDOM.contains(q)||Fs.safari&&Uke(q,ee,_)||Fs.chrome&&Wke(q,ee,_))&&(q=void 0))}}if(!q||!r.docView.dom.contains(q)){let oe=ld.find(r.docView,N);if(!oe)return O>g.top+g.height/2?g.to:g.from;({node:q,offset:ee}=qne(oe.dom,_,A))}let F=r.docView.nearest(q);if(!F)return null;if(F.isWidget&&((u=F.dom)===null||u===void 0?void 0:u.nodeType)==1){let oe=F.dom.getBoundingClientRect();return e.y<oe.top||e.y<=oe.bottom&&e.x<=(oe.left+oe.right)/2?F.posAtStart:F.posAtEnd}else return F.localPosFromDOM(q,ee)+F.posAtStart}function Xce(r,e,t,s,a){let u=Math.round((s-e.left)*r.defaultCharacterWidth);if(r.lineWrapping&&t.height>r.defaultLineHeight*1.5){let h=r.viewState.heightOracle.textHeight,g=Math.floor((a-t.top-(r.defaultLineHeight-h)*.5)/h);u+=g*r.viewState.heightOracle.lineLength}let f=r.state.sliceDoc(t.from,t.to);return t.from+Nne(f,u,r.state.tabSize)}function Uke(r,e,t){let s;if(r.nodeType!=3||e!=(s=r.nodeValue.length))return!1;for(let a=r.nextSibling;a;a=a.nextSibling)if(a.nodeType!=1||a.nodeName!="BR")return!1;return Kx(r,s-1,s).getBoundingClientRect().left>t}function Wke(r,e,t){if(e!=0)return!1;for(let a=r;;){let u=a.parentNode;if(!u||u.nodeType!=1||u.firstChild!=a)return!1;if(u.classList.contains("cm-line"))break;a=u}let s=r.nodeType==1?r.getBoundingClientRect():Kx(r,0,Math.max(r.nodeValue.length,1)).getBoundingClientRect();return t-s.left>5}function Gne(r,e){let t=r.lineBlockAt(e);if(Array.isArray(t.type)){for(let s of t.type)if(s.to>e||s.to==e&&(s.to==t.to||s.type==xg.Text))return s}return t}function jke(r,e,t,s){let a=Gne(r,e.head),u=!s||a.type!=xg.Text||!(r.lineWrapping||a.widgetLineBreaks)?null:r.coordsAtPos(e.assoc<0&&e.head>a.from?e.head-1:e.head);if(u){let f=r.dom.getBoundingClientRect(),h=r.textDirectionAt(a.from),g=r.posAtCoords({x:t==(h==mu.LTR)?f.right-1:f.left+1,y:(u.top+u.bottom)/2});if(g!=null)return Yn.cursor(g,t?-1:1)}return Yn.cursor(t?a.to:a.from,t?-1:1)}function Jce(r,e,t,s){let a=r.state.doc.lineAt(e.head),u=r.bidiSpans(a),f=r.textDirectionAt(a.from);for(let h=e,g=null;;){let v=Rke(a,u,f,h,t),_=cge;if(!v){if(a.number==(t?r.state.doc.lines:1))return h;_=`
|
|
`,a=r.state.doc.line(a.number+(t?1:-1)),u=r.bidiSpans(a),v=Yn.cursor(t?a.from:a.to)}if(g){if(!g(_))return h}else{if(!s)return v;g=s(_)}h=v}}function Zke(r,e,t){let s=r.state.charCategorizer(e),a=s(t);return u=>{let f=s(u);return a==jc.Space&&(a=f),a==f}}function qke(r,e,t,s){let a=e.head,u=t?1:-1;if(a==(t?r.state.doc.length:0))return Yn.cursor(a,e.assoc);let f=e.goalColumn,h,g=r.contentDOM.getBoundingClientRect(),v=r.coordsAtPos(a,e.assoc||-1),_=r.documentTop;if(v)f==null&&(f=v.left-g.left),h=u<0?v.top:v.bottom;else{let N=r.viewState.lineBlockAt(a);f==null&&(f=Math.min(g.right-g.left,r.defaultCharacterWidth*(a-N.from))),h=(u<0?N.top:N.bottom)+_}let A=g.left+f,O=s!=null?s:r.viewState.heightOracle.textHeight>>1;for(let N=0;;N+=10){let L=h+(O+N)*u,j=dge(r,{x:A,y:L},!1,u);if(L<g.top||L>g.bottom||(u<0?j<a:j>a)){let z=r.docView.coordsForChar(j),q=!z||L<z.top?-1:1;return Yn.cursor(j,q,void 0,f)}}}function Hz(r,e,t){for(;;){let s=0;for(let a of r)a.between(e-1,e+1,(u,f,h)=>{if(e>u&&e<f){let g=s||t||(e-u<f-e?-1:1);e=g<0?u:f,s=g}});if(!s)return e}}function Mte(r,e,t){let s=Hz(r.state.facet(Voe).map(a=>a(r)),t.from,e.head>t.from?-1:1);return s==t.from?t:Yn.cursor(s,s<t.from?1:-1)}class Gke{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.handleEvent=this.handleEvent.bind(this),e.scrollDOM.addEventListener("mousedown",t=>{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,Fs.safari&&e.contentDOM.addEventListener("input",()=>null),Fs.gecko&&uEe(e.contentDOM.ownerDocument)}handleEvent(e){!nEe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let s=this.handlers[e];if(s){for(let a of s.observers)a(this.view,t);for(let a of s.handlers){if(t.defaultPrevented)break;if(a(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Kke(e),s=this.handlers,a=this.view.contentDOM;for(let u in t)if(u!="scroll"){let f=!t[u].handlers.length,h=s[u];h&&f!=!h.handlers.length&&(a.removeEventListener(u,this.handleEvent),h=null),h||a.addEventListener(u,this.handleEvent,{passive:f})}for(let u in s)u!="scroll"&&!t[u]&&a.removeEventListener(u,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&mge.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),Fs.android&&Fs.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Fs.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=hge.find(s=>s.keyCode==e.keyCode))&&!e.ctrlKey||Yke.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,QD(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Fs.safari&&!Fs.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Qce(r,e){return(t,s)=>{try{return e.call(r,s,t)}catch(a){R0(t.state,a)}}}function Kke(r){let e=Object.create(null);function t(s){return e[s]||(e[s]={observers:[],handlers:[]})}for(let s of r){let a=s.spec;if(a&&a.domEventHandlers)for(let u in a.domEventHandlers){let f=a.domEventHandlers[u];f&&t(u).handlers.push(Qce(s.value,f))}if(a&&a.domEventObservers)for(let u in a.domEventObservers){let f=a.domEventObservers[u];f&&t(u).observers.push(Qce(s.value,f))}}for(let s in l2)t(s).handlers.push(l2[s]);for(let s in mv)t(s).observers.push(mv[s]);return e}const hge=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Yke="dthko",mge=[16,17,18,20,91,92,224,225],Q$=6;function ez(r){return Math.max(0,r)*.7+8}function Xke(r,e){return Math.max(Math.abs(r.clientX-e.clientX),Math.abs(r.clientY-e.clientY))}class Jke{constructor(e,t,s,a){this.view=e,this.startEvent=t,this.style=s,this.mustSelect=a,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=mke(e.contentDOM),this.atoms=e.state.facet(Voe).map(f=>f(e));let u=e.contentDOM.ownerDocument;u.addEventListener("mousemove",this.move=this.move.bind(this)),u.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ea.allowMultipleSelections)&&Qke(e,t),this.dragging=tEe(e,t)&&vge(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Xke(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let s=0,a=0,u=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},f=sge(this.view);e.clientX-f.left<=u.left+Q$?s=-ez(u.left-e.clientX):e.clientX+f.right>=u.right-Q$&&(s=ez(e.clientX-u.right)),e.clientY-f.top<=u.top+Q$?a=-ez(u.top-e.clientY):e.clientY+f.bottom>=u.bottom-Q$&&(a=ez(e.clientY-u.bottom)),this.setScrollSpeed(s,a)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let s=0;s<e.ranges.length;s++){let a=e.ranges[s],u=null;if(a.empty){let f=Hz(this.atoms,a.from,0);f!=a.from&&(u=Yn.cursor(f,-1))}else{let f=Hz(this.atoms,a.from,-1),h=Hz(this.atoms,a.to,1);(f!=a.from||h!=a.to)&&(u=Yn.range(a.from==a.anchor?f:h,a.from==a.head?f:h))}u&&(t||(t=e.ranges.slice()),t[s]=u)}return t?Yn.create(t,e.mainIndex):e}select(e){let{view:t}=this,s=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!s.eq(t.state.selection)||s.main.assoc!=t.state.selection.main.assoc&&this.dragging===!1)&&this.view.dispatch({selection:s,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Qke(r,e){let t=r.state.facet(qme);return t.length?t[0](e):Fs.mac?e.metaKey:e.ctrlKey}function eEe(r,e){let t=r.state.facet(Gme);return t.length?t[0](e):Fs.mac?!e.altKey:!e.ctrlKey}function tEe(r,e){let{main:t}=r.state.selection;if(t.empty)return!1;let s=uV(r.root);if(!s||s.rangeCount==0)return!0;let a=s.getRangeAt(0).getClientRects();for(let u=0;u<a.length;u++){let f=a[u];if(f.left<=e.clientX&&f.right>=e.clientX&&f.top<=e.clientY&&f.bottom>=e.clientY)return!0}return!1}function nEe(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,s;t!=r.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(s=Tc.get(t))&&s.ignoreEvent(e))return!1;return!0}const l2=Object.create(null),mv=Object.create(null),gge=Fs.ie&&Fs.ie_version<15||Fs.ios&&Fs.webkit_version<604;function oEe(r){let e=r.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{r.focus(),t.remove(),pge(r,t.value)},50)}function pge(r,e){let{state:t}=r,s,a=1,u=t.toText(e),f=u.lines==t.selection.ranges.length;if(Kne!=null&&t.selection.ranges.every(g=>g.empty)&&Kne==u.toString()){let g=-1;s=t.changeByRange(v=>{let _=t.doc.lineAt(v.from);if(_.from==g)return{range:v};g=_.from;let A=t.toText((f?u.line(a++).text:e)+t.lineBreak);return{changes:{from:_.from,insert:A},range:Yn.cursor(v.from+A.length)}})}else f?s=t.changeByRange(g=>{let v=u.line(a++);return{changes:{from:g.from,to:g.to,insert:v.text},range:Yn.cursor(g.from+v.length)}}):s=t.replaceSelection(u);r.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}mv.scroll=r=>{r.inputState.lastScrollTop=r.scrollDOM.scrollTop,r.inputState.lastScrollLeft=r.scrollDOM.scrollLeft};l2.keydown=(r,e)=>(r.inputState.setSelectionOrigin("select"),e.keyCode==27&&(r.inputState.lastEscPress=Date.now()),!1);mv.touchstart=(r,e)=>{r.inputState.lastTouchTime=Date.now(),r.inputState.setSelectionOrigin("select.pointer")};mv.touchmove=r=>{r.inputState.setSelectionOrigin("select.pointer")};l2.mousedown=(r,e)=>{if(r.observer.flush(),r.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let s of r.state.facet(Kme))if(t=s(r,e),t)break;if(!t&&e.button==0&&(t=iEe(r,e)),t){let s=!r.hasFocus;r.inputState.startMouseSelection(new Jke(r,e,t,s)),s&&r.observer.ignore(()=>Ime(r.contentDOM));let a=r.inputState.mouseSelection;if(a)return a.start(e),!a.dragging}return!1};function eue(r,e,t,s){if(s==1)return Yn.cursor(e,t);if(s==2)return $ke(r.state,e,t);{let a=ld.find(r.docView,e),u=r.state.doc.lineAt(a?a.posAtEnd:e),f=a?a.posAtStart:u.from,h=a?a.posAtEnd:u.to;return h<r.state.doc.length&&h==u.to&&h++,Yn.range(f,h)}}let bge=(r,e)=>r>=e.top&&r<=e.bottom,tue=(r,e,t)=>bge(e,t)&&r>=t.left&&r<=t.right;function sEe(r,e,t,s){let a=ld.find(r.docView,e);if(!a)return 1;let u=e-a.posAtStart;if(u==0)return 1;if(u==a.length)return-1;let f=a.coordsAt(u,-1);if(f&&tue(t,s,f))return-1;let h=a.coordsAt(u,1);return h&&tue(t,s,h)?1:f&&bge(s,f)?-1:1}function nue(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:sEe(r,t,e.clientX,e.clientY)}}const rEe=Fs.ie&&Fs.ie_version<=11;let oue=null,sue=0,rue=0;function vge(r){if(!rEe)return r.detail;let e=oue,t=rue;return oue=r,rue=Date.now(),sue=!e||t>Date.now()-400&&Math.abs(e.clientX-r.clientX)<2&&Math.abs(e.clientY-r.clientY)<2?(sue+1)%3:1}function iEe(r,e){let t=nue(r,e),s=vge(e),a=r.state.selection;return{update(u){u.docChanged&&(t.pos=u.changes.mapPos(t.pos),a=a.map(u.changes))},get(u,f,h){let g=nue(r,u),v,_=eue(r,g.pos,g.bias,s);if(t.pos!=g.pos&&!f){let A=eue(r,t.pos,t.bias,s),O=Math.min(A.from,_.from),N=Math.max(A.to,_.to);_=O<_.from?Yn.range(O,N):Yn.range(N,O)}return f?a.replaceRange(a.main.extend(_.from,_.to)):h&&s==1&&a.ranges.length>1&&(v=aEe(a,g.pos))?v:h?a.addRange(_):Yn.create([_])}}}function aEe(r,e){for(let t=0;t<r.ranges.length;t++){let{from:s,to:a}=r.ranges[t];if(s<=e&&a>=e)return Yn.create(r.ranges.slice(0,t).concat(r.ranges.slice(t+1)),r.mainIndex==t?0:r.mainIndex-(r.mainIndex>t?1:0))}return null}l2.dragstart=(r,e)=>{let{selection:{main:t}}=r.state,{mouseSelection:s}=r.inputState;return s&&(s.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",r.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function iue(r,e,t,s){if(!t)return;let a=r.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:u}=r.inputState,f=s&&u&&u.dragging&&eEe(r,e)?{from:u.dragging.from,to:u.dragging.to}:null,h={from:a,insert:t},g=r.state.changes(f?[f,h]:h);r.focus(),r.dispatch({changes:g,selection:{anchor:g.mapPos(a,-1),head:g.mapPos(a,1)},userEvent:f?"move.drop":"input.drop"})}l2.drop=(r,e)=>{if(!e.dataTransfer)return!1;if(r.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let s=Array(t.length),a=0,u=()=>{++a==t.length&&iue(r,e,s.filter(f=>f!=null).join(r.state.lineBreak),!1)};for(let f=0;f<t.length;f++){let h=new FileReader;h.onerror=u,h.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(h.result)||(s[f]=h.result),u()},h.readAsText(t[f])}return!0}else{let s=e.dataTransfer.getData("Text");if(s)return iue(r,e,s,!0),!0}return!1};l2.paste=(r,e)=>{if(r.state.readOnly)return!0;r.observer.flush();let t=gge?null:e.clipboardData;return t?(pge(r,t.getData("text/plain")||t.getData("text/uri-text")),!0):(oEe(r),!1)};function lEe(r,e){let t=r.dom.parentNode;if(!t)return;let s=t.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),r.focus()},50)}function cEe(r){let e=[],t=[],s=!1;for(let a of r.selection.ranges)a.empty||(e.push(r.sliceDoc(a.from,a.to)),t.push(a));if(!e.length){let a=-1;for(let{from:u}of r.selection.ranges){let f=r.doc.lineAt(u);f.number>a&&(e.push(f.text),t.push({from:f.from,to:Math.min(r.doc.length,f.to+1)})),a=f.number}s=!0}return{text:e.join(r.lineBreak),ranges:t,linewise:s}}let Kne=null;l2.copy=l2.cut=(r,e)=>{let{text:t,ranges:s,linewise:a}=cEe(r.state);if(!t&&!a)return!1;Kne=a?t:null,e.type=="cut"&&!r.state.readOnly&&r.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let u=gge?null:e.clipboardData;return u?(u.clearData(),u.setData("text/plain",t),!0):(lEe(r,t),!1)};const yge=B_.define();function wge(r,e){let t=[];for(let s of r.facet(Jme)){let a=s(r,e);a&&t.push(a)}return t?r.update({effects:t,annotations:yge.of(!0)}):null}function _ge(r){setTimeout(()=>{let e=r.hasFocus;if(e!=r.inputState.notifiedFocused){let t=wge(r.state,e);t?r.dispatch(t):r.update([])}},10)}mv.focus=r=>{r.inputState.lastFocusTime=Date.now(),!r.scrollDOM.scrollTop&&(r.inputState.lastScrollTop||r.inputState.lastScrollLeft)&&(r.scrollDOM.scrollTop=r.inputState.lastScrollTop,r.scrollDOM.scrollLeft=r.inputState.lastScrollLeft),_ge(r)};mv.blur=r=>{r.observer.clearSelectionRange(),_ge(r)};mv.compositionstart=mv.compositionupdate=r=>{r.inputState.compositionFirstChange==null&&(r.inputState.compositionFirstChange=!0),r.inputState.composing<0&&(r.inputState.composing=0)};mv.compositionend=r=>{r.inputState.composing=-1,r.inputState.compositionEndedAt=Date.now(),r.inputState.compositionPendingKey=!0,r.inputState.compositionPendingChange=r.observer.pendingRecords().length>0,r.inputState.compositionFirstChange=null,Fs.chrome&&Fs.android?r.observer.flushSoon():r.inputState.compositionPendingChange?Promise.resolve().then(()=>r.observer.flush()):setTimeout(()=>{r.inputState.composing<0&&r.docView.hasComposition&&r.update([])},50)};mv.contextmenu=r=>{r.inputState.lastContextMenu=Date.now()};l2.beforeinput=(r,e)=>{var t;let s;if(Fs.chrome&&Fs.android&&(s=hge.find(a=>a.inputType==e.inputType))&&(r.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let a=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var u;(((u=window.visualViewport)===null||u===void 0?void 0:u.height)||0)>a+10&&r.hasFocus&&(r.contentDOM.blur(),r.focus())},100)}return!1};const aue=new Set;function uEe(r){aue.has(r)||(aue.add(r),r.addEventListener("copy",()=>{}),r.addEventListener("cut",()=>{}))}const lue=["pre-wrap","normal","pre-line","break-spaces"];class fEe{constructor(e){this.lineWrapping=e,this.doc=ul.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let s=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(s+=Math.max(0,Math.ceil((t-e-s*this.lineLength*.5)/this.lineLength))),this.lineHeight*s}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return lue.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let s=0;s<e.length;s++){let a=e[s];a<0?s++:this.heightSamples[Math.floor(a*10)]||(t=!0,this.heightSamples[Math.floor(a*10)]=!0)}return t}refresh(e,t,s,a,u,f){let h=lue.indexOf(e)>-1,g=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=h;if(this.lineWrapping=h,this.lineHeight=t,this.charWidth=s,this.textHeight=a,this.lineLength=u,g){this.heightSamples={};for(let v=0;v<f.length;v++){let _=f[v];_<0?v++:this.heightSamples[Math.floor(_*10)]=!0}}return g}}class dEe{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Jy{constructor(e,t,s,a,u){this.from=e,this.length=t,this.top=s,this.height=a,this._content=u}get type(){return typeof this._content=="number"?xg.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof bk?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Jy(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var xc=function(r){return r[r.ByPos=0]="ByPos",r[r.ByHeight=1]="ByHeight",r[r.ByPosNoHeight=2]="ByPosNoHeight",r}(xc||(xc={}));const $z=.001;class Tg{constructor(e,t,s=2){this.length=e,this.height=t,this.flags=s}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>$z&&(e.heightChanged=!0),this.height=t)}replace(e,t,s){return Tg.of(s)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,s,a){let u=this,f=s.doc;for(let h=a.length-1;h>=0;h--){let{fromA:g,toA:v,fromB:_,toB:A}=a[h],O=u.lineAt(g,xc.ByPosNoHeight,s.setDoc(t),0,0),N=O.to>=v?O:u.lineAt(v,xc.ByPosNoHeight,s,0,0);for(A+=N.to-v,v=N.to;h>0&&O.from<=a[h-1].toA;)g=a[h-1].fromA,_=a[h-1].fromB,h--,g<O.from&&(O=u.lineAt(g,xc.ByPosNoHeight,s,0,0));_+=O.from-g,g=O.from;let L=Uoe.build(s.setDoc(f),e,_,A);u=u.replace(g,v,L)}return u.updateHeight(s,0)}static empty(){return new D1(0,0)}static of(e){if(e.length==1)return e[0];let t=0,s=e.length,a=0,u=0;for(;;)if(t==s)if(a>u*2){let h=e[t-1];h.break?e.splice(--t,1,h.left,null,h.right):e.splice(--t,1,h.left,h.right),s+=1+h.break,a-=h.size}else if(u>a*2){let h=e[s];h.break?e.splice(s,1,h.left,null,h.right):e.splice(s,1,h.left,h.right),s+=2+h.break,u-=h.size}else break;else if(a<u){let h=e[t++];h&&(a+=h.size)}else{let h=e[--s];h&&(u+=h.size)}let f=0;return e[t-1]==null?(f=1,t--):e[t]==null&&(f=1,s++),new hEe(Tg.of(e.slice(0,t)),f,Tg.of(e.slice(s)))}}Tg.prototype.size=1;class Cge extends Tg{constructor(e,t,s){super(e,t),this.deco=s}blockAt(e,t,s,a){return new Jy(a,this.length,s,this.height,this.deco||0)}lineAt(e,t,s,a,u){return this.blockAt(0,s,a,u)}forEachLine(e,t,s,a,u,f){e<=u+this.length&&t>=u&&f(this.blockAt(0,s,a,u))}updateHeight(e,t=0,s=!1,a){return a&&a.from<=t&&a.more&&this.setHeight(e,a.heights[a.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class D1 extends Cge{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,s,a){return new Jy(a,this.length,s,this.height,this.breaks)}replace(e,t,s){let a=s[0];return s.length==1&&(a instanceof D1||a instanceof Bh&&a.flags&4)&&Math.abs(this.length-a.length)<10?(a instanceof Bh?a=new D1(a.length,this.height):a.height=this.height,this.outdated||(a.outdated=!1),a):Tg.of(s)}updateHeight(e,t=0,s=!1,a){return a&&a.from<=t&&a.more?this.setHeight(e,a.heights[a.index++]):(s||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Bh extends Tg{constructor(e){super(e,0)}heightMetrics(e,t){let s=e.doc.lineAt(t).number,a=e.doc.lineAt(t+this.length).number,u=a-s+1,f,h=0;if(e.lineWrapping){let g=Math.min(this.height,e.lineHeight*u);f=g/u,this.length>u+1&&(h=(this.height-g)/(this.length-u-1))}else f=this.height/u;return{firstLine:s,lastLine:a,perLine:f,perChar:h}}blockAt(e,t,s,a){let{firstLine:u,lastLine:f,perLine:h,perChar:g}=this.heightMetrics(t,a);if(t.lineWrapping){let v=a+Math.round(Math.max(0,Math.min(1,(e-s)/this.height))*this.length),_=t.doc.lineAt(v),A=h+_.length*g,O=Math.max(s,e-A/2);return new Jy(_.from,_.length,O,A,0)}else{let v=Math.max(0,Math.min(f-u,Math.floor((e-s)/h))),{from:_,length:A}=t.doc.line(u+v);return new Jy(_,A,s+h*v,h,0)}}lineAt(e,t,s,a,u){if(t==xc.ByHeight)return this.blockAt(e,s,a,u);if(t==xc.ByPosNoHeight){let{from:N,to:L}=s.doc.lineAt(e);return new Jy(N,L-N,0,0,0)}let{firstLine:f,perLine:h,perChar:g}=this.heightMetrics(s,u),v=s.doc.lineAt(e),_=h+v.length*g,A=v.number-f,O=a+h*A+g*(v.from-u-A);return new Jy(v.from,v.length,Math.max(a,Math.min(O,a+this.height-_)),_,0)}forEachLine(e,t,s,a,u,f){e=Math.max(e,u),t=Math.min(t,u+this.length);let{firstLine:h,perLine:g,perChar:v}=this.heightMetrics(s,u);for(let _=e,A=a;_<=t;){let O=s.doc.lineAt(_);if(_==e){let L=O.number-h;A+=g*L+v*(e-u-L)}let N=g+v*O.length;f(new Jy(O.from,O.length,A,N,0)),A+=N,_=O.to+1}}replace(e,t,s){let a=this.length-t;if(a>0){let u=s[s.length-1];u instanceof Bh?s[s.length-1]=new Bh(u.length+a):s.push(null,new Bh(a-1))}if(e>0){let u=s[0];u instanceof Bh?s[0]=new Bh(e+u.length):s.unshift(new Bh(e-1),null)}return Tg.of(s)}decomposeLeft(e,t){t.push(new Bh(e-1),null)}decomposeRight(e,t){t.push(null,new Bh(this.length-e-1))}updateHeight(e,t=0,s=!1,a){let u=t+this.length;if(a&&a.from<=t+this.length&&a.more){let f=[],h=Math.max(t,a.from),g=-1;for(a.from>t&&f.push(new Bh(a.from-t-1).updateHeight(e,t));h<=u&&a.more;){let _=e.doc.lineAt(h).length;f.length&&f.push(null);let A=a.heights[a.index++];g==-1?g=A:Math.abs(A-g)>=$z&&(g=-2);let O=new D1(_,A);O.outdated=!1,f.push(O),h+=_+1}h<=u&&f.push(null,new Bh(u-h).updateHeight(e,h));let v=Tg.of(f);return(g<0||Math.abs(v.height-this.height)>=$z||Math.abs(g-this.heightMetrics(e,t).perLine)>=$z)&&(e.heightChanged=!0),v}else(s||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class hEe extends Tg{constructor(e,t,s){super(e.length+t+s.length,e.height+s.height,t|(e.outdated||s.outdated?2:0)),this.left=e,this.right=s,this.size=e.size+s.size}get break(){return this.flags&1}blockAt(e,t,s,a){let u=s+this.left.height;return e<u?this.left.blockAt(e,t,s,a):this.right.blockAt(e,t,u,a+this.left.length+this.break)}lineAt(e,t,s,a,u){let f=a+this.left.height,h=u+this.left.length+this.break,g=t==xc.ByHeight?e<f:e<h,v=g?this.left.lineAt(e,t,s,a,u):this.right.lineAt(e,t,s,f,h);if(this.break||(g?v.to<h:v.from>h))return v;let _=t==xc.ByPosNoHeight?xc.ByPosNoHeight:xc.ByPos;return g?v.join(this.right.lineAt(h,_,s,f,h)):this.left.lineAt(h,_,s,a,u).join(v)}forEachLine(e,t,s,a,u,f){let h=a+this.left.height,g=u+this.left.length+this.break;if(this.break)e<g&&this.left.forEachLine(e,t,s,a,u,f),t>=g&&this.right.forEachLine(e,t,s,h,g,f);else{let v=this.lineAt(g,xc.ByPos,s,a,u);e<v.from&&this.left.forEachLine(e,v.from-1,s,a,u,f),v.to>=e&&v.from<=t&&f(v),t>v.to&&this.right.forEachLine(v.to+1,t,s,h,g,f)}}replace(e,t,s){let a=this.left.length+this.break;if(t<a)return this.balanced(this.left.replace(e,t,s),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-a,t-a,s));let u=[];e>0&&this.decomposeLeft(e,u);let f=u.length;for(let h of s)u.push(h);if(e>0&&cue(u,f-1),t<this.length){let h=u.length;this.decomposeRight(t,u),cue(u,h)}return Tg.of(u)}decomposeLeft(e,t){let s=this.left.length;if(e<=s)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(s++,e>=s&&t.push(null)),e>s&&this.right.decomposeLeft(e-s,t)}decomposeRight(e,t){let s=this.left.length,a=s+this.break;if(e>=a)return this.right.decomposeRight(e-a,t);e<s&&this.left.decomposeRight(e,t),this.break&&e<a&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Tg.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,s=!1,a){let{left:u,right:f}=this,h=t+u.length+this.break,g=null;return a&&a.from<=t+u.length&&a.more?g=u=u.updateHeight(e,t,s,a):u.updateHeight(e,t,s),a&&a.from<=h+f.length&&a.more?g=f=f.updateHeight(e,h,s,a):f.updateHeight(e,h,s),g?this.balanced(u,f):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function cue(r,e){let t,s;r[e]==null&&(t=r[e-1])instanceof Bh&&(s=r[e+1])instanceof Bh&&r.splice(e-1,3,new Bh(t.length+1+s.length))}const mEe=5;class Uoe{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let s=Math.min(t,this.lineEnd),a=this.nodes[this.nodes.length-1];a instanceof D1?a.length+=s-this.pos:(s>this.pos||!this.isCovered)&&this.nodes.push(new D1(s-this.pos,-1)),this.writtenTo=s,t>s&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,s){if(e<t||s.heightRelevant){let a=s.widget?s.widget.estimatedHeight:0,u=s.widget?s.widget.lineBreaks:0;a<0&&(a=this.oracle.lineHeight);let f=t-e;s.block?this.addBlock(new Cge(f,a,s)):(f||u||a>=mEe)&&this.addLineDeco(a,u,f)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new D1(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let s=new Bh(t-e);return this.oracle.doc.lineAt(e).to==t&&(s.flags|=4),s}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof D1)return e;let t=new D1(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,s){let a=this.ensureLine();a.length+=s,a.collapsed+=s,a.widgetHeight=Math.max(a.widgetHeight,e),a.breaks+=t,this.writtenTo=this.pos=this.pos+s}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof D1)&&!this.isCovered?this.nodes.push(new D1(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let s=e;for(let a of this.nodes)a instanceof D1&&a.updateHeight(this.oracle,s),s+=a?a.length:1;return this.nodes}static build(e,t,s,a){let u=new Uoe(s,e);return Xa.spans(t,s,a,u,0),u.finish(s)}}function gEe(r,e,t){let s=new pEe;return Xa.compare(r,e,t,s,0),s.changes}class pEe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,s,a){(e<t||s&&s.heightRelevant||a&&a.heightRelevant)&&Vne(e,t,this.changes,5)}}function bEe(r,e){let t=r.getBoundingClientRect(),s=r.ownerDocument,a=s.defaultView||window,u=Math.max(0,t.left),f=Math.min(a.innerWidth,t.right),h=Math.max(0,t.top),g=Math.min(a.innerHeight,t.bottom);for(let v=r.parentNode;v&&v!=s.body;)if(v.nodeType==1){let _=v,A=window.getComputedStyle(_);if((_.scrollHeight>_.clientHeight||_.scrollWidth>_.clientWidth)&&A.overflow!="visible"){let O=_.getBoundingClientRect();u=Math.max(u,O.left),f=Math.min(f,O.right),h=Math.max(h,O.top),g=v==r.parentNode?O.bottom:Math.min(g,O.bottom)}v=A.position=="absolute"||A.position=="fixed"?_.offsetParent:_.parentNode}else if(v.nodeType==11)v=v.host;else break;return{left:u-t.left,right:Math.max(u,f)-t.left,top:h-(t.top+e),bottom:Math.max(h,g)-(t.top+e)}}function vEe(r,e){let t=r.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Rte{constructor(e,t,s){this.from=e,this.to=t,this.size=s}static same(e,t){if(e.length!=t.length)return!1;for(let s=0;s<e.length;s++){let a=e[s],u=t[s];if(a.from!=u.from||a.to!=u.to||a.size!=u.size)return!1}return!0}draw(e,t){return ti.replace({widget:new yEe(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class yEe extends Sk{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class uue{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=fue,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mu.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(zoe).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new fEe(t),this.stateDeco=e.facet(WP).filter(s=>typeof s!="function"),this.heightMap=Tg.empty().applyChanges(this.stateDeco,ul.empty,this.heightOracle.setDoc(e.doc),[new N0(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ti.set(this.lineGaps.map(s=>s.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let s=0;s<=1;s++){let a=s?t.head:t.anchor;if(!e.some(({from:u,to:f})=>a>=u&&a<=f)){let{from:u,to:f}=this.lineBlockAt(a);e.push(new tz(u,f))}}this.viewports=e.sort((s,a)=>s.from-a.from),this.scaler=this.heightMap.height<=7e6?fue:new CEe(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:yP(e,this.scaler))})}update(e,t=null){this.state=e.state;let s=this.stateDeco;this.stateDeco=this.state.facet(WP).filter(_=>typeof _!="function");let a=e.changedRanges,u=N0.extendWithRanges(a,gEe(s,this.stateDeco,e?e.changes:ud.empty(this.state.doc.length))),f=this.heightMap.height,h=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),u),this.heightMap.height!=f&&(e.flags|=2),h?(this.scrollAnchorPos=e.changes.mapPos(h.from,-1),this.scrollAnchorHeight=h.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let g=u.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<g.from||t.range.head>g.to)||!this.viewportIsAppropriate(g))&&(g=this.getViewport(0,t));let v=!e.changes.empty||e.flags&2||g.from!=this.viewport.from||g.to!=this.viewport.to;this.viewport=g,this.updateForViewport(),v&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ege)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,s=window.getComputedStyle(t),a=this.heightOracle,u=s.whiteSpace;this.defaultTextDirection=s.direction=="rtl"?mu.RTL:mu.LTR;let f=this.heightOracle.mustRefreshForWrapping(u),h=t.getBoundingClientRect(),g=f||this.mustMeasureContent||this.contentDOMHeight!=h.height;this.contentDOMHeight=h.height,this.mustMeasureContent=!1;let v=0,_=0;if(h.width&&h.height){let oe=h.width/t.offsetWidth,te=h.height/t.offsetHeight;(oe>.995&&oe<1.005||!isFinite(oe)||Math.abs(h.width-t.offsetWidth)<1)&&(oe=1),(te>.995&&te<1.005||!isFinite(te)||Math.abs(h.height-t.offsetHeight)<1)&&(te=1),(this.scaleX!=oe||this.scaleY!=te)&&(this.scaleX=oe,this.scaleY=te,v|=8,f=g=!0)}let A=(parseInt(s.paddingTop)||0)*this.scaleY,O=(parseInt(s.paddingBottom)||0)*this.scaleY;(this.paddingTop!=A||this.paddingBottom!=O)&&(this.paddingTop=A,this.paddingBottom=O,v|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(a.lineWrapping&&(g=!0),this.editorWidth=e.scrollDOM.clientWidth,v|=8);let N=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=N&&(this.scrollAnchorHeight=-1,this.scrollTop=N),this.scrolledToBottom=Lme(e.scrollDOM);let L=(this.printing?vEe:bEe)(t,this.paddingTop),j=L.top-this.pixelViewport.top,z=L.bottom-this.pixelViewport.bottom;this.pixelViewport=L;let q=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(q!=this.inView&&(this.inView=q,q&&(g=!0)),!this.inView&&!this.scrollTarget)return 0;let ee=h.width;if((this.contentDOMWidth!=ee||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=h.width,this.editorHeight=e.scrollDOM.clientHeight,v|=8),g){let oe=e.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(oe)&&(f=!0),f||a.lineWrapping&&Math.abs(ee-this.contentDOMWidth)>a.charWidth){let{lineHeight:te,charWidth:se,textHeight:X}=e.docView.measureTextSize();f=te>0&&a.refresh(u,te,se,X,ee/se,oe),f&&(e.docView.minWidth=0,v|=8)}j>0&&z>0?_=Math.max(j,z):j<0&&z<0&&(_=Math.min(j,z)),a.heightChanged=!1;for(let te of this.viewports){let se=te.from==this.viewport.from?oe:e.docView.measureVisibleLineHeights(te);this.heightMap=(f?Tg.empty().applyChanges(this.stateDeco,ul.empty,this.heightOracle,[new N0(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(a,0,f,new dEe(te.from,se))}a.heightChanged&&(v|=2)}let F=!this.viewportIsAppropriate(this.viewport,_)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return F&&(this.viewport=this.getViewport(_,this.scrollTarget)),this.updateForViewport(),(v&2||F)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(f?[]:this.lineGaps,e)),v|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),v}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let s=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),a=this.heightMap,u=this.heightOracle,{visibleTop:f,visibleBottom:h}=this,g=new tz(a.lineAt(f-s*1e3,xc.ByHeight,u,0,0).from,a.lineAt(h+(1-s)*1e3,xc.ByHeight,u,0,0).to);if(t){let{head:v}=t.range;if(v<g.from||v>g.to){let _=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),A=a.lineAt(v,xc.ByPos,u,0,0),O;t.y=="center"?O=(A.top+A.bottom)/2-_/2:t.y=="start"||t.y=="nearest"&&v<g.from?O=A.top:O=A.bottom-_,g=new tz(a.lineAt(O-1e3/2,xc.ByHeight,u,0,0).from,a.lineAt(O+_+1e3/2,xc.ByHeight,u,0,0).to)}}return g}mapViewport(e,t){let s=t.mapPos(e.from,-1),a=t.mapPos(e.to,1);return new tz(this.heightMap.lineAt(s,xc.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(a,xc.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},s=0){if(!this.inView)return!0;let{top:a}=this.heightMap.lineAt(e,xc.ByPos,this.heightOracle,0,0),{bottom:u}=this.heightMap.lineAt(t,xc.ByPos,this.heightOracle,0,0),{visibleTop:f,visibleBottom:h}=this;return(e==0||a<=f-Math.max(10,Math.min(-s,250)))&&(t==this.state.doc.length||u>=h+Math.max(10,Math.min(s,250)))&&a>f-2*1e3&&u<h+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let s=[];for(let a of e)t.touchesRange(a.from,a.to)||s.push(new Rte(t.mapPos(a.from),t.mapPos(a.to),a.size));return s}ensureLineGaps(e,t){let s=this.heightOracle.lineWrapping,a=s?1e4:2e3,u=a>>1,f=a<<1;if(this.defaultTextDirection!=mu.LTR&&!s)return[];let h=[],g=(v,_,A,O)=>{if(_-v<u)return;let N=this.state.selection.main,L=[N.from];N.empty||L.push(N.to);for(let z of L)if(z>v&&z<_){g(v,z-10,A,O),g(z+10,_,A,O);return}let j=_Ee(e,z=>z.from>=A.from&&z.to<=A.to&&Math.abs(z.from-v)<u&&Math.abs(z.to-_)<u&&!L.some(q=>z.from<q&&z.to>q));if(!j){if(_<A.to&&t&&s&&t.visibleRanges.some(z=>z.from<=_&&z.to>=_)){let z=t.moveToLineBoundary(Yn.cursor(_),!1,!0).head;z>v&&(_=z)}j=new Rte(v,_,this.gapSize(A,v,_,O))}h.push(j)};for(let v of this.viewportLines){if(v.length<f)continue;let _=wEe(v.from,v.to,this.stateDeco);if(_.total<f)continue;let A=this.scrollTarget?this.scrollTarget.range.head:null,O,N;if(s){let L=a/this.heightOracle.lineLength*this.heightOracle.lineHeight,j,z;if(A!=null){let q=oz(_,A),ee=((this.visibleBottom-this.visibleTop)/2+L)/v.height;j=q-ee,z=q+ee}else j=(this.visibleTop-v.top-L)/v.height,z=(this.visibleBottom-v.top+L)/v.height;O=nz(_,j),N=nz(_,z)}else{let L=_.total*this.heightOracle.charWidth,j=a*this.heightOracle.charWidth,z,q;if(A!=null){let ee=oz(_,A),F=((this.pixelViewport.right-this.pixelViewport.left)/2+j)/L;z=ee-F,q=ee+F}else z=(this.pixelViewport.left-j)/L,q=(this.pixelViewport.right+j)/L;O=nz(_,z),N=nz(_,q)}O>v.from&&g(v.from,O,v,_),N<v.to&&g(N,v.to,v,_)}return h}gapSize(e,t,s,a){let u=oz(a,s)-oz(a,t);return this.heightOracle.lineWrapping?e.height*u:a.total*this.heightOracle.charWidth*u}updateLineGaps(e){Rte.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ti.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Xa.spans(e,this.viewport.from,this.viewport.to,{span(a,u){t.push({from:a,to:u})},point(){}},20);let s=t.length!=this.visibleRanges.length||this.visibleRanges.some((a,u)=>a.from!=t[u].from||a.to!=t[u].to);return this.visibleRanges=t,s?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||yP(this.heightMap.lineAt(e,xc.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return yP(this.heightMap.lineAt(this.scaler.fromDOM(e),xc.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return yP(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class tz{constructor(e,t){this.from=e,this.to=t}}function wEe(r,e,t){let s=[],a=r,u=0;return Xa.spans(t,r,e,{span(){},point(f,h){f>a&&(s.push({from:a,to:f}),u+=f-a),a=h}},20),a<e&&(s.push({from:a,to:e}),u+=e-a),{total:u,ranges:s}}function nz({total:r,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let s=Math.floor(r*t);for(let a=0;;a++){let{from:u,to:f}=e[a],h=f-u;if(s<=h)return u+s;s-=h}}function oz(r,e){let t=0;for(let{from:s,to:a}of r.ranges){if(e<=a){t+=e-s;break}t+=a-s}return t/r.total}function _Ee(r,e){for(let t of r)if(e(t))return t}const fue={toDOM(r){return r},fromDOM(r){return r},scale:1};class CEe{constructor(e,t,s){let a=0,u=0,f=0;this.viewports=s.map(({from:h,to:g})=>{let v=t.lineAt(h,xc.ByPos,e,0,0).top,_=t.lineAt(g,xc.ByPos,e,0,0).bottom;return a+=_-v,{from:h,to:g,top:v,bottom:_,domTop:0,domBottom:0}}),this.scale=(7e6-a)/(t.height-a);for(let h of this.viewports)h.domTop=f+(h.top-u)*this.scale,f=h.domBottom=h.domTop+(h.bottom-h.top),u=h.bottom}toDOM(e){for(let t=0,s=0,a=0;;t++){let u=t<this.viewports.length?this.viewports[t]:null;if(!u||e<u.top)return a+(e-s)*this.scale;if(e<=u.bottom)return u.domTop+(e-u.top);s=u.bottom,a=u.domBottom}}fromDOM(e){for(let t=0,s=0,a=0;;t++){let u=t<this.viewports.length?this.viewports[t]:null;if(!u||e<u.domTop)return s+(e-a)/this.scale;if(e<=u.domBottom)return u.top+(e-u.domTop);s=u.bottom,a=u.domBottom}}}function yP(r,e){if(e.scale==1)return r;let t=e.toDOM(r.top),s=e.toDOM(r.bottom);return new Jy(r.from,r.length,t,s-t,Array.isArray(r._content)?r._content.map(a=>yP(a,e)):r._content)}const sz=Ds.define({combine:r=>r.join(" ")}),Yne=Ds.define({combine:r=>r.indexOf(!0)>-1}),Xne=gk.newName(),Sge=gk.newName(),kge=gk.newName(),Ege={"&light":"."+Sge,"&dark":"."+kge};function Jne(r,e,t){return new gk(e,{finish(s){return/&/.test(s)?s.replace(/&\w*/,a=>{if(a=="&")return r;if(!t||!t[a])throw new RangeError(`Unsupported selector: ${a}`);return t[a]}):r+" "+s}})}const SEe=Jne("."+Xne,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ege),wP="\uFFFF";class kEe{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Ea.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=wP}readRange(e,t){if(!e)return this;let s=e.parentNode;for(let a=e;;){this.findPointBefore(s,a);let u=this.text.length;this.readNode(a);let f=a.nextSibling;if(f==t)break;let h=Tc.get(a),g=Tc.get(f);(h&&g?h.breakAfter:(h?h.breakAfter:due(a))||due(f)&&(a.nodeName!="BR"||a.cmIgnore)&&this.text.length>u)&&this.lineBreak(),a=f}return this.findPointBefore(s,t),this}readTextNode(e){let t=e.nodeValue;for(let s of this.points)s.node==e&&(s.pos=this.text.length+Math.min(s.offset,t.length));for(let s=0,a=this.lineSeparator?null:/\r\n?|\n/g;;){let u=-1,f=1,h;if(this.lineSeparator?(u=t.indexOf(this.lineSeparator,s),f=this.lineSeparator.length):(h=a.exec(t))&&(u=h.index,f=h[0].length),this.append(t.slice(s,u<0?t.length:u)),u<0)break;if(this.lineBreak(),f>1)for(let g of this.points)g.node==e&&g.pos>this.text.length&&(g.pos-=f-1);s=u+f}}readNode(e){if(e.cmIgnore)return;let t=Tc.get(e),s=t&&t.overrideDOMText;if(s!=null){this.findPointInside(e,s.length);for(let a=s.iter();!a.next().done;)a.lineBreak?this.lineBreak():this.append(a.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let s of this.points)s.node==e&&e.childNodes[s.offset]==t&&(s.pos=this.text.length)}findPointInside(e,t){for(let s of this.points)(e.nodeType==3?s.node==e:e.contains(s.node))&&(s.pos=this.text.length+(EEe(e,s.node,s.offset)?t:0))}}function EEe(r,e,t){for(;;){if(!e||t<O_(e))return!1;if(e==r)return!0;t=UP(e)+1,e=e.parentNode}}function due(r){return r.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(r.nodeName)}class hue{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class AEe{constructor(e,t,s,a){this.typeOver=a,this.bounds=null,this.text="";let{impreciseHead:u,impreciseAnchor:f}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,s,0))){let h=u||f?[]:DEe(e),g=new kEe(h,e.state);g.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=g.text,this.newSel=OEe(h,this.bounds.from)}else{let h=e.observer.selectionRange,g=u&&u.node==h.focusNode&&u.offset==h.focusOffset||!Bne(e.contentDOM,h.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(h.focusNode,h.focusOffset),v=f&&f.node==h.anchorNode&&f.offset==h.anchorOffset||!Bne(e.contentDOM,h.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(h.anchorNode,h.anchorOffset);this.newSel=Yn.single(v,g)}}}function Age(r,e){let t,{newSel:s}=e,a=r.state.selection.main,u=r.inputState.lastKeyTime>Date.now()-100?r.inputState.lastKeyCode:-1;if(e.bounds){let{from:f,to:h}=e.bounds,g=a.from,v=null;(u===8||Fs.android&&e.text.length<h-f)&&(g=a.to,v="end");let _=TEe(r.state.doc.sliceString(f,h,wP),e.text,g-f,v);_&&(Fs.chrome&&u==13&&_.toB==_.from+2&&e.text.slice(_.from,_.toB)==wP+wP&&_.toB--,t={from:f+_.from,to:f+_.toA,insert:ul.of(e.text.slice(_.from,_.toB).split(wP))})}else s&&(!r.hasFocus&&r.state.facet(KV)||s.main.eq(a))&&(s=null);if(!t&&!s)return!1;if(!t&&e.typeOver&&!a.empty&&s&&s.main.empty?t={from:a.from,to:a.to,insert:r.state.doc.slice(a.from,a.to)}:t&&t.from>=a.from&&t.to<=a.to&&(t.from!=a.from||t.to!=a.to)&&a.to-a.from-(t.to-t.from)<=4?t={from:a.from,to:a.to,insert:r.state.doc.slice(a.from,t.from).append(t.insert).append(r.state.doc.slice(t.to,a.to))}:(Fs.mac||Fs.android)&&t&&t.from==t.to&&t.from==a.head-1&&/^\. ?$/.test(t.insert.toString())&&r.contentDOM.getAttribute("autocorrect")=="off"?(s&&t.insert.length==2&&(s=Yn.single(s.main.anchor-1,s.main.head-1)),t={from:a.from,to:a.to,insert:ul.of([" "])}):Fs.chrome&&t&&t.from==t.to&&t.from==a.head&&t.insert.toString()==`
|
|
`&&r.lineWrapping&&(s&&(s=Yn.single(s.main.anchor-1,s.main.head-1)),t={from:a.from,to:a.to,insert:ul.of([" "])}),t){if(Fs.ios&&r.inputState.flushIOSKey()||Fs.android&&(t.from==a.from&&t.to==a.to&&t.insert.length==1&&t.insert.lines==2&&QD(r.contentDOM,"Enter",13)||(t.from==a.from-1&&t.to==a.to&&t.insert.length==0||u==8&&t.insert.length<t.to-t.from&&t.to>a.head)&&QD(r.contentDOM,"Backspace",8)||t.from==a.from&&t.to==a.to+1&&t.insert.length==0&&QD(r.contentDOM,"Delete",46)))return!0;let f=t.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let h,g=()=>h||(h=xEe(r,t,s));return r.state.facet(Xme).some(v=>v(r,t.from,t.to,f,g))||r.dispatch(g()),!0}else if(s&&!s.main.eq(a)){let f=!1,h="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(f=!0),h=r.inputState.lastSelectionOrigin),r.dispatch({selection:s,scrollIntoView:f,userEvent:h}),!0}else return!1}function xEe(r,e,t){let s,a=r.state,u=a.selection.main;if(e.from>=u.from&&e.to<=u.to&&e.to-e.from>=(u.to-u.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&r.inputState.composing<0){let h=u.from<e.from?a.sliceDoc(u.from,e.from):"",g=u.to>e.to?a.sliceDoc(e.to,u.to):"";s=a.replaceSelection(r.state.toText(h+e.insert.sliceString(0,void 0,r.state.lineBreak)+g))}else{let h=a.changes(e),g=t&&t.main.to<=h.newLength?t.main:void 0;if(a.selection.ranges.length>1&&r.inputState.composing>=0&&e.to<=u.to&&e.to>=u.to-10){let v=r.state.sliceDoc(e.from,e.to),_,A=t&&uge(r,t.main.head);if(A){let L=e.insert.length-(e.to-e.from);_={from:A.from,to:A.to-L}}else _=r.state.doc.lineAt(u.head);let O=u.to-e.to,N=u.to-u.from;s=a.changeByRange(L=>{if(L.from==u.from&&L.to==u.to)return{changes:h,range:g||L.map(h)};let j=L.to-O,z=j-v.length;if(L.to-L.from!=N||r.state.sliceDoc(z,j)!=v||L.to>=_.from&&L.from<=_.to)return{range:L};let q=a.changes({from:z,to:j,insert:e.insert}),ee=L.to-u.to;return{changes:q,range:g?Yn.range(Math.max(0,g.anchor+ee),Math.max(0,g.head+ee)):L.map(q)}})}else s={changes:h,selection:g&&a.selection.replaceRange(g)}}let f="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,f+=".compose",r.inputState.compositionFirstChange&&(f+=".start",r.inputState.compositionFirstChange=!1)),a.update(s,{userEvent:f,scrollIntoView:!0})}function TEe(r,e,t,s){let a=Math.min(r.length,e.length),u=0;for(;u<a&&r.charCodeAt(u)==e.charCodeAt(u);)u++;if(u==a&&r.length==e.length)return null;let f=r.length,h=e.length;for(;f>0&&h>0&&r.charCodeAt(f-1)==e.charCodeAt(h-1);)f--,h--;if(s=="end"){let g=Math.max(0,u-Math.min(f,h));t-=f+g-u}if(f<u&&r.length<e.length){let g=t<=u&&t>=f?u-t:0;u-=g,h=u+(h-f),f=u}else if(h<u){let g=t<=u&&t>=h?u-t:0;u-=g,f=u+(f-h),h=u}return{from:u,toA:f,toB:h}}function DEe(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:s,focusNode:a,focusOffset:u}=r.observer.selectionRange;return t&&(e.push(new hue(t,s)),(a!=t||u!=s)&&e.push(new hue(a,u))),e}function OEe(r,e){if(r.length==0)return null;let t=r[0].pos,s=r.length==2?r[1].pos:t;return t>-1&&s>-1?Yn.single(t+e,s+e):null}const MEe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Nte=Fs.ie&&Fs.ie_version<=11;class REe{constructor(e){this.view=e,this.active=!1,this.selectionRange=new gke,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let s of t)this.queue.push(s);(Fs.ie&&Fs.ie_version<=11||Fs.ios&&e.composing)&&t.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),Nte&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM),this.resizeContent=new ResizeObserver(()=>this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,s)=>t!=e[s]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:s}=this,a=this.selectionRange;if(s.state.facet(KV)?s.root.activeElement!=this.dom:!Fz(s.dom,a))return;let u=a.anchorNode&&s.docView.nearest(a.anchorNode);if(u&&u.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Fs.ie&&Fs.ie_version<=11||Fs.android&&Fs.chrome)&&!s.state.selection.main.empty&&a.focusNode&&fV(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Fs.safari&&e.root.nodeType==11&&fke(this.dom.ownerDocument)==this.dom&&NEe(this.view)||uV(e.root);if(!t||this.selectionRange.eq(t))return!1;let s=Fz(this.dom,t);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&bke(this.dom,t)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(t),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let s=this.dom;s;)if(s.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==s?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);for(let s of this.scrollTargets=t)s.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,MEe),Nte&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){!this.active||(this.active=!1,this.observer.disconnect(),Nte&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var s;if(!this.delayedAndroidKey){let a=()=>{let u=this.delayedAndroidKey;u&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=u.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&u.force&&QD(this.dom,u.key,u.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(a)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((s=this.delayedAndroidKey)===null||s===void 0)&&s.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,s=-1,a=!1;for(let u of e){let f=this.readMutation(u);!f||(f.typeOver&&(a=!0),t==-1?{from:t,to:s}=f:(t=Math.min(f.from,t),s=Math.max(f.to,s)))}return{from:t,to:s,typeOver:a}}readChange(){let{from:e,to:t,typeOver:s}=this.processRecords(),a=this.selectionChanged&&Fz(this.dom,this.selectionRange);if(e<0&&!a)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let u=new AEe(this.view,e,t,s);return this.view.docView.domChanged={newSel:u.newSel?u.newSel.main:null},u}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let s=this.view.state,a=Age(this.view,t);return this.view.state==s&&this.view.update([]),a}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let s=mue(t,e.previousSibling||e.target.previousSibling,-1),a=mue(t,e.nextSibling||e.target.nextSibling,1);return{from:s?t.posAfter(s):t.posAtStart,to:a?t.posBefore(a):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,s,a;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(s=this.resizeScroll)===null||s===void 0||s.disconnect(),(a=this.resizeContent)===null||a===void 0||a.disconnect();for(let u of this.scrollTargets)u.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function mue(r,e,t){for(;e;){let s=Tc.get(e);if(s&&s.parent==r)return s;let a=e.parentNode;e=a!=r.dom?a:t>0?e.nextSibling:e.previousSibling}return null}function NEe(r){let e=null;function t(g){g.preventDefault(),g.stopImmediatePropagation(),e=g.getTargetRanges()[0]}if(r.contentDOM.addEventListener("beforeinput",t,!0),r.dom.ownerDocument.execCommand("indent"),r.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let s=e.startContainer,a=e.startOffset,u=e.endContainer,f=e.endOffset,h=r.docView.domAtPos(r.state.selection.main.anchor);return fV(h.node,h.offset,u,f)&&([s,a,u,f]=[u,f,s,a]),{anchorNode:s,anchorOffset:a,focusNode:u,focusOffset:f}}class xs{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(s=>s.forEach(a=>t(a,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||pke(e.parent)||document,this.viewState=new uue(e.state||Ea.create(e)),this.plugins=this.state.facet(bP).map(s=>new Dte(s));for(let s of this.plugins)s.update(this);this.observer=new REe(this),this.inputState=new Gke(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Zce(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof hd?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,s=!1,a,u=this.state;for(let O of e){if(O.startState!=u)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");u=O.state}if(this.destroyed){this.viewState.state=u;return}let f=this.hasFocus,h=0,g=null;e.some(O=>O.annotation(yge))?(this.inputState.notifiedFocused=f,h=1):f!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=f,g=wge(u,f),g||(h=1));let v=this.observer.delayedAndroidKey,_=null;if(v?(this.observer.clearDelayedAndroidKey(),_=this.observer.readChange(),(_&&!this.state.doc.eq(u.doc)||!this.state.selection.eq(u.selection))&&(_=null)):this.observer.clear(),u.facet(Ea.phrases)!=this.state.facet(Ea.phrases))return this.setState(u);a=hV.create(this,u,e),a.flags|=h;let A=this.viewState.scrollTarget;try{this.updateState=2;for(let O of e){if(A&&(A=A.map(O.changes)),O.scrollIntoView){let{main:N}=O.state.selection;A=new dV(N.empty?N:Yn.cursor(N.head,N.head>N.anchor?-1:1))}for(let N of O.effects)N.is(Wce)&&(A=N.value)}this.viewState.update(a,A),this.bidiCache=mV.update(this.bidiCache,a.changes),a.empty||(this.updatePlugins(a),this.inputState.update(a)),t=this.docView.update(a),this.state.facet(vP)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(O=>O.isUserEvent("select.pointer")))}finally{this.updateState=0}if(a.startState.facet(sz)!=a.state.facet(sz)&&(this.viewState.mustMeasureContent=!0),(t||s||A||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!a.empty)for(let O of this.state.facet(Une))O(a);(g||_)&&Promise.resolve().then(()=>{g&&this.state==g.startState&&this.dispatch(g),_&&!Age(this,_)&&v.force&&QD(this.contentDOM,v.key,v.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let s of this.plugins)s.destroy(this);this.viewState=new uue(e),this.plugins=e.facet(bP).map(s=>new Dte(s)),this.pluginMap.clear();for(let s of this.plugins)s.update(this);this.docView=new Zce(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(bP),s=e.state.facet(bP);if(t!=s){let a=[];for(let u of s){let f=t.indexOf(u);if(f<0)a.push(new Dte(u));else{let h=this.plugins[f];h.mustUpdate=e,a.push(h)}}for(let u of this.plugins)u.mustUpdate!=e&&u.destroy(this);this.plugins=a,this.pluginMap.clear()}else for(let a of this.plugins)a.mustUpdate=e;for(let a=0;a<this.plugins.length;a++)this.plugins[a].update(this);t!=s&&this.inputState.ensureHandlers(this.plugins)}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,s=this.scrollDOM,a=s.scrollTop*this.scaleY,{scrollAnchorPos:u,scrollAnchorHeight:f}=this.viewState;Math.abs(a-this.viewState.scrollTop)>1&&(f=-1),this.viewState.scrollAnchorHeight=-1;try{for(let h=0;;h++){if(f<0)if(Lme(s))u=-1,f=this.viewState.heightMap.height;else{let N=this.viewState.scrollAnchorAt(a);u=N.from,f=N.top}this.updateState=1;let g=this.viewState.measure(this);if(!g&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(h>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let v=[];g&4||([this.measureRequests,v]=[v,this.measureRequests]);let _=v.map(N=>{try{return N.read(this)}catch(L){return R0(this.state,L),gue}}),A=hV.create(this,this.state,[]),O=!1;A.flags|=g,t?t.flags|=g:t=A,this.updateState=2,A.empty||(this.updatePlugins(A),this.inputState.update(A),this.updateAttrs(),O=this.docView.update(A));for(let N=0;N<v.length;N++)if(_[N]!=gue)try{let L=v[N];L.write&&L.write(_[N],this)}catch(L){R0(this.state,L)}if(O&&this.docView.updateSelection(!0),!A.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null;continue}else{let L=(u<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(u).top)-f;if(L>1||L<-1){a=a+L,s.scrollTop=a/this.scaleY,f=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let h of this.state.facet(Une))h(t)}get themeClasses(){return Xne+" "+(this.state.facet(Yne)?kge:Sge)+" "+this.state.facet(sz)}updateAttrs(){let e=pue(this,tge,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(KV)?"true":"false",class:"cm-content",style:`${Fs.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),pue(this,zoe,t);let s=this.observer.ignore(()=>{let a=zne(this.contentDOM,this.contentAttrs,t),u=zne(this.dom,this.editorAttrs,e);return a||u});return this.editorAttrs=e,this.contentAttrs=t,s}showAnnouncements(e){let t=!0;for(let s of e)for(let a of s.effects)if(a.is(xs.announce)){t&&(this.announceDOM.textContent=""),t=!1;let u=this.announceDOM.appendChild(document.createElement("div"));u.textContent=a.value}}mountStyles(){this.styleModules=this.state.facet(vP);let e=this.state.facet(xs.cspNonce);gk.mount(this.root,this.styleModules.concat(SEe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(s=>s.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,s){return Mte(this,e,Jce(this,e,t,s))}moveByGroup(e,t){return Mte(this,e,Jce(this,e,t,s=>Zke(this,e.head,s)))}moveToLineBoundary(e,t,s=!0){return jke(this,e,t,s)}moveVertically(e,t,s){return Mte(this,e,qke(this,e,t,s))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),dge(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let s=this.docView.coordsAt(e,t);if(!s||s.left==s.right)return s;let a=this.state.doc.lineAt(e),u=this.bidiSpans(a),f=u[lk.find(u,e-a.from,-1,t)];return Foe(s,f.dir==mu.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Qme)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>PEe)return lge(e.length);let t=this.textDirectionAt(e.from),s;for(let u of this.bidiCache)if(u.from==e.from&&u.dir==t&&(u.fresh||age(u.isolates,s=jce(this,e.from,e.to))))return u.order;s||(s=jce(this,e.from,e.to));let a=Mke(e.text,t,s);return this.bidiCache.push(new mV(e.from,e.to,t,s,!0,a)),a}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Fs.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ime(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Wce.of(new dV(typeof e=="number"?Yn.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return mf.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return mf.define(()=>({}),{eventObservers:e})}static theme(e,t){let s=gk.newName(),a=[sz.of(s),vP.of(Jne(`.${s}`,e))];return t&&t.dark&&a.push(Yne.of(!0)),a}static baseTheme(e){return wO.lowest(vP.of(Jne("."+Xne,e,Ege)))}static findFromDOM(e){var t;let s=e.querySelector(".cm-content"),a=s&&Tc.get(s)||Tc.get(e);return((t=a==null?void 0:a.rootView)===null||t===void 0?void 0:t.view)||null}}xs.styleModule=vP;xs.inputHandler=Xme;xs.focusChangeEffect=Jme;xs.perLineTextDirection=Qme;xs.exceptionSink=Yme;xs.updateListener=Une;xs.editable=KV;xs.mouseSelectionStyle=Kme;xs.dragMovesSelection=Gme;xs.clickAddsSelectionRange=qme;xs.decorations=WP;xs.atomicRanges=Voe;xs.bidiIsolatedRanges=nge;xs.scrollMargins=oge;xs.darkTheme=Yne;xs.cspNonce=Ds.define({combine:r=>r.length?r[0]:""});xs.contentAttributes=zoe;xs.editorAttributes=tge;xs.lineWrapping=xs.contentAttributes.of({class:"cm-lineWrapping"});xs.announce=Ii.define();const PEe=4096,gue={};class mV{constructor(e,t,s,a,u,f){this.from=e,this.to=t,this.dir=s,this.isolates=a,this.fresh=u,this.order=f}static update(e,t){if(t.empty&&!e.some(u=>u.fresh))return e;let s=[],a=e.length?e[e.length-1].dir:mu.LTR;for(let u=Math.max(0,e.length-10);u<e.length;u++){let f=e[u];f.dir==a&&!t.touchesRange(f.from,f.to)&&s.push(new mV(t.mapPos(f.from,1),t.mapPos(f.to,-1),f.dir,f.isolates,!1,f.order))}return s}}function pue(r,e,t){for(let s=r.state.facet(e),a=s.length-1;a>=0;a--){let u=s[a],f=typeof u=="function"?u(r):u;f&&$ne(f,t)}return t}const IEe=Fs.mac?"mac":Fs.windows?"win":Fs.linux?"linux":"key";function BEe(r,e){const t=r.split(/-(?!$)/);let s=t[t.length-1];s=="Space"&&(s=" ");let a,u,f,h;for(let g=0;g<t.length-1;++g){const v=t[g];if(/^(cmd|meta|m)$/i.test(v))h=!0;else if(/^a(lt)?$/i.test(v))a=!0;else if(/^(c|ctrl|control)$/i.test(v))u=!0;else if(/^s(hift)?$/i.test(v))f=!0;else if(/^mod$/i.test(v))e=="mac"?h=!0:u=!0;else throw new Error("Unrecognized modifier name: "+v)}return a&&(s="Alt-"+s),u&&(s="Ctrl-"+s),h&&(s="Meta-"+s),f&&(s="Shift-"+s),s}function rz(r,e,t){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t!==!1&&e.shiftKey&&(r="Shift-"+r),r}const LEe=wO.default(xs.domEventHandlers({keydown(r,e){return Tge(xge(e.state),r,e,"editor")}})),YV=Ds.define({enables:LEe}),bue=new WeakMap;function xge(r){let e=r.facet(YV),t=bue.get(e);return t||bue.set(e,t=$Ee(e.reduce((s,a)=>s.concat(a),[]))),t}function FEe(r,e,t){return Tge(xge(r.state),e,r,t)}let sk=null;const HEe=4e3;function $Ee(r,e=IEe){let t=Object.create(null),s=Object.create(null),a=(f,h)=>{let g=s[f];if(g==null)s[f]=h;else if(g!=h)throw new Error("Key binding "+f+" is used both as a regular binding and as a multi-stroke prefix")},u=(f,h,g,v,_)=>{var A,O;let N=t[f]||(t[f]=Object.create(null)),L=h.split(/ (?!$)/).map(q=>BEe(q,e));for(let q=1;q<L.length;q++){let ee=L.slice(0,q).join(" ");a(ee,!0),N[ee]||(N[ee]={preventDefault:!0,stopPropagation:!1,run:[F=>{let oe=sk={view:F,prefix:ee,scope:f};return setTimeout(()=>{sk==oe&&(sk=null)},HEe),!0}]})}let j=L.join(" ");a(j,!1);let z=N[j]||(N[j]={preventDefault:!1,stopPropagation:!1,run:((O=(A=N._any)===null||A===void 0?void 0:A.run)===null||O===void 0?void 0:O.slice())||[]});g&&z.run.push(g),v&&(z.preventDefault=!0),_&&(z.stopPropagation=!0)};for(let f of r){let h=f.scope?f.scope.split(" "):["editor"];if(f.any)for(let v of h){let _=t[v]||(t[v]=Object.create(null));_._any||(_._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let A in _)_[A].run.push(f.any)}let g=f[e]||f.key;if(!!g)for(let v of h)u(v,g,f.run,f.preventDefault,f.stopPropagation),f.shift&&u(v,"Shift-"+g,f.shift,f.preventDefault,f.stopPropagation)}return t}function Tge(r,e,t,s){let a=uke(e),u=Lh(a,0),f=O0(u)==a.length&&a!=" ",h="",g=!1,v=!1,_=!1;sk&&sk.view==t&&sk.scope==s&&(h=sk.prefix+" ",mge.indexOf(e.keyCode)<0&&(v=!0,sk=null));let A=new Set,O=z=>{if(z){for(let q of z.run)if(!A.has(q)&&(A.add(q),q(t,e)))return z.stopPropagation&&(_=!0),!0;z.preventDefault&&(z.stopPropagation&&(_=!0),v=!0)}return!1},N=r[s],L,j;return N&&(O(N[h+rz(a,e,!f)])?g=!0:f&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Fs.windows&&e.ctrlKey&&e.altKey)&&(L=pk[e.keyCode])&&L!=a?(O(N[h+rz(L,e,!0)])||e.shiftKey&&(j=zP[e.keyCode])!=a&&j!=L&&O(N[h+rz(j,e,!1)]))&&(g=!0):f&&e.shiftKey&&O(N[h+rz(a,e,!0)])&&(g=!0),!g&&O(N._any)&&(g=!0)),v&&(g=!0),g&&_&&e.stopPropagation(),g}class pI{constructor(e,t,s,a,u){this.className=e,this.left=t,this.top=s,this.width=a,this.height=u}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,s){if(s.empty){let a=e.coordsAtPos(s.head,s.assoc||1);if(!a)return[];let u=Dge(e);return[new pI(t,a.left-u.left,a.top-u.top,null,a.bottom-a.top)]}else return zEe(e,t,s)}}function Dge(r){let e=r.scrollDOM.getBoundingClientRect();return{left:(r.textDirection==mu.LTR?e.left:e.right-r.scrollDOM.clientWidth*r.scaleX)-r.scrollDOM.scrollLeft*r.scaleX,top:e.top-r.scrollDOM.scrollTop*r.scaleY}}function vue(r,e,t){let s=Yn.cursor(e);return{from:Math.max(t.from,r.moveToLineBoundary(s,!1,!0).from),to:Math.min(t.to,r.moveToLineBoundary(s,!0,!0).from),type:xg.Text}}function zEe(r,e,t){if(t.to<=r.viewport.from||t.from>=r.viewport.to)return[];let s=Math.max(t.from,r.viewport.from),a=Math.min(t.to,r.viewport.to),u=r.textDirection==mu.LTR,f=r.contentDOM,h=f.getBoundingClientRect(),g=Dge(r),v=f.querySelector(".cm-line"),_=v&&window.getComputedStyle(v),A=h.left+(_?parseInt(_.paddingLeft)+Math.min(0,parseInt(_.textIndent)):0),O=h.right-(_?parseInt(_.paddingRight):0),N=Gne(r,s),L=Gne(r,a),j=N.type==xg.Text?N:null,z=L.type==xg.Text?L:null;if(j&&(r.lineWrapping||N.widgetLineBreaks)&&(j=vue(r,s,j)),z&&(r.lineWrapping||L.widgetLineBreaks)&&(z=vue(r,a,z)),j&&z&&j.from==z.from)return ee(F(t.from,t.to,j));{let te=j?F(t.from,null,j):oe(N,!1),se=z?F(null,t.to,z):oe(L,!0),X=[];return(j||N).to<(z||L).from-(j&&z?1:0)||N.widgetLineBreaks>1&&te.bottom+r.defaultLineHeight/2<se.top?X.push(q(A,te.bottom,O,se.top)):te.bottom<se.top&&r.elementAtHeight((te.bottom+se.top)/2).type==xg.Text&&(te.bottom=se.top=(te.bottom+se.top)/2),ee(te).concat(X).concat(ee(se))}function q(te,se,X,we){return new pI(e,te-g.left,se-g.top-.01,X-te,we-se+.01)}function ee({top:te,bottom:se,horizontal:X}){let we=[];for(let ye=0;ye<X.length;ye+=2)we.push(q(X[ye],te,X[ye+1],se));return we}function F(te,se,X){let we=1e9,ye=-1e9,Te=[];function _e(Je,ft,V,ut,et){let Et=r.coordsAtPos(Je,Je==X.to?-2:2),xt=r.coordsAtPos(V,V==X.from?2:-2);!Et||!xt||(we=Math.min(Et.top,xt.top,we),ye=Math.max(Et.bottom,xt.bottom,ye),et==mu.LTR?Te.push(u&&ft?A:Et.left,u&&ut?O:xt.right):Te.push(!u&&ut?A:xt.left,!u&&ft?O:Et.right))}let ge=te!=null?te:X.from,nt=se!=null?se:X.to;for(let Je of r.visibleRanges)if(Je.to>ge&&Je.from<nt)for(let ft=Math.max(Je.from,ge),V=Math.min(Je.to,nt);;){let ut=r.state.doc.lineAt(ft);for(let et of r.bidiSpans(ut)){let Et=et.from+ut.from,xt=et.to+ut.from;if(Et>=V)break;xt>ft&&_e(Math.max(Et,ft),te==null&&Et<=ge,Math.min(xt,V),se==null&&xt>=nt,et.dir)}if(ft=ut.to+1,ft>=V)break}return Te.length==0&&_e(ge,te==null,nt,se==null,r.textDirection),{top:we,bottom:ye,horizontal:Te}}function oe(te,se){let X=h.top+(se?te.top:te.bottom);return{top:X,bottom:X,horizontal:[]}}}function VEe(r,e){return r.constructor==e.constructor&&r.eq(e)}class UEe{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(zz)!=e.state.facet(zz)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,s=e.facet(zz);for(;t<s.length&&s[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,s)=>!VEe(t,this.drawn[s]))){let t=this.dom.firstChild,s=0;for(let a of e)a.update&&t&&a.constructor&&this.drawn[s].constructor&&a.update(t,this.drawn[s])?(t=t.nextSibling,s++):this.dom.insertBefore(a.draw(),t);for(;t;){let a=t.nextSibling;t.remove(),t=a}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const zz=Ds.define();function Oge(r){return[mf.define(e=>new UEe(e,r)),zz.of(r)]}const Mge=!Fs.ios,ZP=Ds.define({combine(r){return pv(r,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function WEe(r={}){return[ZP.of(r),jEe,ZEe,qEe,ege.of(!0)]}function Rge(r){return r.startState.facet(ZP)!=r.state.facet(ZP)}const jEe=Oge({above:!0,markers(r){let{state:e}=r,t=e.facet(ZP),s=[];for(let a of e.selection.ranges){let u=a==e.selection.main;if(a.empty?!u||Mge:t.drawRangeCursor){let f=u?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",h=a.empty?a:Yn.cursor(a.head,a.head>a.anchor?-1:1);for(let g of pI.forRange(r,f,h))s.push(g)}}return s},update(r,e){r.transactions.some(s=>s.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Rge(r);return t&&yue(r.state,e),r.docChanged||r.selectionSet||t},mount(r,e){yue(e.state,r)},class:"cm-cursorLayer"});function yue(r,e){e.style.animationDuration=r.facet(ZP).cursorBlinkRate+"ms"}const ZEe=Oge({above:!1,markers(r){return r.state.selection.ranges.map(e=>e.empty?[]:pI.forRange(r,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(r,e){return r.docChanged||r.selectionSet||r.viewportChanged||Rge(r)},class:"cm-selectionLayer"}),Nge={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Mge&&(Nge[".cm-line"].caretColor="transparent !important");const qEe=wO.highest(xs.theme(Nge)),Pge=Ii.define({map(r,e){return r==null?null:e.mapPos(r)}}),_P=md.define({create(){return null},update(r,e){return r!=null&&(r=e.changes.mapPos(r)),e.effects.reduce((t,s)=>s.is(Pge)?s.value:t,r)}}),GEe=mf.fromClass(class{constructor(r){this.view=r,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(r){var e;let t=r.state.field(_P);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(r.startState.field(_P)!=t||r.docChanged||r.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:r}=this,e=r.state.field(_P),t=e!=null&&r.coordsAtPos(e);if(!t)return null;let s=r.scrollDOM.getBoundingClientRect();return{left:t.left-s.left+r.scrollDOM.scrollLeft*r.scaleX,top:t.top-s.top+r.scrollDOM.scrollTop*r.scaleY,height:t.bottom-t.top}}drawCursor(r){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;r?(this.cursor.style.left=r.left/e+"px",this.cursor.style.top=r.top/t+"px",this.cursor.style.height=r.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(r){this.view.state.field(_P)!=r&&this.view.dispatch({effects:Pge.of(r)})}},{eventObservers:{dragover(r){this.setDropPos(this.view.posAtCoords({x:r.clientX,y:r.clientY}))},dragleave(r){(r.target==this.view.contentDOM||!this.view.contentDOM.contains(r.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function KEe(){return[_P,GEe]}function wue(r,e,t,s,a){e.lastIndex=0;for(let u=r.iterRange(t,s),f=t,h;!u.next().done;f+=u.value.length)if(!u.lineBreak)for(;h=e.exec(u.value);)a(f+h.index,h)}function YEe(r,e){let t=r.visibleRanges;if(t.length==1&&t[0].from==r.viewport.from&&t[0].to==r.viewport.to)return t;let s=[];for(let{from:a,to:u}of t)a=Math.max(r.state.doc.lineAt(a).from,a-e),u=Math.min(r.state.doc.lineAt(u).to,u+e),s.length&&s[s.length-1].to>=a?s[s.length-1].to=u:s.push({from:a,to:u});return s}class XEe{constructor(e){const{regexp:t,decoration:s,decorate:a,boundary:u,maxLength:f=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,a)this.addMatch=(h,g,v,_)=>a(_,v,v+h[0].length,h,g);else if(typeof s=="function")this.addMatch=(h,g,v,_)=>{let A=s(h,g,v);A&&_(v,v+h[0].length,A)};else if(s)this.addMatch=(h,g,v,_)=>_(v,v+h[0].length,s);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=u,this.maxLength=f}createDeco(e){let t=new mk,s=t.add.bind(t);for(let{from:a,to:u}of YEe(e,this.maxLength))wue(e.state.doc,this.regexp,a,u,(f,h)=>this.addMatch(h,e,f,s));return t.finish()}updateDeco(e,t){let s=1e9,a=-1;return e.docChanged&&e.changes.iterChanges((u,f,h,g)=>{g>e.view.viewport.from&&h<e.view.viewport.to&&(s=Math.min(h,s),a=Math.max(g,a))}),e.viewportChanged||a-s>1e3?this.createDeco(e.view):a>-1?this.updateRange(e.view,t.map(e.changes),s,a):t}updateRange(e,t,s,a){for(let u of e.visibleRanges){let f=Math.max(u.from,s),h=Math.min(u.to,a);if(h>f){let g=e.state.doc.lineAt(f),v=g.to<h?e.state.doc.lineAt(h):g,_=Math.max(u.from,g.from),A=Math.min(u.to,v.to);if(this.boundary){for(;f>g.from;f--)if(this.boundary.test(g.text[f-1-g.from])){_=f;break}for(;h<v.to;h++)if(this.boundary.test(v.text[h-v.from])){A=h;break}}let O=[],N,L=(j,z,q)=>O.push(q.range(j,z));if(g==v)for(this.regexp.lastIndex=_-g.from;(N=this.regexp.exec(g.text))&&N.index<A-g.from;)this.addMatch(N,e,N.index+g.from,L);else wue(e.state.doc,this.regexp,_,A,(j,z)=>this.addMatch(z,e,j,L));t=t.update({filterFrom:_,filterTo:A,filter:(j,z)=>j<_||z>A,add:O})}}return t}}const Qne=/x/.unicode!=null?"gu":"g",JEe=new RegExp(`[\0-\b
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Qne),QEe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Pte=null;function eAe(){var r;if(Pte==null&&typeof document<"u"&&document.body){let e=document.body.style;Pte=((r=e.tabSize)!==null&&r!==void 0?r:e.MozTabSize)!=null}return Pte||!1}const Vz=Ds.define({combine(r){let e=pv(r,{render:null,specialChars:JEe,addSpecialChars:null});return(e.replaceTabs=!eAe())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Qne)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Qne)),e}});function tAe(r={}){return[Vz.of(r),nAe()]}let _ue=null;function nAe(){return _ue||(_ue=mf.fromClass(class{constructor(r){this.view=r,this.decorations=ti.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(r.state.facet(Vz)),this.decorations=this.decorator.createDeco(r)}makeDecorator(r){return new XEe({regexp:r.specialChars,decoration:(e,t,s)=>{let{doc:a}=t.state,u=Lh(e[0],0);if(u==9){let f=a.lineAt(s),h=t.state.tabSize,g=_O(f.text,h,s-f.from);return ti.replace({widget:new iAe((h-g%h)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[u]||(this.decorationCache[u]=ti.replace({widget:new rAe(r,u)}))},boundary:r.replaceTabs?void 0:/[^]/})}update(r){let e=r.state.facet(Vz);r.startState.facet(Vz)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(r.view)):this.decorations=this.decorator.updateDeco(r,this.decorations)}},{decorations:r=>r.decorations}))}const oAe="\u2022";function sAe(r){return r>=32?oAe:r==10?"\u2424":String.fromCharCode(9216+r)}class rAe extends Sk{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=sAe(this.code),s=e.state.phrase("Control character")+" "+(QEe[this.code]||"0x"+this.code.toString(16)),a=this.options.render&&this.options.render(this.code,s,t);if(a)return a;let u=document.createElement("span");return u.textContent=t,u.title=s,u.setAttribute("aria-label",s),u.className="cm-specialChar",u}ignoreEvent(){return!1}}class iAe extends Sk{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function aAe(){return cAe}const lAe=ti.line({class:"cm-activeLine"}),cAe=mf.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.docChanged||r.selectionSet)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=-1,t=[];for(let s of r.state.selection.ranges){let a=r.lineBlockAt(s.head);a.from>e&&(t.push(lAe.range(a.from)),e=a.from)}return ti.set(t)}},{decorations:r=>r.decorations}),eoe=2e3;function uAe(r,e,t){let s=Math.min(e.line,t.line),a=Math.max(e.line,t.line),u=[];if(e.off>eoe||t.off>eoe||e.col<0||t.col<0){let f=Math.min(e.off,t.off),h=Math.max(e.off,t.off);for(let g=s;g<=a;g++){let v=r.doc.line(g);v.length<=h&&u.push(Yn.range(v.from+f,v.to+h))}}else{let f=Math.min(e.col,t.col),h=Math.max(e.col,t.col);for(let g=s;g<=a;g++){let v=r.doc.line(g),_=Nne(v.text,f,r.tabSize,!0);if(_<0)u.push(Yn.cursor(v.to));else{let A=Nne(v.text,h,r.tabSize);u.push(Yn.range(v.from+_,v.from+A))}}}return u}function fAe(r,e){let t=r.coordsAtPos(r.viewport.from);return t?Math.round(Math.abs((t.left-e)/r.defaultCharacterWidth)):-1}function Cue(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1),s=r.state.doc.lineAt(t),a=t-s.from,u=a>eoe?-1:a==s.length?fAe(r,e.clientX):_O(s.text,r.state.tabSize,t-s.from);return{line:s.number,col:u,off:a}}function dAe(r,e){let t=Cue(r,e),s=r.state.selection;return t?{update(a){if(a.docChanged){let u=a.changes.mapPos(a.startState.doc.line(t.line).from),f=a.state.doc.lineAt(u);t={line:f.number,col:t.col,off:Math.min(t.off,f.length)},s=s.map(a.changes)}},get(a,u,f){let h=Cue(r,a);if(!h)return s;let g=uAe(r.state,t,h);return g.length?f?Yn.create(g.concat(s.ranges)):Yn.create(g):s}}:null}function hAe(r){let e=(r==null?void 0:r.eventFilter)||(t=>t.altKey&&t.button==0);return xs.mouseSelectionStyle.of((t,s)=>e(s)?dAe(t,s):null)}const mAe={Alt:[18,r=>!!r.altKey],Control:[17,r=>!!r.ctrlKey],Shift:[16,r=>!!r.shiftKey],Meta:[91,r=>!!r.metaKey]},gAe={style:"cursor: crosshair"};function pAe(r={}){let[e,t]=mAe[r.key||"Alt"],s=mf.fromClass(class{constructor(a){this.view=a,this.isDown=!1}set(a){this.isDown!=a&&(this.isDown=a,this.view.update([]))}},{eventObservers:{keydown(a){this.set(a.keyCode==e||t(a))},keyup(a){(a.keyCode==e||!t(a))&&this.set(!1)},mousemove(a){this.set(t(a))}}});return[s,xs.contentAttributes.of(a=>{var u;return!((u=a.plugin(s))===null||u===void 0)&&u.isDown?gAe:null})]}const iz="-10000px";class Ige{constructor(e,t,s){this.facet=t,this.createTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(a=>a),this.tooltipViews=this.tooltips.map(s)}update(e){var t;let s=e.state.facet(this.facet),a=s.filter(f=>f);if(s===this.input){for(let f of this.tooltipViews)f.update&&f.update(e);return!1}let u=[];for(let f=0;f<a.length;f++){let h=a[f],g=-1;if(!!h){for(let v=0;v<this.tooltips.length;v++){let _=this.tooltips[v];_&&_.create==h.create&&(g=v)}if(g<0)u[f]=this.createTooltipView(h);else{let v=u[f]=this.tooltipViews[g];v.update&&v.update(e)}}}for(let f of this.tooltipViews)u.indexOf(f)<0&&(f.dom.remove(),(t=f.destroy)===null||t===void 0||t.call(f));return this.input=s,this.tooltips=a,this.tooltipViews=u,!0}}function bAe(r){let{win:e}=r;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Ite=Ds.define({combine:r=>{var e,t,s;return{position:Fs.ios?"absolute":((e=r.find(a=>a.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=r.find(a=>a.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((s=r.find(a=>a.tooltipSpace))===null||s===void 0?void 0:s.tooltipSpace)||bAe}}}),Sue=new WeakMap,Bge=mf.fromClass(class{constructor(r){this.view=r,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=r.state.facet(Ite);this.position=e.position,this.parent=e.parent,this.classes=r.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Ige(r,XV,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),r.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let r of this.manager.tooltipViews)this.intersectionObserver.observe(r.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(r){r.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(r);e&&this.observeIntersection();let t=e||r.geometryChanged,s=r.state.facet(Ite);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let a of this.manager.tooltipViews)a.dom.style.position=this.position;t=!0}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();for(let a of this.manager.tooltipViews)this.container.appendChild(a.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(r){let e=r.create(this.view);if(e.dom.classList.add("cm-tooltip"),r.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=iz,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var r,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(r=t.destroy)===null||r===void 0||r.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let r=this.view.dom.getBoundingClientRect(),e=1,t=1,s=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{offsetParent:a}=this.manager.tooltipViews[0].dom;s=!!(a&&a!=this.container.ownerDocument.body)}if(s||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(e=a.width/this.parent.offsetWidth,t=a.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:r,parent:this.parent?this.container.getBoundingClientRect():r,pos:this.manager.tooltips.map((a,u)=>{let f=this.manager.tooltipViews[u];return f.getCoords?f.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Ite).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:s}}writeMeasure(r){var e;if(r.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let h of this.manager.tooltipViews)h.dom.style.position="absolute"}let{editor:t,space:s,scaleX:a,scaleY:u}=r,f=[];for(let h=0;h<this.manager.tooltips.length;h++){let g=this.manager.tooltips[h],v=this.manager.tooltipViews[h],{dom:_}=v,A=r.pos[h],O=r.size[h];if(!A||A.bottom<=Math.max(t.top,s.top)||A.top>=Math.min(t.bottom,s.bottom)||A.right<Math.max(t.left,s.left)-.1||A.left>Math.min(t.right,s.right)+.1){_.style.top=iz;continue}let N=g.arrow?v.dom.querySelector(".cm-tooltip-arrow"):null,L=N?7:0,j=O.right-O.left,z=(e=Sue.get(v))!==null&&e!==void 0?e:O.bottom-O.top,q=v.offset||yAe,ee=this.view.textDirection==mu.LTR,F=O.width>s.right-s.left?ee?s.left:s.right-O.width:ee?Math.min(A.left-(N?14:0)+q.x,s.right-j):Math.max(s.left,A.left-j+(N?14:0)-q.x),oe=!!g.above;!g.strictSide&&(oe?A.top-(O.bottom-O.top)-q.y<s.top:A.bottom+(O.bottom-O.top)+q.y>s.bottom)&&oe==s.bottom-A.bottom>A.top-s.top&&(oe=!oe);let te=(oe?A.top-s.top:s.bottom-A.bottom)-L;if(te<z&&v.resize!==!1){if(te<this.view.defaultLineHeight){_.style.top=iz;continue}Sue.set(v,z),_.style.height=(z=te)/u+"px"}else _.style.height&&(_.style.height="");let se=oe?A.top-z-L-q.y:A.bottom+L+q.y,X=F+j;if(v.overlap!==!0)for(let we of f)we.left<X&&we.right>F&&we.top<se+z&&we.bottom>se&&(se=oe?we.top-z-2-L:we.bottom+L+2);if(this.position=="absolute"?(_.style.top=(se-r.parent.top)/u+"px",_.style.left=(F-r.parent.left)/a+"px"):(_.style.top=se/u+"px",_.style.left=F/a+"px"),N){let we=A.left+(ee?q.x:-q.x)-(F+14-7);N.style.left=we/a+"px"}v.overlap!==!0&&f.push({left:F,top:se,right:X,bottom:se+z}),_.classList.toggle("cm-tooltip-above",oe),_.classList.toggle("cm-tooltip-below",!oe),v.positioned&&v.positioned(r.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let r of this.manager.tooltipViews)r.dom.style.top=iz}},{eventObservers:{scroll(){this.maybeMeasure()}}}),vAe=xs.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),yAe={x:0,y:0},XV=Ds.define({enables:[Bge,vAe]}),gV=Ds.define();class Woe{static create(e){return new Woe(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ige(e,gV,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const wAe=XV.compute([gV],r=>{let e=r.facet(gV).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Woe.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class _Ae{constructor(e,t,s,a,u){this.view=e,this.source=t,this.field=s,this.setHover=a,this.hoverTime=u,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,s=e.docView.nearest(t.target);if(!s)return;let a,u=1;if(s instanceof ak)a=s.posAtStart;else{if(a=e.posAtCoords(t),a==null)return;let h=e.coordsAtPos(a);if(!h||t.y<h.top||t.y>h.bottom||t.x<h.left-e.defaultCharacterWidth||t.x>h.right+e.defaultCharacterWidth)return;let g=e.bidiSpans(e.state.doc.lineAt(a)).find(_=>_.from<=a&&_.to>=a),v=g&&g.dir==mu.RTL?-1:1;u=t.x<h.left?-v:v}let f=this.source(e,a,u);if(f!=null&&f.then){let h=this.pending={pos:a};f.then(g=>{this.pending==h&&(this.pending=null,g&&e.dispatch({effects:this.setHover.of(g)}))},g=>R0(e.state,g,"hover tooltip"))}else f&&e.dispatch({effects:this.setHover.of(f)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let s=this.active;if(s&&!kue(this.lastMove.target)||this.pending){let{pos:a}=s||this.pending,u=(t=s==null?void 0:s.end)!==null&&t!==void 0?t:a;(a==u?this.view.posAtCoords(this.lastMove)!=a:!CAe(this.view,a,u,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!kue(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function kue(r){for(let e=r;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function CAe(r,e,t,s,a,u){let f=r.scrollDOM.getBoundingClientRect(),h=r.documentTop+r.documentPadding.top+r.contentHeight;if(f.left>s||f.right<s||f.top>a||Math.min(f.bottom,h)<a)return!1;let g=r.posAtCoords({x:s,y:a},!1);return g>=e&&g<=t}function SAe(r,e={}){let t=Ii.define(),s=md.define({create(){return null},update(a,u){if(a&&(e.hideOnChange&&(u.docChanged||u.selection)||e.hideOn&&e.hideOn(u,a)))return null;if(a&&u.docChanged){let f=u.changes.mapPos(a.pos,-1,Ag.TrackDel);if(f==null)return null;let h=Object.assign(Object.create(null),a);h.pos=f,a.end!=null&&(h.end=u.changes.mapPos(a.end)),a=h}for(let f of u.effects)f.is(t)&&(a=f.value),f.is(kAe)&&(a=null);return a},provide:a=>gV.from(a)});return[s,mf.define(a=>new _Ae(a,r,s,t,e.hoverTime||300)),wAe]}function Lge(r,e){let t=r.plugin(Bge);if(!t)return null;let s=t.manager.tooltips.indexOf(e);return s<0?null:t.manager.tooltipViews[s]}const kAe=Ii.define(),Eue=Ds.define({combine(r){let e,t;for(let s of r)e=e||s.topContainer,t=t||s.bottomContainer;return{topContainer:e,bottomContainer:t}}});function qP(r,e){let t=r.plugin(Fge),s=t?t.specs.indexOf(e):-1;return s>-1?t.panels[s]:null}const Fge=mf.fromClass(class{constructor(r){this.input=r.state.facet(GP),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(r));let e=r.state.facet(Eue);this.top=new az(r,!0,e.topContainer),this.bottom=new az(r,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(r){let e=r.state.facet(Eue);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new az(r.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new az(r.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=r.state.facet(GP);if(t!=this.input){let s=t.filter(g=>g),a=[],u=[],f=[],h=[];for(let g of s){let v=this.specs.indexOf(g),_;v<0?(_=g(r.view),h.push(_)):(_=this.panels[v],_.update&&_.update(r)),a.push(_),(_.top?u:f).push(_)}this.specs=s,this.panels=a,this.top.sync(u),this.bottom.sync(f);for(let g of h)g.dom.classList.add("cm-panel"),g.mount&&g.mount()}else for(let s of this.panels)s.update&&s.update(r)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:r=>xs.scrollMargins.of(e=>{let t=e.plugin(r);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class az{constructor(e,t,s){this.view=e,this.top=t,this.container=s,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Aue(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Aue(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Aue(r){let e=r.nextSibling;return r.remove(),e}const GP=Ds.define({enables:Fge});class c2 extends Gx{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}c2.prototype.elementClass="";c2.prototype.toDOM=void 0;c2.prototype.mapMode=Ag.TrackBefore;c2.prototype.startSide=c2.prototype.endSide=-1;c2.prototype.point=!0;const Uz=Ds.define(),EAe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Xa.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},RP=Ds.define();function Hge(r){return[$ge(),RP.of(Object.assign(Object.assign({},EAe),r))]}const toe=Ds.define({combine:r=>r.some(e=>e)});function $ge(r){let e=[AAe];return r&&r.fixed===!1&&e.push(toe.of(!0)),e}const AAe=mf.fromClass(class{constructor(r){this.view=r,this.prevViewport=r.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=r.state.facet(RP).map(e=>new Tue(r,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!r.state.facet(toe),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),r.scrollDOM.insertBefore(this.dom,r.contentDOM)}update(r){if(this.updateGutters(r)){let e=this.prevViewport,t=r.view.viewport,s=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(s<(t.to-t.from)*.8)}r.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(toe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=r.view.viewport}syncGutters(r){let e=this.dom.nextSibling;r&&this.dom.remove();let t=Xa.iter(this.view.state.facet(Uz),this.view.viewport.from),s=[],a=this.gutters.map(u=>new xAe(u,this.view.viewport,-this.view.documentPadding.top));for(let u of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(u.type)){let f=!0;for(let h of u.type)if(h.type==xg.Text&&f){noe(t,s,h.from);for(let g of a)g.line(this.view,h,s);f=!1}else if(h.widget)for(let g of a)g.widget(this.view,h)}else if(u.type==xg.Text){noe(t,s,u.from);for(let f of a)f.line(this.view,u,s)}else if(u.widget)for(let f of a)f.widget(this.view,u);for(let u of a)u.finish();r&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(r){let e=r.startState.facet(RP),t=r.state.facet(RP),s=r.docChanged||r.heightChanged||r.viewportChanged||!Xa.eq(r.startState.facet(Uz),r.state.facet(Uz),r.view.viewport.from,r.view.viewport.to);if(e==t)for(let a of this.gutters)a.update(r)&&(s=!0);else{s=!0;let a=[];for(let u of t){let f=e.indexOf(u);f<0?a.push(new Tue(this.view,u)):(this.gutters[f].update(r),a.push(this.gutters[f]))}for(let u of this.gutters)u.dom.remove(),a.indexOf(u)<0&&u.destroy();for(let u of a)this.dom.appendChild(u.dom);this.gutters=a}return s}destroy(){for(let r of this.gutters)r.destroy();this.dom.remove()}},{provide:r=>xs.scrollMargins.of(e=>{let t=e.plugin(r);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==mu.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function xue(r){return Array.isArray(r)?r:[r]}function noe(r,e,t){for(;r.value&&r.from<=t;)r.from==t&&e.push(r.value),r.next()}class xAe{constructor(e,t,s){this.gutter=e,this.height=s,this.i=0,this.cursor=Xa.iter(e.markers,t.from)}addElement(e,t,s){let{gutter:a}=this,u=(t.top-this.height)/e.scaleY,f=t.height/e.scaleY;if(this.i==a.elements.length){let h=new zge(e,f,u,s);a.elements.push(h),a.dom.appendChild(h.dom)}else a.elements[this.i].update(e,f,u,s);this.height=t.bottom,this.i++}line(e,t,s){let a=[];noe(this.cursor,a,t.from),s.length&&(a=a.concat(s));let u=this.gutter.config.lineMarker(e,t,a);u&&a.unshift(u);let f=this.gutter;a.length==0&&!f.config.renderEmptyElements||this.addElement(e,t,a)}widget(e,t){let s=this.gutter.config.widgetMarker(e,t.widget,t);s&&this.addElement(e,t,[s])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Tue{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let s in t.domEventHandlers)this.dom.addEventListener(s,a=>{let u=a.target,f;if(u!=this.dom&&this.dom.contains(u)){for(;u.parentNode!=this.dom;)u=u.parentNode;let g=u.getBoundingClientRect();f=(g.top+g.bottom)/2}else f=a.clientY;let h=e.lineBlockAtHeight(f-e.documentTop);t.domEventHandlers[s](e,h,a)&&a.preventDefault()});this.markers=xue(t.markers(e)),t.initialSpacer&&(this.spacer=new zge(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=xue(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let a=this.config.updateSpacer(this.spacer.markers[0],e);a!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[a])}let s=e.view.viewport;return!Xa.eq(this.markers,t,s.from,s.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class zge{constructor(e,t,s,a){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,s,a)}update(e,t,s,a){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=s&&(this.dom.style.marginTop=(this.above=s)?s+"px":""),TAe(this.markers,a)||this.setMarkers(e,a)}setMarkers(e,t){let s="cm-gutterElement",a=this.dom.firstChild;for(let u=0,f=0;;){let h=f,g=u<t.length?t[u++]:null,v=!1;if(g){let _=g.elementClass;_&&(s+=" "+_);for(let A=f;A<this.markers.length;A++)if(this.markers[A].compare(g)){h=A,v=!0;break}}else h=this.markers.length;for(;f<h;){let _=this.markers[f++];if(_.toDOM){_.destroy(a);let A=a.nextSibling;a.remove(),a=A}}if(!g)break;g.toDOM&&(v?a=a.nextSibling:this.dom.insertBefore(g.toDOM(e),a)),v&&f++}this.dom.className=s,this.markers=t}destroy(){this.setMarkers(null,[])}}function TAe(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].compare(e[t]))return!1;return!0}const DAe=Ds.define(),VD=Ds.define({combine(r){return pv(r,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let s=Object.assign({},e);for(let a in t){let u=s[a],f=t[a];s[a]=u?(h,g,v)=>u(h,g,v)||f(h,g,v):f}return s}})}});class Bte extends c2{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Lte(r,e){return r.state.facet(VD).formatNumber(e,r.state)}const OAe=RP.compute([VD],r=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(DAe)},lineMarker(e,t,s){return s.some(a=>a.toDOM)?null:new Bte(Lte(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(VD)!=e.state.facet(VD),initialSpacer(e){return new Bte(Lte(e,Due(e.state.doc.lines)))},updateSpacer(e,t){let s=Lte(t.view,Due(t.view.state.doc.lines));return s==e.number?e:new Bte(s)},domEventHandlers:r.facet(VD).domEventHandlers}));function MAe(r={}){return[VD.of(r),$ge(),OAe]}function Due(r){let e=9;for(;e<r;)e=e*10+9;return e}const RAe=new class extends c2{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},NAe=Uz.compute(["selection"],r=>{let e=[],t=-1;for(let s of r.selection.ranges){let a=r.doc.lineAt(s.head).from;a>t&&(t=a,e.push(RAe.range(a)))}return Xa.of(e)});function PAe(){return NAe}const Vge=1024;let IAe=0;class Fte{constructor(e,t){this.from=e,this.to=t}}class ca{constructor(e={}){this.id=IAe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Np.match(e)),t=>{let s=e(t);return s===void 0?null:[this,s]}}}ca.closedBy=new ca({deserialize:r=>r.split(" ")});ca.openedBy=new ca({deserialize:r=>r.split(" ")});ca.group=new ca({deserialize:r=>r.split(" ")});ca.contextHash=new ca({perNode:!0});ca.lookAhead=new ca({perNode:!0});ca.mounted=new ca({perNode:!0});class pV{constructor(e,t,s){this.tree=e,this.overlay=t,this.parser=s}static get(e){return e&&e.props&&e.props[ca.mounted.id]}}const BAe=Object.create(null);class Np{constructor(e,t,s,a=0){this.name=e,this.props=t,this.id=s,this.flags=a}static define(e){let t=e.props&&e.props.length?Object.create(null):BAe,s=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),a=new Np(e.name||"",t,e.id,s);if(e.props){for(let u of e.props)if(Array.isArray(u)||(u=u(a)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[u[0].id]=u[1]}}return a}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ca.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let s in e)for(let a of s.split(" "))t[a]=e[s];return s=>{for(let a=s.prop(ca.group),u=-1;u<(a?a.length:0);u++){let f=t[u<0?s.name:a[u]];if(f)return f}}}}Np.none=new Np("",Object.create(null),0,8);class joe{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let s of this.types){let a=null;for(let u of e){let f=u(s);f&&(a||(a=Object.assign({},s.props)),a[f[0].id]=f[1])}t.push(a?new Np(s.name,a,s.id,s.flags):s)}return new joe(t)}}const lz=new WeakMap,Oue=new WeakMap;var Wd;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays"})(Wd||(Wd={}));class If{constructor(e,t,s,a,u){if(this.type=e,this.children=t,this.positions=s,this.length=a,this.props=null,u&&u.length){this.props=Object.create(null);for(let[f,h]of u)this.props[typeof f=="number"?f:f.id]=h}}toString(){let e=pV.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let s of this.children){let a=s.toString();a&&(t&&(t+=","),t+=a)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new soe(this.topNode,e)}cursorAt(e,t=0,s=0){let a=lz.get(this)||this.topNode,u=new soe(a);return u.moveTo(e,t),lz.set(this,u._tree),u}get topNode(){return new P0(this,0,0,null)}resolve(e,t=0){let s=KP(lz.get(this)||this.topNode,e,t,!1);return lz.set(this,s),s}resolveInner(e,t=0){let s=KP(Oue.get(this)||this.topNode,e,t,!0);return Oue.set(this,s),s}resolveStack(e,t=0){return HAe(this,e,t)}iterate(e){let{enter:t,leave:s,from:a=0,to:u=this.length}=e,f=e.mode||0,h=(f&Wd.IncludeAnonymous)>0;for(let g=this.cursor(f|Wd.IncludeAnonymous);;){let v=!1;if(g.from<=u&&g.to>=a&&(!h&&g.type.isAnonymous||t(g)!==!1)){if(g.firstChild())continue;v=!0}for(;v&&s&&(h||!g.type.isAnonymous)&&s(g),!g.nextSibling();){if(!g.parent())return;v=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Goe(Np.none,this.children,this.positions,0,this.children.length,0,this.length,(t,s,a)=>new If(this.type,t,s,a,this.propValues),e.makeTree||((t,s,a)=>new If(Np.none,t,s,a)))}static build(e){return $Ae(e)}}If.empty=new If(Np.none,[],[],0);class Zoe{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Zoe(this.buffer,this.index)}}class Qx{constructor(e,t,s){this.buffer=e,this.length=t,this.set=s}get type(){return Np.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],s=this.buffer[e+3],a=this.set.types[t],u=a.name;if(/\W/.test(u)&&!a.isError&&(u=JSON.stringify(u)),e+=4,s==e)return u;let f=[];for(;e<s;)f.push(this.childString(e)),e=this.buffer[e+3];return u+"("+f.join(",")+")"}findChild(e,t,s,a,u){let{buffer:f}=this,h=-1;for(let g=e;g!=t&&!(Uge(u,a,f[g+1],f[g+2])&&(h=g,s>0));g=f[g+3]);return h}slice(e,t,s){let a=this.buffer,u=new Uint16Array(t-e),f=0;for(let h=e,g=0;h<t;){u[g++]=a[h++],u[g++]=a[h++]-s;let v=u[g++]=a[h++]-s;u[g++]=a[h++]-e,f=Math.max(f,v)}return new Qx(u,f,this.set)}}function Uge(r,e,t,s){switch(r){case-2:return t<e;case-1:return s>=e&&t<e;case 0:return t<e&&s>e;case 1:return t<=e&&s>e;case 2:return s>e;case 4:return!0}}function KP(r,e,t,s){for(var a;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to<e);){let f=!s&&r instanceof P0&&r.index<0?null:r.parent;if(!f)return r;r=f}let u=s?0:Wd.IgnoreOverlays;if(s)for(let f=r,h=f.parent;h;f=h,h=f.parent)f instanceof P0&&f.index<0&&((a=h.enter(e,t,u))===null||a===void 0?void 0:a.from)!=f.from&&(r=h);for(;;){let f=r.enter(e,t,u);if(!f)return r;r=f}}class Wge{cursor(e=0){return new soe(this,e)}getChild(e,t=null,s=null){let a=Mue(this,e,t,s);return a.length?a[0]:null}getChildren(e,t=null,s=null){return Mue(this,e,t,s)}resolve(e,t=0){return KP(this,e,t,!1)}resolveInner(e,t=0){return KP(this,e,t,!0)}matchContext(e){return ooe(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),s=this;for(;t;){let a=t.lastChild;if(!a||a.to!=t.to)break;a.type.isError&&a.from==a.to?(s=t,t=a.prevSibling):t=a}return s}get node(){return this}get next(){return this.parent}}class P0 extends Wge{constructor(e,t,s,a){super(),this._tree=e,this.from=t,this.index=s,this._parent=a}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,s,a,u=0){for(let f=this;;){for(let{children:h,positions:g}=f._tree,v=t>0?h.length:-1;e!=v;e+=t){let _=h[e],A=g[e]+f.from;if(!!Uge(a,s,A,A+_.length)){if(_ instanceof Qx){if(u&Wd.ExcludeBuffers)continue;let O=_.findChild(0,_.buffer.length,t,s-A,a);if(O>-1)return new ck(new LAe(f,_,e,A),null,O)}else if(u&Wd.IncludeAnonymous||!_.type.isAnonymous||qoe(_)){let O;if(!(u&Wd.IgnoreMounts)&&(O=pV.get(_))&&!O.overlay)return new P0(O.tree,A,e,f);let N=new P0(_,A,e,f);return u&Wd.IncludeAnonymous||!N.type.isAnonymous?N:N.nextChild(t<0?_.children.length-1:0,t,s,a)}}}if(u&Wd.IncludeAnonymous||!f.type.isAnonymous||(f.index>=0?e=f.index+t:e=t<0?-1:f._parent._tree.children.length,f=f._parent,!f))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,s=0){let a;if(!(s&Wd.IgnoreOverlays)&&(a=pV.get(this._tree))&&a.overlay){let u=e-this.from;for(let{from:f,to:h}of a.overlay)if((t>0?f<=u:f<u)&&(t<0?h>=u:h>u))return new P0(a.tree,a.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,s)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Mue(r,e,t,s){let a=r.cursor(),u=[];if(!a.firstChild())return u;if(t!=null){for(;!a.type.is(t);)if(!a.nextSibling())return u}for(;;){if(s!=null&&a.type.is(s))return u;if(a.type.is(e)&&u.push(a.node),!a.nextSibling())return s==null?u:[]}}function ooe(r,e,t=e.length-1){for(let s=r.parent;t>=0;s=s.parent){if(!s)return!1;if(!s.type.isAnonymous){if(e[t]&&e[t]!=s.name)return!1;t--}}return!0}class LAe{constructor(e,t,s,a){this.parent=e,this.buffer=t,this.index=s,this.start=a}}class ck extends Wge{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,s){super(),this.context=e,this._parent=t,this.index=s,this.type=e.buffer.set.types[e.buffer.buffer[s]]}child(e,t,s){let{buffer:a}=this.context,u=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.context.start,s);return u<0?null:new ck(this.context,this,u)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,s=0){if(s&Wd.ExcludeBuffers)return null;let{buffer:a}=this.context,u=a.findChild(this.index+4,a.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return u<0?null:new ck(this.context,this,u)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ck(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ck(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:s}=this.context,a=this.index+4,u=s.buffer[this.index+3];if(u>a){let f=s.buffer[this.index+1];e.push(s.slice(a,u,f)),t.push(0)}return new If(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function jge(r){if(!r.length)return null;if(r.length==1)return r[0];let e=0,t=r[0];for(let u=1;u<r.length;u++){let f=r[u];(f.from>t.from||f.to<t.to)&&(t=f,e=u)}let s=t instanceof P0&&t.index<0?null:t.parent,a=r.slice();return s?a[e]=s:a.splice(e,1),new FAe(a,t)}class FAe{constructor(e,t){this.heads=e,this.node=t}get next(){return jge(this.heads)}}function HAe(r,e,t){let s=r.resolveInner(e,t),a=null;for(let u=s instanceof P0?s:s.context.parent;u;u=u.parent)if(u.index<0){let f=u.parent;(a||(a=[s])).push(f.resolve(e,t)),u=f}else{let f=pV.get(u.tree);if(f&&f.overlay&&f.overlay[0].from<=e&&f.overlay[f.overlay.length-1].to>=e){let h=new P0(f.tree,f.overlay[0].from+u.from,0,null);(a||(a=[s])).push(KP(h,e,t,!1))}}return a?jge(a):s}class soe{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof P0)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let s=e._parent;s;s=s._parent)this.stack.unshift(s.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:s,buffer:a}=this.buffer;return this.type=t||a.set.types[a.buffer[e]],this.from=s+a.buffer[e+1],this.to=s+a.buffer[e+2],!0}yield(e){return e?e instanceof P0?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,s){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,s,this.mode));let{buffer:a}=this.buffer,u=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.buffer.start,s);return u<0?!1:(this.stack.push(this.index),this.yieldBuf(u))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,s=this.mode){return this.buffer?s&Wd.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,s))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wd.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Wd.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,s=this.stack.length-1;if(e<0){let a=s<0?0:this.stack[s]+4;if(this.index!=a)return this.yieldBuf(t.findChild(a,this.index,-1,0,4))}else{let a=t.buffer[this.index+3];if(a<(s<0?t.buffer.length:t.buffer[this.stack[s]+3]))return this.yieldBuf(a)}return s<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,s,{buffer:a}=this;if(a){if(e>0){if(this.index<a.buffer.buffer.length)return!1}else for(let u=0;u<this.index;u++)if(a.buffer.buffer[u+3]<this.index)return!1;({index:t,parent:s}=a)}else({index:t,_parent:s}=this._tree);for(;s;{index:t,_parent:s}=s)if(t>-1)for(let u=t+e,f=e<0?-1:s._tree.children.length;u!=f;u+=e){let h=s._tree.children[u];if(this.mode&Wd.IncludeAnonymous||h instanceof Qx||!h.type.isAnonymous||qoe(h))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,s=0;if(e&&e.context==this.buffer){e:for(let a=this.index,u=this.stack.length;u>=0;){for(let f=e;f;f=f._parent)if(f.index==a){if(a==this.index)return f;t=f,s=u+1;break e}a=this.stack[--u]}}for(let a=s;a<this.stack.length;a++)t=new ck(this.buffer,t,this.stack[a]);return this.bufferNode=new ck(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let s=0;;){let a=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){s++;continue}this.type.isAnonymous||(a=!0)}for(;a&&t&&t(this),a=this.type.isAnonymous,!this.nextSibling();){if(!s)return;this.parent(),s--,a=!0}}}matchContext(e){if(!this.buffer)return ooe(this.node,e);let{buffer:t}=this.buffer,{types:s}=t.set;for(let a=e.length-1,u=this.stack.length-1;a>=0;u--){if(u<0)return ooe(this.node,e,a);let f=s[t.buffer[this.stack[u]]];if(!f.isAnonymous){if(e[a]&&e[a]!=f.name)return!1;a--}}return!0}}function qoe(r){return r.children.some(e=>e instanceof Qx||!e.type.isAnonymous||qoe(e))}function $Ae(r){var e;let{buffer:t,nodeSet:s,maxBufferLength:a=Vge,reused:u=[],minRepeatType:f=s.types.length}=r,h=Array.isArray(t)?new Zoe(t,t.length):t,g=s.types,v=0,_=0;function A(oe,te,se,X,we){let{id:ye,start:Te,end:_e,size:ge}=h,nt=_;for(;ge<0;)if(h.next(),ge==-1){let et=u[ye];se.push(et),X.push(Te-oe);return}else if(ge==-3){v=ye;return}else if(ge==-4){_=ye;return}else throw new RangeError(`Unrecognized record size: ${ge}`);let Je=g[ye],ft,V,ut=Te-oe;if(_e-Te<=a&&(V=j(h.pos-te,we))){let et=new Uint16Array(V.size-V.skip),Et=h.pos-V.size,xt=et.length;for(;h.pos>Et;)xt=z(V.start,et,xt);ft=new Qx(et,_e-V.start,s),ut=V.start-oe}else{let et=h.pos-ge;h.next();let Et=[],xt=[],He=ye>=f?ye:-1,ct=0,an=_e;for(;h.pos>et;)He>=0&&h.id==He&&h.size>=0?(h.end<=an-a&&(N(Et,xt,Te,ct,h.end,an,He,nt),ct=Et.length,an=h.end),h.next()):A(Te,et,Et,xt,He);if(He>=0&&ct>0&&ct<Et.length&&N(Et,xt,Te,ct,Te,an,He,nt),Et.reverse(),xt.reverse(),He>-1&&ct>0){let kt=O(Je);ft=Goe(Je,Et,xt,0,Et.length,0,_e-Te,kt,kt)}else ft=L(Je,Et,xt,_e-Te,nt-_e)}se.push(ft),X.push(ut)}function O(oe){return(te,se,X)=>{let we=0,ye=te.length-1,Te,_e;if(ye>=0&&(Te=te[ye])instanceof If){if(!ye&&Te.type==oe&&Te.length==X)return Te;(_e=Te.prop(ca.lookAhead))&&(we=se[ye]+Te.length+_e)}return L(oe,te,se,X,we)}}function N(oe,te,se,X,we,ye,Te,_e){let ge=[],nt=[];for(;oe.length>X;)ge.push(oe.pop()),nt.push(te.pop()+se-we);oe.push(L(s.types[Te],ge,nt,ye-we,_e-ye)),te.push(we-se)}function L(oe,te,se,X,we=0,ye){if(v){let Te=[ca.contextHash,v];ye=ye?[Te].concat(ye):[Te]}if(we>25){let Te=[ca.lookAhead,we];ye=ye?[Te].concat(ye):[Te]}return new If(oe,te,se,X,ye)}function j(oe,te){let se=h.fork(),X=0,we=0,ye=0,Te=se.end-a,_e={size:0,start:0,skip:0};e:for(let ge=se.pos-oe;se.pos>ge;){let nt=se.size;if(se.id==te&&nt>=0){_e.size=X,_e.start=we,_e.skip=ye,ye+=4,X+=4,se.next();continue}let Je=se.pos-nt;if(nt<0||Je<ge||se.start<Te)break;let ft=se.id>=f?4:0,V=se.start;for(se.next();se.pos>Je;){if(se.size<0)if(se.size==-3)ft+=4;else break e;else se.id>=f&&(ft+=4);se.next()}we=V,X+=nt,ye+=ft}return(te<0||X==oe)&&(_e.size=X,_e.start=we,_e.skip=ye),_e.size>4?_e:void 0}function z(oe,te,se){let{id:X,start:we,end:ye,size:Te}=h;if(h.next(),Te>=0&&X<f){let _e=se;if(Te>4){let ge=h.pos-(Te-4);for(;h.pos>ge;)se=z(oe,te,se)}te[--se]=_e,te[--se]=ye-oe,te[--se]=we-oe,te[--se]=X}else Te==-3?v=X:Te==-4&&(_=X);return se}let q=[],ee=[];for(;h.pos>0;)A(r.start||0,r.bufferStart||0,q,ee,-1);let F=(e=r.length)!==null&&e!==void 0?e:q.length?ee[0]+q[0].length:0;return new If(g[r.topID],q.reverse(),ee.reverse(),F)}const Rue=new WeakMap;function Wz(r,e){if(!r.isAnonymous||e instanceof Qx||e.type!=r)return 1;let t=Rue.get(e);if(t==null){t=1;for(let s of e.children){if(s.type!=r||!(s instanceof If)){t=1;break}t+=Wz(r,s)}Rue.set(e,t)}return t}function Goe(r,e,t,s,a,u,f,h,g){let v=0;for(let L=s;L<a;L++)v+=Wz(r,e[L]);let _=Math.ceil(v*1.5/8),A=[],O=[];function N(L,j,z,q,ee){for(let F=z;F<q;){let oe=F,te=j[F],se=Wz(r,L[F]);for(F++;F<q;F++){let X=Wz(r,L[F]);if(se+X>=_)break;se+=X}if(F==oe+1){if(se>_){let X=L[oe];N(X.children,X.positions,0,X.children.length,j[oe]+ee);continue}A.push(L[oe])}else{let X=j[F-1]+L[F-1].length-te;A.push(Goe(r,L,j,oe,F,te,X,null,g))}O.push(te+ee-u)}}return N(e,t,s,a,0),(h||g)(A,O,f)}class Zx{constructor(e,t,s,a,u=!1,f=!1){this.from=e,this.to=t,this.tree=s,this.offset=a,this.open=(u?1:0)|(f?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],s=!1){let a=[new Zx(0,e.length,e,0,!1,s)];for(let u of t)u.to>e.length&&a.push(u);return a}static applyChanges(e,t,s=128){if(!t.length)return e;let a=[],u=1,f=e.length?e[0]:null;for(let h=0,g=0,v=0;;h++){let _=h<t.length?t[h]:null,A=_?_.fromA:1e9;if(A-g>=s)for(;f&&f.from<A;){let O=f;if(g>=O.from||A<=O.to||v){let N=Math.max(O.from,g)-v,L=Math.min(O.to,A)-v;O=N>=L?null:new Zx(N,L,O.tree,O.offset+v,h>0,!!_)}if(O&&a.push(O),f.to>A)break;f=u<e.length?e[u++]:null}if(!_)break;g=_.toA,v=_.toA-_.toB}return a}}class Zge{startParse(e,t,s){return typeof e=="string"&&(e=new zAe(e)),s=s?s.length?s.map(a=>new Fte(a.from,a.to)):[new Fte(0,0)]:[new Fte(0,e.length)],this.createParse(e,t||[],s)}parse(e,t,s){let a=this.startParse(e,t,s);for(;;){let u=a.advance();if(u)return u}}}class zAe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new ca({perNode:!0});let VAe=0;class Yy{constructor(e,t,s){this.set=e,this.base=t,this.modified=s,this.id=VAe++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Yy([],null,[]);if(t.set.push(t),e)for(let s of e.set)t.set.push(s);return t}static defineModifier(){let e=new bV;return t=>t.modified.indexOf(e)>-1?t:bV.get(t.base||t,t.modified.concat(e).sort((s,a)=>s.id-a.id))}}let UAe=0;class bV{constructor(){this.instances=[],this.id=UAe++}static get(e,t){if(!t.length)return e;let s=t[0].instances.find(h=>h.base==e&&WAe(t,h.modified));if(s)return s;let a=[],u=new Yy(a,e,t);for(let h of t)h.instances.push(u);let f=jAe(t);for(let h of e.set)if(!h.modified.length)for(let g of f)a.push(bV.get(h,g));return u}}function WAe(r,e){return r.length==e.length&&r.every((t,s)=>t==e[s])}function jAe(r){let e=[[]];for(let t=0;t<r.length;t++)for(let s=0,a=e.length;s<a;s++)e.push(e[s].concat(r[t]));return e.sort((t,s)=>s.length-t.length)}function qge(r){let e=Object.create(null);for(let t in r){let s=r[t];Array.isArray(s)||(s=[s]);for(let a of t.split(" "))if(a){let u=[],f=2,h=a;for(let A=0;;){if(h=="..."&&A>0&&A+3==a.length){f=1;break}let O=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(h);if(!O)throw new RangeError("Invalid path: "+a);if(u.push(O[0]=="*"?"":O[0][0]=='"'?JSON.parse(O[0]):O[0]),A+=O[0].length,A==a.length)break;let N=a[A++];if(A==a.length&&N=="!"){f=0;break}if(N!="/")throw new RangeError("Invalid path: "+a);h=a.slice(A)}let g=u.length-1,v=u[g];if(!v)throw new RangeError("Invalid path: "+a);let _=new vV(s,f,g>0?u.slice(0,g):null);e[v]=_.sort(e[v])}}return Gge.add(e)}const Gge=new ca;class vV{constructor(e,t,s,a){this.tags=e,this.mode=t,this.context=s,this.next=a}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}vV.empty=new vV([],2,null);function Kge(r,e){let t=Object.create(null);for(let u of r)if(!Array.isArray(u.tag))t[u.tag.id]=u.class;else for(let f of u.tag)t[f.id]=u.class;let{scope:s,all:a=null}=e||{};return{style:u=>{let f=a;for(let h of u)for(let g of h.set){let v=t[g.id];if(v){f=f?f+" "+v:v;break}}return f},scope:s}}function ZAe(r,e){let t=null;for(let s of r){let a=s.style(e);a&&(t=t?t+" "+a:a)}return t}function qAe(r,e,t,s=0,a=r.length){let u=new GAe(s,Array.isArray(e)?e:[e],t);u.highlightRange(r.cursor(),s,a,"",u.highlighters),u.flush(a)}class GAe{constructor(e,t,s){this.at=e,this.highlighters=t,this.span=s,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,s,a,u){let{type:f,from:h,to:g}=e;if(h>=s||g<=t)return;f.isTop&&(u=this.highlighters.filter(N=>!N.scope||N.scope(f)));let v=a,_=KAe(e)||vV.empty,A=ZAe(u,_.tags);if(A&&(v&&(v+=" "),v+=A,_.mode==1&&(a+=(a?" ":"")+A)),this.startSpan(Math.max(t,h),v),_.opaque)return;let O=e.tree&&e.tree.prop(ca.mounted);if(O&&O.overlay){let N=e.node.enter(O.overlay[0].from+h,1),L=this.highlighters.filter(z=>!z.scope||z.scope(O.tree.type)),j=e.firstChild();for(let z=0,q=h;;z++){let ee=z<O.overlay.length?O.overlay[z]:null,F=ee?ee.from+h:g,oe=Math.max(t,q),te=Math.min(s,F);if(oe<te&&j)for(;e.from<te&&(this.highlightRange(e,oe,te,a,u),this.startSpan(Math.min(te,e.to),v),!(e.to>=F||!e.nextSibling())););if(!ee||F>s)break;q=ee.to+h,q>t&&(this.highlightRange(N.cursor(),Math.max(t,ee.from+h),Math.min(s,q),"",L),this.startSpan(Math.min(s,q),v))}j&&e.parent()}else if(e.firstChild()){O&&(a="");do if(!(e.to<=t)){if(e.from>=s)break;this.highlightRange(e,t,s,a,u),this.startSpan(Math.min(s,e.to),v)}while(e.nextSibling());e.parent()}}}function KAe(r){let e=r.type.prop(Gge);for(;e&&e.context&&!r.matchContext(e.context);)e=e.next;return e||null}const Go=Yy.define,cz=Go(),tk=Go(),Nue=Go(tk),Pue=Go(tk),nk=Go(),uz=Go(nk),Hte=Go(nk),Gy=Go(),Ix=Go(Gy),Zy=Go(),qy=Go(),roe=Go(),cP=Go(roe),fz=Go(),Uo={comment:cz,lineComment:Go(cz),blockComment:Go(cz),docComment:Go(cz),name:tk,variableName:Go(tk),typeName:Nue,tagName:Go(Nue),propertyName:Pue,attributeName:Go(Pue),className:Go(tk),labelName:Go(tk),namespace:Go(tk),macroName:Go(tk),literal:nk,string:uz,docString:Go(uz),character:Go(uz),attributeValue:Go(uz),number:Hte,integer:Go(Hte),float:Go(Hte),bool:Go(nk),regexp:Go(nk),escape:Go(nk),color:Go(nk),url:Go(nk),keyword:Zy,self:Go(Zy),null:Go(Zy),atom:Go(Zy),unit:Go(Zy),modifier:Go(Zy),operatorKeyword:Go(Zy),controlKeyword:Go(Zy),definitionKeyword:Go(Zy),moduleKeyword:Go(Zy),operator:qy,derefOperator:Go(qy),arithmeticOperator:Go(qy),logicOperator:Go(qy),bitwiseOperator:Go(qy),compareOperator:Go(qy),updateOperator:Go(qy),definitionOperator:Go(qy),typeOperator:Go(qy),controlOperator:Go(qy),punctuation:roe,separator:Go(roe),bracket:cP,angleBracket:Go(cP),squareBracket:Go(cP),paren:Go(cP),brace:Go(cP),content:Gy,heading:Ix,heading1:Go(Ix),heading2:Go(Ix),heading3:Go(Ix),heading4:Go(Ix),heading5:Go(Ix),heading6:Go(Ix),contentSeparator:Go(Gy),list:Go(Gy),quote:Go(Gy),emphasis:Go(Gy),strong:Go(Gy),link:Go(Gy),monospace:Go(Gy),strikethrough:Go(Gy),inserted:Go(),deleted:Go(),changed:Go(),invalid:Go(),meta:fz,documentMeta:Go(fz),annotation:Go(fz),processingInstruction:Go(fz),definition:Yy.defineModifier(),constant:Yy.defineModifier(),function:Yy.defineModifier(),standard:Yy.defineModifier(),local:Yy.defineModifier(),special:Yy.defineModifier()};Kge([{tag:Uo.link,class:"tok-link"},{tag:Uo.heading,class:"tok-heading"},{tag:Uo.emphasis,class:"tok-emphasis"},{tag:Uo.strong,class:"tok-strong"},{tag:Uo.keyword,class:"tok-keyword"},{tag:Uo.atom,class:"tok-atom"},{tag:Uo.bool,class:"tok-bool"},{tag:Uo.url,class:"tok-url"},{tag:Uo.labelName,class:"tok-labelName"},{tag:Uo.inserted,class:"tok-inserted"},{tag:Uo.deleted,class:"tok-deleted"},{tag:Uo.literal,class:"tok-literal"},{tag:Uo.string,class:"tok-string"},{tag:Uo.number,class:"tok-number"},{tag:[Uo.regexp,Uo.escape,Uo.special(Uo.string)],class:"tok-string2"},{tag:Uo.variableName,class:"tok-variableName"},{tag:Uo.local(Uo.variableName),class:"tok-variableName tok-local"},{tag:Uo.definition(Uo.variableName),class:"tok-variableName tok-definition"},{tag:Uo.special(Uo.variableName),class:"tok-variableName2"},{tag:Uo.definition(Uo.propertyName),class:"tok-propertyName tok-definition"},{tag:Uo.typeName,class:"tok-typeName"},{tag:Uo.namespace,class:"tok-namespace"},{tag:Uo.className,class:"tok-className"},{tag:Uo.macroName,class:"tok-macroName"},{tag:Uo.propertyName,class:"tok-propertyName"},{tag:Uo.operator,class:"tok-operator"},{tag:Uo.comment,class:"tok-comment"},{tag:Uo.meta,class:"tok-meta"},{tag:Uo.invalid,class:"tok-invalid"},{tag:Uo.punctuation,class:"tok-punctuation"}]);var $te;const UD=new ca;function YAe(r){return Ds.define({combine:r?e=>e.concat(r):void 0})}const XAe=new ca;class hv{constructor(e,t,s=[],a=""){this.data=e,this.name=a,Ea.prototype.hasOwnProperty("tree")||Object.defineProperty(Ea.prototype,"tree",{get(){return Om(this)}}),this.parser=t,this.extension=[vk.of(this),Ea.languageData.of((u,f,h)=>{let g=Iue(u,f,h),v=g.type.prop(UD);if(!v)return[];let _=u.facet(v),A=g.type.prop(XAe);if(A){let O=g.resolve(f-g.from,h);for(let N of A)if(N.test(O,u)){let L=u.facet(N.facet);return N.type=="replace"?L:L.concat(_)}}return _})].concat(s)}isActiveAt(e,t,s=-1){return Iue(e,t,s).type.prop(UD)==this.data}findRegions(e){let t=e.facet(vk);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let s=[],a=(u,f)=>{if(u.prop(UD)==this.data){s.push({from:f,to:f+u.length});return}let h=u.prop(ca.mounted);if(h){if(h.tree.prop(UD)==this.data){if(h.overlay)for(let g of h.overlay)s.push({from:g.from+f,to:g.to+f});else s.push({from:f,to:f+u.length});return}else if(h.overlay){let g=s.length;if(a(h.tree,h.overlay[0].from+f),s.length>g)return}}for(let g=0;g<u.children.length;g++){let v=u.children[g];v instanceof If&&a(v,u.positions[g]+f)}};return a(Om(e),0),s}get allowsNesting(){return!0}}hv.setState=Ii.define();function Iue(r,e,t){let s=r.facet(vk),a=Om(r).topNode;if(!s||s.allowsNesting)for(let u=a;u;u=u.enter(e,t,Wd.ExcludeBuffers))u.type.isTop&&(a=u);return a}class yV extends hv{constructor(e,t,s){super(e,t,[],s),this.parser=t}static define(e){let t=YAe(e.languageData);return new yV(t,e.parser.configure({props:[UD.add(s=>s.isTop?t:void 0)]}),e.name)}configure(e,t){return new yV(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Om(r){let e=r.field(hv.state,!1);return e?e.tree:If.empty}class JAe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let s=this.cursorPos-this.string.length;return e<s||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-s,t-s)}}let uP=null;class wV{constructor(e,t,s=[],a,u,f,h,g){this.parser=e,this.state=t,this.fragments=s,this.tree=a,this.treeLen=u,this.viewport=f,this.skipped=h,this.scheduleOn=g,this.parse=null,this.tempSkipped=[]}static create(e,t,s){return new wV(e,t,[],If.empty,0,s,[],null)}startParse(){return this.parser.startParse(new JAe(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=If.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var s;if(typeof e=="number"){let a=Date.now()+e;e=()=>Date.now()>a}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let a=this.parse.advance();if(a)if(this.fragments=this.withoutTempSkipped(Zx.addTree(a,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(s=this.parse.stoppedAt)!==null&&s!==void 0?s:this.state.doc.length,this.tree=a,this.parse=null,this.treeLen<(t!=null?t:this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Zx.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=uP;uP=this;try{return e()}finally{uP=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Bue(e,t.from,t.to);return e}changes(e,t){let{fragments:s,tree:a,treeLen:u,viewport:f,skipped:h}=this;if(this.takeTree(),!e.empty){let g=[];if(e.iterChangedRanges((v,_,A,O)=>g.push({fromA:v,toA:_,fromB:A,toB:O})),s=Zx.applyChanges(s,g),a=If.empty,u=0,f={from:e.mapPos(f.from,-1),to:e.mapPos(f.to,1)},this.skipped.length){h=[];for(let v of this.skipped){let _=e.mapPos(v.from,1),A=e.mapPos(v.to,-1);_<A&&h.push({from:_,to:A})}}}return new wV(this.parser,t,s,a,u,f,h,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let s=0;s<this.skipped.length;s++){let{from:a,to:u}=this.skipped[s];a<e.to&&u>e.from&&(this.fragments=Bue(this.fragments,a,u),this.skipped.splice(s--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Zge{createParse(t,s,a){let u=a[0].from,f=a[a.length-1].to;return{parsedPos:u,advance(){let g=uP;if(g){for(let v of a)g.tempSkipped.push(v);e&&(g.scheduleOn=g.scheduleOn?Promise.all([g.scheduleOn,e]):e)}return this.parsedPos=f,new If(Np.none,[],[],f-u)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return uP}}function Bue(r,e,t){return Zx.applyChanges(r,[{fromA:e,toA:t,fromB:e,toB:t}])}class aO{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),s=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,s)||t.takeTree(),new aO(t)}static init(e){let t=Math.min(3e3,e.doc.length),s=wV.create(e.facet(vk).parser,e,{from:0,to:t});return s.work(20,t)||s.takeTree(),new aO(s)}}hv.state=md.define({create:aO.init,update(r,e){for(let t of e.effects)if(t.is(hv.setState))return t.value;return e.startState.facet(vk)!=e.state.facet(vk)?aO.init(e.state):r.apply(e)}});let Yge=r=>{let e=setTimeout(()=>r(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Yge=r=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(r,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const zte=typeof navigator<"u"&&(($te=navigator.scheduling)===null||$te===void 0?void 0:$te.isInputPending)?()=>navigator.scheduling.isInputPending():null,QAe=mf.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(hv.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(hv.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Yge(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:s,viewport:{to:a}}=this.view,u=s.field(hv.state);if(u.tree==u.context.tree&&u.context.isDone(a+1e5))return;let f=Date.now()+Math.min(this.chunkBudget,100,e&&!zte?Math.max(25,e.timeRemaining()-5):1e9),h=u.context.treeLen<a&&s.doc.length>a+1e3,g=u.context.work(()=>zte&&zte()||Date.now()>f,a+(h?0:1e5));this.chunkBudget-=Date.now()-t,(g||this.chunkBudget<=0)&&(u.context.takeTree(),this.view.dispatch({effects:hv.setState.of(new aO(u.context))})),this.chunkBudget>0&&!(g&&!h)&&this.scheduleWork(),this.checkAsyncSchedule(u.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>R0(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),vk=Ds.define({combine(r){return r.length?r[0]:null},enables:r=>[hv.state,QAe,xs.contentAttributes.compute([r],e=>{let t=e.facet(r);return t&&t.name?{"data-language":t.name}:{}})]});class exe{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const txe=Ds.define(),Koe=Ds.define({combine:r=>{if(!r.length)return" ";let e=r[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(r[0]));return e}});function _V(r){let e=r.facet(Koe);return e.charCodeAt(0)==9?r.tabSize*e.length:e.length}function YP(r,e){let t="",s=r.tabSize,a=r.facet(Koe)[0];if(a==" "){for(;e>=s;)t+=" ",e-=s;a=" "}for(let u=0;u<e;u++)t+=a;return t}function Yoe(r,e){r instanceof Ea&&(r=new JV(r));for(let s of r.state.facet(txe)){let a=s(r,e);if(a!==void 0)return a}let t=Om(r.state);return t.length>=e?nxe(r,t,e):null}class JV{constructor(e,t={}){this.state=e,this.options=t,this.unit=_V(e)}lineAt(e,t=1){let s=this.state.doc.lineAt(e),{simulateBreak:a,simulateDoubleBreak:u}=this.options;return a!=null&&a>=s.from&&a<=s.to?u&&a==e?{text:"",from:e}:(t<0?a<e:a<=e)?{text:s.text.slice(a-s.from),from:a}:{text:s.text.slice(0,a-s.from),from:s.from}:s}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:s,from:a}=this.lineAt(e,t);return s.slice(e-a,Math.min(s.length,e+100-a))}column(e,t=1){let{text:s,from:a}=this.lineAt(e,t),u=this.countColumn(s,e-a),f=this.options.overrideIndentation?this.options.overrideIndentation(a):-1;return f>-1&&(u+=f-this.countColumn(s,s.search(/\S|$/))),u}countColumn(e,t=e.length){return _O(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:s,from:a}=this.lineAt(e,t),u=this.options.overrideIndentation;if(u){let f=u(a);if(f>-1)return f}return this.countColumn(s,s.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Xge=new ca;function nxe(r,e,t){let s=e.resolveStack(t),a=s.node.enterUnfinishedNodesBefore(t);if(a!=s.node){let u=[];for(let f=a;f!=s.node;f=f.parent)u.push(f);for(let f=u.length-1;f>=0;f--)s={node:u[f],next:s}}return Jge(s,r,t)}function Jge(r,e,t){for(let s=r;s;s=s.next){let a=sxe(s.node);if(a)return a(Xoe.create(e,t,s))}return 0}function oxe(r){return r.pos==r.options.simulateBreak&&r.options.simulateDoubleBreak}function sxe(r){let e=r.type.prop(Xge);if(e)return e;let t=r.firstChild,s;if(t&&(s=t.type.prop(ca.closedBy))){let a=r.lastChild,u=a&&s.indexOf(a.name)>-1;return f=>lxe(f,!0,1,void 0,u&&!oxe(f)?a.from:void 0)}return r.parent==null?rxe:null}function rxe(){return 0}class Xoe extends JV{constructor(e,t,s){super(e.state,e.options),this.base=e,this.pos=t,this.context=s}get node(){return this.context.node}static create(e,t,s){return new Xoe(e,t,s)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let s=e.resolve(t.from);for(;s.parent&&s.parent.from==s.from;)s=s.parent;if(ixe(s,e))break;t=this.state.doc.lineAt(s.from)}return this.lineIndent(t.from)}continue(){return Jge(this.context.next,this.base,this.pos)}}function ixe(r,e){for(let t=e;t;t=t.parent)if(r==t)return!0;return!1}function axe(r){let e=r.node,t=e.childAfter(e.from),s=e.lastChild;if(!t)return null;let a=r.options.simulateBreak,u=r.state.doc.lineAt(t.from),f=a==null||a<=u.from?u.to:Math.min(u.to,a);for(let h=t.to;;){let g=e.childAfter(h);if(!g||g==s)return null;if(!g.type.isSkipped)return g.from<f?t:null;h=g.to}}function lxe(r,e,t,s,a){let u=r.textAfter,f=u.match(/^\s*/)[0].length,h=s&&u.slice(f,f+s.length)==s||a==r.pos+f,g=e?axe(r):null;return g?h?r.column(g.from):r.column(g.to):r.baseIndent+(h?0:r.unit*t)}function Lue({except:r,units:e=1}={}){return t=>{let s=r&&r.test(t.textAfter);return t.baseIndent+(s?0:e*t.unit)}}const cxe=200;function uxe(){return Ea.transactionFilter.of(r=>{if(!r.docChanged||!r.isUserEvent("input.type")&&!r.isUserEvent("input.complete"))return r;let e=r.startState.languageDataAt("indentOnInput",r.startState.selection.main.head);if(!e.length)return r;let t=r.newDoc,{head:s}=r.newSelection.main,a=t.lineAt(s);if(s>a.from+cxe)return r;let u=t.sliceString(a.from,s);if(!e.some(v=>v.test(u)))return r;let{state:f}=r,h=-1,g=[];for(let{head:v}of f.selection.ranges){let _=f.doc.lineAt(v);if(_.from==h)continue;h=_.from;let A=Yoe(f,_.from);if(A==null)continue;let O=/^\s*/.exec(_.text)[0],N=YP(f,A);O!=N&&g.push({from:_.from,to:_.from+O.length,insert:N})}return g.length?[r,{changes:g,sequential:!0}]:r})}const fxe=Ds.define(),Qge=new ca;function dxe(r){let e=r.firstChild,t=r.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?r.to:t.from}:null}function hxe(r,e,t){let s=Om(r);if(s.length<t)return null;let a=s.resolveStack(t,1),u=null;for(let f=a;f;f=f.next){let h=f.node;if(h.to<=t||h.from>t)continue;if(u&&h.from<e)break;let g=h.type.prop(Qge);if(g&&(h.to<s.length-50||s.length==r.doc.length||!mxe(h))){let v=g(h,r);v&&v.from<=t&&v.from>=e&&v.to>t&&(u=v)}}return u}function mxe(r){let e=r.lastChild;return e&&e.to==r.to&&e.type.isError}function CV(r,e,t){for(let s of r.facet(fxe)){let a=s(r,e,t);if(a)return a}return hxe(r,e,t)}function epe(r,e){let t=e.mapPos(r.from,1),s=e.mapPos(r.to,-1);return t>=s?void 0:{from:t,to:s}}const QV=Ii.define({map:epe}),bI=Ii.define({map:epe});function tpe(r){let e=[];for(let{head:t}of r.state.selection.ranges)e.some(s=>s.from<=t&&s.to>=t)||e.push(r.lineBlockAt(t));return e}const Yx=md.define({create(){return ti.none},update(r,e){r=r.map(e.changes);for(let t of e.effects)if(t.is(QV)&&!gxe(r,t.value.from,t.value.to)){let{preparePlaceholder:s}=e.state.facet(Joe),a=s?ti.replace({widget:new Cxe(s(e.state,t.value))}):Fue;r=r.update({add:[a.range(t.value.from,t.value.to)]})}else t.is(bI)&&(r=r.update({filter:(s,a)=>t.value.from!=s||t.value.to!=a,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:s}=e.selection.main;r.between(s,s,(a,u)=>{a<s&&u>s&&(t=!0)}),t&&(r=r.update({filterFrom:s,filterTo:s,filter:(a,u)=>u<=s||a>=s}))}return r},provide:r=>xs.decorations.from(r),toJSON(r,e){let t=[];return r.between(0,e.doc.length,(s,a)=>{t.push(s,a)}),t},fromJSON(r){if(!Array.isArray(r)||r.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<r.length;){let s=r[t++],a=r[t++];if(typeof s!="number"||typeof a!="number")throw new RangeError("Invalid JSON for fold state");e.push(Fue.range(s,a))}return ti.set(e,!0)}});function SV(r,e,t){var s;let a=null;return(s=r.field(Yx,!1))===null||s===void 0||s.between(e,t,(u,f)=>{(!a||a.from>u)&&(a={from:u,to:f})}),a}function gxe(r,e,t){let s=!1;return r.between(e,e,(a,u)=>{a==e&&u==t&&(s=!0)}),s}function npe(r,e){return r.field(Yx,!1)?e:e.concat(Ii.appendConfig.of(spe()))}const pxe=r=>{for(let e of tpe(r)){let t=CV(r.state,e.from,e.to);if(t)return r.dispatch({effects:npe(r.state,[QV.of(t),ope(r,t)])}),!0}return!1},bxe=r=>{if(!r.state.field(Yx,!1))return!1;let e=[];for(let t of tpe(r)){let s=SV(r.state,t.from,t.to);s&&e.push(bI.of(s),ope(r,s,!1))}return e.length&&r.dispatch({effects:e}),e.length>0};function ope(r,e,t=!0){let s=r.state.doc.lineAt(e.from).number,a=r.state.doc.lineAt(e.to).number;return xs.announce.of(`${r.state.phrase(t?"Folded lines":"Unfolded lines")} ${s} ${r.state.phrase("to")} ${a}.`)}const vxe=r=>{let{state:e}=r,t=[];for(let s=0;s<e.doc.length;){let a=r.lineBlockAt(s),u=CV(e,a.from,a.to);u&&t.push(QV.of(u)),s=(u?r.lineBlockAt(u.to):a).to+1}return t.length&&r.dispatch({effects:npe(r.state,t)}),!!t.length},yxe=r=>{let e=r.state.field(Yx,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,r.state.doc.length,(s,a)=>{t.push(bI.of({from:s,to:a}))}),r.dispatch({effects:t}),!0},wxe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:pxe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:bxe},{key:"Ctrl-Alt-[",run:vxe},{key:"Ctrl-Alt-]",run:yxe}],_xe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Joe=Ds.define({combine(r){return pv(r,_xe)}});function spe(r){let e=[Yx,Exe];return r&&e.push(Joe.of(r)),e}function rpe(r,e){let{state:t}=r,s=t.facet(Joe),a=f=>{let h=r.lineBlockAt(r.posAtDOM(f.target)),g=SV(r.state,h.from,h.to);g&&r.dispatch({effects:bI.of(g)}),f.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(r,a,e);let u=document.createElement("span");return u.textContent=s.placeholderText,u.setAttribute("aria-label",t.phrase("folded code")),u.title=t.phrase("unfold"),u.className="cm-foldPlaceholder",u.onclick=a,u}const Fue=ti.replace({widget:new class extends Sk{toDOM(r){return rpe(r,null)}}});class Cxe extends Sk{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return rpe(e,this.value)}}const Sxe={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vte extends c2{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function kxe(r={}){let e=Object.assign(Object.assign({},Sxe),r),t=new Vte(e,!0),s=new Vte(e,!1),a=mf.fromClass(class{constructor(f){this.from=f.viewport.from,this.markers=this.buildMarkers(f)}update(f){(f.docChanged||f.viewportChanged||f.startState.facet(vk)!=f.state.facet(vk)||f.startState.field(Yx,!1)!=f.state.field(Yx,!1)||Om(f.startState)!=Om(f.state)||e.foldingChanged(f))&&(this.markers=this.buildMarkers(f.view))}buildMarkers(f){let h=new mk;for(let g of f.viewportLineBlocks){let v=SV(f.state,g.from,g.to)?s:CV(f.state,g.from,g.to)?t:null;v&&h.add(g.from,g.from,v)}return h.finish()}}),{domEventHandlers:u}=e;return[a,Hge({class:"cm-foldGutter",markers(f){var h;return((h=f.plugin(a))===null||h===void 0?void 0:h.markers)||Xa.empty},initialSpacer(){return new Vte(e,!1)},domEventHandlers:Object.assign(Object.assign({},u),{click:(f,h,g)=>{if(u.click&&u.click(f,h,g))return!0;let v=SV(f.state,h.from,h.to);if(v)return f.dispatch({effects:bI.of(v)}),!0;let _=CV(f.state,h.from,h.to);return _?(f.dispatch({effects:QV.of(_)}),!0):!1}})}),spe()]}const Exe=xs.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class eU{constructor(e,t){this.specs=e;let s;function a(h){let g=gk.newName();return(s||(s=Object.create(null)))["."+g]=h,g}const u=typeof t.all=="string"?t.all:t.all?a(t.all):void 0,f=t.scope;this.scope=f instanceof hv?h=>h.prop(UD)==f.data:f?h=>h==f:void 0,this.style=Kge(e.map(h=>({tag:h.tag,class:h.class||a(Object.assign({},h,{tag:null}))})),{all:u}).style,this.module=s?new gk(s):null,this.themeType=t.themeType}static define(e,t){return new eU(e,t||{})}}const ioe=Ds.define(),ipe=Ds.define({combine(r){return r.length?[r[0]]:null}});function Ute(r){let e=r.facet(ioe);return e.length?e:r.facet(ipe)}function Axe(r,e){let t=[Txe],s;return r instanceof eU&&(r.module&&t.push(xs.styleModule.of(r.module)),s=r.themeType),e!=null&&e.fallback?t.push(ipe.of(r)):s?t.push(ioe.computeN([xs.darkTheme],a=>a.facet(xs.darkTheme)==(s=="dark")?[r]:[])):t.push(ioe.of(r)),t}class xxe{constructor(e){this.markCache=Object.create(null),this.tree=Om(e.state),this.decorations=this.buildDeco(e,Ute(e.state))}update(e){let t=Om(e.state),s=Ute(e.state),a=s!=Ute(e.startState);t.length<e.view.viewport.to&&!a&&t.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(t!=this.tree||e.viewportChanged||a)&&(this.tree=t,this.decorations=this.buildDeco(e.view,s))}buildDeco(e,t){if(!t||!this.tree.length)return ti.none;let s=new mk;for(let{from:a,to:u}of e.visibleRanges)qAe(this.tree,t,(f,h,g)=>{s.add(f,h,this.markCache[g]||(this.markCache[g]=ti.mark({class:g})))},a,u);return s.finish()}}const Txe=wO.high(mf.fromClass(xxe,{decorations:r=>r.decorations})),Dxe=eU.define([{tag:Uo.meta,color:"#404740"},{tag:Uo.link,textDecoration:"underline"},{tag:Uo.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Uo.emphasis,fontStyle:"italic"},{tag:Uo.strong,fontWeight:"bold"},{tag:Uo.strikethrough,textDecoration:"line-through"},{tag:Uo.keyword,color:"#708"},{tag:[Uo.atom,Uo.bool,Uo.url,Uo.contentSeparator,Uo.labelName],color:"#219"},{tag:[Uo.literal,Uo.inserted],color:"#164"},{tag:[Uo.string,Uo.deleted],color:"#a11"},{tag:[Uo.regexp,Uo.escape,Uo.special(Uo.string)],color:"#e40"},{tag:Uo.definition(Uo.variableName),color:"#00f"},{tag:Uo.local(Uo.variableName),color:"#30a"},{tag:[Uo.typeName,Uo.namespace],color:"#085"},{tag:Uo.className,color:"#167"},{tag:[Uo.special(Uo.variableName),Uo.macroName],color:"#256"},{tag:Uo.definition(Uo.propertyName),color:"#00c"},{tag:Uo.comment,color:"#940"},{tag:Uo.invalid,color:"#f00"}]),Oxe=xs.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ape=1e4,lpe="()[]{}",cpe=Ds.define({combine(r){return pv(r,{afterCursor:!0,brackets:lpe,maxScanDistance:ape,renderMatch:Nxe})}}),Mxe=ti.mark({class:"cm-matchingBracket"}),Rxe=ti.mark({class:"cm-nonmatchingBracket"});function Nxe(r){let e=[],t=r.matched?Mxe:Rxe;return e.push(t.range(r.start.from,r.start.to)),r.end&&e.push(t.range(r.end.from,r.end.to)),e}const Pxe=md.define({create(){return ti.none},update(r,e){if(!e.docChanged&&!e.selection)return r;let t=[],s=e.state.facet(cpe);for(let a of e.state.selection.ranges){if(!a.empty)continue;let u=e2(e.state,a.head,-1,s)||a.head>0&&e2(e.state,a.head-1,1,s)||s.afterCursor&&(e2(e.state,a.head,1,s)||a.head<e.state.doc.length&&e2(e.state,a.head+1,-1,s));u&&(t=t.concat(s.renderMatch(u,e.state)))}return ti.set(t,!0)},provide:r=>xs.decorations.from(r)}),Ixe=[Pxe,Oxe];function Bxe(r={}){return[cpe.of(r),Ixe]}const Lxe=new ca;function aoe(r,e,t){let s=r.prop(e<0?ca.openedBy:ca.closedBy);if(s)return s;if(r.name.length==1){let a=t.indexOf(r.name);if(a>-1&&a%2==(e<0?1:0))return[t[a+e]]}return null}function loe(r){let e=r.type.prop(Lxe);return e?e(r.node):r}function e2(r,e,t,s={}){let a=s.maxScanDistance||ape,u=s.brackets||lpe,f=Om(r),h=f.resolveInner(e,t);for(let g=h;g;g=g.parent){let v=aoe(g.type,t,u);if(v&&g.from<g.to){let _=loe(g);if(_&&(t>0?e>=_.from&&e<_.to:e>_.from&&e<=_.to))return Fxe(r,e,t,g,_,v,u)}}return Hxe(r,e,t,f,h.type,a,u)}function Fxe(r,e,t,s,a,u,f){let h=s.parent,g={from:a.from,to:a.to},v=0,_=h==null?void 0:h.cursor();if(_&&(t<0?_.childBefore(s.from):_.childAfter(s.to)))do if(t<0?_.to<=s.from:_.from>=s.to){if(v==0&&u.indexOf(_.type.name)>-1&&_.from<_.to){let A=loe(_);return{start:g,end:A?{from:A.from,to:A.to}:void 0,matched:!0}}else if(aoe(_.type,t,f))v++;else if(aoe(_.type,-t,f)){if(v==0){let A=loe(_);return{start:g,end:A&&A.from<A.to?{from:A.from,to:A.to}:void 0,matched:!1}}v--}}while(t<0?_.prevSibling():_.nextSibling());return{start:g,matched:!1}}function Hxe(r,e,t,s,a,u,f){let h=t<0?r.sliceDoc(e-1,e):r.sliceDoc(e,e+1),g=f.indexOf(h);if(g<0||g%2==0!=t>0)return null;let v={from:t<0?e-1:e,to:t>0?e+1:e},_=r.doc.iterRange(e,t>0?r.doc.length:0),A=0;for(let O=0;!_.next().done&&O<=u;){let N=_.value;t<0&&(O+=N.length);let L=e+O*t;for(let j=t>0?0:N.length-1,z=t>0?N.length:-1;j!=z;j+=t){let q=f.indexOf(N[j]);if(!(q<0||s.resolveInner(L+j,1).type!=a))if(q%2==0==t>0)A++;else{if(A==1)return{start:v,end:{from:L+j,to:L+j+1},matched:q>>1==g>>1};A--}}t>0&&(O+=N.length)}return _.done?{start:v,matched:!1}:null}const $xe=Object.create(null),Hue=[Np.none],$ue=[],zxe=Object.create(null);for(let[r,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])zxe[r]=Vxe($xe,e);function Wte(r,e){$ue.indexOf(r)>-1||($ue.push(r),console.warn(e))}function Vxe(r,e){let t=null;for(let u of e.split(".")){let f=r[u]||Uo[u];f?typeof f=="function"?t?t=f(t):Wte(u,`Modifier ${u} used at start of tag`):t?Wte(u,`Tag ${u} used as modifier`):t=f:Wte(u,`Unknown highlighting tag ${u}`)}if(!t)return 0;let s=e.replace(/ /g,"_"),a=Np.define({id:Hue.length,name:s,props:[qge({[s]:t})]});return Hue.push(a),a.id}const Uxe=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),s=ese(r.state,t.from);return s.line?Wxe(r):s.block?Zxe(r):!1};function Qoe(r,e){return({state:t,dispatch:s})=>{if(t.readOnly)return!1;let a=r(e,t);return a?(s(t.update(a)),!0):!1}}const Wxe=Qoe(Kxe,0),jxe=Qoe(upe,0),Zxe=Qoe((r,e)=>upe(r,e,Gxe(e)),0);function ese(r,e){let t=r.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const fP=50;function qxe(r,{open:e,close:t},s,a){let u=r.sliceDoc(s-fP,s),f=r.sliceDoc(a,a+fP),h=/\s*$/.exec(u)[0].length,g=/^\s*/.exec(f)[0].length,v=u.length-h;if(u.slice(v-e.length,v)==e&&f.slice(g,g+t.length)==t)return{open:{pos:s-h,margin:h&&1},close:{pos:a+g,margin:g&&1}};let _,A;a-s<=2*fP?_=A=r.sliceDoc(s,a):(_=r.sliceDoc(s,s+fP),A=r.sliceDoc(a-fP,a));let O=/^\s*/.exec(_)[0].length,N=/\s*$/.exec(A)[0].length,L=A.length-N-t.length;return _.slice(O,O+e.length)==e&&A.slice(L,L+t.length)==t?{open:{pos:s+O+e.length,margin:/\s/.test(_.charAt(O+e.length))?1:0},close:{pos:a-N-t.length,margin:/\s/.test(A.charAt(L-1))?1:0}}:null}function Gxe(r){let e=[];for(let t of r.selection.ranges){let s=r.doc.lineAt(t.from),a=t.to<=s.to?s:r.doc.lineAt(t.to),u=e.length-1;u>=0&&e[u].to>s.from?e[u].to=a.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:a.to})}return e}function upe(r,e,t=e.selection.ranges){let s=t.map(u=>ese(e,u.from).block);if(!s.every(u=>u))return null;let a=t.map((u,f)=>qxe(e,s[f],u.from,u.to));if(r!=2&&!a.every(u=>u))return{changes:e.changes(t.map((u,f)=>a[f]?[]:[{from:u.from,insert:s[f].open+" "},{from:u.to,insert:" "+s[f].close}]))};if(r!=1&&a.some(u=>u)){let u=[];for(let f=0,h;f<a.length;f++)if(h=a[f]){let g=s[f],{open:v,close:_}=h;u.push({from:v.pos-g.open.length,to:v.pos+v.margin},{from:_.pos-_.margin,to:_.pos+g.close.length})}return{changes:u}}return null}function Kxe(r,e,t=e.selection.ranges){let s=[],a=-1;for(let{from:u,to:f}of t){let h=s.length,g=1e9,v=ese(e,u).line;if(!!v){for(let _=u;_<=f;){let A=e.doc.lineAt(_);if(A.from>a&&(u==f||f>A.from)){a=A.from;let O=/^\s*/.exec(A.text)[0].length,N=O==A.length,L=A.text.slice(O,O+v.length)==v?O:-1;O<A.text.length&&O<g&&(g=O),s.push({line:A,comment:L,token:v,indent:O,empty:N,single:!1})}_=A.to+1}if(g<1e9)for(let _=h;_<s.length;_++)s[_].indent<s[_].line.text.length&&(s[_].indent=g);s.length==h+1&&(s[h].single=!0)}}if(r!=2&&s.some(u=>u.comment<0&&(!u.empty||u.single))){let u=[];for(let{line:h,token:g,indent:v,empty:_,single:A}of s)(A||!_)&&u.push({from:h.from+v,insert:g+" "});let f=e.changes(u);return{changes:f,selection:e.selection.map(f,1)}}else if(r!=1&&s.some(u=>u.comment>=0)){let u=[];for(let{line:f,comment:h,token:g}of s)if(h>=0){let v=f.from+h,_=v+g.length;f.text[_-f.from]==" "&&_++,u.push({from:v,to:_})}return{changes:u}}return null}const coe=B_.define(),Yxe=B_.define(),Xxe=Ds.define(),fpe=Ds.define({combine(r){return pv(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(s,a)=>e(s,a)||t(s,a)})}});function Jxe(r){let e=0;return r.iterChangedRanges((t,s)=>e=s),e}const dpe=md.define({create(){return t2.empty},update(r,e){let t=e.state.facet(fpe),s=e.annotation(coe);if(s){let g=e.docChanged?Yn.single(Jxe(e.changes)):void 0,v=Op.fromTransaction(e,g),_=s.side,A=_==0?r.undone:r.done;return v?A=kV(A,A.length,t.minDepth,v):A=gpe(A,e.startState.selection),new t2(_==0?s.rest:A,_==0?A:s.rest)}let a=e.annotation(Yxe);if((a=="full"||a=="before")&&(r=r.isolate()),e.annotation(hd.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let u=Op.fromTransaction(e),f=e.annotation(hd.time),h=e.annotation(hd.userEvent);return u?r=r.addChanges(u,f,h,t,e):e.selection&&(r=r.addSelection(e.startState.selection,f,h,t.newGroupDelay)),(a=="full"||a=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new t2(r.done.map(Op.fromJSON),r.undone.map(Op.fromJSON))}});function Qxe(r={}){return[dpe,fpe.of(r),xs.domEventHandlers({beforeinput(e,t){let s=e.inputType=="historyUndo"?hpe:e.inputType=="historyRedo"?uoe:null;return s?(e.preventDefault(),s(t)):!1}})]}function tU(r,e){return function({state:t,dispatch:s}){if(!e&&t.readOnly)return!1;let a=t.field(dpe,!1);if(!a)return!1;let u=a.pop(r,t,e);return u?(s(u),!0):!1}}const hpe=tU(0,!1),uoe=tU(1,!1),e3e=tU(0,!0),t3e=tU(1,!0);class Op{constructor(e,t,s,a,u){this.changes=e,this.effects=t,this.mapped=s,this.startSelection=a,this.selectionsAfter=u}setSelAfter(e){return new Op(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,s;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(s=this.startSelection)===null||s===void 0?void 0:s.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(e){return new Op(e.changes&&ud.fromJSON(e.changes),[],e.mapped&&o2.fromJSON(e.mapped),e.startSelection&&Yn.fromJSON(e.startSelection),e.selectionsAfter.map(Yn.fromJSON))}static fromTransaction(e,t){let s=M0;for(let a of e.startState.facet(Xxe)){let u=a(e);u.length&&(s=s.concat(u))}return!s.length&&e.changes.empty?null:new Op(e.changes.invert(e.startState.doc),s,void 0,t||e.startState.selection,M0)}static selection(e){return new Op(void 0,M0,void 0,void 0,e)}}function kV(r,e,t,s){let a=e+1>t+20?e-t-1:0,u=r.slice(a,e);return u.push(s),u}function n3e(r,e){let t=[],s=!1;return r.iterChangedRanges((a,u)=>t.push(a,u)),e.iterChangedRanges((a,u,f,h)=>{for(let g=0;g<t.length;){let v=t[g++],_=t[g++];h>=v&&f<=_&&(s=!0)}}),s}function o3e(r,e){return r.ranges.length==e.ranges.length&&r.ranges.filter((t,s)=>t.empty!=e.ranges[s].empty).length===0}function mpe(r,e){return r.length?e.length?r.concat(e):r:e}const M0=[],s3e=200;function gpe(r,e){if(r.length){let t=r[r.length-1],s=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-s3e));return s.length&&s[s.length-1].eq(e)?r:(s.push(e),kV(r,r.length-1,1e9,t.setSelAfter(s)))}else return[Op.selection([e])]}function r3e(r){let e=r[r.length-1],t=r.slice();return t[r.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function jte(r,e){if(!r.length)return r;let t=r.length,s=M0;for(;t;){let a=i3e(r[t-1],e,s);if(a.changes&&!a.changes.empty||a.effects.length){let u=r.slice(0,t);return u[t-1]=a,u}else e=a.mapped,t--,s=a.selectionsAfter}return s.length?[Op.selection(s)]:M0}function i3e(r,e,t){let s=mpe(r.selectionsAfter.length?r.selectionsAfter.map(h=>h.map(e)):M0,t);if(!r.changes)return Op.selection(s);let a=r.changes.map(e),u=e.mapDesc(r.changes,!0),f=r.mapped?r.mapped.composeDesc(u):u;return new Op(a,Ii.mapEffects(r.effects,e),f,r.startSelection.map(u),s)}const a3e=/^(input\.type|delete)($|\.)/;class t2{constructor(e,t,s=0,a=void 0){this.done=e,this.undone=t,this.prevTime=s,this.prevUserEvent=a}isolate(){return this.prevTime?new t2(this.done,this.undone):this}addChanges(e,t,s,a,u){let f=this.done,h=f[f.length-1];return h&&h.changes&&!h.changes.empty&&e.changes&&(!s||a3e.test(s))&&(!h.selectionsAfter.length&&t-this.prevTime<a.newGroupDelay&&a.joinToEvent(u,n3e(h.changes,e.changes))||s=="input.type.compose")?f=kV(f,f.length-1,a.minDepth,new Op(e.changes.compose(h.changes),mpe(e.effects,h.effects),h.mapped,h.startSelection,M0)):f=kV(f,f.length,a.minDepth,e),new t2(f,M0,t,s)}addSelection(e,t,s,a){let u=this.done.length?this.done[this.done.length-1].selectionsAfter:M0;return u.length>0&&t-this.prevTime<a&&s==this.prevUserEvent&&s&&/^select($|\.)/.test(s)&&o3e(u[u.length-1],e)?this:new t2(gpe(this.done,e),this.undone,t,s)}addMapping(e){return new t2(jte(this.done,e),jte(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,s){let a=e==0?this.done:this.undone;if(a.length==0)return null;let u=a[a.length-1];if(s&&u.selectionsAfter.length)return t.update({selection:u.selectionsAfter[u.selectionsAfter.length-1],annotations:coe.of({side:e,rest:r3e(a)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(u.changes){let f=a.length==1?M0:a.slice(0,a.length-1);return u.mapped&&(f=jte(f,u.mapped)),t.update({changes:u.changes,selection:u.startSelection,effects:u.effects,annotations:coe.of({side:e,rest:f}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}t2.empty=new t2(M0,M0);const l3e=[{key:"Mod-z",run:hpe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:uoe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:uoe,preventDefault:!0},{key:"Mod-u",run:e3e,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:t3e,preventDefault:!0}];function CO(r,e){return Yn.create(r.ranges.map(e),r.mainIndex)}function d2(r,e){return r.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function bv({state:r,dispatch:e},t){let s=CO(r.selection,t);return s.eq(r.selection)?!1:(e(d2(r,s)),!0)}function nU(r,e){return Yn.cursor(e?r.to:r.from)}function ppe(r,e){return bv(r,t=>t.empty?r.moveByChar(t,e):nU(t,e))}function Mm(r){return r.textDirectionAt(r.state.selection.main.head)==mu.LTR}const bpe=r=>ppe(r,!Mm(r)),vpe=r=>ppe(r,Mm(r));function ype(r,e){return bv(r,t=>t.empty?r.moveByGroup(t,e):nU(t,e))}const c3e=r=>ype(r,!Mm(r)),u3e=r=>ype(r,Mm(r));function f3e(r,e,t){if(e.type.prop(t))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(r.sliceDoc(e.from,e.to)))||e.firstChild}function oU(r,e,t){let s=Om(r).resolveInner(e.head),a=t?ca.closedBy:ca.openedBy;for(let g=e.head;;){let v=t?s.childAfter(g):s.childBefore(g);if(!v)break;f3e(r,v,a)?s=v:g=t?v.to:v.from}let u=s.type.prop(a),f,h;return u&&(f=t?e2(r,s.from,1):e2(r,s.to,-1))&&f.matched?h=t?f.end.to:f.end.from:h=t?s.to:s.from,Yn.cursor(h,t?-1:1)}const d3e=r=>bv(r,e=>oU(r.state,e,!Mm(r))),h3e=r=>bv(r,e=>oU(r.state,e,Mm(r)));function wpe(r,e){return bv(r,t=>{if(!t.empty)return nU(t,e);let s=r.moveVertically(t,e);return s.head!=t.head?s:r.moveToLineBoundary(t,e)})}const _pe=r=>wpe(r,!1),Cpe=r=>wpe(r,!0);function Spe(r){let e=r.scrollDOM.clientHeight<r.scrollDOM.scrollHeight-2,t=0,s=0,a;if(e){for(let u of r.state.facet(xs.scrollMargins)){let f=u(r);f!=null&&f.top&&(t=Math.max(f==null?void 0:f.top,t)),f!=null&&f.bottom&&(s=Math.max(f==null?void 0:f.bottom,s))}a=r.scrollDOM.clientHeight-t-s}else a=(r.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:s,selfScroll:e,height:Math.max(r.defaultLineHeight,a-5)}}function kpe(r,e){let t=Spe(r),{state:s}=r,a=CO(s.selection,f=>f.empty?r.moveVertically(f,e,t.height):nU(f,e));if(a.eq(s.selection))return!1;let u;if(t.selfScroll){let f=r.coordsAtPos(s.selection.main.head),h=r.scrollDOM.getBoundingClientRect(),g=h.top+t.marginTop,v=h.bottom-t.marginBottom;f&&f.top>g&&f.bottom<v&&(u=xs.scrollIntoView(a.main.head,{y:"start",yMargin:f.top-g}))}return r.dispatch(d2(s,a),{effects:u}),!0}const zue=r=>kpe(r,!1),foe=r=>kpe(r,!0);function kk(r,e,t){let s=r.lineBlockAt(e.head),a=r.moveToLineBoundary(e,t);if(a.head==e.head&&a.head!=(t?s.to:s.from)&&(a=r.moveToLineBoundary(e,t,!1)),!t&&a.head==s.from&&s.length){let u=/^\s*/.exec(r.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;u&&e.head!=s.from+u&&(a=Yn.cursor(s.from+u))}return a}const m3e=r=>bv(r,e=>kk(r,e,!0)),g3e=r=>bv(r,e=>kk(r,e,!1)),p3e=r=>bv(r,e=>kk(r,e,!Mm(r))),b3e=r=>bv(r,e=>kk(r,e,Mm(r))),v3e=r=>bv(r,e=>Yn.cursor(r.lineBlockAt(e.head).from,1)),y3e=r=>bv(r,e=>Yn.cursor(r.lineBlockAt(e.head).to,-1));function w3e(r,e,t){let s=!1,a=CO(r.selection,u=>{let f=e2(r,u.head,-1)||e2(r,u.head,1)||u.head>0&&e2(r,u.head-1,1)||u.head<r.doc.length&&e2(r,u.head+1,-1);if(!f||!f.end)return u;s=!0;let h=f.start.from==u.head?f.end.to:f.end.from;return t?Yn.range(u.anchor,h):Yn.cursor(h)});return s?(e(d2(r,a)),!0):!1}const _3e=({state:r,dispatch:e})=>w3e(r,e,!1);function z0(r,e){let t=CO(r.state.selection,s=>{let a=e(s);return Yn.range(s.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return t.eq(r.state.selection)?!1:(r.dispatch(d2(r.state,t)),!0)}function Epe(r,e){return z0(r,t=>r.moveByChar(t,e))}const Ape=r=>Epe(r,!Mm(r)),xpe=r=>Epe(r,Mm(r));function Tpe(r,e){return z0(r,t=>r.moveByGroup(t,e))}const C3e=r=>Tpe(r,!Mm(r)),S3e=r=>Tpe(r,Mm(r)),k3e=r=>z0(r,e=>oU(r.state,e,!Mm(r))),E3e=r=>z0(r,e=>oU(r.state,e,Mm(r)));function Dpe(r,e){return z0(r,t=>r.moveVertically(t,e))}const Ope=r=>Dpe(r,!1),Mpe=r=>Dpe(r,!0);function Rpe(r,e){return z0(r,t=>r.moveVertically(t,e,Spe(r).height))}const Vue=r=>Rpe(r,!1),Uue=r=>Rpe(r,!0),A3e=r=>z0(r,e=>kk(r,e,!0)),x3e=r=>z0(r,e=>kk(r,e,!1)),T3e=r=>z0(r,e=>kk(r,e,!Mm(r))),D3e=r=>z0(r,e=>kk(r,e,Mm(r))),O3e=r=>z0(r,e=>Yn.cursor(r.lineBlockAt(e.head).from)),M3e=r=>z0(r,e=>Yn.cursor(r.lineBlockAt(e.head).to)),Wue=({state:r,dispatch:e})=>(e(d2(r,{anchor:0})),!0),jue=({state:r,dispatch:e})=>(e(d2(r,{anchor:r.doc.length})),!0),Zue=({state:r,dispatch:e})=>(e(d2(r,{anchor:r.selection.main.anchor,head:0})),!0),que=({state:r,dispatch:e})=>(e(d2(r,{anchor:r.selection.main.anchor,head:r.doc.length})),!0),R3e=({state:r,dispatch:e})=>(e(r.update({selection:{anchor:0,head:r.doc.length},userEvent:"select"})),!0),N3e=({state:r,dispatch:e})=>{let t=rU(r).map(({from:s,to:a})=>Yn.range(s,Math.min(a+1,r.doc.length)));return e(r.update({selection:Yn.create(t),userEvent:"select"})),!0},P3e=({state:r,dispatch:e})=>{let t=CO(r.selection,s=>{var a;let u=Om(r).resolveInner(s.head,1);for(;!(u.from<s.from&&u.to>=s.to||u.to>s.to&&u.from<=s.from||!(!((a=u.parent)===null||a===void 0)&&a.parent));)u=u.parent;return Yn.range(u.to,u.from)});return e(d2(r,t)),!0},I3e=({state:r,dispatch:e})=>{let t=r.selection,s=null;return t.ranges.length>1?s=Yn.create([t.main]):t.main.empty||(s=Yn.create([Yn.cursor(t.main.head)])),s?(e(d2(r,s)),!0):!1};function sU(r,e){if(r.state.readOnly)return!1;let t="delete.selection",{state:s}=r,a=s.changeByRange(u=>{let{from:f,to:h}=u;if(f==h){let g=e(f);g<f?(t="delete.backward",g=dz(r,g,!1)):g>f&&(t="delete.forward",g=dz(r,g,!0)),f=Math.min(f,g),h=Math.max(h,g)}else f=dz(r,f,!1),h=dz(r,h,!0);return f==h?{range:u}:{changes:{from:f,to:h},range:Yn.cursor(f)}});return a.changes.empty?!1:(r.dispatch(s.update(a,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?xs.announce.of(s.phrase("Selection deleted")):void 0})),!0)}function dz(r,e,t){if(r instanceof xs)for(let s of r.state.facet(xs.atomicRanges).map(a=>a(r)))s.between(e,e,(a,u)=>{a<e&&u>e&&(e=t?u:a)});return e}const Npe=(r,e)=>sU(r,t=>{let{state:s}=r,a=s.doc.lineAt(t),u,f;if(!e&&t>a.from&&t<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,t-a.from))){if(u[u.length-1]==" ")return t-1;let h=_O(u,s.tabSize),g=h%_V(s)||_V(s);for(let v=0;v<g&&u[u.length-1-v]==" ";v++)t--;f=t}else f=Dm(a.text,t-a.from,e,e)+a.from,f==t&&a.number!=(e?s.doc.lines:1)&&(f+=e?1:-1);return f}),doe=r=>Npe(r,!1),Ppe=r=>Npe(r,!0),Ipe=(r,e)=>sU(r,t=>{let s=t,{state:a}=r,u=a.doc.lineAt(s),f=a.charCategorizer(s);for(let h=null;;){if(s==(e?u.to:u.from)){s==t&&u.number!=(e?a.doc.lines:1)&&(s+=e?1:-1);break}let g=Dm(u.text,s-u.from,e)+u.from,v=u.text.slice(Math.min(s,g)-u.from,Math.max(s,g)-u.from),_=f(v);if(h!=null&&_!=h)break;(v!=" "||s!=t)&&(h=_),s=g}return s}),Bpe=r=>Ipe(r,!1),B3e=r=>Ipe(r,!0),Lpe=r=>sU(r,e=>{let t=r.lineBlockAt(e).to;return e<t?t:Math.min(r.state.doc.length,e+1)}),L3e=r=>sU(r,e=>{let t=r.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),F3e=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:ul.of(["",""])},range:Yn.cursor(s.from)}));return e(r.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},H3e=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(s=>{if(!s.empty||s.from==0||s.from==r.doc.length)return{range:s};let a=s.from,u=r.doc.lineAt(a),f=a==u.from?a-1:Dm(u.text,a-u.from,!1)+u.from,h=a==u.to?a+1:Dm(u.text,a-u.from,!0)+u.from;return{changes:{from:f,to:h,insert:r.doc.slice(a,h).append(r.doc.slice(f,a))},range:Yn.cursor(h)}});return t.changes.empty?!1:(e(r.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function rU(r){let e=[],t=-1;for(let s of r.selection.ranges){let a=r.doc.lineAt(s.from),u=r.doc.lineAt(s.to);if(!s.empty&&s.to==u.from&&(u=r.doc.lineAt(s.to-1)),t>=a.number){let f=e[e.length-1];f.to=u.to,f.ranges.push(s)}else e.push({from:a.from,to:u.to,ranges:[s]});t=u.number+1}return e}function Fpe(r,e,t){if(r.readOnly)return!1;let s=[],a=[];for(let u of rU(r)){if(t?u.to==r.doc.length:u.from==0)continue;let f=r.doc.lineAt(t?u.to+1:u.from-1),h=f.length+1;if(t){s.push({from:u.to,to:f.to},{from:u.from,insert:f.text+r.lineBreak});for(let g of u.ranges)a.push(Yn.range(Math.min(r.doc.length,g.anchor+h),Math.min(r.doc.length,g.head+h)))}else{s.push({from:f.from,to:u.from},{from:u.to,insert:r.lineBreak+f.text});for(let g of u.ranges)a.push(Yn.range(g.anchor-h,g.head-h))}}return s.length?(e(r.update({changes:s,scrollIntoView:!0,selection:Yn.create(a,r.selection.mainIndex),userEvent:"move.line"})),!0):!1}const $3e=({state:r,dispatch:e})=>Fpe(r,e,!1),z3e=({state:r,dispatch:e})=>Fpe(r,e,!0);function Hpe(r,e,t){if(r.readOnly)return!1;let s=[];for(let a of rU(r))t?s.push({from:a.from,insert:r.doc.slice(a.from,a.to)+r.lineBreak}):s.push({from:a.to,insert:r.lineBreak+r.doc.slice(a.from,a.to)});return e(r.update({changes:s,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const V3e=({state:r,dispatch:e})=>Hpe(r,e,!1),U3e=({state:r,dispatch:e})=>Hpe(r,e,!0),W3e=r=>{if(r.state.readOnly)return!1;let{state:e}=r,t=e.changes(rU(e).map(({from:a,to:u})=>(a>0?a--:u<e.doc.length&&u++,{from:a,to:u}))),s=CO(e.selection,a=>r.moveVertically(a,!0)).map(t);return r.dispatch({changes:t,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0};function j3e(r,e){if(/\(\)|\[\]|\{\}/.test(r.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Om(r).resolveInner(e),s=t.childBefore(e),a=t.childAfter(e),u;return s&&a&&s.to<=e&&a.from>=e&&(u=s.type.prop(ca.closedBy))&&u.indexOf(a.name)>-1&&r.doc.lineAt(s.to).from==r.doc.lineAt(a.from).from&&!/\S/.test(r.sliceDoc(s.to,a.from))?{from:s.to,to:a.from}:null}const Z3e=$pe(!1),q3e=$pe(!0);function $pe(r){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let s=e.changeByRange(a=>{let{from:u,to:f}=a,h=e.doc.lineAt(u),g=!r&&u==f&&j3e(e,u);r&&(u=f=(f<=h.to?h:e.doc.lineAt(f)).to);let v=new JV(e,{simulateBreak:u,simulateDoubleBreak:!!g}),_=Yoe(v,u);for(_==null&&(_=_O(/^\s*/.exec(e.doc.lineAt(u).text)[0],e.tabSize));f<h.to&&/\s/.test(h.text[f-h.from]);)f++;g?{from:u,to:f}=g:u>h.from&&u<h.from+100&&!/\S/.test(h.text.slice(0,u))&&(u=h.from);let A=["",YP(e,_)];return g&&A.push(YP(e,v.lineIndent(h.from,-1))),{changes:{from:u,to:f,insert:ul.of(A)},range:Yn.cursor(u+1+A[1].length)}});return t(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0}}function tse(r,e){let t=-1;return r.changeByRange(s=>{let a=[];for(let f=s.from;f<=s.to;){let h=r.doc.lineAt(f);h.number>t&&(s.empty||s.to>h.from)&&(e(h,a,s),t=h.number),f=h.to+1}let u=r.changes(a);return{changes:a,range:Yn.range(u.mapPos(s.anchor,1),u.mapPos(s.head,1))}})}const G3e=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=Object.create(null),s=new JV(r,{overrideIndentation:u=>{let f=t[u];return f==null?-1:f}}),a=tse(r,(u,f,h)=>{let g=Yoe(s,u.from);if(g==null)return;/\S/.test(u.text)||(g=0);let v=/^\s*/.exec(u.text)[0],_=YP(r,g);(v!=_||h.from<u.from+v.length)&&(t[u.from]=g,f.push({from:u.from,to:u.from+v.length,insert:_}))});return a.changes.empty||e(r.update(a,{userEvent:"indent"})),!0},zpe=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(tse(r,(t,s)=>{s.push({from:t.from,insert:r.facet(Koe)})}),{userEvent:"input.indent"})),!0),Vpe=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(tse(r,(t,s)=>{let a=/^\s*/.exec(t.text)[0];if(!a)return;let u=_O(a,r.tabSize),f=0,h=YP(r,Math.max(0,u-_V(r)));for(;f<a.length&&f<h.length&&a.charCodeAt(f)==h.charCodeAt(f);)f++;s.push({from:t.from+f,to:t.from+a.length,insert:h.slice(f)})}),{userEvent:"delete.dedent"})),!0),K3e=[{key:"Ctrl-b",run:bpe,shift:Ape,preventDefault:!0},{key:"Ctrl-f",run:vpe,shift:xpe},{key:"Ctrl-p",run:_pe,shift:Ope},{key:"Ctrl-n",run:Cpe,shift:Mpe},{key:"Ctrl-a",run:v3e,shift:O3e},{key:"Ctrl-e",run:y3e,shift:M3e},{key:"Ctrl-d",run:Ppe},{key:"Ctrl-h",run:doe},{key:"Ctrl-k",run:Lpe},{key:"Ctrl-Alt-h",run:Bpe},{key:"Ctrl-o",run:F3e},{key:"Ctrl-t",run:H3e},{key:"Ctrl-v",run:foe}],Y3e=[{key:"ArrowLeft",run:bpe,shift:Ape,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:c3e,shift:C3e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:p3e,shift:T3e,preventDefault:!0},{key:"ArrowRight",run:vpe,shift:xpe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:u3e,shift:S3e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:b3e,shift:D3e,preventDefault:!0},{key:"ArrowUp",run:_pe,shift:Ope,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Wue,shift:Zue},{mac:"Ctrl-ArrowUp",run:zue,shift:Vue},{key:"ArrowDown",run:Cpe,shift:Mpe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:jue,shift:que},{mac:"Ctrl-ArrowDown",run:foe,shift:Uue},{key:"PageUp",run:zue,shift:Vue},{key:"PageDown",run:foe,shift:Uue},{key:"Home",run:g3e,shift:x3e,preventDefault:!0},{key:"Mod-Home",run:Wue,shift:Zue},{key:"End",run:m3e,shift:A3e,preventDefault:!0},{key:"Mod-End",run:jue,shift:que},{key:"Enter",run:Z3e},{key:"Mod-a",run:R3e},{key:"Backspace",run:doe,shift:doe},{key:"Delete",run:Ppe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Bpe},{key:"Mod-Delete",mac:"Alt-Delete",run:B3e},{mac:"Mod-Backspace",run:L3e},{mac:"Mod-Delete",run:Lpe}].concat(K3e.map(r=>({mac:r.key,run:r.run,shift:r.shift}))),X3e=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:d3e,shift:k3e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:h3e,shift:E3e},{key:"Alt-ArrowUp",run:$3e},{key:"Shift-Alt-ArrowUp",run:V3e},{key:"Alt-ArrowDown",run:z3e},{key:"Shift-Alt-ArrowDown",run:U3e},{key:"Escape",run:I3e},{key:"Mod-Enter",run:q3e},{key:"Alt-l",mac:"Ctrl-l",run:N3e},{key:"Mod-i",run:P3e,preventDefault:!0},{key:"Mod-[",run:Vpe},{key:"Mod-]",run:zpe},{key:"Mod-Alt-\\",run:G3e},{key:"Shift-Mod-k",run:W3e},{key:"Shift-Mod-\\",run:_3e},{key:"Mod-/",run:Uxe},{key:"Alt-A",run:jxe}].concat(Y3e),J3e={key:"Tab",run:zpe,shift:Vpe};function mc(){var r=arguments[0];typeof r=="string"&&(r=document.createElement(r));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var a=t[s];typeof a=="string"?r.setAttribute(s,a):a!=null&&(r[s]=a)}e++}for(;e<arguments.length;e++)Upe(r,arguments[e]);return r}function Upe(r,e){if(typeof e=="string")r.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)r.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Upe(r,e[t]);else throw new RangeError("Unsupported child node: "+e)}const Gue=typeof String.prototype.normalize=="function"?r=>r.normalize("NFKD"):r=>r;class lO{constructor(e,t,s=0,a=e.length,u,f){this.test=f,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(s,a),this.bufferStart=s,this.normalize=u?h=>u(Gue(h)):Gue,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Lh(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Poe(e),s=this.bufferStart+this.bufferPos;this.bufferPos+=O0(e);let a=this.normalize(t);for(let u=0,f=s;;u++){let h=a.charCodeAt(u),g=this.match(h,f);if(u==a.length-1){if(g)return this.value=g,this;break}f==s&&u<t.length&&t.charCodeAt(u)==h&&f++}}}match(e,t){let s=null;for(let a=0;a<this.matches.length;a+=2){let u=this.matches[a],f=!1;this.query.charCodeAt(u)==e&&(u==this.query.length-1?s={from:this.matches[a+1],to:t+1}:(this.matches[a]++,f=!0)),f||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:t,to:t+1}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(lO.prototype[Symbol.iterator]=function(){return this});const Wpe={from:-1,to:-1,match:/.*/.exec("")},nse="gm"+(/x/.unicode==null?"":"u");class jpe{constructor(e,t,s,a=0,u=e.length){if(this.text=e,this.to=u,this.curLine="",this.done=!1,this.value=Wpe,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Zpe(e,t,s,a,u);this.re=new RegExp(t,nse+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.iter=e.iter();let f=e.lineAt(a);this.curLineStart=f.from,this.matchPos=EV(e,a),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let s=this.curLineStart+t.index,a=s+t[0].length;if(this.matchPos=EV(this.text,a+(s==a?1:0)),s==this.curLineStart+this.curLine.length&&this.nextLine(),(s<a||s>this.value.to)&&(!this.test||this.test(s,a,t)))return this.value={from:s,to:a,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Zte=new WeakMap;class eO{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,s){let a=Zte.get(e);if(!a||a.from>=s||a.to<=t){let h=new eO(t,e.sliceString(t,s));return Zte.set(e,h),h}if(a.from==t&&a.to==s)return a;let{text:u,from:f}=a;return f>t&&(u=e.sliceString(t,f)+u,f=t),a.to<s&&(u+=e.sliceString(a.to,s)),Zte.set(e,new eO(f,u)),new eO(t,u.slice(t-f,s-f))}}class Zpe{constructor(e,t,s,a,u){this.text=e,this.to=u,this.done=!1,this.value=Wpe,this.matchPos=EV(e,a),this.re=new RegExp(t,nse+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.flat=eO.get(e,a,this.chunkEnd(a+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let s=this.flat.from+t.index,a=s+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,a,t)))return this.value={from:s,to:a,match:t},this.matchPos=EV(this.text,a+(s==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=eO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(jpe.prototype[Symbol.iterator]=Zpe.prototype[Symbol.iterator]=function(){return this});function Q3e(r){try{return new RegExp(r,nse),!0}catch{return!1}}function EV(r,e){if(e>=r.length)return e;let t=r.lineAt(e),s;for(;e<t.to&&(s=t.text.charCodeAt(e-t.from))>=56320&&s<57344;)e++;return e}function hoe(r){let e=String(r.state.doc.lineAt(r.state.selection.main.head).number),t=mc("input",{class:"cm-textfield",name:"line",value:e}),s=mc("form",{class:"cm-gotoLine",onkeydown:u=>{u.keyCode==27?(u.preventDefault(),r.dispatch({effects:AV.of(!1)}),r.focus()):u.keyCode==13&&(u.preventDefault(),a())},onsubmit:u=>{u.preventDefault(),a()}},mc("label",r.state.phrase("Go to line"),": ",t)," ",mc("button",{class:"cm-button",type:"submit"},r.state.phrase("go")));function a(){let u=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!u)return;let{state:f}=r,h=f.doc.lineAt(f.selection.main.head),[,g,v,_,A]=u,O=_?+_.slice(1):0,N=v?+v:h.number;if(v&&A){let z=N/100;g&&(z=z*(g=="-"?-1:1)+h.number/f.doc.lines),N=Math.round(f.doc.lines*z)}else v&&g&&(N=N*(g=="-"?-1:1)+h.number);let L=f.doc.line(Math.max(1,Math.min(f.doc.lines,N))),j=Yn.cursor(L.from+Math.max(0,Math.min(O,L.length)));r.dispatch({effects:[AV.of(!1),xs.scrollIntoView(j.from,{y:"center"})],selection:j}),r.focus()}return{dom:s}}const AV=Ii.define(),Kue=md.define({create(){return!0},update(r,e){for(let t of e.effects)t.is(AV)&&(r=t.value);return r},provide:r=>GP.from(r,e=>e?hoe:null)}),eTe=r=>{let e=qP(r,hoe);if(!e){let t=[AV.of(!0)];r.state.field(Kue,!1)==null&&t.push(Ii.appendConfig.of([Kue,tTe])),r.dispatch({effects:t}),e=qP(r,hoe)}return e&&e.dom.querySelector("input").select(),!0},tTe=xs.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),nTe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},qpe=Ds.define({combine(r){return pv(r,nTe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function oTe(r){let e=[lTe,aTe];return r&&e.push(qpe.of(r)),e}const sTe=ti.mark({class:"cm-selectionMatch"}),rTe=ti.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Yue(r,e,t,s){return(t==0||r(e.sliceDoc(t-1,t))!=jc.Word)&&(s==e.doc.length||r(e.sliceDoc(s,s+1))!=jc.Word)}function iTe(r,e,t,s){return r(e.sliceDoc(t,t+1))==jc.Word&&r(e.sliceDoc(s-1,s))==jc.Word}const aTe=mf.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.selectionSet||r.docChanged||r.viewportChanged)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=r.state.facet(qpe),{state:t}=r,s=t.selection;if(s.ranges.length>1)return ti.none;let a=s.main,u,f=null;if(a.empty){if(!e.highlightWordAroundCursor)return ti.none;let g=t.wordAt(a.head);if(!g)return ti.none;f=t.charCategorizer(a.head),u=t.sliceDoc(g.from,g.to)}else{let g=a.to-a.from;if(g<e.minSelectionLength||g>200)return ti.none;if(e.wholeWords){if(u=t.sliceDoc(a.from,a.to),f=t.charCategorizer(a.head),!(Yue(f,t,a.from,a.to)&&iTe(f,t,a.from,a.to)))return ti.none}else if(u=t.sliceDoc(a.from,a.to).trim(),!u)return ti.none}let h=[];for(let g of r.visibleRanges){let v=new lO(t.doc,u,g.from,g.to);for(;!v.next().done;){let{from:_,to:A}=v.value;if((!f||Yue(f,t,_,A))&&(a.empty&&_<=a.from&&A>=a.to?h.push(rTe.range(_,A)):(_>=a.to||A<=a.from)&&h.push(sTe.range(_,A)),h.length>e.maxMatches))return ti.none}}return ti.set(h)}},{decorations:r=>r.decorations}),lTe=xs.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),cTe=({state:r,dispatch:e})=>{let{selection:t}=r,s=Yn.create(t.ranges.map(a=>r.wordAt(a.head)||Yn.cursor(a.head)),t.mainIndex);return s.eq(t)?!1:(e(r.update({selection:s})),!0)};function uTe(r,e){let{main:t,ranges:s}=r.selection,a=r.wordAt(t.head),u=a&&a.from==t.from&&a.to==t.to;for(let f=!1,h=new lO(r.doc,e,s[s.length-1].to);;)if(h.next(),h.done){if(f)return null;h=new lO(r.doc,e,0,Math.max(0,s[s.length-1].from-1)),f=!0}else{if(f&&s.some(g=>g.from==h.value.from))continue;if(u){let g=r.wordAt(h.value.from);if(!g||g.from!=h.value.from||g.to!=h.value.to)continue}return h.value}}const fTe=({state:r,dispatch:e})=>{let{ranges:t}=r.selection;if(t.some(u=>u.from===u.to))return cTe({state:r,dispatch:e});let s=r.sliceDoc(t[0].from,t[0].to);if(r.selection.ranges.some(u=>r.sliceDoc(u.from,u.to)!=s))return!1;let a=uTe(r,s);return a?(e(r.update({selection:r.selection.addRange(Yn.range(a.from,a.to),!1),effects:xs.scrollIntoView(a.to)})),!0):!1},SO=Ds.define({combine(r){return pv(r,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new STe(e),scrollToMatch:e=>xs.scrollIntoView(e)})}});class Gpe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Q3e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,s)=>s=="n"?`
|
|
`:s=="r"?"\r":s=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new gTe(this):new hTe(this)}getCursor(e,t=0,s){let a=e.doc?e:Ea.create({doc:e});return s==null&&(s=a.doc.length),this.regexp?LD(this,a,t,s):BD(this,a,t,s)}}class Kpe{constructor(e){this.spec=e}}function BD(r,e,t,s){return new lO(e.doc,r.unquoted,t,s,r.caseSensitive?void 0:a=>a.toLowerCase(),r.wholeWord?dTe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function dTe(r,e){return(t,s,a,u)=>((u>t||u+a.length<s)&&(u=Math.max(0,t-2),a=r.sliceString(u,Math.min(r.length,s+2))),(e(xV(a,t-u))!=jc.Word||e(TV(a,t-u))!=jc.Word)&&(e(TV(a,s-u))!=jc.Word||e(xV(a,s-u))!=jc.Word))}class hTe extends Kpe{constructor(e){super(e)}nextMatch(e,t,s){let a=BD(this.spec,e,s,e.doc.length).nextOverlapping();return a.done&&(a=BD(this.spec,e,0,t).nextOverlapping()),a.done?null:a.value}prevMatchInRange(e,t,s){for(let a=s;;){let u=Math.max(t,a-1e4-this.spec.unquoted.length),f=BD(this.spec,e,u,a),h=null;for(;!f.nextOverlapping().done;)h=f.value;if(h)return h;if(u==t)return null;a-=1e4}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let s=BD(this.spec,e,0,e.doc.length),a=[];for(;!s.next().done;){if(a.length>=t)return null;a.push(s.value)}return a}highlight(e,t,s,a){let u=BD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!u.next().done;)a(u.value.from,u.value.to)}}function LD(r,e,t,s){return new jpe(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:r.wholeWord?mTe(e.charCategorizer(e.selection.main.head)):void 0},t,s)}function xV(r,e){return r.slice(Dm(r,e,!1),e)}function TV(r,e){return r.slice(e,Dm(r,e))}function mTe(r){return(e,t,s)=>!s[0].length||(r(xV(s.input,s.index))!=jc.Word||r(TV(s.input,s.index))!=jc.Word)&&(r(TV(s.input,s.index+s[0].length))!=jc.Word||r(xV(s.input,s.index+s[0].length))!=jc.Word)}class gTe extends Kpe{nextMatch(e,t,s){let a=LD(this.spec,e,s,e.doc.length).next();return a.done&&(a=LD(this.spec,e,0,t).next()),a.done?null:a.value}prevMatchInRange(e,t,s){for(let a=1;;a++){let u=Math.max(t,s-a*1e4),f=LD(this.spec,e,u,s),h=null;for(;!f.next().done;)h=f.value;if(h&&(u==t||h.from>u+10))return h;if(u==t)return null}}prevMatch(e,t,s){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,s,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,s)=>s=="$"?"$":s=="&"?e.match[0]:s!="0"&&+s<e.match.length?e.match[s]:t))}matchAll(e,t){let s=LD(this.spec,e,0,e.doc.length),a=[];for(;!s.next().done;){if(a.length>=t)return null;a.push(s.value)}return a}highlight(e,t,s,a){let u=LD(this.spec,e,Math.max(0,t-250),Math.min(s+250,e.doc.length));for(;!u.next().done;)a(u.value.from,u.value.to)}}const XP=Ii.define(),ose=Ii.define(),uk=md.define({create(r){return new qte(moe(r).create(),null)},update(r,e){for(let t of e.effects)t.is(XP)?r=new qte(t.value.create(),r.panel):t.is(ose)&&(r=new qte(r.query,t.value?sse:null));return r},provide:r=>GP.from(r,e=>e.panel)});class qte{constructor(e,t){this.query=e,this.panel=t}}const pTe=ti.mark({class:"cm-searchMatch"}),bTe=ti.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vTe=mf.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(uk))}update(r){let e=r.state.field(uk);(e!=r.startState.field(uk)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return ti.none;let{view:t}=this,s=new mk;for(let a=0,u=t.visibleRanges,f=u.length;a<f;a++){let{from:h,to:g}=u[a];for(;a<f-1&&g>u[a+1].from-2*250;)g=u[++a].to;r.highlight(t.state,h,g,(v,_)=>{let A=t.state.selection.ranges.some(O=>O.from==v&&O.to==_);s.add(v,_,A?bTe:pTe)})}return s.finish()}},{decorations:r=>r.decorations});function vI(r){return e=>{let t=e.state.field(uk,!1);return t&&t.query.spec.valid?r(e,t):Jpe(e)}}const DV=vI((r,{query:e})=>{let{to:t}=r.state.selection.main,s=e.nextMatch(r.state,t,t);if(!s)return!1;let a=Yn.single(s.from,s.to),u=r.state.facet(SO);return r.dispatch({selection:a,effects:[rse(r,s),u.scrollToMatch(a.main,r)],userEvent:"select.search"}),Xpe(r),!0}),OV=vI((r,{query:e})=>{let{state:t}=r,{from:s}=t.selection.main,a=e.prevMatch(t,s,s);if(!a)return!1;let u=Yn.single(a.from,a.to),f=r.state.facet(SO);return r.dispatch({selection:u,effects:[rse(r,a),f.scrollToMatch(u.main,r)],userEvent:"select.search"}),Xpe(r),!0}),yTe=vI((r,{query:e})=>{let t=e.matchAll(r.state,1e3);return!t||!t.length?!1:(r.dispatch({selection:Yn.create(t.map(s=>Yn.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),wTe=({state:r,dispatch:e})=>{let t=r.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:s,to:a}=t.main,u=[],f=0;for(let h=new lO(r.doc,r.sliceDoc(s,a));!h.next().done;){if(u.length>1e3)return!1;h.value.from==s&&(f=u.length),u.push(Yn.range(h.value.from,h.value.to))}return e(r.update({selection:Yn.create(u,f),userEvent:"select.search.matches"})),!0},Xue=vI((r,{query:e})=>{let{state:t}=r,{from:s,to:a}=t.selection.main;if(t.readOnly)return!1;let u=e.nextMatch(t,s,s);if(!u)return!1;let f=[],h,g,v=[];if(u.from==s&&u.to==a&&(g=t.toText(e.getReplacement(u)),f.push({from:u.from,to:u.to,insert:g}),u=e.nextMatch(t,u.from,u.to),v.push(xs.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(s).number)+"."))),u){let _=f.length==0||f[0].from>=u.to?0:u.to-u.from-g.length;h=Yn.single(u.from-_,u.to-_),v.push(rse(r,u)),v.push(t.facet(SO).scrollToMatch(h.main,r))}return r.dispatch({changes:f,selection:h,effects:v,userEvent:"input.replace"}),!0}),_Te=vI((r,{query:e})=>{if(r.state.readOnly)return!1;let t=e.matchAll(r.state,1e9).map(a=>{let{from:u,to:f}=a;return{from:u,to:f,insert:e.getReplacement(a)}});if(!t.length)return!1;let s=r.state.phrase("replaced $ matches",t.length)+".";return r.dispatch({changes:t,effects:xs.announce.of(s),userEvent:"input.replace.all"}),!0});function sse(r){return r.state.facet(SO).createPanel(r)}function moe(r,e){var t,s,a,u,f;let h=r.selection.main,g=h.empty||h.to>h.from+100?"":r.sliceDoc(h.from,h.to);if(e&&!g)return e;let v=r.facet(SO);return new Gpe({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:v.literal)?g:g.replace(/\n/g,"\\n"),caseSensitive:(s=e==null?void 0:e.caseSensitive)!==null&&s!==void 0?s:v.caseSensitive,literal:(a=e==null?void 0:e.literal)!==null&&a!==void 0?a:v.literal,regexp:(u=e==null?void 0:e.regexp)!==null&&u!==void 0?u:v.regexp,wholeWord:(f=e==null?void 0:e.wholeWord)!==null&&f!==void 0?f:v.wholeWord})}function Ype(r){let e=qP(r,sse);return e&&e.dom.querySelector("[main-field]")}function Xpe(r){let e=Ype(r);e&&e==r.root.activeElement&&e.select()}const Jpe=r=>{let e=r.state.field(uk,!1);if(e&&e.panel){let t=Ype(r);if(t&&t!=r.root.activeElement){let s=moe(r.state,e.query.spec);s.valid&&r.dispatch({effects:XP.of(s)}),t.focus(),t.select()}}else r.dispatch({effects:[ose.of(!0),e?XP.of(moe(r.state,e.query.spec)):Ii.appendConfig.of(ETe)]});return!0},Qpe=r=>{let e=r.state.field(uk,!1);if(!e||!e.panel)return!1;let t=qP(r,sse);return t&&t.dom.contains(r.root.activeElement)&&r.focus(),r.dispatch({effects:ose.of(!1)}),!0},CTe=[{key:"Mod-f",run:Jpe,scope:"editor search-panel"},{key:"F3",run:DV,shift:OV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:DV,shift:OV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Qpe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:wTe},{key:"Alt-g",run:eTe},{key:"Mod-d",run:fTe,preventDefault:!0}];class STe{constructor(e){this.view=e;let t=this.query=e.state.field(uk).query.spec;this.commit=this.commit.bind(this),this.searchField=mc("input",{value:t.search,placeholder:k1(e,"Find"),"aria-label":k1(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=mc("input",{value:t.replace,placeholder:k1(e,"Replace"),"aria-label":k1(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=mc("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=mc("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=mc("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function s(a,u,f){return mc("button",{class:"cm-button",name:a,onclick:u,type:"button"},f)}this.dom=mc("div",{onkeydown:a=>this.keydown(a),class:"cm-search"},[this.searchField,s("next",()=>DV(e),[k1(e,"next")]),s("prev",()=>OV(e),[k1(e,"previous")]),s("select",()=>yTe(e),[k1(e,"all")]),mc("label",null,[this.caseField,k1(e,"match case")]),mc("label",null,[this.reField,k1(e,"regexp")]),mc("label",null,[this.wordField,k1(e,"by word")]),...e.state.readOnly?[]:[mc("br"),this.replaceField,s("replace",()=>Xue(e),[k1(e,"replace")]),s("replaceAll",()=>_Te(e),[k1(e,"replace all")])],mc("button",{name:"close",onclick:()=>Qpe(e),"aria-label":k1(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Gpe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:XP.of(e)}))}keydown(e){FEe(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?OV:DV)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Xue(this.view))}update(e){for(let t of e.transactions)for(let s of t.effects)s.is(XP)&&!s.value.eq(this.query)&&this.setQuery(s.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(SO).top}}function k1(r,e){return r.state.phrase(e)}const hz=30,mz=/[\s\.,:;?!]/;function rse(r,{from:e,to:t}){let s=r.state.doc.lineAt(e),a=r.state.doc.lineAt(t).to,u=Math.max(s.from,e-hz),f=Math.min(a,t+hz),h=r.state.sliceDoc(u,f);if(u!=s.from){for(let g=0;g<hz;g++)if(!mz.test(h[g+1])&&mz.test(h[g])){h=h.slice(g);break}}if(f!=a){for(let g=h.length-1;g>h.length-hz;g--)if(!mz.test(h[g-1])&&mz.test(h[g])){h=h.slice(0,g);break}}return xs.announce.of(`${r.state.phrase("current match")}. ${h} ${r.state.phrase("on line")} ${s.number}.`)}const kTe=xs.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ETe=[uk,wO.low(vTe),kTe];class e1e{constructor(e,t,s){this.state=e,this.pos=t,this.explicit=s,this.abortListeners=[]}tokenBefore(e){let t=Om(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),s=Math.max(t.from,this.pos-250),a=t.text.slice(s-t.from,this.pos-t.from),u=a.search(t1e(e,!1));return u<0?null:{from:s+u,to:this.pos,text:a.slice(u)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Jue(r){let e=Object.keys(r).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function ATe(r){let e=Object.create(null),t=Object.create(null);for(let{label:a}of r){e[a[0]]=!0;for(let u=1;u<a.length;u++)t[a[u]]=!0}let s=Jue(e)+Jue(t)+"*$";return[new RegExp("^"+s),new RegExp(s)]}function xTe(r){let e=r.map(a=>typeof a=="string"?{label:a}:a),[t,s]=e.every(a=>/^\w+$/.test(a.label))?[/\w*$/,/\w+$/]:ATe(e);return a=>{let u=a.matchBefore(s);return u||a.explicit?{from:u?u.from:a.pos,options:e,validFor:t}:null}}class Que{constructor(e,t,s,a){this.completion=e,this.source=t,this.match=s,this.score=a}}function fk(r){return r.selection.main.from}function t1e(r,e){var t;let{source:s}=r,a=e&&s[0]!="^",u=s[s.length-1]!="$";return!a&&!u?r:new RegExp(`${a?"^":""}(?:${s})${u?"$":""}`,(t=r.flags)!==null&&t!==void 0?t:r.ignoreCase?"i":"")}const TTe=B_.define();function DTe(r,e,t,s){let{main:a}=r.selection,u=t-a.from,f=s-a.from;return Object.assign(Object.assign({},r.changeByRange(h=>h!=a&&t!=s&&r.sliceDoc(h.from+u,h.from+f)!=r.sliceDoc(t,s)?{range:h}:{changes:{from:h.from+u,to:s==a.from?h.to:h.from+f,insert:e},range:Yn.cursor(h.from+u+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const efe=new WeakMap;function OTe(r){if(!Array.isArray(r))return r;let e=efe.get(r);return e||efe.set(r,e=xTe(r)),e}const ise=Ii.define(),JP=Ii.define();class MTe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let s=Lh(e,t),a=O0(s);this.chars.push(s);let u=e.slice(t,t+a),f=u.toUpperCase();this.folded.push(Lh(f==u?u.toLowerCase():f,0)),t+=a}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,!0}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return!1;let{chars:t,folded:s,any:a,precise:u,byWord:f}=this;if(t.length==1){let ee=Lh(e,0),F=O0(ee),oe=F==e.length?0:-100;if(ee!=t[0])if(ee==s[0])oe+=-200;else return!1;return this.ret(oe,[0,F])}let h=e.indexOf(this.pattern);if(h==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let g=t.length,v=0;if(h<0){for(let ee=0,F=Math.min(e.length,200);ee<F&&v<g;){let oe=Lh(e,ee);(oe==t[v]||oe==s[v])&&(a[v++]=ee),ee+=O0(oe)}if(v<g)return!1}let _=0,A=0,O=!1,N=0,L=-1,j=-1,z=/[a-z]/.test(e),q=!0;for(let ee=0,F=Math.min(e.length,200),oe=0;ee<F&&A<g;){let te=Lh(e,ee);h<0&&(_<g&&te==t[_]&&(u[_++]=ee),N<g&&(te==t[N]||te==s[N]?(N==0&&(L=ee),j=ee+1,N++):N=0));let se,X=te<255?te>=48&&te<=57||te>=97&&te<=122?2:te>=65&&te<=90?1:0:(se=Poe(te))!=se.toLowerCase()?1:se!=se.toUpperCase()?2:0;(!ee||X==1&&z||oe==0&&X!=0)&&(t[A]==te||s[A]==te&&(O=!0)?f[A++]=ee:f.length&&(q=!1)),oe=X,ee+=O0(te)}return A==g&&f[0]==0&&q?this.result(-100+(O?-200:0),f,e):N==g&&L==0?this.ret(-200-e.length+(j==e.length?0:-100),[0,j]):h>-1?this.ret(-700-e.length,[h,h+this.pattern.length]):N==g?this.ret(-200+-700-e.length,[L,j]):A==g?this.result(-100+(O?-200:0)+-700+(q?0:-1100),f,e):t.length==2?!1:this.result((a[0]?-700:0)+-200+-1100,a,e)}result(e,t,s){let a=[],u=0;for(let f of t){let h=f+(this.astral?O0(Lh(s,f)):1);u&&a[u-1]==f?a[u-1]=h:(a[u++]=f,a[u++]=h)}return this.ret(e-s.length,a)}}const Mp=Ds.define({combine(r){return pv(r,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:RTe,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>s=>tfe(e(s),t(s)),optionClass:(e,t)=>s=>tfe(e(s),t(s)),addToOptions:(e,t)=>e.concat(t)})}});function tfe(r,e){return r?e?r+" "+e:r:e}function RTe(r,e,t,s,a,u){let f=r.textDirection==mu.RTL,h=f,g=!1,v="top",_,A,O=e.left-a.left,N=a.right-e.right,L=s.right-s.left,j=s.bottom-s.top;if(h&&O<Math.min(L,N)?h=!1:!h&&N<Math.min(L,O)&&(h=!0),L<=(h?O:N))_=Math.max(a.top,Math.min(t.top,a.bottom-j))-e.top,A=Math.min(400,h?O:N);else{g=!0,A=Math.min(400,(f?e.right:a.right-e.left)-30);let ee=a.bottom-e.bottom;ee>=j||ee>e.top?_=t.bottom-e.top:(v="bottom",_=e.bottom-t.top)}let z=(e.bottom-e.top)/u.offsetHeight,q=(e.right-e.left)/u.offsetWidth;return{style:`${v}: ${_/z}px; max-width: ${A/q}px`,class:"cm-completionInfo-"+(g?f?"left-narrow":"right-narrow":h?"left":"right")}}function NTe(r){let e=r.addToOptions.slice();return r.icons&&e.push({render(t){let s=document.createElement("div");return s.classList.add("cm-completionIcon"),t.type&&s.classList.add(...t.type.split(/\s+/g).map(a=>"cm-completionIcon-"+a)),s.setAttribute("aria-hidden","true"),s},position:20}),e.push({render(t,s,a){let u=document.createElement("span");u.className="cm-completionLabel";let f=t.displayLabel||t.label,h=0;for(let g=0;g<a.length;){let v=a[g++],_=a[g++];v>h&&u.appendChild(document.createTextNode(f.slice(h,v)));let A=u.appendChild(document.createElement("span"));A.appendChild(document.createTextNode(f.slice(v,_))),A.className="cm-completionMatchedText",h=_}return h<f.length&&u.appendChild(document.createTextNode(f.slice(h))),u},position:50},{render(t){if(!t.detail)return null;let s=document.createElement("span");return s.className="cm-completionDetail",s.textContent=t.detail,s},position:80}),e.sort((t,s)=>t.position-s.position).map(t=>t.render)}function nfe(r,e,t){if(r<=t)return{from:0,to:r};if(e<0&&(e=0),e<=r>>1){let a=Math.floor(e/t);return{from:a*t,to:(a+1)*t}}let s=Math.floor((r-e)/t);return{from:r-(s+1)*t,to:r-s*t}}class PTe{constructor(e,t,s){this.view=e,this.stateField=t,this.applyCompletion=s,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:g=>this.placeInfo(g),key:this},this.space=null,this.currentClass="";let a=e.state.field(t),{options:u,selected:f}=a.open,h=e.state.facet(Mp);this.optionContent=NTe(h),this.optionClass=h.optionClass,this.tooltipClass=h.tooltipClass,this.range=nfe(u.length,f,h.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",g=>{for(let v=g.target,_;v&&v!=this.dom;v=v.parentNode)if(v.nodeName=="LI"&&(_=/-(\d+)$/.exec(v.id))&&+_[1]<u.length){this.applyCompletion(e,u[+_[1]]),g.preventDefault();return}}),this.dom.addEventListener("focusout",g=>{let v=e.state.field(this.stateField,!1);v&&v.tooltip&&e.state.facet(Mp).closeOnBlur&&g.relatedTarget!=e.contentDOM&&e.dispatch({effects:JP.of(null)})}),this.list=this.dom.appendChild(this.createListBox(u,a.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,s,a;let u=e.state.field(this.stateField),f=e.startState.field(this.stateField);this.updateTooltipClass(e.state),u!=f&&(this.updateSel(),((t=u.open)===null||t===void 0?void 0:t.disabled)!=((s=f.open)===null||s===void 0?void 0:s.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((a=u.open)===null||a===void 0)&&a.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let s of this.currentClass.split(" "))s&&this.dom.classList.remove(s);for(let s of t.split(" "))s&&this.dom.classList.add(s);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=nfe(t.options.length,t.selected,this.view.state.facet(Mp).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:a}=s;if(!a)return;let u=typeof a=="string"?document.createTextNode(a):a(s);if(!u)return;"then"in u?u.then(f=>{f&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(f,s)}).catch(f=>R0(this.view.state,f,"completion info")):this.addInfoPane(u,s)}}addInfoPane(e,t){this.destroyInfo();let s=this.info=document.createElement("div");if(s.className="cm-tooltip cm-completionInfo",e.nodeType!=null)s.appendChild(e),this.infoDestroy=null;else{let{dom:a,destroy:u}=e;s.appendChild(a),this.infoDestroy=u||null}this.dom.appendChild(s),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let s=this.list.firstChild,a=this.range.from;s;s=s.nextSibling,a++)s.nodeName!="LI"||!s.id?a--:a==e?s.hasAttribute("aria-selected")||(s.setAttribute("aria-selected","true"),t=s):s.hasAttribute("aria-selected")&&s.removeAttribute("aria-selected");return t&&BTe(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),s=this.info.getBoundingClientRect(),a=e.getBoundingClientRect(),u=this.space;if(!u){let f=this.dom.ownerDocument.defaultView||window;u={left:0,top:0,right:f.innerWidth,bottom:f.innerHeight}}return a.top>Math.min(u.bottom,t.bottom)-10||a.bottom<Math.max(u.top,t.top)+10?null:this.view.state.facet(Mp).positionInfo(this.view,t,a,s,u,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,s){const a=document.createElement("ul");a.id=t,a.setAttribute("role","listbox"),a.setAttribute("aria-expanded","true"),a.setAttribute("aria-label",this.view.state.phrase("Completions"));let u=null;for(let f=s.from;f<s.to;f++){let{completion:h,match:g}=e[f],{section:v}=h;if(v){let O=typeof v=="string"?v:v.name;if(O!=u&&(f>s.from||s.from==0))if(u=O,typeof v!="string"&&v.header)a.appendChild(v.header(v));else{let N=a.appendChild(document.createElement("completion-section"));N.textContent=O}}const _=a.appendChild(document.createElement("li"));_.id=t+"-"+f,_.setAttribute("role","option");let A=this.optionClass(h);A&&(_.className=A);for(let O of this.optionContent){let N=O(h,this.view.state,g);N&&_.appendChild(N)}}return s.from&&a.classList.add("cm-completionListIncompleteTop"),s.to<e.length&&a.classList.add("cm-completionListIncompleteBottom"),a}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function ITe(r,e){return t=>new PTe(t,r,e)}function BTe(r,e){let t=r.getBoundingClientRect(),s=e.getBoundingClientRect(),a=t.height/r.offsetHeight;s.top<t.top?r.scrollTop-=(t.top-s.top)/a:s.bottom>t.bottom&&(r.scrollTop+=(s.bottom-t.bottom)/a)}function ofe(r){return(r.boost||0)*100+(r.apply?10:0)+(r.info?5:0)+(r.type?1:0)}function LTe(r,e){let t=[],s=null,a=g=>{t.push(g);let{section:v}=g.completion;if(v){s||(s=[]);let _=typeof v=="string"?v:v.name;s.some(A=>A.name==_)||s.push(typeof v=="string"?{name:_}:v)}};for(let g of r)if(g.hasResult()){let v=g.result.getMatch;if(g.result.filter===!1)for(let _ of g.result.options)a(new Que(_,g.source,v?v(_):[],1e9-t.length));else{let _=new MTe(e.sliceDoc(g.from,g.to));for(let A of g.result.options)if(_.match(A.label)){let O=A.displayLabel?v?v(A,_.matched):[]:_.matched;a(new Que(A,g.source,O,_.score+(A.boost||0)))}}}if(s){let g=Object.create(null),v=0,_=(A,O)=>{var N,L;return((N=A.rank)!==null&&N!==void 0?N:1e9)-((L=O.rank)!==null&&L!==void 0?L:1e9)||(A.name<O.name?-1:1)};for(let A of s.sort(_))v-=1e5,g[A.name]=v;for(let A of t){let{section:O}=A.completion;O&&(A.score+=g[typeof O=="string"?O:O.name])}}let u=[],f=null,h=e.facet(Mp).compareCompletions;for(let g of t.sort((v,_)=>_.score-v.score||h(v.completion,_.completion))){let v=g.completion;!f||f.label!=v.label||f.detail!=v.detail||f.type!=null&&v.type!=null&&f.type!=v.type||f.apply!=v.apply||f.boost!=v.boost?u.push(g):ofe(g.completion)>ofe(f)&&(u[u.length-1]=g),f=g.completion}return u}class WD{constructor(e,t,s,a,u,f){this.options=e,this.attrs=t,this.tooltip=s,this.timestamp=a,this.selected=u,this.disabled=f}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new WD(this.options,sfe(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,s,a,u){let f=LTe(e,t);if(!f.length)return a&&e.some(g=>g.state==1)?new WD(a.options,a.attrs,a.tooltip,a.timestamp,a.selected,!0):null;let h=t.facet(Mp).selectOnOpen?0:-1;if(a&&a.selected!=h&&a.selected!=-1){let g=a.options[a.selected].completion;for(let v=0;v<f.length;v++)if(f[v].completion==g){h=v;break}}return new WD(f,sfe(s,h),{pos:e.reduce((g,v)=>v.hasResult()?Math.min(g,v.from):g,1e8),create:ITe(O1,s1e),above:u.aboveCursor},a?a.timestamp:Date.now(),h,!1)}map(e){return new WD(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class MV{constructor(e,t,s){this.active=e,this.id=t,this.open=s}static start(){return new MV($Te,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,s=t.facet(Mp),u=(s.override||t.languageDataAt("autocomplete",fk(t)).map(OTe)).map(h=>(this.active.find(v=>v.source==h)||new xp(h,this.active.some(v=>v.state!=0)?1:0)).update(e,s));u.length==this.active.length&&u.every((h,g)=>h==this.active[g])&&(u=this.active);let f=this.open;f&&e.docChanged&&(f=f.map(e.changes)),e.selection||u.some(h=>h.hasResult()&&e.changes.touchesRange(h.from,h.to))||!FTe(u,this.active)?f=WD.build(u,t,this.id,f,s):f&&f.disabled&&!u.some(h=>h.state==1)&&(f=null),!f&&u.every(h=>h.state!=1)&&u.some(h=>h.hasResult())&&(u=u.map(h=>h.hasResult()?new xp(h.source,0):h));for(let h of e.effects)h.is(o1e)&&(f=f&&f.setSelected(h.value,this.id));return u==this.active&&f==this.open?this:new MV(u,this.id,f)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:HTe}}function FTe(r,e){if(r==e)return!0;for(let t=0,s=0;;){for(;t<r.length&&!r[t].hasResult;)t++;for(;s<e.length&&!e[s].hasResult;)s++;let a=t==r.length,u=s==e.length;if(a||u)return a==u;if(r[t++].result!=e[s++].result)return!1}}const HTe={"aria-autocomplete":"list"};function sfe(r,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":r};return e>-1&&(t["aria-activedescendant"]=r+"-"+e),t}const $Te=[];function goe(r){return r.isUserEvent("input.type")?"input":r.isUserEvent("delete.backward")?"delete":null}class xp{constructor(e,t,s=-1){this.source=e,this.state=t,this.explicitPos=s}hasResult(){return!1}update(e,t){let s=goe(e),a=this;s?a=a.handleUserEvent(e,s,t):e.docChanged?a=a.handleChange(e):e.selection&&a.state!=0&&(a=new xp(a.source,0));for(let u of e.effects)if(u.is(ise))a=new xp(a.source,1,u.value?fk(e.state):-1);else if(u.is(JP))a=new xp(a.source,0);else if(u.is(n1e))for(let f of u.value)f.source==a.source&&(a=f);return a}handleUserEvent(e,t,s){return t=="delete"||!s.activateOnTyping?this.map(e.changes):new xp(this.source,1)}handleChange(e){return e.changes.touchesRange(fk(e.startState))?new xp(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new xp(this.source,this.state,e.mapPos(this.explicitPos))}}class tO extends xp{constructor(e,t,s,a,u){super(e,2,t),this.result=s,this.from=a,this.to=u}hasResult(){return!0}handleUserEvent(e,t,s){var a;let u=e.changes.mapPos(this.from),f=e.changes.mapPos(this.to,1),h=fk(e.state);if((this.explicitPos<0?h<=u:h<this.from)||h>f||t=="delete"&&fk(e.startState)==this.from)return new xp(this.source,t=="input"&&s.activateOnTyping?1:0);let g=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),v;return zTe(this.result.validFor,e.state,u,f)?new tO(this.source,g,this.result,u,f):this.result.update&&(v=this.result.update(this.result,u,f,new e1e(e.state,h,g>=0)))?new tO(this.source,g,v,v.from,(a=v.to)!==null&&a!==void 0?a:fk(e.state)):new xp(this.source,1,g)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new xp(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new tO(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function zTe(r,e,t,s){if(!r)return!1;let a=e.sliceDoc(t,s);return typeof r=="function"?r(a,t,s,e):t1e(r,!0).test(a)}const n1e=Ii.define({map(r,e){return r.map(t=>t.map(e))}}),o1e=Ii.define(),O1=md.define({create(){return MV.start()},update(r,e){return r.update(e)},provide:r=>[XV.from(r,e=>e.tooltip),xs.contentAttributes.from(r,e=>e.attrs)]});function s1e(r,e){const t=e.completion.apply||e.completion.label;let s=r.state.field(O1).active.find(a=>a.source==e.source);return s instanceof tO?(typeof t=="string"?r.dispatch(Object.assign(Object.assign({},DTe(r.state,t,s.from,s.to)),{annotations:TTe.of(e.completion)})):t(r,e.completion,s.from,s.to),!0):!1}function gz(r,e="option"){return t=>{let s=t.state.field(O1,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<t.state.facet(Mp).interactionDelay)return!1;let a=1,u;e=="page"&&(u=Lge(t,s.open.tooltip))&&(a=Math.max(2,Math.floor(u.dom.offsetHeight/u.dom.querySelector("li").offsetHeight)-1));let{length:f}=s.open.options,h=s.open.selected>-1?s.open.selected+a*(r?1:-1):r?0:f-1;return h<0?h=e=="page"?0:f-1:h>=f&&(h=e=="page"?f-1:0),t.dispatch({effects:o1e.of(h)}),!0}}const VTe=r=>{let e=r.state.field(O1,!1);return r.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<r.state.facet(Mp).interactionDelay?!1:s1e(r,e.open.options[e.open.selected])},UTe=r=>r.state.field(O1,!1)?(r.dispatch({effects:ise.of(!0)}),!0):!1,WTe=r=>{let e=r.state.field(O1,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(r.dispatch({effects:JP.of(null)}),!0)};class jTe{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const rfe=50,ZTe=50,qTe=1e3,GTe=mf.fromClass(class{constructor(r){this.view=r,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of r.state.field(O1).active)e.state==1&&this.startQuery(e)}update(r){let e=r.state.field(O1);if(!r.selectionSet&&!r.docChanged&&r.startState.field(O1)==e)return;let t=r.transactions.some(s=>(s.selection||s.docChanged)&&!goe(s));for(let s=0;s<this.running.length;s++){let a=this.running[s];if(t||a.updates.length+r.transactions.length>ZTe&&Date.now()-a.time>qTe){for(let u of a.context.abortListeners)try{u()}catch(f){R0(this.view.state,f)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...r.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(s=>s.state==1&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),rfe):-1,this.composing!=0)for(let s of r.transactions)goe(s)=="input"?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:r}=this.view,e=r.field(O1);for(let t of e.active)t.state==1&&!this.running.some(s=>s.active.source==t.source)&&this.startQuery(t)}startQuery(r){let{state:e}=this.view,t=fk(e),s=new e1e(e,t,r.explicitPos==t),a=new jTe(r,s);this.running.push(a),Promise.resolve(r.source(s)).then(u=>{a.context.aborted||(a.done=u||null,this.scheduleAccept())},u=>{this.view.dispatch({effects:JP.of(null)}),R0(this.view.state,u)})}scheduleAccept(){this.running.every(r=>r.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),rfe))}accept(){var r;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Mp);for(let s=0;s<this.running.length;s++){let a=this.running[s];if(a.done===void 0)continue;if(this.running.splice(s--,1),a.done){let f=new tO(a.active.source,a.active.explicitPos,a.done,a.done.from,(r=a.done.to)!==null&&r!==void 0?r:fk(a.updates.length?a.updates[0].startState:this.view.state));for(let h of a.updates)f=f.update(h,t);if(f.hasResult()){e.push(f);continue}}let u=this.view.state.field(O1).active.find(f=>f.source==a.active.source);if(u&&u.state==1)if(a.done==null){let f=new xp(a.active.source,0);for(let h of a.updates)f=f.update(h,t);f.state!=1&&e.push(f)}else this.startQuery(u)}e.length&&this.view.dispatch({effects:n1e.of(e)})}},{eventHandlers:{blur(r){let e=this.view.state.field(O1,!1);if(e&&e.tooltip&&this.view.state.facet(Mp).closeOnBlur){let t=e.open&&Lge(this.view,e.open.tooltip);(!t||!t.dom.contains(r.relatedTarget))&&this.view.dispatch({effects:JP.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ise.of(!1)}),20),this.composing=0}}}),KTe=xs.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),QP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zx=Ii.define({map(r,e){let t=e.mapPos(r,-1,Ag.TrackAfter);return t==null?void 0:t}}),ase=new class extends Gx{};ase.startSide=1;ase.endSide=-1;const r1e=md.define({create(){return Xa.empty},update(r,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,s=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(s,-1)&&(r=Xa.empty)}r=r.map(e.changes);for(let t of e.effects)t.is(zx)&&(r=r.update({add:[ase.range(t.value,t.value+1)]}));return r}});function YTe(){return[JTe,r1e]}const Gte="()[]{}<>";function i1e(r){for(let e=0;e<Gte.length;e+=2)if(Gte.charCodeAt(e)==r)return Gte.charAt(e+1);return Poe(r<128?r:r+1)}function a1e(r,e){return r.languageDataAt("closeBrackets",e)[0]||QP}const XTe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),JTe=xs.inputHandler.of((r,e,t,s)=>{if((XTe?r.composing:r.compositionStarted)||r.state.readOnly)return!1;let a=r.state.selection.main;if(s.length>2||s.length==2&&O0(Lh(s,0))==1||e!=a.from||t!=a.to)return!1;let u=t4e(r.state,s);return u?(r.dispatch(u),!0):!1}),QTe=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let s=a1e(r,r.selection.main.head).brackets||QP.brackets,a=null,u=r.changeByRange(f=>{if(f.empty){let h=n4e(r.doc,f.head);for(let g of s)if(g==h&&iU(r.doc,f.head)==i1e(Lh(g,0)))return{changes:{from:f.head-g.length,to:f.head+g.length},range:Yn.cursor(f.head-g.length)}}return{range:a=f}});return a||e(r.update(u,{scrollIntoView:!0,userEvent:"delete.backward"})),!a},e4e=[{key:"Backspace",run:QTe}];function t4e(r,e){let t=a1e(r,r.selection.main.head),s=t.brackets||QP.brackets;for(let a of s){let u=i1e(Lh(a,0));if(e==a)return u==a?r4e(r,a,s.indexOf(a+a+a)>-1,t):o4e(r,a,u,t.before||QP.before);if(e==u&&l1e(r,r.selection.main.from))return s4e(r,a,u)}return null}function l1e(r,e){let t=!1;return r.field(r1e).between(0,r.doc.length,s=>{s==e&&(t=!0)}),t}function iU(r,e){let t=r.sliceString(e,e+2);return t.slice(0,O0(Lh(t,0)))}function n4e(r,e){let t=r.sliceString(e-2,e);return O0(Lh(t,0))==t.length?t:t.slice(1)}function o4e(r,e,t,s){let a=null,u=r.changeByRange(f=>{if(!f.empty)return{changes:[{insert:e,from:f.from},{insert:t,from:f.to}],effects:zx.of(f.to+e.length),range:Yn.range(f.anchor+e.length,f.head+e.length)};let h=iU(r.doc,f.head);return!h||/\s/.test(h)||s.indexOf(h)>-1?{changes:{insert:e+t,from:f.head},effects:zx.of(f.head+e.length),range:Yn.cursor(f.head+e.length)}:{range:a=f}});return a?null:r.update(u,{scrollIntoView:!0,userEvent:"input.type"})}function s4e(r,e,t){let s=null,a=r.changeByRange(u=>u.empty&&iU(r.doc,u.head)==t?{changes:{from:u.head,to:u.head+t.length,insert:t},range:Yn.cursor(u.head+t.length)}:s={range:u});return s?null:r.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function r4e(r,e,t,s){let a=s.stringPrefixes||QP.stringPrefixes,u=null,f=r.changeByRange(h=>{if(!h.empty)return{changes:[{insert:e,from:h.from},{insert:e,from:h.to}],effects:zx.of(h.to+e.length),range:Yn.range(h.anchor+e.length,h.head+e.length)};let g=h.head,v=iU(r.doc,g),_;if(v==e){if(ife(r,g))return{changes:{insert:e+e,from:g},effects:zx.of(g+e.length),range:Yn.cursor(g+e.length)};if(l1e(r,g)){let O=t&&r.sliceDoc(g,g+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:g,to:g+O.length,insert:O},range:Yn.cursor(g+O.length)}}}else{if(t&&r.sliceDoc(g-2*e.length,g)==e+e&&(_=afe(r,g-2*e.length,a))>-1&&ife(r,_))return{changes:{insert:e+e+e+e,from:g},effects:zx.of(g+e.length),range:Yn.cursor(g+e.length)};if(r.charCategorizer(g)(v)!=jc.Word&&afe(r,g,a)>-1&&!i4e(r,g,e,a))return{changes:{insert:e+e,from:g},effects:zx.of(g+e.length),range:Yn.cursor(g+e.length)}}return{range:u=h}});return u?null:r.update(f,{scrollIntoView:!0,userEvent:"input.type"})}function ife(r,e){let t=Om(r).resolveInner(e+1);return t.parent&&t.from==e}function i4e(r,e,t,s){let a=Om(r).resolveInner(e,-1),u=s.reduce((f,h)=>Math.max(f,h.length),0);for(let f=0;f<5;f++){let h=r.sliceDoc(a.from,Math.min(a.to,a.from+t.length+u)),g=h.indexOf(t);if(!g||g>-1&&s.indexOf(h.slice(0,g))>-1){let _=a.firstChild;for(;_&&_.from==a.from&&_.to-_.from>t.length+g;){if(r.sliceDoc(_.to-t.length,_.to)==t)return!1;_=_.firstChild}return!0}let v=a.to==e&&a.parent;if(!v)break;a=v}return!1}function afe(r,e,t){let s=r.charCategorizer(e);if(s(r.sliceDoc(e-1,e))!=jc.Word)return e;for(let a of t){let u=e-a.length;if(r.sliceDoc(u,e)==a&&s(r.sliceDoc(u-1,u))!=jc.Word)return u}return-1}function a4e(r={}){return[O1,Mp.of(r),GTe,l4e,KTe]}const c1e=[{key:"Ctrl-Space",run:UTe},{key:"Escape",run:WTe},{key:"ArrowDown",run:gz(!0)},{key:"ArrowUp",run:gz(!1)},{key:"PageDown",run:gz(!0,"page")},{key:"PageUp",run:gz(!1,"page")},{key:"Enter",run:VTe}],l4e=wO.highest(YV.computeN([Mp],r=>r.facet(Mp).defaultKeymap?[c1e]:[]));class c4e{constructor(e,t,s){this.from=e,this.to=t,this.diagnostic=s}}class Hx{constructor(e,t,s){this.diagnostics=e,this.panel=t,this.selected=s}static init(e,t,s){let a=e,u=s.facet(Vx).markerFilter;u&&(a=u(a));let f=ti.set(a.map(h=>h.from==h.to||h.from==h.to-1&&s.doc.lineAt(h.from).to==h.from?ti.widget({widget:new v4e(h),diagnostic:h}).range(h.from):ti.mark({attributes:{class:"cm-lintRange cm-lintRange-"+h.severity+(h.markClass?" "+h.markClass:"")},diagnostic:h}).range(h.from,h.to)),!0);return new Hx(f,t,cO(f))}}function cO(r,e=null,t=0){let s=null;return r.between(t,1e9,(a,u,{spec:f})=>{if(!(e&&f.diagnostic!=e))return s=new c4e(a,u,f.diagnostic),!1}),s}function u1e(r,e){let t=r.startState.doc.lineAt(e.pos);return!!(r.effects.some(s=>s.is(aU))||r.changes.touchesRange(t.from,t.to))}function f1e(r,e){return r.field(N1,!1)?e:e.concat(Ii.appendConfig.of(v1e))}function u4e(r,e){return{effects:f1e(r,[aU.of(e)])}}const aU=Ii.define(),lse=Ii.define(),d1e=Ii.define(),N1=md.define({create(){return new Hx(ti.none,null,null)},update(r,e){if(e.docChanged){let t=r.diagnostics.map(e.changes),s=null;if(r.selected){let a=e.changes.mapPos(r.selected.from,1);s=cO(t,r.selected.diagnostic,a)||cO(t,null,a)}r=new Hx(t,r.panel,s)}for(let t of e.effects)t.is(aU)?r=Hx.init(t.value,r.panel,e.state):t.is(lse)?r=new Hx(r.diagnostics,t.value?lU.open:null,r.selected):t.is(d1e)&&(r=new Hx(r.diagnostics,r.panel,t.value));return r},provide:r=>[GP.from(r,e=>e.panel),xs.decorations.from(r,e=>e.diagnostics)]}),f4e=ti.mark({class:"cm-lintRange cm-lintRange-active"});function d4e(r,e,t){let{diagnostics:s}=r.state.field(N1),a=[],u=2e8,f=0;s.between(e-(t<0?1:0),e+(t>0?1:0),(g,v,{spec:_})=>{e>=g&&e<=v&&(g==v||(e>g||t>0)&&(e<v||t<0))&&(a.push(_.diagnostic),u=Math.min(g,u),f=Math.max(v,f))});let h=r.state.facet(Vx).tooltipFilter;return h&&(a=h(a)),a.length?{pos:u,end:f,above:r.state.doc.lineAt(u).to<f,create(){return{dom:h1e(r,a)}}}:null}function h1e(r,e){return mc("ul",{class:"cm-tooltip-lint"},e.map(t=>g1e(r,t,!1)))}const h4e=r=>{let e=r.state.field(N1,!1);(!e||!e.panel)&&r.dispatch({effects:f1e(r.state,[lse.of(!0)])});let t=qP(r,lU.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},lfe=r=>{let e=r.state.field(N1,!1);return!e||!e.panel?!1:(r.dispatch({effects:lse.of(!1)}),!0)},m4e=r=>{let e=r.state.field(N1,!1);if(!e)return!1;let t=r.state.selection.main,s=e.diagnostics.iter(t.to+1);return!s.value&&(s=e.diagnostics.iter(0),!s.value||s.from==t.from&&s.to==t.to)?!1:(r.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0)},g4e=[{key:"Mod-Shift-m",run:h4e,preventDefault:!0},{key:"F8",run:m4e}],p4e=mf.fromClass(class{constructor(r){this.view=r,this.timeout=-1,this.set=!0;let{delay:e}=r.state.facet(Vx);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let r=Date.now();if(r<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-r);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Vx);Promise.all(t.map(s=>Promise.resolve(s(this.view)))).then(s=>{let a=s.reduce((u,f)=>u.concat(f));this.view.state.doc==e.doc&&this.view.dispatch(u4e(this.view.state,a))},s=>{R0(this.view.state,s)})}}update(r){let e=r.state.facet(Vx);(r.docChanged||e!=r.startState.facet(Vx)||e.needsRefresh&&e.needsRefresh(r))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Vx=Ds.define({combine(r){return Object.assign({sources:r.map(e=>e.source)},pv(r.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?s=>e(s)||t(s):e:t}))}});function b4e(r,e={}){return[Vx.of({source:r,config:e}),p4e,v1e]}function m1e(r){let e=[];if(r)e:for(let{name:t}of r){for(let s=0;s<t.length;s++){let a=t[s];if(/[a-zA-Z]/.test(a)&&!e.some(u=>u.toLowerCase()==a.toLowerCase())){e.push(a);continue e}}e.push("")}return e}function g1e(r,e,t){var s;let a=t?m1e(e.actions):[];return mc("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},mc("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(s=e.actions)===null||s===void 0?void 0:s.map((u,f)=>{let h=!1,g=O=>{if(O.preventDefault(),h)return;h=!0;let N=cO(r.state.field(N1).diagnostics,e);N&&u.apply(r,N.from,N.to)},{name:v}=u,_=a[f]?v.indexOf(a[f]):-1,A=_<0?v:[v.slice(0,_),mc("u",v.slice(_,_+1)),v.slice(_+1)];return mc("button",{type:"button",class:"cm-diagnosticAction",onclick:g,onmousedown:g,"aria-label":` Action: ${v}${_<0?"":` (access key "${a[f]})"`}.`},A)}),e.source&&mc("div",{class:"cm-diagnosticSource"},e.source))}class v4e extends Sk{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return mc("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class cfe{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=g1e(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class lU{constructor(e){this.view=e,this.items=[];let t=a=>{if(a.keyCode==27)lfe(this.view),this.view.focus();else if(a.keyCode==38||a.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(a.keyCode==40||a.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(a.keyCode==36)this.moveSelection(0);else if(a.keyCode==35)this.moveSelection(this.items.length-1);else if(a.keyCode==13)this.view.focus();else if(a.keyCode>=65&&a.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:u}=this.items[this.selectedIndex],f=m1e(u.actions);for(let h=0;h<f.length;h++)if(f[h].toUpperCase().charCodeAt(0)==a.keyCode){let g=cO(this.view.state.field(N1).diagnostics,u);g&&u.actions[h].apply(e,g.from,g.to)}}else return;a.preventDefault()},s=a=>{for(let u=0;u<this.items.length;u++)this.items[u].dom.contains(a.target)&&this.moveSelection(u)};this.list=mc("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:s}),this.dom=mc("div",{class:"cm-panel-lint"},this.list,mc("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>lfe(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(N1).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(N1),s=0,a=!1,u=null;for(e.between(0,this.view.state.doc.length,(f,h,{spec:g})=>{let v=-1,_;for(let A=s;A<this.items.length;A++)if(this.items[A].diagnostic==g.diagnostic){v=A;break}v<0?(_=new cfe(this.view,g.diagnostic),this.items.splice(s,0,_),a=!0):(_=this.items[v],v>s&&(this.items.splice(s,v-s),a=!0)),t&&_.diagnostic==t.diagnostic?_.dom.hasAttribute("aria-selected")||(_.dom.setAttribute("aria-selected","true"),u=_):_.dom.hasAttribute("aria-selected")&&_.dom.removeAttribute("aria-selected"),s++});s<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)a=!0,this.items.pop();this.items.length==0&&(this.items.push(new cfe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),a=!0),u?(this.list.setAttribute("aria-activedescendant",u.id),this.view.requestMeasure({key:this,read:()=>({sel:u.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:f,panel:h})=>{let g=h.height/this.list.offsetHeight;f.top<h.top?this.list.scrollTop-=(h.top-f.top)/g:f.bottom>h.bottom&&(this.list.scrollTop+=(f.bottom-h.bottom)/g)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}sync(){let e=this.list.firstChild;function t(){let s=e;e=s.nextSibling,s.remove()}for(let s of this.items)if(s.dom.parentNode==this.list){for(;e!=s.dom;)t();e=s.dom.nextSibling}else this.list.insertBefore(s.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(N1),s=cO(t.diagnostics,this.items[e].diagnostic);!s||this.view.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:d1e.of(s)})}static open(e){return new lU(e)}}function jz(r,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(r)}</svg>')`}function pz(r){return jz(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${r}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const y4e=xs.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:pz("#d11")},".cm-lintRange-warning":{backgroundImage:pz("orange")},".cm-lintRange-info":{backgroundImage:pz("#999")},".cm-lintRange-hint":{backgroundImage:pz("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function ufe(r){return r=="error"?4:r=="warning"?3:r=="info"?2:1}class w4e extends c2{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,s)=>ufe(t)<ufe(s.severity)?s.severity:t,"hint")}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let s=this.diagnostics,a=e.state.facet(cU).tooltipFilter;return a&&(s=a(s)),s.length&&(t.onmouseover=()=>C4e(e,t,s)),t}}function _4e(r,e){let t=s=>{let a=e.getBoundingClientRect();if(!(s.clientX>a.left-10&&s.clientX<a.right+10&&s.clientY>a.top-10&&s.clientY<a.bottom+10)){for(let u=s.target;u;u=u.parentNode)if(u.nodeType==1&&u.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",t),r.state.field(b1e)&&r.dispatch({effects:cse.of(null)})}};window.addEventListener("mousemove",t)}function C4e(r,e,t){function s(){let f=r.elementAtHeight(e.getBoundingClientRect().top+5-r.documentTop);r.coordsAtPos(f.from)&&r.dispatch({effects:cse.of({pos:f.from,above:!1,create(){return{dom:h1e(r,t),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,_4e(r,e)}let{hoverTime:a}=r.state.facet(cU),u=setTimeout(s,a);e.onmouseout=()=>{clearTimeout(u),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(u),u=setTimeout(s,a)}}function S4e(r,e){let t=Object.create(null);for(let a of e){let u=r.lineAt(a.from);(t[u.from]||(t[u.from]=[])).push(a)}let s=[];for(let a in t)s.push(new w4e(t[a]).range(+a));return Xa.of(s,!0)}const k4e=Hge({class:"cm-gutter-lint",markers:r=>r.state.field(p1e)}),p1e=md.define({create(){return Xa.empty},update(r,e){r=r.map(e.changes);let t=e.state.facet(cU).markerFilter;for(let s of e.effects)if(s.is(aU)){let a=s.value;t&&(a=t(a||[])),r=S4e(e.state.doc,a.slice(0))}return r}}),cse=Ii.define(),b1e=md.define({create(){return null},update(r,e){return r&&e.docChanged&&(r=u1e(e,r)?null:Object.assign(Object.assign({},r),{pos:e.changes.mapPos(r.pos)})),e.effects.reduce((t,s)=>s.is(cse)?s.value:t,r)},provide:r=>XV.from(r)}),E4e=xs.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:jz('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:jz('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:jz('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),v1e=[N1,xs.decorations.compute([N1],r=>{let{selected:e,panel:t}=r.field(N1);return!e||!t||e.from==e.to?ti.none:ti.set([f4e.range(e.from,e.to)])}),SAe(d4e,{hideOn:u1e}),y4e],cU=Ds.define({combine(r){return pv(r,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function A4e(r={}){return[cU.of(r),p1e,k4e,E4e,b1e]}const ffe=(()=>[MAe(),PAe(),tAe(),Qxe(),kxe(),WEe(),KEe(),Ea.allowMultipleSelections.of(!0),uxe(),Axe(Dxe,{fallback:!0}),Bxe(),YTe(),a4e(),hAe(),pAe(),aAe(),oTe(),YV.of([...e4e,...X3e,...CTe,...l3e,...wxe,...c1e,...g4e])])();class RV{constructor(e,t,s,a,u,f,h,g,v,_=0,A){this.p=e,this.stack=t,this.state=s,this.reducePos=a,this.pos=u,this.score=f,this.buffer=h,this.bufferBase=g,this.curContext=v,this.lookAhead=_,this.parent=A}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,s=0){let a=e.parser.context;return new RV(e,[],t,s,s,0,[],0,a?new dfe(a,a.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let s=e>>19,a=e&65535,{parser:u}=this.p,f=u.dynamicPrecedence(a);if(f&&(this.score+=f),s==0){this.pushState(u.getGoto(this.state,a,!0),this.reducePos),a<u.minRepeatTerm&&this.storeNode(a,this.reducePos,this.reducePos,4,!0),this.reduceContext(a,this.reducePos);return}let h=this.stack.length-(s-1)*3-(e&262144?6:0),g=h?this.stack[h-2]:this.p.ranges[0].from,v=this.reducePos-g;v>=2e3&&!(!((t=this.p.parser.nodeSet.types[a])===null||t===void 0)&&t.isAnonymous)&&(g==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=v):this.p.lastBigReductionSize<v&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=g,this.p.lastBigReductionSize=v));let _=h?this.stack[h-1]:0,A=this.bufferBase+this.buffer.length-_;if(a<u.minRepeatTerm||e&131072){let O=u.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(a,g,O,A+4,!0)}if(e&262144)this.state=this.stack[h];else{let O=this.stack[h-3];this.state=u.getGoto(O,a,!0)}for(;this.stack.length>h;)this.stack.pop();this.reduceContext(a,g)}storeNode(e,t,s,a=4,u=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let f=this,h=this.buffer.length;if(h==0&&f.parent&&(h=f.bufferBase-f.parent.bufferBase,f=f.parent),h>0&&f.buffer[h-4]==0&&f.buffer[h-1]>-1){if(t==s)return;if(f.buffer[h-2]>=t){f.buffer[h-2]=s;return}}}if(!u||this.pos==s)this.buffer.push(e,t,s,a);else{let f=this.buffer.length;if(f>0&&this.buffer[f-4]!=0)for(;f>0&&this.buffer[f-2]>s;)this.buffer[f]=this.buffer[f-4],this.buffer[f+1]=this.buffer[f-3],this.buffer[f+2]=this.buffer[f-2],this.buffer[f+3]=this.buffer[f-1],f-=4,a>4&&(a-=4);this.buffer[f]=e,this.buffer[f+1]=t,this.buffer[f+2]=s,this.buffer[f+3]=a}}shift(e,t,s,a){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let u=e,{parser:f}=this.p;(a>this.pos||t<=f.maxNode)&&(this.pos=a,f.stateFlag(u,1)||(this.reducePos=a)),this.pushState(u,s),this.shiftContext(t,s),t<=f.maxNode&&this.buffer.push(t,s,a,4)}else this.pos=a,this.shiftContext(t,s),t<=this.p.parser.maxNode&&this.buffer.push(t,s,a,4)}apply(e,t,s,a){e&65536?this.reduce(e):this.shift(e,t,s,a)}useNode(e,t){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=e)&&(this.p.reused.push(e),s++);let a=this.pos;this.reducePos=this.pos=a+e.length,this.pushState(t,a),this.buffer.push(s,a,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let s=e.buffer.slice(t),a=e.bufferBase+t;for(;e&&a==e.bufferBase;)e=e.parent;return new RV(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,a,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let s=e<=this.p.parser.maxNode;s&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,s?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new x4e(this);;){let s=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(s==0)return!1;if((s&65536)==0)return!0;t.reduce(s)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let a=[];for(let u=0,f;u<t.length;u+=2)(f=t[u+1])!=this.state&&this.p.parser.hasAction(f,e)&&a.push(t[u],f);if(this.stack.length<120)for(let u=0;a.length<4<<1&&u<t.length;u+=2){let f=t[u+1];a.some((h,g)=>g&1&&h==f)||a.push(t[u],f)}t=a}let s=[];for(let a=0;a<t.length&&s.length<4;a+=2){let u=t[a+1];if(u==this.state)continue;let f=this.split();f.pushState(u,this.pos),f.storeNode(0,f.pos,f.pos,4,!0),f.shiftContext(t[a],this.pos),f.score-=200,s.push(f)}return s}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let s=t>>19,a=t&65535,u=this.stack.length-s*3;if(u<0||e.getGoto(this.stack[u],a,!1)<0){let f=this.findForcedReduction();if(f==null)return!1;t=f}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],s=(a,u)=>{if(!t.includes(a))return t.push(a),e.allActions(a,f=>{if(!(f&393216))if(f&65536){let h=(f>>19)-u;if(h>1){let g=f&65535,v=this.stack.length-h*3;if(v>=0&&e.getGoto(this.stack[v],g,!1)>=0)return h<<19|65536|g}}else{let h=s(f,u+1);if(h!=null)return h}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new dfe(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class dfe{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class x4e{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,s=e>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let a=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=a}}class NV{constructor(e,t,s){this.stack=e,this.pos=t,this.index=s,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new NV(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new NV(this.stack,this.pos,this.index)}}function bz(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let s=0,a=0;s<r.length;){let u=0;for(;;){let f=r.charCodeAt(s++),h=!1;if(f==126){u=65535;break}f>=92&&f--,f>=34&&f--;let g=f-32;if(g>=46&&(g-=46,h=!0),u+=g,h)break;u*=46}t?t[a++]=u:t=new e(u)}return t}class Zz{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const hfe=new Zz;class T4e{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=hfe,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let s=this.range,a=this.rangeIndex,u=this.pos+e;for(;u<s.from;){if(!a)return null;let f=this.ranges[--a];u-=s.from-f.to,s=f}for(;t<0?u>s.to:u>=s.to;){if(a==this.ranges.length-1)return null;let f=this.ranges[++a];u+=f.from-s.to,s=f}return u}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,s,a;if(t>=0&&t<this.chunk.length)s=this.pos+e,a=this.chunk.charCodeAt(t);else{let u=this.resolveOffset(e,1);if(u==null)return-1;if(s=u,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)a=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let f=this.rangeIndex,h=this.range;for(;h.to<=s;)h=this.ranges[++f];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>h.to&&(this.chunk2=this.chunk2.slice(0,h.to-s)),a=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),a}acceptToken(e,t=0){let s=t?this.resolveOffset(t,-1):this.pos;if(s==null||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=s}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=hfe,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let s="";for(let a of this.ranges){if(a.from>=t)break;a.to>e&&(s+=this.input.read(Math.max(a.from,e),Math.min(a.to,t)))}return s}}class nO{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:s}=t.p;D4e(this.data,e,t,this.id,s.data,s.tokenPrecTable)}}nO.prototype.contextual=nO.prototype.fallback=nO.prototype.extend=!1;nO.prototype.fallback=nO.prototype.extend=!1;function D4e(r,e,t,s,a,u){let f=0,h=1<<s,{dialect:g}=t.p.parser;e:for(;(h&r[f])!=0;){let v=r[f+1];for(let N=f+3;N<v;N+=2)if((r[N+1]&h)>0){let L=r[N];if(g.allows(L)&&(e.token.value==-1||e.token.value==L||O4e(L,e.token.value,a,u))){e.acceptToken(L);break}}let _=e.next,A=0,O=r[f+2];if(e.next<0&&O>A&&r[v+O*3-3]==65535&&r[v+O*3-3]==65535){f=r[v+O*3-1];continue e}for(;A<O;){let N=A+O>>1,L=v+N+(N<<1),j=r[L],z=r[L+1]||65536;if(_<j)O=N;else if(_>=z)A=N+1;else{f=r[L+2],e.advance();continue e}}break}}function mfe(r,e,t){for(let s=e,a;(a=r[s])!=65535;s++)if(a==t)return s-e;return-1}function O4e(r,e,t,s){let a=mfe(t,s,e);return a<0||mfe(t,s,r)<a}const E1=typeof process<"u"&&process.env&&/\bparse\b/.test({}.LOG);let Kte=null;function gfe(r,e,t){let s=r.cursor(Wd.IncludeAnonymous);for(s.moveTo(e);;)if(!(t<0?s.childBefore(e):s.childAfter(e)))for(;;){if((t<0?s.to<e:s.from>e)&&!s.type.isError)return t<0?Math.max(0,Math.min(s.to-1,e-25)):Math.min(r.length,Math.max(s.from+1,e+25));if(t<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return t<0?0:r.length}}class M4e{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?gfe(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?gfe(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let s=this.trees[t],a=this.index[t];if(a==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let u=s.children[a],f=this.start[t]+s.positions[a];if(f>e)return this.nextStart=f,null;if(u instanceof If){if(f==e){if(f<this.safeFrom)return null;let h=f+u.length;if(h<=this.safeTo){let g=u.prop(ca.lookAhead);if(!g||h+g<this.fragment.to)return u}}this.index[t]++,f+u.length>=Math.max(this.safeFrom,e)&&(this.trees.push(u),this.start.push(f),this.index.push(0))}else this.index[t]++,this.nextStart=f+u.length}}}class R4e{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(s=>new Zz)}getActions(e){let t=0,s=null,{parser:a}=e.p,{tokenizers:u}=a,f=a.stateSlot(e.state,3),h=e.curContext?e.curContext.hash:0,g=0;for(let v=0;v<u.length;v++){if((1<<v&f)==0)continue;let _=u[v],A=this.tokens[v];if(!(s&&!_.fallback)&&((_.contextual||A.start!=e.pos||A.mask!=f||A.context!=h)&&(this.updateCachedToken(A,_,e),A.mask=f,A.context=h),A.lookAhead>A.end+25&&(g=Math.max(A.lookAhead,g)),A.value!=0)){let O=t;if(A.extended>-1&&(t=this.addActions(e,A.extended,A.end,t)),t=this.addActions(e,A.value,A.end,t),!_.extend&&(s=A,t>O))break}}for(;this.actions.length>t;)this.actions.pop();return g&&e.setLookAhead(g),!s&&e.pos==this.stream.end&&(s=new Zz,s.value=e.p.parser.eofTerm,s.start=s.end=e.pos,t=this.addActions(e,s.value,s.end,t)),this.mainToken=s,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Zz,{pos:s,p:a}=e;return t.start=s,t.end=Math.min(s+1,a.stream.end),t.value=s==a.stream.end?a.parser.eofTerm:0,t}updateCachedToken(e,t,s){let a=this.stream.clipPos(s.pos);if(t.token(this.stream.reset(a,e),s),e.value>-1){let{parser:u}=s.p;for(let f=0;f<u.specialized.length;f++)if(u.specialized[f]==e.value){let h=u.specializers[f](this.stream.read(e.start,e.end),s);if(h>=0&&s.p.parser.dialect.allows(h>>1)){(h&1)==0?e.value=h>>1:e.extended=h>>1;break}}}else e.value=0,e.end=this.stream.clipPos(a+1)}putAction(e,t,s,a){for(let u=0;u<a;u+=3)if(this.actions[u]==e)return a;return this.actions[a++]=e,this.actions[a++]=t,this.actions[a++]=s,a}addActions(e,t,s,a){let{state:u}=e,{parser:f}=e.p,{data:h}=f;for(let g=0;g<2;g++)for(let v=f.stateSlot(u,g?2:1);;v+=3){if(h[v]==65535)if(h[v+1]==1)v=k_(h,v+2);else{a==0&&h[v+1]==2&&(a=this.putAction(k_(h,v+2),t,s,a));break}h[v]==t&&(a=this.putAction(k_(h,v+1),t,s,a))}return a}}class N4e{constructor(e,t,s,a){this.parser=e,this.input=t,this.ranges=a,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new T4e(t,a),this.tokens=new R4e(e,this.stream),this.topTerm=e.top[1];let{from:u}=a[0];this.stacks=[RV.start(this,e.top[0],u)],this.fragments=s.length&&this.stream.end-u>e.bufferLength*4?new M4e(s,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,s=this.stacks=[],a,u;if(this.bigReductionCount>300&&e.length==1){let[f]=e;for(;f.forceReduce()&&f.stack.length&&f.stack[f.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let f=0;f<e.length;f++){let h=e[f];for(;;){if(this.tokens.mainToken=null,h.pos>t)s.push(h);else{if(this.advanceStack(h,s,e))continue;{a||(a=[],u=[]),a.push(h);let g=this.tokens.getMainToken(h);u.push(g.value,g.end)}}break}}if(!s.length){let f=a&&I4e(a);if(f)return E1&&console.log("Finish with "+this.stackID(f)),this.stackToTree(f);if(this.parser.strict)throw E1&&a&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&a){let f=this.stoppedAt!=null&&a[0].pos>this.stoppedAt?a[0]:this.runRecovery(a,u,s);if(f)return E1&&console.log("Force-finish "+this.stackID(f)),this.stackToTree(f.forceAll())}if(this.recovering){let f=this.recovering==1?1:this.recovering*3;if(s.length>f)for(s.sort((h,g)=>g.score-h.score);s.length>f;)s.pop();s.some(h=>h.reducePos>t)&&this.recovering--}else if(s.length>1){e:for(let f=0;f<s.length-1;f++){let h=s[f];for(let g=f+1;g<s.length;g++){let v=s[g];if(h.sameState(v)||h.buffer.length>500&&v.buffer.length>500)if((h.score-v.score||h.buffer.length-v.buffer.length)>0)s.splice(g--,1);else{s.splice(f--,1);continue e}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let f=1;f<s.length;f++)s[f].pos<this.minStackPos&&(this.minStackPos=s[f].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,s){let a=e.pos,{parser:u}=this,f=E1?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&a>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let v=e.curContext&&e.curContext.tracker.strict,_=v?e.curContext.hash:0;for(let A=this.fragments.nodeAt(a);A;){let O=this.parser.nodeSet.types[A.type.id]==A.type?u.getGoto(e.state,A.type.id):-1;if(O>-1&&A.length&&(!v||(A.prop(ca.contextHash)||0)==_))return e.useNode(A,O),E1&&console.log(f+this.stackID(e)+` (via reuse of ${u.getName(A.type.id)})`),!0;if(!(A instanceof If)||A.children.length==0||A.positions[0]>0)break;let N=A.children[0];if(N instanceof If&&A.positions[0]==0)A=N;else break}}let h=u.stateSlot(e.state,4);if(h>0)return e.reduce(h),E1&&console.log(f+this.stackID(e)+` (via always-reduce ${u.getName(h&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let g=this.tokens.getActions(e);for(let v=0;v<g.length;){let _=g[v++],A=g[v++],O=g[v++],N=v==g.length||!s,L=N?e:e.split(),j=this.tokens.mainToken;if(L.apply(_,A,j?j.start:L.pos,O),E1&&console.log(f+this.stackID(L)+` (via ${(_&65536)==0?"shift":`reduce of ${u.getName(_&65535)}`} for ${u.getName(A)} @ ${a}${L==e?"":", split"})`),N)return!0;L.pos>a?t.push(L):s.push(L)}return!1}advanceFully(e,t){let s=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>s)return pfe(e,t),!0}}runRecovery(e,t,s){let a=null,u=!1;for(let f=0;f<e.length;f++){let h=e[f],g=t[f<<1],v=t[(f<<1)+1],_=E1?this.stackID(h)+" -> ":"";if(h.deadEnd&&(u||(u=!0,h.restart(),E1&&console.log(_+this.stackID(h)+" (restarted)"),this.advanceFully(h,s))))continue;let A=h.split(),O=_;for(let N=0;A.forceReduce()&&N<10&&(E1&&console.log(O+this.stackID(A)+" (via force-reduce)"),!this.advanceFully(A,s));N++)E1&&(O=this.stackID(A)+" -> ");for(let N of h.recoverByInsert(g))E1&&console.log(_+this.stackID(N)+" (via recover-insert)"),this.advanceFully(N,s);this.stream.end>h.pos?(v==h.pos&&(v++,g=0),h.recoverByDelete(g,v),E1&&console.log(_+this.stackID(h)+` (via recover-delete ${this.parser.getName(g)})`),pfe(h,s)):(!a||a.score<h.score)&&(a=h)}return a}stackToTree(e){return e.close(),If.build({buffer:NV.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Kte||(Kte=new WeakMap)).get(e);return t||Kte.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function pfe(r,e){for(let t=0;t<e.length;t++){let s=e[t];if(s.pos==r.pos&&s.sameState(r)){e[t].score<r.score&&(e[t]=r);return}}e.push(r)}class P4e{constructor(e,t,s){this.source=e,this.flags=t,this.disabled=s}allows(e){return!this.disabled||this.disabled[e]==0}}class PV extends Zge{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (${14})`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let h=0;h<e.repeatNodeCount;h++)t.push("");let s=Object.keys(e.topRules).map(h=>e.topRules[h][1]),a=[];for(let h=0;h<t.length;h++)a.push([]);function u(h,g,v){a[h].push([g,g.deserialize(String(v))])}if(e.nodeProps)for(let h of e.nodeProps){let g=h[0];typeof g=="string"&&(g=ca[g]);for(let v=1;v<h.length;){let _=h[v++];if(_>=0)u(_,g,h[v++]);else{let A=h[v+-_];for(let O=-_;O>0;O--)u(h[v++],g,A);v++}}}this.nodeSet=new joe(t.map((h,g)=>Np.define({name:g>=this.minRepeatTerm?void 0:h,id:g,props:a[g],top:s.indexOf(g)>-1,error:g==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(g)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Vge;let f=bz(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let h=0;h<this.specializerSpecs.length;h++)this.specialized[h]=this.specializerSpecs[h].term;this.specializers=this.specializerSpecs.map(bfe),this.states=bz(e.states,Uint32Array),this.data=bz(e.stateData),this.goto=bz(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(h=>typeof h=="number"?new nO(f,h):h),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,s){let a=new N4e(this,e,t,s);for(let u of this.wrappers)a=u(a,e,t,s);return a}getGoto(e,t,s=!1){let a=this.goto;if(t>=a[0])return-1;for(let u=a[t+1];;){let f=a[u++],h=f&1,g=a[u++];if(h&&s)return g;for(let v=u+(f>>1);u<v;u++)if(a[u]==e)return g;if(h)return-1}}hasAction(e,t){let s=this.data;for(let a=0;a<2;a++)for(let u=this.stateSlot(e,a?2:1),f;;u+=3){if((f=s[u])==65535)if(s[u+1]==1)f=s[u=k_(s,u+2)];else{if(s[u+1]==2)return k_(s,u+2);break}if(f==t||f==0)return k_(s,u+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,s=>s==t?!0:null)}allActions(e,t){let s=this.stateSlot(e,4),a=s?t(s):void 0;for(let u=this.stateSlot(e,1);a==null;u+=3){if(this.data[u]==65535)if(this.data[u+1]==1)u=k_(this.data,u+2);else break;a=t(k_(this.data,u+1))}return a}nextStates(e){let t=[];for(let s=this.stateSlot(e,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k_(this.data,s+2);else break;if((this.data[s+2]&1)==0){let a=this.data[s+1];t.some((u,f)=>f&1&&u==a)||t.push(this.data[s],a)}}return t}configure(e){let t=Object.assign(Object.create(PV.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let s=this.topRules[e.top];if(!s)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=s}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(s=>{let a=e.tokenizers.find(u=>u.from==s);return a?a.to:s})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((s,a)=>{let u=e.specializers.find(h=>h.from==s.external);if(!u)return s;let f=Object.assign(Object.assign({},s),{external:u.to});return t.specializers[a]=bfe(f),f})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),s=t.map(()=>!1);if(e)for(let u of e.split(" ")){let f=t.indexOf(u);f>=0&&(s[f]=!0)}let a=null;for(let u=0;u<t.length;u++)if(!s[u])for(let f=this.dialects[t[u]],h;(h=this.data[f++])!=65535;)(a||(a=new Uint8Array(this.maxTerm+1)))[h]=1;return new P4e(e,s,a)}static deserialize(e){return new PV(e)}}function k_(r,e){return r[e]|r[e+1]<<16}function I4e(r){let e=null;for(let t of r){let s=t.p.stoppedAt;(t.pos==t.p.stream.end||s!=null&&t.pos>s)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function bfe(r){if(r.external){let e=r.extend?1:0;return(t,s)=>r.external(t,s)<<1|e}return r.get}const B4e=qge({String:Uo.string,Number:Uo.number,"True False":Uo.bool,PropertyName:Uo.propertyName,Null:Uo.null,",":Uo.separator,"[ ]":Uo.squareBracket,"{ }":Uo.brace}),L4e=PV.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[B4e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),F4e=()=>r=>{try{JSON.parse(r.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=H4e(e,r.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function H4e(r,e){let t;return(t=r.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=r.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const $4e=yV.define({name:"json",parser:L4e.configure({props:[Xge.add({Object:Lue({except:/^\s*\}/}),Array:Lue({except:/^\s*\]/})}),Qge.add({"Object Array":dxe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function vfe(){return new exe($4e)}function z4e(r){let e,t;return{c(){e=ae("div"),U(e,"class",t="is-editable-"+r[0])},m(s,a){Ie(s,e,a),r[3](e)},p(s,[a]){a&1&&t!==(t="is-editable-"+s[0])&&U(e,"class",t)},i:_n,o:_n,d(s){s&&Pe(e),r[3](null)}}}function V4e(r,e,t){let s,a,{value:u}=e,{editable:f=!0}=e;H0(()=>{let g=new rO,v=new rO,_=Ea.create({doc:JSON.stringify(u,null,4),extensions:[ffe,YV.of([J3e]),g.of(vfe()),vfe(),v.of(Ea.tabSize.of(4)),A4e(),ffe,xs.editable.of(f),xs.updateListener.of(function(A){A.docChanged&&t(2,u=A.state.doc.toString())}),b4e(F4e())]});a=new xs({state:_,parent:s})}),The(()=>{a&&a.destroy()});function h(g){ts[g?"unshift":"push"](()=>{s=g,t(1,s)})}return r.$$set=g=>{"value"in g&&t(2,u=g.value),"editable"in g&&t(0,f=g.editable)},[f,s,u,h]}class U4e extends xo{constructor(e){super(),Ao(this,e,V4e,z4e,Eo,{value:2,editable:0})}}function yfe(r){let e,t;return{c(){e=ae("div"),t=Kt(r[3]),U(e,"class","invalid-feedback d-block")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&8&&jn(t,s[3])},d(s){s&&Pe(e)}}}function W4e(r){let e,t,s,a,u;function f(v){r[5](v)}let h={editable:!r[1].readonly||r[2]};r[0]!==void 0&&(h.value=r[0]),t=new U4e({props:h}),ts.push(()=>gr(t,"value",f));let g=r[3]&&yfe(r);return{c(){e=ae("div"),sn(t.$$.fragment),a=Ze(),g&&g.c(),U(e,"class","mb-3")},m(v,_){Ie(v,e,_),nn(t,e,null),Y(e,a),g&&g.m(e,null),u=!0},p(v,[_]){const A={};_&6&&(A.editable=!v[1].readonly||v[2]),!s&&_&1&&(s=!0,A.value=v[0],Cr(()=>s=!1)),t.$set(A),v[3]?g?g.p(v,_):(g=yfe(v),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(v){u||(Oe(t.$$.fragment,v),u=!0)},o(v){$e(t.$$.fragment,v),u=!1},d(v){v&&Pe(e),on(t),g&&g.d()}}}function j4e(r,e,t){let s,{value:a}=e,{field:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e;function g(v){a=v,t(0,a)}return r.$$set=v=>{"value"in v&&t(0,a=v.value),"field"in v&&t(1,u=v.field),"isCreateMode"in v&&t(2,f=v.isCreateMode),"validationErrors"in v&&t(4,h=v.validationErrors)},r.$$.update=()=>{r.$$.dirty&18&&t(3,s=Rg(h,u.name))},[a,u,f,s,h,g]}class Z4e extends xo{constructor(e){super(),Ao(this,e,j4e,W4e,Eo,{value:0,field:1,isCreateMode:2,validationErrors:4})}}function wfe(r){let e,t=r[0].help+"",s;return{c(){e=ae("small"),s=Kt(t),U(e,"class","text-primary opacity-50")},m(a,u){Ie(a,e,u),Y(e,s)},p(a,u){u&1&&t!==(t=a[0].help+"")&&jn(s,t)},d(a){a&&Pe(e)}}}function q4e(r){let e,t,s,a,u=r[0].label+"",f,h,g,v,_,A=r[0].name+"",O,N,L=r[0].help&&wfe(r);return{c(){e=ae("div"),t=ae("div"),s=ae("div"),a=ae("label"),f=Kt(u),h=Ze(),L&&L.c(),g=Ze(),v=ae("a"),_=ae("code"),O=Kt(A),U(a,"for",r[2]),U(a,"class","form-label"),U(_,"class","text-primary opacity-50"),U(v,"tabindex","-1"),U(v,"class","text-decoration-none"),U(v,"href",N=r[3].lucentUrl+"/schemas/"+r[1].name+"/fields/edit/"+r[0].name),U(t,"class","d-flex justify-content-between"),U(e,"class","mb-1")},m(j,z){Ie(j,e,z),Y(e,t),Y(t,s),Y(s,a),Y(a,f),Y(s,h),L&&L.m(s,null),Y(t,g),Y(t,v),Y(v,_),Y(_,O)},p(j,[z]){z&1&&u!==(u=j[0].label+"")&&jn(f,u),z&4&&U(a,"for",j[2]),j[0].help?L?L.p(j,z):(L=wfe(j),L.c(),L.m(s,null)):L&&(L.d(1),L=null),z&1&&A!==(A=j[0].name+"")&&jn(O,A),z&3&&N!==(N=j[3].lucentUrl+"/schemas/"+j[1].name+"/fields/edit/"+j[0].name)&&U(v,"href",N)},i:_n,o:_n,d(j){j&&Pe(e),L&&L.d()}}}function G4e(r,e,t){const s=hi("channel");let{field:a}=e,{schema:u}=e,{id:f}=e;return r.$$set=h=>{"field"in h&&t(0,a=h.field),"schema"in h&&t(1,u=h.schema),"id"in h&&t(2,f=h.id)},[a,u,f,s]}class K4e extends xo{constructor(e){super(),Ao(this,e,G4e,q4e,Eo,{field:0,schema:1,id:2})}}function _fe(r,e,t){const s=r.slice();return s[2]=e[t],s}function Cfe(r,e,t){const s=r.slice();return s[1]=e[t],s[17]=t,s}function Sfe(r,e,t){const s=r.slice();return s[1]=e[t],s}function kfe(r){let e,t;return{c(){e=ae("div"),t=Kt(r[5]),U(e,"class","invalid-feedback d-block mb-3")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&32&&jn(t,s[5])},d(s){s&&Pe(e)}}}function Efe(r){let e,t,s,a,u,f,h,g,v,_,A,O=r[3],N=[];for(let L=0;L<O.length;L+=1)N[L]=Afe(Sfe(r,O,L));return _=new hI({props:{isTable:!0,$$slots:{default:[Y4e]},$$scope:{ctx:r}}}),_.$on("update",r[10]),{c(){e=ae("div"),t=ae("table"),s=ae("thead"),a=ae("tr"),u=ae("th"),f=Ze();for(let L=0;L<N.length;L+=1)N[L].c();h=Ze(),g=ae("th"),v=Ze(),sn(_.$$.fragment),U(s,"class","table-light"),U(t,"class",""),U(e,"class","lx-table rounded")},m(L,j){Ie(L,e,j),Y(e,t),Y(t,s),Y(s,a),Y(a,u),Y(a,f);for(let z=0;z<N.length;z+=1)N[z]&&N[z].m(a,null);Y(a,h),Y(a,g),Y(t,v),nn(_,t,null),A=!0},p(L,j){if(j&8){O=L[3];let q;for(q=0;q<O.length;q+=1){const ee=Sfe(L,O,q);N[q]?N[q].p(ee,j):(N[q]=Afe(ee),N[q].c(),N[q].m(a,h))}for(;q<N.length;q+=1)N[q].d(1);N.length=O.length}const z={};j&1048601&&(z.$$scope={dirty:j,ctx:L}),_.$set(z)},i(L){A||(Oe(_.$$.fragment,L),A=!0)},o(L){$e(_.$$.fragment,L),A=!1},d(L){L&&Pe(e),Ba(N,L),on(_)}}}function Afe(r){let e,t=r[1].label+"",s,a,u;return{c(){e=ae("th"),s=Kt(t),U(e,"class",a="field-ui-"+r[1].ui),U(e,"scope","col"),U(e,"title",u=r[1].help),U(e,"data-bs-toggle","tooltip"),U(e,"data-bs-placement","top")},m(f,h){Ie(f,e,h),Y(e,s)},p(f,h){h&8&&t!==(t=f[1].label+"")&&jn(s,t),h&8&&a!==(a="field-ui-"+f[1].ui)&&U(e,"class",a),h&8&&u!==(u=f[1].help)&&U(e,"title",u)},d(f){f&&Pe(e)}}}function xfe(r){let e,t,s,a;return t=new Ghe({props:{record:r[2],graph:r[0],schema:r[8],field:r[1]}}),{c(){e=ae("td"),sn(t.$$.fragment),U(e,"class",s="field-ui-"+r[1].ui)},m(u,f){Ie(u,e,f),nn(t,e,null),a=!0},p(u,f){const h={};f&16&&(h.record=u[2]),f&1&&(h.graph=u[0]),f&8&&(h.field=u[1]),t.$set(h),(!a||f&8&&s!==(s="field-ui-"+u[1].ui))&&U(e,"class",s)},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function Tfe(r,e){let t,s,a,u,f,h=dd(e[6].schemas,e[2])+"",g,v,_,A,O,N,L,j,z,q,ee,F=e[3],oe=[];for(let X=0;X<F.length;X+=1)oe[X]=xfe(Cfe(e,F,X));const te=X=>$e(oe[X],1,1,()=>{oe[X]=null});L=new fl({props:{icon:"trash-can"}});function se(...X){return e[13](e[2],...X)}return{key:r,first:null,c(){t=ae("tr"),s=ae("td"),a=ae("div"),u=ae("div"),f=ae("a"),g=Kt(h),_=Ze();for(let X=0;X<oe.length;X+=1)oe[X].c();A=Ze(),O=ae("td"),N=ae("button"),sn(L.$$.fragment),j=Ze(),U(f,"class","me-2 text-decoration-none text-dark fs-6"),U(f,"href",v=e[6].lucentUrl+"/records/"+e[2].id),U(f,"target","_blank"),U(u,"class","d-flex align-items-center"),U(a,"class",""),U(s,"class",""),U(N,"class","trash-button text-dark btn btn-sm btn-link"),this.first=t},m(X,we){Ie(X,t,we),Y(t,s),Y(s,a),Y(a,u),Y(u,f),Y(f,g),Y(t,_);for(let ye=0;ye<oe.length;ye+=1)oe[ye]&&oe[ye].m(t,null);Y(t,A),Y(t,O),Y(O,N),nn(L,N,null),Y(t,j),z=!0,q||(ee=En(N,"click",se),q=!0)},p(X,we){if(e=X,(!z||we&16)&&h!==(h=dd(e[6].schemas,e[2])+"")&&jn(g,h),(!z||we&16&&v!==(v=e[6].lucentUrl+"/records/"+e[2].id))&&U(f,"href",v),we&281){F=e[3];let ye;for(ye=0;ye<F.length;ye+=1){const Te=Cfe(e,F,ye);oe[ye]?(oe[ye].p(Te,we),Oe(oe[ye],1)):(oe[ye]=xfe(Te),oe[ye].c(),Oe(oe[ye],1),oe[ye].m(t,A))}for(So(),ye=F.length;ye<oe.length;ye+=1)te(ye);ko()}},i(X){if(!z){for(let we=0;we<F.length;we+=1)Oe(oe[we]);Oe(L.$$.fragment,X),z=!0}},o(X){oe=oe.filter(Boolean);for(let we=0;we<oe.length;we+=1)$e(oe[we]);$e(L.$$.fragment,X),z=!1},d(X){X&&Pe(t),Ba(oe,X),on(L),q=!1,ee()}}}function Y4e(r){let e=[],t=new Map,s,a,u=r[4];const f=h=>h[2].id;for(let h=0;h<u.length;h+=1){let g=_fe(r,u,h),v=f(g);t.set(v,e[h]=Tfe(v,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),a=!0},p(h,g){g&857&&(u=h[4],So(),e=$h(e,g,f,1,h,u,t,s.parentNode,gv,Tfe,s,_fe),ko())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Oe(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)$e(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s)}}}function X4e(r){let e,t,s,a,u,f,h=r[5]&&kfe(r);s=new uI({props:{field:r[1],buttonClass:"mt-2",recordId:null,schemas:r[7]}}),s.$on("insert",r[11]),s.$on("save",r[11]);let g=r[4].length>0&&Efe(r);return{c(){h&&h.c(),e=Ze(),t=ae("div"),sn(s.$$.fragment),a=Ze(),g&&g.c(),u=Bs(),U(t,"class","inline-card-wrapper")},m(v,_){h&&h.m(v,_),Ie(v,e,_),Ie(v,t,_),nn(s,t,null),Ie(v,a,_),g&&g.m(v,_),Ie(v,u,_),f=!0},p(v,[_]){v[5]?h?h.p(v,_):(h=kfe(v),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null);const A={};_&2&&(A.field=v[1]),s.$set(A),v[4].length>0?g?(g.p(v,_),_&16&&Oe(g,1)):(g=Efe(v),g.c(),Oe(g,1),g.m(u.parentNode,u)):g&&(So(),$e(g,1,1,()=>{g=null}),ko())},i(v){f||(Oe(s.$$.fragment,v),Oe(g),f=!0)},o(v){$e(s.$$.fragment,v),$e(g),f=!1},d(v){h&&h.d(v),v&&Pe(e),v&&Pe(t),on(s),v&&Pe(a),g&&g.d(v),v&&Pe(u)}}}function J4e(r,e,t){let s,a,u;const f=hi("channel");let{field:h}=e,{record:g}=e,{graph:v}=e,{validationErrors:_}=e,A=f.schemas.filter(q=>h.collections.includes(q.name)),O=f.schemas.filter(q=>h.collections.includes(q.name))[0];function N(q,ee){q.preventDefault(),t(0,v.edges=v.edges.filter(F=>!(F.target===ee&&F.field===h.name)),v)}function L(q){t(0,v.edges=yO(q.detail.source,q.detail.target,v.edges,h.name),v)}function j(q){q.preventDefault(),t(0,v=lI(v,g,q.detail.records,h.name,q.detail.action)),console.log(v)}const z=(q,ee)=>N(ee,q.id);return r.$$set=q=>{"field"in q&&t(1,h=q.field),"record"in q&&t(2,g=q.record),"graph"in q&&t(0,v=q.graph),"validationErrors"in q&&t(12,_=q.validationErrors)},r.$$.update=()=>{var q;r.$$.dirty&4098&&t(5,s=Rg(_,h.name)),r.$$.dirty&7&&t(4,a=(q=v.edges.filter(ee=>ee.field===h.name).map(ee=>v.records.find(F=>F.id==ee.target&&g.id==ee.source)).filter(ee=>!!(ee!=null&&ee.id)))!=null?q:[])},t(3,u=[]),[v,h,g,u,a,s,f,A,O,N,L,j,_,z]}class Q4e extends xo{constructor(e){super(),Ao(this,e,J4e,X4e,Eo,{field:1,record:2,graph:0,validationErrors:12})}}function Dfe(r,e,t){const s=r.slice();return s[2]=e[t],s}function Ofe(r,e,t){const s=r.slice();return s[22]=e[t],s}function Mfe(r){let e,t;return{c(){e=ae("div"),t=Kt(r[6]),U(e,"class","invalid-feedback d-block mb-3")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&64&&jn(t,s[6])},d(s){s&&Pe(e)}}}function Rfe(r){let e=[],t=new Map,s,a=r[4];const u=h=>h[22].id;for(let h=0;h<a.length;h+=1){let g=Ofe(r,a,h),v=u(g);t.set(v,e[h]=Pfe(v,g))}let f=null;return a.length||(f=Nfe()),{c(){for(let h=0;h<e.length;h+=1)e[h].c();s=Bs(),f&&f.c()},m(h,g){for(let v=0;v<e.length;v+=1)e[v]&&e[v].m(h,g);Ie(h,s,g),f&&f.m(h,g)},p(h,g){g&1168&&(a=h[4],e=$h(e,g,u,1,h,a,t,s.parentNode,oI,Pfe,s,Ofe),a.length?f&&(f.d(1),f=null):f||(f=Nfe(),f.c(),f.m(s.parentNode,s)))},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Pe(s),f&&f.d(h)}}}function Nfe(r){let e;return{c(){e=Kt("Start typing...")},m(t,s){Ie(t,e,s)},d(t){t&&Pe(e)}}}function Pfe(r,e){let t,s,a=dd(e[7].schemas,e[22])+"",u,f,h,g;function v(...A){return e[15](e[22],...A)}function _(...A){return e[16](e[22],...A)}return{key:r,first:null,c(){t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),U(s,"class","dropdown-item"),this.first=t},m(A,O){Ie(A,t,O),Y(t,s),Y(s,u),Y(t,f),h||(g=[En(t,"click",v),En(t,"keypress",_)],h=!0)},p(A,O){e=A,O&16&&a!==(a=dd(e[7].schemas,e[22])+"")&&jn(u,a)},d(A){A&&Pe(t),h=!1,Bi(g)}}}function Ife(r){let e,t,s,a,u,f,h;return{c(){e=ae("div"),t=ae("span"),s=Kt('Add "'),a=Kt(r[3]),u=Kt('"'),U(t,"class","dropdown-item")},m(g,v){Ie(g,e,v),Y(e,t),Y(t,s),Y(t,a),Y(t,u),f||(h=[En(e,"click",r[17]),En(e,"keypress",r[18])],f=!0)},p(g,v){v&8&&jn(a,g[3])},d(g){g&&Pe(e),f=!1,Bi(h)}}}function Bfe(r){let e,t=[],s=new Map,a=r[5];const u=f=>f[2].id;for(let f=0;f<a.length;f+=1){let h=Dfe(r,a,f),g=u(h);s.set(g,t[f]=Lfe(g,h))}return{c(){e=ae("div");for(let f=0;f<t.length;f+=1)t[f].c();U(e,"class","d-flex")},m(f,h){Ie(f,e,h);for(let g=0;g<t.length;g+=1)t[g]&&t[g].m(e,null)},p(f,h){h&416&&(a=f[5],t=$h(t,h,u,1,f,a,s,e,oI,Lfe,null,Dfe))},d(f){f&&Pe(e);for(let h=0;h<t.length;h+=1)t[h].d()}}}function Lfe(r,e){let t,s,a=dd(e[7].schemas,e[2])+"",u,f,h,g,v,_;function A(...O){return e[19](e[2],...O)}return{key:r,first:null,c(){t=ae("span"),s=ae("div"),u=Kt(a),f=Ze(),h=ae("button"),g=Ze(),U(h,"type","button"),U(h,"class","btn-close btn-sm ms-1"),ss(h,"font-size","10px"),U(h,"aria-label","Close"),U(s,"class","d-flex align-items-center "),U(t,"class","badge rounded-pill bg-light text-dark fs-6 mt-3"),this.first=t},m(O,N){Ie(O,t,N),Y(t,s),Y(s,u),Y(s,f),Y(s,h),Y(t,g),v||(_=En(h,"click",Hu(A)),v=!0)},p(O,N){e=O,N&32&&a!==(a=dd(e[7].schemas,e[2])+"")&&jn(u,a)},d(O){O&&Pe(t),v=!1,_()}}}function eDe(r){let e,t,s,a,u,f,h,g,v,_,A,O=r[6]&&Mfe(r),N=r[4]&&Rfe(r),L=r[3]&&Ife(r),j=r[5].length>0&&Bfe(r);return{c(){O&&O.c(),e=Ze(),t=ae("input"),u=Ze(),f=ae("div"),N&&N.c(),h=Ze(),L&&L.c(),g=Ze(),j&&j.c(),v=Bs(),U(t,"type","search"),U(t,"id",r[1]),U(t,"class","form-control dropdown-toggle"),U(t,"placeholder",s="Search for "+r[0].label),U(t,"data-bs-toggle","dropdown"),U(t,"autocomplete","off"),t.readOnly=a=r[0].readonly&&!isCreateMode,vs(t,"is-invalid",r[6]),U(f,"class","dropdown-menu w-100")},m(z,q){O&&O.m(z,q),Ie(z,e,q),Ie(z,t,q),_r(t,r[3]),Ie(z,u,q),Ie(z,f,q),N&&N.m(f,null),Y(f,h),L&&L.m(f,null),Ie(z,g,q),j&&j.m(z,q),Ie(z,v,q),_||(A=[En(t,"keyup",r[11]),En(t,"input",r[14])],_=!0)},p(z,[q]){z[6]?O?O.p(z,q):(O=Mfe(z),O.c(),O.m(e.parentNode,e)):O&&(O.d(1),O=null),q&2&&U(t,"id",z[1]),q&1&&s!==(s="Search for "+z[0].label)&&U(t,"placeholder",s),q&1&&a!==(a=z[0].readonly&&!isCreateMode)&&(t.readOnly=a),q&8&&t.value!==z[3]&&_r(t,z[3]),q&64&&vs(t,"is-invalid",z[6]),z[4]?N?N.p(z,q):(N=Rfe(z),N.c(),N.m(f,h)):N&&(N.d(1),N=null),z[3]?L?L.p(z,q):(L=Ife(z),L.c(),L.m(f,null)):L&&(L.d(1),L=null),z[5].length>0?j?j.p(z,q):(j=Bfe(z),j.c(),j.m(v.parentNode,v)):j&&(j.d(1),j=null)},i:_n,o:_n,d(z){O&&O.d(z),z&&Pe(e),z&&Pe(t),z&&Pe(u),z&&Pe(f),N&&N.d(),L&&L.d(),z&&Pe(g),j&&j.d(z),z&&Pe(v),_=!1,Bi(A)}}}function tDe(r,e,t){let s,a,u;const f=hi("channel");let{field:h}=e,{id:g}=e,{record:v}=e,{graph:_}=e,{validationErrors:A}=e,O="";function N(X,we){X.preventDefault(),t(12,_.edges=_.edges.filter(ye=>!(ye.target===we&&ye.field===h.name)),_)}function L(X,we){X.preventDefault(),axios.post(f.lucentUrl+"/records",{isCreateMode:!0,record:{schema:h.collections[0],status:"published",data:{[h.searchField]:we}}}).then(ye=>{t(4,u=[]),j(X,ye.data.records[0]),console.log(ye)}).catch(ye=>{t(4,u=[]),console.log(ye)})}function j(X,we){X.preventDefault(),t(12,_=lI(_,v,[we],h.name,X.detail.action))}const z=fd.exports.debounce(X=>{axios.get(f.lucentUrl+"/records/suggestions",{params:{schema:h.collections[0],field:h.searchField,value:O,ui:"text"}}).then(we=>{t(4,u=we.data)}).catch(we=>{t(4,u=[]),console.log(we)})},500);function q(){O=this.value,t(3,O)}const ee=(X,we)=>j(we,X),F=(X,we)=>j(we,X),oe=X=>L(X,O),te=X=>L(X,O),se=(X,we)=>N(we,X.id);return r.$$set=X=>{"field"in X&&t(0,h=X.field),"id"in X&&t(1,g=X.id),"record"in X&&t(2,v=X.record),"graph"in X&&t(12,_=X.graph),"validationErrors"in X&&t(13,A=X.validationErrors)},r.$$.update=()=>{var X;r.$$.dirty&8193&&t(6,s=Rg(A,h.name)),r.$$.dirty&4101&&t(5,a=(X=_.edges.filter(we=>we.field===h.name).map(we=>_.records.find(ye=>ye.id==we.target&&v.id==we.source)).filter(we=>!!(we!=null&&we.id)))!=null?X:[])},t(4,u=[]),[h,g,v,O,u,a,s,f,N,L,j,z,_,A,q,ee,F,oe,te,se]}class nDe extends xo{constructor(e){super(),Ao(this,e,tDe,eDe,Eo,{field:0,id:1,record:2,graph:12,validationErrors:13})}}function oDe(r){let e,t,s,a;function u(g){r[19](g)}var f=r[7];function h(g){let v={schema:g[3],field:g[2],validationErrors:g[5],isCreateMode:g[6],id:g[8]};return g[0][g[2].name]!==void 0&&(v.value=g[0][g[2].name]),{props:v}}return f&&(e=dk(f,h(r)),ts.push(()=>gr(e,"value",u))),{c(){e&&sn(e.$$.fragment),s=Bs()},m(g,v){e&&nn(e,g,v),Ie(g,s,v),a=!0},p(g,v){const _={};if(v&8&&(_.schema=g[3]),v&4&&(_.field=g[2]),v&32&&(_.validationErrors=g[5]),v&64&&(_.isCreateMode=g[6]),!t&&v&5&&(t=!0,_.value=g[0][g[2].name],Cr(()=>t=!1)),f!==(f=g[7])){if(e){So();const A=e;$e(A.$$.fragment,1,0,()=>{on(A,1)}),ko()}f?(e=dk(f,h(g)),ts.push(()=>gr(e,"value",u)),sn(e.$$.fragment),Oe(e.$$.fragment,1),nn(e,s.parentNode,s)):e=null}else f&&e.$set(_)},i(g){a||(e&&Oe(e.$$.fragment,g),a=!0)},o(g){e&&$e(e.$$.fragment,g),a=!1},d(g){g&&Pe(s),e&&on(e,g)}}}function sDe(r){let e,t,s;function a(f){r[18](f)}let u={field:r[2],validationErrors:r[5],isCreateMode:r[6],id:r[8]};return r[0][r[2].name]!==void 0&&(u.value=r[0][r[2].name]),e=new pme({props:u}),ts.push(()=>gr(e,"value",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function rDe(r){let e,t,s;function a(f){r[17](f)}let u={field:r[2],id:r[8],validationErrors:r[5],isCreateMode:r[6]};return r[0][r[2].name]!==void 0&&(u.value=r[0][r[2].name]),e=new Whe({props:u}),ts.push(()=>gr(e,"value",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function iDe(r){let e,t,s;function a(f){r[16](f)}let u={field:r[2],id:r[8],validationErrors:r[5],isCreateMode:r[6]};return r[0][r[2].name]!==void 0&&(u.value=r[0][r[2].name]),e=new Uhe({props:u}),ts.push(()=>gr(e,"value",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function aDe(r){let e,t,s,a;function u(g){r[14](g)}function f(g){r[15](g)}let h={record:r[4],id:r[8],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(h.graph=r[1]),r[0][r[2].name]!==void 0&&(h.value=r[0][r[2].name]),e=new qCe({props:h}),ts.push(()=>gr(e,"graph",u)),ts.push(()=>gr(e,"value",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&16&&(_.record=g[4]),v&4&&(_.field=g[2]),v&32&&(_.validationErrors=g[5]),!t&&v&2&&(t=!0,_.graph=g[1],Cr(()=>t=!1)),!s&&v&5&&(s=!0,_.value=g[0][g[2].name],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function lDe(r){let e,t,s;function a(f){r[13](f)}let u={record:r[4],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(u.graph=r[1]),e=new PSe({props:u}),ts.push(()=>gr(e,"graph",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function cDe(r){let e,t,s;function a(f){r[12](f)}let u={id:r[8],record:r[4],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(u.graph=r[1]),e=new G_e({props:u}),ts.push(()=>gr(e,"graph",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function uDe(r){let e,t,s;function a(f){r[11](f)}let u={id:r[8],record:r[4],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(u.graph=r[1]),e=new nDe({props:u}),ts.push(()=>gr(e,"graph",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function fDe(r){let e,t,s;function a(f){r[10](f)}let u={id:r[8],record:r[4],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(u.graph=r[1]),e=new Q4e({props:u}),ts.push(()=>gr(e,"graph",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function dDe(r){let e,t,s;function a(f){r[9](f)}let u={record:r[4],field:r[2],validationErrors:r[5]};return r[1]!==void 0&&(u.graph=r[1]),e=new cCe({props:u}),ts.push(()=>gr(e,"graph",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function hDe(r){let e,t,s,a,u,f;t=new K4e({props:{schema:r[3],field:r[2],id:r[8]}});const h=[dDe,fDe,uDe,cDe,lDe,aDe,iDe,rDe,sDe,oDe],g=[];function v(_,A){return _[2].info.name==="reference"&&_[2].layout==="inline"?0:_[2].info.name==="reference"&&_[2].layout==="table"?1:_[2].info.name==="reference"&&_[2].layout==="tags"?2:_[2].info.name==="reference"?3:_[2].info.name==="file"?4:_[2].info.name==="block"?5:_[2].info.name==="text"?6:_[2].info.name==="slug"?7:_[2].info.name==="textarea"?8:9}return a=v(r),u=g[a]=h[a](r),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),u.c(),U(e,"class","card editor-field")},m(_,A){Ie(_,e,A),nn(t,e,null),Y(e,s),g[a].m(e,null),f=!0},p(_,[A]){const O={};A&8&&(O.schema=_[3]),A&4&&(O.field=_[2]),t.$set(O);let N=a;a=v(_),a===N?g[a].p(_,A):(So(),$e(g[N],1,1,()=>{g[N]=null}),ko(),u=g[a],u?u.p(_,A):(u=g[a]=h[a](_),u.c()),Oe(u,1),u.m(e,null))},i(_){f||(Oe(t.$$.fragment,_),Oe(u),f=!0)},o(_){$e(t.$$.fragment,_),$e(u),f=!1},d(_){_&&Pe(e),on(t),g[a].d()}}}function mDe(r,e,t){const s={text:Uhe,slug:Whe,textarea:pme,rich:WSe,color:YCe,checkbox:QCe,number:sSe,url:aSe,date:vSe,datetime:zSe,uuid:TSe,json:Z4e};let{field:a}=e,{data:u}=e,{schema:f}=e,{record:h}=e,{graph:g}=e,{validationErrors:v}=e,{isCreateMode:_}=e,A=s[a.info.name];const O=`field-${a.name}-${h.id}`;function N(we){g=we,t(1,g)}function L(we){g=we,t(1,g)}function j(we){g=we,t(1,g)}function z(we){g=we,t(1,g)}function q(we){g=we,t(1,g)}function ee(we){g=we,t(1,g)}function F(we){r.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function oe(we){r.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function te(we){r.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function se(we){r.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function X(we){r.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}return r.$$set=we=>{"field"in we&&t(2,a=we.field),"data"in we&&t(0,u=we.data),"schema"in we&&t(3,f=we.schema),"record"in we&&t(4,h=we.record),"graph"in we&&t(1,g=we.graph),"validationErrors"in we&&t(5,v=we.validationErrors),"isCreateMode"in we&&t(6,_=we.isCreateMode)},[u,g,a,f,h,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X]}class y1e extends xo{constructor(e){super(),Ao(this,e,mDe,hDe,Eo,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function Ffe(r,e,t){const s=r.slice();return s[5]=e[t][0],s[6]=e[t][1],s}function Hfe(r,e,t){const s=r.slice();return s[9]=e[t],s}function $fe(r,e,t){const s=r.slice();return s[5]=e[t][0],s[6]=e[t][1],s}function zfe(r,e,t){const s=r.slice();return s[9]=e[t],s}function gDe(r){let e,t,s;return t=new aI({props:{graph:r[0],record:r[9]}}),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","ms-2 mb-2")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p(a,u){const f={};u&1&&(f.graph=a[0]),t.$set(f)},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function pDe(r){let e,t,s;return t=new P_({props:{record:r[9],size:"small"}}),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","ms-2 mb-2"),ss(e,"max-height","64px")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},p:_n,i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function Vfe(r){let e,t,s,a;const u=[pDe,gDe],f=[];function h(g,v){var _;return(_=g[9]._file)!=null&&_.path?0:1}return e=h(r),t=f[e]=u[e](r),{c(){t.c(),s=Bs()},m(g,v){f[e].m(g,v),Ie(g,s,v),a=!0},p(g,v){t.p(g,v)},i(g){a||(Oe(t),a=!0)},o(g){$e(t),a=!1},d(g){f[e].d(g),g&&Pe(s)}}}function Ufe(r){let e,t,s,a=r[6].schema.label+"",u,f,h,g,v,_=r[6].field.label+"",A,O,N,L;h=new fl({props:{icon:"angle-right",width:"12",height:"12"}});let j=r[6].nodes,z=[];for(let ee=0;ee<j.length;ee+=1)z[ee]=Vfe(zfe(r,j,ee));const q=ee=>$e(z[ee],1,1,()=>{z[ee]=null});return{c(){e=ae("div"),t=ae("div"),s=ae("span"),u=Kt(a),f=Ze(),sn(h.$$.fragment),g=Ze(),v=ae("span"),A=Kt(_),O=Ze(),N=ae("div");for(let ee=0;ee<z.length;ee+=1)z[ee].c();U(t,"class","text-center mb-3 d-flex justify-content-center align-items-center text-uppercase "),U(N,"class","d-flex justify-content-center text-center flex-wrap"),U(e,"class","lx-card mt-3")},m(ee,F){Ie(ee,e,F),Y(e,t),Y(t,s),Y(s,u),Y(t,f),nn(h,t,null),Y(t,g),Y(t,v),Y(v,A),Y(e,O),Y(e,N);for(let oe=0;oe<z.length;oe+=1)z[oe]&&z[oe].m(N,null);L=!0},p(ee,F){if(F&5){j=ee[6].nodes;let oe;for(oe=0;oe<j.length;oe+=1){const te=zfe(ee,j,oe);z[oe]?(z[oe].p(te,F),Oe(z[oe],1)):(z[oe]=Vfe(te),z[oe].c(),Oe(z[oe],1),z[oe].m(N,null))}for(So(),oe=j.length;oe<z.length;oe+=1)q(oe);ko()}},i(ee){if(!L){Oe(h.$$.fragment,ee);for(let F=0;F<j.length;F+=1)Oe(z[F]);L=!0}},o(ee){$e(h.$$.fragment,ee),z=z.filter(Boolean);for(let F=0;F<z.length;F+=1)$e(z[F]);L=!1},d(ee){ee&&Pe(e),on(h),Ba(z,ee)}}}function bDe(r){let e,t,s;return t=new fl({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","text-center my-4")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function vDe(r){let e,t,s;return t=new fl({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=ae("div"),sn(t.$$.fragment),U(e,"class","text-center my-4")},m(a,u){Ie(a,e,u),nn(t,e,null),s=!0},i(a){s||(Oe(t.$$.fragment,a),s=!0)},o(a){$e(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),on(t)}}}function yDe(r){let e,t,s,a;return t=new aI({props:{graph:r[0],record:r[9]}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),U(e,"class","ms-2 mb-2")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p(u,f){const h={};f&1&&(h.graph=u[0]),t.$set(h)},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function wDe(r){let e,t,s,a;return t=new P_({props:{record:r[9],size:"small",showFilename:!0}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),U(e,"class","ms-2 mb-2"),ss(e,"max-width","64px"),ss(e,"overflow","hidden"),ss(e,"white-space","nowrap"),ss(e,"text-overflow","ellipsis")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p:_n,i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function Wfe(r){let e,t,s,a;const u=[wDe,yDe],f=[];function h(g,v){return g[6].field.info.ui==="file"?0:1}return e=h(r),t=f[e]=u[e](r),{c(){t.c(),s=Bs()},m(g,v){f[e].m(g,v),Ie(g,s,v),a=!0},p(g,v){t.p(g,v)},i(g){a||(Oe(t),a=!0)},o(g){$e(t),a=!1},d(g){f[e].d(g),g&&Pe(s)}}}function jfe(r){let e,t,s=r[6].field.label+"",a,u,f,h,g,v=r[6].nodes,_=[];for(let O=0;O<v.length;O+=1)_[O]=Wfe(Hfe(r,v,O));const A=O=>$e(_[O],1,1,()=>{_[O]=null});return{c(){e=ae("div"),t=ae("div"),a=Kt(s),u=Ze(),f=ae("div");for(let O=0;O<_.length;O+=1)_[O].c();h=Ze(),U(t,"class","text-center mb-5 d-block"),U(f,"class","d-flex justify-content-center text-center flex-wrap"),U(e,"class","lx-card mt-3")},m(O,N){Ie(O,e,N),Y(e,t),Y(t,a),Y(e,u),Y(e,f);for(let L=0;L<_.length;L+=1)_[L]&&_[L].m(f,null);Y(e,h),g=!0},p(O,N){if(N&9){v=O[6].nodes;let L;for(L=0;L<v.length;L+=1){const j=Hfe(O,v,L);_[L]?(_[L].p(j,N),Oe(_[L],1)):(_[L]=Wfe(j),_[L].c(),Oe(_[L],1),_[L].m(f,null))}for(So(),L=v.length;L<_.length;L+=1)A(L);ko()}},i(O){if(!g){for(let N=0;N<v.length;N+=1)Oe(_[N]);g=!0}},o(O){_=_.filter(Boolean);for(let N=0;N<_.length;N+=1)$e(_[N]);g=!1},d(O){O&&Pe(e),Ba(_,O)}}}function _De(r){let e,t=Object.entries(r[2]).length>0,s,a,u,f,h=Object.entries(r[3]).length>0,g,v,_,A=Object.entries(r[2]),O=[];for(let F=0;F<A.length;F+=1)O[F]=Ufe($fe(r,A,F));const N=F=>$e(O[F],1,1,()=>{O[F]=null});let L=t&&bDe();u=new cI({props:{graph:r[0],record:r[1]}});let j=h&&vDe(),z=Object.entries(r[3]),q=[];for(let F=0;F<z.length;F+=1)q[F]=jfe(Ffe(r,z,F));const ee=F=>$e(q[F],1,1,()=>{q[F]=null});return{c(){for(let F=0;F<O.length;F+=1)O[F].c();e=Ze(),L&&L.c(),s=Ze(),a=ae("div"),sn(u.$$.fragment),f=Ze(),j&&j.c(),g=Ze();for(let F=0;F<q.length;F+=1)q[F].c();v=Bs(),ss(a,"max-width","400px"),ss(a,"margin","0 auto")},m(F,oe){for(let te=0;te<O.length;te+=1)O[te]&&O[te].m(F,oe);Ie(F,e,oe),L&&L.m(F,oe),Ie(F,s,oe),Ie(F,a,oe),nn(u,a,null),Ie(F,f,oe),j&&j.m(F,oe),Ie(F,g,oe);for(let te=0;te<q.length;te+=1)q[te]&&q[te].m(F,oe);Ie(F,v,oe),_=!0},p(F,[oe]){if(oe&5){A=Object.entries(F[2]);let se;for(se=0;se<A.length;se+=1){const X=$fe(F,A,se);O[se]?(O[se].p(X,oe),Oe(O[se],1)):(O[se]=Ufe(X),O[se].c(),Oe(O[se],1),O[se].m(e.parentNode,e))}for(So(),se=A.length;se<O.length;se+=1)N(se);ko()}const te={};if(oe&1&&(te.graph=F[0]),oe&2&&(te.record=F[1]),u.$set(te),oe&9){z=Object.entries(F[3]);let se;for(se=0;se<z.length;se+=1){const X=Ffe(F,z,se);q[se]?(q[se].p(X,oe),Oe(q[se],1)):(q[se]=jfe(X),q[se].c(),Oe(q[se],1),q[se].m(v.parentNode,v))}for(So(),se=z.length;se<q.length;se+=1)ee(se);ko()}},i(F){if(!_){for(let oe=0;oe<A.length;oe+=1)Oe(O[oe]);Oe(L),Oe(u.$$.fragment,F),Oe(j);for(let oe=0;oe<z.length;oe+=1)Oe(q[oe]);_=!0}},o(F){O=O.filter(Boolean);for(let oe=0;oe<O.length;oe+=1)$e(O[oe]);$e(L),$e(u.$$.fragment,F),$e(j),q=q.filter(Boolean);for(let oe=0;oe<q.length;oe+=1)$e(q[oe]);_=!1},d(F){Ba(O,F),F&&Pe(e),L&&L.d(F),F&&Pe(s),F&&Pe(a),on(u),F&&Pe(f),j&&j.d(F),F&&Pe(g),Ba(q,F),F&&Pe(v)}}}function Zfe(r,e){return e.includes(":")&&(e=e.split(":")[0]),r.fields.find(t=>t.name===e)}function CDe(r,e,t){const s=hi("channel");let{graph:a}=e,{record:u}=e,f=a.parentEdges.filter(g=>g.source!==u.id&&g.depth===1).reduce((g,v)=>{let _=s.schemas.find(L=>L.name===v.sourceSchema),A=Zfe(_,v.field),O=v.sourceSchema+A,N=a.records.find(L=>L.id===v.source);return g[O]||(g[O]={field:A,schema:_,nodes:[]}),N&&g[O].nodes.push(N),g},{}),h=a.edges.filter(g=>g.source===u.id&&g.depth===1).reduce((g,v)=>{let _=s.schemas.find(L=>L.name===u.schema),A=Zfe(_,v.field),O=A;g[O]||(g[O]={field:A,nodes:[]});let N=a.records.find(L=>L.id===v.target);return N&&g[O].nodes.push(N),g},{});return r.$$set=g=>{"graph"in g&&t(0,a=g.graph),"record"in g&&t(1,u=g.record)},[a,u,f,h]}class SDe extends xo{constructor(e){super(),Ao(this,e,CDe,_De,Eo,{graph:0,record:1})}}function qfe(r,e,t){const s=r.slice();return s[4]=e[t],s}function kDe(r){var u;let e,t=((u=JSON.stringify(r[1]))!=null?u:"")+"",s,a;return{c(){e=ae("div"),s=Kt(t),U(e,"class",a=r[3]+" field-content svelte-md34ba")},m(f,h){Ie(f,e,h),Y(e,s)},p(f,h){var g;h&2&&t!==(t=((g=JSON.stringify(f[1]))!=null?g:"")+"")&&jn(s,t),h&8&&a!==(a=f[3]+" field-content svelte-md34ba")&&U(e,"class",a)},i:_n,o:_n,d(f){f&&Pe(e)}}}function EDe(r){var a;let e,t=((a=r[1])!=null?a:"")+"",s;return{c(){e=ae("div"),U(e,"class",s=r[3]+" field-content svelte-md34ba")},m(u,f){Ie(u,e,f),e.innerHTML=t},p(u,f){var h;f&2&&t!==(t=((h=u[1])!=null?h:"")+"")&&(e.innerHTML=t),f&8&&s!==(s=u[3]+" field-content svelte-md34ba")&&U(e,"class",s)},i:_n,o:_n,d(u){u&&Pe(e)}}}function ADe(r){var u;let e,t=((u=JSON.stringify(r[1],null,2))!=null?u:"")+"",s,a;return{c(){e=ae("div"),s=Kt(t),U(e,"class",a=r[3]+" field-content svelte-md34ba"),ss(e,"white-space","break-spaces")},m(f,h){Ie(f,e,h),Y(e,s)},p(f,h){var g;h&2&&t!==(t=((g=JSON.stringify(f[1],null,2))!=null?g:"")+"")&&jn(s,t),h&8&&a!==(a=f[3]+" field-content svelte-md34ba")&&U(e,"class",a)},i:_n,o:_n,d(f){f&&Pe(e)}}}function xDe(r){let e,t,s,a,u=r[2][r[0].name],f=[];for(let g=0;g<u.length;g+=1)f[g]=Gfe(qfe(r,u,g));const h=g=>$e(f[g],1,1,()=>{f[g]=null});return{c(){e=ae("div"),t=ae("div");for(let g=0;g<f.length;g+=1)f[g].c();U(t,"class","d-flex align-items-center text-center flex-wrap"),U(e,"class",s=r[3]+" field-content svelte-md34ba")},m(g,v){Ie(g,e,v),Y(e,t);for(let _=0;_<f.length;_+=1)f[_]&&f[_].m(t,null);a=!0},p(g,v){if(v&5){u=g[2][g[0].name];let _;for(_=0;_<u.length;_+=1){const A=qfe(g,u,_);f[_]?(f[_].p(A,v),Oe(f[_],1)):(f[_]=Gfe(A),f[_].c(),Oe(f[_],1),f[_].m(t,null))}for(So(),_=u.length;_<f.length;_+=1)h(_);ko()}(!a||v&8&&s!==(s=g[3]+" field-content svelte-md34ba"))&&U(e,"class",s)},i(g){if(!a){for(let v=0;v<u.length;v+=1)Oe(f[v]);a=!0}},o(g){f=f.filter(Boolean);for(let v=0;v<f.length;v+=1)$e(f[v]);a=!1},d(g){g&&Pe(e),Ba(f,g)}}}function TDe(r){let e,t,s,a;return t=new aI({props:{record:r[4]}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),U(e,"class","ms-2 ")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p(u,f){const h={};f&5&&(h.record=u[4]),t.$set(h)},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function DDe(r){let e,t,s,a;return t=new P_({props:{record:r[4],size:"small",showFilename:!0}}),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),U(e,"class","ms-2 "),ss(e,"max-width","64px"),ss(e,"overflow","hidden"),ss(e,"white-space","nowrap"),ss(e,"text-overflow","ellipsis")},m(u,f){Ie(u,e,f),nn(t,e,null),Y(e,s),a=!0},p(u,f){const h={};f&5&&(h.record=u[4]),t.$set(h)},i(u){a||(Oe(t.$$.fragment,u),a=!0)},o(u){$e(t.$$.fragment,u),a=!1},d(u){u&&Pe(e),on(t)}}}function Gfe(r){let e,t,s,a;const u=[DDe,TDe],f=[];function h(g,v){var _;return(_=g[4]._file)!=null&&_.path?0:1}return e=h(r),t=f[e]=u[e](r),{c(){t.c(),s=Bs()},m(g,v){f[e].m(g,v),Ie(g,s,v),a=!0},p(g,v){let _=e;e=h(g),e===_?f[e].p(g,v):(So(),$e(f[_],1,1,()=>{f[_]=null}),ko(),t=f[e],t?t.p(g,v):(t=f[e]=u[e](g),t.c()),Oe(t,1),t.m(s.parentNode,s))},i(g){a||(Oe(t),a=!0)},o(g){$e(t),a=!1},d(g){f[e].d(g),g&&Pe(s)}}}function ODe(r){let e,t,s,a,u;const f=[xDe,ADe,EDe,kDe],h=[];function g(v,_){return _&1&&(e=null),e==null&&(e=!!["reference","file"].includes(v[0].ui)),e?0:v[0].ui==="json"?1:v[0].ui==="rich"?2:3}return t=g(r,-1),s=h[t]=f[t](r),{c(){s.c(),a=Bs()},m(v,_){h[t].m(v,_),Ie(v,a,_),u=!0},p(v,[_]){let A=t;t=g(v,_),t===A?h[t].p(v,_):(So(),$e(h[A],1,1,()=>{h[A]=null}),ko(),s=h[t],s?s.p(v,_):(s=h[t]=f[t](v),s.c()),Oe(s,1),s.m(a.parentNode,a))},i(v){u||(Oe(s),u=!0)},o(v){$e(s),u=!1},d(v){h[t].d(v),v&&Pe(a)}}}function MDe(r,e,t){let{field:s}=e,{side:a}=e,{edges:u}=e,{colorClass:f}=e;return r.$$set=h=>{"field"in h&&t(0,s=h.field),"side"in h&&t(1,a=h.side),"edges"in h&&t(2,u=h.edges),"colorClass"in h&&t(3,f=h.colorClass)},[s,a,u,f]}class Kfe extends xo{constructor(e){super(),Ao(this,e,MDe,ODe,Eo,{field:0,side:1,edges:2,colorClass:3})}}function Yfe(r,e,t){const s=r.slice();return s[13]=e[t],s}function Xfe(r,e,t){const s=r.slice();return s[16]=e[t],s}function RDe(r){let e;return{c(){e=ae("div"),e.innerHTML="<span>Revisions are not enabled for this Schema</span>",U(e,"class","card-body")},m(t,s){Ie(t,e,s)},p:_n,i:_n,o:_n,d(t){t&&Pe(e)}}}function NDe(r){let e,t,s,a,u=r[6],f=[];for(let g=0;g<u.length;g+=1)f[g]=Qfe(Xfe(r,u,g));const h=g=>$e(f[g],1,1,()=>{f[g]=null});return{c(){e=ae("div"),e.textContent="Revisions",t=Ze();for(let g=0;g<f.length;g+=1)f[g].c();s=Bs(),U(e,"class","header-small mb-3")},m(g,v){Ie(g,e,v),Ie(g,t,v);for(let _=0;_<f.length;_+=1)f[_]&&f[_].m(g,v);Ie(g,s,v),a=!0},p(g,v){if(v&595){u=g[6];let _;for(_=0;_<u.length;_+=1){const A=Xfe(g,u,_);f[_]?(f[_].p(A,v),Oe(f[_],1)):(f[_]=Qfe(A),f[_].c(),Oe(f[_],1),f[_].m(s.parentNode,s))}for(So(),_=u.length;_<f.length;_+=1)h(_);ko()}},i(g){if(!a){for(let v=0;v<u.length;v+=1)Oe(f[v]);a=!0}},o(g){f=f.filter(Boolean);for(let v=0;v<f.length;v+=1)$e(f[v]);a=!1},d(g){g&&Pe(e),g&&Pe(t),Ba(f,g),g&&Pe(s)}}}function Jfe(r){let e,t,s,a,u,f,h=r[16]._sys.version+"",g,v,_,A,O,N=Qy(r[16]._sys.updatedAt)+"",L,j,z,q,ee,F,oe,te,se,X;s=new jV({props:{status:r[16].status}}),A=new i2({props:{name:Dp(r[1],r[16]._sys.updatedBy),side:24}});function we(...ye){return r[11](r[16],...ye)}return{c(){var ye,Te;e=ae("div"),t=ae("div"),sn(s.$$.fragment),a=Ze(),u=ae("div"),f=Kt("version "),g=Kt(h),v=Ze(),_=ae("div"),sn(A.$$.fragment),O=Ze(),L=Kt(N),j=Ze(),z=ae("div"),q=ae("button"),ee=Kt("Compare"),oe=Ze(),U(t,"class","col-2"),U(u,"class","col-2"),U(_,"class","col-5"),q.disabled=F=r[16]._sys.version===((ye=r[4])==null?void 0:ye._sys.version),U(q,"class","btn btn-sm btn-outline-primary"),U(z,"class","col-3 text-center"),U(e,"class","row p-2 rounded svelte-4o2asb"),vs(e,"active",r[16]._sys.version===((Te=r[4])==null?void 0:Te._sys.version))},m(ye,Te){Ie(ye,e,Te),Y(e,t),nn(s,t,null),Y(e,a),Y(e,u),Y(u,f),Y(u,g),Y(e,v),Y(e,_),nn(A,_,null),Y(_,O),Y(_,L),Y(e,j),Y(e,z),Y(z,q),Y(q,ee),Y(e,oe),te=!0,se||(X=En(q,"click",we),se=!0)},p(ye,Te){var nt,Je;r=ye;const _e={};Te&64&&(_e.status=r[16].status),s.$set(_e),(!te||Te&64)&&h!==(h=r[16]._sys.version+"")&&jn(g,h);const ge={};Te&66&&(ge.name=Dp(r[1],r[16]._sys.updatedBy)),A.$set(ge),(!te||Te&64)&&N!==(N=Qy(r[16]._sys.updatedAt)+"")&&jn(L,N),(!te||Te&80&&F!==(F=r[16]._sys.version===((nt=r[4])==null?void 0:nt._sys.version)))&&(q.disabled=F),(!te||Te&80)&&vs(e,"active",r[16]._sys.version===((Je=r[4])==null?void 0:Je._sys.version))},i(ye){te||(Oe(s.$$.fragment,ye),Oe(A.$$.fragment,ye),te=!0)},o(ye){$e(s.$$.fragment,ye),$e(A.$$.fragment,ye),te=!1},d(ye){ye&&Pe(e),on(s),on(A),se=!1,X()}}}function Qfe(r){let e,t,s=r[16]._sys.version!=r[0]._sys.version&&Jfe(r);return{c(){s&&s.c(),e=Bs()},m(a,u){s&&s.m(a,u),Ie(a,e,u),t=!0},p(a,u){a[16]._sys.version!=a[0]._sys.version?s?(s.p(a,u),u&65&&Oe(s,1)):(s=Jfe(a),s.c(),Oe(s,1),s.m(e.parentNode,e)):s&&(So(),$e(s,1,1,()=>{s=null}),ko())},i(a){t||(Oe(s),t=!0)},o(a){$e(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function ede(r){let e,t,s,a;const u=[IDe,PDe],f=[];function h(g,v){return g[5].length>0?0:1}return t=h(r),s=f[t]=u[t](r),{c(){e=ae("div"),s.c(),U(e,"class","mt-4")},m(g,v){Ie(g,e,v),f[t].m(e,null),a=!0},p(g,v){let _=t;t=h(g),t===_?f[t].p(g,v):(So(),$e(f[_],1,1,()=>{f[_]=null}),ko(),s=f[t],s?s.p(g,v):(s=f[t]=u[t](g),s.c()),Oe(s,1),s.m(e,null))},i(g){a||(Oe(s),a=!0)},o(g){$e(s),a=!1},d(g){g&&Pe(e),f[t].d()}}}function PDe(r){let e;return{c(){e=ae("div"),e.innerHTML="<span>Nothing will change</span>",U(e,"class","lx-card text-center")},m(t,s){Ie(t,e,s)},p:_n,i:_n,o:_n,d(t){t&&Pe(e)}}}function IDe(r){let e,t,s,a,u=r[4]._sys.version+"",f,h,g,v,_,A,O,N=r[3]&&tde(r),L=r[5],j=[];for(let q=0;q<L.length;q+=1)j[q]=nde(Yfe(r,L,q));const z=q=>$e(j[q],1,1,()=>{j[q]=null});return{c(){e=ae("p"),e.textContent="If you choose to rollback to this revision",t=Ze(),s=ae("button"),a=Kt("Rollback to version "),f=Kt(u),h=Ze(),N&&N.c(),g=Ze(),v=ae("div");for(let q=0;q<j.length;q+=1)j[q].c();U(e,"class","text-center fw-bold mb-3 mt-5"),U(s,"class","btn btn-primary mb-5 d-block mx-auto"),U(v,"class","mt-3")},m(q,ee){Ie(q,e,ee),Ie(q,t,ee),Ie(q,s,ee),Y(s,a),Y(s,f),Ie(q,h,ee),N&&N.m(q,ee),Ie(q,g,ee),Ie(q,v,ee);for(let F=0;F<j.length;F+=1)j[F]&&j[F].m(v,null);_=!0,A||(O=En(s,"click",r[10]),A=!0)},p(q,ee){if((!_||ee&16)&&u!==(u=q[4]._sys.version+"")&&jn(f,u),q[3]?N?N.p(q,ee):(N=tde(q),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),ee&433){L=q[5];let F;for(F=0;F<L.length;F+=1){const oe=Yfe(q,L,F);j[F]?(j[F].p(oe,ee),Oe(j[F],1)):(j[F]=nde(oe),j[F].c(),Oe(j[F],1),j[F].m(v,null))}for(So(),F=L.length;F<j.length;F+=1)z(F);ko()}},i(q){if(!_){for(let ee=0;ee<L.length;ee+=1)Oe(j[ee]);_=!0}},o(q){j=j.filter(Boolean);for(let ee=0;ee<j.length;ee+=1)$e(j[ee]);_=!1},d(q){q&&Pe(e),q&&Pe(t),q&&Pe(s),q&&Pe(h),N&&N.d(q),q&&Pe(g),q&&Pe(v),Ba(j,q),A=!1,O()}}}function tde(r){let e,t;return{c(){e=ae("span"),t=Kt(r[3]),U(e,"class","d-block text-danger mt-3")},m(s,a){Ie(s,e,a),Y(e,t)},p(s,a){a&8&&jn(t,s[3])},d(s){s&&Pe(e)}}}function nde(r){let e,t,s,a,u,f,h,g=r[13].label+"",v,_,A,O,N,L,j,z;return s=new Kfe({props:{edges:r[8],field:r[13],side:r[0].data[r[13].name],colorClass:"text-danger"}}),A=new fl({props:{icon:"angle-right",width:"12",height:"12"}}),L=new Kfe({props:{edges:r[7],field:r[13],side:r[4].data[r[13].name],colorClass:"text-success"}}),{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),a=Ze(),u=ae("div"),f=ae("div"),h=ae("span"),v=Kt(g),_=Ze(),sn(A.$$.fragment),O=Ze(),N=ae("div"),sn(L.$$.fragment),j=Ze(),U(t,"class","col-5"),U(h,"class","me-1"),U(f,"class","h-100 d-flex align-items-center justify-content-center text-secondary"),U(u,"class","col-2"),U(N,"class","col-5"),U(e,"class","lx-card row p-4 mb-4 w-100"),ss(e,"overflow","hidden")},m(q,ee){Ie(q,e,ee),Y(e,t),nn(s,t,null),Y(e,a),Y(e,u),Y(u,f),Y(f,h),Y(h,v),Y(f,_),nn(A,f,null),Y(e,O),Y(e,N),nn(L,N,null),Ie(q,j,ee),z=!0},p(q,ee){const F={};ee&256&&(F.edges=q[8]),ee&32&&(F.field=q[13]),ee&33&&(F.side=q[0].data[q[13].name]),s.$set(F),(!z||ee&32)&&g!==(g=q[13].label+"")&&jn(v,g);const oe={};ee&128&&(oe.edges=q[7]),ee&32&&(oe.field=q[13]),ee&48&&(oe.side=q[4].data[q[13].name]),L.$set(oe)},i(q){z||(Oe(s.$$.fragment,q),Oe(A.$$.fragment,q),Oe(L.$$.fragment,q),z=!0)},o(q){$e(s.$$.fragment,q),$e(A.$$.fragment,q),$e(L.$$.fragment,q),z=!1},d(q){q&&Pe(e),on(s),on(A),on(L),q&&Pe(j)}}}function BDe(r){let e,t,s,a,u,f,h,g=r[0].id+"",v,_,A,O,N,L=r[0]._sys.version+"",j,z,q,ee,F,oe,te,se=Qy(r[0]._sys.createdAt)+"",X,we,ye,Te,_e,ge,nt,Je=Qy(r[0]._sys.updatedAt)+"",ft,V,ut,et,Et,xt,He,ct=r[2].revisionRetentionDays+"",an,kt,bn,qe,gt=r[2].revisionRetentionNumber+"",de,No,Zn,Bn,ao,Wo,St,Xt,Tt;oe=new i2({props:{name:Dp(r[1],r[0]._sys.createdBy),side:24}}),ge=new i2({props:{name:Dp(r[1],r[0]._sys.updatedBy),side:24}});const Be=[NDe,RDe],Ut=[];function gn(Yt,vn){return Yt[2].revisionRetentionDays>0?0:1}ao=gn(r),Wo=Ut[ao]=Be[ao](r);let wt=r[4]&&ede(r);return{c(){e=ae("div"),t=ae("div"),s=ae("div"),a=ae("div"),u=ae("span"),u.textContent="record id",f=Ze(),h=ae("small"),v=Kt(g),_=Ze(),A=ae("div"),O=ae("span"),O.textContent="current version",N=Ze(),j=Kt(L),z=Ze(),q=ae("div"),ee=ae("span"),ee.textContent="created",F=Ze(),sn(oe.$$.fragment),te=Ze(),X=Kt(se),we=Ze(),ye=ae("div"),Te=ae("span"),Te.textContent="updated",_e=Ze(),sn(ge.$$.fragment),nt=Ze(),ft=Kt(Je),V=Ze(),ut=ae("div"),et=ae("span"),et.textContent="Rules for this schema",Et=Ze(),xt=ae("small"),He=Kt("Revisions are retained for "),an=Kt(ct),kt=Kt(` days
|
|
`),bn=ae("br"),qe=Kt(`
|
|
Each record maintains the last `),de=Kt(gt),No=Kt(`
|
|
versions`),Zn=Ze(),Bn=ae("div"),Wo.c(),St=Ze(),wt&&wt.c(),Xt=Bs(),U(u,"class","label text-end text-muted svelte-4o2asb"),U(O,"class","label text-end text-muted svelte-4o2asb"),U(ee,"class","label text-end text-muted svelte-4o2asb"),U(Te,"class","label text-end text-muted svelte-4o2asb"),U(s,"class","col-8"),U(et,"class","label d-block text-muted svelte-4o2asb"),U(ut,"class","col-4"),U(t,"class","row"),U(e,"class","lx-card "),U(Bn,"class","lx-card mt-4")},m(Yt,vn){Ie(Yt,e,vn),Y(e,t),Y(t,s),Y(s,a),Y(a,u),Y(a,f),Y(a,h),Y(h,v),Y(s,_),Y(s,A),Y(A,O),Y(A,N),Y(A,j),Y(s,z),Y(s,q),Y(q,ee),Y(q,F),nn(oe,q,null),Y(q,te),Y(q,X),Y(s,we),Y(s,ye),Y(ye,Te),Y(ye,_e),nn(ge,ye,null),Y(ye,nt),Y(ye,ft),Y(t,V),Y(t,ut),Y(ut,et),Y(ut,Et),Y(ut,xt),Y(xt,He),Y(xt,an),Y(xt,kt),Y(xt,bn),Y(xt,qe),Y(xt,de),Y(xt,No),Ie(Yt,Zn,vn),Ie(Yt,Bn,vn),Ut[ao].m(Bn,null),Ie(Yt,St,vn),wt&&wt.m(Yt,vn),Ie(Yt,Xt,vn),Tt=!0},p(Yt,[vn]){(!Tt||vn&1)&&g!==(g=Yt[0].id+"")&&jn(v,g),(!Tt||vn&1)&&L!==(L=Yt[0]._sys.version+"")&&jn(j,L);const rs={};vn&3&&(rs.name=Dp(Yt[1],Yt[0]._sys.createdBy)),oe.$set(rs),(!Tt||vn&1)&&se!==(se=Qy(Yt[0]._sys.createdAt)+"")&&jn(X,se);const eo={};vn&3&&(eo.name=Dp(Yt[1],Yt[0]._sys.updatedBy)),ge.$set(eo),(!Tt||vn&1)&&Je!==(Je=Qy(Yt[0]._sys.updatedAt)+"")&&jn(ft,Je),(!Tt||vn&4)&&ct!==(ct=Yt[2].revisionRetentionDays+"")&&jn(an,ct),(!Tt||vn&4)&>!==(gt=Yt[2].revisionRetentionNumber+"")&&jn(de,gt);let ds=ao;ao=gn(Yt),ao===ds?Ut[ao].p(Yt,vn):(So(),$e(Ut[ds],1,1,()=>{Ut[ds]=null}),ko(),Wo=Ut[ao],Wo?Wo.p(Yt,vn):(Wo=Ut[ao]=Be[ao](Yt),Wo.c()),Oe(Wo,1),Wo.m(Bn,null)),Yt[4]?wt?(wt.p(Yt,vn),vn&16&&Oe(wt,1)):(wt=ede(Yt),wt.c(),Oe(wt,1),wt.m(Xt.parentNode,Xt)):wt&&(So(),$e(wt,1,1,()=>{wt=null}),ko())},i(Yt){Tt||(Oe(oe.$$.fragment,Yt),Oe(ge.$$.fragment,Yt),Oe(Wo),Oe(wt),Tt=!0)},o(Yt){$e(oe.$$.fragment,Yt),$e(ge.$$.fragment,Yt),$e(Wo),$e(wt),Tt=!1},d(Yt){Yt&&Pe(e),on(oe),on(ge),Yt&&Pe(Zn),Yt&&Pe(Bn),Ut[ao].d(),Yt&&Pe(St),wt&&wt.d(Yt),Yt&&Pe(Xt)}}}function LDe(r,e,t){let s,a,u,f,h,{record:g}=e,{users:v}=e,{schema:_}=e,A="";axios.get(`/records/${g.id}/revisions`).then(j=>{t(6,s=j.data)}).catch(j=>{console.log(j)});function O(j,z){j.preventDefault(),t(4,u=z),t(5,a=_.fields.filter(q=>!fd.exports.isEqual(u.data[q.name],g.data[q.name])))}function N(j){j.preventDefault(),t(3,A=""),axios.post(`/records/${g.id}/rollback/${u._sys.version}`).then(z=>{window.location.reload()}).catch(z=>{const q=z.response.data.error;t(3,A=q.fieldLabel+": "+q.message)})}const L=(j,z)=>O(z,j);return r.$$set=j=>{"record"in j&&t(0,g=j.record),"users"in j&&t(1,v=j.users),"schema"in j&&t(2,_=j.schema)},t(6,s=[]),t(5,a=[]),t(4,u=null),t(8,f={}),t(7,h={}),[g,v,_,A,u,a,s,h,f,O,N,L]}class FDe extends xo{constructor(e){super(),Ao(this,e,LDe,BDe,Eo,{record:0,users:1,schema:2})}}const{window:HDe}=Mbe;function ode(r,e,t){const s=r.slice();return s[23]=e[t],s}function sde(r){let e,t,s,a,u,f;function h(O){r[14](O)}let g={record:r[0],schema:r[2]};r[0].status!==void 0&&(g.status=r[0].status),s=new $he({props:g}),ts.push(()=>gr(s,"status",h));function v(O,N){if(O[4])return zDe;if(O[9])return $De}let _=v(r),A=_&&_(r);return{c(){e=ae("div"),t=ae("div"),sn(s.$$.fragment),u=Ze(),A&&A.c(),U(t,"class","d-flex mt-3 mb-3 align-items-center justify-content-center"),U(e,"class","shadow-lg "),ss(e,"position","fixed"),ss(e,"bottom","0"),ss(e,"left","0px"),ss(e,"width","100%"),ss(e,"background","rgb(206, 223, 210)"),ss(e,"z-index","1050")},m(O,N){Ie(O,e,N),Y(e,t),nn(s,t,null),Y(t,u),A&&A.m(t,null),f=!0},p(O,N){const L={};N&1&&(L.record=O[0]),N&4&&(L.schema=O[2]),!a&&N&1&&(a=!0,L.status=O[0].status,Cr(()=>a=!1)),s.$set(L),_===(_=v(O))&&A?A.p(O,N):(A&&A.d(1),A=_&&_(O),A&&(A.c(),A.m(t,null)))},i(O){f||(Oe(s.$$.fragment,O),f=!0)},o(O){$e(s.$$.fragment,O),f=!1},d(O){O&&Pe(e),on(s),A&&A.d()}}}function $De(r){let e,t,s;return{c(){e=ae("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Save`,U(e,"type","button"),U(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",r[12]),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function zDe(r){let e,t,s;return{c(){e=ae("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Create`,U(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Ie(a,e,u),t||(s=En(e,"click",r[12]),t=!0)},p:_n,d(a){a&&Pe(e),t=!1,s()}}}function VDe(r){let e,t,s;function a(f){r[18](f)}let u={users:r[5],schema:r[2]};return r[0]!==void 0&&(u.record=r[0]),e=new FDe({props:u}),ts.push(()=>gr(e,"record",a)),{c(){sn(e.$$.fragment)},m(f,h){nn(e,f,h),s=!0},p(f,h){const g={};h&32&&(g.users=f[5]),h&4&&(g.schema=f[2]),!t&&h&1&&(t=!0,g.record=f[0],Cr(()=>t=!1)),e.$set(g)},i(f){s||(Oe(e.$$.fragment,f),s=!0)},o(f){$e(e.$$.fragment,f),s=!1},d(f){on(e,f)}}}function UDe(r){let e,t;return e=new SDe({props:{graph:r[1],record:r[0]}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&2&&(u.graph=s[1]),a&1&&(u.record=s[0]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function WDe(r){let e,t,s=[],a=new Map,u,f;e=new zhe({props:{record:r[0],schema:r[2]}});let h=r[10];const g=v=>v[23].name;for(let v=0;v<h.length;v+=1){let _=ode(r,h,v),A=g(_);a.set(A,s[v]=ide(A,_))}return{c(){sn(e.$$.fragment),t=Ze();for(let v=0;v<s.length;v+=1)s[v].c();u=Bs()},m(v,_){nn(e,v,_),Ie(v,t,_);for(let A=0;A<s.length;A+=1)s[A]&&s[A].m(v,_);Ie(v,u,_),f=!0},p(v,_){const A={};_&1&&(A.record=v[0]),_&4&&(A.schema=v[2]),e.$set(A),_&1239&&(h=v[10],So(),s=$h(s,_,g,1,v,h,a,u.parentNode,gv,ide,u,ode),ko())},i(v){if(!f){Oe(e.$$.fragment,v);for(let _=0;_<h.length;_+=1)Oe(s[_]);f=!0}},o(v){$e(e.$$.fragment,v);for(let _=0;_<s.length;_+=1)$e(s[_]);f=!1},d(v){on(e,v),v&&Pe(t);for(let _=0;_<s.length;_+=1)s[_].d(v);v&&Pe(u)}}}function rde(r){let e,t,s,a;function u(g){r[16](g)}function f(g){r[17](g)}let h={field:r[23],schema:r[2],record:r[0],validationErrors:r[6],isCreateMode:r[4]};return r[0].data!==void 0&&(h.data=r[0].data),r[1]!==void 0&&(h.graph=r[1]),e=new y1e({props:h}),ts.push(()=>gr(e,"data",u)),ts.push(()=>gr(e,"graph",f)),{c(){sn(e.$$.fragment)},m(g,v){nn(e,g,v),a=!0},p(g,v){const _={};v&4&&(_.schema=g[2]),v&1&&(_.record=g[0]),v&64&&(_.validationErrors=g[6]),v&16&&(_.isCreateMode=g[4]),!t&&v&1&&(t=!0,_.data=g[0].data,Cr(()=>t=!1)),!s&&v&2&&(s=!0,_.graph=g[1],Cr(()=>s=!1)),e.$set(_)},i(g){a||(Oe(e.$$.fragment,g),a=!0)},o(g){$e(e.$$.fragment,g),a=!1},d(g){on(e,g)}}}function ide(r,e){let t,s,a,u=e[7]===e[23].group&&rde(e);return{key:r,first:null,c(){t=Bs(),u&&u.c(),s=Bs(),this.first=t},m(f,h){Ie(f,t,h),u&&u.m(f,h),Ie(f,s,h),a=!0},p(f,h){e=f,e[7]===e[23].group?u?(u.p(e,h),h&128&&Oe(u,1)):(u=rde(e),u.c(),Oe(u,1),u.m(s.parentNode,s)):u&&(So(),$e(u,1,1,()=>{u=null}),ko())},i(f){a||(Oe(u),a=!0)},o(f){$e(u),a=!1},d(f){f&&Pe(t),u&&u.d(f),f&&Pe(s)}}}function jDe(r){let e,t,s,a,u,f,h=!["_graph","_info"].includes(r[7]),g,v,_,A,O,N,L,j,z,q,ee,F,oe;t=new Jye({props:{managerRecords:r[3],graph:r[1]}});function te(nt){r[13](nt)}let se={schema:r[2],record:r[0],isCreateMode:r[4],graph:r[1]};r[7]!==void 0&&(se.activeContentTab=r[7]),a=new o2e({props:se}),ts.push(()=>gr(a,"activeContentTab",te));let X=h&&sde(r);v=new sI({props:{message:r[8]}});function we(nt){r[15](nt)}let ye={schema:r[2],isCreateMode:r[4]};r[7]!==void 0&&(ye.active=r[7]),O=new Vhe({props:ye}),ts.push(()=>gr(O,"active",we));const Te=[WDe,UDe,VDe],_e=[];function ge(nt,Je){return Je&128&&(j=null),j==null&&(j=!["_graph","_info"].includes(nt[7])),j?0:nt[7]==="_graph"?1:nt[7]==="_info"?2:-1}return~(z=ge(r,-1))&&(q=_e[z]=Te[z](r)),{c(){e=ae("div"),sn(t.$$.fragment),s=Ze(),sn(a.$$.fragment),f=Ze(),X&&X.c(),g=Ze(),sn(v.$$.fragment),_=Ze(),A=ae("div"),sn(O.$$.fragment),L=Ze(),q&&q.c(),U(A,"class","mt-4"),ss(A,"margin-bottom","150px"),U(e,"class","wrapper-normal transparent")},m(nt,Je){Ie(nt,e,Je),nn(t,e,null),Y(e,s),nn(a,e,null),Y(e,f),X&&X.m(e,null),Y(e,g),nn(v,e,null),Y(e,_),Y(e,A),nn(O,A,null),Y(A,L),~z&&_e[z].m(A,null),ee=!0,F||(oe=En(HDe,"beforeunload",r[11]),F=!0)},p(nt,[Je]){const ft={};Je&8&&(ft.managerRecords=nt[3]),Je&2&&(ft.graph=nt[1]),t.$set(ft);const V={};Je&4&&(V.schema=nt[2]),Je&1&&(V.record=nt[0]),Je&16&&(V.isCreateMode=nt[4]),Je&2&&(V.graph=nt[1]),!u&&Je&128&&(u=!0,V.activeContentTab=nt[7],Cr(()=>u=!1)),a.$set(V),Je&128&&(h=!["_graph","_info"].includes(nt[7])),h?X?(X.p(nt,Je),Je&128&&Oe(X,1)):(X=sde(nt),X.c(),Oe(X,1),X.m(e,g)):X&&(So(),$e(X,1,1,()=>{X=null}),ko());const ut={};Je&256&&(ut.message=nt[8]),v.$set(ut);const et={};Je&4&&(et.schema=nt[2]),Je&16&&(et.isCreateMode=nt[4]),!N&&Je&128&&(N=!0,et.active=nt[7],Cr(()=>N=!1)),O.$set(et);let Et=z;z=ge(nt,Je),z===Et?~z&&_e[z].p(nt,Je):(q&&(So(),$e(_e[Et],1,1,()=>{_e[Et]=null}),ko()),~z?(q=_e[z],q?q.p(nt,Je):(q=_e[z]=Te[z](nt),q.c()),Oe(q,1),q.m(A,null)):q=null)},i(nt){ee||(Oe(t.$$.fragment,nt),Oe(a.$$.fragment,nt),Oe(X),Oe(v.$$.fragment,nt),Oe(O.$$.fragment,nt),Oe(q),ee=!0)},o(nt){$e(t.$$.fragment,nt),$e(a.$$.fragment,nt),$e(X),$e(v.$$.fragment,nt),$e(O.$$.fragment,nt),$e(q),ee=!1},d(nt){nt&&Pe(e),on(t),on(a),X&&X.d(),on(v),on(O),~z&&_e[z].d(),F=!1,oe()}}}function ZDe(r,e,t){let s,a,u;const f=hi("channel");let{schema:h}=e,{record:g}=e,{graph:v={records:[],edges:[]}}=e,{recordHistory:_}=e,{isCreateMode:A}=e,{users:O}=e,N,L="",j=h.fields.filter(Te=>Te.name!=="id");H0(()=>{z()});function z(){N={data:JSON.parse(JSON.stringify(g.data)),schema:g.schema,status:g.status,_sys:JSON.parse(JSON.stringify(g._sys)),_file:JSON.parse(JSON.stringify(g._file)),edges:JSON.parse(JSON.stringify(v.edges))}}xhe(()=>{t(9,s=ee())});function q(Te){return s?Te.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Te.returnValue,"...")}function ee(){return A?!1:!fd.exports.isEqual(N,{data:g.data,schema:g.schema,status:g.status,_sys:g._sys,_file:g._file,edges:v.edges})}function F(Te){return Te.preventDefault(),console.log("SAVE: Attempt"),t(6,a=null),t(8,u=""),new Promise(function(_e,ge){var nt,Je;if(!s&&!A){_e(null);return}if(!g){_e(null);return}t(1,v.edges=(Je=(nt=v.edges)==null?void 0:nt.filter(ft=>!ft._isTrashed&&ft.source===g.id))!=null?Je:null,v),axios.post(f.lucentUrl+"/records",{record:g,edges:v.edges,isCreateMode:A}).then(function(ft){var V;if(console.log("SAVE: SAVED"),A)window.location=f.lucentUrl+"/records/"+g.id;else{if(t(0,g=(V=ft.data.records[0])!=null?V:null),!g){t(9,s=!1),window.location=f.lucentUrl;return}t(1,v=ft.data),z()}_e(null)}).catch(function(ft){ft.response&&(typeof ft.response.data.error=="string"?t(8,u=ft.response.data.error):(t(6,a=ft.response.data.error),console.log(a))),_e(null)})})}function oe(Te){L=Te,t(7,L)}function te(Te){r.$$.not_equal(g.status,Te)&&(g.status=Te,t(0,g))}function se(Te){L=Te,t(7,L)}function X(Te){r.$$.not_equal(g.data,Te)&&(g.data=Te,t(0,g))}function we(Te){v=Te,t(1,v)}function ye(Te){g=Te,t(0,g)}return r.$$set=Te=>{"schema"in Te&&t(2,h=Te.schema),"record"in Te&&t(0,g=Te.record),"graph"in Te&&t(1,v=Te.graph),"recordHistory"in Te&&t(3,_=Te.recordHistory),"isCreateMode"in Te&&t(4,A=Te.isCreateMode),"users"in Te&&t(5,O=Te.users)},r.$$.update=()=>{r.$$.dirty&64&&t(8,u=a?`Record submission failed. ${Object.entries(a).length} error(s)`:null)},t(9,s=!1),t(6,a=null),[g,v,h,_,A,O,a,L,u,s,j,q,F,oe,te,se,X,we,ye]}class qDe extends xo{constructor(e){super(),Ao(this,e,ZDe,jDe,Eo,{schema:2,record:0,graph:1,recordHistory:3,isCreateMode:4,users:5})}}function ade(r,e,t){const s=r.slice();return s[3]=e[t],s}function lde(r){let e,t=r[3].label+"",s,a;return{c(){var u;e=ae("a"),s=Kt(t),U(e,"class","list-group-item list-group-item-action"),U(e,"aria-current","page"),U(e,"href",a=r[2].lucentUrl+"/content/"+r[3].name),vs(e,"active",r[3].name===((u=r[1])==null?void 0:u.name))},m(u,f){Ie(u,e,f),Y(e,s)},p(u,f){var h;f&1&&t!==(t=u[3].label+"")&&jn(s,t),f&1&&a!==(a=u[2].lucentUrl+"/content/"+u[3].name)&&U(e,"href",a),f&3&&vs(e,"active",u[3].name===((h=u[1])==null?void 0:h.name))},d(u){u&&Pe(e)}}}function GDe(r){let e,t=r[0],s=[];for(let a=0;a<t.length;a+=1)s[a]=lde(ade(r,t,a));return{c(){e=ae("div");for(let a=0;a<s.length;a+=1)s[a].c();U(e,"class","list-group list-group-flush")},m(a,u){Ie(a,e,u);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null)},p(a,[u]){if(u&7){t=a[0];let f;for(f=0;f<t.length;f+=1){const h=ade(a,t,f);s[f]?s[f].p(h,u):(s[f]=lde(h),s[f].c(),s[f].m(e,null))}for(;f<s.length;f+=1)s[f].d(1);s.length=t.length}},i:_n,o:_n,d(a){a&&Pe(e),Ba(s,a)}}}function KDe(r,e,t){const s=hi("channel");let{schemas:a}=e,{schema:u}=e;return r.$$set=f=>{"schemas"in f&&t(0,a=f.schemas),"schema"in f&&t(1,u=f.schema)},[a,u,s]}class Yte extends xo{constructor(e){super(),Ao(this,e,KDe,GDe,Eo,{schemas:0,schema:1})}}function YDe(r){let e,t;return{c(){e=ae("a"),t=Kt("Build website"),U(e,"href",r[2].lucentUrl+"/build-report"),U(e,"class","btn btn-outline-primary btn-sm")},m(s,a){Ie(s,e,a),Y(e,t)},p:_n,d(s){s&&Pe(e)}}}function XDe(r){let e,t,s,a,u,f,h=r[2].name+"",g,v,_,A,O,N,L,j,z,q,ee,F,oe,te,se,X,we,ye,Te,_e,ge,nt,Je,ft,V,ut,et,Et,xt,He,ct,an,kt,bn,qe,gt,de,No,Zn=r[2].generateCommand&&YDe(r);return z=new i2({props:{side:"28",name:r[3].name}}),ge=new Yte({props:{schemas:r[2].schemas.filter(JDe),schema:r[0]}}),Et=new Yte({props:{schemas:r[2].schemas.filter(QDe),schema:r[0]}}),qe=new Yte({props:{schemas:r[2].schemas.filter(eOe),schema:r[0]}}),{c(){e=ae("nav"),t=ae("div"),s=ae("button"),s.textContent="\xAB Content",a=Ze(),u=ae("div"),f=ae("a"),g=Kt(h),v=Ze(),_=ae("a"),A=Kt("Members"),O=Ze(),Zn&&Zn.c(),N=Ze(),L=ae("div"),j=ae("a"),sn(z.$$.fragment),q=Ze(),ee=ae("div"),F=ae("div"),oe=ae("button"),oe.textContent="\xAB close",te=Ze(),se=ae("div"),X=ae("div"),we=ae("h2"),we.innerHTML='<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseMain" aria-expanded="true" aria-controls="panelsStayOpen-collapseMain">Main</button>',ye=Ze(),Te=ae("div"),_e=ae("div"),sn(ge.$$.fragment),nt=Ze(),Je=ae("div"),ft=ae("h2"),ft.innerHTML='<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOther" aria-expanded="false" aria-controls="panelsStayOpen-collapseOther">Other</button>',V=Ze(),ut=ae("div"),et=ae("div"),sn(Et.$$.fragment),xt=Ze(),He=ae("div"),ct=ae("h2"),ct.innerHTML='<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFS" aria-expanded="false" aria-controls="panelsStayOpen-collapseFS">Filesystem</button>',an=Ze(),kt=ae("div"),bn=ae("div"),sn(qe.$$.fragment),U(s,"class","btn btn-primary btn-sm d-xxl-none"),U(f,"class","nav-item"),U(f,"href",r[2].lucentUrl),U(_,"class","nav-item"),U(_,"href",r[2].lucentUrl+"/members"),U(j,"class","nav-item"),U(j,"href",r[2].lucentUrl+"/profile"),U(e,"class","lx-nav"),U(oe,"class","btn btn-primary btn-sm d-xxl-none mb-4"),U(we,"class","accordion-header"),U(we,"id","panelsStayOpen-headingMain"),U(_e,"class","accordion-body"),U(Te,"id","panelsStayOpen-collapseMain"),U(Te,"class","accordion-collapse collapse show"),U(Te,"aria-labelledby","panelsStayOpen-headingMain"),U(X,"class","accordion-item"),U(ft,"class","accordion-header"),U(ft,"id","panelsStayOpen-headingOther"),U(et,"class","accordion-body"),U(ut,"id","panelsStayOpen-collapseOther"),U(ut,"class","accordion-collapse collapse"),U(ut,"aria-labelledby","panelsStayOpen-headingOther"),U(Je,"class","accordion-item"),U(ct,"class","accordion-header"),U(ct,"id","panelsStayOpen-headingFS"),U(bn,"class","accordion-body"),U(kt,"id","panelsStayOpen-collapseFS"),U(kt,"class","accordion-collapse collapse"),U(kt,"aria-labelledby","panelsStayOpen-headingFS"),U(He,"class","accordion-item"),U(se,"class","accordion"),U(F,"class","offcanvas-body"),U(ee,"class","offcanvas offcanvas-start d-xxl-block show border-0 bg-light-subtle"),ss(ee,"padding-top","36px "),U(ee,"data-bs-scroll","true"),U(ee,"data-bs-backdrop","false"),U(ee,"tabindex","-1"),U(ee,"aria-labelledby","offcanvasScrollingLabel"),vs(ee,"d-none",!r[1])},m(Bn,ao){Ie(Bn,e,ao),Y(e,t),Y(t,s),Y(e,a),Y(e,u),Y(u,f),Y(f,g),Y(u,v),Y(u,_),Y(_,A),Y(u,O),Zn&&Zn.m(u,null),Y(e,N),Y(e,L),Y(L,j),nn(z,j,null),Ie(Bn,q,ao),Ie(Bn,ee,ao),Y(ee,F),Y(F,oe),Y(F,te),Y(F,se),Y(se,X),Y(X,we),Y(X,ye),Y(X,Te),Y(Te,_e),nn(ge,_e,null),Y(se,nt),Y(se,Je),Y(Je,ft),Y(Je,V),Y(Je,ut),Y(ut,et),nn(Et,et,null),Y(se,xt),Y(se,He),Y(He,ct),Y(He,an),Y(He,kt),Y(kt,bn),nn(qe,bn,null),gt=!0,de||(No=[En(s,"click",r[4]),En(oe,"click",r[5])],de=!0)},p(Bn,[ao]){Bn[2].generateCommand&&Zn.p(Bn,ao);const Wo={};ao&1&&(Wo.schema=Bn[0]),ge.$set(Wo);const St={};ao&1&&(St.schema=Bn[0]),Et.$set(St);const Xt={};ao&1&&(Xt.schema=Bn[0]),qe.$set(Xt),(!gt||ao&2)&&vs(ee,"d-none",!Bn[1])},i(Bn){gt||(Oe(z.$$.fragment,Bn),Oe(ge.$$.fragment,Bn),Oe(Et.$$.fragment,Bn),Oe(qe.$$.fragment,Bn),gt=!0)},o(Bn){$e(z.$$.fragment,Bn),$e(ge.$$.fragment,Bn),$e(Et.$$.fragment,Bn),$e(qe.$$.fragment,Bn),gt=!1},d(Bn){Bn&&Pe(e),Zn&&Zn.d(),on(z),Bn&&Pe(q),Bn&&Pe(ee),on(ge),on(Et),on(qe),de=!1,Bi(No)}}}const JDe=r=>r.isEntry,QDe=r=>!r.isEntry&&r.type==="collection",eOe=r=>r.type==="files";function tOe(r,e,t){let{schema:s}=e;const a=hi("channel"),u=hi("user");let f=!1;const h=v=>t(1,f=!0),g=v=>t(1,f=!1);return r.$$set=v=>{"schema"in v&&t(0,s=v.schema)},[s,f,a,u,h,g]}class nOe extends xo{constructor(e){super(),Ao(this,e,tOe,XDe,Eo,{schema:0})}}function oOe(r){let e,t=dd(r[3].schemas,r[2],r[1])+"",s,a;return{c(){e=ae("a"),s=Kt(t),U(e,"href",a=r[3].lucentUrl+"/records/"+r[2].id),U(e,"class","text-decoration-none text-dark d-block")},m(u,f){Ie(u,e,f),Y(e,s)},p(u,f){f&6&&t!==(t=dd(u[3].schemas,u[2],u[1])+"")&&jn(s,t),f&4&&a!==(a=u[3].lucentUrl+"/records/"+u[2].id)&&U(e,"href",a)},i:_n,o:_n,d(u){u&&Pe(e)}}}function sOe(r){let e,t;return e=new P_({props:{record:r[2],size:"tiny"}}),{c(){sn(e.$$.fragment)},m(s,a){nn(e,s,a),t=!0},p(s,a){const u={};a&4&&(u.record=s[2]),e.$set(u)},i(s){t||(Oe(e.$$.fragment,s),t=!0)},o(s){$e(e.$$.fragment,s),t=!1},d(s){on(e,s)}}}function rOe(r){let e,t,s,a,u,f,h=r[4].label+"",g,v,_,A,O,N,L,j,z,q,ee;const F=[sOe,oOe],oe=[];function te(se,X){return se[4].type==="files"?0:1}return t=te(r),s=oe[t]=F[t](r),A=new jV({props:{status:r[2].status}}),j=new i2({props:{name:Dp(r[0],r[2]._sys.updatedBy),side:24}}),{c(){e=ae("td"),s.c(),a=Ze(),u=ae("td"),f=ae("a"),g=Kt(h),v=Ze(),_=ae("td"),sn(A.$$.fragment),O=Ze(),N=ae("td"),L=ae("div"),sn(j.$$.fragment),z=Ze(),q=ae("div"),q.textContent=`${r[5]}`,U(f,"class","text-decoration-none lx-small-text"),U(f,"href",r[3].lucentUrl+"/content/"+r[4].name),U(_,"class","text-center"),U(q,"class","ms-2"),U(L,"class","d-flex")},m(se,X){Ie(se,e,X),oe[t].m(e,null),Ie(se,a,X),Ie(se,u,X),Y(u,f),Y(f,g),Ie(se,v,X),Ie(se,_,X),nn(A,_,null),Ie(se,O,X),Ie(se,N,X),Y(N,L),nn(j,L,null),Y(L,z),Y(L,q),ee=!0},p(se,[X]){s.p(se,X);const we={};X&4&&(we.status=se[2].status),A.$set(we);const ye={};X&5&&(ye.name=Dp(se[0],se[2]._sys.updatedBy)),j.$set(ye)},i(se){ee||(Oe(s),Oe(A.$$.fragment,se),Oe(j.$$.fragment,se),ee=!0)},o(se){$e(s),$e(A.$$.fragment,se),$e(j.$$.fragment,se),ee=!1},d(se){se&&Pe(e),oe[t].d(),se&&Pe(a),se&&Pe(u),se&&Pe(v),se&&Pe(_),on(A),se&&Pe(O),se&&Pe(N),on(j)}}}function iOe(r,e,t){const s=hi("channel");let{users:a}=e,{graph:u}=e,{record:f}=e,h=s.schemas.find(v=>v.name===f.schema),g=Ihe(Bhe(f._sys.updatedAt),{addSuffix:!0});return r.$$set=v=>{"users"in v&&t(0,a=v.users),"graph"in v&&t(1,u=v.graph),"record"in v&&t(2,f=v.record)},[a,u,f,s,h,g]}class aOe extends xo{constructor(e){super(),Ao(this,e,iOe,rOe,Eo,{users:0,graph:1,record:2})}}function cde(r,e,t){const s=r.slice();return s[4]=e[t],s}function ude(r){let e,t,s,a,u=[],f=new Map,h,g=r[0];const v=_=>_[4].id;for(let _=0;_<g.length;_+=1){let A=cde(r,g,_),O=v(A);f.set(O,u[_]=fde(O,A))}return{c(){e=ae("div"),t=ae("div"),s=ae("table"),a=ae("tbody");for(let _=0;_<u.length;_+=1)u[_].c();U(s,"class",""),U(t,"class","lx-table p-0"),U(e,"class","lx-card mb-4")},m(_,A){Ie(_,e,A),Y(e,t),Y(t,s),Y(s,a);for(let O=0;O<u.length;O+=1)u[O]&&u[O].m(a,null);h=!0},p(_,A){A&7&&(g=_[0],So(),u=$h(u,A,v,1,_,g,f,a,gv,fde,null,cde),ko())},i(_){if(!h){for(let A=0;A<g.length;A+=1)Oe(u[A]);h=!0}},o(_){for(let A=0;A<u.length;A+=1)$e(u[A]);h=!1},d(_){_&&Pe(e);for(let A=0;A<u.length;A+=1)u[A].d()}}}function fde(r,e){let t,s,a,u;return s=new aOe({props:{graph:e[1],record:e[4],users:e[2]}}),{key:r,first:null,c(){t=ae("tr"),sn(s.$$.fragment),a=Ze(),this.first=t},m(f,h){Ie(f,t,h),nn(s,t,null),Y(t,a),u=!0},p(f,h){e=f;const g={};h&2&&(g.graph=e[1]),h&1&&(g.record=e[4]),h&4&&(g.users=e[2]),s.$set(g)},i(f){u||(Oe(s.$$.fragment,f),u=!0)},o(f){$e(s.$$.fragment,f),u=!1},d(f){f&&Pe(t),on(s)}}}function lOe(r){let e,t,s,a,u=r[0].length>0&&ude(r);return{c(){e=ae("div"),t=ae("h3"),t.textContent="Latest Content changes",s=Ze(),u&&u.c(),U(t,"class","header-small mb-4 mt-5"),U(e,"class","wrapper-normal transparent")},m(f,h){Ie(f,e,h),Y(e,t),Y(e,s),u&&u.m(e,null),a=!0},p(f,[h]){f[0].length>0?u?(u.p(f,h),h&1&&Oe(u,1)):(u=ude(f),u.c(),Oe(u,1),u.m(e,null)):u&&(So(),$e(u,1,1,()=>{u=null}),ko())},i(f){a||(Oe(u),a=!0)},o(f){$e(u),a=!1},d(f){f&&Pe(e),u&&u.d()}}}function cOe(r,e,t){const s=hi("channel");let a=[],u=null,f=[];return H0(()=>{axios.get(s.lucentUrl+"/home/records").then(h=>{t(0,a=h.data.records),t(1,u=h.data.graph),t(2,f=h.data.users)}).catch(h=>{console.log(h)})}),[a,u,f]}class uOe extends xo{constructor(e){super(),Ao(this,e,cOe,lOe,Eo,{})}}function dde(r){let e;return{c(){e=ae("span"),e.textContent="Build in progress",U(e,"class","badge text-bg-warning")},m(t,s){Ie(t,e,s)},d(t){t&&Pe(e)}}}function hde(r){let e;return{c(){e=ae("span"),e.textContent="Build completed at",U(e,"class","badge text-bg-info")},m(t,s){Ie(t,e,s)},d(t){t&&Pe(e)}}}function fOe(r){let e,t,s,a,u,f,h,g,v,_,A,O,N,L,j,z,q,ee,F=r[1]&&dde(),oe=!r[1]&&r[2]&&hde();return{c(){e=ae("div"),t=ae("div"),s=ae("h3"),a=Kt(r[0]),u=Ze(),f=ae("button"),h=Kt("Start Build"),g=Ze(),v=ae("div"),F&&F.c(),_=Ze(),oe&&oe.c(),A=Ze(),O=ae("span"),N=Kt(r[3]),L=Ze(),j=ae("pre"),z=Kt(r[2]),U(s,"class","header-small mb-5"),U(f,"class","btn btn-outline-primary btn-sm mb-3"),f.disabled=r[1],U(O,"class","badge text-bg-light"),U(v,"class","mb-3"),U(t,"class","lx-card mt-5"),U(e,"class","wrapper-tiny transparent mb-5")},m(te,se){Ie(te,e,se),Y(e,t),Y(t,s),Y(s,a),Y(t,u),Y(t,f),Y(f,h),Y(t,g),Y(t,v),F&&F.m(v,null),Y(v,_),oe&&oe.m(v,null),Y(v,A),Y(v,O),Y(O,N),Y(t,L),Y(t,j),Y(j,z),q||(ee=En(f,"click",r[4]),q=!0)},p(te,[se]){se&1&&jn(a,te[0]),se&2&&(f.disabled=te[1]),te[1]?F||(F=dde(),F.c(),F.m(v,_)):F&&(F.d(1),F=null),!te[1]&&te[2]?oe||(oe=hde(),oe.c(),oe.m(v,A)):oe&&(oe.d(1),oe=null),se&8&&jn(N,te[3]),se&4&&jn(z,te[2])},i:_n,o:_n,d(te){te&&Pe(e),F&&F.d(),oe&&oe.d(),q=!1,ee()}}}function dOe(r,e,t){let s,a;const u=hi("channel");let{title:f}=e,h=!1;function g(){const _=new EventSource(u.lucentUrl+"/build-report-source");_.onmessage=function(A){t(1,h=!0);const O=JSON.parse(A.data);t(3,s=O.date),t(2,a=O.logs)},_.onerror=A=>{console.log(A),_.close(),t(1,h=!1)}}function v(_){_.preventDefault(),t(1,h=!0),axios.post(u.lucentUrl+"/build").then(A=>{g()})}return H0(()=>{g()}),r.$$set=_=>{"title"in _&&t(0,f=_.title)},t(3,s=""),t(2,a=""),[f,h,a,s,v]}class hOe extends xo{constructor(e){super(),Ao(this,e,dOe,fOe,Eo,{title:0})}}function mOe(r){let e,t,s,a,u;e=new nOe({props:{schema:r[2].schema}});const f=[{title:r[0]},r[2]];var h=r[3][r[1]];function g(v){let _={};for(let A=0;A<f.length;A+=1)_=nI(_,f[A]);return{props:_}}return h&&(s=dk(h,g())),{c(){sn(e.$$.fragment),t=Ze(),s&&sn(s.$$.fragment),a=Bs()},m(v,_){nn(e,v,_),Ie(v,t,_),s&&nn(s,v,_),Ie(v,a,_),u=!0},p(v,[_]){const A={};_&4&&(A.schema=v[2].schema),e.$set(A);const O=_&5?UV(f,[_&1&&{title:v[0]},_&4&&WV(v[2])]):{};if(_&2&&h!==(h=v[3][v[1]])){if(s){So();const N=s;$e(N.$$.fragment,1,0,()=>{on(N,1)}),ko()}h?(s=dk(h,g()),sn(s.$$.fragment),Oe(s.$$.fragment,1),nn(s,a.parentNode,a)):s=null}else h&&s.$set(O)},i(v){u||(Oe(e.$$.fragment,v),s&&Oe(s.$$.fragment,v),u=!0)},o(v){$e(e.$$.fragment,v),s&&$e(s.$$.fragment,v),u=!1},d(v){on(e,v),v&&Pe(t),v&&Pe(a),s&&on(s,v)}}}function gOe(r,e,t){const s={members:Ave,recordEdit:qDe,recordNotFound:Tve,contentIndex:Khe,homeIndex:uOe,buildReport:hOe};let{title:a}=e,{view:u}=e,{user:f}=e,{data:h}=e,{channel:g}=e;return Qz("channel",g),Qz("user",f),r.$$set=v=>{"title"in v&&t(0,a=v.title),"view"in v&&t(1,u=v.view),"user"in v&&t(4,f=v.user),"data"in v&&t(2,h=v.data),"channel"in v&&t(5,g=v.channel)},[a,u,h,s,f,g]}class pOe extends xo{constructor(e){super(),Ao(this,e,gOe,mOe,Eo,{title:0,view:1,user:4,data:2,channel:5})}}var Dg="top",P1="bottom",I1="right",Og="left",uU="auto",kO=[Dg,P1,I1,Og],Xx="start",uO="end",w1e="clippingParents",use="viewport",FD="popper",_1e="reference",poe=kO.reduce(function(r,e){return r.concat([e+"-"+Xx,e+"-"+uO])},[]),fse=[].concat(kO,[uU]).reduce(function(r,e){return r.concat([e,e+"-"+Xx,e+"-"+uO])},[]),C1e="beforeRead",S1e="read",k1e="afterRead",E1e="beforeMain",A1e="main",x1e="afterMain",T1e="beforeWrite",D1e="write",O1e="afterWrite",M1e=[C1e,S1e,k1e,E1e,A1e,x1e,T1e,D1e,O1e];function u2(r){return r?(r.nodeName||"").toLowerCase():null}function B1(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Jx(r){var e=B1(r).Element;return r instanceof e||r instanceof Element}function I0(r){var e=B1(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function dse(r){if(typeof ShadowRoot>"u")return!1;var e=B1(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function bOe(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},a=e.attributes[t]||{},u=e.elements[t];!I0(u)||!u2(u)||(Object.assign(u.style,s),Object.keys(a).forEach(function(f){var h=a[f];h===!1?u.removeAttribute(f):u.setAttribute(f,h===!0?"":h)}))})}function vOe(r){var e=r.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var a=e.elements[s],u=e.attributes[s]||{},f=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),h=f.reduce(function(g,v){return g[v]="",g},{});!I0(a)||!u2(a)||(Object.assign(a.style,h),Object.keys(u).forEach(function(g){a.removeAttribute(g)}))})}}const hse={name:"applyStyles",enabled:!0,phase:"write",fn:bOe,effect:vOe,requires:["computeStyles"]};function s2(r){return r.split("-")[0]}var qx=Math.max,IV=Math.min,fO=Math.round;function boe(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function R1e(){return!/^((?!chrome|android).)*safari/i.test(boe())}function dO(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=r.getBoundingClientRect(),a=1,u=1;e&&I0(r)&&(a=r.offsetWidth>0&&fO(s.width)/r.offsetWidth||1,u=r.offsetHeight>0&&fO(s.height)/r.offsetHeight||1);var f=Jx(r)?B1(r):window,h=f.visualViewport,g=!R1e()&&t,v=(s.left+(g&&h?h.offsetLeft:0))/a,_=(s.top+(g&&h?h.offsetTop:0))/u,A=s.width/a,O=s.height/u;return{width:A,height:O,top:_,right:v+A,bottom:_+O,left:v,x:v,y:_}}function mse(r){var e=dO(r),t=r.offsetWidth,s=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:s}}function N1e(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&dse(t)){var s=e;do{if(s&&r.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function N_(r){return B1(r).getComputedStyle(r)}function yOe(r){return["table","td","th"].indexOf(u2(r))>=0}function Ek(r){return((Jx(r)?r.ownerDocument:r.document)||window.document).documentElement}function fU(r){return u2(r)==="html"?r:r.assignedSlot||r.parentNode||(dse(r)?r.host:null)||Ek(r)}function mde(r){return!I0(r)||N_(r).position==="fixed"?null:r.offsetParent}function wOe(r){var e=/firefox/i.test(boe()),t=/Trident/i.test(boe());if(t&&I0(r)){var s=N_(r);if(s.position==="fixed")return null}var a=fU(r);for(dse(a)&&(a=a.host);I0(a)&&["html","body"].indexOf(u2(a))<0;){var u=N_(a);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||e&&u.willChange==="filter"||e&&u.filter&&u.filter!=="none")return a;a=a.parentNode}return null}function yI(r){for(var e=B1(r),t=mde(r);t&&yOe(t)&&N_(t).position==="static";)t=mde(t);return t&&(u2(t)==="html"||u2(t)==="body"&&N_(t).position==="static")?e:t||wOe(r)||e}function gse(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function NP(r,e,t){return qx(r,IV(e,t))}function _Oe(r,e,t){var s=NP(r,e,t);return s>t?t:s}function P1e(){return{top:0,right:0,bottom:0,left:0}}function I1e(r){return Object.assign({},P1e(),r)}function B1e(r,e){return e.reduce(function(t,s){return t[s]=r,t},{})}var COe=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,I1e(typeof e!="number"?e:B1e(e,kO))};function SOe(r){var e,t=r.state,s=r.name,a=r.options,u=t.elements.arrow,f=t.modifiersData.popperOffsets,h=s2(t.placement),g=gse(h),v=[Og,I1].indexOf(h)>=0,_=v?"height":"width";if(!(!u||!f)){var A=COe(a.padding,t),O=mse(u),N=g==="y"?Dg:Og,L=g==="y"?P1:I1,j=t.rects.reference[_]+t.rects.reference[g]-f[g]-t.rects.popper[_],z=f[g]-t.rects.reference[g],q=yI(u),ee=q?g==="y"?q.clientHeight||0:q.clientWidth||0:0,F=j/2-z/2,oe=A[N],te=ee-O[_]-A[L],se=ee/2-O[_]/2+F,X=NP(oe,se,te),we=g;t.modifiersData[s]=(e={},e[we]=X,e.centerOffset=X-se,e)}}function kOe(r){var e=r.state,t=r.options,s=t.element,a=s===void 0?"[data-popper-arrow]":s;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!N1e(e.elements.popper,a)||(e.elements.arrow=a))}const L1e={name:"arrow",enabled:!0,phase:"main",fn:SOe,effect:kOe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hO(r){return r.split("-")[1]}var EOe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AOe(r,e){var t=r.x,s=r.y,a=e.devicePixelRatio||1;return{x:fO(t*a)/a||0,y:fO(s*a)/a||0}}function gde(r){var e,t=r.popper,s=r.popperRect,a=r.placement,u=r.variation,f=r.offsets,h=r.position,g=r.gpuAcceleration,v=r.adaptive,_=r.roundOffsets,A=r.isFixed,O=f.x,N=O===void 0?0:O,L=f.y,j=L===void 0?0:L,z=typeof _=="function"?_({x:N,y:j}):{x:N,y:j};N=z.x,j=z.y;var q=f.hasOwnProperty("x"),ee=f.hasOwnProperty("y"),F=Og,oe=Dg,te=window;if(v){var se=yI(t),X="clientHeight",we="clientWidth";if(se===B1(t)&&(se=Ek(t),N_(se).position!=="static"&&h==="absolute"&&(X="scrollHeight",we="scrollWidth")),se=se,a===Dg||(a===Og||a===I1)&&u===uO){oe=P1;var ye=A&&se===te&&te.visualViewport?te.visualViewport.height:se[X];j-=ye-s.height,j*=g?1:-1}if(a===Og||(a===Dg||a===P1)&&u===uO){F=I1;var Te=A&&se===te&&te.visualViewport?te.visualViewport.width:se[we];N-=Te-s.width,N*=g?1:-1}}var _e=Object.assign({position:h},v&&EOe),ge=_===!0?AOe({x:N,y:j},B1(t)):{x:N,y:j};if(N=ge.x,j=ge.y,g){var nt;return Object.assign({},_e,(nt={},nt[oe]=ee?"0":"",nt[F]=q?"0":"",nt.transform=(te.devicePixelRatio||1)<=1?"translate("+N+"px, "+j+"px)":"translate3d("+N+"px, "+j+"px, 0)",nt))}return Object.assign({},_e,(e={},e[oe]=ee?j+"px":"",e[F]=q?N+"px":"",e.transform="",e))}function xOe(r){var e=r.state,t=r.options,s=t.gpuAcceleration,a=s===void 0?!0:s,u=t.adaptive,f=u===void 0?!0:u,h=t.roundOffsets,g=h===void 0?!0:h,v={placement:s2(e.placement),variation:hO(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gde(Object.assign({},v,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:f,roundOffsets:g})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gde(Object.assign({},v,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:g})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const pse={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xOe,data:{}};var vz={passive:!0};function TOe(r){var e=r.state,t=r.instance,s=r.options,a=s.scroll,u=a===void 0?!0:a,f=s.resize,h=f===void 0?!0:f,g=B1(e.elements.popper),v=[].concat(e.scrollParents.reference,e.scrollParents.popper);return u&&v.forEach(function(_){_.addEventListener("scroll",t.update,vz)}),h&&g.addEventListener("resize",t.update,vz),function(){u&&v.forEach(function(_){_.removeEventListener("scroll",t.update,vz)}),h&&g.removeEventListener("resize",t.update,vz)}}const bse={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:TOe,data:{}};var DOe={left:"right",right:"left",bottom:"top",top:"bottom"};function qz(r){return r.replace(/left|right|bottom|top/g,function(e){return DOe[e]})}var OOe={start:"end",end:"start"};function pde(r){return r.replace(/start|end/g,function(e){return OOe[e]})}function vse(r){var e=B1(r),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function yse(r){return dO(Ek(r)).left+vse(r).scrollLeft}function MOe(r,e){var t=B1(r),s=Ek(r),a=t.visualViewport,u=s.clientWidth,f=s.clientHeight,h=0,g=0;if(a){u=a.width,f=a.height;var v=R1e();(v||!v&&e==="fixed")&&(h=a.offsetLeft,g=a.offsetTop)}return{width:u,height:f,x:h+yse(r),y:g}}function ROe(r){var e,t=Ek(r),s=vse(r),a=(e=r.ownerDocument)==null?void 0:e.body,u=qx(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),f=qx(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),h=-s.scrollLeft+yse(r),g=-s.scrollTop;return N_(a||t).direction==="rtl"&&(h+=qx(t.clientWidth,a?a.clientWidth:0)-u),{width:u,height:f,x:h,y:g}}function wse(r){var e=N_(r),t=e.overflow,s=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+s)}function F1e(r){return["html","body","#document"].indexOf(u2(r))>=0?r.ownerDocument.body:I0(r)&&wse(r)?r:F1e(fU(r))}function PP(r,e){var t;e===void 0&&(e=[]);var s=F1e(r),a=s===((t=r.ownerDocument)==null?void 0:t.body),u=B1(s),f=a?[u].concat(u.visualViewport||[],wse(s)?s:[]):s,h=e.concat(f);return a?h:h.concat(PP(fU(f)))}function voe(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function NOe(r,e){var t=dO(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function bde(r,e,t){return e===use?voe(MOe(r,t)):Jx(e)?NOe(e,t):voe(ROe(Ek(r)))}function POe(r){var e=PP(fU(r)),t=["absolute","fixed"].indexOf(N_(r).position)>=0,s=t&&I0(r)?yI(r):r;return Jx(s)?e.filter(function(a){return Jx(a)&&N1e(a,s)&&u2(a)!=="body"}):[]}function IOe(r,e,t,s){var a=e==="clippingParents"?POe(r):[].concat(e),u=[].concat(a,[t]),f=u[0],h=u.reduce(function(g,v){var _=bde(r,v,s);return g.top=qx(_.top,g.top),g.right=IV(_.right,g.right),g.bottom=IV(_.bottom,g.bottom),g.left=qx(_.left,g.left),g},bde(r,f,s));return h.width=h.right-h.left,h.height=h.bottom-h.top,h.x=h.left,h.y=h.top,h}function H1e(r){var e=r.reference,t=r.element,s=r.placement,a=s?s2(s):null,u=s?hO(s):null,f=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,g;switch(a){case Dg:g={x:f,y:e.y-t.height};break;case P1:g={x:f,y:e.y+e.height};break;case I1:g={x:e.x+e.width,y:h};break;case Og:g={x:e.x-t.width,y:h};break;default:g={x:e.x,y:e.y}}var v=a?gse(a):null;if(v!=null){var _=v==="y"?"height":"width";switch(u){case Xx:g[v]=g[v]-(e[_]/2-t[_]/2);break;case uO:g[v]=g[v]+(e[_]/2-t[_]/2);break}}return g}function mO(r,e){e===void 0&&(e={});var t=e,s=t.placement,a=s===void 0?r.placement:s,u=t.strategy,f=u===void 0?r.strategy:u,h=t.boundary,g=h===void 0?w1e:h,v=t.rootBoundary,_=v===void 0?use:v,A=t.elementContext,O=A===void 0?FD:A,N=t.altBoundary,L=N===void 0?!1:N,j=t.padding,z=j===void 0?0:j,q=I1e(typeof z!="number"?z:B1e(z,kO)),ee=O===FD?_1e:FD,F=r.rects.popper,oe=r.elements[L?ee:O],te=IOe(Jx(oe)?oe:oe.contextElement||Ek(r.elements.popper),g,_,f),se=dO(r.elements.reference),X=H1e({reference:se,element:F,strategy:"absolute",placement:a}),we=voe(Object.assign({},F,X)),ye=O===FD?we:se,Te={top:te.top-ye.top+q.top,bottom:ye.bottom-te.bottom+q.bottom,left:te.left-ye.left+q.left,right:ye.right-te.right+q.right},_e=r.modifiersData.offset;if(O===FD&&_e){var ge=_e[a];Object.keys(Te).forEach(function(nt){var Je=[I1,P1].indexOf(nt)>=0?1:-1,ft=[Dg,P1].indexOf(nt)>=0?"y":"x";Te[nt]+=ge[ft]*Je})}return Te}function BOe(r,e){e===void 0&&(e={});var t=e,s=t.placement,a=t.boundary,u=t.rootBoundary,f=t.padding,h=t.flipVariations,g=t.allowedAutoPlacements,v=g===void 0?fse:g,_=hO(s),A=_?h?poe:poe.filter(function(L){return hO(L)===_}):kO,O=A.filter(function(L){return v.indexOf(L)>=0});O.length===0&&(O=A);var N=O.reduce(function(L,j){return L[j]=mO(r,{placement:j,boundary:a,rootBoundary:u,padding:f})[s2(j)],L},{});return Object.keys(N).sort(function(L,j){return N[L]-N[j]})}function LOe(r){if(s2(r)===uU)return[];var e=qz(r);return[pde(r),e,pde(e)]}function FOe(r){var e=r.state,t=r.options,s=r.name;if(!e.modifiersData[s]._skip){for(var a=t.mainAxis,u=a===void 0?!0:a,f=t.altAxis,h=f===void 0?!0:f,g=t.fallbackPlacements,v=t.padding,_=t.boundary,A=t.rootBoundary,O=t.altBoundary,N=t.flipVariations,L=N===void 0?!0:N,j=t.allowedAutoPlacements,z=e.options.placement,q=s2(z),ee=q===z,F=g||(ee||!L?[qz(z)]:LOe(z)),oe=[z].concat(F).reduce(function(kt,bn){return kt.concat(s2(bn)===uU?BOe(e,{placement:bn,boundary:_,rootBoundary:A,padding:v,flipVariations:L,allowedAutoPlacements:j}):bn)},[]),te=e.rects.reference,se=e.rects.popper,X=new Map,we=!0,ye=oe[0],Te=0;Te<oe.length;Te++){var _e=oe[Te],ge=s2(_e),nt=hO(_e)===Xx,Je=[Dg,P1].indexOf(ge)>=0,ft=Je?"width":"height",V=mO(e,{placement:_e,boundary:_,rootBoundary:A,altBoundary:O,padding:v}),ut=Je?nt?I1:Og:nt?P1:Dg;te[ft]>se[ft]&&(ut=qz(ut));var et=qz(ut),Et=[];if(u&&Et.push(V[ge]<=0),h&&Et.push(V[ut]<=0,V[et]<=0),Et.every(function(kt){return kt})){ye=_e,we=!1;break}X.set(_e,Et)}if(we)for(var xt=L?3:1,He=function(bn){var qe=oe.find(function(gt){var de=X.get(gt);if(de)return de.slice(0,bn).every(function(No){return No})});if(qe)return ye=qe,"break"},ct=xt;ct>0;ct--){var an=He(ct);if(an==="break")break}e.placement!==ye&&(e.modifiersData[s]._skip=!0,e.placement=ye,e.reset=!0)}}const $1e={name:"flip",enabled:!0,phase:"main",fn:FOe,requiresIfExists:["offset"],data:{_skip:!1}};function vde(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function yde(r){return[Dg,I1,P1,Og].some(function(e){return r[e]>=0})}function HOe(r){var e=r.state,t=r.name,s=e.rects.reference,a=e.rects.popper,u=e.modifiersData.preventOverflow,f=mO(e,{elementContext:"reference"}),h=mO(e,{altBoundary:!0}),g=vde(f,s),v=vde(h,a,u),_=yde(g),A=yde(v);e.modifiersData[t]={referenceClippingOffsets:g,popperEscapeOffsets:v,isReferenceHidden:_,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":_,"data-popper-escaped":A})}const z1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:HOe};function $Oe(r,e,t){var s=s2(r),a=[Og,Dg].indexOf(s)>=0?-1:1,u=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,f=u[0],h=u[1];return f=f||0,h=(h||0)*a,[Og,I1].indexOf(s)>=0?{x:h,y:f}:{x:f,y:h}}function zOe(r){var e=r.state,t=r.options,s=r.name,a=t.offset,u=a===void 0?[0,0]:a,f=fse.reduce(function(_,A){return _[A]=$Oe(A,e.rects,u),_},{}),h=f[e.placement],g=h.x,v=h.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=g,e.modifiersData.popperOffsets.y+=v),e.modifiersData[s]=f}const V1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zOe};function VOe(r){var e=r.state,t=r.name;e.modifiersData[t]=H1e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const _se={name:"popperOffsets",enabled:!0,phase:"read",fn:VOe,data:{}};function UOe(r){return r==="x"?"y":"x"}function WOe(r){var e=r.state,t=r.options,s=r.name,a=t.mainAxis,u=a===void 0?!0:a,f=t.altAxis,h=f===void 0?!1:f,g=t.boundary,v=t.rootBoundary,_=t.altBoundary,A=t.padding,O=t.tether,N=O===void 0?!0:O,L=t.tetherOffset,j=L===void 0?0:L,z=mO(e,{boundary:g,rootBoundary:v,padding:A,altBoundary:_}),q=s2(e.placement),ee=hO(e.placement),F=!ee,oe=gse(q),te=UOe(oe),se=e.modifiersData.popperOffsets,X=e.rects.reference,we=e.rects.popper,ye=typeof j=="function"?j(Object.assign({},e.rects,{placement:e.placement})):j,Te=typeof ye=="number"?{mainAxis:ye,altAxis:ye}:Object.assign({mainAxis:0,altAxis:0},ye),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ge={x:0,y:0};if(!!se){if(u){var nt,Je=oe==="y"?Dg:Og,ft=oe==="y"?P1:I1,V=oe==="y"?"height":"width",ut=se[oe],et=ut+z[Je],Et=ut-z[ft],xt=N?-we[V]/2:0,He=ee===Xx?X[V]:we[V],ct=ee===Xx?-we[V]:-X[V],an=e.elements.arrow,kt=N&&an?mse(an):{width:0,height:0},bn=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:P1e(),qe=bn[Je],gt=bn[ft],de=NP(0,X[V],kt[V]),No=F?X[V]/2-xt-de-qe-Te.mainAxis:He-de-qe-Te.mainAxis,Zn=F?-X[V]/2+xt+de+gt+Te.mainAxis:ct+de+gt+Te.mainAxis,Bn=e.elements.arrow&&yI(e.elements.arrow),ao=Bn?oe==="y"?Bn.clientTop||0:Bn.clientLeft||0:0,Wo=(nt=_e==null?void 0:_e[oe])!=null?nt:0,St=ut+No-Wo-ao,Xt=ut+Zn-Wo,Tt=NP(N?IV(et,St):et,ut,N?qx(Et,Xt):Et);se[oe]=Tt,ge[oe]=Tt-ut}if(h){var Be,Ut=oe==="x"?Dg:Og,gn=oe==="x"?P1:I1,wt=se[te],Yt=te==="y"?"height":"width",vn=wt+z[Ut],rs=wt-z[gn],eo=[Dg,Og].indexOf(q)!==-1,ds=(Be=_e==null?void 0:_e[te])!=null?Be:0,Or=eo?vn:wt-X[Yt]-we[Yt]-ds+Te.altAxis,Rs=eo?wt+X[Yt]+we[Yt]-ds-Te.altAxis:rs,Js=N&&eo?_Oe(Or,wt,Rs):NP(N?Or:vn,wt,N?Rs:rs);se[te]=Js,ge[te]=Js-wt}e.modifiersData[s]=ge}}const U1e={name:"preventOverflow",enabled:!0,phase:"main",fn:WOe,requiresIfExists:["offset"]};function jOe(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function ZOe(r){return r===B1(r)||!I0(r)?vse(r):jOe(r)}function qOe(r){var e=r.getBoundingClientRect(),t=fO(e.width)/r.offsetWidth||1,s=fO(e.height)/r.offsetHeight||1;return t!==1||s!==1}function GOe(r,e,t){t===void 0&&(t=!1);var s=I0(e),a=I0(e)&&qOe(e),u=Ek(e),f=dO(r,a,t),h={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(s||!s&&!t)&&((u2(e)!=="body"||wse(u))&&(h=ZOe(e)),I0(e)?(g=dO(e,!0),g.x+=e.clientLeft,g.y+=e.clientTop):u&&(g.x=yse(u))),{x:f.left+h.scrollLeft-g.x,y:f.top+h.scrollTop-g.y,width:f.width,height:f.height}}function KOe(r){var e=new Map,t=new Set,s=[];r.forEach(function(u){e.set(u.name,u)});function a(u){t.add(u.name);var f=[].concat(u.requires||[],u.requiresIfExists||[]);f.forEach(function(h){if(!t.has(h)){var g=e.get(h);g&&a(g)}}),s.push(u)}return r.forEach(function(u){t.has(u.name)||a(u)}),s}function YOe(r){var e=KOe(r);return M1e.reduce(function(t,s){return t.concat(e.filter(function(a){return a.phase===s}))},[])}function XOe(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function JOe(r){var e=r.reduce(function(t,s){var a=t[s.name];return t[s.name]=a?Object.assign({},a,s,{options:Object.assign({},a.options,s.options),data:Object.assign({},a.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var wde={placement:"bottom",modifiers:[],strategy:"absolute"};function _de(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function dU(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,s=t===void 0?[]:t,a=e.defaultOptions,u=a===void 0?wde:a;return function(h,g,v){v===void 0&&(v=u);var _={placement:"bottom",orderedModifiers:[],options:Object.assign({},wde,u),modifiersData:{},elements:{reference:h,popper:g},attributes:{},styles:{}},A=[],O=!1,N={state:_,setOptions:function(q){var ee=typeof q=="function"?q(_.options):q;j(),_.options=Object.assign({},u,_.options,ee),_.scrollParents={reference:Jx(h)?PP(h):h.contextElement?PP(h.contextElement):[],popper:PP(g)};var F=YOe(JOe([].concat(s,_.options.modifiers)));return _.orderedModifiers=F.filter(function(oe){return oe.enabled}),L(),N.update()},forceUpdate:function(){if(!O){var q=_.elements,ee=q.reference,F=q.popper;if(!!_de(ee,F)){_.rects={reference:GOe(ee,yI(F),_.options.strategy==="fixed"),popper:mse(F)},_.reset=!1,_.placement=_.options.placement,_.orderedModifiers.forEach(function(Te){return _.modifiersData[Te.name]=Object.assign({},Te.data)});for(var oe=0;oe<_.orderedModifiers.length;oe++){if(_.reset===!0){_.reset=!1,oe=-1;continue}var te=_.orderedModifiers[oe],se=te.fn,X=te.options,we=X===void 0?{}:X,ye=te.name;typeof se=="function"&&(_=se({state:_,options:we,name:ye,instance:N})||_)}}}},update:XOe(function(){return new Promise(function(z){N.forceUpdate(),z(_)})}),destroy:function(){j(),O=!0}};if(!_de(h,g))return N;N.setOptions(v).then(function(z){!O&&v.onFirstUpdate&&v.onFirstUpdate(z)});function L(){_.orderedModifiers.forEach(function(z){var q=z.name,ee=z.options,F=ee===void 0?{}:ee,oe=z.effect;if(typeof oe=="function"){var te=oe({state:_,name:q,instance:N,options:F}),se=function(){};A.push(te||se)}})}function j(){A.forEach(function(z){return z()}),A=[]}return N}}var QOe=dU(),eMe=[bse,_se,pse,hse],tMe=dU({defaultModifiers:eMe}),nMe=[bse,_se,pse,hse,V1e,$1e,U1e,L1e,z1e],Cse=dU({defaultModifiers:nMe});const W1e=Object.freeze(Object.defineProperty({__proto__:null,popperGenerator:dU,detectOverflow:mO,createPopperBase:QOe,createPopper:Cse,createPopperLite:tMe,top:Dg,bottom:P1,right:I1,left:Og,auto:uU,basePlacements:kO,start:Xx,end:uO,clippingParents:w1e,viewport:use,popper:FD,reference:_1e,variationPlacements:poe,placements:fse,beforeRead:C1e,read:S1e,afterRead:k1e,beforeMain:E1e,main:A1e,afterMain:x1e,beforeWrite:T1e,write:D1e,afterWrite:O1e,modifierPhases:M1e,applyStyles:hse,arrow:L1e,computeStyles:pse,eventListeners:bse,flip:$1e,hide:z1e,offset:V1e,popperOffsets:_se,preventOverflow:U1e},Symbol.toStringTag,{value:"Module"}));/*!
|
|
* Bootstrap v5.3.2 (https://getbootstrap.com/)
|
|
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
*/const QS=new Map,Xte={set(r,e,t){QS.has(r)||QS.set(r,new Map);const s=QS.get(r);if(!s.has(e)&&s.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`);return}s.set(e,t)},get(r,e){return QS.has(r)&&QS.get(r).get(e)||null},remove(r,e){if(!QS.has(r))return;const t=QS.get(r);t.delete(e),t.size===0&&QS.delete(r)}},oMe=1e6,sMe=1e3,yoe="transitionend",j1e=r=>(r&&window.CSS&&window.CSS.escape&&(r=r.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),r),rMe=r=>r==null?`${r}`:Object.prototype.toString.call(r).match(/\s([a-z]+)/i)[1].toLowerCase(),iMe=r=>{do r+=Math.floor(Math.random()*oMe);while(document.getElementById(r));return r},aMe=r=>{if(!r)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(r);const s=Number.parseFloat(e),a=Number.parseFloat(t);return!s&&!a?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*sMe)},Z1e=r=>{r.dispatchEvent(new Event(yoe))},x_=r=>!r||typeof r!="object"?!1:(typeof r.jquery<"u"&&(r=r[0]),typeof r.nodeType<"u"),yk=r=>x_(r)?r.jquery?r[0]:r:typeof r=="string"&&r.length>0?document.querySelector(j1e(r)):null,EO=r=>{if(!x_(r)||r.getClientRects().length===0)return!1;const e=getComputedStyle(r).getPropertyValue("visibility")==="visible",t=r.closest("details:not([open])");if(!t)return e;if(t!==r){const s=r.closest("summary");if(s&&s.parentNode!==t||s===null)return!1}return e},wk=r=>!r||r.nodeType!==Node.ELEMENT_NODE||r.classList.contains("disabled")?!0:typeof r.disabled<"u"?r.disabled:r.hasAttribute("disabled")&&r.getAttribute("disabled")!=="false",q1e=r=>{if(!document.documentElement.attachShadow)return null;if(typeof r.getRootNode=="function"){const e=r.getRootNode();return e instanceof ShadowRoot?e:null}return r instanceof ShadowRoot?r:r.parentNode?q1e(r.parentNode):null},BV=()=>{},wI=r=>{r.offsetHeight},G1e=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Jte=[],lMe=r=>{document.readyState==="loading"?(Jte.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of Jte)e()}),Jte.push(r)):r()},L0=()=>document.documentElement.dir==="rtl",V0=r=>{lMe(()=>{const e=G1e();if(e){const t=r.NAME,s=e.fn[t];e.fn[t]=r.jQueryInterface,e.fn[t].Constructor=r,e.fn[t].noConflict=()=>(e.fn[t]=s,r.jQueryInterface)}})},Tp=(r,e=[],t=r)=>typeof r=="function"?r(...e):t,K1e=(r,e,t=!0)=>{if(!t){Tp(r);return}const s=5,a=aMe(e)+s;let u=!1;const f=({target:h})=>{h===e&&(u=!0,e.removeEventListener(yoe,f),Tp(r))};e.addEventListener(yoe,f),setTimeout(()=>{u||Z1e(e)},a)},Sse=(r,e,t,s)=>{const a=r.length;let u=r.indexOf(e);return u===-1?!t&&s?r[a-1]:r[0]:(u+=t?1:-1,s&&(u=(u+a)%a),r[Math.max(0,Math.min(u,a-1))])},cMe=/[^.]*(?=\..*)\.|.*/,uMe=/\..*/,fMe=/::\d+$/,Qte={};let Cde=1;const Y1e={mouseenter:"mouseover",mouseleave:"mouseout"},dMe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function X1e(r,e){return e&&`${e}::${Cde++}`||r.uidEvent||Cde++}function J1e(r){const e=X1e(r);return r.uidEvent=e,Qte[e]=Qte[e]||{},Qte[e]}function hMe(r,e){return function t(s){return kse(s,{delegateTarget:r}),t.oneOff&&io.off(r,s.type,e),e.apply(r,[s])}}function mMe(r,e,t){return function s(a){const u=r.querySelectorAll(e);for(let{target:f}=a;f&&f!==this;f=f.parentNode)for(const h of u)if(h===f)return kse(a,{delegateTarget:f}),s.oneOff&&io.off(r,a.type,e,t),t.apply(f,[a])}}function Q1e(r,e,t=null){return Object.values(r).find(s=>s.callable===e&&s.delegationSelector===t)}function e0e(r,e,t){const s=typeof e=="string",a=s?t:e||t;let u=t0e(r);return dMe.has(u)||(u=r),[s,a,u]}function Sde(r,e,t,s,a){if(typeof e!="string"||!r)return;let[u,f,h]=e0e(e,t,s);e in Y1e&&(f=(L=>function(j){if(!j.relatedTarget||j.relatedTarget!==j.delegateTarget&&!j.delegateTarget.contains(j.relatedTarget))return L.call(this,j)})(f));const g=J1e(r),v=g[h]||(g[h]={}),_=Q1e(v,f,u?t:null);if(_){_.oneOff=_.oneOff&&a;return}const A=X1e(f,e.replace(cMe,"")),O=u?mMe(r,t,f):hMe(r,f);O.delegationSelector=u?t:null,O.callable=f,O.oneOff=a,O.uidEvent=A,v[A]=O,r.addEventListener(h,O,u)}function woe(r,e,t,s,a){const u=Q1e(e[t],s,a);!u||(r.removeEventListener(t,u,Boolean(a)),delete e[t][u.uidEvent])}function gMe(r,e,t,s){const a=e[t]||{};for(const[u,f]of Object.entries(a))u.includes(s)&&woe(r,e,t,f.callable,f.delegationSelector)}function t0e(r){return r=r.replace(uMe,""),Y1e[r]||r}const io={on(r,e,t,s){Sde(r,e,t,s,!1)},one(r,e,t,s){Sde(r,e,t,s,!0)},off(r,e,t,s){if(typeof e!="string"||!r)return;const[a,u,f]=e0e(e,t,s),h=f!==e,g=J1e(r),v=g[f]||{},_=e.startsWith(".");if(typeof u<"u"){if(!Object.keys(v).length)return;woe(r,g,f,u,a?t:null);return}if(_)for(const A of Object.keys(g))gMe(r,g,A,e.slice(1));for(const[A,O]of Object.entries(v)){const N=A.replace(fMe,"");(!h||e.includes(N))&&woe(r,g,f,O.callable,O.delegationSelector)}},trigger(r,e,t){if(typeof e!="string"||!r)return null;const s=G1e(),a=t0e(e),u=e!==a;let f=null,h=!0,g=!0,v=!1;u&&s&&(f=s.Event(e,t),s(r).trigger(f),h=!f.isPropagationStopped(),g=!f.isImmediatePropagationStopped(),v=f.isDefaultPrevented());const _=kse(new Event(e,{bubbles:h,cancelable:!0}),t);return v&&_.preventDefault(),g&&r.dispatchEvent(_),_.defaultPrevented&&f&&f.preventDefault(),_}};function kse(r,e={}){for(const[t,s]of Object.entries(e))try{r[t]=s}catch{Object.defineProperty(r,t,{configurable:!0,get(){return s}})}return r}function kde(r){if(r==="true")return!0;if(r==="false")return!1;if(r===Number(r).toString())return Number(r);if(r===""||r==="null")return null;if(typeof r!="string")return r;try{return JSON.parse(decodeURIComponent(r))}catch{return r}}function ene(r){return r.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const T_={setDataAttribute(r,e,t){r.setAttribute(`data-bs-${ene(e)}`,t)},removeDataAttribute(r,e){r.removeAttribute(`data-bs-${ene(e)}`)},getDataAttributes(r){if(!r)return{};const e={},t=Object.keys(r.dataset).filter(s=>s.startsWith("bs")&&!s.startsWith("bsConfig"));for(const s of t){let a=s.replace(/^bs/,"");a=a.charAt(0).toLowerCase()+a.slice(1,a.length),e[a]=kde(r.dataset[s])}return e},getDataAttribute(r,e){return kde(r.getAttribute(`data-bs-${ene(e)}`))}};class _I{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const s=x_(t)?T_.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof s=="object"?s:{},...x_(t)?T_.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[s,a]of Object.entries(t)){const u=e[s],f=x_(u)?"element":rMe(u);if(!new RegExp(a).test(f))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${f}" but expected type "${a}".`)}}}const pMe="5.3.2";class vv extends _I{constructor(e,t){super(),e=yk(e),e&&(this._element=e,this._config=this._getConfig(t),Xte.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Xte.remove(this._element,this.constructor.DATA_KEY),io.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,s=!0){K1e(e,t,s)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Xte.get(yk(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return pMe}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const tne=r=>{let e=r.getAttribute("data-bs-target");if(!e||e==="#"){let t=r.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?j1e(t.trim()):null}return e},mr={find(r,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,r))},findOne(r,e=document.documentElement){return Element.prototype.querySelector.call(e,r)},children(r,e){return[].concat(...r.children).filter(t=>t.matches(e))},parents(r,e){const t=[];let s=r.parentNode.closest(e);for(;s;)t.push(s),s=s.parentNode.closest(e);return t},prev(r,e){let t=r.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(r,e){let t=r.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(r){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,r).filter(t=>!wk(t)&&EO(t))},getSelectorFromElement(r){const e=tne(r);return e&&mr.findOne(e)?e:null},getElementFromSelector(r){const e=tne(r);return e?mr.findOne(e):null},getMultipleElementsFromSelector(r){const e=tne(r);return e?mr.find(e):[]}},hU=(r,e="hide")=>{const t=`click.dismiss${r.EVENT_KEY}`,s=r.NAME;io.on(document,t,`[data-bs-dismiss="${s}"]`,function(a){if(["A","AREA"].includes(this.tagName)&&a.preventDefault(),wk(this))return;const u=mr.getElementFromSelector(this)||this.closest(`.${s}`);r.getOrCreateInstance(u)[e]()})},bMe="alert",vMe="bs.alert",n0e=`.${vMe}`,yMe=`close${n0e}`,wMe=`closed${n0e}`,_Me="fade",CMe="show";class mU extends vv{static get NAME(){return bMe}close(){if(io.trigger(this._element,yMe).defaultPrevented)return;this._element.classList.remove(CMe);const t=this._element.classList.contains(_Me);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),io.trigger(this._element,wMe),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=mU.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}hU(mU,"close");V0(mU);const SMe="button",kMe="bs.button",EMe=`.${kMe}`,AMe=".data-api",xMe="active",Ede='[data-bs-toggle="button"]',TMe=`click${EMe}${AMe}`;class gU extends vv{static get NAME(){return SMe}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(xMe))}static jQueryInterface(e){return this.each(function(){const t=gU.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}io.on(document,TMe,Ede,r=>{r.preventDefault();const e=r.target.closest(Ede);gU.getOrCreateInstance(e).toggle()});V0(gU);const DMe="swipe",AO=".bs.swipe",OMe=`touchstart${AO}`,MMe=`touchmove${AO}`,RMe=`touchend${AO}`,NMe=`pointerdown${AO}`,PMe=`pointerup${AO}`,IMe="touch",BMe="pen",LMe="pointer-event",FMe=40,HMe={endCallback:null,leftCallback:null,rightCallback:null},$Me={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class LV extends _I{constructor(e,t){super(),this._element=e,!(!e||!LV.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return HMe}static get DefaultType(){return $Me}static get NAME(){return DMe}dispose(){io.off(this._element,AO)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Tp(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=FMe)return;const t=e/this._deltaX;this._deltaX=0,t&&Tp(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(io.on(this._element,NMe,e=>this._start(e)),io.on(this._element,PMe,e=>this._end(e)),this._element.classList.add(LMe)):(io.on(this._element,OMe,e=>this._start(e)),io.on(this._element,MMe,e=>this._move(e)),io.on(this._element,RMe,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===BMe||e.pointerType===IMe)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const zMe="carousel",VMe="bs.carousel",Ak=`.${VMe}`,o0e=".data-api",UMe="ArrowLeft",WMe="ArrowRight",jMe=500,dP="next",RD="prev",HD="left",Gz="right",ZMe=`slide${Ak}`,nne=`slid${Ak}`,qMe=`keydown${Ak}`,GMe=`mouseenter${Ak}`,KMe=`mouseleave${Ak}`,YMe=`dragstart${Ak}`,XMe=`load${Ak}${o0e}`,JMe=`click${Ak}${o0e}`,s0e="carousel",yz="active",QMe="slide",eRe="carousel-item-end",tRe="carousel-item-start",nRe="carousel-item-next",oRe="carousel-item-prev",r0e=".active",i0e=".carousel-item",sRe=r0e+i0e,rRe=".carousel-item img",iRe=".carousel-indicators",aRe="[data-bs-slide], [data-bs-slide-to]",lRe='[data-bs-ride="carousel"]',cRe={[UMe]:Gz,[WMe]:HD},uRe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},fRe={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class CI extends vv{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=mr.findOne(iRe,this._element),this._addEventListeners(),this._config.ride===s0e&&this.cycle()}static get Default(){return uRe}static get DefaultType(){return fRe}static get NAME(){return zMe}next(){this._slide(dP)}nextWhenVisible(){!document.hidden&&EO(this._element)&&this.next()}prev(){this._slide(RD)}pause(){this._isSliding&&Z1e(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(!!this._config.ride){if(this._isSliding){io.one(this._element,nne,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){io.one(this._element,nne,()=>this.to(e));return}const s=this._getItemIndex(this._getActive());if(s===e)return;const a=e>s?dP:RD;this._slide(a,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&io.on(this._element,qMe,e=>this._keydown(e)),this._config.pause==="hover"&&(io.on(this._element,GMe,()=>this.pause()),io.on(this._element,KMe,()=>this._maybeEnableCycle())),this._config.touch&&LV.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const s of mr.find(rRe,this._element))io.on(s,YMe,a=>a.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(HD)),rightCallback:()=>this._slide(this._directionToOrder(Gz)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),jMe+this._config.interval))}};this._swipeHelper=new LV(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=cRe[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=mr.findOne(r0e,this._indicatorsElement);t.classList.remove(yz),t.removeAttribute("aria-current");const s=mr.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);s&&(s.classList.add(yz),s.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const s=this._getActive(),a=e===dP,u=t||Sse(this._getItems(),s,a,this._config.wrap);if(u===s)return;const f=this._getItemIndex(u),h=N=>io.trigger(this._element,N,{relatedTarget:u,direction:this._orderToDirection(e),from:this._getItemIndex(s),to:f});if(h(ZMe).defaultPrevented||!s||!u)return;const v=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(f),this._activeElement=u;const _=a?tRe:eRe,A=a?nRe:oRe;u.classList.add(A),wI(u),s.classList.add(_),u.classList.add(_);const O=()=>{u.classList.remove(_,A),u.classList.add(yz),s.classList.remove(yz,A,_),this._isSliding=!1,h(nne)};this._queueCallback(O,s,this._isAnimated()),v&&this.cycle()}_isAnimated(){return this._element.classList.contains(QMe)}_getActive(){return mr.findOne(sRe,this._element)}_getItems(){return mr.find(i0e,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return L0()?e===HD?RD:dP:e===HD?dP:RD}_orderToDirection(e){return L0()?e===RD?HD:Gz:e===RD?Gz:HD}static jQueryInterface(e){return this.each(function(){const t=CI.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}io.on(document,JMe,aRe,function(r){const e=mr.getElementFromSelector(this);if(!e||!e.classList.contains(s0e))return;r.preventDefault();const t=CI.getOrCreateInstance(e),s=this.getAttribute("data-bs-slide-to");if(s){t.to(s),t._maybeEnableCycle();return}if(T_.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});io.on(window,XMe,()=>{const r=mr.find(lRe);for(const e of r)CI.getOrCreateInstance(e)});V0(CI);const dRe="collapse",hRe="bs.collapse",SI=`.${hRe}`,mRe=".data-api",gRe=`show${SI}`,pRe=`shown${SI}`,bRe=`hide${SI}`,vRe=`hidden${SI}`,yRe=`click${SI}${mRe}`,one="show",jD="collapse",wz="collapsing",wRe="collapsed",_Re=`:scope .${jD} .${jD}`,CRe="collapse-horizontal",SRe="width",kRe="height",ERe=".collapse.show, .collapse.collapsing",_oe='[data-bs-toggle="collapse"]',ARe={parent:null,toggle:!0},xRe={parent:"(null|element)",toggle:"boolean"};class eI extends vv{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const s=mr.find(_oe);for(const a of s){const u=mr.getSelectorFromElement(a),f=mr.find(u).filter(h=>h===this._element);u!==null&&f.length&&this._triggerArray.push(a)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return ARe}static get DefaultType(){return xRe}static get NAME(){return dRe}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(ERe).filter(h=>h!==this._element).map(h=>eI.getOrCreateInstance(h,{toggle:!1}))),e.length&&e[0]._isTransitioning||io.trigger(this._element,gRe).defaultPrevented)return;for(const h of e)h.hide();const s=this._getDimension();this._element.classList.remove(jD),this._element.classList.add(wz),this._element.style[s]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const a=()=>{this._isTransitioning=!1,this._element.classList.remove(wz),this._element.classList.add(jD,one),this._element.style[s]="",io.trigger(this._element,pRe)},f=`scroll${s[0].toUpperCase()+s.slice(1)}`;this._queueCallback(a,this._element,!0),this._element.style[s]=`${this._element[f]}px`}hide(){if(this._isTransitioning||!this._isShown()||io.trigger(this._element,bRe).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,wI(this._element),this._element.classList.add(wz),this._element.classList.remove(jD,one);for(const a of this._triggerArray){const u=mr.getElementFromSelector(a);u&&!this._isShown(u)&&this._addAriaAndCollapsedClass([a],!1)}this._isTransitioning=!0;const s=()=>{this._isTransitioning=!1,this._element.classList.remove(wz),this._element.classList.add(jD),io.trigger(this._element,vRe)};this._element.style[t]="",this._queueCallback(s,this._element,!0)}_isShown(e=this._element){return e.classList.contains(one)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=yk(e.parent),e}_getDimension(){return this._element.classList.contains(CRe)?SRe:kRe}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(_oe);for(const t of e){const s=mr.getElementFromSelector(t);s&&this._addAriaAndCollapsedClass([t],this._isShown(s))}}_getFirstLevelChildren(e){const t=mr.find(_Re,this._config.parent);return mr.find(e,this._config.parent).filter(s=>!t.includes(s))}_addAriaAndCollapsedClass(e,t){if(!!e.length)for(const s of e)s.classList.toggle(wRe,!t),s.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const s=eI.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e]()}})}}io.on(document,yRe,_oe,function(r){(r.target.tagName==="A"||r.delegateTarget&&r.delegateTarget.tagName==="A")&&r.preventDefault();for(const e of mr.getMultipleElementsFromSelector(this))eI.getOrCreateInstance(e,{toggle:!1}).toggle()});V0(eI);const Ade="dropdown",TRe="bs.dropdown",e3=`.${TRe}`,Ese=".data-api",DRe="Escape",xde="Tab",ORe="ArrowUp",Tde="ArrowDown",MRe=2,RRe=`hide${e3}`,NRe=`hidden${e3}`,PRe=`show${e3}`,IRe=`shown${e3}`,a0e=`click${e3}${Ese}`,l0e=`keydown${e3}${Ese}`,BRe=`keyup${e3}${Ese}`,$D="show",LRe="dropup",FRe="dropend",HRe="dropstart",$Re="dropup-center",zRe="dropdown-center",Ux='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',VRe=`${Ux}.${$D}`,Kz=".dropdown-menu",URe=".navbar",WRe=".navbar-nav",jRe=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",ZRe=L0()?"top-end":"top-start",qRe=L0()?"top-start":"top-end",GRe=L0()?"bottom-end":"bottom-start",KRe=L0()?"bottom-start":"bottom-end",YRe=L0()?"left-start":"right-start",XRe=L0()?"right-start":"left-start",JRe="top",QRe="bottom",e5e={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},t5e={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class r2 extends vv{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=mr.next(this._element,Kz)[0]||mr.prev(this._element,Kz)[0]||mr.findOne(Kz,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return e5e}static get DefaultType(){return t5e}static get NAME(){return Ade}toggle(){return this._isShown()?this.hide():this.show()}show(){if(wk(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!io.trigger(this._element,PRe,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(WRe))for(const s of[].concat(...document.body.children))io.on(s,"mouseover",BV);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add($D),this._element.classList.add($D),io.trigger(this._element,IRe,e)}}hide(){if(wk(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!io.trigger(this._element,RRe,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))io.off(s,"mouseover",BV);this._popper&&this._popper.destroy(),this._menu.classList.remove($D),this._element.classList.remove($D),this._element.setAttribute("aria-expanded","false"),T_.removeDataAttribute(this._menu,"popper"),io.trigger(this._element,NRe,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!x_(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Ade.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof W1e>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:x_(this._config.reference)?e=yk(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Cse(e,this._menu,t)}_isShown(){return this._menu.classList.contains($D)}_getPlacement(){const e=this._parent;if(e.classList.contains(FRe))return YRe;if(e.classList.contains(HRe))return XRe;if(e.classList.contains($Re))return JRe;if(e.classList.contains(zRe))return QRe;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(LRe)?t?qRe:ZRe:t?KRe:GRe}_detectNavbar(){return this._element.closest(URe)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(T_.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Tp(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const s=mr.find(jRe,this._menu).filter(a=>EO(a));!s.length||Sse(s,t,e===Tde,!s.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=r2.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===MRe||e.type==="keyup"&&e.key!==xde)return;const t=mr.find(VRe);for(const s of t){const a=r2.getInstance(s);if(!a||a._config.autoClose===!1)continue;const u=e.composedPath(),f=u.includes(a._menu);if(u.includes(a._element)||a._config.autoClose==="inside"&&!f||a._config.autoClose==="outside"&&f||a._menu.contains(e.target)&&(e.type==="keyup"&&e.key===xde||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const h={relatedTarget:a._element};e.type==="click"&&(h.clickEvent=e),a._completeHide(h)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s=e.key===DRe,a=[ORe,Tde].includes(e.key);if(!a&&!s||t&&!s)return;e.preventDefault();const u=this.matches(Ux)?this:mr.prev(this,Ux)[0]||mr.next(this,Ux)[0]||mr.findOne(Ux,e.delegateTarget.parentNode),f=r2.getOrCreateInstance(u);if(a){e.stopPropagation(),f.show(),f._selectMenuItem(e);return}f._isShown()&&(e.stopPropagation(),f.hide(),u.focus())}}io.on(document,l0e,Ux,r2.dataApiKeydownHandler);io.on(document,l0e,Kz,r2.dataApiKeydownHandler);io.on(document,a0e,r2.clearMenus);io.on(document,BRe,r2.clearMenus);io.on(document,a0e,Ux,function(r){r.preventDefault(),r2.getOrCreateInstance(this).toggle()});V0(r2);const c0e="backdrop",n5e="fade",Dde="show",Ode=`mousedown.bs.${c0e}`,o5e={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},s5e={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class u0e extends _I{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return o5e}static get DefaultType(){return s5e}static get NAME(){return c0e}show(e){if(!this._config.isVisible){Tp(e);return}this._append();const t=this._getElement();this._config.isAnimated&&wI(t),t.classList.add(Dde),this._emulateAnimation(()=>{Tp(e)})}hide(e){if(!this._config.isVisible){Tp(e);return}this._getElement().classList.remove(Dde),this._emulateAnimation(()=>{this.dispose(),Tp(e)})}dispose(){!this._isAppended||(io.off(this._element,Ode),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(n5e),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=yk(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),io.on(e,Ode,()=>{Tp(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){K1e(e,this._getElement(),this._config.isAnimated)}}const r5e="focustrap",i5e="bs.focustrap",FV=`.${i5e}`,a5e=`focusin${FV}`,l5e=`keydown.tab${FV}`,c5e="Tab",u5e="forward",Mde="backward",f5e={autofocus:!0,trapElement:null},d5e={autofocus:"boolean",trapElement:"element"};class f0e extends _I{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return f5e}static get DefaultType(){return d5e}static get NAME(){return r5e}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),io.off(document,FV),io.on(document,a5e,e=>this._handleFocusin(e)),io.on(document,l5e,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){!this._isActive||(this._isActive=!1,io.off(document,FV))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const s=mr.focusableChildren(t);s.length===0?t.focus():this._lastTabNavDirection===Mde?s[s.length-1].focus():s[0].focus()}_handleKeydown(e){e.key===c5e&&(this._lastTabNavDirection=e.shiftKey?Mde:u5e)}}const Rde=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Nde=".sticky-top",_z="padding-right",Pde="margin-right";class Coe{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,_z,t=>t+e),this._setElementAttributes(Rde,_z,t=>t+e),this._setElementAttributes(Nde,Pde,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,_z),this._resetElementAttributes(Rde,_z),this._resetElementAttributes(Nde,Pde)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const a=this.getWidth(),u=f=>{if(f!==this._element&&window.innerWidth>f.clientWidth+a)return;this._saveInitialAttribute(f,t);const h=window.getComputedStyle(f).getPropertyValue(t);f.style.setProperty(t,`${s(Number.parseFloat(h))}px`)};this._applyManipulationCallback(e,u)}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&T_.setDataAttribute(e,t,s)}_resetElementAttributes(e,t){const s=a=>{const u=T_.getDataAttribute(a,t);if(u===null){a.style.removeProperty(t);return}T_.removeDataAttribute(a,t),a.style.setProperty(t,u)};this._applyManipulationCallback(e,s)}_applyManipulationCallback(e,t){if(x_(e)){t(e);return}for(const s of mr.find(e,this._element))t(s)}}const h5e="modal",m5e="bs.modal",F0=`.${m5e}`,g5e=".data-api",p5e="Escape",b5e=`hide${F0}`,v5e=`hidePrevented${F0}`,d0e=`hidden${F0}`,h0e=`show${F0}`,y5e=`shown${F0}`,w5e=`resize${F0}`,_5e=`click.dismiss${F0}`,C5e=`mousedown.dismiss${F0}`,S5e=`keydown.dismiss${F0}`,k5e=`click${F0}${g5e}`,Ide="modal-open",E5e="fade",Bde="show",sne="modal-static",A5e=".modal.show",x5e=".modal-dialog",T5e=".modal-body",D5e='[data-bs-toggle="modal"]',O5e={backdrop:!0,focus:!0,keyboard:!0},M5e={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class gO extends vv{constructor(e,t){super(e,t),this._dialog=mr.findOne(x5e,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Coe,this._addEventListeners()}static get Default(){return O5e}static get DefaultType(){return M5e}static get NAME(){return h5e}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||io.trigger(this._element,h0e,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ide),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||io.trigger(this._element,b5e).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Bde),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){io.off(window,F0),io.off(this._dialog,F0),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new u0e({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new f0e({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=mr.findOne(T5e,this._dialog);t&&(t.scrollTop=0),wI(this._element),this._element.classList.add(Bde);const s=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,io.trigger(this._element,y5e,{relatedTarget:e})};this._queueCallback(s,this._dialog,this._isAnimated())}_addEventListeners(){io.on(this._element,S5e,e=>{if(e.key===p5e){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),io.on(window,w5e,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),io.on(this._element,C5e,e=>{io.one(this._element,_5e,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ide),this._resetAdjustments(),this._scrollBar.reset(),io.trigger(this._element,d0e)})}_isAnimated(){return this._element.classList.contains(E5e)}_triggerBackdropTransition(){if(io.trigger(this._element,v5e).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,s=this._element.style.overflowY;s==="hidden"||this._element.classList.contains(sne)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(sne),this._queueCallback(()=>{this._element.classList.remove(sne),this._queueCallback(()=>{this._element.style.overflowY=s},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const a=L0()?"paddingLeft":"paddingRight";this._element.style[a]=`${t}px`}if(!s&&e){const a=L0()?"paddingRight":"paddingLeft";this._element.style[a]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const s=gO.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e](t)}})}}io.on(document,k5e,D5e,function(r){const e=mr.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&r.preventDefault(),io.one(e,h0e,a=>{a.defaultPrevented||io.one(e,d0e,()=>{EO(this)&&this.focus()})});const t=mr.findOne(A5e);t&&gO.getInstance(t).hide(),gO.getOrCreateInstance(e).toggle(this)});hU(gO);V0(gO);const R5e="offcanvas",N5e="bs.offcanvas",L_=`.${N5e}`,m0e=".data-api",P5e=`load${L_}${m0e}`,I5e="Escape",Lde="show",Fde="showing",Hde="hiding",B5e="offcanvas-backdrop",g0e=".offcanvas.show",L5e=`show${L_}`,F5e=`shown${L_}`,H5e=`hide${L_}`,$de=`hidePrevented${L_}`,p0e=`hidden${L_}`,$5e=`resize${L_}`,z5e=`click${L_}${m0e}`,V5e=`keydown.dismiss${L_}`,U5e='[data-bs-toggle="offcanvas"]',W5e={backdrop:!0,keyboard:!0,scroll:!1},j5e={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class _k extends vv{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return W5e}static get DefaultType(){return j5e}static get NAME(){return R5e}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||io.trigger(this._element,L5e,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Coe().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Fde);const s=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(Lde),this._element.classList.remove(Fde),io.trigger(this._element,F5e,{relatedTarget:e})};this._queueCallback(s,this._element,!0)}hide(){if(!this._isShown||io.trigger(this._element,H5e).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Hde),this._backdrop.hide();const t=()=>{this._element.classList.remove(Lde,Hde),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Coe().reset(),io.trigger(this._element,p0e)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){io.trigger(this._element,$de);return}this.hide()},t=Boolean(this._config.backdrop);return new u0e({className:B5e,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new f0e({trapElement:this._element})}_addEventListeners(){io.on(this._element,V5e,e=>{if(e.key===I5e){if(this._config.keyboard){this.hide();return}io.trigger(this._element,$de)}})}static jQueryInterface(e){return this.each(function(){const t=_k.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}io.on(document,z5e,U5e,function(r){const e=mr.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),wk(this))return;io.one(e,p0e,()=>{EO(this)&&this.focus()});const t=mr.findOne(g0e);t&&t!==e&&_k.getInstance(t).hide(),_k.getOrCreateInstance(e).toggle(this)});io.on(window,P5e,()=>{for(const r of mr.find(g0e))_k.getOrCreateInstance(r).show()});io.on(window,$5e,()=>{for(const r of mr.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(r).position!=="fixed"&&_k.getOrCreateInstance(r).hide()});hU(_k);V0(_k);const Z5e=/^aria-[\w-]*$/i,b0e={"*":["class","dir","id","lang","role",Z5e],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},q5e=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),G5e=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,K5e=(r,e)=>{const t=r.nodeName.toLowerCase();return e.includes(t)?q5e.has(t)?Boolean(G5e.test(r.nodeValue)):!0:e.filter(s=>s instanceof RegExp).some(s=>s.test(t))};function Y5e(r,e,t){if(!r.length)return r;if(t&&typeof t=="function")return t(r);const a=new window.DOMParser().parseFromString(r,"text/html"),u=[].concat(...a.body.querySelectorAll("*"));for(const f of u){const h=f.nodeName.toLowerCase();if(!Object.keys(e).includes(h)){f.remove();continue}const g=[].concat(...f.attributes),v=[].concat(e["*"]||[],e[h]||[]);for(const _ of g)K5e(_,v)||f.removeAttribute(_.nodeName)}return a.body.innerHTML}const X5e="TemplateFactory",J5e={allowList:b0e,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Q5e={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},eNe={entry:"(string|element|function|null)",selector:"(string|element)"};class tNe extends _I{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return J5e}static get DefaultType(){return Q5e}static get NAME(){return X5e}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[a,u]of Object.entries(this._config.content))this._setContent(e,u,a);const t=e.children[0],s=this._resolvePossibleFunction(this._config.extraClass);return s&&t.classList.add(...s.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,s]of Object.entries(e))super._typeCheckConfig({selector:t,entry:s},eNe)}_setContent(e,t,s){const a=mr.findOne(s,e);if(!!a){if(t=this._resolvePossibleFunction(t),!t){a.remove();return}if(x_(t)){this._putElementInTemplate(yk(t),a);return}if(this._config.html){a.innerHTML=this._maybeSanitize(t);return}a.textContent=t}}_maybeSanitize(e){return this._config.sanitize?Y5e(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Tp(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const nNe="tooltip",oNe=new Set(["sanitize","allowList","sanitizeFn"]),rne="fade",sNe="modal",Cz="show",rNe=".tooltip-inner",zde=`.${sNe}`,Vde="hide.bs.modal",hP="hover",ine="focus",iNe="click",aNe="manual",lNe="hide",cNe="hidden",uNe="show",fNe="shown",dNe="inserted",hNe="click",mNe="focusin",gNe="focusout",pNe="mouseenter",bNe="mouseleave",vNe={AUTO:"auto",TOP:"top",RIGHT:L0()?"left":"right",BOTTOM:"bottom",LEFT:L0()?"right":"left"},yNe={allowList:b0e,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},wNe={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class t3 extends vv{constructor(e,t){if(typeof W1e>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return yNe}static get DefaultType(){return wNe}static get NAME(){return nNe}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(!!this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),io.off(this._element.closest(zde),Vde,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=io.trigger(this._element,this.constructor.eventName(uNe)),s=(q1e(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!s)return;this._disposePopper();const a=this._getTipElement();this._element.setAttribute("aria-describedby",a.getAttribute("id"));const{container:u}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(u.append(a),io.trigger(this._element,this.constructor.eventName(dNe))),this._popper=this._createPopper(a),a.classList.add(Cz),"ontouchstart"in document.documentElement)for(const h of[].concat(...document.body.children))io.on(h,"mouseover",BV);const f=()=>{io.trigger(this._element,this.constructor.eventName(fNe)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(f,this.tip,this._isAnimated())}hide(){if(!this._isShown()||io.trigger(this._element,this.constructor.eventName(lNe)).defaultPrevented)return;if(this._getTipElement().classList.remove(Cz),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))io.off(a,"mouseover",BV);this._activeTrigger[iNe]=!1,this._activeTrigger[ine]=!1,this._activeTrigger[hP]=!1,this._isHovered=null;const s=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),io.trigger(this._element,this.constructor.eventName(cNe)))};this._queueCallback(s,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(rne,Cz),t.classList.add(`bs-${this.constructor.NAME}-auto`);const s=iMe(this.constructor.NAME).toString();return t.setAttribute("id",s),this._isAnimated()&&t.classList.add(rne),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new tNe({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[rNe]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(rne)}_isShown(){return this.tip&&this.tip.classList.contains(Cz)}_createPopper(e){const t=Tp(this._config.placement,[this,e,this._element]),s=vNe[t.toUpperCase()];return Cse(this._element,e,this._getPopperConfig(s))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Tp(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:s=>{this._getTipElement().setAttribute("data-popper-placement",s.state.placement)}}]};return{...t,...Tp(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")io.on(this._element,this.constructor.eventName(hNe),this._config.selector,s=>{this._initializeOnDelegatedTarget(s).toggle()});else if(t!==aNe){const s=t===hP?this.constructor.eventName(pNe):this.constructor.eventName(mNe),a=t===hP?this.constructor.eventName(bNe):this.constructor.eventName(gNe);io.on(this._element,s,this._config.selector,u=>{const f=this._initializeOnDelegatedTarget(u);f._activeTrigger[u.type==="focusin"?ine:hP]=!0,f._enter()}),io.on(this._element,a,this._config.selector,u=>{const f=this._initializeOnDelegatedTarget(u);f._activeTrigger[u.type==="focusout"?ine:hP]=f._element.contains(u.relatedTarget),f._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},io.on(this._element.closest(zde),Vde,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");!e||(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=T_.getDataAttributes(this._element);for(const s of Object.keys(t))oNe.has(s)&&delete t[s];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:yk(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,s]of Object.entries(this._config))this.constructor.Default[t]!==s&&(e[t]=s);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=t3.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}V0(t3);const _Ne="popover",CNe=".popover-header",SNe=".popover-body",kNe={...t3.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},ENe={...t3.DefaultType,content:"(null|string|element|function)"};class Ase extends t3{static get Default(){return kNe}static get DefaultType(){return ENe}static get NAME(){return _Ne}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[CNe]:this._getTitle(),[SNe]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Ase.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}V0(Ase);const ANe="scrollspy",xNe="bs.scrollspy",xse=`.${xNe}`,TNe=".data-api",DNe=`activate${xse}`,Ude=`click${xse}`,ONe=`load${xse}${TNe}`,MNe="dropdown-item",ND="active",RNe='[data-bs-spy="scroll"]',ane="[href]",NNe=".nav, .list-group",Wde=".nav-link",PNe=".nav-item",INe=".list-group-item",BNe=`${Wde}, ${PNe} > ${Wde}, ${INe}`,LNe=".dropdown",FNe=".dropdown-toggle",HNe={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},$Ne={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class pU extends vv{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return HNe}static get DefaultType(){return $Ne}static get NAME(){return ANe}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=yk(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){!this._config.smoothScroll||(io.off(this._config.target,Ude),io.on(this._config.target,Ude,ane,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const s=this._rootElement||window,a=t.offsetTop-this._element.offsetTop;if(s.scrollTo){s.scrollTo({top:a,behavior:"smooth"});return}s.scrollTop=a}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=f=>this._targetLinks.get(`#${f.target.id}`),s=f=>{this._previousScrollData.visibleEntryTop=f.target.offsetTop,this._process(t(f))},a=(this._rootElement||document.documentElement).scrollTop,u=a>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=a;for(const f of e){if(!f.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(f));continue}const h=f.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(u&&h){if(s(f),!a)return;continue}!u&&!h&&s(f)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=mr.find(ane,this._config.target);for(const t of e){if(!t.hash||wk(t))continue;const s=mr.findOne(decodeURI(t.hash),this._element);EO(s)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,s))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(ND),this._activateParents(e),io.trigger(this._element,DNe,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(MNe)){mr.findOne(FNe,e.closest(LNe)).classList.add(ND);return}for(const t of mr.parents(e,NNe))for(const s of mr.prev(t,BNe))s.classList.add(ND)}_clearActiveClass(e){e.classList.remove(ND);const t=mr.find(`${ane}.${ND}`,e);for(const s of t)s.classList.remove(ND)}static jQueryInterface(e){return this.each(function(){const t=pU.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}io.on(window,ONe,()=>{for(const r of mr.find(RNe))pU.getOrCreateInstance(r)});V0(pU);const zNe="tab",VNe="bs.tab",n3=`.${VNe}`,UNe=`hide${n3}`,WNe=`hidden${n3}`,jNe=`show${n3}`,ZNe=`shown${n3}`,qNe=`click${n3}`,GNe=`keydown${n3}`,KNe=`load${n3}`,YNe="ArrowLeft",jde="ArrowRight",XNe="ArrowUp",Zde="ArrowDown",lne="Home",qde="End",Wx="active",Gde="fade",cne="show",JNe="dropdown",v0e=".dropdown-toggle",QNe=".dropdown-menu",une=`:not(${v0e})`,e6e='.list-group, .nav, [role="tablist"]',t6e=".nav-item, .list-group-item",n6e=`.nav-link${une}, .list-group-item${une}, [role="tab"]${une}`,y0e='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',fne=`${n6e}, ${y0e}`,o6e=`.${Wx}[data-bs-toggle="tab"], .${Wx}[data-bs-toggle="pill"], .${Wx}[data-bs-toggle="list"]`;class pO extends vv{constructor(e){super(e),this._parent=this._element.closest(e6e),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),io.on(this._element,GNe,t=>this._keydown(t)))}static get NAME(){return zNe}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),s=t?io.trigger(t,UNe,{relatedTarget:e}):null;io.trigger(e,jNe,{relatedTarget:t}).defaultPrevented||s&&s.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Wx),this._activate(mr.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(cne);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),io.trigger(e,ZNe,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(Gde))}_deactivate(e,t){if(!e)return;e.classList.remove(Wx),e.blur(),this._deactivate(mr.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(cne);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),io.trigger(e,WNe,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(Gde))}_keydown(e){if(![YNe,jde,XNe,Zde,lne,qde].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(a=>!wk(a));let s;if([lne,qde].includes(e.key))s=t[e.key===lne?0:t.length-1];else{const a=[jde,Zde].includes(e.key);s=Sse(t,e.target,a,!0)}s&&(s.focus({preventScroll:!0}),pO.getOrCreateInstance(s).show())}_getChildren(){return mr.find(fne,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const s of t)this._setInitialAttributesOnChild(s)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),s=this._getOuterElement(e);e.setAttribute("aria-selected",t),s!==e&&this._setAttributeIfNotExists(s,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=mr.getElementFromSelector(e);!t||(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const s=this._getOuterElement(e);if(!s.classList.contains(JNe))return;const a=(u,f)=>{const h=mr.findOne(u,s);h&&h.classList.toggle(f,t)};a(v0e,Wx),a(QNe,cne),s.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,s){e.hasAttribute(t)||e.setAttribute(t,s)}_elemIsActive(e){return e.classList.contains(Wx)}_getInnerElement(e){return e.matches(fne)?e:mr.findOne(fne,e)}_getOuterElement(e){return e.closest(t6e)||e}static jQueryInterface(e){return this.each(function(){const t=pO.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}io.on(document,qNe,y0e,function(r){["A","AREA"].includes(this.tagName)&&r.preventDefault(),!wk(this)&&pO.getOrCreateInstance(this).show()});io.on(window,KNe,()=>{for(const r of mr.find(o6e))pO.getOrCreateInstance(r)});V0(pO);const s6e="toast",r6e="bs.toast",xk=`.${r6e}`,i6e=`mouseover${xk}`,a6e=`mouseout${xk}`,l6e=`focusin${xk}`,c6e=`focusout${xk}`,u6e=`hide${xk}`,f6e=`hidden${xk}`,d6e=`show${xk}`,h6e=`shown${xk}`,m6e="fade",Kde="hide",Sz="show",kz="showing",g6e={animation:"boolean",autohide:"boolean",delay:"number"},p6e={animation:!0,autohide:!0,delay:5e3};class bU extends vv{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return p6e}static get DefaultType(){return g6e}static get NAME(){return s6e}show(){if(io.trigger(this._element,d6e).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(m6e);const t=()=>{this._element.classList.remove(kz),io.trigger(this._element,h6e),this._maybeScheduleHide()};this._element.classList.remove(Kde),wI(this._element),this._element.classList.add(Sz,kz),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||io.trigger(this._element,u6e).defaultPrevented)return;const t=()=>{this._element.classList.add(Kde),this._element.classList.remove(kz,Sz),io.trigger(this._element,f6e)};this._element.classList.add(kz),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Sz),super.dispose()}isShown(){return this._element.classList.contains(Sz)}_maybeScheduleHide(){!this._config.autohide||this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const s=e.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide()}_setListeners(){io.on(this._element,i6e,e=>this._onInteraction(e,!0)),io.on(this._element,a6e,e=>this._onInteraction(e,!1)),io.on(this._element,l6e,e=>this._onInteraction(e,!0)),io.on(this._element,c6e,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=bU.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}hU(bU);V0(bU);Rp.escape=function(r){return r};function b6e(){var r=[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));r.map(function(e){return new t3(e)})}const v6e={account:bve,channel:pOe};let Ez=[],y6e=function(){Ez.map(t=>t.$destroy()),Ez=[];const r=document.body.querySelectorAll(".lucent-component");if(r.length===0)return;const e=function(t){const s=t.attributes["data-layout"].value,[a,u]=Object.entries(v6e).find(([v,_])=>s==v);if(!u)return[];const f=document.getElementById("json-"+s).innerHTML,h=JSON.parse(f),g={target:t,props:h};Ez=[...Ez,new u(g)]};Array.from(r).map(e)};document.addEventListener("DOMContentLoaded",y6e);document.addEventListener("DOMContentLoaded",b6e);
|