189 lines
2.3 MiB
Plaintext
189 lines
2.3 MiB
Plaintext
var NN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o2e(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var epe={exports:{}},Gse={exports:{}},tpe=function(e,t){return function(){for(var a=new Array(arguments.length),l=0;l<a.length;l++)a[l]=arguments[l];return e.apply(t,a)}},s2e=tpe,FC=Object.prototype.toString;function Kse(o){return Array.isArray(o)}function Doe(o){return typeof o>"u"}function r2e(o){return o!==null&&!Doe(o)&&o.constructor!==null&&!Doe(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}function npe(o){return FC.call(o)==="[object ArrayBuffer]"}function i2e(o){return FC.call(o)==="[object FormData]"}function a2e(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&npe(o.buffer),e}function l2e(o){return typeof o=="string"}function c2e(o){return typeof o=="number"}function ope(o){return o!==null&&typeof o=="object"}function wH(o){if(FC.call(o)!=="[object Object]")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function u2e(o){return FC.call(o)==="[object Date]"}function f2e(o){return FC.call(o)==="[object File]"}function d2e(o){return FC.call(o)==="[object Blob]"}function spe(o){return FC.call(o)==="[object Function]"}function h2e(o){return ope(o)&&spe(o.pipe)}function m2e(o){return FC.call(o)==="[object URLSearchParams]"}function g2e(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function p2e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Jse(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Kse(o))for(var t=0,s=o.length;t<s;t++)e.call(null,o[t],t,o);else for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&e.call(null,o[a],a,o)}function Poe(){var o={};function e(a,l){wH(o[l])&&wH(a)?o[l]=Poe(o[l],a):wH(a)?o[l]=Poe({},a):Kse(a)?o[l]=a.slice():o[l]=a}for(var t=0,s=arguments.length;t<s;t++)Jse(arguments[t],e);return o}function b2e(o,e,t){return Jse(e,function(a,l){t&&typeof a=="function"?o[l]=s2e(a,t):o[l]=a}),o}function v2e(o){return o.charCodeAt(0)===65279&&(o=o.slice(1)),o}var Hp={isArray:Kse,isArrayBuffer:npe,isBuffer:r2e,isFormData:i2e,isArrayBufferView:a2e,isString:l2e,isNumber:c2e,isObject:ope,isPlainObject:wH,isUndefined:Doe,isDate:u2e,isFile:f2e,isBlob:d2e,isFunction:spe,isStream:h2e,isURLSearchParams:m2e,isStandardBrowserEnv:p2e,forEach:Jse,merge:Poe,extend:b2e,trim:g2e,stripBOM:v2e},q4=Hp;function Uae(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var rpe=function(e,t,s){if(!t)return e;var a;if(s)a=s(t);else if(q4.isURLSearchParams(t))a=t.toString();else{var l=[];q4.forEach(t,function(h,b){h===null||typeof h>"u"||(q4.isArray(h)?b=b+"[]":h=[h],q4.forEach(h,function(C){q4.isDate(C)?C=C.toISOString():q4.isObject(C)&&(C=JSON.stringify(C)),l.push(Uae(b)+"="+Uae(C))}))}),a=l.join("&")}if(a){var u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},O2e=Hp;function Yz(){this.handlers=[]}Yz.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};Yz.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Yz.prototype.forEach=function(e){O2e.forEach(this.handlers,function(s){s!==null&&e(s)})};var y2e=Yz,w2e=Hp,_2e=function(e,t){w2e.forEach(e,function(a,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[l])})},ipe=function(e,t,s,a,l){return e.config=t,s&&(e.code=s),e.request=a,e.response=l,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},jte,Yae;function ape(){if(Yae)return jte;Yae=1;var o=ipe;return jte=function(t,s,a,l,u){var d=new Error(t);return o(d,s,a,l,u)},jte}var qte,Xae;function S2e(){if(Xae)return qte;Xae=1;var o=ape();return qte=function(t,s,a){var l=a.config.validateStatus;!a.status||!l||l(a.status)?t(a):s(o("Request failed with status code "+a.status,a.config,null,a.request,a))},qte}var Gte,jae;function C2e(){if(jae)return Gte;jae=1;var o=Hp;return Gte=o.isStandardBrowserEnv()?function(){return{write:function(s,a,l,u,d,h){var b=[];b.push(s+"="+encodeURIComponent(a)),o.isNumber(l)&&b.push("expires="+new Date(l).toGMTString()),o.isString(u)&&b.push("path="+u),o.isString(d)&&b.push("domain="+d),h===!0&&b.push("secure"),document.cookie=b.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(){}}}(),Gte}var Kte,qae;function k2e(){return qae||(qae=1,Kte=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Kte}var Jte,Gae;function x2e(){return Gae||(Gae=1,Jte=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),Jte}var ene,Kae;function T2e(){if(Kae)return ene;Kae=1;var o=k2e(),e=x2e();return ene=function(s,a){return s&&!o(a)?e(s,a):a},ene}var tne,Jae;function E2e(){if(Jae)return tne;Jae=1;var o=Hp,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 tne=function(s){var a={},l,u,d;return s&&o.forEach(s.split(`
|
|
`),function(b){if(d=b.indexOf(":"),l=o.trim(b.substr(0,d)).toLowerCase(),u=o.trim(b.substr(d+1)),l){if(a[l]&&e.indexOf(l)>=0)return;l==="set-cookie"?a[l]=(a[l]?a[l]:[]).concat([u]):a[l]=a[l]?a[l]+", "+u:u}}),a},tne}var nne,ele;function A2e(){if(ele)return nne;ele=1;var o=Hp;return nne=o.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),a;function l(u){var d=u;return t&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{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=l(window.location.href),function(d){var h=o.isString(d)?l(d):d;return h.protocol===a.protocol&&h.host===a.host}}():function(){return function(){return!0}}(),nne}var one,tle;function Xz(){if(tle)return one;tle=1;function o(e){this.message=e}return o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,one=o,one}var sne,nle;function ole(){if(nle)return sne;nle=1;var o=Hp,e=S2e(),t=C2e(),s=rpe,a=T2e(),l=E2e(),u=A2e(),d=ape(),h=jz(),b=Xz();return sne=function(C){return new Promise(function(R,$){var Q=C.data,F=C.headers,U=C.responseType,K;function L(){C.cancelToken&&C.cancelToken.unsubscribe(K),C.signal&&C.signal.removeEventListener("abort",K)}o.isFormData(Q)&&delete F["Content-Type"];var te=new XMLHttpRequest;if(C.auth){var ne=C.auth.username||"",oe=C.auth.password?unescape(encodeURIComponent(C.auth.password)):"";F.Authorization="Basic "+btoa(ne+":"+oe)}var G=a(C.baseURL,C.url);te.open(C.method.toUpperCase(),s(G,C.params,C.paramsSerializer),!0),te.timeout=C.timeout;function we(){if(!!te){var Re="getAllResponseHeaders"in te?l(te.getAllResponseHeaders()):null,Oe=!U||U==="text"||U==="json"?te.responseText:te.response,ce={data:Oe,status:te.status,statusText:te.statusText,headers:Re,config:C,request:te};e(function(tt){R(tt),L()},function(tt){$(tt),L()},ce),te=null}}if("onloadend"in te?te.onloadend=we:te.onreadystatechange=function(){!te||te.readyState!==4||te.status===0&&!(te.responseURL&&te.responseURL.indexOf("file:")===0)||setTimeout(we)},te.onabort=function(){!te||($(d("Request aborted",C,"ECONNABORTED",te)),te=null)},te.onerror=function(){$(d("Network Error",C,null,te)),te=null},te.ontimeout=function(){var Oe=C.timeout?"timeout of "+C.timeout+"ms exceeded":"timeout exceeded",ce=C.transitional||h.transitional;C.timeoutErrorMessage&&(Oe=C.timeoutErrorMessage),$(d(Oe,C,ce.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",te)),te=null},o.isStandardBrowserEnv()){var ve=(C.withCredentials||u(G))&&C.xsrfCookieName?t.read(C.xsrfCookieName):void 0;ve&&(F[C.xsrfHeaderName]=ve)}"setRequestHeader"in te&&o.forEach(F,function(Oe,ce){typeof Q>"u"&&ce.toLowerCase()==="content-type"?delete F[ce]:te.setRequestHeader(ce,Oe)}),o.isUndefined(C.withCredentials)||(te.withCredentials=!!C.withCredentials),U&&U!=="json"&&(te.responseType=C.responseType),typeof C.onDownloadProgress=="function"&&te.addEventListener("progress",C.onDownloadProgress),typeof C.onUploadProgress=="function"&&te.upload&&te.upload.addEventListener("progress",C.onUploadProgress),(C.cancelToken||C.signal)&&(K=function(Re){!te||($(!Re||Re&&Re.type?new b("canceled"):Re),te.abort(),te=null)},C.cancelToken&&C.cancelToken.subscribe(K),C.signal&&(C.signal.aborted?K():C.signal.addEventListener("abort",K))),Q||(Q=null),te.send(Q)})},sne}var rne,sle;function jz(){if(sle)return rne;sle=1;var o=Hp,e=_2e,t=ipe,s={"Content-Type":"application/x-www-form-urlencoded"};function a(h,b){!o.isUndefined(h)&&o.isUndefined(h["Content-Type"])&&(h["Content-Type"]=b)}function l(){var h;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(h=ole()),h}function u(h,b,y){if(o.isString(h))try{return(b||JSON.parse)(h),o.trim(h)}catch(C){if(C.name!=="SyntaxError")throw C}return(y||JSON.stringify)(h)}var d={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(b,y){return e(y,"Accept"),e(y,"Content-Type"),o.isFormData(b)||o.isArrayBuffer(b)||o.isBuffer(b)||o.isStream(b)||o.isFile(b)||o.isBlob(b)?b:o.isArrayBufferView(b)?b.buffer:o.isURLSearchParams(b)?(a(y,"application/x-www-form-urlencoded;charset=utf-8"),b.toString()):o.isObject(b)||y&&y["Content-Type"]==="application/json"?(a(y,"application/json"),u(b)):b}],transformResponse:[function(b){var y=this.transitional||d.transitional,C=y&&y.silentJSONParsing,E=y&&y.forcedJSONParsing,R=!C&&this.responseType==="json";if(R||E&&o.isString(b)&&b.length)try{return JSON.parse(b)}catch($){if(R)throw $.name==="SyntaxError"?t($,this,"E_JSON_PARSE"):$}return b}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(b){return b>=200&&b<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return o.forEach(["delete","get","head"],function(b){d.headers[b]={}}),o.forEach(["post","put","patch"],function(b){d.headers[b]=o.merge(s)}),rne=d,rne}var D2e=Hp,P2e=jz(),M2e=function(e,t,s){var a=this||P2e;return D2e.forEach(s,function(u){e=u.call(a,e,t)}),e},ine,rle;function lpe(){return rle||(rle=1,ine=function(e){return!!(e&&e.__CANCEL__)}),ine}var ile=Hp,ane=M2e,R2e=lpe(),$2e=jz(),N2e=Xz();function lne(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new N2e("canceled")}var I2e=function(e){lne(e),e.headers=e.headers||{},e.data=ane.call(e,e.data,e.headers,e.transformRequest),e.headers=ile.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ile.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||$2e.adapter;return t(e).then(function(a){return lne(e),a.data=ane.call(e,a.data,a.headers,e.transformResponse),a},function(a){return R2e(a)||(lne(e),a&&a.response&&(a.response.data=ane.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},A1=Hp,cpe=function(e,t){t=t||{};var s={};function a(y,C){return A1.isPlainObject(y)&&A1.isPlainObject(C)?A1.merge(y,C):A1.isPlainObject(C)?A1.merge({},C):A1.isArray(C)?C.slice():C}function l(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(e[y],t[y])}function u(y){if(!A1.isUndefined(t[y]))return a(void 0,t[y])}function d(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(void 0,t[y])}function h(y){if(y in t)return a(e[y],t[y]);if(y in e)return a(void 0,e[y])}var b={url:u,method:u,data:u,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h};return A1.forEach(Object.keys(e).concat(Object.keys(t)),function(C){var E=b[C]||l,R=E(C);A1.isUndefined(R)&&E!==h||(s[C]=R)}),s},cne,ale;function upe(){return ale||(ale=1,cne={version:"0.25.0"}),cne}var B2e=upe().version,ere={};["object","boolean","number","function","string","symbol"].forEach(function(o,e){ere[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o}});var lle={};ere.transitional=function(e,t,s){function a(l,u){return"[Axios v"+B2e+"] Transitional option '"+l+"'"+u+(s?". "+s:"")}return function(l,u,d){if(e===!1)throw new Error(a(u," has been removed"+(t?" in "+t:"")));return t&&!lle[u]&&(lle[u]=!0,console.warn(a(u," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(l,u,d):!0}};function L2e(o,e,t){if(typeof o!="object")throw new TypeError("options must be an object");for(var s=Object.keys(o),a=s.length;a-- >0;){var l=s[a],u=e[l];if(u){var d=o[l],h=d===void 0||u(d,l,o);if(h!==!0)throw new TypeError("option "+l+" must be "+h);continue}if(t!==!0)throw Error("Unknown option "+l)}}var F2e={assertOptions:L2e,validators:ere},fpe=Hp,Q2e=rpe,cle=y2e,ule=I2e,qz=cpe,dpe=F2e,G4=dpe.validators;function U6(o){this.defaults=o,this.interceptors={request:new cle,response:new cle}}U6.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=qz(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&&dpe.assertOptions(s,{silentJSONParsing:G4.transitional(G4.boolean),forcedJSONParsing:G4.transitional(G4.boolean),clarifyTimeoutError:G4.transitional(G4.boolean)},!1);var a=[],l=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(t)===!1||(l=l&&R.synchronous,a.unshift(R.fulfilled,R.rejected))});var u=[];this.interceptors.response.forEach(function(R){u.push(R.fulfilled,R.rejected)});var d;if(!l){var h=[ule,void 0];for(Array.prototype.unshift.apply(h,a),h=h.concat(u),d=Promise.resolve(t);h.length;)d=d.then(h.shift(),h.shift());return d}for(var b=t;a.length;){var y=a.shift(),C=a.shift();try{b=y(b)}catch(E){C(E);break}}try{d=ule(b)}catch(E){return Promise.reject(E)}for(;u.length;)d=d.then(u.shift(),u.shift());return d};U6.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=qz(this.defaults,e),Q2e(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};fpe.forEach(["delete","get","head","options"],function(e){U6.prototype[e]=function(t,s){return this.request(qz(s||{},{method:e,url:t,data:(s||{}).data}))}});fpe.forEach(["post","put","patch"],function(e){U6.prototype[e]=function(t,s,a){return this.request(qz(a||{},{method:e,url:t,data:s}))}});var Z2e=U6,une,fle;function H2e(){if(fle)return une;fle=1;var o=Xz();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(u){s=u});var a=this;this.promise.then(function(l){if(!!a._listeners){var u,d=a._listeners.length;for(u=0;u<d;u++)a._listeners[u](l);a._listeners=null}}),this.promise.then=function(l){var u,d=new Promise(function(h){a.subscribe(h),u=h}).then(l);return d.cancel=function(){a.unsubscribe(u)},d},t(function(u){a.reason||(a.reason=new o(u),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(u){s=u});return{token:a,cancel:s}},une=e,une}var fne,dle;function z2e(){return dle||(dle=1,fne=function(e){return function(s){return e.apply(null,s)}}),fne}var dne,hle;function V2e(){if(hle)return dne;hle=1;var o=Hp;return dne=function(t){return o.isObject(t)&&t.isAxiosError===!0},dne}var mle=Hp,W2e=tpe,_H=Z2e,U2e=cpe,Y2e=jz();function hpe(o){var e=new _H(o),t=W2e(_H.prototype.request,e);return mle.extend(t,_H.prototype,e),mle.extend(t,e),t.create=function(a){return hpe(U2e(o,a))},t}var Sy=hpe(Y2e);Sy.Axios=_H;Sy.Cancel=Xz();Sy.CancelToken=H2e();Sy.isCancel=lpe();Sy.VERSION=upe().version;Sy.all=function(e){return Promise.all(e)};Sy.spread=z2e();Sy.isAxiosError=V2e();Gse.exports=Sy;Gse.exports.default=Sy;(function(o){o.exports=Gse.exports})(epe);const mpe=o2e(epe.exports);window.axios=mpe;const X2e=mpe;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.interceptors.request.use(function(o){let e;e=document.querySelectorAll(".btn-spinner");for(let t=0;t<e.length;++t)e[t].classList.add("spinner-on"),e[t].disabled=!0;return o},function(o){return Promise.reject(o)});window.axios.interceptors.response.use(function(o){let e;e=document.querySelectorAll(".btn-spinner");for(let t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return o},function(o){let e;e=document.querySelectorAll(".btn-spinner");for(let t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return Promise.reject(o)});function un(){}const gpe=o=>o;function Y6(o,e){for(const t in e)o[t]=e[t];return o}function ppe(o){return o()}function gle(){return Object.create(null)}function vi(o){o.forEach(ppe)}function Ub(o){return typeof o=="function"}function lo(o,e){return o!=o?e==e:o!==e||o&&typeof o=="object"||typeof o=="function"}let $Z;function ple(o,e){return $Z||($Z=document.createElement("a")),$Z.href=e,o===$Z.href}function j2e(o){return Object.keys(o).length===0}function YH(o,e,t,s){if(o){const a=bpe(o,e,t,s);return o[0](a)}}function bpe(o,e,t,s){return o[1]&&s?Y6(t.ctx.slice(),o[1](s(e))):t.ctx}function XH(o,e,t,s){if(o[2]&&s){const a=o[2](s(t));if(e.dirty===void 0)return a;if(typeof a=="object"){const l=[],u=Math.max(e.dirty.length,a.length);for(let d=0;d<u;d+=1)l[d]=e.dirty[d]|a[d];return l}return e.dirty|a}return e.dirty}function jH(o,e,t,s,a,l){if(a){const u=bpe(e,t,s,l);o.p(u,a)}}function qH(o){if(o.ctx.length>32){const e=[],t=o.ctx.length/32;for(let s=0;s<t;s++)e[s]=-1;return e}return-1}function ble(o){const e=typeof o=="string"&&o.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[o,"px"]}const vpe=typeof window<"u";let Ope=vpe?()=>window.performance.now():()=>Date.now(),tre=vpe?o=>requestAnimationFrame(o):un;const bD=new Set;function ype(o){bD.forEach(e=>{e.c(o)||(bD.delete(e),e.f())}),bD.size!==0&&tre(ype)}function wpe(o){let e;return bD.size===0&&tre(ype),{promise:new Promise(t=>{bD.add(e={c:o,f:t})}),abort(){bD.delete(e)}}}const q2e=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function X(o,e){o.appendChild(e)}function _pe(o){if(!o)return document;const e=o.getRootNode?o.getRootNode():o.ownerDocument;return e&&e.host?e:o.ownerDocument}function G2e(o){const e=re("style");return K2e(_pe(o),e),e.sheet}function K2e(o,e){return X(o.head||o,e),e.sheet}function Te(o,e,t){o.insertBefore(e,t||null)}function ke(o){o.parentNode&&o.parentNode.removeChild(o)}function ia(o,e){for(let t=0;t<o.length;t+=1)o[t]&&o[t].d(e)}function re(o){return document.createElement(o)}function Spe(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function Ht(o){return document.createTextNode(o)}function Ze(){return Ht(" ")}function Rs(){return Ht("")}function mn(o,e,t,s){return o.addEventListener(e,t,s),()=>o.removeEventListener(e,t,s)}function ku(o){return function(e){return e.preventDefault(),o.call(this,e)}}function Z(o,e,t){t==null?o.removeAttribute(e):o.getAttribute(e)!==t&&o.setAttribute(e,t)}function nre(o){let e;return{p(...t){e=t,e.forEach(s=>o.push(s))},r(){e.forEach(t=>o.splice(o.indexOf(t),1))}}}function GH(o){return o===""?null:+o}function J2e(o){return Array.from(o.childNodes)}function Fn(o,e){e=""+e,o.data!==e&&(o.data=e)}function ar(o,e){o.value=e==null?"":e}function rs(o,e,t,s){t==null?o.style.removeProperty(e):o.style.setProperty(e,t,s?"important":"")}function NZ(o,e,t){for(let s=0;s<o.options.length;s+=1){const a=o.options[s];if(a.__value===e){a.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function vle(o){const e=o.querySelector(":checked");return e&&e.__value}function Vo(o,e,t){o.classList[t?"add":"remove"](e)}function Cpe(o,e,{bubbles:t=!1,cancelable:s=!1}={}){const a=document.createEvent("CustomEvent");return a.initCustomEvent(o,t,s,e),a}class ewe{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=Spe(t.nodeName):this.e=re(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)Te(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(ke)}}function EC(o,e){return new o(e)}const KH=new Map;let JH=0;function twe(o){let e=5381,t=o.length;for(;t--;)e=(e<<5)-e^o.charCodeAt(t);return e>>>0}function nwe(o,e){const t={stylesheet:G2e(e),rules:{}};return KH.set(o,t),t}function Moe(o,e,t,s,a,l,u,d=0){const h=16.666/s;let b=`{
|
|
`;for(let F=0;F<=1;F+=h){const U=e+(t-e)*l(F);b+=F*100+`%{${u(U,1-U)}}
|
|
`}const y=b+`100% {${u(t,1-t)}}
|
|
}`,C=`__svelte_${twe(y)}_${d}`,E=_pe(o),{stylesheet:R,rules:$}=KH.get(E)||nwe(E,o);$[C]||($[C]=!0,R.insertRule(`@keyframes ${C} ${y}`,R.cssRules.length));const Q=o.style.animation||"";return o.style.animation=`${Q?`${Q}, `:""}${C} ${s}ms linear ${a}ms 1 both`,JH+=1,C}function kpe(o,e){const t=(o.style.animation||"").split(", "),s=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=t.length-s.length;a&&(o.style.animation=s.join(", "),JH-=a,JH||owe())}function owe(){tre(()=>{JH||(KH.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&ke(e)}),KH.clear())})}function xpe(o,e,t,s){if(!e)return un;const a=o.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return un;const{delay:l=0,duration:u=300,easing:d=gpe,start:h=Ope()+l,end:b=h+u,tick:y=un,css:C}=t(o,{from:e,to:a},s);let E=!0,R=!1,$;function Q(){C&&($=Moe(o,0,1,u,l,d,C)),l||(R=!0)}function F(){C&&kpe(o,$),E=!1}return wpe(U=>{if(!R&&U>=h&&(R=!0),R&&U>=b&&(y(1,0),F()),!E)return!1;if(R){const K=U-h,L=0+1*d(K/u);y(L,1-L)}return!0}),Q(),y(0,1),F}function Tpe(o){const e=getComputedStyle(o);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:s}=e,a=o.getBoundingClientRect();o.style.position="absolute",o.style.width=t,o.style.height=s,swe(o,a)}}function swe(o,e){const t=o.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const s=getComputedStyle(o),a=s.transform==="none"?"":s.transform;o.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let y6;function r6(o){y6=o}function YD(){if(!y6)throw new Error("Function called outside component initialization");return y6}function W1(o){YD().$$.on_mount.push(o)}function Epe(o){YD().$$.after_update.push(o)}function ore(o){YD().$$.on_destroy.push(o)}function Fg(){const o=YD();return(e,t,{cancelable:s=!1}={})=>{const a=o.$$.callbacks[e];if(a){const l=Cpe(e,t,{cancelable:s});return a.slice().forEach(u=>{u.call(o,l)}),!l.defaultPrevented}return!0}}function dD(o,e){return YD().$$.context.set(o,e),e}function Ur(o){return YD().$$.context.get(o)}function SH(o,e){const t=o.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const rD=[],Ro=[];let vD=[];const Roe=[],rwe=Promise.resolve();let $oe=!1;function iwe(){$oe||($oe=!0,rwe.then(Ape))}function AC(o){vD.push(o)}function lr(o){Roe.push(o)}const hne=new Set;let K4=0;function Ape(){if(K4!==0)return;const o=y6;do{try{for(;K4<rD.length;){const e=rD[K4];K4++,r6(e),awe(e.$$)}}catch(e){throw rD.length=0,K4=0,e}for(r6(null),rD.length=0,K4=0;Ro.length;)Ro.pop()();for(let e=0;e<vD.length;e+=1){const t=vD[e];hne.has(t)||(hne.add(t),t())}vD.length=0}while(rD.length);for(;Roe.length;)Roe.pop()();$oe=!1,hne.clear(),r6(o)}function awe(o){if(o.fragment!==null){o.update(),vi(o.before_update);const e=o.dirty;o.dirty=[-1],o.fragment&&o.fragment.p(o.ctx,e),o.after_update.forEach(AC)}}function lwe(o){const e=[],t=[];vD.forEach(s=>o.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),vD=e}let IN;function cwe(){return IN||(IN=Promise.resolve(),IN.then(()=>{IN=null})),IN}function mne(o,e,t){o.dispatchEvent(Cpe(`${e?"intro":"outro"}${t}`))}const CH=new Set;let Lw;function mo(){Lw={r:0,c:[],p:Lw}}function go(){Lw.r||vi(Lw.c),Lw=Lw.p}function xe(o,e){o&&o.i&&(CH.delete(o),o.i(e))}function Be(o,e,t,s){if(o&&o.o){if(CH.has(o))return;CH.add(o),Lw.c.push(()=>{CH.delete(o),s&&(t&&o.d(1),s())}),o.o(e)}else s&&s()}const uwe={duration:0};function ez(o,e,t,s){const a={direction:"both"};let l=e(o,t,a),u=s?0:1,d=null,h=null,b=null;function y(){b&&kpe(o,b)}function C(R,$){const Q=R.b-u;return $*=Math.abs(Q),{a:u,b:R.b,d:Q,duration:$,start:R.start,end:R.start+$,group:R.group}}function E(R){const{delay:$=0,duration:Q=300,easing:F=gpe,tick:U=un,css:K}=l||uwe,L={start:Ope()+$,b:R};R||(L.group=Lw,Lw.r+=1),d||h?h=L:(K&&(y(),b=Moe(o,u,R,Q,$,F,K)),R&&U(0,1),d=C(L,Q),AC(()=>mne(o,R,"start")),wpe(te=>{if(h&&te>h.start&&(d=C(h,Q),h=null,mne(o,d.b,"start"),K&&(y(),b=Moe(o,u,d.b,d.duration,0,F,l.css))),d){if(te>=d.end)U(u=d.b,1-u),mne(o,d.b,"end"),h||(d.b?y():--d.group.r||vi(d.group.c)),d=null;else if(te>=d.start){const ne=te-d.start;u=d.a+d.d*F(ne/d.duration),U(u,1-u)}}return!!(d||h)}))}return{run(R){Ub(l)?cwe().then(()=>{l=l(a),E(R)}):E(R)},end(){y(),d=h=null}}}function XD(o,e){o.d(1),e.delete(o.key)}function xv(o,e){Be(o,1,1,()=>{e.delete(o.key)})}function Dpe(o,e){o.f(),xv(o,e)}function Jd(o,e,t,s,a,l,u,d,h,b,y,C){let E=o.length,R=l.length,$=E;const Q={};for(;$--;)Q[o[$].key]=$;const F=[],U=new Map,K=new Map,L=[];for($=R;$--;){const G=C(a,l,$),we=t(G);let ve=u.get(we);ve?s&&L.push(()=>ve.p(G,e)):(ve=b(we,G),ve.c()),U.set(we,F[$]=ve),we in Q&&K.set(we,Math.abs($-Q[we]))}const te=new Set,ne=new Set;function oe(G){xe(G,1),G.m(d,y),u.set(G.key,G),y=G.first,R--}for(;E&&R;){const G=F[R-1],we=o[E-1],ve=G.key,Re=we.key;G===we?(y=G.first,E--,R--):U.has(Re)?!u.has(ve)||te.has(ve)?oe(G):ne.has(Re)?E--:K.get(ve)>K.get(Re)?(ne.add(ve),oe(G)):(te.add(Re),E--):(h(we,u),E--)}for(;E--;){const G=o[E];U.has(G.key)||h(G,u)}for(;R;)oe(F[R-1]);return vi(L),F}function Gz(o,e){const t={},s={},a={$$scope:1};let l=o.length;for(;l--;){const u=o[l],d=e[l];if(d){for(const h in u)h in d||(s[h]=1);for(const h in d)a[h]||(t[h]=d[h],a[h]=1);o[l]=d}else for(const h in u)a[h]=1}for(const u in s)u in t||(t[u]=void 0);return t}function Kz(o){return typeof o=="object"&&o!==null?o:{}}function er(o,e,t){const s=o.$$.props[e];s!==void 0&&(o.$$.bound[s]=t,t(o.$$.ctx[s]))}function en(o){o&&o.c()}function Kt(o,e,t,s){const{fragment:a,after_update:l}=o.$$;a&&a.m(e,t),s||AC(()=>{const u=o.$$.on_mount.map(ppe).filter(Ub);o.$$.on_destroy?o.$$.on_destroy.push(...u):vi(u),o.$$.on_mount=[]}),l.forEach(AC)}function Jt(o,e){const t=o.$$;t.fragment!==null&&(lwe(t.after_update),vi(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function fwe(o,e){o.$$.dirty[0]===-1&&(rD.push(o),iwe(),o.$$.dirty.fill(0)),o.$$.dirty[e/31|0]|=1<<e%31}function co(o,e,t,s,a,l,u,d=[-1]){const h=y6;r6(o);const b=o.$$={fragment:null,ctx:[],props:l,update:un,not_equal:a,bound:gle(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(h?h.$$.context:[])),callbacks:gle(),dirty:d,skip_bound:!1,root:e.target||h.$$.root};u&&u(b.root);let y=!1;if(b.ctx=t?t(o,e.props||{},(C,E,...R)=>{const $=R.length?R[0]:E;return b.ctx&&a(b.ctx[C],b.ctx[C]=$)&&(!b.skip_bound&&b.bound[C]&&b.bound[C]($),y&&fwe(o,C)),E}):[],b.update(),y=!0,vi(b.before_update),b.fragment=s?s(b.ctx):!1,e.target){if(e.hydrate){const C=J2e(e.target);b.fragment&&b.fragment.l(C),C.forEach(ke)}else b.fragment&&b.fragment.c();e.intro&&xe(o.$$.fragment),Kt(o,e.target,e.anchor,e.customElement),Ape()}r6(h)}class uo{$destroy(){Jt(this,1),this.$destroy=un}$on(e,t){if(!Ub(t))return un;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&&!j2e(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Ole(o){let e,t;return{c(){e=re("div"),t=Ht(o[0]),Z(e,"class","alert alert-danger"),Z(e,"role","alert")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&1&&Fn(t,s[0])},d(s){s&&ke(e)}}}function dwe(o){let e,t=o[0]&&Ole(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Ole(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function hwe(o,e,t){let{message:s=""}=e;return o.$$set=a=>{"message"in a&&t(0,s=a.message)},[s]}class X6 extends uo{constructor(e){super(),co(this,e,hwe,dwe,lo,{message:0})}}function mwe(o){let e,t,s,a;return{c(){e=re("button"),t=re("span"),s=Ze(),a=Ht(o[0]),Z(t,"class","spinner-border spinner-border-sm"),Z(t,"role","status"),Z(t,"aria-hidden","true"),Z(e,"type","submit"),Z(e,"class","btn btn-primary btn-spinner"),e.disabled=o[1]},m(l,u){Te(l,e,u),X(e,t),X(e,s),X(e,a)},p(l,[u]){u&1&&Fn(a,l[0]),u&2&&(e.disabled=l[1])},i:un,o:un,d(l){l&&ke(e)}}}function gwe(o,e,t){let{label:s=""}=e,{disabled:a=!1}=e;return o.$$set=l=>{"label"in l&&t(0,s=l.label),"disabled"in l&&t(1,a=l.disabled)},[s,a]}class AD extends uo{constructor(e){super(),co(this,e,gwe,mwe,lo,{label:0,disabled:1})}}function pwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L;return t=new X6({props:{message:o[2]}}),F=new AD({props:{label:"Register"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),a=re("form"),l=re("div"),u=re("label"),u.textContent="Name",d=Ze(),h=re("input"),b=Ze(),y=re("div"),C=re("label"),C.textContent="Email address",E=Ze(),R=re("input"),$=Ze(),Q=re("div"),en(F.$$.fragment),Z(u,"for","name"),Z(u,"class","form-label"),Z(h,"type","text"),Z(h,"class","form-control"),Z(h,"id","name"),Z(l,"class","mb-3"),Z(C,"for","email"),Z(C,"class","form-label"),Z(R,"type","email"),Z(R,"class","form-control"),Z(R,"id","email"),Z(y,"class","mb-3"),Z(Q,"class","text-center mt-5 d-block"),Z(e,"class","wrapper-tiny")},m(te,ne){Te(te,e,ne),Kt(t,e,null),X(e,s),X(e,a),X(a,l),X(l,u),X(l,d),X(l,h),ar(h,o[1]),X(a,b),X(a,y),X(y,C),X(y,E),X(y,R),ar(R,o[0]),X(a,$),X(a,Q),Kt(F,Q,null),U=!0,K||(L=[mn(h,"input",o[4]),mn(R,"input",o[5]),mn(a,"submit",o[3])],K=!0)},p(te,[ne]){const oe={};ne&4&&(oe.message=te[2]),t.$set(oe),ne&2&&h.value!==te[1]&&ar(h,te[1]),ne&1&&R.value!==te[0]&&ar(R,te[0])},i(te){U||(xe(t.$$.fragment,te),xe(F.$$.fragment,te),U=!0)},o(te){Be(t.$$.fragment,te),Be(F.$$.fragment,te),U=!1},d(te){te&&ke(e),Jt(t),Jt(F),K=!1,vi(L)}}}function bwe(o,e,t){const s=Ur("channel");let a="",{email:l=""}=e,u="";function d(y){y.preventDefault(),t(2,u=""),axios.post(s.lucentUrl+"/register",{name:a,email:l}).then(()=>{window.location=s.lucentUrl+"/login"}).catch(C=>{var E;t(2,u=(E=C.response)==null?void 0:E.data.error),console.log({errorMessage:u})})}function h(){a=this.value,t(1,a)}function b(){l=this.value,t(0,l)}return o.$$set=y=>{"email"in y&&t(0,l=y.email)},[l,a,u,d,h,b]}class vwe extends uo{constructor(e){super(),co(this,e,bwe,pwe,lo,{email:0})}}function Owe(o){let e,t,s,a,l,u,d,h,b,y,C;return h=new AD({props:{label:"Login"}}),{c(){e=re("form"),t=re("div"),s=re("label"),s.textContent="Email address",a=Ze(),l=re("input"),u=Ze(),d=re("div"),en(h.$$.fragment),Z(s,"for","emailaddress"),Z(s,"class","form-label"),Z(l,"type","email"),Z(l,"class","form-control"),Z(l,"id","emailaddress"),l.required=!0,Z(t,"class","mb-3"),Z(d,"class","text-center mt-5 d-block")},m(E,R){Te(E,e,R),X(e,t),X(t,s),X(t,a),X(t,l),ar(l,o[0]),X(e,u),X(e,d),Kt(h,d,null),b=!0,y||(C=[mn(l,"input",o[3]),mn(e,"submit",o[2])],y=!0)},p(E,R){R&1&&l.value!==E[0]&&ar(l,E[0])},i(E){b||(xe(h.$$.fragment,E),b=!0)},o(E){Be(h.$$.fragment,E),b=!1},d(E){E&&ke(e),Jt(h),y=!1,vi(C)}}}function ywe(o){let e,t;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","alert alert-info"),Z(e,"role","alert")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&2&&Fn(t,s[1])},i:un,o:un,d(s){s&&ke(e)}}}function wwe(o){let e,t,s,a;const l=[ywe,Owe],u=[];function d(h,b){return h[1]?0:1}return t=d(o),s=u[t]=l[t](o),{c(){e=re("div"),s.c(),Z(e,"class","wrapper-tiny")},m(h,b){Te(h,e,b),u[t].m(e,null),a=!0},p(h,[b]){let y=t;t=d(h),t===y?u[t].p(h,b):(mo(),Be(u[y],1,1,()=>{u[y]=null}),go(),s=u[t],s?s.p(h,b):(s=u[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Be(s),a=!1},d(h){h&&ke(e),u[t].d()}}}function _we(o,e,t){const s=Ur("channel");let a="",l="";function u(h){h.preventDefault(),axios.post(s.lucentUrl+"/login",{email:a}).then(b=>{console.log(b),t(1,l="You will receive an email with a login link")}).catch(b=>{})}function d(){a=this.value,t(0,a)}return[a,l,u,d]}class Swe extends uo{constructor(e){super(),co(this,e,_we,wwe,lo,{})}}function Ppe(o){const e=o-1;return e*e*e+1}function Mpe(o){return--o*o*o*o*o+1}function tz(o,{delay:e=0,duration:t=400,easing:s=Ppe,x:a=0,y:l=0,opacity:u=0}={}){const d=getComputedStyle(o),h=+d.opacity,b=d.transform==="none"?"":d.transform,y=h*(1-u),[C,E]=ble(a),[R,$]=ble(l);return{delay:e,duration:t,easing:s,css:(Q,F)=>`
|
|
transform: ${b} translate(${(1-Q)*C}${E}, ${(1-Q)*R}${$});
|
|
opacity: ${h-y*F}`}}function yle(o){let e,t,s,a;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),Z(e,"role","alert")},m(l,u){Te(l,e,u),X(e,t),a=!0},p(l,u){(!a||u&2)&&Fn(t,l[1])},i(l){a||(AC(()=>{!a||(s||(s=ez(e,tz,{duration:500},!0)),s.run(1))}),a=!0)},o(l){s||(s=ez(e,tz,{duration:500},!1)),s.run(0),a=!1},d(l){l&&ke(e),l&&s&&s.end()}}}function Cwe(o){let e,t,s=o[0]&&yle(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&xe(s,1)):(s=yle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function kwe(o,e,t){let s,a;function l(u="Saved"){t(1,s=u),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,s="Saved"),t(0,a=!1),[a,s,l]}class sre extends uo{constructor(e){super(),co(this,e,kwe,Cwe,lo,{show:2})}get show(){return this.$$.ctx[2]}}function xwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q={};return e=new sre({props:Q}),o[4](e),C=new AD({props:{label:"Enter"}}),{c(){en(e.$$.fragment),t=Ze(),s=re("div"),a=re("form"),l=re("div"),u=re("h3"),d=Ht("Login as "),h=Ht(o[0]),b=Ze(),y=re("div"),en(C.$$.fragment),Z(l,"class","mb-3 text-center"),Z(y,"class","text-center mt-5 d-block"),Z(s,"class","wrapper-tiny")},m(F,U){Kt(e,F,U),Te(F,t,U),Te(F,s,U),X(s,a),X(a,l),X(l,u),X(u,d),X(u,h),X(a,b),X(a,y),Kt(C,y,null),E=!0,R||($=mn(a,"submit",o[2]),R=!0)},p(F,[U]){const K={};e.$set(K),(!E||U&1)&&Fn(h,F[0])},i(F){E||(xe(e.$$.fragment,F),xe(C.$$.fragment,F),E=!0)},o(F){Be(e.$$.fragment,F),Be(C.$$.fragment,F),E=!1},d(F){o[4](null),Jt(e,F),F&&ke(t),F&&ke(s),Jt(C),R=!1,$()}}}function Twe(o,e,t){const s=Ur("channel");let{email:a}=e,{token:l}=e,u;function d(b){b.preventDefault(),axios.post(s.lucentUrl+"/verify",{email:a,token:l}).then(y=>{window.location=s.lucentUrl}).catch(y=>{})}function h(b){Ro[b?"unshift":"push"](()=>{u=b,t(1,u)})}return o.$$set=b=>{"email"in b&&t(0,a=b.email),"token"in b&&t(3,l=b.token)},[a,u,d,l,h]}class Ewe extends uo{constructor(e){super(),co(this,e,Twe,xwe,lo,{email:0,token:3})}}function Awe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Ht(o[2]),Z(t,"class","avatar__letters"),Z(e,"class","avatar"),Z(e,"title",o[0]),rs(e,"background-color",o[3][o[4]]),rs(e,"height",o[1]+"px"),rs(e,"width",o[1]+"px"),rs(e,"font-size",o[1]/2+"px")},m(a,l){Te(a,e,l),X(e,t),X(t,s)},p(a,[l]){l&4&&Fn(s,a[2]),l&1&&Z(e,"title",a[0]),l&2&&rs(e,"height",a[1]+"px"),l&2&&rs(e,"width",a[1]+"px"),l&2&&rs(e,"font-size",a[1]/2+"px")},i:un,o:un,d(a){a&&ke(e)}}}function Dwe(o,e,t){let{name:s}=e,{side:a=48}=e;const l=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let u="";s.split(" ").length>1?u=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[1].charAt(0).toUpperCase():u=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[0].charAt(1).toUpperCase();let h=(s.charCodeAt(1)+s.length)%19;return o.$$set=b=>{"name"in b&&t(0,s=b.name),"side"in b&&t(1,a=b.side)},[s,a,u,l,h]}class vy extends uo{constructor(e){super(),co(this,e,Dwe,Awe,lo,{name:0,side:1})}}function Pwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re;t=new X6({props:{message:o[2]}});let Oe={};return a=new sre({props:Oe}),o[8](a),d=new vy({props:{name:o[4].name}}),R=new AD({props:{label:"Update"}}),L=new AD({props:{label:"Update"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),en(a.$$.fragment),l=Ze(),u=re("h3"),en(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),C=re("input"),E=Ze(),en(R.$$.fragment),$=Ze(),Q=re("form"),F=re("div"),U=re("input"),K=Ze(),en(L.$$.fragment),te=Ze(),ne=re("div"),oe=re("a"),G=Ht(`Logout from this
|
|
device`),Z(u,"class","header-small mb-5"),Z(C,"type","text"),Z(C,"class","form-control"),Z(C,"placeholder","Name"),C.required=!0,Z(y,"class","input-group mb-3"),Z(U,"type","email"),Z(U,"class","form-control"),Z(U,"placeholder","Email"),U.required=!0,Z(F,"class","input-group mb-3"),Z(oe,"class","list-group-item list-group-item-action"),Z(oe,"href",o[5].lucentUrl+"/logout"),Z(ne,"class","list-group"),Z(e,"class","wrapper-tiny")},m(ce,Xe){Te(ce,e,Xe),Kt(t,e,null),X(e,s),Kt(a,e,null),X(e,l),X(e,u),Kt(d,u,null),X(e,h),X(e,b),X(b,y),X(y,C),ar(C,o[0]),X(y,E),Kt(R,y,null),X(e,$),X(e,Q),X(Q,F),X(F,U),ar(U,o[1]),X(F,K),Kt(L,F,null),X(e,te),X(e,ne),X(ne,oe),X(oe,G),we=!0,ve||(Re=[mn(C,"input",o[9]),mn(b,"submit",o[6]),mn(U,"input",o[10]),mn(Q,"submit",o[7])],ve=!0)},p(ce,[Xe]){const tt={};Xe&4&&(tt.message=ce[2]),t.$set(tt);const ot={};a.$set(ot),Xe&1&&C.value!==ce[0]&&ar(C,ce[0]),Xe&2&&U.value!==ce[1]&&ar(U,ce[1])},i(ce){we||(xe(t.$$.fragment,ce),xe(a.$$.fragment,ce),xe(d.$$.fragment,ce),xe(R.$$.fragment,ce),xe(L.$$.fragment,ce),we=!0)},o(ce){Be(t.$$.fragment,ce),Be(a.$$.fragment,ce),Be(d.$$.fragment,ce),Be(R.$$.fragment,ce),Be(L.$$.fragment,ce),we=!1},d(ce){ce&&ke(e),Jt(t),o[8](null),Jt(a),Jt(d),Jt(R),Jt(L),ve=!1,vi(Re)}}}function Mwe(o,e,t){const s=Ur("user"),a=Ur("channel");let l=s.name,u=s.email,d="",h;function b($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-name",{name:l}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function y($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-email",{email:u}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function C($){Ro[$?"unshift":"push"](()=>{h=$,t(3,h)})}function E(){l=this.value,t(0,l)}function R(){u=this.value,t(1,u)}return[l,u,d,h,s,a,b,y,C,E,R]}class Rwe extends uo{constructor(e){super(),co(this,e,Mwe,Pwe,lo,{})}}function $we(o){let e,t,s,a=o[3].name+"",l,u,d,h,b,y;const C=[{title:o[0]},o[2]];var E=o[4][o[1]];function R($){let Q={};for(let F=0;F<C.length;F+=1)Q=Y6(Q,C[F]);return{props:Q}}return E&&(b=EC(E,R())),{c(){e=re("div"),t=re("h1"),s=re("a"),l=Ht(a),d=Ze(),h=re("div"),b&&en(b.$$.fragment),Z(s,"class","text-decoration-none"),Z(s,"href",u=o[3].lucentUrl),Z(e,"class","text-center")},m($,Q){Te($,e,Q),X(e,t),X(t,s),X(s,l),Te($,d,Q),Te($,h,Q),b&&Kt(b,h,null),y=!0},p($,[Q]){(!y||Q&8)&&a!==(a=$[3].name+"")&&Fn(l,a),(!y||Q&8&&u!==(u=$[3].lucentUrl))&&Z(s,"href",u);const F=Q&5?Gz(C,[Q&1&&{title:$[0]},Q&4&&Kz($[2])]):{};if(Q&2&&E!==(E=$[4][$[1]])){if(b){mo();const U=b;Be(U.$$.fragment,1,0,()=>{Jt(U,1)}),go()}E?(b=EC(E,R()),en(b.$$.fragment),xe(b.$$.fragment,1),Kt(b,h,null)):b=null}else E&&b.$set(F)},i($){y||(b&&xe(b.$$.fragment,$),y=!0)},o($){b&&Be(b.$$.fragment,$),y=!1},d($){$&&ke(e),$&&ke(d),$&&ke(h),b&&Jt(b)}}}function Nwe(o,e,t){const s={register:vwe,login:Swe,verify:Ewe,profile:Rwe};let{title:a}=e,{view:l}=e,{user:u}=e,{data:d}=e,{channel:h}=e;return dD("channel",h),dD("user",u),o.$$set=b=>{"title"in b&&t(0,a=b.title),"view"in b&&t(1,l=b.view),"user"in b&&t(5,u=b.user),"data"in b&&t(2,d=b.data),"channel"in b&&t(3,h=b.channel)},[a,l,d,h,s,u]}class Iwe extends uo{constructor(e){super(),co(this,e,Nwe,$we,lo,{title:0,view:1,user:5,data:2,channel:3})}}var Lc={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(o,e){(function(){var t,s="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",d="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",b=500,y="__lodash_placeholder__",C=1,E=2,R=4,$=1,Q=2,F=1,U=2,K=4,L=8,te=16,ne=32,oe=64,G=128,we=256,ve=512,Re=30,Oe="...",ce=800,Xe=16,tt=1,ot=2,V=3,ut=1/0,Qe=9007199254740991,Bt=17976931348623157e292,Ct=0/0,He=4294967295,st=He-1,rn=He>>>1,Et=[["ary",G],["bind",F],["bindKey",U],["curry",L],["curryRight",te],["flip",ve],["partial",ne],["partialRight",oe],["rearg",we]],Cn="[object Arguments]",je="[object Array]",mt="[object AsyncFunction]",he="[object Boolean]",Zo="[object Date]",Kn="[object DOMException]",so="[object Error]",Yo="[object Function]",as="[object GeneratorFunction]",kt="[object Map]",jt="[object Number]",pt="[object Null]",Ne="[object Object]",Gt="[object Promise]",bn="[object Proxy]",At="[object RegExp]",An="[object Set]",zn="[object String]",ps="[object Symbol]",oo="[object Undefined]",Ss="[object WeakMap]",Mr="[object WeakSet]",$s="[object ArrayBuffer]",tr="[object DataView]",Xs="[object Float32Array]",wa="[object Float64Array]",dr="[object Int8Array]",Ns="[object Int16Array]",qr="[object Int32Array]",$o="[object Uint8Array]",Po="[object Uint8ClampedArray]",Rr="[object Uint16Array]",Ls="[object Uint32Array]",aa=/\b__p \+= '';/g,bs=/\b(__p \+=) '' \+/g,_a=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ln=/&(?:amp|lt|gt|quot|#39);/g,vs=/[&<>"']/g,Qi=RegExp(ln.source),ze=RegExp(vs.source),et=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,Yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,po=/^\w*$/,wo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/[\\^$.*+?()[\]{}|]/g,os=RegExp(fn.source),xo=/^\s+/,fs=/\s/,kr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lr=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Yr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zi=/[()=,{}\[\]\/\s]/,Qa=/\\(\\)?/g,Oi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,Nt=/^0b[01]+$/i,Ut=/^\[object .+?Constructor\]$/,bo=/^0o[0-7]+$/i,Lo=/^(?:0|[1-9]\d*)$/,Go=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ei=/($^)/,lt=/['\n\r\u2028\u2029\\]/g,Xo="\\ud800-\\udfff",Ni="\\u0300-\\u036f",la="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",gr=Ni+la+ma,Fc="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",nl="\\xac\\xb1\\xd7\\xf7",ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",Ar=" \\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",gl="\\ufe0e\\ufe0f",kc=nl+ga+nr+Ar,nu="['\u2019]",xu="["+Xo+"]",yr="["+kc+"]",ol="["+gr+"]",Tu="\\d+",ou="["+Fc+"]",Yl="["+Cc+"]",Aa="[^"+Xo+kc+Tu+Fc+Cc+Ki+"]",Dr="\\ud83c[\\udffb-\\udfff]",Qm="(?:"+ol+"|"+Dr+")",xf="[^"+Xo+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Za="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+Ki+"]",Ji="\\u200d",Eu="(?:"+Yl+"|"+Aa+")",Qc="(?:"+ca+"|"+Aa+")",Ha="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",Zc="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",xc=Qm+"?",Cd="["+gl+"]?",Yf="(?:"+Ji+"(?:"+[xf,xr,Za].join("|")+")"+Cd+xc+")*",Au="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hc=Cd+xc+Yf,Tf="(?:"+[ou,xr,Za].join("|")+")"+Hc,su="(?:"+[xf+ol+"?",ol,xr,Za,xu].join("|")+")",kd=RegExp(nu,"g"),De=RegExp(ol,"g"),nt=RegExp(Dr+"(?="+Dr+")|"+su+Hc,"g"),bt=RegExp([ca+"?"+Yl+"+"+Ha+"(?="+[yr,ca,"$"].join("|")+")",Qc+"+"+Zc+"(?="+[yr,ca+Eu,"$"].join("|")+")",ca+"?"+Eu+"+"+Ha,ca+"+"+Zc,Xl,Au,Tu,Tf].join("|"),"g"),$t=RegExp("["+Ji+Xo+gr+gl+"]"),On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Mo=["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"],$r=-1,ys={};ys[Xs]=ys[wa]=ys[dr]=ys[Ns]=ys[qr]=ys[$o]=ys[Po]=ys[Rr]=ys[Ls]=!0,ys[Cn]=ys[je]=ys[$s]=ys[he]=ys[tr]=ys[Zo]=ys[so]=ys[Yo]=ys[kt]=ys[jt]=ys[Ne]=ys[At]=ys[An]=ys[zn]=ys[Ss]=!1;var ls={};ls[Cn]=ls[je]=ls[$s]=ls[tr]=ls[he]=ls[Zo]=ls[Xs]=ls[wa]=ls[dr]=ls[Ns]=ls[qr]=ls[kt]=ls[jt]=ls[Ne]=ls[At]=ls[An]=ls[zn]=ls[ps]=ls[$o]=ls[Po]=ls[Rr]=ls[Ls]=!0,ls[so]=ls[Yo]=ls[Ss]=!1;var Di={\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"},js={"&":"&","<":"<",">":">",'"':""","'":"'"},Hi={"&":"&","<":"<",">":">",""":'"',"'":"'"},Du={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xd=parseFloat,qn=parseInt,Zm=typeof NN=="object"&&NN&&NN.Object===Object&&NN,zi=typeof self=="object"&&self&&self.Object===Object&&self,me=Zm||zi||Function("return this")(),$e=e&&!e.nodeType&&e,Ue=$e&&!0&&o&&!o.nodeType&&o,It=Ue&&Ue.exports===$e,Bn=It&&Zm.process,es=function(){try{var vt=Ue&&Ue.require&&Ue.require("util").types;return vt||Bn&&Bn.binding&&Bn.binding("util")}catch{}}(),ro=es&&es.isArrayBuffer,yi=es&&es.isDate,gn=es&&es.isMap,Gr=es&&es.isRegExp,Ll=es&&es.isSet,ea=es&&es.isTypedArray;function ri(vt,cn,an){switch(an.length){case 0:return vt.call(cn);case 1:return vt.call(cn,an[0]);case 2:return vt.call(cn,an[0],an[1]);case 3:return vt.call(cn,an[0],an[1],an[2])}return vt.apply(cn,an)}function Ef(vt,cn,an,Eo){for(var or=-1,Xr=vt==null?0:vt.length;++or<Xr;){var fi=vt[or];cn(Eo,fi,an(fi),vt)}return Eo}function ks(vt,cn){for(var an=-1,Eo=vt==null?0:vt.length;++an<Eo&&cn(vt[an],an,vt)!==!1;);return vt}function ru(vt,cn){for(var an=vt==null?0:vt.length;an--&&cn(vt[an],an,vt)!==!1;);return vt}function Pi(vt,cn){for(var an=-1,Eo=vt==null?0:vt.length;++an<Eo;)if(!cn(vt[an],an,vt))return!1;return!0}function uc(vt,cn){for(var an=-1,Eo=vt==null?0:vt.length,or=0,Xr=[];++an<Eo;){var fi=vt[an];cn(fi,an,vt)&&(Xr[or++]=fi)}return Xr}function Ii(vt,cn){var an=vt==null?0:vt.length;return!!an&&za(vt,cn,0)>-1}function Xf(vt,cn,an){for(var Eo=-1,or=vt==null?0:vt.length;++Eo<or;)if(an(cn,vt[Eo]))return!0;return!1}function pa(vt,cn){for(var an=-1,Eo=vt==null?0:vt.length,or=Array(Eo);++an<Eo;)or[an]=cn(vt[an],an,vt);return or}function jf(vt,cn){for(var an=-1,Eo=cn.length,or=vt.length;++an<Eo;)vt[or+an]=cn[an];return vt}function pr(vt,cn,an,Eo){var or=-1,Xr=vt==null?0:vt.length;for(Eo&&Xr&&(an=vt[++or]);++or<Xr;)an=cn(an,vt[or],or,vt);return an}function Gu(vt,cn,an,Eo){var or=vt==null?0:vt.length;for(Eo&&or&&(an=vt[--or]);or--;)an=cn(an,vt[or],or,vt);return an}function Ku(vt,cn){for(var an=-1,Eo=vt==null?0:vt.length;++an<Eo;)if(cn(vt[an],an,vt))return!0;return!1}var Tc=sl("length");function qf(vt){return vt.split("")}function eh(vt){return vt.match(Yr)||[]}function ti(vt,cn,an){var Eo;return an(vt,function(or,Xr,fi){if(cn(or,Xr,fi))return Eo=Xr,!1}),Eo}function ta(vt,cn,an,Eo){for(var or=vt.length,Xr=an+(Eo?1:-1);Eo?Xr--:++Xr<or;)if(cn(vt[Xr],Xr,vt))return Xr;return-1}function za(vt,cn,an){return cn===cn?zp(vt,cn,an):ta(vt,Mi,an)}function Kb(vt,cn,an,Eo){for(var or=an-1,Xr=vt.length;++or<Xr;)if(Eo(vt[or],cn))return or;return-1}function Mi(vt){return vt!==vt}function kl(vt,cn){var an=vt==null?0:vt.length;return an?Af(vt,cn)/an:Ct}function sl(vt){return function(cn){return cn==null?t:cn[vt]}}function Zg(vt){return function(cn){return vt==null?t:vt[cn]}}function Gf(vt,cn,an,Eo,or){return or(vt,function(Xr,fi,wi){an=Eo?(Eo=!1,Xr):cn(an,Xr,fi,wi)}),an}function Ec(vt,cn){var an=vt.length;for(vt.sort(cn);an--;)vt[an]=vt[an].value;return vt}function Af(vt,cn){for(var an,Eo=-1,or=vt.length;++Eo<or;){var Xr=cn(vt[Eo]);Xr!==t&&(an=an===t?Xr:an+Xr)}return an}function Pr(vt,cn){for(var an=-1,Eo=Array(vt);++an<vt;)Eo[an]=cn(an);return Eo}function Ju(vt,cn){return pa(cn,function(an){return[an,vt[an]]})}function Fl(vt){return vt&&vt.slice(0,zg(vt)+1).replace(xo,"")}function Va(vt){return function(cn){return vt(cn)}}function qi(vt,cn){return pa(cn,function(an){return vt[an]})}function Vi(vt,cn){return vt.has(cn)}function fc(vt,cn){for(var an=-1,Eo=vt.length;++an<Eo&&za(cn,vt[an],0)>-1;);return an}function Kf(vt,cn){for(var an=vt.length;an--&&za(cn,vt[an],0)>-1;);return an}function th(vt,cn){for(var an=vt.length,Eo=0;an--;)vt[an]===cn&&++Eo;return Eo}var Hg=Zg(Di),Hm=Zg(js);function Ql(vt){return"\\"+Du[vt]}function zm(vt,cn){return vt==null?t:vt[cn]}function rl(vt){return $t.test(vt)}function Df(vt){return On.test(vt)}function jh(vt){for(var cn,an=[];!(cn=vt.next()).done;)an.push(cn.value);return an}function ef(vt){var cn=-1,an=Array(vt.size);return vt.forEach(function(Eo,or){an[++cn]=[or,Eo]}),an}function qh(vt,cn){return function(an){return vt(cn(an))}}function zc(vt,cn){for(var an=-1,Eo=vt.length,or=0,Xr=[];++an<Eo;){var fi=vt[an];(fi===cn||fi===y)&&(vt[an]=y,Xr[or++]=an)}return Xr}function Gh(vt){var cn=-1,an=Array(vt.size);return vt.forEach(function(Eo){an[++cn]=Eo}),an}function Pf(vt){var cn=-1,an=Array(vt.size);return vt.forEach(function(Eo){an[++cn]=[Eo,Eo]}),an}function zp(vt,cn,an){for(var Eo=an-1,or=vt.length;++Eo<or;)if(vt[Eo]===cn)return Eo;return-1}function Vm(vt,cn,an){for(var Eo=an+1;Eo--;)if(vt[Eo]===cn)return Eo;return Eo}function Jf(vt){return rl(vt)?nh(vt):Tc(vt)}function jl(vt){return rl(vt)?Pu(vt):qf(vt)}function zg(vt){for(var cn=vt.length;cn--&&fs.test(vt.charAt(cn)););return cn}var Ke=Zg(Hi);function nh(vt){for(var cn=nt.lastIndex=0;nt.test(vt);)++cn;return cn}function Pu(vt){return vt.match(nt)||[]}function Vg(vt){return vt.match(bt)||[]}var U1=function vt(cn){cn=cn==null?me:Kh.defaults(me.Object(),cn,Kh.pick(me,Mo));var an=cn.Array,Eo=cn.Date,or=cn.Error,Xr=cn.Function,fi=cn.Math,wi=cn.Object,oh=cn.RegExp,Jb=cn.String,Sa=cn.TypeError,Td=an.prototype,Wg=Xr.prototype,il=wi.prototype,Da=cn["__core-js_shared__"],tf=Wg.toString,ii=il.hasOwnProperty,Mu=0,dc=function(){var S=/[^.]+$/.exec(Da&&Da.keys&&Da.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),Jh=il.toString,Y1=tf.call(wi),sh=me._,Ug=oh("^"+tf.call(ii).replace(fn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rh=It?cn.Buffer:t,ql=cn.Symbol,em=cn.Uint8Array,X1=rh?rh.allocUnsafe:t,Wm=qh(wi.getPrototypeOf,wi),Yg=wi.create,tm=il.propertyIsEnumerable,ih=Td.splice,Ed=ql?ql.isConcatSpreadable:t,ai=ql?ql.iterator:t,di=ql?ql.toStringTag:t,Zl=function(){try{var S=op(wi,"defineProperty");return S({},"",{}),S}catch{}}(),Vp=cn.clearTimeout!==me.clearTimeout&&cn.clearTimeout,ee=Eo&&Eo.now!==me.Date.now&&Eo.now,ue=cn.setTimeout!==me.setTimeout&&cn.setTimeout,Se=fi.ceil,Je=fi.floor,at=wi.getOwnPropertySymbols,Dn=rh?rh.isBuffer:t,wn=cn.isFinite,Ko=Td.join,ss=qh(wi.keys,wi),vo=fi.max,Tr=fi.min,Gl=Eo.now,ua=cn.parseInt,Bi=fi.random,Ru=Td.reverse,Pa=op(cn,"DataView"),nm=op(cn,"Map"),Um=op(cn,"Promise"),Wi=op(cn,"Set"),Ca=op(cn,"WeakMap"),iu=op(wi,"create"),ah=Ca&&new Ca,na={},e0=cp(Pa),Dv=cp(nm),ni=cp(Um),Ad=cp(Wi),wr=cp(Ca),Kl=ql?ql.prototype:t,ed=Kl?Kl.valueOf:t,lh=Kl?Kl.toString:t;function Ae(S){if(Pl(S)&&!Sr(S)&&!(S instanceof hi)){if(S instanceof $u)return S;if(ii.call(S,"__wrapped__"))return Zv(S)}return new $u(S)}var Mf=function(){function S(){}return function(A){if(!Ol(A))return{};if(Yg)return Yg(A);S.prototype=A;var H=new S;return S.prototype=t,H}}();function Xg(){}function $u(S,A){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!A,this.__index__=0,this.__values__=t}Ae.templateSettings={escape:et,evaluate:Tt,interpolate:Wt,variable:"",imports:{_:Ae}},Ae.prototype=Xg.prototype,Ae.prototype.constructor=Ae,$u.prototype=Mf(Xg.prototype),$u.prototype.constructor=$u;function hi(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function Pv(){var S=new hi(this.__wrapped__);return S.__actions__=du(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=du(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=du(this.__views__),S}function j1(){if(this.__filtered__){var S=new hi(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function t0(){var S=this.__wrapped__.value(),A=this.__dir__,H=Sr(S),le=A<0,Ce=H?S.length:0,We=TE(0,Ce,this.__views__),ht=We.start,St=We.end,zt=St-ht,vn=le?St:ht-1,Zn=this.__iteratees__,Vn=Zn.length,Fo=0,ms=Tr(zt,this.__takeCount__);if(!H||!le&&Ce==zt&&ms==zt)return Kg(S,this.__actions__);var Is=[];e:for(;zt--&&Fo<ms;){vn+=A;for(var Hr=-1,Zs=S[vn];++Hr<Vn;){var gi=Zn[Hr],ki=gi.iteratee,Ou=gi.type,Zu=ki(Zs);if(Ou==ot)Zs=Zu;else if(!Zu){if(Ou==tt)continue e;break e}}Is[Fo++]=Zs}return Is}hi.prototype=Mf(Xg.prototype),hi.prototype.constructor=hi;function td(S){var A=-1,H=S==null?0:S.length;for(this.clear();++A<H;){var le=S[A];this.set(le[0],le[1])}}function Ym(){this.__data__=iu?iu(null):{},this.size=0}function jg(S){var A=this.has(S)&&delete this.__data__[S];return this.size-=A?1:0,A}function Mv(S){var A=this.__data__;if(iu){var H=A[S];return H===h?t:H}return ii.call(A,S)?A[S]:t}function Rf(S){var A=this.__data__;return iu?A[S]!==t:ii.call(A,S)}function xy(S,A){var H=this.__data__;return this.size+=this.has(S)?0:1,H[S]=iu&&A===t?h:A,this}td.prototype.clear=Ym,td.prototype.delete=jg,td.prototype.get=Mv,td.prototype.has=Rf,td.prototype.set=xy;function Nu(S){var A=-1,H=S==null?0:S.length;for(this.clear();++A<H;){var le=S[A];this.set(le[0],le[1])}}function nf(){this.__data__=[],this.size=0}function n0(S){var A=this.__data__,H=Md(A,S);if(H<0)return!1;var le=A.length-1;return H==le?A.pop():ih.call(A,H,1),--this.size,!0}function o0(S){var A=this.__data__,H=Md(A,S);return H<0?t:A[H][1]}function s0(S){return Md(this.__data__,S)>-1}function q1(S,A){var H=this.__data__,le=Md(H,S);return le<0?(++this.size,H.push([S,A])):H[le][1]=A,this}Nu.prototype.clear=nf,Nu.prototype.delete=n0,Nu.prototype.get=o0,Nu.prototype.has=s0,Nu.prototype.set=q1;function nd(S){var A=-1,H=S==null?0:S.length;for(this.clear();++A<H;){var le=S[A];this.set(le[0],le[1])}}function r0(){this.size=0,this.__data__={hash:new td,map:new(nm||Nu),string:new td}}function i0(S){var A=jp(this,S).delete(S);return this.size-=A?1:0,A}function pl(S){return jp(this,S).get(S)}function Ty(S){return jp(this,S).has(S)}function _i(S,A){var H=jp(this,S),le=H.size;return H.set(S,A),this.size+=H.size==le?0:1,this}nd.prototype.clear=r0,nd.prototype.delete=i0,nd.prototype.get=pl,nd.prototype.has=Ty,nd.prototype.set=_i;function fo(S){var A=-1,H=S==null?0:S.length;for(this.__data__=new nd;++A<H;)this.add(S[A])}function Dd(S){return this.__data__.set(S,h),this}function Jn(S){return this.__data__.has(S)}fo.prototype.add=fo.prototype.push=Dd,fo.prototype.has=Jn;function Ac(S){var A=this.__data__=new Nu(S);this.size=A.size}function $f(){this.__data__=new Nu,this.size=0}function ch(S){var A=this.__data__,H=A.delete(S);return this.size=A.size,H}function Vc(S){return this.__data__.get(S)}function qg(S){return this.__data__.has(S)}function Pd(S,A){var H=this.__data__;if(H instanceof Nu){var le=H.__data__;if(!nm||le.length<a-1)return le.push([S,A]),this.size=++H.size,this;H=this.__data__=new nd(le)}return H.set(S,A),this.size=H.size,this}Ac.prototype.clear=$f,Ac.prototype.delete=ch,Ac.prototype.get=Vc,Ac.prototype.has=qg,Ac.prototype.set=Pd;function bl(S,A){var H=Sr(S),le=!H&&dm(S),Ce=!H&&!le&&gg(S),We=!H&&!le&&!Ce&&Qd(S),ht=H||le||Ce||We,St=ht?Pr(S.length,Jb):[],zt=St.length;for(var vn in S)(A||ii.call(S,vn))&&!(ht&&(vn=="length"||Ce&&(vn=="offset"||vn=="parent")||We&&(vn=="buffer"||vn=="byteLength"||vn=="byteOffset")||lm(vn,zt)))&&St.push(vn);return St}function Iu(S){var A=S.length;return A?S[Nf(0,A-1)]:t}function Wp(S,A){return Yc(du(S),ba(A,0,S.length))}function G1(S){return Yc(du(S))}function _n(S,A,H){(H!==t&&!Zr(S[A],H)||H===t&&!(A in S))&&mi(S,A,H)}function Xm(S,A,H){var le=S[A];(!(ii.call(S,A)&&Zr(le,H))||H===t&&!(A in S))&&mi(S,A,H)}function Md(S,A){for(var H=S.length;H--;)if(Zr(S[H][0],A))return H;return-1}function uh(S,A,H,le){return ka(S,function(Ce,We,ht){A(le,Ce,H(Ce),ht)}),le}function of(S,A){return S&&Bf(A,oc(A),S)}function K1(S,A){return S&&Bf(A,pf(A),S)}function mi(S,A,H){A=="__proto__"&&Zl?Zl(S,A,{configurable:!0,enumerable:!0,value:H,writable:!0}):S[A]=H}function Ui(S,A){for(var H=-1,le=A.length,Ce=an(le),We=S==null;++H<le;)Ce[H]=We?t:Mc(S,A[H]);return Ce}function ba(S,A,H){return S===S&&(H!==t&&(S=S<=H?S:H),A!==t&&(S=S>=A?S:A)),S}function Es(S,A,H,le,Ce,We){var ht,St=A&C,zt=A&E,vn=A&R;if(H&&(ht=Ce?H(S,le,Ce,We):H(S)),ht!==t)return ht;if(!Ol(S))return S;var Zn=Sr(S);if(Zn){if(ht=Dy(S),!St)return du(S,ht)}else{var Vn=El(S),Fo=Vn==Yo||Vn==as;if(gg(S))return tg(S,St);if(Vn==Ne||Vn==Cn||Fo&&!Ce){if(ht=zt||Fo?{}:io(S),!St)return zt?gh(S,K1(ht,S)):sg(S,of(ht,S))}else{if(!ls[Vn])return Ce?S:{};ht=Py(S,Vn,St)}}We||(We=new Ac);var ms=We.get(S);if(ms)return ms;We.set(S,ht),i1(S)?S.forEach(function(Zs){ht.add(Es(Zs,A,H,Zs,S,We))}):Tn(S)&&S.forEach(function(Zs,gi){ht.set(gi,Es(Zs,A,H,gi,S,We))});var Is=vn?zt?Ci:lg:zt?pf:oc,Hr=Zn?t:Is(S);return ks(Hr||S,function(Zs,gi){Hr&&(gi=Zs,Zs=S[gi]),Xm(ht,gi,Es(Zs,A,H,gi,S,We))}),ht}function Rd(S){var A=oc(S);return function(H){return xl(H,S,A)}}function xl(S,A,H){var le=H.length;if(S==null)return!le;for(S=wi(S);le--;){var Ce=H[le],We=A[Ce],ht=S[Ce];if(ht===t&&!(Ce in S)||!We(ht))return!1}return!0}function sf(S,A,H){if(typeof S!="function")throw new Sa(u);return lp(function(){S.apply(t,H)},A)}function Wa(S,A,H,le){var Ce=-1,We=Ii,ht=!0,St=S.length,zt=[],vn=A.length;if(!St)return zt;H&&(A=pa(A,Va(H))),le?(We=Xf,ht=!1):A.length>=a&&(We=Vi,ht=!1,A=new fo(A));e:for(;++Ce<St;){var Zn=S[Ce],Vn=H==null?Zn:H(Zn);if(Zn=le||Zn!==0?Zn:0,ht&&Vn===Vn){for(var Fo=vn;Fo--;)if(A[Fo]===Vn)continue e;zt.push(Zn)}else We(A,Vn,le)||zt.push(Zn)}return zt}var ka=rg(od),Up=rg(sd,!0);function nn(S,A){var H=!0;return ka(S,function(le,Ce,We){return H=!!A(le,Ce,We),H}),H}function Kr(S,A,H){for(var le=-1,Ce=S.length;++le<Ce;){var We=S[le],ht=A(We);if(ht!=null&&(St===t?ht===ht&&!al(ht):H(ht,St)))var St=ht,zt=We}return zt}function a0(S,A,H,le){var Ce=S.length;for(H=jr(H),H<0&&(H=-H>Ce?0:Ce+H),le=le===t||le>Ce?Ce:jr(le),le<0&&(le+=Ce),le=H>le?0:Jv(le);H<le;)S[H++]=A;return S}function xa(S,A){var H=[];return ka(S,function(le,Ce,We){A(le,Ce,We)&&H.push(le)}),H}function Ua(S,A,H,le,Ce){var We=-1,ht=S.length;for(H||(H=My),Ce||(Ce=[]);++We<ht;){var St=S[We];A>0&&H(St)?A>1?Ua(St,A-1,H,le,Ce):jf(Ce,St):le||(Ce[Ce.length]=St)}return Ce}var Gg=d0(),Wc=d0(!0);function od(S,A){return S&&Gg(S,A,oc)}function sd(S,A){return S&&Wc(S,A,oc)}function Yp(S,A){return uc(A,function(H){return hm(S[H])})}function Hl(S,A){A=rm(A,S);for(var H=0,le=A.length;S!=null&&H<le;)S=S[cf(A[H++])];return H&&H==le?S:t}function Er(S,A,H){var le=A(S);return Sr(S)?le:jf(le,H(S))}function Ya(S){return S==null?S===t?oo:pt:di&&di in wi(S)?YC(S):Qv(S)}function fh(S,A){return S>A}function Jl(S,A){return S!=null&&ii.call(S,A)}function l0(S,A){return S!=null&&A in wi(S)}function jm(S,A,H){return S>=Tr(A,H)&&S<vo(A,H)}function J1(S,A,H){for(var le=H?Xf:Ii,Ce=S[0].length,We=S.length,ht=We,St=an(We),zt=1/0,vn=[];ht--;){var Zn=S[ht];ht&&A&&(Zn=pa(Zn,Va(A))),zt=Tr(Zn.length,zt),St[ht]=!H&&(A||Ce>=120&&Zn.length>=120)?new fo(ht&&Zn):t}Zn=S[0];var Vn=-1,Fo=St[0];e:for(;++Vn<Ce&&vn.length<zt;){var ms=Zn[Vn],Is=A?A(ms):ms;if(ms=H||ms!==0?ms:0,!(Fo?Vi(Fo,Is):le(vn,Is,H))){for(ht=We;--ht;){var Hr=St[ht];if(!(Hr?Vi(Hr,Is):le(S[ht],Is,H)))continue e}Fo&&Fo.push(Is),vn.push(ms)}}return vn}function Xa(S,A,H,le){return od(S,function(Ce,We,ht){A(le,H(Ce),We,ht)}),le}function hc(S,A,H){A=rm(A,S),S=Ny(S,A);var le=S==null?S:S[cf(_h(A))];return le==null?t:ri(le,S,H)}function xt(S){return Pl(S)&&Ya(S)==Cn}function Dc(S){return Pl(S)&&Ya(S)==$s}function au(S){return Pl(S)&&Ya(S)==Zo}function mc(S,A,H,le,Ce){return S===A?!0:S==null||A==null||!Pl(S)&&!Pl(A)?S!==S&&A!==A:Bu(S,A,H,le,mc,Ce)}function Bu(S,A,H,le,Ce,We){var ht=Sr(S),St=Sr(A),zt=ht?je:El(S),vn=St?je:El(A);zt=zt==Cn?Ne:zt,vn=vn==Cn?Ne:vn;var Zn=zt==Ne,Vn=vn==Ne,Fo=zt==vn;if(Fo&&gg(S)){if(!gg(A))return!1;ht=!0,Zn=!1}if(Fo&&!Zn)return We||(We=new Ac),ht||Qd(S)?ag(S,A,H,le,Ce,We):Ay(S,A,zt,H,le,Ce,We);if(!(H&$)){var ms=Zn&&ii.call(S,"__wrapped__"),Is=Vn&&ii.call(A,"__wrapped__");if(ms||Is){var Hr=ms?S.value():S,Zs=Is?A.value():A;return We||(We=new Ac),Ce(Hr,Zs,H,le,We)}}return Fo?(We||(We=new Ac),am(S,A,H,le,Ce,We)):!1}function ja(S){return Pl(S)&&El(S)==kt}function qa(S,A,H,le){var Ce=H.length,We=Ce,ht=!le;if(S==null)return!We;for(S=wi(S);Ce--;){var St=H[Ce];if(ht&&St[2]?St[1]!==S[St[0]]:!(St[0]in S))return!1}for(;++Ce<We;){St=H[Ce];var zt=St[0],vn=S[zt],Zn=St[1];if(ht&&St[2]){if(vn===t&&!(zt in S))return!1}else{var Vn=new Ac;if(le)var Fo=le(vn,Zn,zt,S,A,Vn);if(!(Fo===t?mc(Zn,vn,$|Q,le,Vn):Fo))return!1}}return!0}function qm(S){if(!Ol(S)||g0(S))return!1;var A=hm(S)?Ug:Ut;return A.test(cp(S))}function lu(S){return Pl(S)&&Ya(S)==At}function c0(S){return Pl(S)&&El(S)==An}function Ho(S){return Pl(S)&&r1(S.length)&&!!ys[Ya(S)]}function z(S){return typeof S=="function"?S:S==null?bf:typeof S=="object"?Sr(S)?Sn(S[0],S[1]):Ft(S):Ob(S)}function j(S){if(!ip(S))return ss(S);var A=[];for(var H in wi(S))ii.call(S,H)&&H!="constructor"&&A.push(H);return A}function ye(S){if(!Ol(S))return wh(S);var A=ip(S),H=[];for(var le in S)le=="constructor"&&(A||!ii.call(S,le))||H.push(le);return H}function Pe(S,A){return S<A}function ct(S,A){var H=-1,le=bu(S)?an(S.length):[];return ka(S,function(Ce,We,ht){le[++H]=A(Ce,We,ht)}),le}function Ft(S){var A=vh(S);return A.length==1&&A[0][2]?qp(A[0][0],A[0][1]):function(H){return H===S||qa(H,S,A)}}function Sn(S,A){return Oh(S)&&Ry(A)?qp(cf(S),A):function(H){var le=Mc(H,S);return le===t&&le===A?ll(H,S):mc(A,le,$|Q)}}function In(S,A,H,le,Ce){S!==A&&Gg(A,function(We,ht){if(Ce||(Ce=new Ac),Ol(We))Uo(S,A,ht,H,In,le,Ce);else{var St=le?le(Ff(S,ht),We,ht+"",S,A,Ce):t;St===t&&(St=We),_n(S,ht,St)}},pf)}function Uo(S,A,H,le,Ce,We,ht){var St=Ff(S,H),zt=Ff(A,H),vn=ht.get(zt);if(vn){_n(S,H,vn);return}var Zn=We?We(St,zt,H+"",S,A,ht):t,Vn=Zn===t;if(Vn){var Fo=Sr(zt),ms=!Fo&&gg(zt),Is=!Fo&&!ms&&Qd(zt);Zn=zt,Fo||ms||Is?Sr(St)?Zn=St:Dl(St)?Zn=du(St):ms?(Vn=!1,Zn=tg(zt,!0)):Is?(Vn=!1,Zn=tb(zt,!0)):Zn=[]:fb(zt)||dm(zt)?(Zn=St,dm(St)?Zn=S_(St):(!Ol(St)||hm(St))&&(Zn=io(zt))):Vn=!1}Vn&&(ht.set(zt,Zn),Ce(Zn,zt,le,We,ht),ht.delete(zt)),_n(S,H,Zn)}function ts(S,A){var H=S.length;if(!!H)return A+=A<0?H:0,lm(A,H)?S[A]:t}function Si(S,A,H){A.length?A=pa(A,function(We){return Sr(We)?function(ht){return Hl(ht,We.length===1?We[0]:We)}:We}):A=[bf];var le=-1;A=pa(A,Va(Qs()));var Ce=ct(S,function(We,ht,St){var zt=pa(A,function(vn){return vn(We)});return{criteria:zt,index:++le,value:We}});return Ec(Ce,function(We,ht){return $a(We,ht,H)})}function sr(S,A){return _r(S,A,function(H,le){return ll(S,le)})}function _r(S,A,H){for(var le=-1,Ce=A.length,We={};++le<Ce;){var ht=A[le],St=Hl(S,ht);H(St,ht)&&oa(We,rm(ht,S),St)}return We}function Uc(S){return function(A){return Hl(A,S)}}function cu(S,A,H,le){var Ce=le?Kb:za,We=-1,ht=A.length,St=S;for(S===A&&(A=du(A)),H&&(St=pa(S,Va(H)));++We<ht;)for(var zt=0,vn=A[We],Zn=H?H(vn):vn;(zt=Ce(St,Zn,zt,le))>-1;)St!==S&&ih.call(St,zt,1),ih.call(S,zt,1);return S}function rf(S,A){for(var H=S?A.length:0,le=H-1;H--;){var Ce=A[H];if(H==le||Ce!==We){var We=Ce;lm(Ce)?ih.call(S,Ce,1):If(S,Ce)}}return S}function Nf(S,A){return S+Je(Bi()*(A-S+1))}function dh(S,A,H,le){for(var Ce=-1,We=vo(Se((A-S)/(H||1)),0),ht=an(We);We--;)ht[le?We:++Ce]=S,S+=H;return ht}function hh(S,A){var H="";if(!S||A<1||A>Qe)return H;do A%2&&(H+=S),A=Je(A/2),A&&(S+=S);while(A);return H}function hr(S,A){return Iy(n_(S,A,bf),S+"")}function Gm(S){return Iu(pb(S))}function Km(S,A){var H=pb(S);return Yc(H,ba(A,0,H.length))}function oa(S,A,H,le){if(!Ol(S))return S;A=rm(A,S);for(var Ce=-1,We=A.length,ht=We-1,St=S;St!=null&&++Ce<We;){var zt=cf(A[Ce]),vn=H;if(zt==="__proto__"||zt==="constructor"||zt==="prototype")return S;if(Ce!=ht){var Zn=St[zt];vn=le?le(Zn,zt,St):t,vn===t&&(vn=Ol(Zn)?Zn:lm(A[Ce+1])?[]:{})}Xm(St,zt,vn),St=St[zt]}return S}var uu=ah?function(S,A){return ah.set(S,A),S}:bf,Xp=Zl?function(S,A){return Zl(S,"toString",{configurable:!0,enumerable:!1,value:fO(A),writable:!0})}:bf;function Jm(S){return Yc(pb(S))}function Ps(S,A,H){var le=-1,Ce=S.length;A<0&&(A=-A>Ce?0:Ce+A),H=H>Ce?Ce:H,H<0&&(H+=Ce),Ce=A>H?0:H-A>>>0,A>>>=0;for(var We=an(Ce);++le<Ce;)We[le]=S[le+A];return We}function Fr(S,A){var H;return ka(S,function(le,Ce,We){return H=A(le,Ce,We),!H}),!!H}function Ma(S,A,H){var le=0,Ce=S==null?le:S.length;if(typeof A=="number"&&A===A&&Ce<=rn){for(;le<Ce;){var We=le+Ce>>>1,ht=S[We];ht!==null&&!al(ht)&&(H?ht<=A:ht<A)?le=We+1:Ce=We}return Ce}return gc(S,A,bf,H)}function gc(S,A,H,le){var Ce=0,We=S==null?0:S.length;if(We===0)return 0;A=H(A);for(var ht=A!==A,St=A===null,zt=al(A),vn=A===t;Ce<We;){var Zn=Je((Ce+We)/2),Vn=H(S[Zn]),Fo=Vn!==t,ms=Vn===null,Is=Vn===Vn,Hr=al(Vn);if(ht)var Zs=le||Is;else vn?Zs=Is&&(le||Fo):St?Zs=Is&&Fo&&(le||!ms):zt?Zs=Is&&Fo&&!ms&&(le||!Hr):ms||Hr?Zs=!1:Zs=le?Vn<=A:Vn<A;Zs?Ce=Zn+1:We=Zn}return Tr(We,st)}function eb(S,A){for(var H=-1,le=S.length,Ce=0,We=[];++H<le;){var ht=S[H],St=A?A(ht):ht;if(!H||!Zr(St,zt)){var zt=St;We[Ce++]=ht===0?0:ht}}return We}function Tl(S){return typeof S=="number"?S:al(S)?Ct:+S}function Gi(S){if(typeof S=="string")return S;if(Sr(S))return pa(S,Gi)+"";if(al(S))return lh?lh.call(S):"";var A=S+"";return A=="0"&&1/S==-ut?"-0":A}function fu(S,A,H){var le=-1,Ce=Ii,We=S.length,ht=!0,St=[],zt=St;if(H)ht=!1,Ce=Xf;else if(We>=a){var vn=A?null:Ey(S);if(vn)return Gh(vn);ht=!1,Ce=Vi,zt=new fo}else zt=A?[]:St;e:for(;++le<We;){var Zn=S[le],Vn=A?A(Zn):Zn;if(Zn=H||Zn!==0?Zn:0,ht&&Vn===Vn){for(var Fo=zt.length;Fo--;)if(zt[Fo]===Vn)continue e;A&&zt.push(Vn),St.push(Zn)}else Ce(zt,Vn,H)||(zt!==St&&zt.push(Vn),St.push(Zn))}return St}function If(S,A){return A=rm(A,S),S=Ny(S,A),S==null||delete S[cf(_h(A))]}function Jw(S,A,H,le){return oa(S,A,H(Hl(S,A)),le)}function om(S,A,H,le){for(var Ce=S.length,We=le?Ce:-1;(le?We--:++We<Ce)&&A(S[We],We,S););return H?Ps(S,le?0:We,le?We+1:Ce):Ps(S,le?We+1:0,le?Ce:We)}function Kg(S,A){var H=S;return H instanceof hi&&(H=H.value()),pr(A,function(le,Ce){return Ce.func.apply(Ce.thisArg,jf([le],Ce.args))},H)}function sm(S,A,H){var le=S.length;if(le<2)return le?fu(S[0]):[];for(var Ce=-1,We=an(le);++Ce<le;)for(var ht=S[Ce],St=-1;++St<le;)St!=Ce&&(We[Ce]=Wa(We[Ce]||ht,S[St],A,H));return fu(Ua(We,1),A,H)}function eg(S,A,H){for(var le=-1,Ce=S.length,We=A.length,ht={};++le<Ce;){var St=le<We?A[le]:t;H(ht,S[le],St)}return ht}function Jg(S){return Dl(S)?S:[]}function u0(S){return typeof S=="function"?S:bf}function rm(S,A){return Sr(S)?S:Oh(S,A)?[S]:b0(fa(S))}var Ra=hr;function mh(S,A,H){var le=S.length;return H=H===t?le:H,!A&&H>=le?S:Ps(S,A,H)}var $d=Vp||function(S){return me.clearTimeout(S)};function tg(S,A){if(A)return S.slice();var H=S.length,le=X1?X1(H):new S.constructor(H);return S.copy(le),le}function ng(S){var A=new S.constructor(S.byteLength);return new em(A).set(new em(S)),A}function im(S,A){var H=A?ng(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.byteLength)}function af(S){var A=new S.constructor(S.source,Ge.exec(S));return A.lastIndex=S.lastIndex,A}function f0(S){return ed?wi(ed.call(S)):{}}function tb(S,A){var H=A?ng(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.length)}function e_(S,A){if(S!==A){var H=S!==t,le=S===null,Ce=S===S,We=al(S),ht=A!==t,St=A===null,zt=A===A,vn=al(A);if(!St&&!vn&&!We&&S>A||We&&ht&&zt&&!St&&!vn||le&&ht&&zt||!H&&zt||!Ce)return 1;if(!le&&!We&&!vn&&S<A||vn&&H&&Ce&&!le&&!We||St&&H&&Ce||!ht&&Ce||!zt)return-1}return 0}function $a(S,A,H){for(var le=-1,Ce=S.criteria,We=A.criteria,ht=Ce.length,St=H.length;++le<ht;){var zt=e_(Ce[le],We[le]);if(zt){if(le>=St)return zt;var vn=H[le];return zt*(vn=="desc"?-1:1)}}return S.index-A.index}function ep(S,A,H,le){for(var Ce=-1,We=S.length,ht=H.length,St=-1,zt=A.length,vn=vo(We-ht,0),Zn=an(zt+vn),Vn=!le;++St<zt;)Zn[St]=A[St];for(;++Ce<ht;)(Vn||Ce<We)&&(Zn[H[Ce]]=S[Ce]);for(;vn--;)Zn[St++]=S[Ce++];return Zn}function og(S,A,H,le){for(var Ce=-1,We=S.length,ht=-1,St=H.length,zt=-1,vn=A.length,Zn=vo(We-St,0),Vn=an(Zn+vn),Fo=!le;++Ce<Zn;)Vn[Ce]=S[Ce];for(var ms=Ce;++zt<vn;)Vn[ms+zt]=A[zt];for(;++ht<St;)(Fo||Ce<We)&&(Vn[ms+H[ht]]=S[Ce++]);return Vn}function du(S,A){var H=-1,le=S.length;for(A||(A=an(le));++H<le;)A[H]=S[H];return A}function Bf(S,A,H,le){var Ce=!H;H||(H={});for(var We=-1,ht=A.length;++We<ht;){var St=A[We],zt=le?le(H[St],S[St],St,H,S):t;zt===t&&(zt=S[St]),Ce?mi(H,St,zt):Xm(H,St,zt)}return H}function sg(S,A){return Bf(S,m0(S),A)}function gh(S,A){return Bf(S,Fv(S),A)}function Lu(S,A){return function(H,le){var Ce=Sr(H)?Ef:uh,We=A?A():{};return Ce(H,S,Qs(le,2),We)}}function Nd(S){return hr(function(A,H){var le=-1,Ce=H.length,We=Ce>1?H[Ce-1]:t,ht=Ce>2?H[2]:t;for(We=S.length>3&&typeof We=="function"?(Ce--,We):t,ht&&lf(H[0],H[1],ht)&&(We=Ce<3?t:We,Ce=1),A=wi(A);++le<Ce;){var St=H[le];St&&S(A,St,le,We)}return A})}function rg(S,A){return function(H,le){if(H==null)return H;if(!bu(H))return S(H,le);for(var Ce=H.length,We=A?Ce:-1,ht=wi(H);(A?We--:++We<Ce)&&le(ht[We],We,ht)!==!1;);return H}}function d0(S){return function(A,H,le){for(var Ce=-1,We=wi(A),ht=le(A),St=ht.length;St--;){var zt=ht[S?St:++Ce];if(H(We[zt],zt,We)===!1)break}return A}}function Rv(S,A,H){var le=A&F,Ce=tp(S);function We(){var ht=this&&this!==me&&this instanceof We?Ce:S;return ht.apply(le?H:this,arguments)}return We}function $v(S){return function(A){A=fa(A);var H=rl(A)?jl(A):t,le=H?H[0]:A.charAt(0),Ce=H?mh(H,1).join(""):A.slice(1);return le[S]()+Ce}}function ph(S){return function(A){return pr(uO($0(A).replace(kd,"")),S,"")}}function tp(S){return function(){var A=arguments;switch(A.length){case 0:return new S;case 1:return new S(A[0]);case 2:return new S(A[0],A[1]);case 3:return new S(A[0],A[1],A[2]);case 4:return new S(A[0],A[1],A[2],A[3]);case 5:return new S(A[0],A[1],A[2],A[3],A[4]);case 6:return new S(A[0],A[1],A[2],A[3],A[4],A[5]);case 7:return new S(A[0],A[1],A[2],A[3],A[4],A[5],A[6])}var H=Mf(S.prototype),le=S.apply(H,A);return Ol(le)?le:H}}function Nv(S,A,H){var le=tp(S);function Ce(){for(var We=arguments.length,ht=an(We),St=We,zt=hu(Ce);St--;)ht[St]=arguments[St];var vn=We<3&&ht[0]!==zt&&ht[We-1]!==zt?[]:zc(ht,zt);if(We-=vn.length,We<H)return Lv(S,A,rr,Ce.placeholder,t,ht,vn,t,t,H-We);var Zn=this&&this!==me&&this instanceof Ce?le:S;return ri(Zn,this,ht)}return Ce}function ig(S){return function(A,H,le){var Ce=wi(A);if(!bu(A)){var We=Qs(H,3);A=oc(A),H=function(St){return We(Ce[St],St,Ce)}}var ht=S(A,H,le);return ht>-1?Ce[We?A[ht]:ht]:t}}function Iv(S){return Bd(function(A){var H=A.length,le=H,Ce=$u.prototype.thru;for(S&&A.reverse();le--;){var We=A[le];if(typeof We!="function")throw new Sa(u);if(Ce&&!ht&&Fd(We)=="wrapper")var ht=new $u([],!0)}for(le=ht?le:H;++le<H;){We=A[le];var St=Fd(We),zt=St=="wrapper"?Ld(We):t;zt&&yh(zt[0])&&zt[1]==(G|L|ne|we)&&!zt[4].length&&zt[9]==1?ht=ht[Fd(zt[0])].apply(ht,zt[3]):ht=We.length==1&&yh(We)?ht[St]():ht.thru(We)}return function(){var vn=arguments,Zn=vn[0];if(ht&&vn.length==1&&Sr(Zn))return ht.plant(Zn).value();for(var Vn=0,Fo=H?A[Vn].apply(this,vn):Zn;++Vn<H;)Fo=A[Vn].call(this,Fo);return Fo}})}function rr(S,A,H,le,Ce,We,ht,St,zt,vn){var Zn=A&G,Vn=A&F,Fo=A&U,ms=A&(L|te),Is=A&ve,Hr=Fo?t:tp(S);function Zs(){for(var gi=arguments.length,ki=an(gi),Ou=gi;Ou--;)ki[Ou]=arguments[Ou];if(ms)var Zu=hu(Zs),Zf=th(ki,Zu);if(le&&(ki=ep(ki,le,Ce,ms)),We&&(ki=og(ki,We,ht,ms)),gi-=Zf,ms&&gi<vn){var Ea=zc(ki,Zu);return Lv(S,A,rr,Zs.placeholder,H,ki,Ea,St,zt,vn-gi)}var bm=Vn?H:this,fd=Fo?bm[S]:S;return gi=ki.length,St?ki=ap(ki,St):Is&&gi>1&&ki.reverse(),Zn&&zt<gi&&(ki.length=zt),this&&this!==me&&this instanceof Zs&&(fd=Hr||tp(fd)),fd.apply(bm,ki)}return Zs}function Ao(S,A){return function(H,le){return Xa(H,S,A(le),{})}}function bh(S,A){return function(H,le){var Ce;if(H===t&&le===t)return A;if(H!==t&&(Ce=H),le!==t){if(Ce===t)return le;typeof H=="string"||typeof le=="string"?(H=Gi(H),le=Gi(le)):(H=Tl(H),le=Tl(le)),Ce=S(H,le)}return Ce}}function nb(S){return Bd(function(A){return A=pa(A,Va(Qs())),hr(function(H){var le=this;return S(A,function(Ce){return ri(Ce,le,H)})})})}function np(S,A){A=A===t?" ":Gi(A);var H=A.length;if(H<2)return H?hh(A,S):A;var le=hh(A,Se(S/Jf(A)));return rl(A)?mh(jl(le),0,S).join(""):le.slice(0,S)}function WC(S,A,H,le){var Ce=A&F,We=tp(S);function ht(){for(var St=-1,zt=arguments.length,vn=-1,Zn=le.length,Vn=an(Zn+zt),Fo=this&&this!==me&&this instanceof ht?We:S;++vn<Zn;)Vn[vn]=le[vn];for(;zt--;)Vn[vn++]=arguments[++St];return ri(Fo,Ce?H:this,Vn)}return ht}function Bv(S){return function(A,H,le){return le&&typeof le!="number"&&lf(A,H,le)&&(H=le=t),A=xh(A),H===t?(H=A,A=0):H=xh(H),le=le===t?A<H?1:-1:xh(le),dh(A,H,le,S)}}function li(S){return function(A,H){return typeof A=="string"&&typeof H=="string"||(A=ud(A),H=ud(H)),S(A,H)}}function Lv(S,A,H,le,Ce,We,ht,St,zt,vn){var Zn=A&L,Vn=Zn?ht:t,Fo=Zn?t:ht,ms=Zn?We:t,Is=Zn?t:We;A|=Zn?ne:oe,A&=~(Zn?oe:ne),A&K||(A&=~(F|U));var Hr=[S,A,Ce,ms,Vn,Is,Fo,St,zt,vn],Zs=H.apply(t,Hr);return yh(S)&&mu(Zs,Hr),Zs.placeholder=le,o_(Zs,S,A)}function ob(S){var A=fi[S];return function(H,le){if(H=ud(H),le=le==null?0:Tr(jr(le),292),le&&wn(H)){var Ce=(fa(H)+"e").split("e"),We=A(Ce[0]+"e"+(+Ce[1]+le));return Ce=(fa(We)+"e").split("e"),+(Ce[0]+"e"+(+Ce[1]-le))}return A(H)}}var Ey=Wi&&1/Gh(new Wi([,-0]))[1]==ut?function(S){return new Wi(S)}:gO;function on(S){return function(A){var H=El(A);return H==kt?ef(A):H==An?Pf(A):Ju(A,S(A))}}function Id(S,A,H,le,Ce,We,ht,St){var zt=A&U;if(!zt&&typeof S!="function")throw new Sa(u);var vn=le?le.length:0;if(vn||(A&=~(ne|oe),le=Ce=t),ht=ht===t?ht:vo(jr(ht),0),St=St===t?St:jr(St),vn-=Ce?Ce.length:0,A&oe){var Zn=le,Vn=Ce;le=Ce=t}var Fo=zt?t:Ld(S),ms=[S,A,H,le,Ce,Zn,Vn,We,ht,St];if(Fo&&$y(ms,Fo),S=ms[0],A=ms[1],H=ms[2],le=ms[3],Ce=ms[4],St=ms[9]=ms[9]===t?zt?0:S.length:vo(ms[9]-vn,0),!St&&A&(L|te)&&(A&=~(L|te)),!A||A==F)var Is=Rv(S,A,H);else A==L||A==te?Is=Nv(S,A,St):(A==ne||A==(F|ne))&&!Ce.length?Is=WC(S,A,H,le):Is=rr.apply(t,ms);var Hr=Fo?uu:mu;return o_(Hr(Is,ms),S,A)}function t_(S,A,H,le){return S===t||Zr(S,il[H])&&!ii.call(le,H)?A:S}function h0(S,A,H,le,Ce,We){return Ol(S)&&Ol(A)&&(We.set(A,S),In(S,A,t,h0,We),We.delete(A)),S}function UC(S){return fb(S)?t:S}function ag(S,A,H,le,Ce,We){var ht=H&$,St=S.length,zt=A.length;if(St!=zt&&!(ht&&zt>St))return!1;var vn=We.get(S),Zn=We.get(A);if(vn&&Zn)return vn==A&&Zn==S;var Vn=-1,Fo=!0,ms=H&Q?new fo:t;for(We.set(S,A),We.set(A,S);++Vn<St;){var Is=S[Vn],Hr=A[Vn];if(le)var Zs=ht?le(Hr,Is,Vn,A,S,We):le(Is,Hr,Vn,S,A,We);if(Zs!==t){if(Zs)continue;Fo=!1;break}if(ms){if(!Ku(A,function(gi,ki){if(!Vi(ms,ki)&&(Is===gi||Ce(Is,gi,H,le,We)))return ms.push(ki)})){Fo=!1;break}}else if(!(Is===Hr||Ce(Is,Hr,H,le,We))){Fo=!1;break}}return We.delete(S),We.delete(A),Fo}function Ay(S,A,H,le,Ce,We,ht){switch(H){case tr:if(S.byteLength!=A.byteLength||S.byteOffset!=A.byteOffset)return!1;S=S.buffer,A=A.buffer;case $s:return!(S.byteLength!=A.byteLength||!We(new em(S),new em(A)));case he:case Zo:case jt:return Zr(+S,+A);case so:return S.name==A.name&&S.message==A.message;case At:case zn:return S==A+"";case kt:var St=ef;case An:var zt=le&$;if(St||(St=Gh),S.size!=A.size&&!zt)return!1;var vn=ht.get(S);if(vn)return vn==A;le|=Q,ht.set(S,A);var Zn=ag(St(S),St(A),le,Ce,We,ht);return ht.delete(S),Zn;case ps:if(ed)return ed.call(S)==ed.call(A)}return!1}function am(S,A,H,le,Ce,We){var ht=H&$,St=lg(S),zt=St.length,vn=lg(A),Zn=vn.length;if(zt!=Zn&&!ht)return!1;for(var Vn=zt;Vn--;){var Fo=St[Vn];if(!(ht?Fo in A:ii.call(A,Fo)))return!1}var ms=We.get(S),Is=We.get(A);if(ms&&Is)return ms==A&&Is==S;var Hr=!0;We.set(S,A),We.set(A,S);for(var Zs=ht;++Vn<zt;){Fo=St[Vn];var gi=S[Fo],ki=A[Fo];if(le)var Ou=ht?le(ki,gi,Fo,A,S,We):le(gi,ki,Fo,S,A,We);if(!(Ou===t?gi===ki||Ce(gi,ki,H,le,We):Ou)){Hr=!1;break}Zs||(Zs=Fo=="constructor")}if(Hr&&!Zs){var Zu=S.constructor,Zf=A.constructor;Zu!=Zf&&"constructor"in S&&"constructor"in A&&!(typeof Zu=="function"&&Zu instanceof Zu&&typeof Zf=="function"&&Zf instanceof Zf)&&(Hr=!1)}return We.delete(S),We.delete(A),Hr}function Bd(S){return Iy(n_(S,t,Zy),S+"")}function lg(S){return Er(S,oc,m0)}function Ci(S){return Er(S,pf,Fv)}var Ld=ah?function(S){return ah.get(S)}:gO;function Fd(S){for(var A=S.name+"",H=na[A],le=ii.call(na,A)?H.length:0;le--;){var Ce=H[le],We=Ce.func;if(We==null||We==S)return Ce.name}return A}function hu(S){var A=ii.call(Ae,"placeholder")?Ae:S;return A.placeholder}function Qs(){var S=Ae.iteratee||hO;return S=S===hO?z:S,arguments.length?S(arguments[0],arguments[1]):S}function jp(S,A){var H=S.__data__;return rp(A)?H[typeof A=="string"?"string":"hash"]:H.map}function vh(S){for(var A=oc(S),H=A.length;H--;){var le=A[H],Ce=S[le];A[H]=[le,Ce,Ry(Ce)]}return A}function op(S,A){var H=zm(S,A);return qm(H)?H:t}function YC(S){var A=ii.call(S,di),H=S[di];try{S[di]=t;var le=!0}catch{}var Ce=Jh.call(S);return le&&(A?S[di]=H:delete S[di]),Ce}var m0=at?function(S){return S==null?[]:(S=wi(S),uc(at(S),function(A){return tm.call(S,A)}))}:L0,Fv=at?function(S){for(var A=[];S;)jf(A,m0(S)),S=Wm(S);return A}:L0,El=Ya;(Pa&&El(new Pa(new ArrayBuffer(1)))!=tr||nm&&El(new nm)!=kt||Um&&El(Um.resolve())!=Gt||Wi&&El(new Wi)!=An||Ca&&El(new Ca)!=Ss)&&(El=function(S){var A=Ya(S),H=A==Ne?S.constructor:t,le=H?cp(H):"";if(le)switch(le){case e0:return tr;case Dv:return kt;case ni:return Gt;case Ad:return An;case wr:return Ss}return A});function TE(S,A,H){for(var le=-1,Ce=H.length;++le<Ce;){var We=H[le],ht=We.size;switch(We.type){case"drop":S+=ht;break;case"dropRight":A-=ht;break;case"take":A=Tr(A,S+ht);break;case"takeRight":S=vo(S,A-ht);break}}return{start:S,end:A}}function sp(S){var A=S.match(Lr);return A?A[1].split(Vs):[]}function Al(S,A,H){A=rm(A,S);for(var le=-1,Ce=A.length,We=!1;++le<Ce;){var ht=cf(A[le]);if(!(We=S!=null&&H(S,ht)))break;S=S[ht]}return We||++le!=Ce?We:(Ce=S==null?0:S.length,!!Ce&&r1(Ce)&&lm(ht,Ce)&&(Sr(S)||dm(S)))}function Dy(S){var A=S.length,H=new S.constructor(A);return A&&typeof S[0]=="string"&&ii.call(S,"index")&&(H.index=S.index,H.input=S.input),H}function io(S){return typeof S.constructor=="function"&&!ip(S)?Mf(Wm(S)):{}}function Py(S,A,H){var le=S.constructor;switch(A){case $s:return ng(S);case he:case Zo:return new le(+S);case tr:return im(S,H);case Xs:case wa:case dr:case Ns:case qr:case $o:case Po:case Rr:case Ls:return tb(S,H);case kt:return new le;case jt:case zn:return new le(S);case At:return af(S);case An:return new le;case ps:return f0(S)}}function XC(S,A){var H=A.length;if(!H)return S;var le=H-1;return A[le]=(H>1?"& ":"")+A[le],A=A.join(H>2?", ":" "),S.replace(kr,`{
|
|
/* [wrapped with `+A+`] */
|
|
`)}function My(S){return Sr(S)||dm(S)||!!(Ed&&S&&S[Ed])}function lm(S,A){var H=typeof S;return A=A==null?Qe:A,!!A&&(H=="number"||H!="symbol"&&Lo.test(S))&&S>-1&&S%1==0&&S<A}function lf(S,A,H){if(!Ol(H))return!1;var le=typeof A;return(le=="number"?bu(H)&&lm(A,H.length):le=="string"&&A in H)?Zr(H[A],S):!1}function Oh(S,A){if(Sr(S))return!1;var H=typeof S;return H=="number"||H=="symbol"||H=="boolean"||S==null||al(S)?!0:po.test(S)||!Yn.test(S)||A!=null&&S in wi(A)}function rp(S){var A=typeof S;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?S!=="__proto__":S===null}function yh(S){var A=Fd(S),H=Ae[A];if(typeof H!="function"||!(A in hi.prototype))return!1;if(S===H)return!0;var le=Ld(H);return!!le&&S===le[0]}function g0(S){return!!dc&&dc in S}var Lf=Da?hm:gm;function ip(S){var A=S&&S.constructor,H=typeof A=="function"&&A.prototype||il;return S===H}function Ry(S){return S===S&&!Ol(S)}function qp(S,A){return function(H){return H==null?!1:H[S]===A&&(A!==t||S in wi(H))}}function rd(S){var A=A0(S,function(le){return H.size===b&&H.clear(),le}),H=A.cache;return A}function $y(S,A){var H=S[1],le=A[1],Ce=H|le,We=Ce<(F|U|G),ht=le==G&&H==L||le==G&&H==we&&S[7].length<=A[8]||le==(G|we)&&A[7].length<=A[8]&&H==L;if(!(We||ht))return S;le&F&&(S[2]=A[2],Ce|=H&F?0:K);var St=A[3];if(St){var zt=S[3];S[3]=zt?ep(zt,St,A[4]):St,S[4]=zt?zc(S[3],y):A[4]}return St=A[5],St&&(zt=S[5],S[5]=zt?og(zt,St,A[6]):St,S[6]=zt?zc(S[5],y):A[6]),St=A[7],St&&(S[7]=St),le&G&&(S[8]=S[8]==null?A[8]:Tr(S[8],A[8])),S[9]==null&&(S[9]=A[9]),S[0]=A[0],S[1]=Ce,S}function wh(S){var A=[];if(S!=null)for(var H in wi(S))A.push(H);return A}function Qv(S){return Jh.call(S)}function n_(S,A,H){return A=vo(A===t?S.length-1:A,0),function(){for(var le=arguments,Ce=-1,We=vo(le.length-A,0),ht=an(We);++Ce<We;)ht[Ce]=le[A+Ce];Ce=-1;for(var St=an(A+1);++Ce<A;)St[Ce]=le[Ce];return St[A]=H(ht),ri(S,this,St)}}function Ny(S,A){return A.length<2?S:Hl(S,Ps(A,0,-1))}function ap(S,A){for(var H=S.length,le=Tr(A.length,H),Ce=du(S);le--;){var We=A[le];S[le]=lm(We,H)?Ce[We]:t}return S}function Ff(S,A){if(!(A==="constructor"&&typeof S[A]=="function")&&A!="__proto__")return S[A]}var mu=p0(uu),lp=ue||function(S,A){return me.setTimeout(S,A)},Iy=p0(Xp);function o_(S,A,H){var le=A+"";return Iy(S,XC(le,cm(sp(le),H)))}function p0(S){var A=0,H=0;return function(){var le=Gl(),Ce=Xe-(le-H);if(H=le,Ce>0){if(++A>=ce)return arguments[0]}else A=0;return S.apply(t,arguments)}}function Yc(S,A){var H=-1,le=S.length,Ce=le-1;for(A=A===t?le:A;++H<A;){var We=Nf(H,Ce),ht=S[We];S[We]=S[H],S[H]=ht}return S.length=A,S}var b0=rd(function(S){var A=[];return S.charCodeAt(0)===46&&A.push(""),S.replace(wo,function(H,le,Ce,We){A.push(Ce?We.replace(Qa,"$1"):le||H)}),A});function cf(S){if(typeof S=="string"||al(S))return S;var A=S+"";return A=="0"&&1/S==-ut?"-0":A}function cp(S){if(S!=null){try{return tf.call(S)}catch{}try{return S+""}catch{}}return""}function cm(S,A){return ks(Et,function(H){var le="_."+H[0];A&H[1]&&!Ii(S,le)&&S.push(le)}),S.sort()}function Zv(S){if(S instanceof hi)return S.clone();var A=new $u(S.__wrapped__,S.__chain__);return A.__actions__=du(S.__actions__),A.__index__=S.__index__,A.__values__=S.__values__,A}function s_(S,A,H){(H?lf(S,A,H):A===t)?A=1:A=vo(jr(A),0);var le=S==null?0:S.length;if(!le||A<1)return[];for(var Ce=0,We=0,ht=an(Se(le/A));Ce<le;)ht[We++]=Ps(S,Ce,Ce+=A);return ht}function Gp(S){for(var A=-1,H=S==null?0:S.length,le=0,Ce=[];++A<H;){var We=S[A];We&&(Ce[le++]=We)}return Ce}function By(){var S=arguments.length;if(!S)return[];for(var A=an(S-1),H=arguments[0],le=S;le--;)A[le-1]=arguments[le];return jf(Sr(H)?du(H):[H],Ua(A,1))}var up=hr(function(S,A){return Dl(S)?Wa(S,Ua(A,1,Dl,!0)):[]}),v0=hr(function(S,A){var H=_h(A);return Dl(H)&&(H=t),Dl(S)?Wa(S,Ua(A,1,Dl,!0),Qs(H,2)):[]}),sb=hr(function(S,A){var H=_h(A);return Dl(H)&&(H=t),Dl(S)?Wa(S,Ua(A,1,Dl,!0),t,H):[]});function Ly(S,A,H){var le=S==null?0:S.length;return le?(A=H||A===t?1:jr(A),Ps(S,A<0?0:A,le)):[]}function Fy(S,A,H){var le=S==null?0:S.length;return le?(A=H||A===t?1:jr(A),A=le-A,Ps(S,0,A<0?0:A)):[]}function r_(S,A){return S&&S.length?om(S,Qs(A,3),!0,!0):[]}function jC(S,A){return S&&S.length?om(S,Qs(A,3),!0):[]}function Qr(S,A,H,le){var Ce=S==null?0:S.length;return Ce?(H&&typeof H!="number"&&lf(S,A,H)&&(H=0,le=Ce),a0(S,A,H,le)):[]}function Hv(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=H==null?0:jr(H);return Ce<0&&(Ce=vo(le+Ce,0)),ta(S,Qs(A,3),Ce)}function Qy(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=le-1;return H!==t&&(Ce=jr(H),Ce=H<0?vo(le+Ce,0):Tr(Ce,le-1)),ta(S,Qs(A,3),Ce,!0)}function Zy(S){var A=S==null?0:S.length;return A?Ua(S,1):[]}function O0(S){var A=S==null?0:S.length;return A?Ua(S,ut):[]}function qC(S,A){var H=S==null?0:S.length;return H?(A=A===t?1:jr(A),Ua(S,A)):[]}function um(S){for(var A=-1,H=S==null?0:S.length,le={};++A<H;){var Ce=S[A];le[Ce[0]]=Ce[1]}return le}function Ga(S){return S&&S.length?S[0]:t}function y0(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=H==null?0:jr(H);return Ce<0&&(Ce=vo(le+Ce,0)),za(S,A,Ce)}function rb(S){var A=S==null?0:S.length;return A?Ps(S,0,-1):[]}var i_=hr(function(S){var A=pa(S,Jg);return A.length&&A[0]===S[0]?J1(A):[]}),w0=hr(function(S){var A=_h(S),H=pa(S,Jg);return A===_h(H)?A=t:H.pop(),H.length&&H[0]===S[0]?J1(H,Qs(A,2)):[]}),Hy=hr(function(S){var A=_h(S),H=pa(S,Jg);return A=typeof A=="function"?A:t,A&&H.pop(),H.length&&H[0]===S[0]?J1(H,t,A):[]});function Na(S,A){return S==null?"":Ko.call(S,A)}function _h(S){var A=S==null?0:S.length;return A?S[A-1]:t}function va(S,A,H){var le=S==null?0:S.length;if(!le)return-1;var Ce=le;return H!==t&&(Ce=jr(H),Ce=Ce<0?vo(le+Ce,0):Tr(Ce,le-1)),A===A?Vm(S,A,Ce):ta(S,Mi,Ce,!0)}function uf(S,A){return S&&S.length?ts(S,jr(A)):t}var cg=hr(Xc);function Xc(S,A){return S&&S.length&&A&&A.length?cu(S,A):S}function GC(S,A,H){return S&&S.length&&A&&A.length?cu(S,A,Qs(H,2)):S}function zy(S,A,H){return S&&S.length&&A&&A.length?cu(S,A,t,H):S}var id=Bd(function(S,A){var H=S==null?0:S.length,le=Ui(S,A);return rf(S,pa(A,function(Ce){return lm(Ce,H)?+Ce:Ce}).sort(e_)),le});function Ia(S,A){var H=[];if(!(S&&S.length))return H;var le=-1,Ce=[],We=S.length;for(A=Qs(A,3);++le<We;){var ht=S[le];A(ht,le,S)&&(H.push(ht),Ce.push(le))}return rf(S,Ce),H}function Ta(S){return S==null?S:Ru.call(S)}function KC(S,A,H){var le=S==null?0:S.length;return le?(H&&typeof H!="number"&&lf(S,A,H)?(A=0,H=le):(A=A==null?0:jr(A),H=H===t?le:jr(H)),Ps(S,A,H)):[]}function Sh(S,A){return Ma(S,A)}function _0(S,A,H){return gc(S,A,Qs(H,2))}function zv(S,A){var H=S==null?0:S.length;if(H){var le=Ma(S,A);if(le<H&&Zr(S[le],A))return le}return-1}function ad(S,A){return Ma(S,A,!0)}function ff(S,A,H){return gc(S,A,Qs(H,2),!0)}function Kp(S,A){var H=S==null?0:S.length;if(H){var le=Ma(S,A,!0)-1;if(Zr(S[le],A))return le}return-1}function ib(S){return S&&S.length?eb(S):[]}function S0(S,A){return S&&S.length?eb(S,Qs(A,2)):[]}function C0(S){var A=S==null?0:S.length;return A?Ps(S,1,A):[]}function a_(S,A,H){return S&&S.length?(A=H||A===t?1:jr(A),Ps(S,0,A<0?0:A)):[]}function Vy(S,A,H){var le=S==null?0:S.length;return le?(A=H||A===t?1:jr(A),A=le-A,Ps(S,A<0?0:A,le)):[]}function JC(S,A){return S&&S.length?om(S,Qs(A,3),!1,!0):[]}function l_(S,A){return S&&S.length?om(S,Qs(A,3)):[]}var c_=hr(function(S){return fu(Ua(S,1,Dl,!0))}),Wy=hr(function(S){var A=_h(S);return Dl(A)&&(A=t),fu(Ua(S,1,Dl,!0),Qs(A,2))}),u_=hr(function(S){var A=_h(S);return A=typeof A=="function"?A:t,fu(Ua(S,1,Dl,!0),t,A)});function EE(S){return S&&S.length?fu(S):[]}function Vv(S,A){return S&&S.length?fu(S,Qs(A,2)):[]}function f_(S,A){return A=typeof A=="function"?A:t,S&&S.length?fu(S,t,A):[]}function Li(S){if(!(S&&S.length))return[];var A=0;return S=uc(S,function(H){if(Dl(H))return A=vo(H.length,A),!0}),Pr(A,function(H){return pa(S,sl(H))})}function Wv(S,A){if(!(S&&S.length))return[];var H=Li(S);return A==null?H:pa(H,function(le){return ri(A,t,le)})}var Uy=hr(function(S,A){return Dl(S)?Wa(S,A):[]}),d_=hr(function(S){return sm(uc(S,Dl))}),ug=hr(function(S){var A=_h(S);return Dl(A)&&(A=t),sm(uc(S,Dl),Qs(A,2))}),pc=hr(function(S){var A=_h(S);return A=typeof A=="function"?A:t,sm(uc(S,Dl),t,A)}),gu=hr(Li);function h_(S,A){return eg(S||[],A||[],Xm)}function Yy(S,A){return eg(S||[],A||[],oa)}var fp=hr(function(S){var A=S.length,H=A>1?S[A-1]:t;return H=typeof H=="function"?(S.pop(),H):t,Wv(S,H)});function dp(S){var A=Ae(S);return A.__chain__=!0,A}function Jp(S,A){return A(S),S}function e1(S,A){return A(S)}var fg=Bd(function(S){var A=S.length,H=A?S[0]:0,le=this.__wrapped__,Ce=function(We){return Ui(We,S)};return A>1||this.__actions__.length||!(le instanceof hi)||!lm(H)?this.thru(Ce):(le=le.slice(H,+H+(A?1:0)),le.__actions__.push({func:e1,args:[Ce],thisArg:t}),new $u(le,this.__chain__).thru(function(We){return A&&!We.length&&We.push(t),We}))});function Uv(){return dp(this)}function sa(){return new $u(this.value(),this.__chain__)}function df(){this.__values__===t&&(this.__values__=f2(this.value()));var S=this.__index__>=this.__values__.length,A=S?t:this.__values__[this.__index__++];return{done:S,value:A}}function ab(){return this}function ek(S){for(var A,H=this;H instanceof Xg;){var le=Zv(H);le.__index__=0,le.__values__=t,A?Ce.__wrapped__=le:A=le;var Ce=le;H=H.__wrapped__}return Ce.__wrapped__=S,A}function Xy(){var S=this.__wrapped__;if(S instanceof hi){var A=S;return this.__actions__.length&&(A=new hi(this)),A=A.reverse(),A.__actions__.push({func:e1,args:[Ta],thisArg:t}),new $u(A,this.__chain__)}return this.thru(Ta)}function tk(){return Kg(this.__wrapped__,this.__actions__)}var t1=Lu(function(S,A,H){ii.call(S,H)?++S[H]:mi(S,H,1)});function lb(S,A,H){var le=Sr(S)?Pi:nn;return H&&lf(S,A,H)&&(A=t),le(S,Qs(A,3))}function ld(S,A){var H=Sr(S)?uc:xa;return H(S,Qs(A,3))}var jy=ig(Hv),m_=ig(Qy);function g_(S,A){return Ua(o1(S,A),1)}function nk(S,A){return Ua(o1(S,A),ut)}function p_(S,A,H){return H=H===t?1:jr(H),Ua(o1(S,A),H)}function k0(S,A){var H=Sr(S)?ks:ka;return H(S,Qs(A,3))}function x0(S,A){var H=Sr(S)?ru:Up;return H(S,Qs(A,3))}var b_=Lu(function(S,A,H){ii.call(S,H)?S[H].push(A):mi(S,H,[A])});function qy(S,A,H,le){S=bu(S)?S:pb(S),H=H&&!le?jr(H):0;var Ce=S.length;return H<0&&(H=vo(Ce+H,0)),Qf(S)?H<=Ce&&S.indexOf(A,H)>-1:!!Ce&&za(S,A,H)>-1}var n1=hr(function(S,A,H){var le=-1,Ce=typeof A=="function",We=bu(S)?an(S.length):[];return ka(S,function(ht){We[++le]=Ce?ri(A,ht,H):hc(ht,A,H)}),We}),v_=Lu(function(S,A,H){mi(S,H,A)});function o1(S,A){var H=Sr(S)?pa:ct;return H(S,Qs(A,3))}function dg(S,A,H,le){return S==null?[]:(Sr(A)||(A=A==null?[]:[A]),H=le?t:H,Sr(H)||(H=H==null?[]:[H]),Si(S,A,H))}var Yv=Lu(function(S,A,H){S[H?0:1].push(A)},function(){return[[],[]]});function hf(S,A,H){var le=Sr(S)?pr:Gf,Ce=arguments.length<3;return le(S,Qs(A,4),H,Ce,ka)}function cb(S,A,H){var le=Sr(S)?Gu:Gf,Ce=arguments.length<3;return le(S,Qs(A,4),H,Ce,Up)}function qs(S,A){var H=Sr(S)?uc:xa;return H(S,kh(Qs(A,3)))}function pu(S){var A=Sr(S)?Iu:Gm;return A(S)}function hg(S,A,H){(H?lf(S,A,H):A===t)?A=1:A=jr(A);var le=Sr(S)?Wp:Km;return le(S,A)}function Gy(S){var A=Sr(S)?G1:Jm;return A(S)}function Yi(S){if(S==null)return 0;if(bu(S))return Qf(S)?Jf(S):S.length;var A=El(S);return A==kt||A==An?S.size:j(S).length}function Ky(S,A,H){var le=Sr(S)?Ku:Fr;return H&&lf(S,A,H)&&(A=t),le(S,Qs(A,3))}var mg=hr(function(S,A){if(S==null)return[];var H=A.length;return H>1&&lf(S,A[0],A[1])?A=[]:H>2&&lf(A[0],A[1],A[2])&&(A=[A[0]]),Si(S,Ua(A,1),[])}),Oa=ee||function(){return me.Date.now()};function fm(S,A){if(typeof A!="function")throw new Sa(u);return S=jr(S),function(){if(--S<1)return A.apply(this,arguments)}}function Vt(S,A,H){return A=H?t:A,A=S&&A==null?S.length:A,Id(S,G,t,t,t,t,A)}function T0(S,A){var H;if(typeof A!="function")throw new Sa(u);return S=jr(S),function(){return--S>0&&(H=A.apply(this,arguments)),S<=1&&(A=t),H}}var Jy=hr(function(S,A,H){var le=F;if(H.length){var Ce=zc(H,hu(Jy));le|=ne}return Id(S,le,A,H,Ce)}),E0=hr(function(S,A,H){var le=F|U;if(H.length){var Ce=zc(H,hu(E0));le|=ne}return Id(A,le,S,H,Ce)});function Ch(S,A,H){A=H?t:A;var le=Id(S,L,t,t,t,t,t,A);return le.placeholder=Ch.placeholder,le}function mf(S,A,H){A=H?t:A;var le=Id(S,te,t,t,t,t,t,A);return le.placeholder=mf.placeholder,le}function ub(S,A,H){var le,Ce,We,ht,St,zt,vn=0,Zn=!1,Vn=!1,Fo=!0;if(typeof S!="function")throw new Sa(u);A=ud(A)||0,Ol(H)&&(Zn=!!H.leading,Vn="maxWait"in H,We=Vn?vo(ud(H.maxWait)||0,A):We,Fo="trailing"in H?!!H.trailing:Fo);function ms(Ea){var bm=le,fd=Ce;return le=Ce=t,vn=Ea,ht=S.apply(fd,bm),ht}function Is(Ea){return vn=Ea,St=lp(gi,A),Zn?ms(Ea):ht}function Hr(Ea){var bm=Ea-zt,fd=Ea-vn,k2=A-bm;return Vn?Tr(k2,We-fd):k2}function Zs(Ea){var bm=Ea-zt,fd=Ea-vn;return zt===t||bm>=A||bm<0||Vn&&fd>=We}function gi(){var Ea=Oa();if(Zs(Ea))return ki(Ea);St=lp(gi,Hr(Ea))}function ki(Ea){return St=t,Fo&&le?ms(Ea):(le=Ce=t,ht)}function Ou(){St!==t&&$d(St),vn=0,le=zt=Ce=St=t}function Zu(){return St===t?ht:ki(Oa())}function Zf(){var Ea=Oa(),bm=Zs(Ea);if(le=arguments,Ce=this,zt=Ea,bm){if(St===t)return Is(zt);if(Vn)return $d(St),St=lp(gi,A),ms(zt)}return St===t&&(St=lp(gi,A)),ht}return Zf.cancel=Ou,Zf.flush=Zu,Zf}var Xv=hr(function(S,A){return sf(S,1,A)}),e2=hr(function(S,A,H){return sf(S,ud(A)||0,H)});function jv(S){return Id(S,ve)}function A0(S,A){if(typeof S!="function"||A!=null&&typeof A!="function")throw new Sa(u);var H=function(){var le=arguments,Ce=A?A.apply(this,le):le[0],We=H.cache;if(We.has(Ce))return We.get(Ce);var ht=S.apply(this,le);return H.cache=We.set(Ce,ht)||We,ht};return H.cache=new(A0.Cache||nd),H}A0.Cache=nd;function kh(S){if(typeof S!="function")throw new Sa(u);return function(){var A=arguments;switch(A.length){case 0:return!S.call(this);case 1:return!S.call(this,A[0]);case 2:return!S.call(this,A[0],A[1]);case 3:return!S.call(this,A[0],A[1],A[2])}return!S.apply(this,A)}}function cd(S){return T0(2,S)}var Fu=Ra(function(S,A){A=A.length==1&&Sr(A[0])?pa(A[0],Va(Qs())):pa(Ua(A,1),Va(Qs()));var H=A.length;return hr(function(le){for(var Ce=-1,We=Tr(le.length,H);++Ce<We;)le[Ce]=A[Ce].call(this,le[Ce]);return ri(S,this,le)})}),zl=hr(function(S,A){var H=zc(A,hu(zl));return Id(S,ne,t,A,H)}),t2=hr(function(S,A){var H=zc(A,hu(t2));return Id(S,oe,t,A,H)}),hp=Bd(function(S,A){return Id(S,we,t,t,t,A)});function O_(S,A){if(typeof S!="function")throw new Sa(u);return A=A===t?A:jr(A),hr(S,A)}function D0(S,A){if(typeof S!="function")throw new Sa(u);return A=A==null?0:vo(jr(A),0),hr(function(H){var le=H[A],Ce=mh(H,0,A);return le&&jf(Ce,le),ri(S,this,Ce)})}function s1(S,A,H){var le=!0,Ce=!0;if(typeof S!="function")throw new Sa(u);return Ol(H)&&(le="leading"in H?!!H.leading:le,Ce="trailing"in H?!!H.trailing:Ce),ub(S,A,{leading:le,maxWait:A,trailing:Ce})}function n2(S){return Vt(S,1)}function qv(S,A){return zl(u0(A),S)}function y_(){if(!arguments.length)return[];var S=arguments[0];return Sr(S)?S:[S]}function Gv(S){return Es(S,R)}function o2(S,A){return A=typeof A=="function"?A:t,Es(S,R,A)}function vl(S){return Es(S,C|R)}function ec(S,A){return A=typeof A=="function"?A:t,Es(S,C|R,A)}function Qu(S,A){return A==null||xl(S,A,oc(A))}function Zr(S,A){return S===A||S!==S&&A!==A}var tc=li(fh),Vl=li(function(S,A){return S>=A}),dm=xt(function(){return arguments}())?xt:function(S){return Pl(S)&&ii.call(S,"callee")&&!tm.call(S,"callee")},Sr=an.isArray,w_=ro?Va(ro):Dc;function bu(S){return S!=null&&r1(S.length)&&!hm(S)}function Dl(S){return Pl(S)&&bu(S)}function s2(S){return S===!0||S===!1||Pl(S)&&Ya(S)==he}var gg=Dn||gm,bc=yi?Va(yi):au;function AE(S){return Pl(S)&&S.nodeType===1&&!fb(S)}function pg(S){if(S==null)return!0;if(bu(S)&&(Sr(S)||typeof S=="string"||typeof S.splice=="function"||gg(S)||Qd(S)||dm(S)))return!S.length;var A=El(S);if(A==kt||A==An)return!S.size;if(ip(S))return!j(S).length;for(var H in S)if(ii.call(S,H))return!1;return!0}function ok(S,A){return mc(S,A)}function sk(S,A,H){H=typeof H=="function"?H:t;var le=H?H(S,A):t;return le===t?mc(S,A,t,H):!!le}function r2(S){if(!Pl(S))return!1;var A=Ya(S);return A==so||A==Kn||typeof S.message=="string"&&typeof S.name=="string"&&!fb(S)}function i2(S){return typeof S=="number"&&wn(S)}function hm(S){if(!Ol(S))return!1;var A=Ya(S);return A==Yo||A==as||A==mt||A==bn}function a2(S){return typeof S=="number"&&S==jr(S)}function r1(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=Qe}function Ol(S){var A=typeof S;return S!=null&&(A=="object"||A=="function")}function Pl(S){return S!=null&&typeof S=="object"}var Tn=gn?Va(gn):ja;function rk(S,A){return S===A||qa(S,A,vh(A))}function nc(S,A,H){return H=typeof H=="function"?H:t,qa(S,A,vh(A),H)}function ik(S){return c2(S)&&S!=+S}function l2(S){if(Lf(S))throw new or(l);return qm(S)}function no(S){return S===null}function Pc(S){return S==null}function c2(S){return typeof S=="number"||Pl(S)&&Ya(S)==jt}function fb(S){if(!Pl(S)||Ya(S)!=Ne)return!1;var A=Wm(S);if(A===null)return!0;var H=ii.call(A,"constructor")&&A.constructor;return typeof H=="function"&&H instanceof H&&tf.call(H)==Y1}var gf=Gr?Va(Gr):lu;function Kv(S){return a2(S)&&S>=-Qe&&S<=Qe}var i1=Ll?Va(Ll):c0;function Qf(S){return typeof S=="string"||!Sr(S)&&Pl(S)&&Ya(S)==zn}function al(S){return typeof S=="symbol"||Pl(S)&&Ya(S)==ps}var Qd=ea?Va(ea):Ho;function Zd(S){return S===t}function jc(S){return Pl(S)&&El(S)==Ss}function db(S){return Pl(S)&&Ya(S)==Mr}var u2=li(Pe),__=li(function(S,A){return S<=A});function f2(S){if(!S)return[];if(bu(S))return Qf(S)?jl(S):du(S);if(ai&&S[ai])return jh(S[ai]());var A=El(S),H=A==kt?ef:A==An?Gh:pb;return H(S)}function xh(S){if(!S)return S===0?S:0;if(S=ud(S),S===ut||S===-ut){var A=S<0?-1:1;return A*Bt}return S===S?S:0}function jr(S){var A=xh(S),H=A%1;return A===A?H?A-H:A:0}function Jv(S){return S?ba(jr(S),0,He):0}function ud(S){if(typeof S=="number")return S;if(al(S))return Ct;if(Ol(S)){var A=typeof S.valueOf=="function"?S.valueOf():S;S=Ol(A)?A+"":A}if(typeof S!="string")return S===0?S:+S;S=Fl(S);var H=Nt.test(S);return H||bo.test(S)?qn(S.slice(2),H?2:8):qe.test(S)?Ct:+S}function S_(S){return Bf(S,pf(S))}function C_(S){return S?ba(jr(S),-Qe,Qe):S===0?S:0}function fa(S){return S==null?"":Gi(S)}var ak=Nd(function(S,A){if(ip(A)||bu(A)){Bf(A,oc(A),S);return}for(var H in A)ii.call(A,H)&&Xm(S,H,A[H])}),eO=Nd(function(S,A){Bf(A,pf(A),S)}),tO=Nd(function(S,A,H,le){Bf(A,pf(A),S,le)}),k_=Nd(function(S,A,H,le){Bf(A,oc(A),S,le)}),lk=Bd(Ui);function hb(S,A){var H=Mf(S);return A==null?H:of(H,A)}var x_=hr(function(S,A){S=wi(S);var H=-1,le=A.length,Ce=le>2?A[2]:t;for(Ce&&lf(A[0],A[1],Ce)&&(le=1);++H<le;)for(var We=A[H],ht=pf(We),St=-1,zt=ht.length;++St<zt;){var vn=ht[St],Zn=S[vn];(Zn===t||Zr(Zn,il[vn])&&!ii.call(S,vn))&&(S[vn]=We[vn])}return S}),ck=hr(function(S){return S.push(t,h0),ri(D_,t,S)});function T_(S,A){return ti(S,Qs(A,3),od)}function uk(S,A){return ti(S,Qs(A,3),sd)}function E_(S,A){return S==null?S:Gg(S,Qs(A,3),pf)}function nO(S,A){return S==null?S:Wc(S,Qs(A,3),pf)}function mp(S,A){return S&&od(S,Qs(A,3))}function mb(S,A){return S&&sd(S,Qs(A,3))}function Xi(S){return S==null?[]:Yp(S,oc(S))}function d2(S){return S==null?[]:Yp(S,pf(S))}function Mc(S,A,H){var le=S==null?t:Hl(S,A);return le===t?H:le}function gb(S,A){return S!=null&&Al(S,A,Jl)}function ll(S,A){return S!=null&&Al(S,A,l0)}var A_=Ao(function(S,A,H){A!=null&&typeof A.toString!="function"&&(A=Jh.call(A)),S[A]=H},fO(bf)),mm=Ao(function(S,A,H){A!=null&&typeof A.toString!="function"&&(A=Jh.call(A)),ii.call(S,A)?S[A].push(H):S[A]=[H]},Qs),fk=hr(hc);function oc(S){return bu(S)?bl(S):j(S)}function pf(S){return bu(S)?bl(S,!0):ye(S)}function P0(S,A){var H={};return A=Qs(A,3),od(S,function(le,Ce,We){mi(H,A(le,Ce,We),le)}),H}function dk(S,A){var H={};return A=Qs(A,3),od(S,function(le,Ce,We){mi(H,Ce,A(le,Ce,We))}),H}var hk=Nd(function(S,A,H){In(S,A,H)}),D_=Nd(function(S,A,H,le){In(S,A,H,le)}),M0=Bd(function(S,A){var H={};if(S==null)return H;var le=!1;A=pa(A,function(We){return We=rm(We,S),le||(le=We.length>1),We}),Bf(S,Ci(S),H),le&&(H=Es(H,C|E|R,UC));for(var Ce=A.length;Ce--;)If(H,A[Ce]);return H});function P_(S,A){return gp(S,kh(Qs(A)))}var M_=Bd(function(S,A){return S==null?{}:sr(S,A)});function gp(S,A){if(S==null)return{};var H=pa(Ci(S),function(le){return[le]});return A=Qs(A),_r(S,H,function(le,Ce){return A(le,Ce[0])})}function mk(S,A,H){A=rm(A,S);var le=-1,Ce=A.length;for(Ce||(Ce=1,S=t);++le<Ce;){var We=S==null?t:S[cf(A[le])];We===t&&(le=Ce,We=H),S=hm(We)?We.call(S):We}return S}function gk(S,A,H){return S==null?S:oa(S,A,H)}function pk(S,A,H,le){return le=typeof le=="function"?le:t,S==null?S:oa(S,A,H,le)}var h2=on(oc),oO=on(pf);function bg(S,A,H){var le=Sr(S),Ce=le||gg(S)||Qd(S);if(A=Qs(A,4),H==null){var We=S&&S.constructor;Ce?H=le?new We:[]:Ol(S)?H=hm(We)?Mf(Wm(S)):{}:H={}}return(Ce?ks:od)(S,function(ht,St,zt){return A(H,ht,St,zt)}),H}function R_(S,A){return S==null?!0:If(S,A)}function $_(S,A,H){return S==null?S:Jw(S,A,u0(H))}function sO(S,A,H,le){return le=typeof le=="function"?le:t,S==null?S:Jw(S,A,u0(H),le)}function pb(S){return S==null?[]:qi(S,oc(S))}function vg(S){return S==null?[]:qi(S,pf(S))}function rO(S,A,H){return H===t&&(H=A,A=t),H!==t&&(H=ud(H),H=H===H?H:0),A!==t&&(A=ud(A),A=A===A?A:0),ba(ud(S),A,H)}function iO(S,A,H){return A=xh(A),H===t?(H=A,A=0):H=xh(H),S=ud(S),jm(S,A,H)}function R0(S,A,H){if(H&&typeof H!="boolean"&&lf(S,A,H)&&(A=H=t),H===t&&(typeof A=="boolean"?(H=A,A=t):typeof S=="boolean"&&(H=S,S=t)),S===t&&A===t?(S=0,A=1):(S=xh(S),A===t?(A=S,S=0):A=xh(A)),S>A){var le=S;S=A,A=le}if(H||S%1||A%1){var Ce=Bi();return Tr(S+Ce*(A-S+xd("1e-"+((Ce+"").length-1))),A)}return Nf(S,A)}var N_=ph(function(S,A,H){return A=A.toLowerCase(),S+(H?Th(A):A)});function Th(S){return bb(fa(S).toLowerCase())}function $0(S){return S=fa(S),S&&S.replace(Go,Hg).replace(De,"")}function I_(S,A,H){S=fa(S),A=Gi(A);var le=S.length;H=H===t?le:ba(jr(H),0,le);var Ce=H;return H-=A.length,H>=0&&S.slice(H,Ce)==A}function Eh(S){return S=fa(S),S&&ze.test(S)?S.replace(vs,Hm):S}function pp(S){return S=fa(S),S&&os.test(S)?S.replace(fn,"\\$&"):S}var m2=ph(function(S,A,H){return S+(H?"-":"")+A.toLowerCase()}),B_=ph(function(S,A,H){return S+(H?" ":"")+A.toLowerCase()}),aO=$v("toLowerCase");function bk(S,A,H){S=fa(S),A=jr(A);var le=A?Jf(S):0;if(!A||le>=A)return S;var Ce=(A-le)/2;return np(Je(Ce),H)+S+np(Se(Ce),H)}function L_(S,A,H){S=fa(S),A=jr(A);var le=A?Jf(S):0;return A&&le<A?S+np(A-le,H):S}function vk(S,A,H){S=fa(S),A=jr(A);var le=A?Jf(S):0;return A&&le<A?np(A-le,H)+S:S}function Ok(S,A,H){return H||A==null?A=0:A&&(A=+A),ua(fa(S).replace(xo,""),A||0)}function F_(S,A,H){return(H?lf(S,A,H):A===t)?A=1:A=jr(A),hh(fa(S),A)}function Q_(){var S=arguments,A=fa(S[0]);return S.length<3?A:A.replace(S[1],S[2])}var Z_=ph(function(S,A,H){return S+(H?"_":"")+A.toLowerCase()});function yk(S,A,H){return H&&typeof H!="number"&&lf(S,A,H)&&(A=H=t),H=H===t?He:H>>>0,H?(S=fa(S),S&&(typeof A=="string"||A!=null&&!gf(A))&&(A=Gi(A),!A&&rl(S))?mh(jl(S),0,H):S.split(A,H)):[]}var wk=ph(function(S,A,H){return S+(H?" ":"")+bb(A)});function _k(S,A,H){return S=fa(S),H=H==null?0:ba(jr(H),0,S.length),A=Gi(A),S.slice(H,H+A.length)==A}function H_(S,A,H){var le=Ae.templateSettings;H&&lf(S,A,H)&&(A=t),S=fa(S),A=tO({},A,le,t_);var Ce=tO({},A.imports,le.imports,t_),We=oc(Ce),ht=qi(Ce,We),St,zt,vn=0,Zn=A.interpolate||ei,Vn="__p += '",Fo=oh((A.escape||ei).source+"|"+Zn.source+"|"+(Zn===Wt?Oi:ei).source+"|"+(A.evaluate||ei).source+"|$","g"),ms="//# sourceURL="+(ii.call(A,"sourceURL")?(A.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$r+"]")+`
|
|
`;S.replace(Fo,function(Zs,gi,ki,Ou,Zu,Zf){return ki||(ki=Ou),Vn+=S.slice(vn,Zf).replace(lt,Ql),gi&&(St=!0,Vn+=`' +
|
|
__e(`+gi+`) +
|
|
'`),Zu&&(zt=!0,Vn+=`';
|
|
`+Zu+`;
|
|
__p += '`),ki&&(Vn+=`' +
|
|
((__t = (`+ki+`)) == null ? '' : __t) +
|
|
'`),vn=Zf+Zs.length,Zs}),Vn+=`';
|
|
`;var Is=ii.call(A,"variable")&&A.variable;if(!Is)Vn=`with (obj) {
|
|
`+Vn+`
|
|
}
|
|
`;else if(Zi.test(Is))throw new or(d);Vn=(zt?Vn.replace(aa,""):Vn).replace(bs,"$1").replace(_a,"$1;"),Vn="function("+(Is||"obj")+`) {
|
|
`+(Is?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(St?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+Vn+`return __p
|
|
}`;var Hr=b2(function(){return Xr(We,ms+"return "+Vn).apply(t,ht)});if(Hr.source=Vn,r2(Hr))throw Hr;return Hr}function g2(S){return fa(S).toLowerCase()}function p2(S){return fa(S).toUpperCase()}function Sk(S,A,H){if(S=fa(S),S&&(H||A===t))return Fl(S);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=jl(A),We=fc(le,Ce),ht=Kf(le,Ce)+1;return mh(le,We,ht).join("")}function Ck(S,A,H){if(S=fa(S),S&&(H||A===t))return S.slice(0,zg(S)+1);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=Kf(le,jl(A))+1;return mh(le,0,Ce).join("")}function lO(S,A,H){if(S=fa(S),S&&(H||A===t))return S.replace(xo,"");if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=fc(le,jl(A));return mh(le,Ce).join("")}function z_(S,A){var H=Re,le=Oe;if(Ol(A)){var Ce="separator"in A?A.separator:Ce;H="length"in A?jr(A.length):H,le="omission"in A?Gi(A.omission):le}S=fa(S);var We=S.length;if(rl(S)){var ht=jl(S);We=ht.length}if(H>=We)return S;var St=H-Jf(le);if(St<1)return le;var zt=ht?mh(ht,0,St).join(""):S.slice(0,St);if(Ce===t)return zt+le;if(ht&&(St+=zt.length-St),gf(Ce)){if(S.slice(St).search(Ce)){var vn,Zn=zt;for(Ce.global||(Ce=oh(Ce.source,fa(Ge.exec(Ce))+"g")),Ce.lastIndex=0;vn=Ce.exec(Zn);)var Vn=vn.index;zt=zt.slice(0,Vn===t?St:Vn)}}else if(S.indexOf(Gi(Ce),St)!=St){var Fo=zt.lastIndexOf(Ce);Fo>-1&&(zt=zt.slice(0,Fo))}return zt+le}function cO(S){return S=fa(S),S&&Qi.test(S)?S.replace(ln,Ke):S}var N0=ph(function(S,A,H){return S+(H?" ":"")+A.toUpperCase()}),bb=$v("toUpperCase");function uO(S,A,H){return S=fa(S),A=H?t:A,A===t?Df(S)?Vg(S):eh(S):S.match(A)||[]}var b2=hr(function(S,A){try{return ri(S,t,A)}catch(H){return r2(H)?H:new or(H)}}),V_=Bd(function(S,A){return ks(A,function(H){H=cf(H),mi(S,H,Jy(S[H],S))}),S});function v2(S){var A=S==null?0:S.length,H=Qs();return S=A?pa(S,function(le){if(typeof le[1]!="function")throw new Sa(u);return[H(le[0]),le[1]]}):[],hr(function(le){for(var Ce=-1;++Ce<A;){var We=S[Ce];if(ri(We[0],this,le))return ri(We[1],this,le)}})}function kk(S){return Rd(Es(S,C))}function fO(S){return function(){return S}}function I0(S,A){return S==null||S!==S?A:S}var xk=Iv(),dO=Iv(!0);function bf(S){return S}function hO(S){return z(typeof S=="function"?S:Es(S,C))}function W_(S){return Ft(Es(S,C))}function mO(S,A){return Sn(S,Es(A,C))}var Tk=hr(function(S,A){return function(H){return hc(H,S,A)}}),B0=hr(function(S,A){return function(H){return hc(S,H,A)}});function O2(S,A,H){var le=oc(A),Ce=Yp(A,le);H==null&&!(Ol(A)&&(Ce.length||!le.length))&&(H=A,A=S,S=this,Ce=Yp(A,oc(A)));var We=!(Ol(H)&&"chain"in H)||!!H.chain,ht=hm(S);return ks(Ce,function(St){var zt=A[St];S[St]=zt,ht&&(S.prototype[St]=function(){var vn=this.__chain__;if(We||vn){var Zn=S(this.__wrapped__),Vn=Zn.__actions__=du(this.__actions__);return Vn.push({func:zt,args:arguments,thisArg:S}),Zn.__chain__=vn,Zn}return zt.apply(S,jf([this.value()],arguments))})}),S}function Ek(){return me._===this&&(me._=sh),this}function gO(){}function yl(S){return S=jr(S),hr(function(A){return ts(A,S)})}var Ak=nb(pa),vb=nb(Pi),Dk=nb(Ku);function Ob(S){return Oh(S)?sl(cf(S)):Uc(S)}function y2(S){return function(A){return S==null?t:Hl(S,A)}}var Pk=Bv(),Mk=Bv(!0);function L0(){return[]}function gm(){return!1}function yb(){return{}}function vu(){return""}function a1(){return!0}function U_(S,A){if(S=jr(S),S<1||S>Qe)return[];var H=He,le=Tr(S,He);A=Qs(A),S-=He;for(var Ce=Pr(le,A);++H<S;)A(H);return Ce}function Y_(S){return Sr(S)?pa(S,cf):al(S)?[S]:du(b0(fa(S)))}function w2(S){var A=++Mu;return fa(S)+A}var _2=bh(function(S,A){return S+A},0),S2=ob("ceil"),Rk=bh(function(S,A){return S/A},1),F0=ob("floor");function pO(S){return S&&S.length?Kr(S,bf,fh):t}function bp(S,A){return S&&S.length?Kr(S,Qs(A,2),fh):t}function Q0(S){return kl(S,bf)}function Ah(S,A){return kl(S,Qs(A,2))}function $k(S){return S&&S.length?Kr(S,bf,Pe):t}function pm(S,A){return S&&S.length?Kr(S,Qs(A,2),Pe):t}var Hd=bh(function(S,A){return S*A},1),wb=ob("round"),C2=bh(function(S,A){return S-A},0);function _b(S){return S&&S.length?Af(S,bf):0}function Og(S,A){return S&&S.length?Af(S,Qs(A,2)):0}return Ae.after=fm,Ae.ary=Vt,Ae.assign=ak,Ae.assignIn=eO,Ae.assignInWith=tO,Ae.assignWith=k_,Ae.at=lk,Ae.before=T0,Ae.bind=Jy,Ae.bindAll=V_,Ae.bindKey=E0,Ae.castArray=y_,Ae.chain=dp,Ae.chunk=s_,Ae.compact=Gp,Ae.concat=By,Ae.cond=v2,Ae.conforms=kk,Ae.constant=fO,Ae.countBy=t1,Ae.create=hb,Ae.curry=Ch,Ae.curryRight=mf,Ae.debounce=ub,Ae.defaults=x_,Ae.defaultsDeep=ck,Ae.defer=Xv,Ae.delay=e2,Ae.difference=up,Ae.differenceBy=v0,Ae.differenceWith=sb,Ae.drop=Ly,Ae.dropRight=Fy,Ae.dropRightWhile=r_,Ae.dropWhile=jC,Ae.fill=Qr,Ae.filter=ld,Ae.flatMap=g_,Ae.flatMapDeep=nk,Ae.flatMapDepth=p_,Ae.flatten=Zy,Ae.flattenDeep=O0,Ae.flattenDepth=qC,Ae.flip=jv,Ae.flow=xk,Ae.flowRight=dO,Ae.fromPairs=um,Ae.functions=Xi,Ae.functionsIn=d2,Ae.groupBy=b_,Ae.initial=rb,Ae.intersection=i_,Ae.intersectionBy=w0,Ae.intersectionWith=Hy,Ae.invert=A_,Ae.invertBy=mm,Ae.invokeMap=n1,Ae.iteratee=hO,Ae.keyBy=v_,Ae.keys=oc,Ae.keysIn=pf,Ae.map=o1,Ae.mapKeys=P0,Ae.mapValues=dk,Ae.matches=W_,Ae.matchesProperty=mO,Ae.memoize=A0,Ae.merge=hk,Ae.mergeWith=D_,Ae.method=Tk,Ae.methodOf=B0,Ae.mixin=O2,Ae.negate=kh,Ae.nthArg=yl,Ae.omit=M0,Ae.omitBy=P_,Ae.once=cd,Ae.orderBy=dg,Ae.over=Ak,Ae.overArgs=Fu,Ae.overEvery=vb,Ae.overSome=Dk,Ae.partial=zl,Ae.partialRight=t2,Ae.partition=Yv,Ae.pick=M_,Ae.pickBy=gp,Ae.property=Ob,Ae.propertyOf=y2,Ae.pull=cg,Ae.pullAll=Xc,Ae.pullAllBy=GC,Ae.pullAllWith=zy,Ae.pullAt=id,Ae.range=Pk,Ae.rangeRight=Mk,Ae.rearg=hp,Ae.reject=qs,Ae.remove=Ia,Ae.rest=O_,Ae.reverse=Ta,Ae.sampleSize=hg,Ae.set=gk,Ae.setWith=pk,Ae.shuffle=Gy,Ae.slice=KC,Ae.sortBy=mg,Ae.sortedUniq=ib,Ae.sortedUniqBy=S0,Ae.split=yk,Ae.spread=D0,Ae.tail=C0,Ae.take=a_,Ae.takeRight=Vy,Ae.takeRightWhile=JC,Ae.takeWhile=l_,Ae.tap=Jp,Ae.throttle=s1,Ae.thru=e1,Ae.toArray=f2,Ae.toPairs=h2,Ae.toPairsIn=oO,Ae.toPath=Y_,Ae.toPlainObject=S_,Ae.transform=bg,Ae.unary=n2,Ae.union=c_,Ae.unionBy=Wy,Ae.unionWith=u_,Ae.uniq=EE,Ae.uniqBy=Vv,Ae.uniqWith=f_,Ae.unset=R_,Ae.unzip=Li,Ae.unzipWith=Wv,Ae.update=$_,Ae.updateWith=sO,Ae.values=pb,Ae.valuesIn=vg,Ae.without=Uy,Ae.words=uO,Ae.wrap=qv,Ae.xor=d_,Ae.xorBy=ug,Ae.xorWith=pc,Ae.zip=gu,Ae.zipObject=h_,Ae.zipObjectDeep=Yy,Ae.zipWith=fp,Ae.entries=h2,Ae.entriesIn=oO,Ae.extend=eO,Ae.extendWith=tO,O2(Ae,Ae),Ae.add=_2,Ae.attempt=b2,Ae.camelCase=N_,Ae.capitalize=Th,Ae.ceil=S2,Ae.clamp=rO,Ae.clone=Gv,Ae.cloneDeep=vl,Ae.cloneDeepWith=ec,Ae.cloneWith=o2,Ae.conformsTo=Qu,Ae.deburr=$0,Ae.defaultTo=I0,Ae.divide=Rk,Ae.endsWith=I_,Ae.eq=Zr,Ae.escape=Eh,Ae.escapeRegExp=pp,Ae.every=lb,Ae.find=jy,Ae.findIndex=Hv,Ae.findKey=T_,Ae.findLast=m_,Ae.findLastIndex=Qy,Ae.findLastKey=uk,Ae.floor=F0,Ae.forEach=k0,Ae.forEachRight=x0,Ae.forIn=E_,Ae.forInRight=nO,Ae.forOwn=mp,Ae.forOwnRight=mb,Ae.get=Mc,Ae.gt=tc,Ae.gte=Vl,Ae.has=gb,Ae.hasIn=ll,Ae.head=Ga,Ae.identity=bf,Ae.includes=qy,Ae.indexOf=y0,Ae.inRange=iO,Ae.invoke=fk,Ae.isArguments=dm,Ae.isArray=Sr,Ae.isArrayBuffer=w_,Ae.isArrayLike=bu,Ae.isArrayLikeObject=Dl,Ae.isBoolean=s2,Ae.isBuffer=gg,Ae.isDate=bc,Ae.isElement=AE,Ae.isEmpty=pg,Ae.isEqual=ok,Ae.isEqualWith=sk,Ae.isError=r2,Ae.isFinite=i2,Ae.isFunction=hm,Ae.isInteger=a2,Ae.isLength=r1,Ae.isMap=Tn,Ae.isMatch=rk,Ae.isMatchWith=nc,Ae.isNaN=ik,Ae.isNative=l2,Ae.isNil=Pc,Ae.isNull=no,Ae.isNumber=c2,Ae.isObject=Ol,Ae.isObjectLike=Pl,Ae.isPlainObject=fb,Ae.isRegExp=gf,Ae.isSafeInteger=Kv,Ae.isSet=i1,Ae.isString=Qf,Ae.isSymbol=al,Ae.isTypedArray=Qd,Ae.isUndefined=Zd,Ae.isWeakMap=jc,Ae.isWeakSet=db,Ae.join=Na,Ae.kebabCase=m2,Ae.last=_h,Ae.lastIndexOf=va,Ae.lowerCase=B_,Ae.lowerFirst=aO,Ae.lt=u2,Ae.lte=__,Ae.max=pO,Ae.maxBy=bp,Ae.mean=Q0,Ae.meanBy=Ah,Ae.min=$k,Ae.minBy=pm,Ae.stubArray=L0,Ae.stubFalse=gm,Ae.stubObject=yb,Ae.stubString=vu,Ae.stubTrue=a1,Ae.multiply=Hd,Ae.nth=uf,Ae.noConflict=Ek,Ae.noop=gO,Ae.now=Oa,Ae.pad=bk,Ae.padEnd=L_,Ae.padStart=vk,Ae.parseInt=Ok,Ae.random=R0,Ae.reduce=hf,Ae.reduceRight=cb,Ae.repeat=F_,Ae.replace=Q_,Ae.result=mk,Ae.round=wb,Ae.runInContext=vt,Ae.sample=pu,Ae.size=Yi,Ae.snakeCase=Z_,Ae.some=Ky,Ae.sortedIndex=Sh,Ae.sortedIndexBy=_0,Ae.sortedIndexOf=zv,Ae.sortedLastIndex=ad,Ae.sortedLastIndexBy=ff,Ae.sortedLastIndexOf=Kp,Ae.startCase=wk,Ae.startsWith=_k,Ae.subtract=C2,Ae.sum=_b,Ae.sumBy=Og,Ae.template=H_,Ae.times=U_,Ae.toFinite=xh,Ae.toInteger=jr,Ae.toLength=Jv,Ae.toLower=g2,Ae.toNumber=ud,Ae.toSafeInteger=C_,Ae.toString=fa,Ae.toUpper=p2,Ae.trim=Sk,Ae.trimEnd=Ck,Ae.trimStart=lO,Ae.truncate=z_,Ae.unescape=cO,Ae.uniqueId=w2,Ae.upperCase=N0,Ae.upperFirst=bb,Ae.each=k0,Ae.eachRight=x0,Ae.first=Ga,O2(Ae,function(){var S={};return od(Ae,function(A,H){ii.call(Ae.prototype,H)||(S[H]=A)}),S}(),{chain:!1}),Ae.VERSION=s,ks(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){Ae[S].placeholder=Ae}),ks(["drop","take"],function(S,A){hi.prototype[S]=function(H){H=H===t?1:vo(jr(H),0);var le=this.__filtered__&&!A?new hi(this):this.clone();return le.__filtered__?le.__takeCount__=Tr(H,le.__takeCount__):le.__views__.push({size:Tr(H,He),type:S+(le.__dir__<0?"Right":"")}),le},hi.prototype[S+"Right"]=function(H){return this.reverse()[S](H).reverse()}}),ks(["filter","map","takeWhile"],function(S,A){var H=A+1,le=H==tt||H==V;hi.prototype[S]=function(Ce){var We=this.clone();return We.__iteratees__.push({iteratee:Qs(Ce,3),type:H}),We.__filtered__=We.__filtered__||le,We}}),ks(["head","last"],function(S,A){var H="take"+(A?"Right":"");hi.prototype[S]=function(){return this[H](1).value()[0]}}),ks(["initial","tail"],function(S,A){var H="drop"+(A?"":"Right");hi.prototype[S]=function(){return this.__filtered__?new hi(this):this[H](1)}}),hi.prototype.compact=function(){return this.filter(bf)},hi.prototype.find=function(S){return this.filter(S).head()},hi.prototype.findLast=function(S){return this.reverse().find(S)},hi.prototype.invokeMap=hr(function(S,A){return typeof S=="function"?new hi(this):this.map(function(H){return hc(H,S,A)})}),hi.prototype.reject=function(S){return this.filter(kh(Qs(S)))},hi.prototype.slice=function(S,A){S=jr(S);var H=this;return H.__filtered__&&(S>0||A<0)?new hi(H):(S<0?H=H.takeRight(-S):S&&(H=H.drop(S)),A!==t&&(A=jr(A),H=A<0?H.dropRight(-A):H.take(A-S)),H)},hi.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},hi.prototype.toArray=function(){return this.take(He)},od(hi.prototype,function(S,A){var H=/^(?:filter|find|map|reject)|While$/.test(A),le=/^(?:head|last)$/.test(A),Ce=Ae[le?"take"+(A=="last"?"Right":""):A],We=le||/^find/.test(A);!Ce||(Ae.prototype[A]=function(){var ht=this.__wrapped__,St=le?[1]:arguments,zt=ht instanceof hi,vn=St[0],Zn=zt||Sr(ht),Vn=function(gi){var ki=Ce.apply(Ae,jf([gi],St));return le&&Fo?ki[0]:ki};Zn&&H&&typeof vn=="function"&&vn.length!=1&&(zt=Zn=!1);var Fo=this.__chain__,ms=!!this.__actions__.length,Is=We&&!Fo,Hr=zt&&!ms;if(!We&&Zn){ht=Hr?ht:new hi(this);var Zs=S.apply(ht,St);return Zs.__actions__.push({func:e1,args:[Vn],thisArg:t}),new $u(Zs,Fo)}return Is&&Hr?S.apply(this,St):(Zs=this.thru(Vn),Is?le?Zs.value()[0]:Zs.value():Zs)})}),ks(["pop","push","shift","sort","splice","unshift"],function(S){var A=Td[S],H=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",le=/^(?:pop|shift)$/.test(S);Ae.prototype[S]=function(){var Ce=arguments;if(le&&!this.__chain__){var We=this.value();return A.apply(Sr(We)?We:[],Ce)}return this[H](function(ht){return A.apply(Sr(ht)?ht:[],Ce)})}}),od(hi.prototype,function(S,A){var H=Ae[A];if(H){var le=H.name+"";ii.call(na,le)||(na[le]=[]),na[le].push({name:A,func:H})}}),na[rr(t,U).name]=[{name:"wrapper",func:t}],hi.prototype.clone=Pv,hi.prototype.reverse=j1,hi.prototype.value=t0,Ae.prototype.at=fg,Ae.prototype.chain=Uv,Ae.prototype.commit=sa,Ae.prototype.next=df,Ae.prototype.plant=ek,Ae.prototype.reverse=Xy,Ae.prototype.toJSON=Ae.prototype.valueOf=Ae.prototype.value=tk,Ae.prototype.first=Ae.prototype.head,ai&&(Ae.prototype[ai]=ab),Ae},Kh=U1();Ue?((Ue.exports=Kh)._=Kh,$e._=Kh):me._=Kh}).call(NN)})(Lc,Lc.exports);function wle(o){let e,t;return{c(){e=re("span"),t=Ht(o[4]),Z(e,"class","text-muted")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&16&&Fn(t,s[4])},d(s){s&&ke(e)}}}function Bwe(o){let e,t,s=!1,a,l,u,d,h,b,y,C=o[4]&&wle(o);return h=nre(o[7][0]),{c(){e=re("div"),t=re("input"),a=Ze(),l=re("label"),u=Ht(o[1]),d=Ze(),C&&C.c(),Z(t,"class","form-check-input"),Z(t,"type","radio"),t.__value=o[3],t.value=t.__value,Z(t,"name",o[2]),Z(t,"id",o[5]),Z(l,"class","form-check-label"),Z(l,"for",o[5]),Z(e,"class","form-check"),h.p(t)},m(E,R){Te(E,e,R),X(e,t),t.checked=t.__value===o[0],X(e,a),X(e,l),X(l,u),X(e,d),C&&C.m(e,null),b||(y=mn(t,"change",o[6]),b=!0)},p(E,[R]){R&8&&(t.__value=E[3],t.value=t.__value,s=!0),R&4&&Z(t,"name",E[2]),(s||R&1)&&(t.checked=t.__value===E[0]),R&2&&Fn(u,E[1]),E[4]?C?C.p(E,R):(C=wle(E),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i:un,o:un,d(E){E&&ke(e),C&&C.d(),h.r(),b=!1,y()}}}function Lwe(o,e,t){let{label:s}=e,{name:a}=e,{group:l}=e,{value:u}=e,{help:d}=e,h=Lc.exports.uniqueId();const b=[[]];function y(){l=this.__value,t(0,l)}return o.$$set=C=>{"label"in C&&t(1,s=C.label),"name"in C&&t(2,a=C.name),"group"in C&&t(0,l=C.group),"value"in C&&t(3,u=C.value),"help"in C&&t(4,d=C.help)},[l,s,a,u,d,h,y,b]}class Fwe extends uo{constructor(e){super(),co(this,e,Lwe,Bwe,lo,{label:1,name:2,group:0,value:3,help:4})}}function _le(o,e,t){const s=o.slice();return s[7]=e[t],s}function Sle(o,e,t){const s=o.slice();return s[7]=e[t],s}function Cle(o){let e,t=o[7]+"",s,a,l;function u(...d){return o[4](o[7],...d)}return{c(){e=re("button"),s=Ht(t),Z(e,"class","dropdown-item text-capitalize")},m(d,h){Te(d,e,h),X(e,s),a||(l=mn(e,"click",u),a=!0)},p(d,h){o=d,h&2&&t!==(t=o[7]+"")&&Fn(s,t)},d(d){d&&ke(e),a=!1,l()}}}function kle(o){let e=o[0].roles.includes(o[7]),t,s=e&&Cle(o);return{c(){s&&s.c(),t=Rs()},m(a,l){s&&s.m(a,l),Te(a,t,l)},p(a,l){l&3&&(e=a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=Cle(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&ke(t)}}}function xle(o){let e,t=o[7]+"",s,a,l,u;function d(...h){return o[5](o[7],...h)}return{c(){e=re("button"),s=Ht(t),a=Ze(),Z(e,"class","dropdown-item text-capitalize")},m(h,b){Te(h,e,b),X(e,s),X(e,a),l||(u=mn(e,"click",d),l=!0)},p(h,b){o=h,b&2&&t!==(t=o[7]+"")&&Fn(s,t)},d(h){h&&ke(e),l=!1,u()}}}function Tle(o){let e=!o[0].roles.includes(o[7]),t,s=e&&xle(o);return{c(){s&&s.c(),t=Rs()},m(a,l){s&&s.m(a,l),Te(a,t,l)},p(a,l){l&3&&(e=!a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=xle(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&ke(t)}}}function Qwe(o){var ut;let e,t,s,a,l,u,d,h=o[0].name+"",b,y,C=o[0].email+"",E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce;s=new vy({props:{name:(ut=o[0].name)!=null?ut:"",side:32}});let Xe=o[1],tt=[];for(let Qe=0;Qe<Xe.length;Qe+=1)tt[Qe]=kle(Sle(o,Xe,Qe));let ot=o[1],V=[];for(let Qe=0;Qe<ot.length;Qe+=1)V[Qe]=Tle(_le(o,ot,Qe));return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),l=re("div"),u=re("div"),d=re("span"),b=Ht(h),y=Ze(),E=Ht(C),$=Ze(),Q=re("div"),F=re("div"),U=re("button"),U.textContent="Roles",K=Ze(),L=re("div"),te=re("h6"),te.textContent="Remove role",ne=Ze();for(let Qe=0;Qe<tt.length;Qe+=1)tt[Qe].c();oe=Ze(),G=re("div"),G.innerHTML='<hr class="dropdown-divider"/>',we=Ze(),ve=re("h6"),ve.textContent="Add role",Re=Ze();for(let Qe=0;Qe<V.length;Qe+=1)V[Qe].c();Z(d,"class","fs-5"),Z(l,"class","ms-3 "),Z(t,"class",R="d-flex align-items-center status-"+(o[0].roles.includes("removed")?"removed":"active")+" svelte-1jo1k1d"),Z(U,"class","dropdown-toggle btn btn-light"),Z(U,"type","button"),Z(U,"data-bs-toggle","dropdown"),Z(U,"aria-expanded","false"),Z(te,"class","dropdown-header"),Z(ve,"class","dropdown-header"),Z(L,"class","dropdown-menu"),Z(F,"class","dropdown dropdown-center"),Z(e,"class","d-flex justify-content-between align-items-center mb-3 ")},m(Qe,Bt){Te(Qe,e,Bt),X(e,t),Kt(s,t,null),X(t,a),X(t,l),X(l,u),X(u,d),X(d,b),X(l,y),X(l,E),X(e,$),X(e,Q),X(Q,F),X(F,U),X(F,K),X(F,L),X(L,te),X(L,ne);for(let Ct=0;Ct<tt.length;Ct+=1)tt[Ct]&&tt[Ct].m(L,null);X(L,oe),X(L,G),X(L,we),X(L,ve),X(L,Re);for(let Ct=0;Ct<V.length;Ct+=1)V[Ct]&&V[Ct].m(L,null);ce=!0},p(Qe,[Bt]){var He;const Ct={};if(Bt&1&&(Ct.name=(He=Qe[0].name)!=null?He:""),s.$set(Ct),(!ce||Bt&1)&&h!==(h=Qe[0].name+"")&&Fn(b,h),(!ce||Bt&1)&&C!==(C=Qe[0].email+"")&&Fn(E,C),(!ce||Bt&1&&R!==(R="d-flex align-items-center status-"+(Qe[0].roles.includes("removed")?"removed":"active")+" svelte-1jo1k1d"))&&Z(t,"class",R),Bt&7){Xe=Qe[1];let st;for(st=0;st<Xe.length;st+=1){const rn=Sle(Qe,Xe,st);tt[st]?tt[st].p(rn,Bt):(tt[st]=kle(rn),tt[st].c(),tt[st].m(L,oe))}for(;st<tt.length;st+=1)tt[st].d(1);tt.length=Xe.length}if(Bt&11){ot=Qe[1];let st;for(st=0;st<ot.length;st+=1){const rn=_le(Qe,ot,st);V[st]?V[st].p(rn,Bt):(V[st]=Tle(rn),V[st].c(),V[st].m(L,null))}for(;st<V.length;st+=1)V[st].d(1);V.length=ot.length}},i(Qe){ce||(xe(s.$$.fragment,Qe),AC(()=>{!ce||(Oe||(Oe=ez(e,tz,{duration:200},!0)),Oe.run(1))}),ce=!0)},o(Qe){Be(s.$$.fragment,Qe),Oe||(Oe=ez(e,tz,{duration:200},!1)),Oe.run(0),ce=!1},d(Qe){Qe&&ke(e),Jt(s),ia(tt,Qe),ia(V,Qe),Qe&&Oe&&Oe.end()}}}function Zwe(o,e,t){const s=Fg();let{member:a}=e,{roles:l}=e;function u(y,C){y.preventDefault();let E=a.roles.filter(R=>R!==C);s("update",{user:a.id,roles:E})}function d(y,C){y.preventDefault();let E=[...a.roles,C];console.log(a.roles),console.log(C),console.log(E),s("update",{user:a.id,roles:E})}const h=(y,C)=>u(C,y),b=(y,C)=>d(C,y);return o.$$set=y=>{"member"in y&&t(0,a=y.member),"roles"in y&&t(1,l=y.roles)},[a,l,u,d,h,b]}class Hwe extends uo{constructor(e){super(),co(this,e,Zwe,Qwe,lo,{member:0,roles:1})}}function Ele(o,e,t){const s=o.slice();return s[15]=e[t],s}function Ale(o,e,t){const s=o.slice();return s[18]=e[t],s}function Dle(o){let e,t,s;function a(u){o[13](u)}let l={value:o[18],name:"role",label:o[18]};return o[3]!==void 0&&(l.group=o[3]),e=new Fwe({props:l}),Ro.push(()=>er(e,"group",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};!t&&d&8&&(t=!0,h.group=u[3],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function Ple(o){let e,t;return e=new Hwe({props:{member:o[15],roles:o[6].roles}}),e.$on("update",o[9]),e.$on("reinvite",o[14]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.member=s[15]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function zwe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt;l=new X6({props:{message:o[4]}});let ot={};d=new sre({props:ot}),o[10](d);let V=o[6].roles.filter(Mle),ut=[];for(let st=0;st<V.length;st+=1)ut[st]=Dle(Ale(o,V,st));const Qe=st=>Be(ut[st],1,1,()=>{ut[st]=null});G=new AD({props:{label:"Invite"}});let Bt=o[0],Ct=[];for(let st=0;st<Bt.length;st+=1)Ct[st]=Ple(Ele(o,Bt,st));const He=st=>Be(Ct[st],1,1,()=>{Ct[st]=null});return{c(){e=re("div"),t=re("div"),s=re("h3"),s.textContent="Invite people",a=Ze(),en(l.$$.fragment),u=Ze(),en(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),C=re("label"),C.textContent="Invitee Name",E=Ze(),R=re("input"),$=Ze(),Q=re("div"),F=re("label"),F.textContent="Invitee Email Address",U=Ze(),K=re("input"),L=Ze(),te=re("div");for(let st=0;st<ut.length;st+=1)ut[st].c();ne=Ze(),oe=re("div"),en(G.$$.fragment),we=Ze(),ve=re("div"),Re=re("h3"),Re.textContent="Members",Oe=Ze();for(let st=0;st<Ct.length;st+=1)Ct[st].c();Z(s,"class","header-small mb-5"),Z(C,"for","inviteeName"),Z(C,"class","form-label"),Z(R,"type","text"),Z(R,"class","form-control"),Z(R,"id","inviteeName"),Z(R,"placeholder","Member name"),R.required=!0,Z(y,"class","mb-3"),Z(F,"for","inviteeEmail"),Z(F,"class","form-label"),Z(K,"type","email"),Z(K,"class","form-control"),Z(K,"id","inviteeEmail"),Z(K,"placeholder","Member email"),K.required=!0,Z(Q,"class","mb-3"),Z(te,"class","me-3"),Z(oe,"class","mt-5 d-block text-center"),Z(t,"class","lx-card mt-5"),Z(Re,"class","header-small mb-5"),Z(ve,"class","lx-card mt-3"),Z(e,"class","wrapper-tiny transparent mb-5")},m(st,rn){Te(st,e,rn),X(e,t),X(t,s),X(t,a),Kt(l,t,null),X(t,u),Kt(d,t,null),X(t,h),X(t,b),X(b,y),X(y,C),X(y,E),X(y,R),ar(R,o[1]),X(b,$),X(b,Q),X(Q,F),X(Q,U),X(Q,K),ar(K,o[2]),X(b,L),X(b,te);for(let Et=0;Et<ut.length;Et+=1)ut[Et]&&ut[Et].m(te,null);X(b,ne),X(b,oe),Kt(G,oe,null),X(e,we),X(e,ve),X(ve,Re),X(ve,Oe);for(let Et=0;Et<Ct.length;Et+=1)Ct[Et]&&Ct[Et].m(ve,null);ce=!0,Xe||(tt=[mn(R,"input",o[11]),mn(K,"input",o[12]),mn(b,"submit",o[7])],Xe=!0)},p(st,[rn]){const Et={};rn&16&&(Et.message=st[4]),l.$set(Et);const Cn={};if(d.$set(Cn),rn&2&&R.value!==st[1]&&ar(R,st[1]),rn&4&&K.value!==st[2]&&ar(K,st[2]),rn&72){V=st[6].roles.filter(Mle);let je;for(je=0;je<V.length;je+=1){const mt=Ale(st,V,je);ut[je]?(ut[je].p(mt,rn),xe(ut[je],1)):(ut[je]=Dle(mt),ut[je].c(),xe(ut[je],1),ut[je].m(te,null))}for(mo(),je=V.length;je<ut.length;je+=1)Qe(je);go()}if(rn&833){Bt=st[0];let je;for(je=0;je<Bt.length;je+=1){const mt=Ele(st,Bt,je);Ct[je]?(Ct[je].p(mt,rn),xe(Ct[je],1)):(Ct[je]=Ple(mt),Ct[je].c(),xe(Ct[je],1),Ct[je].m(ve,null))}for(mo(),je=Bt.length;je<Ct.length;je+=1)He(je);go()}},i(st){if(!ce){xe(l.$$.fragment,st),xe(d.$$.fragment,st);for(let rn=0;rn<V.length;rn+=1)xe(ut[rn]);xe(G.$$.fragment,st);for(let rn=0;rn<Bt.length;rn+=1)xe(Ct[rn]);ce=!0}},o(st){Be(l.$$.fragment,st),Be(d.$$.fragment,st),ut=ut.filter(Boolean);for(let rn=0;rn<ut.length;rn+=1)Be(ut[rn]);Be(G.$$.fragment,st),Ct=Ct.filter(Boolean);for(let rn=0;rn<Ct.length;rn+=1)Be(Ct[rn]);ce=!1},d(st){st&&ke(e),Jt(l),o[10](null),Jt(d),ia(ut,st),Jt(G),ia(Ct,st),Xe=!1,vi(tt)}}}const Mle=o=>o!=="removed";function Vwe(o,e,t){const s=Ur("channel");let{users:a}=e,l,u,d,h="",b;function y(K){K.preventDefault(),C(l,u,d)}function C(K,L,te){t(4,h=""),axios.post(s.lucentUrl+"/members/invite",{name:K,email:L,roles:[te]}).then(ne=>{b.show("User was invited"),t(0,a=[...a,ne.data.user]),t(1,l=null),t(2,u=null),t(3,d=null)}).catch(ne=>{var oe,G,we;t(4,h=(we=(G=(oe=ne.response)==null?void 0:oe.data)==null?void 0:G.error)!=null?we:"")})}function E(K){K.preventDefault(),t(4,h=""),axios.post(s.lucentUrl+"/members/update",{id:K.detail.user,roles:K.detail.roles}).then(L=>{b.show("Users updated"),t(0,a=L.data.users)}).catch(L=>{var te,ne,oe;t(4,h=(oe=(ne=(te=L.response)==null?void 0:te.data)==null?void 0:ne.error)!=null?oe:"")})}function R(K){Ro[K?"unshift":"push"](()=>{b=K,t(5,b)})}function $(){l=this.value,t(1,l)}function Q(){u=this.value,t(2,u)}function F(K){d=K,t(3,d)}const U=K=>C(K.detail.email,K.detail.role);return o.$$set=K=>{"users"in K&&t(0,a=K.users)},[a,l,u,d,h,b,s,y,C,E,R,$,Q,F,U]}class Wwe extends uo{constructor(e){super(),co(this,e,Vwe,zwe,lo,{users:0})}}function Uwe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Ht(o[0]),Z(t,"class","header-normal"),Z(e,"class","wrapper-normal ")},m(a,l){Te(a,e,l),X(e,t),X(t,s)},p(a,[l]){l&1&&Fn(s,a[0])},i:un,o:un,d(a){a&&ke(e)}}}function Ywe(o,e,t){let{title:s}=e;return o.$$set=a=>{"title"in a&&t(0,s=a.title)},[s]}class Xwe extends uo{constructor(e){super(),co(this,e,Ywe,Uwe,lo,{title:0})}}function jwe(o){let e,t=o[5].path+"";return{c(){e=Spe("svg"),Z(e,"class","bi svelte-1coky4l"),Z(e,"xmlns","http://www.w3.org/2000/svg"),Z(e,"width",o[0]),Z(e,"height",o[1]),Z(e,"viewBox",o[5].viewBox),Z(e,"aria-labelledby",o[2]),Z(e,"role","presentation"),Z(e,"stroke",o[4]),Z(e,"fill",o[3])},m(s,a){Te(s,e,a),e.innerHTML=t},p(s,[a]){a&1&&Z(e,"width",s[0]),a&2&&Z(e,"height",s[1]),a&4&&Z(e,"aria-labelledby",s[2]),a&16&&Z(e,"stroke",s[4]),a&8&&Z(e,"fill",s[3])},i:un,o:un,d(s){s&&ke(e)}}}function qwe(o,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:l=16}=e,{icon:u=""}=e,{fill:d="currentColor"}=e,{stroke:h="currentColor"}=e,b=s[u];return o.$$set=y=>{"width"in y&&t(0,a=y.width),"height"in y&&t(1,l=y.height),"icon"in y&&t(2,u=y.icon),"fill"in y&&t(3,d=y.fill),"stroke"in y&&t(4,h=y.stroke)},[a,l,u,d,h,b]}class Fa extends uo{constructor(e){super(),co(this,e,qwe,jwe,lo,{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 Gwe=Object.prototype.toString,jD=Array.isArray||function(e){return Gwe.call(e)==="[object Array]"};function rre(o){return typeof o=="function"}function Kwe(o){return jD(o)?"array":typeof o}function gne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Rle(o,e){return o!=null&&typeof o=="object"&&e in o}function Jwe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var e_e=RegExp.prototype.test;function t_e(o,e){return e_e.call(o,e)}var n_e=/\S/;function o_e(o){return!t_e(n_e,o)}var s_e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function r_e(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return s_e[t]})}var i_e=/\s*/,a_e=/\s+/,$le=/\s*=/,l_e=/\s*\}/,c_e=/#|\^|\/|>|\{|&|=|!/;function u_e(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],u=!1,d=!1,h="",b=0;function y(){if(u&&!d)for(;l.length;)delete a[l.pop()];else l=[];u=!1,d=!1}var C,E,R;function $(we){if(typeof we=="string"&&(we=we.split(a_e,2)),!jD(we)||we.length!==2)throw new Error("Invalid tags: "+we);C=new RegExp(gne(we[0])+"\\s*"),E=new RegExp("\\s*"+gne(we[1])),R=new RegExp("\\s*"+gne("}"+we[1]))}$(e||Zp.tags);for(var Q=new j6(o),F,U,K,L,te,ne;!Q.eos();){if(F=Q.pos,K=Q.scanUntil(C),K)for(var oe=0,G=K.length;oe<G;++oe)L=K.charAt(oe),o_e(L)?(l.push(a.length),h+=L):(d=!0,t=!0,h+=" "),a.push(["text",L,F,F+1]),F+=1,L===`
|
|
`&&(y(),h="",b=0,t=!1);if(!Q.scan(C))break;if(u=!0,U=Q.scan(c_e)||"name",Q.scan(i_e),U==="="?(K=Q.scanUntil($le),Q.scan($le),Q.scanUntil(E)):U==="{"?(K=Q.scanUntil(R),Q.scan(l_e),Q.scanUntil(E),U="&"):K=Q.scanUntil(E),!Q.scan(E))throw new Error("Unclosed tag at "+Q.pos);if(U==">"?te=[U,K,F,Q.pos,h,b,t]:te=[U,K,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(ne=s.pop(),!ne)throw new Error('Unopened section "'+K+'" at '+F);if(ne[1]!==K)throw new Error('Unclosed section "'+ne[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(K)}if(y(),ne=s.pop(),ne)throw new Error('Unclosed section "'+ne[1]+'" at '+Q.pos);return d_e(f_e(a))}function f_e(o){for(var e=[],t,s,a=0,l=o.length;a<l;++a)t=o[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 d_e(o){for(var e=[],t=e,s=[],a,l,u=0,d=o.length;u<d;++u)switch(a=o[u],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":l=s.pop(),l[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function j6(o){this.string=o,this.tail=o,this.pos=0}j6.prototype.eos=function(){return this.tail===""};j6.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};j6.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 DD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}DD.prototype.push=function(e){return new DD(e,this)};DD.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,l,u,d,h=!1;a;){if(e.indexOf(".")>0)for(l=a.view,u=e.split("."),d=0;l!=null&&d<u.length;)d===u.length-1&&(h=Rle(l,u[d])||Jwe(l,u[d])),l=l[u[d++]];else l=a.view[e],h=Rle(a.view,e);if(h){s=l;break}a=a.parent}t[e]=s}return rre(s)&&(s=s.call(this.view)),s};function Qg(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Qg.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Qg.prototype.parse=function(e,t){var s=this.templateCache,a=e+":"+(t||Zp.tags).join(":"),l=typeof s<"u",u=l?s.get(a):void 0;return u==null&&(u=u_e(e,t),l&&s.set(a,u)),u};Qg.prototype.render=function(e,t,s,a){var l=this.getConfigTags(a),u=this.parse(e,l),d=t instanceof DD?t:new DD(t,void 0);return this.renderTokens(u,d,s,e,a)};Qg.prototype.renderTokens=function(e,t,s,a,l){for(var u="",d,h,b,y=0,C=e.length;y<C;++y)b=void 0,d=e[y],h=d[0],h==="#"?b=this.renderSection(d,t,s,a,l):h==="^"?b=this.renderInverted(d,t,s,a,l):h===">"?b=this.renderPartial(d,t,s,l):h==="&"?b=this.unescapedValue(d,t):h==="name"?b=this.escapedValue(d,t,l):h==="text"&&(b=this.rawValue(d)),b!==void 0&&(u+=b);return u};Qg.prototype.renderSection=function(e,t,s,a,l){var u=this,d="",h=t.lookup(e[1]);function b(E){return u.render(E,t,s,l)}if(!!h){if(jD(h))for(var y=0,C=h.length;y<C;++y)d+=this.renderTokens(e[4],t.push(h[y]),s,a,l);else if(typeof h=="object"||typeof h=="string"||typeof h=="number")d+=this.renderTokens(e[4],t.push(h),s,a,l);else if(rre(h)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");h=h.call(t.view,a.slice(e[3],e[5]),b),h!=null&&(d+=h)}else d+=this.renderTokens(e[4],t,s,a,l);return d}};Qg.prototype.renderInverted=function(e,t,s,a,l){var u=t.lookup(e[1]);if(!u||jD(u)&&u.length===0)return this.renderTokens(e[4],t,s,a,l)};Qg.prototype.indentPartial=function(e,t,s){for(var a=t.replace(/[^ \t]/g,""),l=e.split(`
|
|
`),u=0;u<l.length;u++)l[u].length&&(u>0||!s)&&(l[u]=a+l[u]);return l.join(`
|
|
`)};Qg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),u=rre(s)?s(e[1]):s[e[1]];if(u!=null){var d=e[6],h=e[5],b=e[4],y=u;h==0&&b&&(y=this.indentPartial(u,b,d));var C=this.parse(y,l);return this.renderTokens(C,t,s,y,a)}}};Qg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Qg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Zp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Zp.escape?String(l):a(l)};Qg.prototype.rawValue=function(e){return e[1]};Qg.prototype.getConfigTags=function(e){return jD(e)?e:e&&typeof e=="object"?e.tags:void 0};Qg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!jD(e))return e.escape};var Zp={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(o){w6.templateCache=o},get templateCache(){return w6.templateCache}},w6=new Qg;Zp.clearCache=function(){return w6.clearCache()};Zp.parse=function(e,t){return w6.parse(e,t)};Zp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Kwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return w6.render(e,t,s,a)};Zp.escape=r_e;Zp.Scanner=j6;Zp.Context=DD;Zp.Writer=Qg;function nz(o){return nz=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},nz(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length<o)throw new TypeError(o+" argument"+(o>1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||nz(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="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))}function h_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var m_e={};function q6(){return m_e}function Noe(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function g_e(o){return Sc(1,arguments),o instanceof Date||nz(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function p_e(o){if(Sc(1,arguments),!g_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function b_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function v_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Nle={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},O_e="trunc";function y_e(o){return o?Nle[o]:Nle[O_e]}function w_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function __e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function S_e(o){Sc(1,arguments);var e=cc(o);return w_e(e).getTime()===__e(e).getTime()}function C_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(b_e(t,s)),u;if(l<1)u=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=kH(t,s)===-a;S_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),u=a*(l-Number(d))}return u===0?0:u}function k_e(o,e,t){Sc(2,arguments);var s=v_e(o,e)/1e3;return y_e(t==null?void 0:t.roundingMethod)(s)}function x_e(o,e){Sc(2,arguments);var t=hE(e);return h_e(o,-t)}var T_e=864e5;function E_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/T_e)+1}function oz(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s<e?7:0)+s-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function Rpe(o){Sc(1,arguments);var e=cc(o),t=e.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(t+1,0,4),s.setUTCHours(0,0,0,0);var a=oz(s),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var u=oz(l);return e.getTime()>=a.getTime()?t+1:e.getTime()>=u.getTime()?t:t-1}function A_e(o){Sc(1,arguments);var e=Rpe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=oz(t);return s}var D_e=6048e5;function P_e(o){Sc(1,arguments);var e=cc(o),t=oz(e).getTime()-A_e(e).getTime();return Math.round(t/D_e)+1}function sz(o,e){var t,s,a,l,u,d,h,b;Sc(1,arguments);var y=q6(),C=hE((t=(s=(a=(l=e==null?void 0:e.weekStartsOn)!==null&&l!==void 0?l:e==null||(u=e.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:y.weekStartsOn)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&t!==void 0?t:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var E=cc(o),R=E.getUTCDay(),$=(R<C?7:0)+R-C;return E.setUTCDate(E.getUTCDate()-$),E.setUTCHours(0,0,0,0),E}function $pe(o,e){var t,s,a,l,u,d,h,b;Sc(1,arguments);var y=cc(o),C=y.getUTCFullYear(),E=q6(),R=hE((t=(s=(a=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(u=e.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:E.firstWeekContainsDate)!==null&&s!==void 0?s:(h=E.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=new Date(0);$.setUTCFullYear(C+1,0,R),$.setUTCHours(0,0,0,0);var Q=sz($,e),F=new Date(0);F.setUTCFullYear(C,0,R),F.setUTCHours(0,0,0,0);var U=sz(F,e);return y.getTime()>=Q.getTime()?C+1:y.getTime()>=U.getTime()?C:C-1}function M_e(o,e){var t,s,a,l,u,d,h,b;Sc(1,arguments);var y=q6(),C=hE((t=(s=(a=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(u=e.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:y.firstWeekContainsDate)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&t!==void 0?t:1),E=$pe(o,e),R=new Date(0);R.setUTCFullYear(E,0,C),R.setUTCHours(0,0,0,0);var $=sz(R,e);return $}var R_e=6048e5;function $_e(o,e){Sc(1,arguments);var t=cc(o),s=sz(t,e).getTime()-M_e(t,e).getTime();return Math.round(s/R_e)+1}function Bl(o,e){for(var t=o<0?"-":"",s=Math.abs(o).toString();s.length<e;)s="0"+s;return t+s}var N_e={y:function(e,t){var s=e.getUTCFullYear(),a=s>0?s:1-s;return Bl(t==="yy"?a%100:a,t.length)},M:function(e,t){var s=e.getUTCMonth();return t==="M"?String(s+1):Bl(s+1,2)},d:function(e,t){return Bl(e.getUTCDate(),t.length)},a:function(e,t){var s=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(e,t){return Bl(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Bl(e.getUTCHours(),t.length)},m:function(e,t){return Bl(e.getUTCMinutes(),t.length)},s:function(e,t){return Bl(e.getUTCSeconds(),t.length)},S:function(e,t){var s=t.length,a=e.getUTCMilliseconds(),l=Math.floor(a*Math.pow(10,s-3));return Bl(l,t.length)}};const mC=N_e;var J4={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},I_e={G:function(e,t,s){var a=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(a,{width:"abbreviated"});case"GGGGG":return s.era(a,{width:"narrow"});case"GGGG":default:return s.era(a,{width:"wide"})}},y:function(e,t,s){if(t==="yo"){var a=e.getUTCFullYear(),l=a>0?a:1-a;return s.ordinalNumber(l,{unit:"year"})}return mC.y(e,t)},Y:function(e,t,s,a){var l=$pe(e,a),u=l>0?l:1-l;if(t==="YY"){var d=u%100;return Bl(d,2)}return t==="Yo"?s.ordinalNumber(u,{unit:"year"}):Bl(u,t.length)},R:function(e,t){var s=Rpe(e);return Bl(s,t.length)},u:function(e,t){var s=e.getUTCFullYear();return Bl(s,t.length)},Q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Bl(a,2);case"Qo":return s.ordinalNumber(a,{unit:"quarter"});case"QQQ":return s.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Bl(a,2);case"qo":return s.ordinalNumber(a,{unit:"quarter"});case"qqq":return s.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,s){var a=e.getUTCMonth();switch(t){case"M":case"MM":return mC.M(e,t);case"Mo":return s.ordinalNumber(a+1,{unit:"month"});case"MMM":return s.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,s){var a=e.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return Bl(a+1,2);case"Lo":return s.ordinalNumber(a+1,{unit:"month"});case"LLL":return s.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,s,a){var l=$_e(e,a);return t==="wo"?s.ordinalNumber(l,{unit:"week"}):Bl(l,t.length)},I:function(e,t,s){var a=P_e(e);return t==="Io"?s.ordinalNumber(a,{unit:"week"}):Bl(a,t.length)},d:function(e,t,s){return t==="do"?s.ordinalNumber(e.getUTCDate(),{unit:"date"}):mC.d(e,t)},D:function(e,t,s){var a=E_e(e);return t==="Do"?s.ordinalNumber(a,{unit:"dayOfYear"}):Bl(a,t.length)},E:function(e,t,s){var a=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return s.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(a,{width:"short",context:"formatting"});case"EEEE":default:return s.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,s,a){var l=e.getUTCDay(),u=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(u);case"ee":return Bl(u,2);case"eo":return s.ordinalNumber(u,{unit:"day"});case"eee":return s.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(l,{width:"short",context:"formatting"});case"eeee":default:return s.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,s,a){var l=e.getUTCDay(),u=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(u);case"cc":return Bl(u,t.length);case"co":return s.ordinalNumber(u,{unit:"day"});case"ccc":return s.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(l,{width:"narrow",context:"standalone"});case"cccccc":return s.day(l,{width:"short",context:"standalone"});case"cccc":default:return s.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,s){var a=e.getUTCDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return Bl(l,t.length);case"io":return s.ordinalNumber(l,{unit:"day"});case"iii":return s.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(a,{width:"short",context:"formatting"});case"iiii":default:return s.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,s){var a=e.getUTCHours(),l=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,s){var a=e.getUTCHours(),l;switch(a===12?l=J4.noon:a===0?l=J4.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,s){var a=e.getUTCHours(),l;switch(a>=17?l=J4.evening:a>=12?l=J4.afternoon:a>=4?l=J4.morning:l=J4.night,t){case"B":case"BB":case"BBB":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,s){if(t==="ho"){var a=e.getUTCHours()%12;return a===0&&(a=12),s.ordinalNumber(a,{unit:"hour"})}return mC.h(e,t)},H:function(e,t,s){return t==="Ho"?s.ordinalNumber(e.getUTCHours(),{unit:"hour"}):mC.H(e,t)},K:function(e,t,s){var a=e.getUTCHours()%12;return t==="Ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},k:function(e,t,s){var a=e.getUTCHours();return a===0&&(a=24),t==="ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},m:function(e,t,s){return t==="mo"?s.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):mC.m(e,t)},s:function(e,t,s){return t==="so"?s.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):mC.s(e,t)},S:function(e,t){return mC.S(e,t)},X:function(e,t,s,a){var l=a._originalDate||e,u=l.getTimezoneOffset();if(u===0)return"Z";switch(t){case"X":return Ble(u);case"XXXX":case"XX":return eE(u);case"XXXXX":case"XXX":default:return eE(u,":")}},x:function(e,t,s,a){var l=a._originalDate||e,u=l.getTimezoneOffset();switch(t){case"x":return Ble(u);case"xxxx":case"xx":return eE(u);case"xxxxx":case"xxx":default:return eE(u,":")}},O:function(e,t,s,a){var l=a._originalDate||e,u=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ile(u,":");case"OOOO":default:return"GMT"+eE(u,":")}},z:function(e,t,s,a){var l=a._originalDate||e,u=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ile(u,":");case"zzzz":default:return"GMT"+eE(u,":")}},t:function(e,t,s,a){var l=a._originalDate||e,u=Math.floor(l.getTime()/1e3);return Bl(u,t.length)},T:function(e,t,s,a){var l=a._originalDate||e,u=l.getTime();return Bl(u,t.length)}};function Ile(o,e){var t=o>0?"-":"+",s=Math.abs(o),a=Math.floor(s/60),l=s%60;if(l===0)return t+String(a);var u=e||"";return t+String(a)+u+Bl(l,2)}function Ble(o,e){if(o%60===0){var t=o>0?"-":"+";return t+Bl(Math.abs(o)/60,2)}return eE(o,e)}function eE(o,e){var t=e||"",s=o>0?"-":"+",a=Math.abs(o),l=Bl(Math.floor(a/60),2),u=Bl(a%60,2);return s+l+t+u}const B_e=I_e;var Lle=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Npe=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},L_e=function(e,t){var s=e.match(/(P+)(p+)?/)||[],a=s[1],l=s[2];if(!l)return Lle(e,t);var u;switch(a){case"P":u=t.dateTime({width:"short"});break;case"PP":u=t.dateTime({width:"medium"});break;case"PPP":u=t.dateTime({width:"long"});break;case"PPPP":default:u=t.dateTime({width:"full"});break}return u.replace("{{date}}",Lle(a,t)).replace("{{time}}",Npe(l,t))},F_e={p:Npe,P:L_e};const Q_e=F_e;var Z_e=["D","DD"],H_e=["YY","YYYY"];function z_e(o){return Z_e.indexOf(o)!==-1}function V_e(o){return H_e.indexOf(o)!==-1}function Fle(o,e,t){if(o==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W_e={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"}},U_e=function(e,t,s){var a,l=W_e[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+a:a+" ago":a};const Y_e=U_e;function pne(o){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):o.defaultWidth,s=o.formats[t]||o.formats[o.defaultWidth];return s}}var X_e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j_e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},q_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G_e={date:pne({formats:X_e,defaultWidth:"full"}),time:pne({formats:j_e,defaultWidth:"full"}),dateTime:pne({formats:q_e,defaultWidth:"full"})};const K_e=G_e;var J_e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},eSe=function(e,t,s,a){return J_e[e]};const tSe=eSe;function BN(o){return function(e,t){var s=t!=null&&t.context?String(t.context):"standalone",a;if(s==="formatting"&&o.formattingValues){var l=o.defaultFormattingWidth||o.defaultWidth,u=t!=null&&t.width?String(t.width):l;a=o.formattingValues[u]||o.formattingValues[l]}else{var d=o.defaultWidth,h=t!=null&&t.width?String(t.width):o.defaultWidth;a=o.values[h]||o.values[d]}var b=o.argumentCallback?o.argumentCallback(e):e;return a[b]}}var nSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oSe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sSe={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"]},rSe={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"]},iSe={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"}},aSe={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"}},lSe=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"},cSe={ordinalNumber:lSe,era:BN({values:nSe,defaultWidth:"wide"}),quarter:BN({values:oSe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:BN({values:sSe,defaultWidth:"wide"}),day:BN({values:rSe,defaultWidth:"wide"}),dayPeriod:BN({values:iSe,defaultWidth:"wide",formattingValues:aSe,defaultFormattingWidth:"wide"})};const uSe=cSe;function LN(o){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.width,a=s&&o.matchPatterns[s]||o.matchPatterns[o.defaultMatchWidth],l=e.match(a);if(!l)return null;var u=l[0],d=s&&o.parsePatterns[s]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(d)?dSe(d,function(C){return C.test(u)}):fSe(d,function(C){return C.test(u)}),b;b=o.valueCallback?o.valueCallback(h):h,b=t.valueCallback?t.valueCallback(b):b;var y=e.slice(u.length);return{value:b,rest:y}}}function fSe(o,e){for(var t in o)if(o.hasOwnProperty(t)&&e(o[t]))return t}function dSe(o,e){for(var t=0;t<o.length;t++)if(e(o[t]))return t}function hSe(o){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=e.match(o.matchPattern);if(!s)return null;var a=s[0],l=e.match(o.parsePattern);if(!l)return null;var u=o.valueCallback?o.valueCallback(l[0]):l[0];u=t.valueCallback?t.valueCallback(u):u;var d=e.slice(a.length);return{value:u,rest:d}}}var mSe=/^(\d+)(th|st|nd|rd)?/i,gSe=/\d+/i,pSe={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},bSe={any:[/^b/i,/^(a|c)/i]},vSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OSe={any:[/1/i,/2/i,/3/i,/4/i]},ySe={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},wSe={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]},_Se={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},SSe={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]},CSe={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},kSe={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}},xSe={ordinalNumber:hSe({matchPattern:mSe,parsePattern:gSe,valueCallback:function(e){return parseInt(e,10)}}),era:LN({matchPatterns:pSe,defaultMatchWidth:"wide",parsePatterns:bSe,defaultParseWidth:"any"}),quarter:LN({matchPatterns:vSe,defaultMatchWidth:"wide",parsePatterns:OSe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:LN({matchPatterns:ySe,defaultMatchWidth:"wide",parsePatterns:wSe,defaultParseWidth:"any"}),day:LN({matchPatterns:_Se,defaultMatchWidth:"wide",parsePatterns:SSe,defaultParseWidth:"any"}),dayPeriod:LN({matchPatterns:CSe,defaultMatchWidth:"any",parsePatterns:kSe,defaultParseWidth:"any"})};const TSe=xSe;var ESe={code:"en-US",formatDistance:Y_e,formatLong:K_e,formatRelative:tSe,localize:uSe,match:TSe,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ipe=ESe;var ASe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,DSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,PSe=/^'([^]*?)'?$/,MSe=/''/g,RSe=/[a-zA-Z]/;function Bpe(o,e,t){var s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te;Sc(2,arguments);var ne=String(e),oe=q6(),G=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:oe.locale)!==null&&s!==void 0?s:Ipe,we=hE((l=(u=(d=(h=t==null?void 0:t.firstWeekContainsDate)!==null&&h!==void 0?h:t==null||(b=t.locale)===null||b===void 0||(y=b.options)===null||y===void 0?void 0:y.firstWeekContainsDate)!==null&&d!==void 0?d:oe.firstWeekContainsDate)!==null&&u!==void 0?u:(C=oe.locale)===null||C===void 0||(E=C.options)===null||E===void 0?void 0:E.firstWeekContainsDate)!==null&&l!==void 0?l:1);if(!(we>=1&&we<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var ve=hE((R=($=(Q=(F=t==null?void 0:t.weekStartsOn)!==null&&F!==void 0?F:t==null||(U=t.locale)===null||U===void 0||(K=U.options)===null||K===void 0?void 0:K.weekStartsOn)!==null&&Q!==void 0?Q:oe.weekStartsOn)!==null&&$!==void 0?$:(L=oe.locale)===null||L===void 0||(te=L.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&R!==void 0?R:0);if(!(ve>=0&&ve<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!G.localize)throw new RangeError("locale must contain localize property");if(!G.formatLong)throw new RangeError("locale must contain formatLong property");var Re=cc(o);if(!p_e(Re))throw new RangeError("Invalid time value");var Oe=Noe(Re),ce=x_e(Re,Oe),Xe={firstWeekContainsDate:we,weekStartsOn:ve,locale:G,_originalDate:Re},tt=ne.match(DSe).map(function(ot){var V=ot[0];if(V==="p"||V==="P"){var ut=Q_e[V];return ut(ot,G.formatLong)}return ot}).join("").match(ASe).map(function(ot){if(ot==="''")return"'";var V=ot[0];if(V==="'")return $Se(ot);var ut=B_e[V];if(ut)return!(t!=null&&t.useAdditionalWeekYearTokens)&&V_e(ot)&&Fle(ot,e,String(o)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&z_e(ot)&&Fle(ot,e,String(o)),ut(ce,ot,G.localize,Xe);if(V.match(RSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");return ot}).join("");return tt}function $Se(o){var e=o.match(PSe);return e?e[1].replace(MSe,"'"):o}function Lpe(o,e){if(o==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)&&(o[t]=e[t]);return o}function NSe(o){return Lpe({},o)}var Qle=1440,ISe=2520,bne=43200,BSe=86400;function LSe(o,e,t){var s,a;Sc(2,arguments);var l=q6(),u=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:l.locale)!==null&&s!==void 0?s:Ipe;if(!u.formatDistance)throw new RangeError("locale must contain formatDistance property");var d=kH(o,e);if(isNaN(d))throw new RangeError("Invalid time value");var h=Lpe(NSe(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:d}),b,y;d>0?(b=cc(e),y=cc(o)):(b=cc(o),y=cc(e));var C=k_e(y,b),E=(Noe(y)-Noe(b))/1e3,R=Math.round((C-E)/60),$;if(R<2)return t!=null&&t.includeSeconds?C<5?u.formatDistance("lessThanXSeconds",5,h):C<10?u.formatDistance("lessThanXSeconds",10,h):C<20?u.formatDistance("lessThanXSeconds",20,h):C<40?u.formatDistance("halfAMinute",0,h):C<60?u.formatDistance("lessThanXMinutes",1,h):u.formatDistance("xMinutes",1,h):R===0?u.formatDistance("lessThanXMinutes",1,h):u.formatDistance("xMinutes",R,h);if(R<45)return u.formatDistance("xMinutes",R,h);if(R<90)return u.formatDistance("aboutXHours",1,h);if(R<Qle){var Q=Math.round(R/60);return u.formatDistance("aboutXHours",Q,h)}else{if(R<ISe)return u.formatDistance("xDays",1,h);if(R<bne){var F=Math.round(R/Qle);return u.formatDistance("xDays",F,h)}else if(R<BSe)return $=Math.round(R/bne),u.formatDistance("aboutXMonths",$,h)}if($=C_e(y,b),$<12){var U=Math.round(R/bne);return u.formatDistance("xMonths",U,h)}else{var K=$%12,L=Math.floor($/12);return K<3?u.formatDistance("aboutXYears",L,h):K<9?u.formatDistance("overXYears",L,h):u.formatDistance("almostXYears",L+1,h)}}function Fpe(o,e){return Sc(1,arguments),LSe(o,Date.now(),e)}function Jz(o){if(Sc(1,arguments),typeof o=="string"){var e=o.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 cc(o)}function cy(o){return Fpe(Jz(o),{addSuffix:!0})}function Zle(o){return o?Bpe(Jz(o),"dd MMM yyyy"):""}function Hle(o){return o?Bpe(Jz(o),"dd MMM yyyy HH:mm"):""}function Qpe(o=""){let e=document.createElement("div");return e.innerHTML=o,e.textContent||e.innerText||""}function zle(o=10){return Math.random().toString(36).substring(2,o+2)}function qu(o,e,t){let s=o.find(h=>h.name===(e==null?void 0:e.schema));if(!(s!=null&&s.titleTemplate))return Vle(s,e);let a=e.data,u=Zp.parse(s.titleTemplate).filter(h=>h[0]==="name").map(h=>h[1]).filter(h=>{let b=s.fields.find(y=>y.name===h);return(b==null?void 0:b.info.name)==="reference"}).reduce((h,b)=>{let y=t.edges.find(E=>E.source===e.id&&E.field===b),C=t.records.find(E=>E.id===(y==null?void 0:y.target));return h[b]=qu(o,C,t),h},{});a={...a,...u};let d=Zp.render(s.titleTemplate,a);return!d||d===""?Vle(s,e):Qpe(d.slice(0,300))}function Vle(o,e){var s;if((o==null?void 0:o.type)==="files")return e._file.path;let t=Qpe(e==null?void 0:e.data[(s=o.fields.filter(a=>a.info.name==="text")[0])==null?void 0:s.name]).slice(0,300);return t.trim()==""?"~Untitled~":t}function Wle(o){let e,t,s;return{c(){e=re("a"),t=Ht(o[1]),Z(e,"href",s=o[3].lucentUrl+"/records/"+o[0].id),Z(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),Z(e,"title",o[1]),rs(e,"border","2px solid "+(o[2].color?o[2].color:"#999"),1),rs(e,"white-space","nowrap")},m(a,l){Te(a,e,l),X(e,t)},p(a,l){l&2&&Fn(t,a[1]),l&1&&s!==(s=a[3].lucentUrl+"/records/"+a[0].id)&&Z(e,"href",s),l&2&&Z(e,"title",a[1]),l&4&&rs(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&ke(e)}}}function FSe(o){var s;let e,t=((s=o[0])==null?void 0:s.data)&&Wle(o);return{c(){t&&t.c(),e=Rs()},m(a,l){t&&t.m(a,l),Te(a,e,l)},p(a,[l]){var u;(u=a[0])!=null&&u.data?t?t.p(a,l):(t=Wle(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(a){t&&t.d(a),a&&ke(e)}}}function QSe(o,e,t){let s,a;const l=Ur("channel");let{record:u}=e,{graph:d}=e;return o.$$set=h=>{"record"in h&&t(0,u=h.record),"graph"in h&&t(4,d=h.graph)},o.$$.update=()=>{o.$$.dirty&1&&t(2,s=l.schemas.find(h=>h.name===u.schema)),o.$$.dirty&17&&t(1,a=qu(l.schemas,u,d))},[u,a,s,l,d]}class G6 extends uo{constructor(e){super(),co(this,e,QSe,FSe,lo,{record:0,graph:4})}}function Ule(o,e,t){const s=o.slice();return s[2]=e[t],s[4]=t,s}function Yle(o){let e,t,s=o[0].reverse(),a=[];for(let u=0;u<s.length;u+=1)a[u]=Xle(Ule(o,s,u));const l=u=>Be(a[u],1,1,()=>{a[u]=null});return{c(){e=re("div");for(let u=0;u<a.length;u+=1)a[u].c();Z(e,"class","record-history d-flex justify-content-center align-items-center w-100 mb-4 mt-4 svelte-eatzsz")},m(u,d){Te(u,e,d);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(e,null);t=!0},p(u,d){if(d&3){s=u[0].reverse();let h;for(h=0;h<s.length;h+=1){const b=Ule(u,s,h);a[h]?(a[h].p(b,d),xe(a[h],1)):(a[h]=Xle(b),a[h].c(),xe(a[h],1),a[h].m(e,null))}for(mo(),h=s.length;h<a.length;h+=1)l(h);go()}},i(u){if(!t){for(let d=0;d<s.length;d+=1)xe(a[d]);t=!0}},o(u){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)Be(a[d]);t=!1},d(u){u&&ke(e),ia(a,u)}}}function ZSe(o){let e,t;return e=new Fa({props:{icon:"angle-right"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Xle(o){let e,t,s,a,l,u=o[4]!==0&&ZSe();return s=new G6({props:{record:o[2],graph:o[1]}}),{c(){u&&u.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","mx-3 p-0 my-0")},m(d,h){u&&u.m(d,h),Te(d,e,h),Te(d,t,h),Kt(s,t,null),X(t,a),l=!0},p(d,h){const b={};h&1&&(b.record=d[2]),h&2&&(b.graph=d[1]),s.$set(b)},i(d){l||(xe(u),xe(s.$$.fragment,d),l=!0)},o(d){Be(u),Be(s.$$.fragment,d),l=!1},d(d){u&&u.d(d),d&&ke(e),d&&ke(t),Jt(s)}}}function HSe(o){let e,t,s=o[0].length>0&&Yle(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,[l]){a[0].length>0?s?(s.p(a,l),l&1&&xe(s,1)):(s=Yle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function zSe(o,e,t){let{managerRecords:s}=e,{graph:a}=e;return o.$$set=l=>{"managerRecords"in l&&t(0,s=l.managerRecords),"graph"in l&&t(1,a=l.graph)},[s,a]}class VSe extends uo{constructor(e){super(),co(this,e,zSe,HSe,lo,{managerRecords:0,graph:1})}}function WSe(o){let e;return{c(){e=Ht("New Record")},m(t,s){Te(t,e,s)},p:un,d(t){t&&ke(e)}}}function USe(o){let e=qu(o[5].schemas,o[3],o[2])+"",t;return{c(){t=Ht(e)},m(s,a){Te(s,t,a)},p(s,a){a&12&&e!==(e=qu(s[5].schemas,s[3],s[2])+"")&&Fn(t,e)},d(s){s&&ke(t)}}}function jle(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U;s=new Fa({props:{icon:"ellipsis"}});let K=!o[4]&&qle(o);return{c(){e=re("div"),t=re("button"),en(s.$$.fragment),a=Ze(),l=re("div"),u=re("h6"),u.textContent="Record Actions",d=Ze(),h=re("a"),b=Ht("Create new"),C=Ze(),K&&K.c(),E=Ze(),R=re("a"),$=Ht("Revisions"),Z(t,"class","btn btn-link btn-sm"),Z(t,"type","button"),Z(t,"data-bs-toggle","dropdown"),Z(t,"aria-expanded","false"),Z(u,"class","dropdown-header"),Z(h,"class","dropdown-item"),Z(h,"href",y=o[5].lucentUrl+"/records/new?schema="+o[1].name),Z(R,"class","dropdown-item"),Z(R,"href",o[5].lucentUrl),Z(l,"class","dropdown-menu"),Z(e,"class","dropdown d-inline-block")},m(L,te){Te(L,e,te),X(e,t),Kt(s,t,null),X(e,a),X(e,l),X(l,u),X(l,d),X(l,h),X(h,b),X(l,C),K&&K.m(l,null),X(l,E),X(l,R),X(R,$),Q=!0,F||(U=mn(R,"click",ku(o[7])),F=!0)},p(L,te){(!Q||te&2&&y!==(y=L[5].lucentUrl+"/records/new?schema="+L[1].name))&&Z(h,"href",y),L[4]?K&&(K.d(1),K=null):K?K.p(L,te):(K=qle(L),K.c(),K.m(l,E))},i(L){Q||(xe(s.$$.fragment,L),Q=!0)},o(L){Be(s.$$.fragment,L),Q=!1},d(L){L&&ke(e),Jt(s),K&&K.d(),F=!1,U()}}}function qle(o){let e,t,s,a;return{c(){e=re("a"),t=Ht("Clone"),Z(e,"class","dropdown-item"),Z(e,"href",o[5].lucentUrl)},m(l,u){Te(l,e,u),X(e,t),s||(a=mn(e,"click",o[6]),s=!0)},p:un,d(l){l&&ke(e),s=!1,a()}}}function YSe(o){let e,t,s=o[1].label.toUpperCase()+"",a,l,u,d,h,b;function y($,Q){return $[4]?WSe:USe}let C=y(o),E=C(o),R=!o[4]&&jle(o);return{c(){e=re("h3"),t=re("a"),a=Ht(s),u=Ze(),d=re("span"),E.c(),h=Ze(),R&&R.c(),Z(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),Z(t,"href",l=o[5].lucentUrl+"/content/"+o[1].name),Z(d,"class","text-dark d-block"),Z(e,"class","header-normal mt-5 mb-0")},m($,Q){Te($,e,Q),X(e,t),X(t,a),X(e,u),X(e,d),E.m(d,null),X(e,h),R&&R.m(e,null),b=!0},p($,[Q]){(!b||Q&2)&&s!==(s=$[1].label.toUpperCase()+"")&&Fn(a,s),(!b||Q&2&&l!==(l=$[5].lucentUrl+"/content/"+$[1].name))&&Z(t,"href",l),C===(C=y($))&&E?E.p($,Q):(E.d(1),E=C($),E&&(E.c(),E.m(d,null))),$[4]?R&&(mo(),Be(R,1,1,()=>{R=null}),go()):R?(R.p($,Q),Q&16&&xe(R,1)):(R=jle($),R.c(),xe(R,1),R.m(e,null))},i($){b||(xe(R),b=!0)},o($){Be(R),b=!1},d($){$&&ke(e),E.d(),R&&R.d()}}}function XSe(o,e,t){const s=Ur("channel");let{schema:a}=e,{graph:l}=e,{record:u}=e,{isCreateMode:d}=e,{activeContentTab:h}=e;function b(C){C.preventDefault(),axios.post(s.lucentUrl+"/records/clone/"+u.id).then(E=>{window.location=s.lucentUrl+"/records/"+E.data.id}).catch(E=>{})}const y=C=>t(0,h="_info");return o.$$set=C=>{"schema"in C&&t(1,a=C.schema),"graph"in C&&t(2,l=C.graph),"record"in C&&t(3,u=C.record),"isCreateMode"in C&&t(4,d=C.isCreateMode),"activeContentTab"in C&&t(0,h=C.activeContentTab)},[h,a,l,u,d,s,b,y]}class jSe extends uo{constructor(e){super(),co(this,e,XSe,YSe,lo,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function Zpe(o){return Hpe()[o]}function Hpe(){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 Gle(o,e,t){const s=o.slice();return s[10]=e[t],s}function Kle(o){let e,t=o[10].text+"",s,a,l,u;function d(...h){return o[9](o[10],...h)}return{c(){e=re("button"),s=Ht(t),a=Ze(),Z(e,"type","button"),Z(e,"class","dropdown-item my-2 rounded w-100 bg-"+o[10].bg+" text-"+o[10].color)},m(h,b){Te(h,e,b),X(e,s),X(e,a),l||(u=mn(e,"click",d),l=!0)},p(h,b){o=h},d(h){h&&ke(e),l=!1,u()}}}function Jle(o){let e,t=o[10].value!==o[0]&&Kle(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,a){s[10].value!==s[0]?t?t.p(s,a):(t=Kle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&ke(e)}}}function qSe(o){let e,t,s;return{c(){e=re("a"),t=Ht("Preview"),Z(e,"href",s=o[5].previewTargetUrl+"?schema="+o[2].name+"&id="+o[1].id),Z(e,"target","_blank"),Z(e,"class","btn btn-info ms-3")},m(a,l){Te(a,e,l),X(e,t)},p(a,l){l&6&&s!==(s=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&Z(e,"href",s)},d(a){a&&ke(e)}}}function GSe(o){let e,t,s,a=o[4].text+"",l,u,d,h,b,y,C,E,R,$,Q,F=o[6],U=[];for(let L=0;L<F.length;L+=1)U[L]=Jle(Gle(o,F,L));let K=o[5].previewTarget&&qSe(o);return{c(){e=re("div"),t=re("div"),s=re("button"),l=Ht(a),d=Ze(),h=re("button"),b=re("span"),b.textContent="Toggle Dropdown",C=Ze(),E=re("div"),R=re("div"),R.textContent="Change status to",$=Ze();for(let L=0;L<U.length;L+=1)U[L].c();Q=Ze(),K&&K.c(),Z(s,"type","button"),Z(s,"class",u="btn btn-"+o[4].bg),Z(b,"class","visually-hidden"),Z(h,"type","button"),Z(h,"class",y="btn btn-"+o[4].bg+" dropdown-toggle dropdown-toggle-split"),Z(h,"data-bs-toggle","dropdown"),Z(h,"aria-expanded","false"),Z(R,"class","dropdown-header"),Z(E,"class","dropdown-menu"),Z(t,"class","btn-group dropup"),Z(e,"class","d-flex justify-content-between")},m(L,te){Te(L,e,te),X(e,t),X(t,s),X(s,l),X(t,d),X(t,h),X(h,b),o[8](h),X(t,C),X(t,E),X(E,R),X(E,$);for(let ne=0;ne<U.length;ne+=1)U[ne]&&U[ne].m(E,null);X(e,Q),K&&K.m(e,null)},p(L,[te]){if(te&16&&a!==(a=L[4].text+"")&&Fn(l,a),te&16&&u!==(u="btn btn-"+L[4].bg)&&Z(s,"class",u),te&16&&y!==(y="btn btn-"+L[4].bg+" dropdown-toggle dropdown-toggle-split")&&Z(h,"class",y),te&193){F=L[6];let ne;for(ne=0;ne<F.length;ne+=1){const oe=Gle(L,F,ne);U[ne]?U[ne].p(oe,te):(U[ne]=Jle(oe),U[ne].c(),U[ne].m(E,null))}for(;ne<U.length;ne+=1)U[ne].d(1);U.length=F.length}L[5].previewTarget&&K.p(L,te)},i:un,o:un,d(L){L&&ke(e),o[8](null),ia(U,L),K&&K.d()}}}function KSe(o,e,t){let s;const a=Ur("channel");let{status:l="draft"}=e,{record:u}=e,{schema:d}=e,h;const b=Object.values(Hpe());function y(R,$){t(0,l=$),h.click()}function C(R){Ro[R?"unshift":"push"](()=>{h=R,t(3,h)})}const E=(R,$)=>y($,R.value);return o.$$set=R=>{"status"in R&&t(0,l=R.status),"record"in R&&t(1,u=R.record),"schema"in R&&t(2,d=R.schema)},o.$$.update=()=>{o.$$.dirty&1&&t(4,s=Zpe(l))},[l,u,d,h,s,a,b,y,C,E]}class zpe extends uo{constructor(e){super(),co(this,e,KSe,GSe,lo,{status:0,record:1,schema:2})}}function ece(o){return o._file.mime==="image/svg+xml"?Ioe(o):Ur("channel").filesUrl+`/thumbs/${o._file.path}`}function Ioe(o){return Ur("channel").filesUrl+`/${o._file.path}`}function tce(o){let e,t,s,a,l;const u=[eCe,JSe],d=[];function h(b,y){return y&1&&(e=null),e==null&&(e=!!b[0]._file.mime.startsWith("image")),e?0:1}return t=h(o,-1),s=d[t]=u[t](o),{c(){s.c(),a=Rs()},m(b,y){d[t].m(b,y),Te(b,a,y),l=!0},p(b,y){let C=t;t=h(b,y),t===C?d[t].p(b,y):(mo(),Be(d[C],1,1,()=>{d[C]=null}),go(),s=d[t],s?s.p(b,y):(s=d[t]=u[t](b),s.c()),xe(s,1),s.m(a.parentNode,a))},i(b){l||(xe(s),l=!0)},o(b){Be(s),l=!1},d(b){d[t].d(b),b&&ke(a)}}}function JSe(o){let e,t,s,a,l,u=o[0]._file.path.split(".").pop()+"",d,h,b,y;return t=new Fa({props:{icon:"file",width:o[3],height:o[3]}}),{c(){e=re("a"),en(t.$$.fragment),s=Ze(),a=re("span"),l=Ht("."),d=Ht(u),Z(a,"class","ms-2"),rs(a,"font-size",o[4]+"px"),Z(e,"href",h=o[5].lucentUrl+"/records/"+o[0].id),Z(e,"title",b=o[0]._file.path),Z(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(C,E){Te(C,e,E),Kt(t,e,null),X(e,s),X(e,a),X(a,l),X(a,d),y=!0},p(C,E){const R={};E&8&&(R.width=C[3]),E&8&&(R.height=C[3]),t.$set(R),(!y||E&1)&&u!==(u=C[0]._file.path.split(".").pop()+"")&&Fn(d,u),(!y||E&16)&&rs(a,"font-size",C[4]+"px"),(!y||E&1&&h!==(h=C[5].lucentUrl+"/records/"+C[0].id))&&Z(e,"href",h),(!y||E&1&&b!==(b=C[0]._file.path))&&Z(e,"title",b),(!y||E&4)&&rs(e,"width",C[2]+"px"),(!y||E&4)&&rs(e,"height",C[2]+"px")},i(C){y||(xe(t.$$.fragment,C),y=!0)},o(C){Be(t.$$.fragment,C),y=!1},d(C){C&&ke(e),Jt(t)}}}function eCe(o){let e,t,s,a,l,u;return{c(){e=re("a"),t=re("img"),Z(t,"class","rounded w-100"),ple(t.src,s=ece(o[0]))||Z(t,"src",s),Z(t,"alt",a=o[0]._file.path),Z(e,"href",l=o[5].lucentUrl+"/records/"+o[0].id),Z(e,"title",u=o[0]._file.path),Z(e,"class","d-flex align-items-center justify-content-center "),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(d,h){Te(d,e,h),X(e,t)},p(d,h){h&1&&!ple(t.src,s=ece(d[0]))&&Z(t,"src",s),h&1&&a!==(a=d[0]._file.path)&&Z(t,"alt",a),h&1&&l!==(l=d[5].lucentUrl+"/records/"+d[0].id)&&Z(e,"href",l),h&1&&u!==(u=d[0]._file.path)&&Z(e,"title",u),h&4&&rs(e,"width",d[2]+"px"),h&4&&rs(e,"height",d[2]+"px")},i:un,o:un,d(d){d&&ke(e)}}}function nce(o){let e,t=o[0]._file.path+"",s,a,l;return{c(){e=re("a"),s=Ht(t),Z(e,"href",a=o[5].lucentUrl+"/records/"+o[0].id),Z(e,"title",l=o[0]._file.path),Z(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(u,d){Te(u,e,d),X(e,s)},p(u,d){d&1&&t!==(t=u[0]._file.path+"")&&Fn(s,t),d&1&&a!==(a=u[5].lucentUrl+"/records/"+u[0].id)&&Z(e,"href",a),d&1&&l!==(l=u[0]._file.path)&&Z(e,"title",l)},d(u){u&&ke(e)}}}function tCe(o){let e,t,s,a=o[0]&&tce(o),l=o[1]&&nce(o);return{c(){a&&a.c(),e=Ze(),l&&l.c(),t=Rs()},m(u,d){a&&a.m(u,d),Te(u,e,d),l&&l.m(u,d),Te(u,t,d),s=!0},p(u,[d]){u[0]?a?(a.p(u,d),d&1&&xe(a,1)):(a=tce(u),a.c(),xe(a,1),a.m(e.parentNode,e)):a&&(mo(),Be(a,1,1,()=>{a=null}),go()),u[1]?l?l.p(u,d):(l=nce(u),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(u){s||(xe(a),s=!0)},o(u){Be(a),s=!1},d(u){a&&a.d(u),u&&ke(e),l&&l.d(u),u&&ke(t)}}}function nCe(o,e,t){let{record:s}=e;const a=Ur("channel");let{size:l="small"}=e,{showFilename:u=!1}=e,d,h,b;return l=="large"?(d=256,h=32,b="20"):l=="medium"?(d=128,h=12,b="17"):l=="small"?(d=64,h=12,b="15"):l=="tiny"&&(d=42,h=12,b="13"),o.$$set=y=>{"record"in y&&t(0,s=y.record),"size"in y&&t(6,l=y.size),"showFilename"in y&&t(1,u=y.showFilename)},[s,u,d,h,b,a,l]}class Xw extends uo{constructor(e){super(),co(this,e,nCe,tCe,lo,{record:0,size:6,showFilename:1})}}function oce(o){let e,t,s,a,l,u,d,h,b,y,C=o[0]._file.path+"",E,R,$,Q,F,U,K=o[0]._file.originalName+"",L,te,ne,oe,G,we,ve=o[0]._file.mime+"",Re,Oe,ce,Xe,tt,ot,V,ut=(o[0]._file.size/1024).toFixed(1)+"",Qe,Bt,Ct,He,st,rn,Et,Cn=o[0]._file.checksum+"",je,mt,he,Zo,Kn,so,Yo=o[0]._file.path+"",as,kt,jt;s=new Xw({props:{record:o[0],size:"large"}});let pt=o[0]._file.width&&sce(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),l=re("div"),u=re("ul"),d=re("li"),h=re("span"),h.textContent="Filename",b=Ze(),y=re("span"),E=Ht(C),R=Ze(),$=re("li"),Q=re("span"),Q.textContent="Original name",F=Ze(),U=re("span"),L=Ht(K),te=Ze(),ne=re("li"),oe=re("span"),oe.textContent="Mime type",G=Ze(),we=re("span"),Re=Ht(ve),Oe=Ze(),pt&&pt.c(),ce=Ze(),Xe=re("li"),tt=re("span"),tt.textContent="File size",ot=Ze(),V=re("span"),Qe=Ht(ut),Bt=Ht("kB"),Ct=Ze(),He=re("li"),st=re("span"),st.textContent="Checksum",rn=Ze(),Et=re("span"),je=Ht(Cn),mt=Ze(),he=re("li"),Zo=re("span"),Zo.textContent="Download",Kn=Ze(),so=re("a"),as=Ht(Yo),Z(t,"class","col"),rs(t,"max-width","276px"),Z(h,"class","text-muted"),Z(d,"class","list-group-item border-primary"),Z(Q,"class","text-muted"),Z($,"class","list-group-item border-primary"),Z(oe,"class","text-muted"),Z(ne,"class","list-group-item border-primary"),Z(tt,"class","text-muted"),Z(Xe,"class","list-group-item border-primary"),Z(st,"class","text-muted"),Z(He,"class","list-group-item border-primary"),Z(Zo,"class","text-muted"),Z(so,"href",kt=Ioe(o[0])),Z(he,"class","list-group-item border-primary"),Z(u,"class","list-group svelte-1qb90xc"),Z(l,"class","col"),Z(e,"class","row mb-4")},m(Ne,Gt){Te(Ne,e,Gt),X(e,t),Kt(s,t,null),X(e,a),X(e,l),X(l,u),X(u,d),X(d,h),X(d,b),X(d,y),X(y,E),X(u,R),X(u,$),X($,Q),X($,F),X($,U),X(U,L),X(u,te),X(u,ne),X(ne,oe),X(ne,G),X(ne,we),X(we,Re),X(u,Oe),pt&&pt.m(u,null),X(u,ce),X(u,Xe),X(Xe,tt),X(Xe,ot),X(Xe,V),X(V,Qe),X(V,Bt),X(u,Ct),X(u,He),X(He,st),X(He,rn),X(He,Et),X(Et,je),X(u,mt),X(u,he),X(he,Zo),X(he,Kn),X(he,so),X(so,as),jt=!0},p(Ne,Gt){const bn={};Gt&1&&(bn.record=Ne[0]),s.$set(bn),(!jt||Gt&1)&&C!==(C=Ne[0]._file.path+"")&&Fn(E,C),(!jt||Gt&1)&&K!==(K=Ne[0]._file.originalName+"")&&Fn(L,K),(!jt||Gt&1)&&ve!==(ve=Ne[0]._file.mime+"")&&Fn(Re,ve),Ne[0]._file.width?pt?pt.p(Ne,Gt):(pt=sce(Ne),pt.c(),pt.m(u,ce)):pt&&(pt.d(1),pt=null),(!jt||Gt&1)&&ut!==(ut=(Ne[0]._file.size/1024).toFixed(1)+"")&&Fn(Qe,ut),(!jt||Gt&1)&&Cn!==(Cn=Ne[0]._file.checksum+"")&&Fn(je,Cn),(!jt||Gt&1)&&Yo!==(Yo=Ne[0]._file.path+"")&&Fn(as,Yo),(!jt||Gt&1&&kt!==(kt=Ioe(Ne[0])))&&Z(so,"href",kt)},i(Ne){jt||(xe(s.$$.fragment,Ne),jt=!0)},o(Ne){Be(s.$$.fragment,Ne),jt=!1},d(Ne){Ne&&ke(e),Jt(s),pt&&pt.d()}}}function sce(o){let e,t,s,a,l=o[0]._file.width+"",u,d,h=o[0]._file.height+"",b;return{c(){e=re("li"),t=re("span"),t.textContent="Dimensions",s=Ze(),a=re("span"),u=Ht(l),d=Ht("x"),b=Ht(h),Z(t,"class","text-muted"),Z(e,"class","list-group-item border-primary")},m(y,C){Te(y,e,C),X(e,t),X(e,s),X(e,a),X(a,u),X(a,d),X(a,b)},p(y,C){C&1&&l!==(l=y[0]._file.width+"")&&Fn(u,l),C&1&&h!==(h=y[0]._file.height+"")&&Fn(b,h)},d(y){y&&ke(e)}}}function oCe(o){let e,t,s=o[1].type==="files"&&oce(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,[l]){a[1].type==="files"?s?(s.p(a,l),l&2&&xe(s,1)):(s=oce(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function sCe(o,e,t){let{record:s}=e,{schema:a}=e;return o.$$set=l=>{"record"in l&&t(0,s=l.record),"schema"in l&&t(1,a=l.schema)},[s,a]}class Vpe extends uo{constructor(e){super(),co(this,e,sCe,oCe,lo,{record:0,schema:1})}}function rce(o,e,t){const s=o.slice();return s[9]=e[t],s}function ice(o){let e,t=o[1],s=[];for(let a=0;a<t.length;a+=1)s[a]=ace(rce(o,t,a));return{c(){e=re("ul");for(let a=0;a<s.length;a+=1)s[a].c();Z(e,"class","nav nav-pills mb-4 justify-content-center")},m(a,l){Te(a,e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null)},p(a,l){if(l&7){t=a[1];let u;for(u=0;u<t.length;u+=1){const d=rce(a,t,u);s[u]?s[u].p(d,l):(s[u]=ace(d),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=t.length}},d(a){a&&ke(e),ia(s,a)}}}function ace(o){let e,t,s=o[9].label+"",a,l,u,d;function h(...b){return o[5](o[9],...b)}return{c(){e=re("li"),t=re("button"),a=Ht(s),l=Ze(),Z(t,"class","nav-link"),Z(t,"aria-current","page"),Vo(t,"active",o[0]===o[9].name),Z(e,"class","nav-item")},m(b,y){Te(b,e,y),X(e,t),X(t,a),X(e,l),u||(d=mn(t,"click",h),u=!0)},p(b,y){o=b,y&2&&s!==(s=o[9].label+"")&&Fn(a,s),y&3&&Vo(t,"active",o[0]===o[9].name)},d(b){b&&ke(e),u=!1,d()}}}function rCe(o){let e,t=o[1].length>1&&ice(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[1].length>1?t?t.p(s,a):(t=ice(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function iCe(o,e,t){var E,R;let{schema:s}=e,{isCreateMode:a}=e,{active:l=""}=e,u=(R=(E=s.groups)==null?void 0:E.map($=>({label:$,name:$})))!=null?R:[],d={label:"Main",name:""},h={label:"Graph",name:"_graph"};a?u=[d,...u]:u=[d,...u,h];function b($){$.preventDefault(),t(0,l="_graph")}function y($,Q){$.preventDefault(),Q=="_graph"?b($):t(0,l=Q)}const C=($,Q)=>y(Q,$.name);return o.$$set=$=>{"schema"in $&&t(3,s=$.schema),"isCreateMode"in $&&t(4,a=$.isCreateMode),"active"in $&&t(0,l=$.active)},[l,u,y,s,a,C]}class Wpe extends uo{constructor(e){super(),co(this,e,iCe,rCe,lo,{schema:3,isCreateMode:4,active:0})}}function lce(o,e,t){const s=o.slice();return s[11]=e[t],s}function cce(o){let e=[],t=new Map,s,a=o[3];const l=d=>d[11].id;for(let d=0;d<a.length;d+=1){let h=lce(o,a,d),b=l(h);t.set(b,e[d]=fce(b,h))}let u=null;return a.length||(u=uce(o)),{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs(),u&&u.c()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),u&&u.m(d,h)},p(d,h){h&63&&(a=d[3],e=Jd(e,h,l,1,d,a,t,s.parentNode,XD,fce,s,lce),!a.length&&u?u.p(d,h):a.length?u&&(u.d(1),u=null):(u=uce(d),u.c(),u.m(s.parentNode,s)))},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s),u&&u.d(d)}}}function uce(o){let e;function t(l,u){return l[1]&&l[2].optionsSuggest?lCe:aCe}let s=t(o),a=s(o);return{c(){a.c(),e=Rs()},m(l,u){a.m(l,u),Te(l,e,u)},p(l,u){s===(s=t(l))&&a?a.p(l,u):(a.d(1),a=s(l),a&&(a.c(),a.m(e.parentNode,e)))},d(l){a.d(l),l&&ke(e)}}}function aCe(o){let e;return{c(){e=Ht("No results")},m(t,s){Te(t,e,s)},p:un,d(t){t&&ke(e)}}}function lCe(o){let e,t,s,a,l,u,d,h;return{c(){e=re("div"),t=re("span"),s=Ht('Add "'),a=Ht(o[1]),l=Ht('"'),u=Ze(),Z(t,"class","dropdown-item")},m(b,y){Te(b,e,y),X(e,t),X(t,s),X(t,a),X(t,l),X(e,u),d||(h=[mn(e,"click",o[9]),mn(e,"keypress",o[10])],d=!0)},p(b,y){y&2&&Fn(a,b[1])},d(b){b&&ke(e),d=!1,vi(h)}}}function fce(o,e){let t,s,a=qu(e[4].schemas,e[11])+"",l,u,d,h=e[11].data[e[2].optionsField]+"",b,y,C,E;function R(...Q){return e[7](e[11],...Q)}function $(...Q){return e[8](e[11],...Q)}return{key:o,first:null,c(){t=re("div"),s=re("span"),l=Ht(a),u=Ze(),d=re("small"),b=Ht(h),y=Ze(),Z(d,"class","text-muted "),Z(s,"class","dropdown-item"),this.first=t},m(Q,F){Te(Q,t,F),X(t,s),X(s,l),X(s,u),X(s,d),X(d,b),X(t,y),C||(E=[mn(t,"click",R),mn(t,"keypress",$)],C=!0)},p(Q,F){e=Q,F&8&&a!==(a=qu(e[4].schemas,e[11])+"")&&Fn(l,a),F&12&&h!==(h=e[11].data[e[2].optionsField]+"")&&Fn(b,h)},d(Q){Q&&ke(t),C=!1,vi(E)}}}function cCe(o){let e,t=o[2].optionsFrom&&cce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[2].optionsFrom?t?t.p(s,a):(t=cce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function uCe(o,e,t){let s;const a=Ur("channel");let{field:l}=e,{value:u}=e,{search:d}=e;const h=Lc.exports.debounce($=>{axios.get("/records/suggestions",{params:{schema:l.optionsFrom,field:l.optionsField,value:d,ui:l.ui}}).then(Q=>{t(3,s=Q.data)}).catch(Q=>{console.log(Q)})},500);function b($,Q){$.preventDefault(),t(0,u=Q.data[l.optionsField]),t(1,d="")}const y=($,Q)=>b(Q,$),C=($,Q)=>b(Q,$),E=$=>{t(0,u=d),t(1,d="")},R=$=>{t(0,u=d),t(1,d="")};return o.$$set=$=>{"field"in $&&t(2,l=$.field),"value"in $&&t(0,u=$.value),"search"in $&&t(1,d=$.search)},t(3,s=[]),[u,d,l,s,a,b,h,y,C,E,R]}class eV extends uo{constructor(e){super(),co(this,e,uCe,cCe,lo,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function dce(o,e,t){const s=o.slice();return s[11]=e[t][0],s[12]=e[t][1],s}function hce(o,e,t){const s=o.slice();return s[8]=e[t],s}function mce(o){let e,t;function s(u,d){return d&1&&(e=null),e==null&&(e=!!Array.isArray(u[0].selectOptions)),e?dCe:fCe}let a=s(o,-1),l=a(o);return{c(){l.c(),t=Rs()},m(u,d){l.m(u,d),Te(u,t,d)},p(u,d){a===(a=s(u,d))&&l?l.p(u,d):(l.d(1),l=a(u),l&&(l.c(),l.m(t.parentNode,t)))},d(u){l.d(u),u&&ke(t)}}}function fCe(o){let e=[],t=new Map,s,a=Object.entries(o[0].selectOptions);const l=u=>u[11];for(let u=0;u<a.length;u+=1){let d=dce(o,a,u),h=l(d);t.set(h,e[u]=gce(h,d))}return{c(){for(let u=0;u<e.length;u+=1)e[u].c();s=Rs()},m(u,d){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(u,d);Te(u,s,d)},p(u,d){d&3&&(a=Object.entries(u[0].selectOptions),e=Jd(e,d,l,1,u,a,t,s.parentNode,XD,gce,s,dce))},d(u){for(let d=0;d<e.length;d+=1)e[d].d(u);u&&ke(s)}}}function dCe(o){let e=[],t=new Map,s,a=o[0].selectOptions;const l=u=>u[8];for(let u=0;u<a.length;u+=1){let d=hce(o,a,u),h=l(d);t.set(h,e[u]=pce(h,d))}return{c(){for(let u=0;u<e.length;u+=1)e[u].c();s=Rs()},m(u,d){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(u,d);Te(u,s,d)},p(u,d){d&3&&(a=u[0].selectOptions,e=Jd(e,d,l,1,u,a,t,s.parentNode,XD,pce,s,hce))},d(u){for(let d=0;d<e.length;d+=1)e[d].d(u);u&&ke(s)}}}function gce(o,e){let t,s,a=e[12]+"",l,u,d,h;function b(...C){return e[6](e[11],...C)}function y(...C){return e[7](e[11],...C)}return{key:o,first:null,c(){t=re("div"),s=re("span"),l=Ht(a),u=Ze(),Z(s,"class","dropdown-item"),this.first=t},m(C,E){Te(C,t,E),X(t,s),X(s,l),X(t,u),d||(h=[mn(t,"click",b),mn(t,"keypress",y)],d=!0)},p(C,E){e=C,E&1&&a!==(a=e[12]+"")&&Fn(l,a)},d(C){C&&ke(t),d=!1,vi(h)}}}function pce(o,e){let t,s,a=e[8]+"",l,u,d,h;function b(...C){return e[4](e[8],...C)}function y(...C){return e[5](e[8],...C)}return{key:o,first:null,c(){t=re("div"),s=re("span"),l=Ht(a),u=Ze(),Z(s,"class","dropdown-item"),this.first=t},m(C,E){Te(C,t,E),X(t,s),X(s,l),X(t,u),d||(h=[mn(t,"click",b),mn(t,"keypress",y)],d=!0)},p(C,E){e=C,E&1&&a!==(a=e[8]+"")&&Fn(l,a)},d(C){C&&ke(t),d=!1,vi(h)}}}function hCe(o){let e,t=o[0].selectOptions&&mce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[0].selectOptions?t?t.p(s,a):(t=mce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function mCe(o,e,t){let{field:s}=e,{value:a}=e,{search:l}=e;function u(C,E){C.preventDefault(),t(2,a=E),t(3,l="")}const d=(C,E)=>u(E,C),h=(C,E)=>u(E,C),b=(C,E)=>u(E,C),y=(C,E)=>u(E,C);return o.$$set=C=>{"field"in C&&t(0,s=C.field),"value"in C&&t(2,a=C.value),"search"in C&&t(3,l=C.search)},[s,u,a,l,d,h,b,y]}class gCe extends uo{constructor(e){super(),co(this,e,mCe,hCe,lo,{field:0,value:2,search:3})}}function Lm(o,e){return o&&o[e]?o[e].message:null}function pCe(o){let e,t,s,a;return{c(){e=re("input"),Z(e,"type","text"),Z(e,"id",o[3]),Z(e,"class","form-control"),Z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[2],Vo(e,"is-invalid",o[7])},m(l,u){Te(l,e,u),ar(e,o[0]),s||(a=mn(e,"input",o[18]),s=!0)},p(l,u){u&8&&Z(e,"id",l[3]),u&6&&t!==(t=l[1].readonly&&!l[2])&&(e.readOnly=t),u&1&&e.value!==l[0]&&ar(e,l[0]),u&128&&Vo(e,"is-invalid",l[7])},i:un,o:un,d(l){l&&ke(e),s=!1,a()}}}function bCe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R;function $(K){o[15](K)}function Q(K){o[16](K)}let F={field:o[1]};o[0]!==void 0&&(F.value=o[0]),o[6]!==void 0&&(F.search=o[6]),u=new gCe({props:F}),Ro.push(()=>er(u,"value",$)),Ro.push(()=>er(u,"search",Q));let U=o[0]&&bce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),en(u.$$.fragment),b=Ze(),U&&U.c(),y=Rs(),Z(t,"type","search"),Z(t,"id",o[3]),Z(t,"class","form-control dropdown-toggle"),Z(t,"placeholder","Search for options"),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],Vo(t,"is-invalid",o[7]),Z(l,"class","dropdown-menu w-100"),Z(e,"class","dropdown")},m(K,L){Te(K,e,L),X(e,t),ar(t,o[6]),X(e,a),X(e,l),Kt(u,l,null),Te(K,b,L),U&&U.m(K,L),Te(K,y,L),C=!0,E||(R=mn(t,"input",o[14]),E=!0)},p(K,L){(!C||L&8)&&Z(t,"id",K[3]),(!C||L&6&&s!==(s=K[1].readonly&&!K[2]))&&(t.readOnly=s),L&64&&t.value!==K[6]&&ar(t,K[6]),(!C||L&128)&&Vo(t,"is-invalid",K[7]);const te={};L&2&&(te.field=K[1]),!d&&L&1&&(d=!0,te.value=K[0],lr(()=>d=!1)),!h&&L&64&&(h=!0,te.search=K[6],lr(()=>h=!1)),u.$set(te),K[0]?U?U.p(K,L):(U=bce(K),U.c(),U.m(y.parentNode,y)):U&&(U.d(1),U=null)},i(K){C||(xe(u.$$.fragment,K),C=!0)},o(K){Be(u.$$.fragment,K),C=!1},d(K){K&&ke(e),Jt(u),K&&ke(b),U&&U.d(K),K&&ke(y),E=!1,R()}}}function vCe(o){let e,t,s,a,l,u,d,h,b,y,C=o[1].optionsFrom&&vce(o),E=o[0]&&Oce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),C&&C.c(),u=Ze(),E&&E.c(),d=Rs(),Z(t,"type","search"),Z(t,"id",o[3]),Z(t,"class","form-control dropdown-toggle"),Z(t,"placeholder","Search for options"),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],Vo(t,"is-invalid",o[7]),Z(l,"class","dropdown-menu w-100"),Z(e,"class","dropdown")},m(R,$){Te(R,e,$),X(e,t),ar(t,o[6]),X(e,a),X(e,l),C&&C.m(l,null),Te(R,u,$),E&&E.m(R,$),Te(R,d,$),h=!0,b||(y=[mn(t,"keyup",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"focus",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"input",o[9])],b=!0)},p(R,$){o=R,(!h||$&8)&&Z(t,"id",o[3]),(!h||$&6&&s!==(s=o[1].readonly&&!o[2]))&&(t.readOnly=s),$&64&&t.value!==o[6]&&ar(t,o[6]),(!h||$&128)&&Vo(t,"is-invalid",o[7]),o[1].optionsFrom?C?(C.p(o,$),$&2&&xe(C,1)):(C=vce(o),C.c(),xe(C,1),C.m(l,null)):C&&(mo(),Be(C,1,1,()=>{C=null}),go()),o[0]?E?E.p(o,$):(E=Oce(o),E.c(),E.m(d.parentNode,d)):E&&(E.d(1),E=null)},i(R){h||(xe(C),h=!0)},o(R){Be(C),h=!1},d(R){R&&ke(e),C&&C.d(),R&&ke(u),E&&E.d(R),R&&ke(d),b=!1,vi(y)}}}function bce(o){let e,t,s,a,l,u,d;function h(C,E){return E&2&&(s=null),s==null&&(s=!!Array.isArray(C[1].selectOptions)),s?yCe:OCe}let b=h(o,-1),y=b(o);return{c(){e=re("span"),t=re("div"),y.c(),a=Ze(),l=re("button"),Z(l,"type","button"),Z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),Z(l,"aria-label","Close"),Z(t,"class","d-flex align-items-center "),Z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(C,E){Te(C,e,E),X(e,t),y.m(t,null),X(t,a),X(t,l),u||(d=mn(l,"click",ku(o[17])),u=!0)},p(C,E){b===(b=h(C,E))&&y?y.p(C,E):(y.d(1),y=b(C),y&&(y.c(),y.m(t,a)))},d(C){C&&ke(e),y.d(),u=!1,d()}}}function OCe(o){let e=o[1].selectOptions[o[0]]+"",t;return{c(){t=Ht(e)},m(s,a){Te(s,t,a)},p(s,a){a&3&&e!==(e=s[1].selectOptions[s[0]]+"")&&Fn(t,e)},d(s){s&&ke(t)}}}function yCe(o){let e;return{c(){e=Ht(o[0])},m(t,s){Te(t,e,s)},p(t,s){s&1&&Fn(e,t[0])},d(t){t&&ke(e)}}}function vce(o){let e,t,s,a;function l(h){o[11](h)}function u(h){o[12](h)}let d={field:o[1]};return o[0]!==void 0&&(d.value=o[0]),o[6]!==void 0&&(d.search=o[6]),e=new eV({props:d}),o[10](e),Ro.push(()=>er(e,"value",l)),Ro.push(()=>er(e,"search",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),!t&&b&1&&(t=!0,y.value=h[0],lr(()=>t=!1)),!s&&b&64&&(s=!0,y.search=h[6],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){o[10](null),Jt(e,h)}}}function Oce(o){let e,t,s,a,l,u,d;return{c(){e=re("span"),t=re("div"),s=Ht(o[0]),a=Ze(),l=re("button"),Z(l,"type","button"),Z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),Z(l,"aria-label","Close"),Z(t,"class","d-flex align-items-center "),Z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Te(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),u||(d=mn(l,"click",ku(o[13])),u=!0)},p(h,b){b&1&&Fn(s,h[0])},d(h){h&&ke(e),u=!1,d()}}}function yce(o){let e,t;return{c(){e=re("div"),t=Ht(o[7]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&128&&Fn(t,s[7])},d(s){s&&ke(e)}}}function wCe(o){let e,t,s,a,l;const u=[vCe,bCe,pCe],d=[];function h(y,C){return y[5]?0:y[1].selectOptions?1:2}t=h(o),s=d[t]=u[t](o);let b=o[7]&&yce(o);return{c(){e=re("div"),s.c(),a=Ze(),b&&b.c(),Z(e,"class","mb-0")},m(y,C){Te(y,e,C),d[t].m(e,null),X(e,a),b&&b.m(e,null),l=!0},p(y,[C]){let E=t;t=h(y),t===E?d[t].p(y,C):(mo(),Be(d[E],1,1,()=>{d[E]=null}),go(),s=d[t],s?s.p(y,C):(s=d[t]=u[t](y),s.c()),xe(s,1),s.m(e,a)),y[7]?b?b.p(y,C):(b=yce(y),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(y){l||(xe(s),l=!0)},o(y){Be(s),l=!1},d(y){y&&ke(e),d[t].d(),b&&b.d()}}}function _Ce(o,e,t){let s,a,l,{field:u}=e,{value:d}=e,{isCreateMode:h}=e,{validationErrors:b}=e,{id:y}=e,C;function E(){a=this.value,t(6,a)}function R(oe){Ro[oe?"unshift":"push"](()=>{C=oe,t(4,C)})}function $(oe){d=oe,t(0,d)}function Q(oe){a=oe,t(6,a)}const F=oe=>t(0,d="");function U(){a=this.value,t(6,a)}function K(oe){d=oe,t(0,d)}function L(oe){a=oe,t(6,a)}const te=oe=>t(0,d="");function ne(){d=this.value,t(0,d)}return o.$$set=oe=>{"field"in oe&&t(1,u=oe.field),"value"in oe&&t(0,d=oe.value),"isCreateMode"in oe&&t(2,h=oe.isCreateMode),"validationErrors"in oe&&t(8,b=oe.validationErrors),"id"in oe&&t(3,y=oe.id)},o.$$.update=()=>{o.$$.dirty&258&&t(7,s=Lm(b,u.name)),o.$$.dirty&6&&t(5,l=u.optionsFrom&&!(u.readonly&&!h))},t(6,a=""),[d,u,h,y,C,l,a,s,b,E,R,$,Q,F,U,K,L,te,ne]}class Upe extends uo{constructor(e){super(),co(this,e,_Ce,wCe,lo,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function wce(o){let e,t;return{c(){e=re("div"),t=Ht(o[4]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&16&&Fn(t,s[4])},d(s){s&&ke(e)}}}function SCe(o){let e,t,s,a,l,u,d=o[4]&&wce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),d&&d.c(),Z(t,"type","text"),Z(t,"id",o[3]),Z(t,"class","form-control"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],Vo(t,"is-invalid",o[4]),Z(e,"class","mb-0")},m(h,b){Te(h,e,b),X(e,t),ar(t,o[0]),X(e,a),d&&d.m(e,null),l||(u=mn(t,"input",o[6]),l=!0)},p(h,[b]){b&8&&Z(t,"id",h[3]),b&6&&s!==(s=h[1].readonly&&!h[2])&&(t.readOnly=s),b&1&&t.value!==h[0]&&ar(t,h[0]),b&16&&Vo(t,"is-invalid",h[4]),h[4]?d?d.p(h,b):(d=wce(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:un,o:un,d(h){h&&ke(e),d&&d.d(),l=!1,u()}}}function CCe(o,e,t){let s,{field:a}=e,{value:l}=e,{isCreateMode:u}=e,{validationErrors:d}=e,{id:h}=e;function b(){l=this.value,t(0,l)}return o.$$set=y=>{"field"in y&&t(1,a=y.field),"value"in y&&t(0,l=y.value),"isCreateMode"in y&&t(2,u=y.isCreateMode),"validationErrors"in y&&t(5,d=y.validationErrors),"id"in y&&t(3,h=y.id)},o.$$.update=()=>{o.$$.dirty&34&&t(4,s=Lm(d,a.name))},[l,a,u,h,s,d,b]}class Ype extends uo{constructor(e){super(),co(this,e,CCe,SCe,lo,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function K6(o,e,t,s,a=""){let l=t.map(d=>({target:d.id,source:e.id,sourceSchema:e.schema,targetSchema:d.schema,field:s,depth:1,rank:""})),u=o.edges;return a==="replace"&&(u=u.filter(d=>d.field!==field.name)),o.records=Lc.exports.uniqBy([...o.records,...t],d=>d.id),o.edges=Lc.exports.uniqBy([...u,...l],d=>d.source+d.target+d.field+d.depth),o}function kCe(o){let e,t=o[0].text+"",s;return{c(){e=re("span"),s=Ht(t),Z(e,"class","badge text-bg-"+o[0].bg),rs(e,"max-width","84px")},m(a,l){Te(a,e,l),X(e,s)},p:un,i:un,o:un,d(a){a&&ke(e)}}}function xCe(o,e,t){let{status:s}=e,a=Zpe(s);return o.$$set=l=>{"status"in l&&t(1,s=l.status)},[a,s]}class ire extends uo{constructor(e){super(),co(this,e,xCe,kCe,lo,{status:1})}}function TCe(o){let e,t,s;return t=new Xw({props:{record:o[0],size:"small"}}),{c(){e=re("div"),en(t.$$.fragment),rs(e,"max-width","94px"),rs(e,"margin-right","15px")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&1&&(u.record=a[0]),t.$set(u)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function _ce(o){let e,t;return e=new ire({props:{status:o[0].status}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.status=s[0].status),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Sce(o){let e,t,s,a,l,u;return s=new Fa({props:{icon:"trash-can"}}),{c(){e=re("div"),t=re("button"),en(s.$$.fragment),Z(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),Z(e,"class","position-absolute end-0"),rs(e,"top","5px")},m(d,h){Te(d,e,h),X(e,t),Kt(s,t,null),a=!0,l||(u=mn(t,"click",o[6]),l=!0)},p:un,i(d){a||(xe(s.$$.fragment,d),a=!0)},o(d){Be(s.$$.fragment,d),a=!1},d(d){d&&ke(e),Jt(s),l=!1,u()}}}function ECe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q=o[4].type==="files"&&TCe(o),F=o[0].status==="draft"&&_ce(o),U=o[2]&&Sce(o);return{c(){var K;e=re("div"),t=re("div"),Q&&Q.c(),s=Ze(),a=re("div"),l=re("a"),u=Ht(o[5]),h=Ze(),b=re("small"),b.textContent=`${o[4].label}`,y=Ze(),C=re("small"),F&&F.c(),E=Ze(),U&&U.c(),Z(l,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),Z(l,"href",d=o[3].lucentUrl+"/records/"+o[0].id),Z(l,"title",o[5]),Z(b,"class","text-muted"),Z(C,"class","text-muted"),Z(a,"class","overflow-hidden"),Z(t,"class","card-body d-flex"),Z(e,"class",R="card mb-2 bg-light "+o[1]+" svelte-dof9cm"),rs(e,"border-color",(K=o[4].color)!=null?K:"#ccc"),rs(e,"border-width","1px")},m(K,L){Te(K,e,L),X(e,t),Q&&Q.m(t,null),X(t,s),X(t,a),X(a,l),X(l,u),X(a,h),X(a,b),X(a,y),X(a,C),F&&F.m(C,null),X(e,E),U&&U.m(e,null),$=!0},p(K,[L]){K[4].type==="files"&&Q.p(K,L),(!$||L&1&&d!==(d=K[3].lucentUrl+"/records/"+K[0].id))&&Z(l,"href",d),K[0].status==="draft"?F?(F.p(K,L),L&1&&xe(F,1)):(F=_ce(K),F.c(),xe(F,1),F.m(C,null)):F&&(mo(),Be(F,1,1,()=>{F=null}),go()),K[2]?U?(U.p(K,L),L&4&&xe(U,1)):(U=Sce(K),U.c(),xe(U,1),U.m(e,null)):U&&(mo(),Be(U,1,1,()=>{U=null}),go()),(!$||L&2&&R!==(R="card mb-2 bg-light "+K[1]+" svelte-dof9cm"))&&Z(e,"class",R)},i(K){$||(xe(Q),xe(F),xe(U),$=!0)},o(K){Be(Q),Be(F),Be(U),$=!1},d(K){K&&ke(e),Q&&Q.d(),F&&F.d(),U&&U.d()}}}function ACe(o,e,t){const s=Fg(),a=Ur("channel");let{graph:l}=e,{record:u}=e,{classes:d=""}=e,{hasDelete:h=!1}=e,b=a.schemas.find(E=>E.name===u.schema),y=qu(a.schemas,u,l);function C(E){E.preventDefault(),s("remove",u.id)}return o.$$set=E=>{"graph"in E&&t(7,l=E.graph),"record"in E&&t(0,u=E.record),"classes"in E&&t(1,d=E.classes),"hasDelete"in E&&t(2,h=E.hasDelete)},[u,d,h,a,b,y,C,l]}class J6 extends uo{constructor(e){super(),co(this,e,ACe,ECe,lo,{graph:7,record:0,classes:1,hasDelete:2})}}function qD(o,e,t,s,a){var h,b;if(o===e)return t;let l=a.map(y=>y.id),u=(h=t==null?void 0:t.filter(y=>y.field===s&&y.depth===1&&l.includes(y.target)))!=null?h:[],d=(b=t==null?void 0:t.filter(y=>!(y.field===s&&y.depth===1)))!=null?b:[];return u=DCe(u,o,e),[...d,...u]}function DCe(o,e,t){if(t>=o.length)for(var s=t-o.length+1;s--;)o.push(void 0);return o.splice(t,0,o.splice(e,1)[0]),o}function Cce(o,e,t){const s=o.slice();return s[23]=e[t],s}function kce(o){let e,t,s,a;function l(h){o[13](h)}function u(h){o[14](h)}let d={field:o[23],schema:o[2],record:o[0],validationErrors:o[4],isCreateMode:o[3]};return o[0].data!==void 0&&(d.data=o[0].data),o[1]!==void 0&&(d.graph=o[1]),e=new LOe({props:d}),Ro.push(()=>er(e,"data",l)),Ro.push(()=>er(e,"graph",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.schema=h[2]),b&1&&(y.record=h[0]),b&16&&(y.validationErrors=h[4]),b&8&&(y.isCreateMode=h[3]),!t&&b&1&&(t=!0,y.data=h[0].data,lr(()=>t=!1)),!s&&b&2&&(s=!0,y.graph=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function xce(o,e){let t,s,a,l=e[5]===e[23].group&&kce(e);return{key:o,first:null,c(){t=Rs(),l&&l.c(),s=Rs(),this.first=t},m(u,d){Te(u,t,d),l&&l.m(u,d),Te(u,s,d),a=!0},p(u,d){e=u,e[5]===e[23].group?l?(l.p(e,d),d&32&&xe(l,1)):(l=kce(e),l.c(),xe(l,1),l.m(s.parentNode,s)):l&&(mo(),Be(l,1,1,()=>{l=null}),go())},i(u){a||(xe(l),a=!0)},o(u){Be(l),a=!1},d(u){u&&ke(t),l&&l.d(u),u&&ke(s)}}}function Tce(o){let e,t,s;function a(u){o[15](u)}let l={schema:o[2]};return o[0].status!==void 0&&(l.status=o[0].status),e=new zpe({props:l}),Ro.push(()=>er(e,"status",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&4&&(h.schema=u[2]),!t&&d&1&&(t=!0,h.status=u[0].status,lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function PCe(o){let e,t,s,a,l,u;return{c(){e=re("button"),t=re("span"),s=Ht(`
|
|
Save`),Z(t,"class","spinner-border spinner-border-sm"),Z(t,"role","status"),Z(t,"aria-hidden","true"),e.disabled=a=!o[6],Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Te(d,e,h),X(e,t),X(e,s),l||(u=mn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&ke(e),l=!1,u()}}}function MCe(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Add`,Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[11]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function RCe(o){let e,t,s,a,l,u,d,h,b,y=[],C=new Map,E,R,$,Q,F,U,K,L,te;t=new X6({props:{message:o[7]}});function ne(Xe){o[12](Xe)}let oe={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(oe.active=o[5]),l=new Wpe({props:oe}),Ro.push(()=>er(l,"active",ne)),h=new Vpe({props:{record:o[0],schema:o[2]}});let G=o[8];const we=Xe=>Xe[23].name;for(let Xe=0;Xe<G.length;Xe+=1){let tt=Cce(o,G,Xe),ot=we(tt);C.set(ot,y[Xe]=xce(ot,tt))}let ve=o[2].hasDrafts&&Tce(o);function Re(Xe,tt){return Xe[3]?MCe:PCe}let Oe=Re(o),ce=Oe(o);return{c(){e=re("div"),en(t.$$.fragment),s=Ze(),a=re("div"),en(l.$$.fragment),d=Ze(),en(h.$$.fragment),b=Ze();for(let Xe=0;Xe<y.length;Xe+=1)y[Xe].c();E=Ze(),R=re("div"),$=re("div"),ve&&ve.c(),Q=Ze(),ce.c(),F=Ze(),U=re("button"),U.textContent="cancel",Z(a,"class","mt-1"),Z(U,"class","ms-2 btn btn-link"),Z($,"class","d-flex mt-3 align-items-center justify-content-center"),Z(e,"class","inline-edit my-4 svelte-sl11hx")},m(Xe,tt){Te(Xe,e,tt),Kt(t,e,null),X(e,s),X(e,a),Kt(l,a,null),X(a,d),Kt(h,a,null),X(a,b);for(let ot=0;ot<y.length;ot+=1)y[ot]&&y[ot].m(a,null);X(e,E),X(e,R),X(R,$),ve&&ve.m($,null),X($,Q),ce.m($,null),X($,F),X($,U),K=!0,L||(te=[mn(window,"beforeunload",o[9]),mn(U,"click",o[10])],L=!0)},p(Xe,[tt]){const ot={};tt&128&&(ot.message=Xe[7]),t.$set(ot);const V={};tt&4&&(V.schema=Xe[2]),tt&8&&(V.isCreateMode=Xe[3]),tt&1&&(V.record=Xe[0]),!u&&tt&32&&(u=!0,V.active=Xe[5],lr(()=>u=!1)),l.$set(V);const ut={};tt&1&&(ut.record=Xe[0]),tt&4&&(ut.schema=Xe[2]),h.$set(ut),tt&319&&(G=Xe[8],mo(),y=Jd(y,tt,we,1,Xe,G,C,a,xv,xce,null,Cce),go()),Xe[2].hasDrafts?ve?(ve.p(Xe,tt),tt&4&&xe(ve,1)):(ve=Tce(Xe),ve.c(),xe(ve,1),ve.m($,Q)):ve&&(mo(),Be(ve,1,1,()=>{ve=null}),go()),Oe===(Oe=Re(Xe))&&ce?ce.p(Xe,tt):(ce.d(1),ce=Oe(Xe),ce&&(ce.c(),ce.m($,F)))},i(Xe){if(!K){xe(t.$$.fragment,Xe),xe(l.$$.fragment,Xe),xe(h.$$.fragment,Xe);for(let tt=0;tt<G.length;tt+=1)xe(y[tt]);xe(ve),K=!0}},o(Xe){Be(t.$$.fragment,Xe),Be(l.$$.fragment,Xe),Be(h.$$.fragment,Xe);for(let tt=0;tt<y.length;tt+=1)Be(y[tt]);Be(ve),K=!1},d(Xe){Xe&&ke(e),Jt(t),Jt(l),Jt(h);for(let tt=0;tt<y.length;tt+=1)y[tt].d();ve&&ve.d(),ce.d(),L=!1,vi(te)}}}function $Ce(o,e,t){let s,a;const l=Ur("channel"),u=Fg();let{schema:d}=e,{record:h}=e,{graph:b={records:[],edges:[]}}=e,{isCreateMode:y}=e,C,E="",R=!1,$=d.fields.filter(ve=>ve.name!=="id"),Q="_default";d.fields.reduce((ve,Re)=>{var Oe;return Re.ui==="tab"?(Q=Re.name,ve):(ve[Q]=[...(Oe=ve[Q])!=null?Oe:[],Re.name],ve)},[]),W1(()=>{F()});function F(){C={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}Epe(()=>{t(6,R=K())});function U(ve){return R?ve.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete ve.returnValue,"...")}function K(){return y?!1:!Lc.exports.isEqual(C,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function L(ve){ve.preventDefault(),u("cancel")}function te(ve){return ve.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Re,Oe){var ce,Xe;if(!R&&!y){Re(null);return}if(!h){Re(null);return}t(1,b.edges=(Xe=(ce=b.edges)==null?void 0:ce.filter(tt=>!tt._isTrashed&&tt.source===h.id))!=null?Xe:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:y}).then(function(tt){console.log("SAVE: SAVED INLINE"),t(0,h=tt.data.records[0]),t(1,b=tt.data),y||F(),u("inlinesaved",{records:[h]}),Re(null)}).catch(function(tt){tt.response&&(typeof tt.response.data.error=="string"?t(7,a=tt.response.data.error):t(4,s=tt.response.data.error)),Re(null)})})}function ne(ve){E=ve,t(5,E)}function oe(ve){o.$$.not_equal(h.data,ve)&&(h.data=ve,t(0,h))}function G(ve){b=ve,t(1,b)}function we(ve){o.$$.not_equal(h.status,ve)&&(h.status=ve,t(0,h))}return o.$$set=ve=>{"schema"in ve&&t(2,d=ve.schema),"record"in ve&&t(0,h=ve.record),"graph"in ve&&t(1,b=ve.graph),"isCreateMode"in ve&&t(3,y=ve.isCreateMode)},o.$$.update=()=>{o.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[h,b,d,y,s,E,R,a,$,U,L,te,ne,oe,G,we]}class Xpe extends uo{constructor(e){super(),co(this,e,$Ce,RCe,lo,{schema:2,record:0,graph:1,isCreateMode:3})}}function Ece(o,e,t){const s=o.slice();return s[11]=e[t],s}function Ace(o){let e=[],t=new Map,s,a=o[2];const l=d=>d[11].id;for(let d=0;d<a.length;d+=1){let h=Ece(o,a,d),b=l(h);t.set(b,e[d]=Pce(b,h))}let u=null;return a.length||(u=Dce()),{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs(),u&&u.c()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),u&&u.m(d,h)},p(d,h){h&44&&(a=d[2],e=Jd(e,h,l,1,d,a,t,s.parentNode,XD,Pce,s,Ece),a.length?u&&(u.d(1),u=null):u||(u=Dce(),u.c(),u.m(s.parentNode,s)))},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s),u&&u.d(d)}}}function Dce(o){let e;return{c(){e=Ht("Start typing...")},m(t,s){Te(t,e,s)},d(t){t&&ke(e)}}}function Pce(o,e){let t,s,a=qu(e[3].schemas,e[11])+"",l,u,d,h;function b(...C){return e[8](e[11],...C)}function y(...C){return e[9](e[11],...C)}return{key:o,first:null,c(){t=re("div"),s=re("span"),l=Ht(a),u=Ze(),Z(s,"class","dropdown-item"),this.first=t},m(C,E){Te(C,t,E),X(t,s),X(s,l),X(t,u),d||(h=[mn(t,"click",b),mn(t,"keypress",y)],d=!0)},p(C,E){e=C,E&4&&a!==(a=qu(e[3].schemas,e[11])+"")&&Fn(l,a)},d(C){C&&ke(t),d=!1,vi(h)}}}function NCe(o){let e,t,s,a,l,u,d=o[2]&&Ace(o);return{c(){e=re("input"),s=Ze(),a=re("div"),d&&d.c(),Z(e,"type","search"),Z(e,"class","form-control dropdown-toggle"),Z(e,"placeholder",t="Search for "+o[0].label),Z(e,"data-bs-toggle","dropdown"),Z(e,"autocomplete","off"),Z(a,"class","dropdown-menu w-100")},m(h,b){Te(h,e,b),ar(e,o[1]),Te(h,s,b),Te(h,a,b),d&&d.m(a,null),l||(u=[mn(e,"keyup",o[4]),mn(e,"input",o[7])],l=!0)},p(h,[b]){b&1&&t!==(t="Search for "+h[0].label)&&Z(e,"placeholder",t),b&2&&e.value!==h[1]&&ar(e,h[1]),h[2]?d?d.p(h,b):(d=Ace(h),d.c(),d.m(a,null)):d&&(d.d(1),d=null)},i:un,o:un,d(h){h&&ke(e),h&&ke(s),h&&ke(a),d&&d.d(),l=!1,vi(u)}}}function ICe(o,e,t){let s;const a=Ur("channel"),l=Fg();let{value:u=""}=e,{field:d}=e,h="";const b=Lc.exports.debounce($=>{axios.get(a.lucentUrl+"/records/suggestions",{params:{schema:d.collections[0],field:"search",value:h,ui:"search"}}).then(Q=>{t(2,s=Q.data)}).catch(Q=>{t(2,s=[]),console.log(Q)})},500);function y($,Q){$.preventDefault(),t(6,u=Q.id),l("addFilter"),t(6,u="")}function C(){h=this.value,t(1,h)}const E=($,Q)=>y(Q,$),R=($,Q)=>y(Q,$);return o.$$set=$=>{"value"in $&&t(6,u=$.value),"field"in $&&t(0,d=$.field)},t(2,s=[]),[d,h,s,a,b,y,u,C,E,R]}class BCe extends uo{constructor(e){super(),co(this,e,ICe,NCe,lo,{value:6,field:0})}}const LCe=o=>({}),Mce=o=>({});function FCe(o){let e;return{c(){e=Ht("Dropdown")},m(t,s){Te(t,e,s)},d(t){t&&ke(e)}}}function QCe(o){let e,t,s,a;const l=o[4].button,u=YH(l,o,o[3],Mce),d=u||FCe(),h=o[4].default,b=YH(h,o,o[3],null);return{c(){e=re("button"),d&&d.c(),t=Ze(),s=re("div"),b&&b.c(),Z(e,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),Z(e,"type","button"),Z(e,"data-bs-toggle","dropdown"),Z(e,"data-bs-auto-close","outside"),Z(e,"aria-expanded","false"),Z(s,"class","dropdown-menu"),rs(s,"width",o[0]+"px")},m(y,C){Te(y,e,C),d&&d.m(e,null),Te(y,t,C),Te(y,s,C),b&&b.m(s,null),o[5](s),a=!0},p(y,[C]){u&&u.p&&(!a||C&8)&&jH(u,l,y,y[3],a?XH(l,y[3],C,LCe):qH(y[3]),Mce),b&&b.p&&(!a||C&8)&&jH(b,h,y,y[3],a?XH(h,y[3],C,null):qH(y[3]),null),(!a||C&1)&&rs(s,"width",y[0]+"px")},i(y){a||(xe(d,y),xe(b,y),a=!0)},o(y){Be(d,y),Be(b,y),a=!1},d(y){y&&ke(e),d&&d.d(y),y&&ke(t),y&&ke(s),b&&b.d(y),o[5](null)}}}function ZCe(o,e,t){let{$$slots:s={},$$scope:a}=e,{width:l="300"}=e,u;function d(){u.classList.remove("show")}function h(b){Ro[b?"unshift":"push"](()=>{u=b,t(1,u)})}return o.$$set=b=>{"width"in b&&t(0,l=b.width),"$$scope"in b&&t(3,a=b.$$scope)},[l,u,d,a,s,h]}class HCe extends uo{constructor(e){super(),co(this,e,ZCe,QCe,lo,{width:0,hide:2})}get hide(){return this.$$.ctx[2]}}function Rce(o,e,t){const s=o.slice();return s[22]=e[t],s}function $ce(o,e,t){const s=o.slice();return s[25]=e[t],s}function Nce(o){let e,t=o[25].label+"",s;return{c(){e=re("option"),s=Ht(t),e.__value=o[25],e.value=e.__value},m(a,l){Te(a,e,l),X(e,s)},p:un,d(a){a&&ke(e)}}}function Ice(o){let e,t=o[22].label+"",s,a;return{c(){e=re("option"),s=Ht(t),e.__value=a=o[22],e.value=e.__value},m(l,u){Te(l,e,u),X(e,s)},p(l,u){u&2&&t!==(t=l[22].label+"")&&Fn(s,t),u&2&&a!==(a=l[22])&&(e.__value=a,e.value=e.__value)},d(l){l&&ke(e)}}}function zCe(o){let e,t,s;return{c(){e=re("input"),Z(e,"type","text"),Z(e,"class","form-control")},m(a,l){Te(a,e,l),ar(e,o[4]),t||(s=mn(e,"input",o[17]),t=!0)},p(a,l){l&16&&e.value!==a[4]&&ar(e,a[4])},i:un,o:un,d(a){a&&ke(e),t=!1,s()}}}function VCe(o){let e,t,s;function a(u){o[16](u)}let l={field:o[0]};return o[4]!==void 0&&(l.value=o[4]),e=new BCe({props:l}),Ro.push(()=>er(e,"value",a)),e.$on("addFilter",o[7]),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&1&&(h.field=u[0]),!t&&d&16&&(t=!0,h.value=u[4],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function WCe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we=o[6],ve=[];for(let ot=0;ot<we.length;ot+=1)ve[ot]=Nce($ce(o,we,ot));let Re=o[1],Oe=[];for(let ot=0;ot<Re.length;ot+=1)Oe[ot]=Ice(Rce(o,Re,ot));const ce=[VCe,zCe],Xe=[];function tt(ot,V){var ut,Qe;return((Qe=(ut=ot[0])==null?void 0:ut.info)==null?void 0:Qe.name)==="reference"&&ot[5].name==="eq"?0:1}return h=tt(o),b=Xe[h]=ce[h](o),{c(){e=re("div"),t=re("select");for(let ot=0;ot<ve.length;ot+=1)ve[ot].c();s=Ze(),a=re("div"),l=re("select");for(let ot=0;ot<Oe.length;ot+=1)Oe[ot].c();u=Ze(),d=re("div"),b.c(),y=Ze(),C=re("div"),E=re("button"),E.textContent="Add filter",R=Ze(),$=re("hr"),Q=Ze(),F=re("div"),F.innerHTML='<h6 class="dropdown-header">Advanced filters</h6>',U=Ze(),K=re("form"),L=re("div"),te=re("input"),Z(t,"class","form-select"),o[0]===void 0&&AC(()=>o[14].call(t)),Z(e,"class","px-3 py-1 d-flex align-items-center"),Z(l,"class","form-select"),o[5]===void 0&&AC(()=>o[15].call(l)),Z(a,"class","px-3 py-1 d-flex align-items-center"),Z(d,"class","px-3 py-1 d-flex align-items-center"),Z(E,"class","btn btn-outline-primary"),Z(E,"type","button"),Z(C,"class","px-3 py-1 d-flex align-items-center"),Z(te,"type","search"),Z(te,"class","form-control"),Z(te,"placeholder","Advanced filters"),te.required=!0,Z(L,"class","px-3 py-1 d-flex align-items-center")},m(ot,V){Te(ot,e,V),X(e,t);for(let ut=0;ut<ve.length;ut+=1)ve[ut]&&ve[ut].m(t,null);NZ(t,o[0],!0),Te(ot,s,V),Te(ot,a,V),X(a,l);for(let ut=0;ut<Oe.length;ut+=1)Oe[ut]&&Oe[ut].m(l,null);NZ(l,o[5],!0),Te(ot,u,V),Te(ot,d,V),Xe[h].m(d,null),Te(ot,y,V),Te(ot,C,V),X(C,E),Te(ot,R,V),Te(ot,$,V),Te(ot,Q,V),Te(ot,F,V),Te(ot,U,V),Te(ot,K,V),X(K,L),X(L,te),ar(te,o[3]),ne=!0,oe||(G=[mn(t,"change",o[14]),mn(l,"change",o[15]),mn(E,"click",o[7]),mn(te,"input",o[18]),mn(K,"submit",o[8])],oe=!0)},p(ot,V){if(V&64){we=ot[6];let Qe;for(Qe=0;Qe<we.length;Qe+=1){const Bt=$ce(ot,we,Qe);ve[Qe]?ve[Qe].p(Bt,V):(ve[Qe]=Nce(Bt),ve[Qe].c(),ve[Qe].m(t,null))}for(;Qe<ve.length;Qe+=1)ve[Qe].d(1);ve.length=we.length}if(V&65&&NZ(t,ot[0]),V&2){Re=ot[1];let Qe;for(Qe=0;Qe<Re.length;Qe+=1){const Bt=Rce(ot,Re,Qe);Oe[Qe]?Oe[Qe].p(Bt,V):(Oe[Qe]=Ice(Bt),Oe[Qe].c(),Oe[Qe].m(l,null))}for(;Qe<Oe.length;Qe+=1)Oe[Qe].d(1);Oe.length=Re.length}V&34&&NZ(l,ot[5]);let ut=h;h=tt(ot),h===ut?Xe[h].p(ot,V):(mo(),Be(Xe[ut],1,1,()=>{Xe[ut]=null}),go(),b=Xe[h],b?b.p(ot,V):(b=Xe[h]=ce[h](ot),b.c()),xe(b,1),b.m(d,null)),V&8&&te.value!==ot[3]&&ar(te,ot[3])},i(ot){ne||(xe(b),ne=!0)},o(ot){Be(b),ne=!1},d(ot){ot&&ke(e),ia(ve,ot),ot&&ke(s),ot&&ke(a),ia(Oe,ot),ot&&ke(u),ot&&ke(d),Xe[h].d(),ot&&ke(y),ot&&ke(C),ot&&ke(R),ot&&ke($),ot&&ke(Q),ot&&ke(F),ot&&ke(U),ot&&ke(K),oe=!1,vi(G)}}}function UCe(o){let e,t,s,a,l;return t=new Fa({props:{icon:"filter"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),a=re("span"),a.textContent="Filter",Z(a,"class","ms-1"),Z(e,"slot","button")},m(u,d){Te(u,e,d),Kt(t,e,null),X(e,s),X(e,a),l=!0},p:un,i(u){l||(xe(t.$$.fragment,u),l=!0)},o(u){Be(t.$$.fragment,u),l=!1},d(u){u&&ke(e),Jt(t)}}}function YCe(o){let e,t,s,a={width:"300",$$slots:{button:[UCe],default:[WCe]},$$scope:{ctx:o}};return t=new HCe({props:a}),o[19](t),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","mx-2 d-flex align-items-center")},m(l,u){Te(l,e,u),Kt(t,e,null),s=!0},p(l,[u]){const d={};u&268435515&&(d.$$scope={dirty:u,ctx:l}),t.$set(d)},i(l){s||(xe(t.$$.fragment,l),s=!0)},o(l){Be(t.$$.fragment,l),s=!1},d(l){l&&ke(e),o[19](null),Jt(t)}}}function XCe(o,e,t){let s,a;const l=Fg();let{schema:u}=e,{systemFields:d=[]}=e,{operators:h}=e,{inModal:b}=e,{modalUrl:y}=e,C,E="",R=d;u.type=="collection"&&(R=d.filter(ve=>ve.files===!1));let $=[...u.fields,...R].filter(ve=>{var Re,Oe;return!["file","json"].includes((Oe=(Re=ve.info)==null?void 0:Re.name)!=null?Oe:ve.ui)}),Q,F="";function U(ve){ve.preventDefault();let Re="",Oe;u.fields.find(Xe=>Xe.name===Q.name)&&(Q.info.name=="reference"&&a.name=="eq"?(Re="children."+Q.name+".id",Oe=`filter[${Re}]`):(Re="data.",Oe=`filter[${Re+Q.name}_${a.name}]`));const ce=new URL(y!=null?y:window.location.href);ce.searchParams.set("skip","0"),ce.searchParams.set(Oe,F),b?(l("refresh",ce),C.hide()):window.location=ce}function K(ve){var tt,ot;ve.preventDefault();let Re=(tt=E.split("=")[0])!=null?tt:"";if(!Re)return;let Oe=`filter[${Re}]`,ce=(ot=E.split("=")[1])!=null?ot:"";if(!ce)return;const Xe=new URL(y!=null?y:window.location.href);Xe.searchParams.set("skip","0"),Xe.searchParams.set(Oe,ce),b?l("refresh",Xe):window.location.replace(Xe)}function L(){Q=vle(this),t(0,Q),t(6,$)}function te(){a=vle(this),t(5,a),t(1,s),t(11,h),t(0,Q),t(1,s),t(11,h),t(0,Q)}function ne(ve){F=ve,t(4,F)}function oe(){F=this.value,t(4,F)}function G(){E=this.value,t(3,E)}function we(ve){Ro[ve?"unshift":"push"](()=>{C=ve,t(2,C)})}return o.$$set=ve=>{"schema"in ve&&t(9,u=ve.schema),"systemFields"in ve&&t(10,d=ve.systemFields),"operators"in ve&&t(11,h=ve.operators),"inModal"in ve&&t(12,b=ve.inModal),"modalUrl"in ve&&t(13,y=ve.modalUrl)},o.$$.update=()=>{o.$$.dirty&2049&&t(1,s=h.filter(ve=>{var Re;return ve.uis.includes((Re=Q==null?void 0:Q.info)==null?void 0:Re.name)||ve.uis[0]=="*"})),o.$$.dirty&2&&t(5,a=s[0])},[Q,s,C,E,F,a,$,U,K,u,d,h,b,y,L,te,ne,oe,G,we]}class jCe extends uo{constructor(e){super(),co(this,e,XCe,YCe,lo,{schema:9,systemFields:10,operators:11,inModal:12,modalUrl:13})}}function qCe(o){let e,t,s,a,l,u,d,h;return{c(){e=re("fieldset"),t=re("label"),s=Ht(`Upload file
|
|
`),a=re("span"),a.innerHTML='<span class="visually-hidden">Loading...</span>',l=Ze(),u=re("input"),Z(a,"class","spinner-border spinner-border-sm"),Z(a,"role","status"),Z(a,"aria-hidden","true"),Z(u,"class","form-control"),Z(u,"type","file"),Z(u,"id","formFile"),u.multiple=!0,Z(u,"accept",GCe),u.disabled=o[0],u.hidden=!0,Z(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,y){Te(b,e,y),X(e,t),X(t,s),X(t,a),X(t,l),X(t,u),d||(h=mn(u,"input",o[1]),d=!0)},p(b,[y]){y&1&&(u.disabled=b[0]),y&1&&(e.disabled=b[0])},i:un,o:un,d(b){b&&ke(e),d=!1,h()}}}let GCe="";function KCe(o,e,t){const s=Fg(),a=Ur("channel");let{schema:l}=e,u=[],d=!1;function h(b){t(0,d=!0),u=b.target.files?[...b.target.files]:[];let y=new FormData;y.append("schema",l.name),Array.from(u).forEach(function(C){y.append("files[]",C)}),s("beforeUpload",u),axios.post(a.lucentUrl+"/files/upload",y,{headers:{"Content-Type":"multipart/form-data"}}).then(C=>{C.data.error?s("uploadError",C.data.error):s("uploadComplete",C.data),t(0,d=!1)}).catch(C=>{t(0,d=!1),console.log(C.response.data)})}return o.$$set=b=>{"schema"in b&&t(2,l=b.schema)},[d,h,l]}class JCe extends uo{constructor(e){super(),co(this,e,KCe,qCe,lo,{schema:2})}}function Bce(o,e,t){const s=o.slice();return s[18]=e[t],s}function Lce(o,e,t){const s=o.slice();return s[18]=e[t],s}function eke(o){let e,t;return e=new Fa({props:{icon:"arrow-up-short-wide"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function tke(o){let e,t;return e=new Fa({props:{icon:"arrow-down-wide-short"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Fce(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[10](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[11](o[18],...ne)}function te(...ne){return o[12](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),u=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),C=re("button"),R=Ht(E),$=Ze(),Z(s,"title","Sort Ascending"),Z(s,"class",l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),Z(d,"title","Sort Descending"),Z(d,"class",b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),Z(C,"title","Sort Ascending"),Z(C,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(C,"overflow","hidden"),Z(t,"class","btn-group w-100"),Z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Te(ne,e,oe),X(e,t),X(t,s),Kt(a,s,null),X(t,u),X(t,d),Kt(h,d,null),X(t,y),X(t,C),X(C,R),X(e,$),Q=!0,F||(U=[mn(s,"click",K),mn(d,"click",L),mn(C,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&11&&l!==(l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&Z(s,"class",l),(!Q||oe&11&&b!==(b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&Z(d,"class",b),(!Q||oe&8)&&E!==(E=o[18].label+"")&&Fn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Be(a.$$.fragment,ne),Be(h.$$.fragment,ne),Q=!1},d(ne){ne&&ke(e),Jt(a),Jt(h),F=!1,vi(U)}}}function Qce(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[13](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[14](o[18],...ne)}function te(...ne){return o[15](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),u=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),C=re("button"),R=Ht(E),$=Ze(),Z(s,"title","Sort Ascending"),Z(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),Z(d,"title","Sort Descending"),Z(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),Z(C,"title","Sort Ascending"),Z(C,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(C,"overflow","hidden"),Z(t,"class","btn-group w-100"),Z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Te(ne,e,oe),X(e,t),X(t,s),Kt(a,s,null),X(t,u),X(t,d),Kt(h,d,null),X(t,y),X(t,C),X(C,R),X(e,$),Q=!0,F||(U=[mn(s,"click",K),mn(d,"click",L),mn(C,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&Z(s,"class",l),(!Q||oe&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&Z(d,"class",b),(!Q||oe&4)&&E!==(E=o[18].label+"")&&Fn(R,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Be(a.$$.fragment,ne),Be(h.$$.fragment,ne),Q=!1},d(ne){ne&&ke(e),Jt(a),Jt(h),F=!1,vi(U)}}}function nke(o){let e,t,s,a,l,u,d,h=o[1].label+"",b,y,C,E,R,$,Q,F,U;const K=[tke,eke],L=[];function te(Oe,ce){return ce&1&&(s=null),s==null&&(s=!!Oe[0].startsWith("-")),s?0:1}a=te(o,-1),l=L[a]=K[a](o);let ne=o[3],oe=[];for(let Oe=0;Oe<ne.length;Oe+=1)oe[Oe]=Fce(Lce(o,ne,Oe));const G=Oe=>Be(oe[Oe],1,1,()=>{oe[Oe]=null});let we=o[2],ve=[];for(let Oe=0;Oe<we.length;Oe+=1)ve[Oe]=Qce(Bce(o,we,Oe));const Re=Oe=>Be(ve[Oe],1,1,()=>{ve[Oe]=null});return{c(){e=re("div"),t=re("button"),l.c(),u=Ze(),d=re("span"),b=Ht(h),y=Ze(),C=re("div"),E=re("div");for(let Oe=0;Oe<oe.length;Oe+=1)oe[Oe].c();R=Ze(),$=re("h6"),$.textContent="System",Q=Ze(),F=re("div");for(let Oe=0;Oe<ve.length;Oe+=1)ve[Oe].c();Z(d,"class","ms-1"),Z(t,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),Z(t,"type","button"),Z(t,"data-bs-toggle","dropdown"),Z(t,"data-bs-auto-close","outside"),Z(t,"aria-expanded","false"),Z(E,"class","row"),Z($,"class","dropdown-header px-0"),Z(F,"class","row"),Z(C,"class","dropdown-menu"),rs(C,"width","auto"),rs(C,"max-width","800px"),Z(e,"class","")},m(Oe,ce){Te(Oe,e,ce),X(e,t),L[a].m(t,null),X(t,u),X(t,d),X(d,b),X(e,y),X(e,C),X(C,E);for(let Xe=0;Xe<oe.length;Xe+=1)oe[Xe]&&oe[Xe].m(E,null);X(C,R),X(C,$),X(C,Q),X(C,F);for(let Xe=0;Xe<ve.length;Xe+=1)ve[Xe]&&ve[Xe].m(F,null);U=!0},p(Oe,[ce]){let Xe=a;if(a=te(Oe,ce),a!==Xe&&(mo(),Be(L[Xe],1,1,()=>{L[Xe]=null}),go(),l=L[a],l||(l=L[a]=K[a](Oe),l.c()),xe(l,1),l.m(t,u)),(!U||ce&2)&&h!==(h=Oe[1].label+"")&&Fn(b,h),ce&59){ne=Oe[3];let tt;for(tt=0;tt<ne.length;tt+=1){const ot=Lce(Oe,ne,tt);oe[tt]?(oe[tt].p(ot,ce),xe(oe[tt],1)):(oe[tt]=Fce(ot),oe[tt].c(),xe(oe[tt],1),oe[tt].m(E,null))}for(mo(),tt=ne.length;tt<oe.length;tt+=1)G(tt);go()}if(ce&53){we=Oe[2];let tt;for(tt=0;tt<we.length;tt+=1){const ot=Bce(Oe,we,tt);ve[tt]?(ve[tt].p(ot,ce),xe(ve[tt],1)):(ve[tt]=Qce(ot),ve[tt].c(),xe(ve[tt],1),ve[tt].m(F,null))}for(mo(),tt=we.length;tt<ve.length;tt+=1)Re(tt);go()}},i(Oe){if(!U){xe(l);for(let ce=0;ce<ne.length;ce+=1)xe(oe[ce]);for(let ce=0;ce<we.length;ce+=1)xe(ve[ce]);U=!0}},o(Oe){Be(l),oe=oe.filter(Boolean);for(let ce=0;ce<oe.length;ce+=1)Be(oe[ce]);ve=ve.filter(Boolean);for(let ce=0;ce<ve.length;ce+=1)Be(ve[ce]);U=!1},d(Oe){Oe&&ke(e),L[a].d(),ia(oe,Oe),ia(ve,Oe)}}}function oke(o,e,t){let s,a;const l=Fg();let{schema:u}=e,{sortParam:d}=e,{sortField:h}=e,{inModal:b}=e,{modalUrl:y}=e,{systemFields:C=[]}=e;function E(ne){const oe=new URL(y!=null?y:window.location.href);oe.searchParams.set("sort",ne),b?l("refresh",oe):window.location=oe}function R(ne,oe){ne.preventDefault();let G=C.map(we=>we.name).includes(oe.name)?"":"data.";return E(G+oe.name)}function $(ne,oe){ne.preventDefault();let G=C.map(we=>we.name).includes(oe.name)?"":"data.";return E("-"+G+oe.name)}const Q=(ne,oe)=>R(oe,ne),F=(ne,oe)=>$(oe,ne),U=(ne,oe)=>R(oe,ne),K=(ne,oe)=>R(oe,ne),L=(ne,oe)=>$(oe,ne),te=(ne,oe)=>R(oe,ne);return o.$$set=ne=>{"schema"in ne&&t(6,u=ne.schema),"sortParam"in ne&&t(0,d=ne.sortParam),"sortField"in ne&&t(1,h=ne.sortField),"inModal"in ne&&t(7,b=ne.inModal),"modalUrl"in ne&&t(8,y=ne.modalUrl),"systemFields"in ne&&t(9,C=ne.systemFields)},o.$$.update=()=>{o.$$.dirty&64&&t(3,s=u.fields.filter(ne=>!["reference","file","json","id","rich","markdown","block"].includes(ne.info.name))),o.$$.dirty&512&&t(2,a=C),o.$$.dirty&576&&u.type==="collection"&&t(2,a=C.filter(ne=>ne.files===!1))},[d,h,a,s,R,$,u,b,y,C,Q,F,U,K,L,te]}class ske extends uo{constructor(e){super(),co(this,e,oke,nke,lo,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function rke(o){var h,b;let e=o[3].label+"",t,s,a=((b=(h=o[0].find(o[11]))==null?void 0:h.symbol)!=null?b:"")+"",l,u,d;return{c(){t=Ht(e),s=Ze(),l=Ht(a),u=Ze(),d=Ht(o[2])},m(y,C){Te(y,t,C),Te(y,s,C),Te(y,l,C),Te(y,u,C),Te(y,d,C)},p(y,C){var E,R;C&8&&e!==(e=y[3].label+"")&&Fn(t,e),C&9&&a!==(a=((R=(E=y[0].find(y[11]))==null?void 0:E.symbol)!=null?R:"")+"")&&Fn(l,a),C&4&&Fn(d,y[2])},d(y){y&&ke(t),y&&ke(s),y&&ke(l),y&&ke(u),y&&ke(d)}}}function ike(o){let e=o[3].label+"",t,s,a=qu(o[4].schemas,o[5])+"",l;return{c(){t=Ht(e),s=Ht(" is "),l=Ht(a)},m(u,d){Te(u,t,d),Te(u,s,d),Te(u,l,d)},p(u,d){d&8&&e!==(e=u[3].label+"")&&Fn(t,e)},d(u){u&&ke(t),u&&ke(s),u&&ke(l)}}}function ake(o){let e,t,s,a,l,u;function d(y,C){return y[3].isReference&&y[5]?ike:rke}let h=d(o),b=h(o);return{c(){e=re("span"),t=re("div"),b.c(),s=Ze(),a=re("button"),Z(a,"type","button"),Z(a,"class","btn-close btn-close ms-1"),Z(a,"aria-label","Close"),Z(t,"class","d-flex align-items-center justify-content-center"),Z(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-1x4ff17")},m(y,C){Te(y,e,C),X(e,t),b.m(t,null),X(t,s),X(t,a),l||(u=mn(a,"click",ku(o[12])),l=!0)},p(y,[C]){h===(h=d(y))&&b?b.p(y,C):(b.d(1),b=h(y),b&&(b.c(),b.m(t,s)))},i:un,o:un,d(y){y&&ke(e),b.d(),l=!1,u()}}}function lke(o){return e=>{var s;if(e.isReference)return e.operator="eq",e;const t=o.split("_");return e.operator=(s=t[t.length-1])!=null?s:"eq",e}}function cke(o,e){return t=>{var l;let s="";t.isReference?s=e.split(".")[1]:s=e.replace("_"+t.operator,"");const a=o.fields.find(u=>u.name===s);return t.label=(l=a==null?void 0:a.label)!=null?l:s,t}}function uke(o,e,t){const s=Ur("channel"),a=Fg();let{schema:l}=e,{operators:u}=e,{key:d}=e,{value:h}=e,{inModal:b}=e,{modalUrl:y}=e,{graph:C}=e,E={label:"",operator:"",value:h,isReference:d.startsWith("children")};E=[lke(d),cke(l,d)].reduce((K,L)=>L(K),E);const R=$(C,h);function $(K,L){return E.isReference?K.records.find(te=>te.id===L):null}function Q(K){let L=`filter[${K}]`;const te=new URL(y!=null?y:window.location.href);te.searchParams.set("skip","0"),te.searchParams.delete(L),b?a("refresh",te):window.location.replace(te)}const F=K=>K.name===E.operator,U=()=>Q(d);return o.$$set=K=>{"schema"in K&&t(7,l=K.schema),"operators"in K&&t(0,u=K.operators),"key"in K&&t(1,d=K.key),"value"in K&&t(2,h=K.value),"inModal"in K&&t(8,b=K.inModal),"modalUrl"in K&&t(9,y=K.modalUrl),"graph"in K&&t(10,C=K.graph)},[u,d,h,E,s,R,Q,l,b,y,C,F,U]}class fke extends uo{constructor(e){super(),co(this,e,uke,ake,lo,{schema:7,operators:0,key:1,value:2,inModal:8,modalUrl:9,graph:10})}}function Zce(o,e,t){const s=o.slice();return s[21]=e[t][0],s[22]=e[t][1],s}function dke(o){let e,t,s;return t=new JCe({props:{schema:o[0]}}),t.$on("uploadComplete",o[13]),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","d-inline-block ms-1")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&1&&(u.schema=a[0]),t.$set(u)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function hke(o){let e,t=!o[5]&&o[7]&&Hce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,a){!s[5]&&s[7]?t?t.p(s,a):(t=Hce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function Hce(o){let e,t,s;return{c(){e=re("a"),t=Ht("New Record"),Z(e,"href",s=o[10].lucentUrl+"/records/new?schema="+o[0].name),Z(e,"class","btn btn-sm btn-primary")},m(a,l){Te(a,e,l),X(e,t)},p(a,l){l&1&&s!==(s=a[10].lucentUrl+"/records/new?schema="+a[0].name)&&Z(e,"href",s)},d(a){a&&ke(e)}}}function zce(o){let e,t,s,a,l,u;s=new Fa({props:{icon:"ellipsis-vertical"}});function d(y,C){return y[4].status_in==="trashed"?gke:mke}let h=d(o),b=h(o);return{c(){e=re("div"),t=re("button"),en(s.$$.fragment),a=Ze(),l=re("ul"),b.c(),Z(t,"class","btn btn-link btn-sm"),Z(t,"type","button"),Z(t,"data-bs-toggle","dropdown"),Z(t,"aria-expanded","false"),Z(l,"class","dropdown-menu"),Z(e,"class","dropdown d-inline-block")},m(y,C){Te(y,e,C),X(e,t),Kt(s,t,null),X(e,a),X(e,l),b.m(l,null),u=!0},p(y,C){h===(h=d(y))&&b?b.p(y,C):(b.d(1),b=h(y),b&&(b.c(),b.m(l,null)))},i(y){u||(xe(s.$$.fragment,y),u=!0)},o(y){Be(s.$$.fragment,y),u=!1},d(y){y&&ke(e),Jt(s),b.d()}}}function mke(o){let e,t,s,a,l,u,d,h;return{c(){e=re("li"),t=re("a"),s=Ht("Export to CSV"),a=Ze(),l=re("li"),u=re("a"),d=Ht("View trashed records"),Z(t,"class","dropdown-item"),Z(t,"href",o[11]),Z(u,"class","dropdown-item"),Z(u,"href",h=o[10].lucentUrl+"/content/"+o[0].name+"?filter[status_in]=trashed")},m(b,y){Te(b,e,y),X(e,t),X(t,s),Te(b,a,y),Te(b,l,y),X(l,u),X(u,d)},p(b,y){y&1&&h!==(h=b[10].lucentUrl+"/content/"+b[0].name+"?filter[status_in]=trashed")&&Z(u,"href",h)},d(b){b&&ke(e),b&&ke(a),b&&ke(l)}}}function gke(o){let e,t=o[7]&&Vce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,a){s[7]?t?t.p(s,a):(t=Vce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&ke(e)}}}function Vce(o){let e,t,s,a;return{c(){e=re("li"),t=re("a"),s=Ht("Empty trash"),Z(t,"class","dropdown-item"),Z(t,"href",a=o[10].lucentUrl+"/content/"+o[0].name+"/emptyTrash")},m(l,u){Te(l,e,u),X(e,t),X(t,s)},p(l,u){u&1&&a!==(a=l[10].lucentUrl+"/content/"+l[0].name+"/emptyTrash")&&Z(t,"href",a)},d(l){l&&ke(e)}}}function Wce(o){let e,t,s=Object.entries(o[4]),a=[];for(let u=0;u<s.length;u+=1)a[u]=Uce(Zce(o,s,u));const l=u=>Be(a[u],1,1,()=>{a[u]=null});return{c(){e=re("div");for(let u=0;u<a.length;u+=1)a[u].c();Z(e,"class","d-flex mb-3")},m(u,d){Te(u,e,d);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(e,null);t=!0},p(u,d){if(d&377){s=Object.entries(u[4]);let h;for(h=0;h<s.length;h+=1){const b=Zce(u,s,h);a[h]?(a[h].p(b,d),xe(a[h],1)):(a[h]=Uce(b),a[h].c(),xe(a[h],1),a[h].m(e,null))}for(mo(),h=s.length;h<a.length;h+=1)l(h);go()}},i(u){if(!t){for(let d=0;d<s.length;d+=1)xe(a[d]);t=!0}},o(u){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)Be(a[d]);t=!1},d(u){u&&ke(e),ia(a,u)}}}function Uce(o){let e,t;return e=new fke({props:{schema:o[0],operators:o[3],key:o[21],value:o[22],inModal:o[5],modalUrl:o[6],graph:o[8]}}),e.$on("refresh",o[18]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.schema=s[0]),a&8&&(l.operators=s[3]),a&16&&(l.key=s[21]),a&16&&(l.value=s[22]),a&32&&(l.inModal=s[5]),a&64&&(l.modalUrl=s[6]),a&256&&(l.graph=s[8]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function pke(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q=Object.entries(o[4]).length>0,F,U,K,L;s=new ske({props:{schema:o[0],sortParam:o[1],sortField:o[2],systemFields:o[9],inModal:o[5],modalUrl:o[6]}}),s.$on("refresh",o[15]);function te(Oe){o[16](Oe)}let ne={systemFields:o[9],operators:o[3],filter:o[4],inModal:o[5],modalUrl:o[6]};o[0]!==void 0&&(ne.schema=o[0]),l=new jCe({props:ne}),Ro.push(()=>er(l,"schema",te)),l.$on("refresh",o[17]);const oe=[hke,dke],G=[];function we(Oe,ce){return Oe[0].type==="collection"?0:1}C=we(o),E=G[C]=oe[C](o);let ve=!o[5]&&zce(o),Re=Q&&Wce(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),en(l.$$.fragment),d=Ze(),h=re("form"),h.innerHTML='<input type="search" name="filter[search_regex]" placeholder="Search" class="form-control" required=""/>',b=Ze(),y=re("div"),E.c(),R=Ze(),ve&&ve.c(),$=Ze(),Re&&Re.c(),F=Rs(),Z(h,"method","GET"),Z(t,"class","d-flex align-items-center"),Z(y,"class","d-flex align-items-center "),Z(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(Oe,ce){Te(Oe,e,ce),X(e,t),Kt(s,t,null),X(t,a),Kt(l,t,null),X(t,d),X(t,h),X(e,b),X(e,y),G[C].m(y,null),X(y,R),ve&&ve.m(y,null),Te(Oe,$,ce),Re&&Re.m(Oe,ce),Te(Oe,F,ce),U=!0,K||(L=mn(h,"submit",o[12]),K=!0)},p(Oe,[ce]){const Xe={};ce&1&&(Xe.schema=Oe[0]),ce&2&&(Xe.sortParam=Oe[1]),ce&4&&(Xe.sortField=Oe[2]),ce&512&&(Xe.systemFields=Oe[9]),ce&32&&(Xe.inModal=Oe[5]),ce&64&&(Xe.modalUrl=Oe[6]),s.$set(Xe);const tt={};ce&512&&(tt.systemFields=Oe[9]),ce&8&&(tt.operators=Oe[3]),ce&16&&(tt.filter=Oe[4]),ce&32&&(tt.inModal=Oe[5]),ce&64&&(tt.modalUrl=Oe[6]),!u&&ce&1&&(u=!0,tt.schema=Oe[0],lr(()=>u=!1)),l.$set(tt);let ot=C;C=we(Oe),C===ot?G[C].p(Oe,ce):(mo(),Be(G[ot],1,1,()=>{G[ot]=null}),go(),E=G[C],E?E.p(Oe,ce):(E=G[C]=oe[C](Oe),E.c()),xe(E,1),E.m(y,R)),Oe[5]?ve&&(mo(),Be(ve,1,1,()=>{ve=null}),go()):ve?(ve.p(Oe,ce),ce&32&&xe(ve,1)):(ve=zce(Oe),ve.c(),xe(ve,1),ve.m(y,null)),ce&16&&(Q=Object.entries(Oe[4]).length>0),Q?Re?(Re.p(Oe,ce),ce&16&&xe(Re,1)):(Re=Wce(Oe),Re.c(),xe(Re,1),Re.m(F.parentNode,F)):Re&&(mo(),Be(Re,1,1,()=>{Re=null}),go())},i(Oe){U||(xe(s.$$.fragment,Oe),xe(l.$$.fragment,Oe),xe(E),xe(ve),xe(Re),U=!0)},o(Oe){Be(s.$$.fragment,Oe),Be(l.$$.fragment,Oe),Be(E),Be(ve),Be(Re),U=!1},d(Oe){Oe&&ke(e),Jt(s),Jt(l),G[C].d(),ve&&ve.d(),Oe&&ke($),Re&&Re.d(Oe),Oe&&ke(F),K=!1,L()}}}function bke(o,e,t){const s=Ur("channel"),a=Fg();let{sortParam:l}=e,{sortField:u}=e,{schema:d}=e,{operators:h}=e,{filter:b}=e,{inModal:y}=e,{modalUrl:C}=e,{isWritable:E}=e,{records:R}=e,{graph:$}=e,{systemFields:Q=[]}=e,F=new URL(window.location.href),U=F.pathname+"/csv?"+F.searchParams.toString();function K(we){we.preventDefault();const ve=new FormData(we.target);let Re=ve.keys().next().value,Oe=ve.values().next().value;const ce=new URL(C!=null?C:window.location.href);ce.searchParams.set("skip","0"),ce.searchParams.set(Re,Oe),y?a("refresh",ce):window.location=ce}function L(we){t(14,R=we.detail)}function te(we){SH.call(this,o,we)}function ne(we){d=we,t(0,d)}function oe(we){SH.call(this,o,we)}function G(we){SH.call(this,o,we)}return o.$$set=we=>{"sortParam"in we&&t(1,l=we.sortParam),"sortField"in we&&t(2,u=we.sortField),"schema"in we&&t(0,d=we.schema),"operators"in we&&t(3,h=we.operators),"filter"in we&&t(4,b=we.filter),"inModal"in we&&t(5,y=we.inModal),"modalUrl"in we&&t(6,C=we.modalUrl),"isWritable"in we&&t(7,E=we.isWritable),"records"in we&&t(14,R=we.records),"graph"in we&&t(8,$=we.graph),"systemFields"in we&&t(9,Q=we.systemFields)},[d,l,u,h,b,y,C,E,$,Q,s,U,K,L,R,te,ne,oe,G]}class vke extends uo{constructor(e){super(),co(this,e,bke,pke,lo,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:14,graph:8,systemFields:9})}}function Yce(o,e,t){const s=o.slice();return s[9]=e[t],s}function Oke(o){let e,t=o[9]+"",s,a,l,u;function d(...h){return o[7](o[9],...h)}return{c(){e=re("a"),s=Ht(t),Z(e,"class","page-link"),Z(e,"href",a=o[2](o[9]))},m(h,b){Te(h,e,b),X(e,s),l||(u=mn(e,"click",d),l=!0)},p(h,b){o=h,b&1&&t!==(t=o[9]+"")&&Fn(s,t),b&1&&a!==(a=o[2](o[9]))&&Z(e,"href",a)},d(h){h&&ke(e),l=!1,u()}}}function yke(o){let e,t=o[9]+"",s;return{c(){e=re("span"),s=Ht(t),Z(e,"class","page-link active")},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&1&&t!==(t=a[9]+"")&&Fn(s,t)},d(a){a&&ke(e)}}}function Xce(o){let e,t;function s(u,d){return u[1]==u[9]?yke:Oke}let a=s(o),l=a(o);return{c(){e=re("li"),l.c(),t=Ze(),Z(e,"class","page-item")},m(u,d){Te(u,e,d),l.m(e,null),X(e,t)},p(u,d){a===(a=s(u))&&l?l.p(u,d):(l.d(1),l=a(u),l&&(l.c(),l.m(e,t)))},d(u){u&&ke(e),l.d()}}}function wke(o){let e,t=o[0],s=[];for(let a=0;a<t.length;a+=1)s[a]=Xce(Yce(o,t,a));return{c(){for(let a=0;a<s.length;a+=1)s[a].c();e=Rs()},m(a,l){for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(a,l);Te(a,e,l)},p(a,[l]){if(l&15){t=a[0];let u;for(u=0;u<t.length;u+=1){const d=Yce(a,t,u);s[u]?s[u].p(d,l):(s[u]=Xce(d),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=t.length}},i:un,o:un,d(a){ia(s,a),a&&ke(e)}}}function _ke(o,e,t){const s=Fg();let{pages:a}=e,{limit:l}=e,{currentPage:u}=e,{inModal:d}=e,{modalUrl:h}=e;function b(E){const R=new URL(h!=null?h:window.location.href);let $=E*l-l;return R.searchParams.set("skip",$),R}function y(E,R){E.preventDefault();const $=new URL(h!=null?h:window.location.href);let Q=R*l-l;$.searchParams.set("skip",Q),d?s("refresh",$):window.location=$}const C=(E,R)=>y(R,E);return o.$$set=E=>{"pages"in E&&t(0,a=E.pages),"limit"in E&&t(4,l=E.limit),"currentPage"in E&&t(1,u=E.currentPage),"inModal"in E&&t(5,d=E.inModal),"modalUrl"in E&&t(6,h=E.modalUrl)},[a,u,b,y,l,d,h,C]}class Ske extends uo{constructor(e){super(),co(this,e,_ke,wke,lo,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function jce(o){let e,t,s,a,l,u,d,h,b,y;return a=new Ske({props:{pages:o[7],currentPage:o[6],limit:o[2],inModal:o[0],modalUrl:o[1]}}),a.$on("refresh",o[10]),{c(){e=re("li"),t=re("a"),t.textContent="First",s=Ze(),en(a.$$.fragment),l=Ze(),u=re("li"),d=re("a"),d.textContent="Last",Z(t,"href","/"),Z(t,"class","page-link"),Z(e,"class","page-item disabled"),Vo(e,"disabled",o[6]===1),Z(d,"class","page-link"),Z(d,"href","/"),Vo(d,"disabled",o[6]===o[5]),Z(u,"class","page-item")},m(C,E){Te(C,e,E),X(e,t),Te(C,s,E),Kt(a,C,E),Te(C,l,E),Te(C,u,E),X(u,d),h=!0,b||(y=[mn(t,"click",o[9]),mn(d,"click",o[8])],b=!0)},p(C,E){(!h||E&64)&&Vo(e,"disabled",C[6]===1);const R={};E&128&&(R.pages=C[7]),E&64&&(R.currentPage=C[6]),E&4&&(R.limit=C[2]),E&1&&(R.inModal=C[0]),E&2&&(R.modalUrl=C[1]),a.$set(R),(!h||E&96)&&Vo(d,"disabled",C[6]===C[5])},i(C){h||(xe(a.$$.fragment,C),h=!0)},o(C){Be(a.$$.fragment,C),h=!1},d(C){C&&ke(e),C&&ke(s),Jt(a,C),C&&ke(l),C&&ke(u),b=!1,vi(y)}}}function Cke(o){let e,t,s,a,l,u,d=+o[3]+1+"",h,b,y,C=(+o[3]+o[2]>o[4]?o[4]:+o[3]+o[2])+"",E,R,$,Q,F,U,K=o[5]>1&&jce(o);return{c(){e=re("nav"),t=re("ul"),K&&K.c(),s=Ze(),a=re("p"),l=Ht(`Showing
|
|
`),u=re("span"),h=Ht(d),b=Ht(`
|
|
to
|
|
`),y=re("span"),E=Ht(C),R=Ht(`
|
|
of
|
|
`),$=re("span"),Q=Ht(o[4]),F=Ht(`
|
|
total`),Z(t,"class","pagination justify-content-center"),Z(u,"class","font-medium"),Z(y,"class","font-medium"),Z($,"class","font-medium"),Z(a,"class","text-muted text-center")},m(L,te){Te(L,e,te),X(e,t),K&&K.m(t,null),Te(L,s,te),Te(L,a,te),X(a,l),X(a,u),X(u,h),X(a,b),X(a,y),X(y,E),X(a,R),X(a,$),X($,Q),X(a,F),U=!0},p(L,[te]){L[5]>1?K?(K.p(L,te),te&32&&xe(K,1)):(K=jce(L),K.c(),xe(K,1),K.m(t,null)):K&&(mo(),Be(K,1,1,()=>{K=null}),go()),(!U||te&8)&&d!==(d=+L[3]+1+"")&&Fn(h,d),(!U||te&28)&&C!==(C=(+L[3]+L[2]>L[4]?L[4]:+L[3]+L[2])+"")&&Fn(E,C),(!U||te&16)&&Fn(Q,L[4])},i(L){U||(xe(K),U=!0)},o(L){Be(K),U=!1},d(L){L&&ke(e),K&&K.d(),L&&ke(s),L&&ke(a)}}}function kke(o,e,t){let s,a,l;const u=Fg();let{inModal:d}=e,{modalUrl:h}=e,{limit:b}=e,{skip:y}=e,{total:C}=e;function E(F){F.preventDefault(),$(s)}function R(F){F.preventDefault(),$(1)}function $(F){const U=new URL(h!=null?h:window.location.href);let K=F*b-b;U.searchParams.set("skip",K),d?u("refresh",U):window.location=U}function Q(F){SH.call(this,o,F)}return o.$$set=F=>{"inModal"in F&&t(0,d=F.inModal),"modalUrl"in F&&t(1,h=F.modalUrl),"limit"in F&&t(2,b=F.limit),"skip"in F&&t(3,y=F.skip),"total"in F&&t(4,C=F.total)},o.$$.update=()=>{o.$$.dirty&20&&t(5,s=Math.ceil(C/b)),o.$$.dirty&12&&t(6,a=Math.ceil((y-1)/b)+1),o.$$.dirty&96&&t(7,l=Lc.exports.range(a-3,a+4).filter(F=>F>0&&F<=s))},[d,h,b,y,C,s,a,l,E,R,Q]}class xke extends uo{constructor(e){super(),co(this,e,kke,Cke,lo,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function Tke(o){let e,t,s;return{c(){e=re("button"),e.textContent="Move to trash",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",ku(o[9])),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function Eke(o){let e,t,s,a,l,u,d=o[1].hasDrafts&&qce(o);return{c(){e=re("button"),e.textContent="Publish",t=Ze(),d&&d.c(),s=Ze(),a=re("button"),a.textContent="Delete forever",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary"),Z(a,"type","button"),Z(a,"class","btn btn-sm btn-outline-primary")},m(h,b){Te(h,e,b),Te(h,t,b),d&&d.m(h,b),Te(h,s,b),Te(h,a,b),l||(u=[mn(e,"click",ku(o[7])),mn(a,"click",ku(o[3]))],l=!0)},p(h,b){h[1].hasDrafts?d?d.p(h,b):(d=qce(h),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(h){h&&ke(e),h&&ke(t),d&&d.d(h),h&&ke(s),h&&ke(a),l=!1,vi(u)}}}function qce(o){let e,t,s;return{c(){e=re("button"),e.textContent="Make Draft",Z(e,"type","button"),Z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",ku(o[8])),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function Ake(o){let e,t,s=o[0].length+"",a,l,u,d,h,b,y,C,E,R;function $(U,K){return U[2].status_in==="trashed"?Eke:Tke}let Q=$(o),F=Q(o);return{c(){e=re("div"),t=re("span"),a=Ht(s),l=Ht(" records selected"),u=Ze(),d=re("div"),h=re("button"),h.textContent="Publish",b=Ze(),y=re("button"),y.textContent="Make Draft",C=Ze(),F.c(),Z(t,"class","me-2"),Z(h,"type","button"),Z(h,"class","btn btn-sm btn-outline-primary"),Z(y,"type","button"),Z(y,"class","btn btn-sm btn-outline-primary"),Z(d,"class","btn-group "),Z(d,"role","group"),Z(d,"aria-label","Basic example"),Z(e,"class","d-flex align-items-center mb-3")},m(U,K){Te(U,e,K),X(e,t),X(t,a),X(t,l),X(e,u),X(e,d),X(d,h),X(d,b),X(d,y),X(d,C),F.m(d,null),E||(R=[mn(h,"click",ku(o[5])),mn(y,"click",ku(o[6]))],E=!0)},p(U,[K]){K&1&&s!==(s=U[0].length+"")&&Fn(a,s),Q===(Q=$(U))&&F?F.p(U,K):(F.d(1),F=Q(U),F&&(F.c(),F.m(d,null)))},i:un,o:un,d(U){U&&ke(e),F.d(),E=!1,vi(R)}}}function Dke(o,e,t){const s=Ur("channel");let{selected:a}=e,{schema:l}=e,{filter:u}=e;function d($){$.preventDefault(),axios.post(s.lucentUrl+"/records/delete",{ids:a.map(Q=>Q.id)}).then(Q=>{window.location.reload()}).catch(Q=>{console.log(Q)})}function h($,Q){axios.post(s.lucentUrl+"/records/status/"+Q,{schemaName:l.name,records:a}).then(F=>{window.location.reload()}).catch(F=>{console.log(F)})}const b=$=>h($,"published"),y=$=>h($,"draft"),C=$=>h($,"published"),E=$=>h($,"draft"),R=$=>h($,"trashed");return o.$$set=$=>{"selected"in $&&t(0,a=$.selected),"schema"in $&&t(1,l=$.schema),"filter"in $&&t(2,u=$.filter)},[a,l,u,d,h,b,y,C,E,R]}class Pke extends uo{constructor(e){super(),co(this,e,Dke,Ake,lo,{selected:0,schema:1,filter:2})}}function Mke(o){let e;return{c(){e=Ht(o[0])},m(t,s){Te(t,e,s)},p(t,[s]){s&1&&Fn(e,t[0])},i:un,o:un,d(t){t&&ke(e)}}}function Rke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class $ke extends uo{constructor(e){super(),co(this,e,Rke,Mke,lo,{value:0})}}function Gce(o){let e,t,s,a;return{c(){e=re("div"),t=re("span"),s=Ze(),a=Ht(o[0]),Z(t,"class","color border border-2 svelte-78o2k4"),rs(t,"background",o[0]),Z(e,"class","d-inline-flex")},m(l,u){Te(l,e,u),X(e,t),X(e,s),X(e,a)},p(l,u){u&1&&rs(t,"background",l[0]),u&1&&Fn(a,l[0])},d(l){l&&ke(e)}}}function Nke(o){let e,t=o[0]&&Gce(o);return{c(){t&&t.c(),e=Rs()},m(s,a){t&&t.m(s,a),Te(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Gce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:un,o:un,d(s){t&&t.d(s),s&&ke(e)}}}function Ike(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Bke extends uo{constructor(e){super(),co(this,e,Ike,Nke,lo,{value:0})}}function Kce(o,e,t){const s=o.slice();return s[5]=e[t],s}function Jce(o){let e,t,s,a;return t=new G6({props:{schemas:o[0],graph:o[1],record:o[5]}}),{c(){e=re("span"),en(t.$$.fragment),s=Ze(),Z(e,"class","mr-3")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p(l,u){const d={};u&1&&(d.schemas=l[0]),u&2&&(d.graph=l[1]),u&4&&(d.record=l[5]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function Lke(o){let e,t,s=o[2],a=[];for(let u=0;u<s.length;u+=1)a[u]=Jce(Kce(o,s,u));const l=u=>Be(a[u],1,1,()=>{a[u]=null});return{c(){e=re("div");for(let u=0;u<a.length;u+=1)a[u].c();Z(e,"class","references svelte-15ilpfz")},m(u,d){Te(u,e,d);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(e,null);t=!0},p(u,[d]){if(d&7){s=u[2];let h;for(h=0;h<s.length;h+=1){const b=Kce(u,s,h);a[h]?(a[h].p(b,d),xe(a[h],1)):(a[h]=Jce(b),a[h].c(),xe(a[h],1),a[h].m(e,null))}for(mo(),h=s.length;h<a.length;h+=1)l(h);go()}},i(u){if(!t){for(let d=0;d<s.length;d+=1)xe(a[d]);t=!0}},o(u){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)Be(a[d]);t=!1},d(u){u&&ke(e),ia(a,u)}}}function Fke(o,e,t){let s,{record:a}=e,{field:l}=e,{schemas:u}=e,{graph:d}=e;return o.$$set=h=>{"record"in h&&t(3,a=h.record),"field"in h&&t(4,l=h.field),"schemas"in h&&t(0,u=h.schemas),"graph"in h&&t(1,d=h.graph)},o.$$.update=()=>{var h,b;o.$$.dirty&26&&t(2,s=(b=(h=d.edges)==null?void 0:h.filter(y=>y.field===l.name&&y.source===a.id).map(y=>d.records.find(C=>C.id===y.target)).filter(y=>!!y))!=null?b:[])},[u,d,s,a,l]}class jpe extends uo{constructor(e){super(),co(this,e,Fke,Lke,lo,{record:3,field:4,schemas:0,graph:1})}}function Qke(o){let e;return{c(){e=Ht(o[0])},m(t,s){Te(t,e,s)},p(t,[s]){s&1&&Fn(e,t[0])},i:un,o:un,d(t){t&&ke(e)}}}function Zke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Hke extends uo{constructor(e){super(),co(this,e,Zke,Qke,lo,{value:0})}}function zke(o){let e,t;return{c(){e=re("div"),t=Ht(o[0]),Z(e,"title",o[0]),Z(e,"data-bs-toggle","tooltip"),Z(e,"data-bs-placement","top"),Z(e,"class","svelte-1ft053t")},m(s,a){Te(s,e,a),X(e,t)},p(s,[a]){a&1&&Fn(t,s[0]),a&1&&Z(e,"title",s[0])},i:un,o:un,d(s){s&&ke(e)}}}function Vke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class vne extends uo{constructor(e){super(),co(this,e,Vke,zke,lo,{value:0})}}function Wke(o){let e,t;return{c(){e=re("a"),t=Ht(o[0]),Z(e,"href",o[0]),Z(e,"target","_blank")},m(s,a){Te(s,e,a),X(e,t)},p(s,[a]){a&1&&Fn(t,s[0]),a&1&&Z(e,"href",s[0])},i:un,o:un,d(s){s&&ke(e)}}}function Uke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Yke extends uo{constructor(e){super(),co(this,e,Uke,Wke,lo,{value:0})}}function Xke(o){let e,t;return{c(){e=re("div"),t=Ht(o[0]),Z(e,"title",o[0]),Z(e,"data-bs-toggle","tooltip"),Z(e,"data-bs-placement","top")},m(s,a){Te(s,e,a),X(e,t)},p(s,[a]){a&1&&Fn(t,s[0]),a&1&&Z(e,"title",s[0])},i:un,o:un,d(s){s&&ke(e)}}}function jke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class qke extends uo{constructor(e){super(),co(this,e,jke,Xke,lo,{value:0})}}function Gke(o){let e,t=Zle(o[0])+"",s,a;return{c(){e=re("div"),s=Ht(t),Z(e,"title",a=Hle(o[0])),Z(e,"data-bs-toggle","tooltip"),Z(e,"data-bs-placement","top")},m(l,u){Te(l,e,u),X(e,s)},p(l,[u]){u&1&&t!==(t=Zle(l[0])+"")&&Fn(s,t),u&1&&a!==(a=Hle(l[0]))&&Z(e,"title",a)},i:un,o:un,d(l){l&&ke(e)}}}function Kke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Jke extends uo{constructor(e){super(),co(this,e,Kke,Gke,lo,{value:0})}}function eue(o,e,t){const s=o.slice();return s[4]=e[t],s}function tue(o){let e,t,s,a;return t=new Xw({props:{record:o[4],size:"tiny"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),Z(e,"class","me-1")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p:un,i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function exe(o){let e,t,s=o[0],a=[];for(let u=0;u<s.length;u+=1)a[u]=tue(eue(o,s,u));const l=u=>Be(a[u],1,1,()=>{a[u]=null});return{c(){e=re("div");for(let u=0;u<a.length;u+=1)a[u].c();Z(e,"class","d-flex me-1")},m(u,d){Te(u,e,d);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(e,null);t=!0},p(u,[d]){if(d&1){s=u[0];let h;for(h=0;h<s.length;h+=1){const b=eue(u,s,h);a[h]?(a[h].p(b,d),xe(a[h],1)):(a[h]=tue(b),a[h].c(),xe(a[h],1),a[h].m(e,null))}for(mo(),h=s.length;h<a.length;h+=1)l(h);go()}},i(u){if(!t){for(let d=0;d<s.length;d+=1)xe(a[d]);t=!0}},o(u){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)Be(a[d]);t=!1},d(u){u&&ke(e),ia(a,u)}}}function txe(o,e,t){var d;let{record:s}=e,{field:a}=e,{graph:l}=e,u=(d=l.edges)==null?void 0:d.filter(h=>h.field===a.name&&h.source===s.id).map(h=>l.records.find(b=>b.id===h.target));return console.log(u),o.$$set=h=>{"record"in h&&t(1,s=h.record),"field"in h&&t(2,a=h.field),"graph"in h&&t(3,l=h.graph)},[u,s,a,l]}class qpe extends uo{constructor(e){super(),co(this,e,txe,exe,lo,{record:1,field:2,graph:3})}}function nxe(o){let e,t;return{c(){e=re("span"),t=Ht(o[0]),Z(e,"class","badge rounded-pill bg-primary bg-opacity-75"),rs(e,"max-width","64px"),rs(e,"overflow","hidden"),rs(e,"white-space","nowrap"),rs(e,"text-overflow","ellipsis"),Z(e,"title",o[0]),Z(e,"data-bs-toggle","tooltip")},m(s,a){Te(s,e,a),X(e,t)},p(s,[a]){a&1&&Fn(t,s[0]),a&1&&Z(e,"title",s[0])},i:un,o:un,d(s){s&&ke(e)}}}function oxe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class sxe extends uo{constructor(e){super(),co(this,e,oxe,nxe,lo,{value:0})}}function rxe(o){let e,t;return{c(){e=re("div"),t=Ht(o[0]),Z(e,"class","svelte-1ft053t")},m(s,a){Te(s,e,a),X(e,t)},p(s,[a]){a&1&&Fn(t,s[0])},i:un,o:un,d(s){s&&ke(e)}}}function ixe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class axe extends uo{constructor(e){super(),co(this,e,ixe,rxe,lo,{value:0})}}function lxe(o){let e,t,s;var a=o[4][o[0].info.name];function l(u){return{props:{value:u[2].data[u[0].name],record:u[2],graph:u[3],schema:u[1],field:u[0]}}}return a&&(e=EC(a,l(o))),{c(){e&&en(e.$$.fragment),t=Rs()},m(u,d){e&&Kt(e,u,d),Te(u,t,d),s=!0},p(u,[d]){const h={};if(d&5&&(h.value=u[2].data[u[0].name]),d&4&&(h.record=u[2]),d&8&&(h.graph=u[3]),d&2&&(h.schema=u[1]),d&1&&(h.field=u[0]),d&1&&a!==(a=u[4][u[0].info.name])){if(e){mo();const b=e;Be(b.$$.fragment,1,0,()=>{Jt(b,1)}),go()}a?(e=EC(a,l(u)),en(e.$$.fragment),xe(e.$$.fragment,1),Kt(e,t.parentNode,t)):e=null}else a&&e.$set(h)},i(u){s||(e&&xe(e.$$.fragment,u),s=!0)},o(u){e&&Be(e.$$.fragment,u),s=!1},d(u){u&&ke(t),e&&Jt(e,u)}}}function cxe(o,e,t){const s={text:vne,slug:vne,rich:axe,textarea:vne,color:Bke,checkbox:$ke,reference:jpe,number:Hke,url:Yke,date:qke,datetime:Jke,uuid:sxe,file:qpe};let{field:a}=e,{schema:l}=e,{record:u}=e,{graph:d}=e;return o.$$set=h=>{"field"in h&&t(0,a=h.field),"schema"in h&&t(1,l=h.schema),"record"in h&&t(2,u=h.record),"graph"in h&&t(3,d=h.graph)},[a,l,u,d,s]}class Gpe extends uo{constructor(e){super(),co(this,e,cxe,lxe,lo,{field:0,schema:1,record:2,graph:3})}}function Lp(o,e){var t,s;return o&&(s=(t=o.find(a=>a.id===e))==null?void 0:t.name)!=null?s:e}function nue(o,e,t){const s=o.slice();return s[7]=e[t],s[9]=t,s}function oue(o){let e,t,s,a;return t=new Gpe({props:{record:o[3],schema:o[0],graph:o[2],field:o[7]}}),{c(){e=re("td"),en(t.$$.fragment),Z(e,"class",s="field-ui-"+o[7].info.name),Vo(e,"is-sort",o[7].name===o[5].name)},m(l,u){Te(l,e,u),Kt(t,e,null),a=!0},p(l,u){const d={};u&8&&(d.record=l[3]),u&1&&(d.schema=l[0]),u&4&&(d.graph=l[2]),u&64&&(d.field=l[7]),t.$set(d),(!a||u&64&&s!==(s="field-ui-"+l[7].info.name))&&Z(e,"class",s),(!a||u&96)&&Vo(e,"is-sort",l[7].name===l[5].name)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function sue(o){let e,t,s;return t=new ire({props:{status:o[3].status}}),{c(){e=re("td"),en(t.$$.fragment),Z(e,"class","text-center"),Vo(e,"is-sort",o[4]=="-status"||o[4]=="status")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&8&&(u.status=a[3].status),t.$set(u),(!s||l&16)&&Vo(e,"is-sort",a[4]=="-status"||a[4]=="status")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function rue(o){let e,t,s;return t=new vy({props:{name:Lp(o[1],o[3]._sys.createdBy),side:24}}),{c(){e=re("td"),en(t.$$.fragment),Z(e,"class","text-center"),Vo(e,"is-sort",o[4]=="-_sys.createdBy"||o[4]=="_sys.createdBy")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&10&&(u.name=Lp(a[1],a[3]._sys.createdBy)),t.$set(u),(!s||l&16)&&Vo(e,"is-sort",a[4]=="-_sys.createdBy"||a[4]=="_sys.createdBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function iue(o){let e,t,s;return t=new vy({props:{name:Lp(o[1],o[3]._sys.updatedBy),side:24}}),{c(){e=re("td"),en(t.$$.fragment),Z(e,"class","text-center"),Vo(e,"is-sort",o[4]=="-_sys.updatedBy"||o[4]=="_sys.updatedBy")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&10&&(u.name=Lp(a[1],a[3]._sys.updatedBy)),t.$set(u),(!s||l&16)&&Vo(e,"is-sort",a[4]=="-_sys.updatedBy"||a[4]=="_sys.updatedBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function aue(o){let e,t=cy(o[3]._sys.createdAt)+"",s;return{c(){e=re("td"),s=Ht(t),Vo(e,"is-sort",o[4]=="-_sys.createdAt"||o[4]=="_sys.createdAt")},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.createdAt)+"")&&Fn(s,t),l&16&&Vo(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&ke(e)}}}function lue(o){let e,t=cy(o[3]._sys.updatedAt)+"",s;return{c(){e=re("td"),s=Ht(t),Vo(e,"is-sort",o[4]=="-_sys.updatedAt"||o[4]=="_sys.updatedAt")},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.updatedAt)+"")&&Fn(s,t),l&16&&Vo(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&ke(e)}}}function uxe(o){let e,t=o[0].visible.includes("status"),s,a=o[0].visible.includes("_sys.createdBy"),l,u=o[0].visible.includes("_sys.updatedBy"),d,h=o[0].visible.includes("_sys.createdAt"),b,y=o[0].visible.includes("_sys.updatedAt"),C,E,R=o[6],$=[];for(let ne=0;ne<R.length;ne+=1)$[ne]=oue(nue(o,R,ne));const Q=ne=>Be($[ne],1,1,()=>{$[ne]=null});let F=t&&sue(o),U=a&&rue(o),K=u&&iue(o),L=h&&aue(o),te=y&&lue(o);return{c(){for(let ne=0;ne<$.length;ne+=1)$[ne].c();e=Ze(),F&&F.c(),s=Ze(),U&&U.c(),l=Ze(),K&&K.c(),d=Ze(),L&&L.c(),b=Ze(),te&&te.c(),C=Rs()},m(ne,oe){for(let G=0;G<$.length;G+=1)$[G]&&$[G].m(ne,oe);Te(ne,e,oe),F&&F.m(ne,oe),Te(ne,s,oe),U&&U.m(ne,oe),Te(ne,l,oe),K&&K.m(ne,oe),Te(ne,d,oe),L&&L.m(ne,oe),Te(ne,b,oe),te&&te.m(ne,oe),Te(ne,C,oe),E=!0},p(ne,[oe]){if(oe&109){R=ne[6];let G;for(G=0;G<R.length;G+=1){const we=nue(ne,R,G);$[G]?($[G].p(we,oe),xe($[G],1)):($[G]=oue(we),$[G].c(),xe($[G],1),$[G].m(e.parentNode,e))}for(mo(),G=R.length;G<$.length;G+=1)Q(G);go()}oe&1&&(t=ne[0].visible.includes("status")),t?F?(F.p(ne,oe),oe&1&&xe(F,1)):(F=sue(ne),F.c(),xe(F,1),F.m(s.parentNode,s)):F&&(mo(),Be(F,1,1,()=>{F=null}),go()),oe&1&&(a=ne[0].visible.includes("_sys.createdBy")),a?U?(U.p(ne,oe),oe&1&&xe(U,1)):(U=rue(ne),U.c(),xe(U,1),U.m(l.parentNode,l)):U&&(mo(),Be(U,1,1,()=>{U=null}),go()),oe&1&&(u=ne[0].visible.includes("_sys.updatedBy")),u?K?(K.p(ne,oe),oe&1&&xe(K,1)):(K=iue(ne),K.c(),xe(K,1),K.m(d.parentNode,d)):K&&(mo(),Be(K,1,1,()=>{K=null}),go()),oe&1&&(h=ne[0].visible.includes("_sys.createdAt")),h?L?L.p(ne,oe):(L=aue(ne),L.c(),L.m(b.parentNode,b)):L&&(L.d(1),L=null),oe&1&&(y=ne[0].visible.includes("_sys.updatedAt")),y?te?te.p(ne,oe):(te=lue(ne),te.c(),te.m(C.parentNode,C)):te&&(te.d(1),te=null)},i(ne){if(!E){for(let oe=0;oe<R.length;oe+=1)xe($[oe]);xe(F),xe(U),xe(K),E=!0}},o(ne){$=$.filter(Boolean);for(let oe=0;oe<$.length;oe+=1)Be($[oe]);Be(F),Be(U),Be(K),E=!1},d(ne){ia($,ne),ne&&ke(e),F&&F.d(ne),ne&&ke(s),U&&U.d(ne),ne&&ke(l),K&&K.d(ne),ne&&ke(d),L&&L.d(ne),ne&&ke(b),te&&te.d(ne),ne&&ke(C)}}}function fxe(o,e,t){let{schema:s}=e,{users:a}=e,{graph:l}=e,{record:u}=e,{sortParam:d}=e,{sortField:h}=e,{visibleColumns:b}=e;return o.$$set=y=>{"schema"in y&&t(0,s=y.schema),"users"in y&&t(1,a=y.users),"graph"in y&&t(2,l=y.graph),"record"in y&&t(3,u=y.record),"sortParam"in y&&t(4,d=y.sortParam),"sortField"in y&&t(5,h=y.sortField),"visibleColumns"in y&&t(6,b=y.visibleColumns)},[s,a,l,u,d,h,b]}class dxe extends uo{constructor(e){super(),co(this,e,fxe,uxe,lo,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}}const hxe=(o,e,t)=>t.length===e.length?[]:(o.currentTarget.checked=t.length>0,e),Kpe=(o,e)=>e.find(s=>s.id===o.id)?e.filter(s=>s.id!==o.id):[...e,o];function cue(o,e,t){const s=o.slice();return s[17]=e[t],s}function uue(o,e,t){const s=o.slice();return s[20]=e[t],s}function fue(o,e,t){const s=o.slice();return s[23]=e[t],s}function due(o){let e,t,s,a,l,u;return{c(){e=re("th"),t=re("input"),t.indeterminate=s=o[0].length>0&&o[0].length<o[3].length,t.checked=a=o[0].length==o[3].length,Z(t,"class","form-check-input"),Z(t,"type","checkbox")},m(d,h){Te(d,e,h),X(e,t),l||(u=mn(t,"change",ku(o[12])),l=!0)},p(d,h){h&9&&s!==(s=d[0].length>0&&d[0].length<d[3].length)&&(t.indeterminate=s),h&9&&a!==(a=d[0].length==d[3].length)&&(t.checked=a)},d(d){d&&ke(e),l=!1,u()}}}function hue(o){let e,t=o[23].label+"",s,a,l;return{c(){var u;e=re("th"),s=Ht(t),Z(e,"class",a="field-ui-"+((u=o[23].info.name)!=null?u:o[23].ui)),Z(e,"scope","col"),Z(e,"title",l=o[23].help),Z(e,"data-bs-toggle","tooltip"),Z(e,"data-bs-placement","top"),Vo(e,"is-sort",o[23].name===o[7].name)},m(u,d){Te(u,e,d),X(e,s)},p(u,d){var h;d&1024&&t!==(t=u[23].label+"")&&Fn(s,t),d&1024&&a!==(a="field-ui-"+((h=u[23].info.name)!=null?h:u[23].ui))&&Z(e,"class",a),d&1024&&l!==(l=u[23].help)&&Z(e,"title",l),d&1152&&Vo(e,"is-sort",u[23].name===u[7].name)},d(u){u&&ke(e)}}}function mue(o){let e,t=o[20].label+"",s;return{c(){e=re("th"),s=Ht(t)},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&34&&t!==(t=a[20].label+"")&&Fn(s,t)},d(a){a&&ke(e)}}}function gue(o){let e,t,s,a,l,u;function d(...b){return o[15](o[17],...b)}function h(){return o[16](o[17])}return{c(){e=re("div"),t=re("input"),Z(t,"class","form-check-input "),Z(t,"type","checkbox"),t.checked=s=o[0].find(d),t.value=a=o[17],Z(e,"class","form-check")},m(b,y){Te(b,e,y),X(e,t),l||(u=mn(t,"change",h),l=!0)},p(b,y){o=b,y&9&&s!==(s=o[0].find(d))&&(t.checked=s),y&8&&a!==(a=o[17])&&(t.value=a)},d(b){b&&ke(e),l=!1,u()}}}function pue(o,e){let t,s,a,l,u,d,h=qu(e[11].schemas,e[17],e[4])+"",b,y,C,E,R,$,Q,F,U,K,L,te=e[9]&&gue(e);return Q=new vy({props:{name:Lp(e[2],e[17]._sys.updatedBy),side:24}}),U=new dxe({props:{record:e[17],graph:e[4],schema:e[1],visibleColumns:e[10],sortParam:e[6],sortField:e[7],users:e[2]}}),{key:o,first:null,c(){t=re("tr"),s=re("td"),a=re("div"),l=re("div"),te&&te.c(),u=Ze(),d=re("a"),b=Ht(h),R=Ze(),$=re("div"),en(Q.$$.fragment),F=Ze(),en(U.$$.fragment),K=Ze(),Z(d,"class","me-2 text-decoration-none text-dark fs-6"),Z(d,"href",y=e[11].lucentUrl+"/records/"+e[17].id),Z(d,"target",C=e[8]?"_blank":"_self"),Z(d,"title",E=qu(e[11].schemas,e[17],e[4])),Z(d,"data-bs-toggle","tooltip"),Z(d,"data-bs-placement","left"),Z(l,"class","d-flex align-items-center "),Z(a,"class","title-td-contents d-inline-flex justify-content-between w-100 align-items-center"),Z(s,"class","title-td"),this.first=t},m(ne,oe){Te(ne,t,oe),X(t,s),X(s,a),X(a,l),te&&te.m(l,null),X(l,u),X(l,d),X(d,b),X(a,R),X(a,$),Kt(Q,$,null),X(t,F),Kt(U,t,null),X(t,K),L=!0},p(ne,oe){e=ne,e[9]?te?te.p(e,oe):(te=gue(e),te.c(),te.m(l,u)):te&&(te.d(1),te=null),(!L||oe&24)&&h!==(h=qu(e[11].schemas,e[17],e[4])+"")&&Fn(b,h),(!L||oe&8&&y!==(y=e[11].lucentUrl+"/records/"+e[17].id))&&Z(d,"href",y),(!L||oe&256&&C!==(C=e[8]?"_blank":"_self"))&&Z(d,"target",C),(!L||oe&24&&E!==(E=qu(e[11].schemas,e[17],e[4])))&&Z(d,"title",E);const G={};oe&12&&(G.name=Lp(e[2],e[17]._sys.updatedBy)),Q.$set(G);const we={};oe&8&&(we.record=e[17]),oe&16&&(we.graph=e[4]),oe&2&&(we.schema=e[1]),oe&1024&&(we.visibleColumns=e[10]),oe&64&&(we.sortParam=e[6]),oe&128&&(we.sortField=e[7]),oe&4&&(we.users=e[2]),U.$set(we)},i(ne){L||(xe(Q.$$.fragment,ne),xe(U.$$.fragment,ne),L=!0)},o(ne){Be(Q.$$.fragment,ne),Be(U.$$.fragment,ne),L=!1},d(ne){ne&&ke(t),te&&te.d(),Jt(Q),Jt(U)}}}function mxe(o){let e,t,s,a,l,u,d,h,b=[],y=new Map,C,E=o[9]&&due(o),R=o[10],$=[];for(let L=0;L<R.length;L+=1)$[L]=hue(fue(o,R,L));let Q=o[5].filter(o[14]),F=[];for(let L=0;L<Q.length;L+=1)F[L]=mue(uue(o,Q,L));let U=o[3];const K=L=>L[17].id;for(let L=0;L<U.length;L+=1){let te=cue(o,U,L),ne=K(te);y.set(ne,b[L]=pue(ne,te))}return{c(){e=re("div"),t=re("table"),s=re("thead"),a=re("tr"),E&&E.c(),l=Ze();for(let L=0;L<$.length;L+=1)$[L].c();u=Ze();for(let L=0;L<F.length;L+=1)F[L].c();d=Ze(),h=re("tbody");for(let L=0;L<b.length;L+=1)b[L].c();Z(s,"class","table-light"),Z(t,"class",""),Z(e,"class","lx-table rounded")},m(L,te){Te(L,e,te),X(e,t),X(t,s),X(s,a),E&&E.m(a,null),X(a,l);for(let ne=0;ne<$.length;ne+=1)$[ne]&&$[ne].m(a,null);X(a,u);for(let ne=0;ne<F.length;ne+=1)F[ne]&&F[ne].m(a,null);X(t,d),X(t,h);for(let ne=0;ne<b.length;ne+=1)b[ne]&&b[ne].m(h,null);C=!0},p(L,[te]){if(L[9]?E?E.p(L,te):(E=due(L),E.c(),E.m(a,l)):E&&(E.d(1),E=null),te&1152){R=L[10];let ne;for(ne=0;ne<R.length;ne+=1){const oe=fue(L,R,ne);$[ne]?$[ne].p(oe,te):($[ne]=hue(oe),$[ne].c(),$[ne].m(a,u))}for(;ne<$.length;ne+=1)$[ne].d(1);$.length=R.length}if(te&34){Q=L[5].filter(L[14]);let ne;for(ne=0;ne<Q.length;ne+=1){const oe=uue(L,Q,ne);F[ne]?F[ne].p(oe,te):(F[ne]=mue(oe),F[ne].c(),F[ne].m(a,null))}for(;ne<F.length;ne+=1)F[ne].d(1);F.length=Q.length}te&12255&&(U=L[3],mo(),b=Jd(b,te,K,1,L,U,y,h,xv,pue,null,cue),go())},i(L){if(!C){for(let te=0;te<U.length;te+=1)xe(b[te]);C=!0}},o(L){for(let te=0;te<b.length;te+=1)Be(b[te]);C=!1},d(L){L&&ke(e),E&&E.d(),ia($,L),ia(F,L);for(let te=0;te<b.length;te+=1)b[te].d()}}}function gxe(o,e,t){let s;const a=Ur("channel");let{schema:l}=e,{users:u}=e,{records:d}=e,{graph:h}=e,{systemFields:b}=e,{sortParam:y}=e,{sortField:C}=e,{inModal:E}=e,{isWritable:R}=e,{selected:$=[]}=e;function Q(te){t(0,$=hxe(te,d,$))}function F(te){t(0,$=Kpe(te,$))}const U=te=>l.visible.includes(te.name),K=(te,ne)=>ne.id===te.id,L=te=>F(te);return o.$$set=te=>{"schema"in te&&t(1,l=te.schema),"users"in te&&t(2,u=te.users),"records"in te&&t(3,d=te.records),"graph"in te&&t(4,h=te.graph),"systemFields"in te&&t(5,b=te.systemFields),"sortParam"in te&&t(6,y=te.sortParam),"sortField"in te&&t(7,C=te.sortField),"inModal"in te&&t(8,E=te.inModal),"isWritable"in te&&t(9,R=te.isWritable),"selected"in te&&t(0,$=te.selected)},o.$$.update=()=>{o.$$.dirty&2&&t(10,s=l.fields.filter(te=>l.visible.includes(te.name)))},[$,l,u,d,h,b,y,C,E,R,s,a,Q,F,U,K,L]}class pxe extends uo{constructor(e){super(),co(this,e,gxe,mxe,lo,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}}function bue(o,e,t){const s=o.slice();return s[8]=e[t],s}function vue(o){let e,t,s,a,l,u;function d(...b){return o[6](o[8],...b)}function h(){return o[7](o[8])}return{c(){e=re("div"),t=re("input"),Z(t,"class","form-check-input "),Z(t,"type","checkbox"),t.checked=s=o[0].find(d),t.value=a=o[8],Z(e,"class","form-check svelte-1xyvs2b")},m(b,y){Te(b,e,y),X(e,t),l||(u=mn(t,"change",h),l=!0)},p(b,y){o=b,y&3&&s!==(s=o[0].find(d))&&(t.checked=s),y&2&&a!==(a=o[8])&&(t.value=a)},d(b){b&&ke(e),l=!1,u()}}}function Oue(o,e){let t,s,a,l,u,d,h,b=e[8]._file.path+"",y,C,E,R,$,Q=e[8]._file.mime+"",F,U,K,L=e[2]&&vue(e);return u=new Xw({props:{record:e[8],size:"medium"}}),{key:o,first:null,c(){t=re("div"),s=re("div"),L&&L.c(),a=Ze(),l=re("div"),en(u.$$.fragment),d=Ze(),h=re("a"),y=Ht(b),R=Ze(),$=re("span"),F=Ht(Q),U=Ze(),Z(l,"class","d-flex justify-content-center"),Z(h,"href",C=e[3].lucentUrl+"/records/"+e[8].id),Z(h,"title",E=e[8]._file.path),Z(h,"class","d-block text-center overflow-hidden text-nowrap my-2 "),rs(h,"text-overflow","ellipsis"),rs(h,"font-size","13px"),rs(h,"color","#333"),Z($,"class","lx-small-text text-muted d-block text-center"),Z(s,"class","file-wrapper rounded p-2 mb-4 bg-light"),Vo(s,"selected",e[0].includes(e[8])),Z(t,"class","col-6 col-md-4"),this.first=t},m(te,ne){Te(te,t,ne),X(t,s),L&&L.m(s,null),X(s,a),X(s,l),Kt(u,l,null),X(s,d),X(s,h),X(h,y),X(s,R),X(s,$),X($,F),X(t,U),K=!0},p(te,ne){e=te,e[2]?L?L.p(e,ne):(L=vue(e),L.c(),L.m(s,a)):L&&(L.d(1),L=null);const oe={};ne&2&&(oe.record=e[8]),u.$set(oe),(!K||ne&2)&&b!==(b=e[8]._file.path+"")&&Fn(y,b),(!K||ne&2&&C!==(C=e[3].lucentUrl+"/records/"+e[8].id))&&Z(h,"href",C),(!K||ne&2&&E!==(E=e[8]._file.path))&&Z(h,"title",E),(!K||ne&2)&&Q!==(Q=e[8]._file.mime+"")&&Fn(F,Q),(!K||ne&3)&&Vo(s,"selected",e[0].includes(e[8]))},i(te){K||(xe(u.$$.fragment,te),K=!0)},o(te){Be(u.$$.fragment,te),K=!1},d(te){te&&ke(t),L&&L.d(),Jt(u)}}}function bxe(o){let e,t=[],s=new Map,a,l=o[1];const u=d=>d[8].id;for(let d=0;d<l.length;d+=1){let h=bue(o,l,d),b=u(h);s.set(b,t[d]=Oue(b,h))}return{c(){e=re("div");for(let d=0;d<t.length;d+=1)t[d].c();Z(e,"class","row"),rs(e,"max-width","1000px")},m(d,h){Te(d,e,h);for(let b=0;b<t.length;b+=1)t[b]&&t[b].m(e,null);a=!0},p(d,[h]){h&31&&(l=d[1],mo(),t=Jd(t,h,u,1,d,l,s,e,xv,Oue,null,bue),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(t[h]);a=!0}},o(d){for(let h=0;h<t.length;h+=1)Be(t[h]);a=!1},d(d){d&&ke(e);for(let h=0;h<t.length;h+=1)t[h].d()}}}function vxe(o,e,t){const s=Ur("channel");let{schema:a}=e,{records:l}=e,{isWritable:u}=e,{selected:d=[]}=e;function h(C){t(0,d=Kpe(C,d))}const b=(C,E)=>E.id===C.id,y=C=>h(C);return o.$$set=C=>{"schema"in C&&t(5,a=C.schema),"records"in C&&t(1,l=C.records),"isWritable"in C&&t(2,u=C.isWritable),"selected"in C&&t(0,d=C.selected)},[d,l,u,s,h,a,b,y]}class Oxe extends uo{constructor(e){super(),co(this,e,vxe,bxe,lo,{schema:5,records:1,isWritable:2,selected:0})}}function yxe(o){let e,t,s,a;function l(h){o[17](h)}function u(h){o[18](h)}let d={systemFields:o[13],sortParam:o[2],sortField:o[3],operators:o[4],filter:o[5],graph:o[12],inModal:o[14],modalUrl:o[9],isWritable:o[15]};return o[0]!==void 0&&(d.schema=o[0]),o[1]!==void 0&&(d.records=o[1]),e=new vke({props:d}),Ro.push(()=>er(e,"schema",l)),Ro.push(()=>er(e,"records",u)),e.$on("refresh",o[16]),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&8192&&(y.systemFields=h[13]),b&4&&(y.sortParam=h[2]),b&8&&(y.sortField=h[3]),b&16&&(y.operators=h[4]),b&32&&(y.filter=h[5]),b&4096&&(y.graph=h[12]),b&16384&&(y.inModal=h[14]),b&512&&(y.modalUrl=h[9]),b&32768&&(y.isWritable=h[15]),!t&&b&1&&(t=!0,y.schema=h[0],lr(()=>t=!1)),!s&&b&2&&(s=!0,y.records=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function wxe(o){let e,t;return e=new Pke({props:{schema:o[0],selected:o[10],filter:o[5]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.schema=s[0]),a&1024&&(l.selected=s[10]),a&32&&(l.filter=s[5]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function _xe(o){let e,t,s;function a(u){o[20](u)}let l={records:o[1],schema:o[0],isWritable:o[15]};return o[10]!==void 0&&(l.selected=o[10]),e=new Oxe({props:l}),Ro.push(()=>er(e,"selected",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&2&&(h.records=u[1]),d&1&&(h.schema=u[0]),d&32768&&(h.isWritable=u[15]),!t&&d&1024&&(t=!0,h.selected=u[10],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function Sxe(o){let e,t,s;function a(u){o[19](u)}let l={records:o[1],graph:o[12],schema:o[0],sortParam:o[2],sortField:o[3],systemFields:o[13],inModal:o[14],users:o[11],isWritable:o[15]};return o[10]!==void 0&&(l.selected=o[10]),e=new pxe({props:l}),Ro.push(()=>er(e,"selected",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&2&&(h.records=u[1]),d&4096&&(h.graph=u[12]),d&1&&(h.schema=u[0]),d&4&&(h.sortParam=u[2]),d&8&&(h.sortField=u[3]),d&8192&&(h.systemFields=u[13]),d&16384&&(h.inModal=u[14]),d&2048&&(h.users=u[11]),d&32768&&(h.isWritable=u[15]),!t&&d&1024&&(t=!0,h.selected=u[10],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function Cxe(o){let e,t,s,a=o[0].label+"",l,u,d,h,b,y,C,E,R,$,Q;const F=[wxe,yxe],U=[];function K(oe,G){return oe[10].length>0&&!oe[14]&&oe[15]?0:1}d=K(o),h=U[d]=F[d](o);const L=[Sxe,_xe],te=[];function ne(oe,G){return oe[0].type==="collection"?0:1}return y=ne(o),C=te[y]=L[y](o),$=new xke({props:{limit:o[6],skip:o[7],total:o[8],inModal:o[14],modalUrl:o[9]}}),$.$on("refresh",o[16]),{c(){e=re("div"),t=re("div"),s=re("h3"),l=Ht(a),u=Ze(),h.c(),b=Ze(),C.c(),R=Ze(),en($.$$.fragment),Z(s,"class","header-normal mb-5 "),Z(t,"class",E="lx-card mb-4 "+(o[14]?"mt-0":"mt-5")),Z(e,"class","wrapper-large transparent ")},m(oe,G){Te(oe,e,G),X(e,t),X(t,s),X(s,l),X(t,u),U[d].m(t,null),X(t,b),te[y].m(t,null),X(e,R),Kt($,e,null),Q=!0},p(oe,[G]){(!Q||G&1)&&a!==(a=oe[0].label+"")&&Fn(l,a);let we=d;d=K(oe),d===we?U[d].p(oe,G):(mo(),Be(U[we],1,1,()=>{U[we]=null}),go(),h=U[d],h?h.p(oe,G):(h=U[d]=F[d](oe),h.c()),xe(h,1),h.m(t,b));let ve=y;y=ne(oe),y===ve?te[y].p(oe,G):(mo(),Be(te[ve],1,1,()=>{te[ve]=null}),go(),C=te[y],C?C.p(oe,G):(C=te[y]=L[y](oe),C.c()),xe(C,1),C.m(t,null)),(!Q||G&16384&&E!==(E="lx-card mb-4 "+(oe[14]?"mt-0":"mt-5")))&&Z(t,"class",E);const Re={};G&64&&(Re.limit=oe[6]),G&128&&(Re.skip=oe[7]),G&256&&(Re.total=oe[8]),G&16384&&(Re.inModal=oe[14]),G&512&&(Re.modalUrl=oe[9]),$.$set(Re)},i(oe){Q||(xe(h),xe(C),xe($.$$.fragment,oe),Q=!0)},o(oe){Be(h),Be(C),Be($.$$.fragment,oe),Q=!1},d(oe){oe&&ke(e),U[d].d(),te[y].d(),Jt($)}}}function kxe(o,e,t){const s=Ur("axios");let{schema:a}=e,{users:l}=e,{records:u}=e,{graph:d}=e,{systemFields:h}=e,{sortParam:b}=e,{sortField:y}=e,{operators:C}=e,{filter:E}=e,{limit:R}=e,{skip:$}=e,{total:Q}=e,{inModal:F}=e,{modalUrl:U}=e,{selected:K=[]}=e,{isWritable:L=!1}=e;function te(ve){const Re=ve.detail;s.get(Re).then(Oe=>{t(1,u=Oe.data.records),t(2,b=Oe.data.sortParam),t(3,y=Oe.data.sortField),t(4,C=Oe.data.operators),t(5,E=Oe.data.filter),t(7,$=Oe.data.skip),t(6,R=Oe.data.limit),t(8,Q=Oe.data.total),t(9,U=Oe.data.modalUrl)}).catch(Oe=>{console.log(Oe)})}function ne(ve){a=ve,t(0,a)}function oe(ve){u=ve,t(1,u)}function G(ve){K=ve,t(10,K)}function we(ve){K=ve,t(10,K)}return o.$$set=ve=>{"schema"in ve&&t(0,a=ve.schema),"users"in ve&&t(11,l=ve.users),"records"in ve&&t(1,u=ve.records),"graph"in ve&&t(12,d=ve.graph),"systemFields"in ve&&t(13,h=ve.systemFields),"sortParam"in ve&&t(2,b=ve.sortParam),"sortField"in ve&&t(3,y=ve.sortField),"operators"in ve&&t(4,C=ve.operators),"filter"in ve&&t(5,E=ve.filter),"limit"in ve&&t(6,R=ve.limit),"skip"in ve&&t(7,$=ve.skip),"total"in ve&&t(8,Q=ve.total),"inModal"in ve&&t(14,F=ve.inModal),"modalUrl"in ve&&t(9,U=ve.modalUrl),"selected"in ve&&t(10,K=ve.selected),"isWritable"in ve&&t(15,L=ve.isWritable)},[a,u,b,y,C,E,R,$,Q,U,K,l,d,h,F,L,te,ne,oe,G,we]}class Jpe extends uo{constructor(e){super(),co(this,e,kxe,Cxe,lo,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}}function yue(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G=o[1].length>0&&wue(o);const we=[o[2]];function ve(Oe){o[8](Oe)}let Re={};for(let Oe=0;Oe<we.length;Oe+=1)Re=Y6(Re,we[Oe]);return o[1]!==void 0&&(Re.selected=o[1]),K=new Jpe({props:Re}),Ro.push(()=>er(K,"selected",ve)),{c(){e=re("div"),t=re("div"),s=re("div"),a=re("div"),l=re("div"),u=re("button"),d=Ht("Insert"),b=Ze(),y=re("button"),C=Ht("Replace"),R=Ze(),G&&G.c(),$=Ze(),Q=re("button"),F=Ze(),U=re("div"),en(K.$$.fragment),Z(u,"type","button"),Z(u,"class","btn btn-primary me-1"),u.disabled=h=o[1].length===0,Z(y,"type","button"),Z(y,"class","btn btn-outline-primary me-3"),y.disabled=E=o[1].length===0,Z(l,"class","d-flex align-items-center"),Z(Q,"type","button"),Z(Q,"class","btn-close"),Z(Q,"data-bs-dismiss","modal"),Z(Q,"aria-label","Close"),Z(a,"class","modal-header"),Z(U,"class","modal-body"),Z(s,"class","modal-content svelte-q84vks"),Z(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-q84vks"),Z(e,"class","modal fade show"),Z(e,"tabindex","-1"),Z(e,"aria-modal","true"),Z(e,"role","dialog"),rs(e,"background","rgba(100,100,100,.6)"),Vo(e,"d-block",o[0])},m(Oe,ce){Te(Oe,e,ce),X(e,t),X(t,s),X(s,a),X(a,l),X(l,u),X(u,d),X(l,b),X(l,y),X(y,C),X(l,R),G&&G.m(l,null),X(a,$),X(a,Q),X(s,F),X(s,U),Kt(K,U,null),te=!0,ne||(oe=[mn(u,"click",o[3]),mn(y,"click",o[4]),mn(Q,"click",ku(o[7]))],ne=!0)},p(Oe,ce){(!te||ce&2&&h!==(h=Oe[1].length===0))&&(u.disabled=h),(!te||ce&2&&E!==(E=Oe[1].length===0))&&(y.disabled=E),Oe[1].length>0?G?G.p(Oe,ce):(G=wue(Oe),G.c(),G.m(l,null)):G&&(G.d(1),G=null);const Xe=ce&4?Gz(we,[Kz(Oe[2])]):{};!L&&ce&2&&(L=!0,Xe.selected=Oe[1],lr(()=>L=!1)),K.$set(Xe),(!te||ce&1)&&Vo(e,"d-block",Oe[0])},i(Oe){te||(xe(K.$$.fragment,Oe),te=!0)},o(Oe){Be(K.$$.fragment,Oe),te=!1},d(Oe){Oe&&ke(e),G&&G.d(),Jt(K),ne=!1,vi(oe)}}}function wue(o){let e,t=o[1].length+"",s,a;return{c(){e=re("span"),s=Ht(t),a=Ht(" records selected"),Z(e,"class","")},m(l,u){Te(l,e,u),X(e,s),X(e,a)},p(l,u){u&2&&t!==(t=l[1].length+"")&&Fn(s,t)},d(l){l&&ke(e)}}}function xxe(o){let e,t,s=o[2].schema&&yue(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,[l]){a[2].schema?s?(s.p(a,l),l&4&&xe(s,1)):(s=yue(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function Txe(o,e,t){let s;const a=Fg(),l=Ur("channel");let u=!1,d=[];function h(Q){t(0,u=!0),y(Q)}function b(){t(0,u=!1),t(1,d=[])}function y(Q){axios.get(l.lucentUrl+"/content/"+Q).then(F=>{t(2,s=F.data)}).catch(F=>console.log(F))}function C(Q){Q.preventDefault(),a("insert",{records:d,action:"insert"})}function E(Q){Q.preventDefault(),a("insert",{records:d,action:"replace"})}const R=Q=>t(0,u=!1);function $(Q){d=Q,t(1,d)}return t(2,s={}),[u,d,s,C,E,h,b,R,$]}class are extends uo{constructor(e){super(),co(this,e,Txe,xxe,lo,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function _ue(o,e,t){const s=o.slice();return s[18]=e[t],s}function Exe(o){let e,t,s,a,l,u,d,h,b;return u=new Fa({props:{icon:"magnifying-glass"}}),{c(){e=re("div"),t=re("div"),s=re("button"),s.textContent="New",a=Ze(),l=re("button"),en(u.$$.fragment),Z(s,"class","btn btn-sm btn-primary"),Z(l,"class","btn btn-sm btn-outline-primary"),Z(t,"class","mb-2"),Z(e,"class","pb-2 text-start")},m(y,C){Te(y,e,C),X(e,t),X(t,s),X(t,a),X(t,l),Kt(u,l,null),d=!0,h||(b=[mn(s,"click",o[12]),mn(l,"click",o[13])],h=!0)},p:un,i(y){d||(xe(u.$$.fragment,y),d=!0)},o(y){Be(u.$$.fragment,y),d=!1},d(y){y&&ke(e),Jt(u),h=!1,vi(b)}}}function Axe(o){let e,t,s,a,l,u,d;t=new Fa({props:{width:24,height:24,icon:"circle-plus"}});let h=o[4]&&Sue(o);return{c(){e=re("button"),en(t.$$.fragment),s=Ze(),h&&h.c(),a=Rs(),Z(e,"type","button"),Z(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),Vo(e,"is-first",!o[1])},m(b,y){Te(b,e,y),Kt(t,e,null),Te(b,s,y),h&&h.m(b,y),Te(b,a,y),l=!0,u||(d=mn(e,"click",ku(o[9])),u=!0)},p(b,y){(!l||y&2)&&Vo(e,"is-first",!b[1]),b[4]?h?(h.p(b,y),y&16&&xe(h,1)):(h=Sue(b),h.c(),xe(h,1),h.m(a.parentNode,a)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){l||(xe(t.$$.fragment,b),xe(h),l=!0)},o(b){Be(t.$$.fragment,b),Be(h),l=!1},d(b){b&&ke(e),Jt(t),b&&ke(s),h&&h.d(b),b&&ke(a),u=!1,d()}}}function Sue(o){let e,t,s=o[0],a=[];for(let u=0;u<s.length;u+=1)a[u]=Cue(_ue(o,s,u));const l=u=>Be(a[u],1,1,()=>{a[u]=null});return{c(){e=re("div");for(let u=0;u<a.length;u+=1)a[u].c();Z(e,"class","bg-light lx-card d-flex")},m(u,d){Te(u,e,d);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(e,null);t=!0},p(u,d){if(d&289){s=u[0];let h;for(h=0;h<s.length;h+=1){const b=_ue(u,s,h);a[h]?(a[h].p(b,d),xe(a[h],1)):(a[h]=Cue(b),a[h].c(),xe(a[h],1),a[h].m(e,null))}for(mo(),h=s.length;h<a.length;h+=1)l(h);go()}},i(u){if(!t){for(let d=0;d<s.length;d+=1)xe(a[d]);t=!0}},o(u){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)Be(a[d]);t=!1},d(u){u&&ke(e),ia(a,u)}}}function Cue(o){let e,t,s=o[18].label+"",a,l,u,d,h,b,y,C,E,R,$;function Q(...U){return o[10](o[18],...U)}y=new Fa({props:{icon:"magnifying-glass"}});function F(...U){return o[11](o[18],...U)}return{c(){e=re("div"),t=re("p"),a=Ht(s),l=Ze(),u=re("div"),d=re("button"),d.textContent="New",h=Ze(),b=re("button"),en(y.$$.fragment),C=Ze(),Z(d,"class","btn btn-sm btn-primary"),Z(b,"class","btn btn-sm btn-outline-primary"),Z(u,"class","mb-2"),Z(e,"class","lx-card p-4 text-center me-4"),rs(e,"max-width","250px")},m(U,K){Te(U,e,K),X(e,t),X(t,a),X(e,l),X(e,u),X(u,d),X(u,h),X(u,b),Kt(y,b,null),X(e,C),E=!0,R||($=[mn(d,"click",Q),mn(b,"click",F)],R=!0)},p(U,K){o=U,(!E||K&1)&&s!==(s=o[18].label+"")&&Fn(a,s)},i(U){E||(xe(y.$$.fragment,U),E=!0)},o(U){Be(y.$$.fragment,U),E=!1},d(U){U&&ke(e),Jt(y),R=!1,vi($)}}}function kue(o){let e,t;const s=[o[3]];let a={};for(let l=0;l<s.length;l+=1)a=Y6(a,s[l]);return e=new Xpe({props:a}),e.$on("cancel",o[14]),e.$on("inlinesaved",o[6]),{c(){en(e.$$.fragment)},m(l,u){Kt(e,l,u),t=!0},p(l,u){const d=u&8?Gz(s,[Kz(l[3])]):{};e.$set(d)},i(l){t||(xe(e.$$.fragment,l),t=!0)},o(l){Be(e.$$.fragment,l),t=!1},d(l){Jt(e,l)}}}function Dxe(o){let e,t,s,a,l,u;const d=[Axe,Exe],h=[];function b(E,R){return E[0].length>1?0:1}e=b(o),t=h[e]=d[e](o);let y=o[3]&&kue(o),C={};return l=new are({props:C}),o[15](l),l.$on("insert",o[7]),{c(){t.c(),s=Ze(),y&&y.c(),a=Ze(),en(l.$$.fragment)},m(E,R){h[e].m(E,R),Te(E,s,R),y&&y.m(E,R),Te(E,a,R),Kt(l,E,R),u=!0},p(E,[R]){let $=e;e=b(E),e===$?h[e].p(E,R):(mo(),Be(h[$],1,1,()=>{h[$]=null}),go(),t=h[e],t?t.p(E,R):(t=h[e]=d[e](E),t.c()),xe(t,1),t.m(s.parentNode,s)),E[3]?y?(y.p(E,R),R&8&&xe(y,1)):(y=kue(E),y.c(),xe(y,1),y.m(a.parentNode,a)):y&&(mo(),Be(y,1,1,()=>{y=null}),go());const Q={};l.$set(Q)},i(E){u||(xe(t),xe(y),xe(l.$$.fragment,E),u=!0)},o(E){Be(t),Be(y),Be(l.$$.fragment,E),u=!1},d(E){h[e].d(E),E&&ke(s),y&&y.d(E),E&&ke(a),o[15](null),Jt(l,E)}}}function Pxe(o,e,t){let s;const a=Fg(),l=Ur("channel");let{schemas:u}=e,{recordId:d}=e,h,b;function y(ne,oe){ne.preventDefault(),h.open(oe)}function C(ne){ne.preventDefault(),console.log("Save inline"),t(3,b=null),a("save",{records:ne.detail.records,after:d})}function E(ne){ne.preventDefault(),h.close(),t(4,s=!1),a("insert",{records:ne.detail.records,after:d})}function R(ne,oe){ne.preventDefault(),axios.get(l.lucentUrl+"/records/newInline?schema="+oe).then(G=>{t(3,b=G.data),t(4,s=!1)}).catch(G=>{console.log(G)})}const $=ne=>t(4,s=!s),Q=(ne,oe)=>R(oe,ne.name),F=(ne,oe)=>y(oe,ne.name),U=ne=>R(ne,u[0].name),K=ne=>y(ne,u[0].name),L=ne=>t(3,b=null);function te(ne){Ro[ne?"unshift":"push"](()=>{h=ne,t(2,h)})}return o.$$set=ne=>{"schemas"in ne&&t(0,u=ne.schemas),"recordId"in ne&&t(1,d=ne.recordId)},t(4,s=!1),[u,d,h,b,s,y,C,E,R,$,Q,F,U,K,L,te]}class eI extends uo{constructor(e){super(),co(this,e,Pxe,Dxe,lo,{schemas:0,recordId:1})}}/**!
|
|
* Sortable 1.15.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function xue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function Oy(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xue(Object(t),!0).forEach(function(s){Mxe(o,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):xue(Object(t)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(t,s))})}return o}function xH(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xH=function(e){return typeof e}:xH=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xH(o)}function Mxe(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function zw(){return zw=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=t[s])}return o},zw.apply(this,arguments)}function Rxe(o,e){if(o==null)return{};var t={},s=Object.keys(o),a,l;for(l=0;l<s.length;l++)a=s[l],!(e.indexOf(a)>=0)&&(t[a]=o[a]);return t}function $xe(o,e){if(o==null)return{};var t=Rxe(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a<l.length;a++)s=l[a],!(e.indexOf(s)>=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var Nxe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Tue=Fw(/firefox/i),i6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),e1e=Fw(/iP(ad|od|hone)/i),t1e=Fw(/chrome/i)&&Fw(/android/i),n1e={capture:!1,passive:!1};function hl(o,e,t){o.addEventListener(e,t,!jw&&n1e)}function La(o,e,t){o.removeEventListener(e,t,!jw&&n1e)}function rz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ixe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&rz(o,e):rz(o,e))||s&&o===t)return o;if(o===t)break}while(o=Ixe(o))}return null}var Eue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(Eue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(Eue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.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 OD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function o1e(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a<l;a++)t(s[a],a);return s}return[]}function hy(){var o=document.scrollingElement;return o||document.documentElement}function yd(o,e,t,s,a){if(!(!o.getBoundingClientRect&&o!==window)){var l,u,d,h,b,y,C;if(o!==window&&o.parentNode&&o!==hy()?(l=o.getBoundingClientRect(),u=l.top,d=l.left,h=l.bottom,b=l.right,y=l.height,C=l.width):(u=0,d=0,h=window.innerHeight,b=window.innerWidth,y=window.innerHeight,C=window.innerWidth),(e||t)&&o!==window&&(a=a||o.parentNode,!jw))do if(a&&a.getBoundingClientRect&&(Vr(a,"transform")!=="none"||t&&Vr(a,"position")!=="static")){var E=a.getBoundingClientRect();u-=E.top+parseInt(Vr(a,"border-top-width")),d-=E.left+parseInt(Vr(a,"border-left-width")),h=u+l.height,b=d+l.width;break}while(a=a.parentNode);if(s&&o!==window){var R=OD(a||o),$=R&&R.a,Q=R&&R.d;R&&(u/=Q,d/=$,C/=$,y/=Q,h=u+y,b=d+C)}return{top:u,left:d,bottom:h,right:b,width:C,height:y}}}function Aue(o,e,t){for(var s=_C(o,!0),a=yd(o)[e];s;){var l=yd(s)[t],u=void 0;if(t==="top"||t==="left"?u=a>=l:u=a<=l,!u)return s;if(s===hy())break;s=_C(s,!1)}return!1}function PD(o,e,t,s){for(var a=0,l=0,u=o.children;l<u.length;){if(u[l].style.display!=="none"&&u[l]!==Wr.ghost&&(s||u[l]!==Wr.dragged)&&iy(u[l],t.draggable,o,!1)){if(a===e)return u[l];a++}l++}return null}function lre(o,e){for(var t=o.lastElementChild;t&&(t===Wr.ghost||Vr(t,"display")==="none"||e&&!rz(t,e));)t=t.previousElementSibling;return t||null}function Lb(o,e){var t=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==Wr.clone&&(!e||rz(o,e))&&t++;return t}function Due(o){var e=0,t=0,s=hy();if(o)do{var a=OD(o),l=a.a,u=a.d;e+=o.scrollLeft*l,t+=o.scrollTop*u}while(o!==s&&(o=o.parentNode));return[e,t]}function Bxe(o,e){for(var t in o)if(!!o.hasOwnProperty(t)){for(var s in e)if(e.hasOwnProperty(s)&&e[s]===o[t][s])return Number(t)}return-1}function _C(o,e){if(!o||!o.getBoundingClientRect)return hy();var t=o,s=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var a=Vr(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 hy();if(s||e)return t;s=!0}}while(t=t.parentNode);return hy()}function Lxe(o,e){if(o&&e)for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o}function One(o,e){return Math.round(o.top)===Math.round(e.top)&&Math.round(o.left)===Math.round(e.left)&&Math.round(o.height)===Math.round(e.height)&&Math.round(o.width)===Math.round(e.width)}var a6;function s1e(o,e){return function(){if(!a6){var t=arguments,s=this;t.length===1?o.call(s,t[0]):o.apply(s,t),a6=setTimeout(function(){a6=void 0},e)}}}function Fxe(){clearTimeout(a6),a6=void 0}function r1e(o,e,t){o.scrollLeft+=e,o.scrollTop+=t}function i1e(o){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(o).cloneNode(!0):t?t(o).clone(!0)[0]:o.cloneNode(!0)}var F1="Sortable"+new Date().getTime();function Qxe(){var o=[],e;return{captureAnimationState:function(){if(o=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(a){if(!(Vr(a,"display")==="none"||a===Wr.ghost)){o.push({target:a,rect:yd(a)});var l=Oy({},o[o.length-1].rect);if(a.thisAnimationDuration){var u=OD(a,!0);u&&(l.top-=u.f,l.left-=u.e)}a.fromRect=l}})}},addAnimationState:function(s){o.push(s)},removeAnimationState:function(s){o.splice(Bxe(o,{target:s}),1)},animateAll:function(s){var a=this;if(!this.options.animation){clearTimeout(e),typeof s=="function"&&s();return}var l=!1,u=0;o.forEach(function(d){var h=0,b=d.target,y=b.fromRect,C=yd(b),E=b.prevFromRect,R=b.prevToRect,$=d.rect,Q=OD(b,!0);Q&&(C.top-=Q.f,C.left-=Q.e),b.toRect=C,b.thisAnimationDuration&&One(E,C)&&!One(y,C)&&($.top-C.top)/($.left-C.left)===(y.top-C.top)/(y.left-C.left)&&(h=Hxe($,E,R,a.options)),One(C,y)||(b.prevFromRect=y,b.prevToRect=C,h||(h=a.options.animation),a.animate(b,$,C,h)),h&&(l=!0,u=Math.max(u,h),clearTimeout(b.animationResetTimer),b.animationResetTimer=setTimeout(function(){b.animationTime=0,b.prevFromRect=null,b.fromRect=null,b.prevToRect=null,b.thisAnimationDuration=null},h),b.thisAnimationDuration=h)}),clearTimeout(e),l?e=setTimeout(function(){typeof s=="function"&&s()},u):typeof s=="function"&&s(),o=[]},animate:function(s,a,l,u){if(u){Vr(s,"transition",""),Vr(s,"transform","");var d=OD(this.el),h=d&&d.a,b=d&&d.d,y=(a.left-l.left)/(h||1),C=(a.top-l.top)/(b||1);s.animatingX=!!y,s.animatingY=!!C,Vr(s,"transform","translate3d("+y+"px,"+C+"px,0)"),this.forRepaintDummy=Zxe(s),Vr(s,"transition","transform "+u+"ms"+(this.options.easing?" "+this.options.easing:"")),Vr(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Vr(s,"transition",""),Vr(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},u)}}}}function Zxe(o){return o.offsetWidth}function Hxe(o,e,t,s){return Math.sqrt(Math.pow(e.top-o.top,2)+Math.pow(e.left-o.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*s.animation}var eD=[],yne={initializeByDefault:!0},nI={mount:function(e){for(var t in yne)yne.hasOwnProperty(t)&&!(t in e)&&(e[t]=yne[t]);eD.forEach(function(s){if(s.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),eD.push(e)},pluginEvent:function(e,t,s){var a=this;this.eventCanceled=!1,s.cancel=function(){a.eventCanceled=!0};var l=e+"Global";eD.forEach(function(u){!t[u.pluginName]||(t[u.pluginName][l]&&t[u.pluginName][l](Oy({sortable:t},s)),t.options[u.pluginName]&&t[u.pluginName][e]&&t[u.pluginName][e](Oy({sortable:t},s)))})},initializePlugins:function(e,t,s,a){eD.forEach(function(d){var h=d.pluginName;if(!(!e.options[h]&&!d.initializeByDefault)){var b=new d(e,t,e.options);b.sortable=e,b.options=e.options,e[h]=b,zw(s,b.defaults)}});for(var l in e.options)if(!!e.options.hasOwnProperty(l)){var u=this.modifyOption(e,l,e.options[l]);typeof u<"u"&&(e.options[l]=u)}},getEventProperties:function(e,t){var s={};return eD.forEach(function(a){typeof a.eventProperties=="function"&&zw(s,a.eventProperties.call(t[a.pluginName],e))}),s},modifyOption:function(e,t,s){var a;return eD.forEach(function(l){!e[l.pluginName]||l.optionListeners&&typeof l.optionListeners[t]=="function"&&(a=l.optionListeners[t].call(e[l.pluginName],s))}),a}};function zxe(o){var e=o.sortable,t=o.rootEl,s=o.name,a=o.targetEl,l=o.cloneEl,u=o.toEl,d=o.fromEl,h=o.oldIndex,b=o.newIndex,y=o.oldDraggableIndex,C=o.newDraggableIndex,E=o.originalEvent,R=o.putSortable,$=o.extraEventProperties;if(e=e||t&&t[F1],!!e){var Q,F=e.options,U="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!jw&&!tI?Q=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(Q=document.createEvent("Event"),Q.initEvent(s,!0,!0)),Q.to=u||t,Q.from=d||t,Q.item=a||t,Q.clone=l,Q.oldIndex=h,Q.newIndex=b,Q.oldDraggableIndex=y,Q.newDraggableIndex=C,Q.originalEvent=E,Q.pullMode=R?R.lastPutMode:void 0;var K=Oy(Oy({},$),nI.getEventProperties(s,e));for(var L in K)Q[L]=K[L];t&&t.dispatchEvent(Q),F[U]&&F[U].call(e,Q)}}var Vxe=["evt"],Rp=function(e,t){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=$xe(s,Vxe);nI.pluginEvent.bind(Wr)(e,t,Oy({dragEl:zo,parentEl:ju,ghostEl:Ai,rootEl:eu,nextEl:tE,lastDownEl:TH,cloneEl:Su,cloneHidden:yC,dragStarted:qN,putSortable:Vh,activeSortable:Wr.active,originalEvent:a,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC,hideGhostForTarget:u1e,unhideGhostForTarget:f1e,cloneNowHidden:function(){yC=!0},cloneNowShown:function(){yC=!1},dispatchSortableEvent:function(d){Rg({sortable:t,name:d,originalEvent:a})}},l))};function Rg(o){zxe(Oy({putSortable:Vh,cloneEl:Su,targetEl:zo,rootEl:eu,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC},o))}var zo,ju,Ai,eu,tE,TH,Su,yC,hD,I1,l6,bC,IZ,Vh,iD=!1,iz=!1,az=[],qT,wv,wne,_ne,Pue,Mue,qN,tD,c6,u6=!1,BZ=!1,EH,Rm,Sne=[],Boe=!1,lz=[],tV=typeof document<"u",LZ=e1e,Rue=tI||jw?"cssFloat":"float",Wxe=tV&&!t1e&&!e1e&&"draggable"in document.createElement("div"),a1e=function(){if(!!tV){if(jw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),l1e=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=PD(e,0,t),u=PD(e,1,t),d=l&&Vr(l),h=u&&Vr(u),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+yd(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+yd(u).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(l&&d.float&&d.float!=="none"){var C=d.float==="left"?"left":"right";return u&&(h.clear==="both"||h.clear===C)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||b>=a&&s[Rue]==="none"||u&&s[Rue]==="none"&&b+y>a)?"vertical":"horizontal"},Uxe=function(e,t,s){var a=s?e.left:e.top,l=s?e.right:e.bottom,u=s?e.width:e.height,d=s?t.left:t.top,h=s?t.right:t.bottom,b=s?t.width:t.height;return a===d||l===h||a+u/2===d+b/2},Yxe=function(e,t){var s;return az.some(function(a){var l=a[F1].options.emptyInsertThreshold;if(!(!l||lre(a))){var u=yd(a),d=e>=u.left-l&&e<=u.right+l,h=t>=u.top-l&&t<=u.bottom+l;if(d&&h)return s=a}}),s},c1e=function(e){function t(l,u){return function(d,h,b,y){var C=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(u||C))return!0;if(l==null||l===!1)return!1;if(u&&l==="clone")return l;if(typeof l=="function")return t(l(d,h,b,y),u)(d,h,b,y);var E=(u?d:h).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var s={},a=e.group;(!a||xH(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},u1e=function(){!a1e&&Ai&&Vr(Ai,"display","none")},f1e=function(){!a1e&&Ai&&Vr(Ai,"display","")};tV&&!t1e&&document.addEventListener("click",function(o){if(iz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),iz=!1,!1},!0);var GT=function(e){if(zo){e=e.touches?e.touches[0]:e;var t=Yxe(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[F1]._onDragOver(s)}}},Xxe=function(e){zo&&zo.parentNode[F1]._isOutsideThisEl(e.target)};function Wr(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=zw({},e),o[F1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return l1e(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(u,d){u.setData("Text",d.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:Wr.supportPointer!==!1&&"PointerEvent"in window&&!i6,emptyInsertThreshold:5};nI.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);c1e(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:Wxe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?hl(o,"pointerdown",this._onTapStart):(hl(o,"mousedown",this._onTapStart),hl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(hl(o,"dragover",this),hl(o,"dragenter",this)),az.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,Qxe())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(tD=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,l=a.preventOnFilter,u=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,b=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,y=a.filter;if(nTe(s),!zo&&!(/mousedown|pointerdown/.test(u)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&i6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=iy(h,a.draggable,s,!1),!(h&&h.animated)&&TH!==h)){if(hD=Lb(h),l6=Lb(h,a.draggable),typeof y=="function"){if(y.call(this,e,h,this)){Rg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Rp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(C){if(C=iy(b,C.trim(),s,!1),C)return Rg({sortable:t,rootEl:C,name:"filter",targetEl:h,fromEl:s,toEl:s}),Rp("filter",t,{evt:e}),!0}),y)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!iy(b,a.handle,s,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,s){var a=this,l=a.el,u=a.options,d=l.ownerDocument,h;if(s&&!zo&&s.parentNode===l){var b=yd(s);if(eu=l,zo=s,ju=zo.parentNode,tE=zo.nextSibling,TH=s,IZ=u.group,Wr.dragged=zo,qT={target:zo,clientX:(t||e).clientX,clientY:(t||e).clientY},Pue=qT.clientX-b.left,Mue=qT.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,zo.style["will-change"]="all",h=function(){if(Rp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Tue&&a.nativeDraggable&&(zo.draggable=!0),a._triggerDragStart(e,t),Rg({sortable:a,name:"choose",originalEvent:e}),$1(zo,u.chosenClass,!0)},u.ignore.split(",").forEach(function(y){o1e(zo,y.trim(),Cne)}),hl(d,"dragover",GT),hl(d,"mousemove",GT),hl(d,"touchmove",GT),hl(d,"mouseup",a._onDrop),hl(d,"touchend",a._onDrop),hl(d,"touchcancel",a._onDrop),Tue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,zo.draggable=!0),Rp("delayStart",this,{evt:e}),u.delay&&(!u.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(tI||jw))){if(Wr.eventCanceled){this._onDrop();return}hl(d,"mouseup",a._disableDelayedDrag),hl(d,"touchend",a._disableDelayedDrag),hl(d,"touchcancel",a._disableDelayedDrag),hl(d,"mousemove",a._delayedDragTouchMoveHandler),hl(d,"touchmove",a._delayedDragTouchMoveHandler),u.supportPointer&&hl(d,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(h,u.delay)}else h()}},_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&&Cne(zo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._disableDelayedDrag),La(e,"touchend",this._disableDelayedDrag),La(e,"touchcancel",this._disableDelayedDrag),La(e,"mousemove",this._delayedDragTouchMoveHandler),La(e,"touchmove",this._delayedDragTouchMoveHandler),La(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?hl(document,"pointermove",this._onTouchMove):t?hl(document,"touchmove",this._onTouchMove):hl(document,"mousemove",this._onTouchMove):(hl(zo,"dragend",this),hl(eu,"dragstart",this._onDragStart));try{document.selection?AH(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(iD=!1,eu&&zo){Rp("dragStarted",this,{evt:t}),this.nativeDraggable&&hl(document,"dragover",Xxe);var s=this.options;!e&&$1(zo,s.dragClass,!1),$1(zo,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Rg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wv){this._lastX=wv.clientX,this._lastY=wv.clientY,u1e();for(var e=document.elementFromPoint(wv.clientX,wv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wv.clientX,wv.clientY),e!==t);)t=e;if(zo.parentNode[F1]._isOutsideThisEl(e),t)do{if(t[F1]){var s=void 0;if(s=t[F1]._onDragOver({clientX:wv.clientX,clientY:wv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);f1e()}},_onTouchMove:function(e){if(qT){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,u=Ai&&OD(Ai,!0),d=Ai&&u&&u.a,h=Ai&&u&&u.d,b=LZ&&Rm&&Due(Rm),y=(l.clientX-qT.clientX+a.x)/(d||1)+(b?b[0]-Sne[0]:0)/(d||1),C=(l.clientY-qT.clientY+a.y)/(h||1)+(b?b[1]-Sne[1]:0)/(h||1);if(!Wr.active&&!iD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))<s)return;this._onDragStart(e,!0)}if(Ai){u?(u.e+=y-(wne||0),u.f+=C-(_ne||0)):u={a:1,b:0,c:0,d:1,e:y,f:C};var E="matrix(".concat(u.a,",").concat(u.b,",").concat(u.c,",").concat(u.d,",").concat(u.e,",").concat(u.f,")");Vr(Ai,"webkitTransform",E),Vr(Ai,"mozTransform",E),Vr(Ai,"msTransform",E),Vr(Ai,"transform",E),wne=y,_ne=C,wv=l}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Ai){var e=this.options.fallbackOnBody?document.body:eu,t=yd(zo,!0,LZ,!0,e),s=this.options;if(LZ){for(Rm=e;Vr(Rm,"position")==="static"&&Vr(Rm,"transform")==="none"&&Rm!==document;)Rm=Rm.parentNode;Rm!==document.body&&Rm!==document.documentElement?(Rm===document&&(Rm=hy()),t.top+=Rm.scrollTop,t.left+=Rm.scrollLeft):Rm=hy(),Sne=Due(Rm)}Ai=zo.cloneNode(!0),$1(Ai,s.ghostClass,!1),$1(Ai,s.fallbackClass,!0),$1(Ai,s.dragClass,!0),Vr(Ai,"transition",""),Vr(Ai,"transform",""),Vr(Ai,"box-sizing","border-box"),Vr(Ai,"margin",0),Vr(Ai,"top",t.top),Vr(Ai,"left",t.left),Vr(Ai,"width",t.width),Vr(Ai,"height",t.height),Vr(Ai,"opacity","0.8"),Vr(Ai,"position",LZ?"absolute":"fixed"),Vr(Ai,"zIndex","100000"),Vr(Ai,"pointerEvents","none"),Wr.ghost=Ai,e.appendChild(Ai),Vr(Ai,"transform-origin",Pue/parseInt(Ai.style.width)*100+"% "+Mue/parseInt(Ai.style.height)*100+"%")}},_onDragStart:function(e,t){var s=this,a=e.dataTransfer,l=s.options;if(Rp("dragStart",this,{evt:e}),Wr.eventCanceled){this._onDrop();return}Rp("setupClone",this),Wr.eventCanceled||(Su=i1e(zo),Su.removeAttribute("id"),Su.draggable=!1,Su.style["will-change"]="",this._hideClone(),$1(Su,this.options.chosenClass,!1),Wr.clone=Su),s.cloneId=AH(function(){Rp("clone",s),!Wr.eventCanceled&&(s.options.removeCloneOnHide||eu.insertBefore(Su,zo),s._hideClone(),Rg({sortable:s,name:"clone"}))}),!t&&$1(zo,l.dragClass,!0),t?(iz=!0,s._loopId=setInterval(s._emulateDragOver,50)):(La(document,"mouseup",s._onDrop),La(document,"touchend",s._onDrop),La(document,"touchcancel",s._onDrop),a&&(a.effectAllowed="move",l.setData&&l.setData.call(s,a,zo)),hl(document,"drop",s),Vr(zo,"transform","translateZ(0)")),iD=!0,s._dragStartId=AH(s._dragStarted.bind(s,t,e)),hl(document,"selectstart",s),qN=!0,i6&&Vr(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,s=e.target,a,l,u,d=this.options,h=d.group,b=Wr.active,y=IZ===h,C=d.sort,E=Vh||b,R,$=this,Q=!1;if(Boe)return;function F(Qe,Bt){Rp(Qe,$,Oy({evt:e,isOwner:y,axis:R?"vertical":"horizontal",revert:u,dragRect:a,targetRect:l,canSort:C,fromSortable:E,target:s,completed:K,onMove:function(He,st){return FZ(eu,t,zo,a,He,yd(He),e,st)},changed:L},Bt))}function U(){F("dragOverAnimationCapture"),$.captureAnimationState(),$!==E&&E.captureAnimationState()}function K(Qe){return F("dragOverCompleted",{insertion:Qe}),Qe&&(y?b._hideClone():b._showClone($),$!==E&&($1(zo,Vh?Vh.options.ghostClass:b.options.ghostClass,!1),$1(zo,d.ghostClass,!0)),Vh!==$&&$!==Wr.active?Vh=$:$===Wr.active&&Vh&&(Vh=null),E===$&&($._ignoreWhileAnimating=s),$.animateAll(function(){F("dragOverAnimationComplete"),$._ignoreWhileAnimating=null}),$!==E&&(E.animateAll(),E._ignoreWhileAnimating=null)),(s===zo&&!zo.animated||s===t&&!s.animated)&&(tD=null),!d.dragoverBubble&&!e.rootEl&&s!==document&&(zo.parentNode[F1]._isOutsideThisEl(e.target),!Qe&>(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),Q=!0}function L(){I1=Lb(zo),bC=Lb(zo,d.draggable),Rg({sortable:$,name:"change",toEl:t,newIndex:I1,newDraggableIndex:bC,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),s=iy(s,d.draggable,t,!0),F("dragOver"),Wr.eventCanceled)return Q;if(zo.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||$._ignoreWhileAnimating===s)return K(!1);if(iz=!1,b&&!d.disabled&&(y?C||(u=ju!==eu):Vh===this||(this.lastPutMode=IZ.checkPull(this,b,zo,e))&&h.checkPut(this,b,zo,e))){if(R=this._getDirection(e,s)==="vertical",a=yd(zo),F("dragOverValid"),Wr.eventCanceled)return Q;if(u)return ju=eu,U(),this._hideClone(),F("revert"),Wr.eventCanceled||(tE?eu.insertBefore(zo,tE):eu.appendChild(zo)),K(!0);var te=lre(t,d.draggable);if(!te||Kxe(e,R,this)&&!te.animated){if(te===zo)return K(!1);if(te&&t===e.target&&(s=te),s&&(l=yd(s)),FZ(eu,t,zo,a,s,l,e,!!s)!==!1)return U(),te&&te.nextSibling?t.insertBefore(zo,te.nextSibling):t.appendChild(zo),ju=t,L(),K(!0)}else if(te&&Gxe(e,R,this)){var ne=PD(t,0,d,!0);if(ne===zo)return K(!1);if(s=ne,l=yd(s),FZ(eu,t,zo,a,s,l,e,!1)!==!1)return U(),t.insertBefore(zo,ne),ju=t,L(),K(!0)}else if(s.parentNode===t){l=yd(s);var oe=0,G,we=zo.parentNode!==t,ve=!Uxe(zo.animated&&zo.toRect||a,s.animated&&s.toRect||l,R),Re=R?"top":"left",Oe=Aue(s,"top","top")||Aue(zo,"top","top"),ce=Oe?Oe.scrollTop:void 0;tD!==s&&(G=l[Re],u6=!1,BZ=!ve&&d.invertSwap||we),oe=Jxe(e,s,l,R,ve?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,BZ,tD===s);var Xe;if(oe!==0){var tt=Lb(zo);do tt-=oe,Xe=ju.children[tt];while(Xe&&(Vr(Xe,"display")==="none"||Xe===Ai))}if(oe===0||Xe===s)return K(!1);tD=s,c6=oe;var ot=s.nextElementSibling,V=!1;V=oe===1;var ut=FZ(eu,t,zo,a,s,l,e,V);if(ut!==!1)return(ut===1||ut===-1)&&(V=ut===1),Boe=!0,setTimeout(qxe,30),U(),V&&!ot?t.appendChild(zo):s.parentNode.insertBefore(zo,V?ot:s),Oe&&r1e(Oe,0,ce-Oe.scrollTop),ju=zo.parentNode,G!==void 0&&!BZ&&(EH=Math.abs(G-yd(s)[Re])),L(),K(!0)}if(t.contains(zo))return K(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){La(document,"mousemove",this._onTouchMove),La(document,"touchmove",this._onTouchMove),La(document,"pointermove",this._onTouchMove),La(document,"dragover",GT),La(document,"mousemove",GT),La(document,"touchmove",GT)},_offUpEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._onDrop),La(e,"touchend",this._onDrop),La(e,"pointerup",this._onDrop),La(e,"touchcancel",this._onDrop),La(document,"selectstart",this)},_onDrop:function(e){var t=this.el,s=this.options;if(I1=Lb(zo),bC=Lb(zo,s.draggable),Rp("drop",this,{evt:e}),ju=zo&&zo.parentNode,I1=Lb(zo),bC=Lb(zo,s.draggable),Wr.eventCanceled){this._nulling();return}iD=!1,BZ=!1,u6=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Loe(this.cloneId),Loe(this._dragStartId),this.nativeDraggable&&(La(document,"drop",this),La(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),i6&&Vr(document.body,"user-select",""),Vr(zo,"transform",""),e&&(qN&&(e.cancelable&&e.preventDefault(),!s.dropBubble&&e.stopPropagation()),Ai&&Ai.parentNode&&Ai.parentNode.removeChild(Ai),(eu===ju||Vh&&Vh.lastPutMode!=="clone")&&Su&&Su.parentNode&&Su.parentNode.removeChild(Su),zo&&(this.nativeDraggable&&La(zo,"dragend",this),Cne(zo),zo.style["will-change"]="",qN&&!iD&&$1(zo,Vh?Vh.options.ghostClass:this.options.ghostClass,!1),$1(zo,this.options.chosenClass,!1),Rg({sortable:this,name:"unchoose",toEl:ju,newIndex:null,newDraggableIndex:null,originalEvent:e}),eu!==ju?(I1>=0&&(Rg({rootEl:ju,name:"add",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"remove",toEl:ju,originalEvent:e}),Rg({rootEl:ju,name:"sort",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Vh&&Vh.save()):I1!==hD&&I1>=0&&(Rg({sortable:this,name:"update",toEl:ju,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Wr.active&&((I1==null||I1===-1)&&(I1=hD,bC=l6),Rg({sortable:this,name:"end",toEl:ju,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Rp("nulling",this),eu=zo=ju=Ai=tE=Su=TH=yC=qT=wv=qN=I1=bC=hD=l6=tD=c6=Vh=IZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,lz.forEach(function(e){e.checked=!0}),lz.length=wne=_ne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":zo&&(this._onDragOver(e),jxe(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,l=s.length,u=this.options;a<l;a++)t=s[a],iy(t,u.draggable,this.el,!1)&&e.push(t.getAttribute(u.dataIdAttr)||tTe(t));return e},sort:function(e,t){var s={},a=this.el;this.toArray().forEach(function(l,u){var d=a.children[u];iy(d,this.options.draggable,a,!1)&&(s[l]=d)},this),t&&this.captureAnimationState(),e.forEach(function(l){s[l]&&(a.removeChild(s[l]),a.appendChild(s[l]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return iy(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=nI.modifyOption(this,e,t);typeof a<"u"?s[e]=a:s[e]=t,e==="group"&&c1e(s)},destroy:function(){Rp("destroy",this);var e=this.el;e[F1]=null,La(e,"mousedown",this._onTapStart),La(e,"touchstart",this._onTapStart),La(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(La(e,"dragover",this),La(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),az.splice(az.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!yC){if(Rp("hideClone",this),Wr.eventCanceled)return;Vr(Su,"display","none"),this.options.removeCloneOnHide&&Su.parentNode&&Su.parentNode.removeChild(Su),yC=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(yC){if(Rp("showClone",this),Wr.eventCanceled)return;zo.parentNode==eu&&!this.options.group.revertClone?eu.insertBefore(Su,zo):tE?eu.insertBefore(Su,tE):eu.appendChild(Su),this.options.group.revertClone&&this.animate(zo,Su),Vr(Su,"display",""),yC=!1}}};function jxe(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function FZ(o,e,t,s,a,l,u,d){var h,b=o[F1],y=b.options.onMove,C;return window.CustomEvent&&!jw&&!tI?h=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent("move",!0,!0)),h.to=e,h.from=o,h.dragged=t,h.draggedRect=s,h.related=a||e,h.relatedRect=l||yd(e),h.willInsertAfter=d,h.originalEvent=u,o.dispatchEvent(h),y&&(C=y.call(b,h,u)),C}function Cne(o){o.draggable=!1}function qxe(){Boe=!1}function Gxe(o,e,t){var s=yd(PD(t.el,0,t.options,!0)),a=10;return e?o.clientX<s.left-a||o.clientY<s.top&&o.clientX<s.right:o.clientY<s.top-a||o.clientY<s.bottom&&o.clientX<s.left}function Kxe(o,e,t){var s=yd(lre(t.el,t.options.draggable)),a=10;return e?o.clientX>s.right+a||o.clientX<=s.right&&o.clientY>s.bottom&&o.clientX>=s.left:o.clientX>s.right&&o.clientY>s.top||o.clientX<=s.right&&o.clientY>s.bottom+a}function Jxe(o,e,t,s,a,l,u,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,y=s?t.top:t.left,C=s?t.bottom:t.right,E=!1;if(!u){if(d&&EH<b*a){if(!u6&&(c6===1?h>y+b*l/2:h<C-b*l/2)&&(u6=!0),u6)E=!0;else if(c6===1?h<y+EH:h>C-EH)return-c6}else if(h>y+b*(1-a)/2&&h<C-b*(1-a)/2)return eTe(e)}return E=E||u,E&&(h<y+b*l/2||h>C-b*l/2)?h>y+b/2?1:-1:0}function eTe(o){return Lb(zo)<Lb(o)?1:-1}function tTe(o){for(var e=o.tagName+o.className+o.src+o.href+o.textContent,t=e.length,s=0;t--;)s+=e.charCodeAt(t);return s.toString(36)}function nTe(o){lz.length=0;for(var e=o.getElementsByTagName("input"),t=e.length;t--;){var s=e[t];s.checked&&lz.push(s)}}function AH(o){return setTimeout(o,0)}function Loe(o){return clearTimeout(o)}tV&&hl(document,"touchmove",function(o){(Wr.active||iD)&&o.cancelable&&o.preventDefault()});Wr.utils={on:hl,off:La,css:Vr,find:o1e,is:function(e,t){return!!iy(e,t,e,!1)},extend:Lxe,throttle:s1e,closest:iy,toggleClass:$1,clone:i1e,index:Lb,nextTick:AH,cancelNextTick:Loe,detectDirection:l1e,getChild:PD};Wr.get=function(o){return o[F1]};Wr.mount=function(){for(var o=arguments.length,e=new Array(o),t=0;t<o;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&&(Wr.utils=Oy(Oy({},Wr.utils),s.utils)),nI.mount(s)})};Wr.create=function(o,e){return new Wr(o,e)};Wr.version=Nxe;var Wf=[],GN,Foe,Qoe=!1,kne,xne,cz,KN;function oTe(){function o(){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 o.prototype={dragStarted:function(t){var s=t.originalEvent;this.sortable.nativeDraggable?hl(document,"dragover",this._handleAutoScroll):this.options.supportPointer?hl(document,"pointermove",this._handleFallbackAutoScroll):s.touches?hl(document,"touchmove",this._handleFallbackAutoScroll):hl(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var s=t.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?La(document,"dragover",this._handleAutoScroll):(La(document,"pointermove",this._handleFallbackAutoScroll),La(document,"touchmove",this._handleFallbackAutoScroll),La(document,"mousemove",this._handleFallbackAutoScroll)),$ue(),DH(),Fxe()},nulling:function(){cz=Foe=GN=Qoe=KN=kne=xne=null,Wf.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,s){var a=this,l=(t.touches?t.touches[0]:t).clientX,u=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(l,u);if(cz=t,s||this.options.forceAutoScrollFallback||tI||jw||i6){Tne(t,this.options,d,s);var h=_C(d,!0);Qoe&&(!KN||l!==kne||u!==xne)&&(KN&&$ue(),KN=setInterval(function(){var b=_C(document.elementFromPoint(l,u),!0);b!==h&&(h=b,DH()),Tne(t,a.options,b,s)},10),kne=l,xne=u)}else{if(!this.options.bubbleScroll||_C(d,!0)===hy()){DH();return}Tne(t,this.options,_C(d,!1),!1)}}},zw(o,{pluginName:"scroll",initializeByDefault:!0})}function DH(){Wf.forEach(function(o){clearInterval(o.pid)}),Wf=[]}function $ue(){clearInterval(KN)}var Tne=s1e(function(o,e,t,s){if(!!e.scroll){var a=(o.touches?o.touches[0]:o).clientX,l=(o.touches?o.touches[0]:o).clientY,u=e.scrollSensitivity,d=e.scrollSpeed,h=hy(),b=!1,y;Foe!==t&&(Foe=t,DH(),GN=e.scroll,y=e.scrollFn,GN===!0&&(GN=_C(t,!0)));var C=0,E=GN;do{var R=E,$=yd(R),Q=$.top,F=$.bottom,U=$.left,K=$.right,L=$.width,te=$.height,ne=void 0,oe=void 0,G=R.scrollWidth,we=R.scrollHeight,ve=Vr(R),Re=R.scrollLeft,Oe=R.scrollTop;R===h?(ne=L<G&&(ve.overflowX==="auto"||ve.overflowX==="scroll"||ve.overflowX==="visible"),oe=te<we&&(ve.overflowY==="auto"||ve.overflowY==="scroll"||ve.overflowY==="visible")):(ne=L<G&&(ve.overflowX==="auto"||ve.overflowX==="scroll"),oe=te<we&&(ve.overflowY==="auto"||ve.overflowY==="scroll"));var ce=ne&&(Math.abs(K-a)<=u&&Re+L<G)-(Math.abs(U-a)<=u&&!!Re),Xe=oe&&(Math.abs(F-l)<=u&&Oe+te<we)-(Math.abs(Q-l)<=u&&!!Oe);if(!Wf[C])for(var tt=0;tt<=C;tt++)Wf[tt]||(Wf[tt]={});(Wf[C].vx!=ce||Wf[C].vy!=Xe||Wf[C].el!==R)&&(Wf[C].el=R,Wf[C].vx=ce,Wf[C].vy=Xe,clearInterval(Wf[C].pid),(ce!=0||Xe!=0)&&(b=!0,Wf[C].pid=setInterval(function(){s&&this.layer===0&&Wr.active._onTouchMove(cz);var ot=Wf[this.layer].vy?Wf[this.layer].vy*d:0,V=Wf[this.layer].vx?Wf[this.layer].vx*d:0;typeof y=="function"&&y.call(Wr.dragged.parentNode[F1],V,ot,o,cz,Wf[this.layer].el)!=="continue"||r1e(Wf[this.layer].el,V,ot)}.bind({layer:C}),24))),C++}while(e.bubbleScroll&&E!==h&&(E=_C(E,!1)));Qoe=b}},30),d1e=function(e){var t=e.originalEvent,s=e.putSortable,a=e.dragEl,l=e.activeSortable,u=e.dispatchSortableEvent,d=e.hideGhostForTarget,h=e.unhideGhostForTarget;if(!!t){var b=s||l;d();var y=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,C=document.elementFromPoint(y.clientX,y.clientY);h(),b&&!b.el.contains(C)&&(u("spill"),this.onSpill({dragEl:a,putSortable:s}))}};function cre(){}cre.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=PD(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:d1e};zw(cre,{pluginName:"revertOnSpill"});function ure(){}ure.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:d1e};zw(ure,{pluginName:"removeOnSpill"});Wr.mount(new oTe);Wr.mount(ure,cre);function sTe(o){let e,t,s;const a=o[5].default,l=YH(a,o,o[4],null);return{c(){e=re("div"),l&&l.c(),Z(e,"class",t="sortable-container "+o[0])},m(u,d){Te(u,e,d),l&&l.m(e,null),o[7](e),s=!0},p(u,d){l&&l.p&&(!s||d&16)&&jH(l,a,u,u[4],s?XH(a,u[4],d,null):qH(u[4]),null),(!s||d&1&&t!==(t="sortable-container "+u[0]))&&Z(e,"class",t)},i(u){s||(xe(l,u),s=!0)},o(u){Be(l,u),s=!1},d(u){u&&ke(e),l&&l.d(u),o[7](null)}}}function rTe(o){let e,t,s;const a=o[5].default,l=YH(a,o,o[4],null);return{c(){e=re("tbody"),l&&l.c(),Z(e,"class",t="sortable-container "+o[0])},m(u,d){Te(u,e,d),l&&l.m(e,null),o[6](e),s=!0},p(u,d){l&&l.p&&(!s||d&16)&&jH(l,a,u,u[4],s?XH(a,u[4],d,null):qH(u[4]),null),(!s||d&1&&t!==(t="sortable-container "+u[0]))&&Z(e,"class",t)},i(u){s||(xe(l,u),s=!0)},o(u){Be(l,u),s=!1},d(u){u&&ke(e),l&&l.d(u),o[6](null)}}}function iTe(o){let e,t,s,a;const l=[rTe,sTe],u=[];function d(h,b){return h[1]?0:1}return e=d(o),t=u[e]=l[e](o),{c(){t.c(),s=Rs()},m(h,b){u[e].m(h,b),Te(h,s,b),a=!0},p(h,[b]){let y=e;e=d(h),e===y?u[e].p(h,b):(mo(),Be(u[y],1,1,()=>{u[y]=null}),go(),t=u[e],t?t.p(h,b):(t=u[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function aTe(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l=""}=e,{isTable:u=!1}=e,{sortableInstance:d}=e;const h=Fg();let b;W1(()=>{let E={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(R){h("update",{source:R.oldIndex,target:R.newIndex})},onMove(R){}};t(3,d=Wr.create(b,E))});function y(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}function C(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}return o.$$set=E=>{"sortableClass"in E&&t(0,l=E.sortableClass),"isTable"in E&&t(1,u=E.isTable),"sortableInstance"in E&&t(3,d=E.sortableInstance),"$$scope"in E&&t(4,a=E.$$scope)},[l,u,b,d,a,s,y,C]}class oI extends uo{constructor(e){super(),co(this,e,aTe,iTe,lo,{sortableClass:0,isTable:1,sortableInstance:3})}}function Nue(o,e,t){const s=o.slice();return s[11]=e[t],s}function Iue(o){let e,t;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&2&&Fn(t,s[1])},d(s){s&&ke(e)}}}function Bue(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[lTe]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Lue(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function lTe(o){let e=[],t=new Map,s,a,l=o[0];const u=d=>d[11].id;for(let d=0;d<l.length;d+=1){let h=Nue(o,l,d),b=u(h);t.set(b,e[d]=Lue(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){h&9&&(l=d[0],mo(),e=Jd(e,h,u,1,d,l,t,s.parentNode,xv,Lue,s,Nue),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function cTe(o){let e,t,s,a,l,u,d=o[1]&&Iue(o);s=new eI({props:{buttonClass:"mt-2",recordId:null,schemas:o[2]}}),s.$on("insert",o[5]),s.$on("save",o[5]);let h=o[0].length>0&&Bue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[1]?d?d.p(b,y):(d=Iue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,y),y&1&&xe(h,1)):(h=Bue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function uTe(o,e,t){let s,a;const l=Ur("channel");let{record:u}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter($=>d.collections.includes($.name));function C($){$.preventDefault(),t(6,h.edges=h.edges.filter(Q=>!(Q.target===$.detail&&Q.field===d.name)),h)}function E($){t(6,h.edges=qD($.detail.source,$.detail.target,h.edges,d.name,a),h)}function R($){$.preventDefault(),t(6,h=K6(h,u,$.detail.records,d.name,$.detail.action))}return o.$$set=$=>{"record"in $&&t(7,u=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(6,h=$.graph),"validationErrors"in $&&t(9,b=$.validationErrors)},o.$$.update=()=>{var $;o.$$.dirty&768&&t(1,s=Lm(b,d.name)),o.$$.dirty&448&&t(0,a=($=h.edges.filter(Q=>Q.field===d.name).map(Q=>h.records.find(F=>F.id===Q.target&&u.id===Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[a,s,y,C,E,R,h,u,d,b]}class fTe extends uo{constructor(e){super(),co(this,e,uTe,cTe,lo,{record:7,field:8,graph:6,validationErrors:9})}}function Fue(o,e,t){const s=o.slice();return s[21]=e[t],s}function dTe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt;u=new Fa({props:{icon:"pencil",width:12,height:12}});const ot=[pTe,gTe],V=[];function ut(Et,Cn){return Et[7]?0:1}b=ut(o),y=V[b]=ot[b](o),$=new Fa({props:{icon:"ellipsis"}});let Qe=!o[1]&&Que(o),Bt=!o[2]&&Zue(o),Ct=o[8].type==="files"&&bTe(o),He=o[8].fields.filter(zue),st=[];for(let Et=0;Et<He.length;Et+=1)st[Et]=Hue(Fue(o,He,Et));const rn=Et=>Be(st[Et],1,1,()=>{st[Et]=null});return{c(){e=re("div"),t=re("div"),s=re("small"),s.textContent=`${o[8].label}`,a=Ze(),l=re("button"),en(u.$$.fragment),d=Ze(),h=re("button"),y.c(),C=Ze(),E=re("div"),R=re("button"),en($.$$.fragment),Q=Ze(),F=re("div"),U=re("a"),K=Ht("Edit in new tab"),te=Ze(),ne=re("button"),ne.textContent="Remove",oe=Ze(),G=re("div"),Qe&&Qe.c(),we=Ze(),Bt&&Bt.c(),ve=Ze(),Re=re("div"),Ct&&Ct.c(),Oe=Ze();for(let Et=0;Et<st.length;Et+=1)st[Et].c();Z(s,"class","text-muted"),Z(l,"class","btn btn-sm btn-link"),Z(h,"class","btn btn-sm btn-link"),Z(R,"class","btn btn-link btn-sm"),Z(R,"type","button"),Z(R,"data-bs-toggle","dropdown"),Z(R,"aria-expanded","false"),Z(U,"class","dropdown-item"),Z(U,"href",L="/records/"+o[0].id),Z(U,"target","_blank"),Z(ne,"class","dropdown-item"),Z(G,"class","text-center mt-3"),Z(F,"class","dropdown-menu"),Z(E,"class","dropdown d-inline-block"),Z(t,"class","actions svelte-4ewolk"),Z(Re,"class","inline-preview svelte-4ewolk"),Vo(Re,"expanded",o[7]),Z(e,"class","lx-card mt-4 bg-primary bg-opacity-10 svelte-4ewolk")},m(Et,Cn){Te(Et,e,Cn),X(e,t),X(t,s),X(t,a),X(t,l),Kt(u,l,null),X(t,d),X(t,h),V[b].m(h,null),X(t,C),X(t,E),X(E,R),Kt($,R,null),X(E,Q),X(E,F),X(F,U),X(U,K),X(F,te),X(F,ne),X(F,oe),X(F,G),Qe&&Qe.m(G,null),X(G,we),Bt&&Bt.m(G,null),X(e,ve),X(e,Re),Ct&&Ct.m(Re,null),X(Re,Oe);for(let je=0;je<st.length;je+=1)st[je]&&st[je].m(Re,null);ce=!0,Xe||(tt=[mn(l,"click",ku(o[9])),mn(h,"click",o[18]),mn(ne,"click",o[14])],Xe=!0)},p(Et,Cn){let je=b;if(b=ut(Et),b!==je&&(mo(),Be(V[je],1,1,()=>{V[je]=null}),go(),y=V[b],y||(y=V[b]=ot[b](Et),y.c()),xe(y,1),y.m(h,null)),(!ce||Cn&1&&L!==(L="/records/"+Et[0].id))&&Z(U,"href",L),Et[1]?Qe&&(mo(),Be(Qe,1,1,()=>{Qe=null}),go()):Qe?(Qe.p(Et,Cn),Cn&2&&xe(Qe,1)):(Qe=Que(Et),Qe.c(),xe(Qe,1),Qe.m(G,we)),Et[2]?Bt&&(mo(),Be(Bt,1,1,()=>{Bt=null}),go()):Bt?(Bt.p(Et,Cn),Cn&4&&xe(Bt,1)):(Bt=Zue(Et),Bt.c(),xe(Bt,1),Bt.m(G,null)),Et[8].type==="files"&&Ct.p(Et,Cn),Cn&257){He=Et[8].fields.filter(zue);let mt;for(mt=0;mt<He.length;mt+=1){const he=Fue(Et,He,mt);st[mt]?(st[mt].p(he,Cn),xe(st[mt],1)):(st[mt]=Hue(he),st[mt].c(),xe(st[mt],1),st[mt].m(Re,null))}for(mo(),mt=He.length;mt<st.length;mt+=1)rn(mt);go()}(!ce||Cn&128)&&Vo(Re,"expanded",Et[7])},i(Et){if(!ce){xe(u.$$.fragment,Et),xe(y),xe($.$$.fragment,Et),xe(Qe),xe(Bt),xe(Ct);for(let Cn=0;Cn<He.length;Cn+=1)xe(st[Cn]);ce=!0}},o(Et){Be(u.$$.fragment,Et),Be(y),Be($.$$.fragment,Et),Be(Qe),Be(Bt),Be(Ct),st=st.filter(Boolean);for(let Cn=0;Cn<st.length;Cn+=1)Be(st[Cn]);ce=!1},d(Et){Et&&ke(e),Jt(u),V[b].d(),Jt($),Qe&&Qe.d(),Bt&&Bt.d(),Ct&&Ct.d(),ia(st,Et),Xe=!1,vi(tt)}}}function hTe(o){let e,t;return e=new Xpe({props:{schema:o[8],record:o[4],graph:o[5],isCreateMode:!1}}),e.$on("cancel",o[16]),e.$on("inlinesaved",o[12]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16&&(l.record=s[4]),a&32&&(l.graph=s[5]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function mTe(o){let e,t,s,a,l,u,d,h,b,y,C;return{c(){e=re("div"),t=re("p"),t.textContent="Item was removed from the current record.",s=Ze(),a=re("p"),l=re("button"),l.textContent="Undo",u=Ze(),d=re("button"),d.textContent="Delete completely from channel",h=Ze(),b=re("button"),b.textContent="Dismiss Message",Z(l,"class","btn btn-sm btn-outline border border-1 border-dark"),Z(d,"class","btn btn-sm btn-danger "),Z(b,"class","btn btn-sm btn-link"),Z(e,"class","lx-card bg-danger bg-opacity-10 text-center svelte-4ewolk")},m(E,R){Te(E,e,R),X(e,t),X(e,s),X(e,a),X(a,l),X(a,u),X(a,d),X(e,h),X(e,b),y||(C=[mn(l,"click",o[15]),mn(d,"click",o[17]),mn(b,"click",o[13])],y=!0)},p:un,i:un,o:un,d(E){E&&ke(e),y=!1,vi(C)}}}function gTe(o){let e,t;return e=new Fa({props:{icon:"expand",width:12,height:12}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function pTe(o){let e,t;return e=new Fa({props:{icon:"compress",width:12,height:12}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Que(o){let e,t,s,a,l;return t=new Fa({props:{icon:"circle-chevron-up"}}),{c(){e=re("button"),en(t.$$.fragment),Z(e,"class","btn btn-sm btn-outline-primary border-0")},m(u,d){Te(u,e,d),Kt(t,e,null),s=!0,a||(l=mn(e,"click",ku(o[10])),a=!0)},p:un,i(u){s||(xe(t.$$.fragment,u),s=!0)},o(u){Be(t.$$.fragment,u),s=!1},d(u){u&&ke(e),Jt(t),a=!1,l()}}}function Zue(o){let e,t,s,a,l;return t=new Fa({props:{icon:"circle-chevron-down"}}),{c(){e=re("button"),en(t.$$.fragment),Z(e,"class","btn btn-sm btn-outline-primary border-0")},m(u,d){Te(u,e,d),Kt(t,e,null),s=!0,a||(l=mn(e,"click",ku(o[11])),a=!0)},p:un,i(u){s||(xe(t.$$.fragment,u),s=!0)},o(u){Be(t.$$.fragment,u),s=!1},d(u){u&&ke(e),Jt(t),a=!1,l()}}}function bTe(o){let e,t;return e=new Xw({props:{record:o[0],size:"small"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.record=s[0]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function vTe(o){let e,t=o[0].data[o[21].name]+"",s;return{c(){e=new ewe(!1),s=Rs(),e.a=s},m(a,l){e.m(t,a,l),Te(a,s,l)},p(a,l){l&1&&t!==(t=a[0].data[a[21].name]+"")&&e.p(t)},i:un,o:un,d(a){a&&ke(s),a&&e.d()}}}function OTe(o){let e,t;return e=new qpe({props:{record:o[0],field:o[21]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.record=s[0]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function yTe(o){let e,t;return e=new jpe({props:{record:o[0],field:o[21]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.record=s[0]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Hue(o){let e,t=o[21].label+"",s,a,l,u,d,h;const b=[yTe,OTe,vTe],y=[];function C(E,R){return E[21].ui==="reference"?0:E[21].ui==="file"?1:2}return l=C(o),u=y[l]=b[l](o),{c(){e=re("span"),s=Ht(t),a=Ze(),u.c(),d=Rs(),Z(e,"class","text-muted d-block mt-2"),rs(e,"font-size","13px")},m(E,R){Te(E,e,R),X(e,s),Te(E,a,R),y[l].m(E,R),Te(E,d,R),h=!0},p(E,R){u.p(E,R)},i(E){h||(xe(u),h=!0)},o(E){Be(u),h=!1},d(E){E&&ke(e),E&&ke(a),y[l].d(E),E&&ke(d)}}}function wTe(o){let e,t,s,a;const l=[mTe,hTe,dTe],u=[];function d(h,b){return h[3]?0:h[6]===!0?1:2}return t=d(o),s=u[t]=l[t](o),{c(){e=re("div"),s.c()},m(h,b){Te(h,e,b),u[t].m(e,null),a=!0},p(h,[b]){let y=t;t=d(h),t===y?u[t].p(h,b):(mo(),Be(u[y],1,1,()=>{u[y]=null}),go(),s=u[t],s?s.p(h,b):(s=u[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Be(s),a=!1},d(h){h&&ke(e),u[t].d()}}}const zue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function _Te(o,e,t){let s,a;const l=Ur("channel"),u=Fg();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:y}=e,C,E,R=l.schemas.find(we=>we.name===y.schema);function $(we){we.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+y.id).then(ve=>{t(0,y=ve.data),t(4,C=ve.data.record),t(5,E=ve.data.graph),t(6,s=!0)}).catch(ve=>{console.log(ve)})}function Q(we){we.preventDefault(),u("moveup")}function F(we){we.preventDefault(),u("movedn")}function U(we){we.preventDefault(),u("inlinesaved",we.detail),t(6,s=!1)}function K(we){we.preventDefault(),u("remove",y.id)}function L(we){we.preventDefault(),u("trash",y.id)}function te(we){we.preventDefault(),u("undoremove",y.id)}function ne(we){we.preventDefault(),t(6,s=!1)}W1(()=>{t(6,s=!1)});function oe(we){we.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[y]).then(ve=>{u("remove",y.id)}).catch(ve=>{console.log(ve)})}const G=we=>t(7,a=!a);return o.$$set=we=>{"isFirst"in we&&t(1,d=we.isFirst),"isLast"in we&&t(2,h=we.isLast),"toDelete"in we&&t(3,b=we.toDelete),"record"in we&&t(0,y=we.record)},t(6,s=!1),t(7,a=!1),[y,d,h,b,C,E,s,a,R,$,Q,F,U,K,L,te,ne,oe,G]}class STe extends uo{constructor(e){super(),co(this,e,_Te,wTe,lo,{isFirst:1,isLast:2,toDelete:3,record:0})}}function h1e(o,{from:e,to:t},s={}){const a=getComputedStyle(o),l=a.transform==="none"?"":a.transform,[u,d]=a.transformOrigin.split(" ").map(parseFloat),h=e.left+e.width*u/t.width-(t.left+u),b=e.top+e.height*d/t.height-(t.top+d),{delay:y=0,duration:C=R=>Math.sqrt(R)*120,easing:E=Ppe}=s;return{delay:y,duration:Ub(C)?C(Math.sqrt(h*h+b*b)):C,easing:E,css:(R,$)=>{const Q=$*h,F=$*b,U=R+$*e.width/t.width,K=R+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${K});`}}}function Vue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Wue(o){let e,t;return{c(){e=re("div"),t=Ht(o[3]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&8&&Fn(t,s[3])},d(s){s&&ke(e)}}}function Uue(o){let e=[],t=new Map,s,a,l=o[2];const u=d=>d[18].id;for(let d=0;d<l.length;d+=1){let h=Vue(o,l,d),b=u(h);t.set(b,e[d]=Yue(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){if(h&2039){l=d[2],mo();for(let b=0;b<e.length;b+=1)e[b].r();e=Jd(e,h,u,1,d,l,t,s.parentNode,Dpe,Yue,s,Vue);for(let b=0;b<e.length;b+=1)e[b].a();go()}},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function Yue(o,e){let t,s,a,l,u,d,h,b=un,y;function C(...F){return e[13](e[18],...F)}function E(F){e[14](F,e[18],e[19],e[20])}function R(...F){return e[15](e[20],...F)}function $(...F){return e[16](e[20],...F)}let Q={isFirst:e[20]===0,isLast:e[20]+1===e[2].length,toDelete:e[0].edges.find(C)._isTrashed};return e[18]!==void 0&&(Q.record=e[18]),s=new STe({props:Q}),Ro.push(()=>er(s,"record",E)),s.$on("inlinesaved",e[5]),s.$on("moveup",R),s.$on("movedn",$),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),u=new eI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),u.$on("insert",e[9]),u.$on("save",e[9]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),l=Ze(),en(u.$$.fragment),d=Ze(),Z(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Te(F,t,U),Kt(s,t,null),X(t,l),Kt(u,t,null),X(t,d),y=!0},p(F,U){e=F;const K={};U&4&&(K.isFirst=e[20]===0),U&4&&(K.isLast=e[20]+1===e[2].length),U&7&&(K.toDelete=e[0].edges.find(C)._isTrashed),!a&&U&4&&(a=!0,K.record=e[18],lr(()=>a=!1)),s.$set(K);const L={};U&2&&(L.field=e[1]),U&4&&(L.recordId=e[18].id),u.$set(L)},r(){h=t.getBoundingClientRect()},f(){Tpe(t),b()},a(){b(),b=xpe(t,h,h1e,{delay:250,duration:250,easing:Mpe})},i(F){y||(xe(s.$$.fragment,F),xe(u.$$.fragment,F),y=!0)},o(F){Be(s.$$.fragment,F),Be(u.$$.fragment,F),y=!1},d(F){F&&ke(t),Jt(s),Jt(u)}}}function CTe(o){let e,t,s,a,l,u,d=o[3]&&Wue(o);s=new eI({props:{field:o[1],recordId:null,schemas:o[4]}}),s.$on("insert",o[9]),s.$on("save",o[9]);let h=o[2].length>0&&Uue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[3]?d?d.p(b,y):(d=Wue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const C={};y&2&&(C.field=b[1]),s.$set(C),b[2].length>0?h?(h.p(b,y),y&4&&xe(h,1)):(h=Uue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function kTe(o,e,t){let s,a;const l=Ur("channel");let{field:u}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter(ne=>u.collections.includes(ne.name));function C(ne){const oe=ne.detail.records[0];t(0,h.edges=h.edges.map(G=>G.source===oe.id?oe:G),h)}function E(ne){ne.preventDefault(),t(0,h.edges=h.edges.filter(oe=>!(oe.target===ne.detail&&oe.field===u.name)),h)}function R(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&(oe._isTrashed=!0),oe)),h)}function $(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&delete oe._isTrashed,oe)),h)}function Q(ne){var Oe;ne.preventDefault();const oe=ne.detail.records,G=(Oe=ne.detail.after)!=null?Oe:null,we=ne.detail.action;let ve=oe.map(ce=>({target:ce.id,source:d.id,sourceSchema:d.schema,targetSchema:ce.schema,field:u.name,rank:""})),Re=h.edges;if(we==="replace"&&(Re=Re.filter(ce=>ce.field!==u.name)),t(0,h.records=Lc.exports.uniqBy([...h.records,...oe],ce=>ce.id),h),t(0,h.edges=Lc.exports.uniqBy([...Re,...ve],ce=>ce.target+ce.field),h),!G)t(0,h.edges=Lc.exports.uniqBy([...ve,...Re],ce=>ce.target+ce.field),h);else{let ce=!1,Xe=Re.reduce((tt,ot)=>(ce?tt.after.push(ot):tt.before.push(ot),ce===!1&&ot.target===G&&(ce=!0),tt),{before:[],after:[]});t(0,h.edges=Lc.exports.uniqBy([...Xe.before,...ve,...Xe.after],tt=>tt.target+tt.field),h)}}function F(ne,oe,G){t(0,h.edges=qD(oe,G,h.edges,u.name,a),h)}const U=(ne,oe)=>oe.field===u.name&&oe.target===ne.id;function K(ne,oe,G,we){G[we]=ne,t(2,a),t(0,h),t(1,u),t(11,d)}const L=(ne,oe)=>F(oe,ne,ne-1),te=(ne,oe)=>F(oe,ne,ne+1);return o.$$set=ne=>{"field"in ne&&t(1,u=ne.field),"record"in ne&&t(11,d=ne.record),"graph"in ne&&t(0,h=ne.graph),"validationErrors"in ne&&t(12,b=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&4098&&t(3,s=Lm(b,u.name)),o.$$.dirty&2051&&t(2,a=(ne=h.edges.filter(oe=>oe.field===u.name).map(oe=>h.records.find(G=>G.id==oe.target&&d.id==oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},[h,u,a,s,y,C,E,R,$,Q,F,d,b,U,K,L,te]}class xTe extends uo{constructor(e){super(),co(this,e,kTe,CTe,lo,{field:1,record:11,graph:0,validationErrors:12})}}function m1e(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:zle(),value:null}),s),[]):[{meta:e,id:zle(),value:null},...o]}function Xue(o,e,t){const s=o.slice();return s[7]=e[t],s}function jue(o){let e,t=o[1].fields,s=[];for(let a=0;a<t.length;a+=1)s[a]=que(Xue(o,t,a));return{c(){e=re("div");for(let a=0;a<s.length;a+=1)s[a].c();Z(e,"class","d-flex ")},m(a,l){Te(a,e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null)},p(a,l){if(l&10){t=a[1].fields;let u;for(u=0;u<t.length;u+=1){const d=Xue(a,t,u);s[u]?s[u].p(d,l):(s[u]=que(d),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=t.length}},d(a){a&&ke(e),ia(s,a)}}}function que(o){let e,t,s=o[7].label+"",a,l,u,d;function h(...b){return o[6](o[7],...b)}return{c(){e=re("div"),t=re("button"),a=Ht(s),l=Ze(),Z(t,"class","btn btn-sm btn-primary"),Z(e,"class","ms-2")},m(b,y){Te(b,e,y),X(e,t),X(t,a),X(e,l),u||(d=mn(t,"click",h),u=!0)},p(b,y){o=b,y&2&&s!==(s=o[7].label+"")&&Fn(a,s)},d(b){b&&ke(e),u=!1,d()}}}function TTe(o){let e,t,s,a,l,u,d;s=new Fa({props:{width:24,height:24,icon:"circle-plus"}});let h=o[2]&&jue(o);return{c(){e=re("div"),t=re("button"),en(s.$$.fragment),a=Ze(),h&&h.c(),Z(t,"type","button"),Z(t,"class","btn btn-lg btn-link text-decoration-none block-buttons svelte-1u8jpgc"),Vo(t,"is-first",!o[0]),Z(e,"class","d-flex justify-content-left mb-2 ")},m(b,y){Te(b,e,y),X(e,t),Kt(s,t,null),X(e,a),h&&h.m(e,null),l=!0,u||(d=mn(t,"click",ku(o[5])),u=!0)},p(b,[y]){(!l||y&1)&&Vo(t,"is-first",!b[0]),b[2]?h?h.p(b,y):(h=jue(b),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(b){l||(xe(s.$$.fragment,b),l=!0)},o(b){Be(s.$$.fragment,b),l=!1},d(b){b&&ke(e),Jt(s),h&&h.d(),u=!1,d()}}}function ETe(o,e,t){let s,{blockId:a=""}=e,{blockData:l}=e,{blockSchema:u}=e;function d(y,C){y.preventDefault(),t(4,l=m1e(l,C)),t(2,s=!1)}const h=y=>t(2,s=!s),b=(y,C)=>d(C,y);return o.$$set=y=>{"blockId"in y&&t(0,a=y.blockId),"blockData"in y&&t(4,l=y.blockData),"blockSchema"in y&&t(1,u=y.blockSchema)},t(2,s=!1),[a,u,s,d,l,h,b]}class ATe extends uo{constructor(e){super(),co(this,e,ETe,TTe,lo,{blockId:0,blockData:4,blockSchema:1})}}function DTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("input"),Z(t,"type","text"),Z(t,"id",s=o[0].id),Z(t,"class","form-control"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),a||(l=mn(t,"input",o[1]),a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&t.value!==u[0].value&&ar(t,u[0].value)},i:un,o:un,d(u){u&&ke(e),a=!1,l()}}}function PTe(o,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class MTe extends uo{constructor(e){super(),co(this,e,PTe,DTe,lo,{block:0})}}function RTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("textarea"),Z(t,"id",s=o[0].id),Z(t,"class","form-control svelte-1er4ovm"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),o[3](t),a||(l=[mn(t,"input",o[2]),mn(t,"input",g1e)],a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&ar(t,u[0].value)},i:un,o:un,d(u){u&&ke(e),o[3](null),a=!1,vi(l)}}}function g1e(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function $Te(o,e,t){let{block:s}=e,a;W1(()=>{g1e(a)});function l(){s.value=this.value,t(0,s)}function u(d){Ro[d?"unshift":"push"](()=>{a=d,t(1,a)})}return o.$$set=d=>{"block"in d&&t(0,s=d.block)},[s,a,l,u]}class NTe extends uo{constructor(e){super(),co(this,e,$Te,RTe,lo,{block:0})}}var p1e={exports:{}};(function(o){(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 c=Array.prototype.slice.call(n);return c.sort(i)},a=function(n,i){return l(function(c,m){return n.eq(i(c),i(m))})},l=function(n){return{eq:n}},u=l(function(n,i){return n===i}),d=u,h=function(n){return l(function(i,c){if(i.length!==c.length)return!1;for(var m=i.length,p=0;p<m;p++)if(!n.eq(i[p],c[p]))return!1;return!0})},b=function(n,i){return a(h(n),function(c){return s(c,i)})},y=function(n){return l(function(i,c){var m=Object.keys(i),p=Object.keys(c);if(!b(d).eq(m,p))return!1;for(var w=m.length,x=0;x<w;x++){var M=m[x];if(!n.eq(i[M],c[M]))return!1}return!0})},C=l(function(n,i){if(n===i)return!0;var c=e(n),m=e(i);return c!==m?!1:t(c)?n===i:c==="array"?h(C).eq(n,i):c==="object"?y(C).eq(n,i):!1});const E=Object.getPrototypeOf,R=(n,i,c)=>{var m;return c(n,i.prototype)?!0:((m=n.constructor)===null||m===void 0?void 0:m.name)===i.name},$=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&R(n,String,(c,m)=>m.isPrototypeOf(c))?"string":i},Q=n=>i=>$(i)===n,F=n=>i=>typeof i===n,U=n=>i=>n===i,K=(n,i)=>te(n)&&R(n,i,(c,m)=>E(c)===m),L=Q("string"),te=Q("object"),ne=n=>K(n,Object),oe=Q("array"),G=U(null),we=F("boolean"),ve=U(void 0),Re=n=>n==null,Oe=n=>!Re(n),ce=F("function"),Xe=F("number"),tt=(n,i)=>{if(oe(n)){for(let c=0,m=n.length;c<m;++c)if(!i(n[c]))return!1;return!0}return!1},ot=()=>{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ut=(n,i)=>c=>n(i(c)),Qe=n=>()=>n,Bt=n=>n,Ct=(n,i)=>n===i;function He(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const st=n=>i=>!n(i),rn=n=>()=>{throw new Error(n)},Et=n=>n(),Cn=n=>{n()},je=Qe(!1),mt=Qe(!0);class he{constructor(i,c){this.tag=i,this.value=c}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,c){return this.tag?c(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.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:he.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 Oe(i)?he.some(i):he.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()"}}he.singletonNone=new he(!1);const Zo=Array.prototype.slice,Kn=Array.prototype.indexOf,so=Array.prototype.push,Yo=(n,i)=>Kn.call(n,i),as=(n,i)=>{const c=Yo(n,i);return c===-1?he.none():he.some(c)},kt=(n,i)=>Yo(n,i)>-1,jt=(n,i)=>{for(let c=0,m=n.length;c<m;c++){const p=n[c];if(i(p,c))return!0}return!1},pt=(n,i)=>{const c=n.length,m=new Array(c);for(let p=0;p<c;p++){const w=n[p];m[p]=i(w,p)}return m},Ne=(n,i)=>{for(let c=0,m=n.length;c<m;c++){const p=n[c];i(p,c)}},Gt=(n,i)=>{for(let c=n.length-1;c>=0;c--){const m=n[c];i(m,c)}},bn=(n,i)=>{const c=[],m=[];for(let p=0,w=n.length;p<w;p++){const x=n[p];(i(x,p)?c:m).push(x)}return{pass:c,fail:m}},At=(n,i)=>{const c=[];for(let m=0,p=n.length;m<p;m++){const w=n[m];i(w,m)&&c.push(w)}return c},An=(n,i,c)=>(Gt(n,(m,p)=>{c=i(c,m,p)}),c),zn=(n,i,c)=>(Ne(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;m<p;m++){const w=n[m];if(i(w,m))return he.some(w);if(c(w,m))break}return he.none()},oo=(n,i)=>ps(n,i,je),Ss=(n,i)=>{for(let c=0,m=n.length;c<m;c++){const p=n[c];if(i(p,c))return he.some(c)}return he.none()},Mr=n=>{const i=[];for(let c=0,m=n.length;c<m;++c){if(!oe(n[c]))throw new Error("Arr.flatten item "+c+" was not an array, input: "+n);so.apply(i,n[c])}return i},$s=(n,i)=>Mr(pt(n,i)),tr=(n,i)=>{for(let c=0,m=n.length;c<m;++c){const p=n[c];if(i(p,c)!==!0)return!1}return!0},Xs=n=>{const i=Zo.call(n,0);return i.reverse(),i},wa=(n,i)=>At(n,c=>!kt(i,c)),dr=(n,i)=>{const c={};for(let m=0,p=n.length;m<p;m++){const w=n[m];c[String(w)]=i(w,m)}return c},Ns=(n,i)=>{const c=Zo.call(n,0);return c.sort(i),c},qr=(n,i)=>i>=0&&i<n.length?he.some(n[i]):he.none(),$o=n=>qr(n,0),Po=n=>qr(n,n.length-1),Rr=ce(Array.from)?Array.from:n=>Zo.call(n),Ls=(n,i)=>{for(let c=0;c<n.length;c++){const m=i(n[c],c);if(m.isSome())return m}return he.none()},aa=(n,i)=>{const c=[],m=ce(i)?p=>jt(c,w=>i(w,p)):p=>kt(c,p);for(let p=0,w=n.length;p<w;p++){const x=n[p];m(x)||c.push(x)}return c},bs=Object.keys,_a=Object.hasOwnProperty,ln=(n,i)=>{const c=bs(n);for(let m=0,p=c.length;m<p;m++){const w=c[m],x=n[w];i(x,w)}},vs=(n,i)=>Qi(n,(c,m)=>({k:m,v:i(c,m)})),Qi=(n,i)=>{const c={};return ln(n,(m,p)=>{const w=i(m,p);c[w.k]=w.v}),c},ze=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,w)=>{(i(p,w)?c:m)(p,w)})},Tt=(n,i)=>{const c={},m={};return et(n,i,ze(c),ze(m)),{t:c,f:m}},Wt=(n,i)=>{const c={};return et(n,i,ze(c),ot),c},Yn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},po=n=>Yn(n,Bt),wo=(n,i)=>fn(n,i)?he.from(n[i]):he.none(),fn=(n,i)=>_a.call(n,i),os=(n,i)=>fn(n,i)&&n[i]!==void 0&&n[i]!==null,xo=(n,i,c=C)=>y(c).eq(n,i),fs=n=>{const i={};return Ne(n,c=>{i[c]={}}),bs(i)},kr=n=>n.length!==void 0,Lr=Array.isArray,Vs=n=>{if(Lr(n))return n;{const i=[];for(let c=0,m=n.length;c<m;c++)i[c]=n[c];return i}},Yr=(n,i,c)=>{if(!n)return!1;if(c=c||n,kr(n)){for(let m=0,p=n.length;m<p;m++)if(i.call(c,n[m],m,n)===!1)return!1}else for(const m in n)if(fn(n,m)&&i.call(c,n[m],m,n)===!1)return!1;return!0},Zi=(n,i)=>{const c=[];return Yr(n,(m,p)=>{c.push(i(m,p,n))}),c},Qa=(n,i)=>{const c=[];return Yr(n,(m,p)=>{(!i||i(m,p,n))&&c.push(m)}),c},Oi=(n,i)=>{if(n){for(let c=0,m=n.length;c<m;c++)if(n[c]===i)return c}return-1},Ge=(n,i,c,m)=>{let p=ve(c)?n[0]:c;for(let w=0;w<n.length;w++)p=i.call(m,p,n[w],w);return p},qe=(n,i,c)=>{for(let m=0,p=n.length;m<p;m++)if(i.call(c,n[m],m,n))return m;return-1},Nt=n=>n[n.length-1],Ut=n=>{let i=!1,c;return(...m)=>(i||(i=!0,c=n.apply(null,m)),c)},bo=(n,i,c,m)=>{const p=n.isiOS()&&/ipad/i.test(c)===!0,w=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),M=x||m("(pointer:coarse)"),B=p||!w&&x&&m("(min-device-width:768px)"),q=w||x&&!B,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!q&&!B&&!ae;return{isiPad:Qe(p),isiPhone:Qe(w),isTablet:Qe(B),isPhone:Qe(q),isTouch:Qe(M),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:Qe(ae),isDesktop:Qe(fe)}},Lo=(n,i)=>{for(let c=0;c<n.length;c++){const m=n[c];if(m.test(i))return m}},Go=(n,i)=>{const c=Lo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Xo(m(1),m(2))},ei=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?lt():Go(n,c)},lt=()=>Xo(0,0),Xo=(n,i)=>({major:n,minor:i}),Ni={nu:Xo,detect:ei,unknown:lt},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var w;return m===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Ni.nu(parseInt(c.version,10),0)}))}),ma=(n,i)=>{const c=String(i).toLowerCase();return oo(n,m=>m.search(c))},gr=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Fc=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Cc=(n,i)=>n.substring(i),nl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?Cc(n,i.length):n,nr=(n,i,c=0,m)=>{const p=n.indexOf(i,c);return p!==-1?ve(m)?!0:p+i.length<=m:!1},Ar=(n,i)=>nl(n,i,0),Ki=(n,i)=>nl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),kc=gl(/^\s+|\s+$/g),nu=gl(/^\s+/g),xu=gl(/\s+$/g),yr=n=>n.length>0,ol=n=>!yr(n),Tu=(n,i)=>i<=0?"":new Array(i+1).join(n),ou=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Yl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>nr(i,n),Dr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>nr(n,"edge/")&&nr(n,"chrome")&&nr(n,"safari")&&nr(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yl],search:n=>nr(n,"chrome")&&!nr(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>nr(n,"msie")||nr(n,"trident")},{name:"Opera",versionRegexes:[Yl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Yl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(nr(n,"safari")||nr(n,"mobile/"))&&nr(n,"applewebkit")}],Qm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>nr(n,"iphone")||nr(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]+).*/]}],xf={browsers:Qe(Dr),oses:Qe(Qm)},xr="Edge",Za="Chromium",ca="IE",Ji="Opera",Eu="Firefox",Qc="Safari",Ha=()=>Zc({current:void 0,version:Ni.unknown()}),Zc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Za),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Eu),isSafari:m(Qc)}},xc={unknown:Ha,nu:Zc,edge:Qe(xr),chromium:Qe(Za),ie:Qe(ca),opera:Qe(Ji),firefox:Qe(Eu),safari:Qe(Qc)},Cd="Windows",Yf="iOS",Au="Android",Xl="Linux",Hc="macOS",Tf="Solaris",su="FreeBSD",kd="ChromeOS",De=()=>nt({current:void 0,version:Ni.unknown()}),nt=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(Cd),isiOS:m(Yf),isAndroid:m(Au),isMacOS:m(Hc),isLinux:m(Xl),isSolaris:m(Tf),isFreeBSD:m(su),isChromeOS:m(kd)}},bt={unknown:De,nu:nt,windows:Qe(Cd),ios:Qe(Yf),android:Qe(Au),linux:Qe(Xl),macos:Qe(Hc),solaris:Qe(Tf),freebsd:Qe(su),chromeos:Qe(kd)},On={detect:(n,i,c)=>{const m=xf.browsers(),p=xf.oses(),w=i.bind(B=>la(m,B)).orThunk(()=>gr(m,n)).fold(xc.unknown,xc.nu),x=Fc(p,n).fold(bt.unknown,bt.nu),M=bo(x,w,n,c);return{browser:w,os:x,deviceType:M}}},Mo=n=>window.matchMedia(n).matches;let $r=Ut(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Mo));const ys=()=>$r(),ls=navigator.userAgent,Di=ys(),js=Di.browser,Hi=Di.os,Du=Di.deviceType,xd=ls.indexOf("Windows Phone")!==-1,qn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:xd,browser:{current:js.current,version:js.version,isChromium:js.isChromium,isEdge:js.isEdge,isFirefox:js.isFirefox,isIE:js.isIE,isOpera:js.isOpera,isSafari:js.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:Du.isDesktop,isiPad:Du.isiPad,isiPhone:Du.isiPhone,isPhone:Du.isPhone,isTablet:Du.isTablet,isTouch:Du.isTouch,isWebView:Du.isWebView}},Zm=/^\s*|\s*$/g,zi=n=>Re(n)?"":(""+n).replace(Zm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,$e=(n,i,c={})=>{const m=L(n)?n.split(i||","):n||[];let p=m.length;for(;p--;)c[m[p]]={};return c},Ue=fn,It=(n,...i)=>{for(let c=0;c<i.length;c++){const m=i[c];for(const p in m)if(fn(m,p)){const w=m[p];w!==void 0&&(n[p]=w)}}return n},Bn=function(n,i,c,m){m=m||this,n&&(c&&(n=n[c]),Yr(n,(p,w)=>i.call(m,p,w,c)===!1?!1:(Bn(p,i,c,m),!0)))},gn={trim:zi,isArray:Lr,is:me,toArray:Vs,makeMap:$e,each:Yr,map:Zi,grep:Qa,inArray:Oi,hasOwn:Ue,extend:It,walk:Bn,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;m<p&&(i=i[c[m]],!!i);m++);return i},explode:(n,i)=>oe(n)?n:n===""?[]:Zi(n.split(i||","),zi),_addCacheSuffix:n=>{const i=qn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},Gr=(n,i,c=Ct)=>n.exists(m=>c(m,i)),Ll=(n,i,c=Ct)=>ri(n,i,c).getOr(n.isNone()&&i.isNone()),ea=n=>{const i=[],c=m=>{i.push(m)};for(let m=0;m<n.length;m++)n[m].each(c);return i},ri=(n,i,c)=>n.isSome()&&i.isSome()?he.some(c(n.getOrDie(),i.getOrDie())):he.none(),Ef=(n,i,c,m)=>n.isSome()&&i.isSome()&&c.isSome()?he.some(m(n.getOrDie(),i.getOrDie(),c.getOrDie())):he.none(),ks=(n,i)=>n?he.some(i):he.none(),ru=typeof window<"u"?window:Function("return this;")(),Pi=(n,i)=>{let c=i!=null?i:ru;for(let m=0;m<n.length&&c!==void 0&&c!==null;++m)c=c[n[m]];return c},uc=(n,i)=>{const c=n.split(".");return Pi(c,i)},Ii=(n,i)=>uc(n,i),Xf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,jf=n=>Xf("HTMLElement",n),pr=n=>{const i=uc("ownerDocument.defaultView",n);return te(n)&&(jf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},Gu=8,Ku=9,Tc=11,qf=1,eh=3,ti=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,za=n=>i=>ta(i)===n,Kb=n=>ta(n)===Gu||ti(n)==="#comment",Mi=n=>kl(n)&&pr(n.dom),kl=za(qf),sl=za(eh),Zg=za(Ku),Gf=za(Tc),Ec=n=>i=>kl(i)&&ti(i)===n,Af=(n,i,c)=>{if(L(c)||we(c)||Xe(c))n.setAttribute(i,c+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",c,":: Element ",n),new Error("Attribute value was not simple")},Pr=(n,i,c)=>{Af(n.dom,i,c)},Ju=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{Af(c,p,m)})},Fl=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},Va=(n,i)=>he.from(Fl(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},fc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Kf=n=>zn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),th=(n,i)=>{const c=Fl(n,i);return c===void 0||c===""?[]:c.split(" ")},Hg=(n,i,c)=>{const p=th(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Hm=(n,i,c)=>{const m=At(th(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Ql=n=>n.dom.classList!==void 0,zm=n=>th(n,"class"),rl=(n,i)=>Hg(n,"class",i),Df=(n,i)=>Hm(n,"class",i),jh=(n,i)=>kt(zm(n),i)?Df(n,i):rl(n,i),ef=(n,i)=>{Ql(n)?n.dom.classList.add(i):rl(n,i)},qh=n=>{(Ql(n)?n.dom.classList:zm(n)).length===0&&Vi(n,"class")},zc=(n,i)=>{Ql(n)?n.dom.classList.remove(i):Df(n,i),qh(n)},Gh=(n,i)=>{const c=Ql(n)?n.dom.classList.toggle(i):jh(n,i);return qh(n),c},Pf=(n,i)=>Ql(n)&&n.dom.classList.contains(i),zp=(n,i)=>{const m=(i||document).createElement("div");if(m.innerHTML=n,!m.hasChildNodes()||m.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return jl(m.childNodes[0])},Vm=(n,i)=>{const m=(i||document).createElement(n);return jl(m)},Jf=(n,i)=>{const m=(i||document).createTextNode(n);return jl(m)},jl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ke={fromHtml:zp,fromTag:Vm,fromText:Jf,fromDom:jl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(jl)},nh=(n,i)=>{const c=[],m=w=>(c.push(w),i(w));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Pu=(n,i)=>{const c=n.dom;if(c.nodeType!==qf)return!1;{const m=c;if(m.matches!==void 0)return m.matches(i);if(m.msMatchesSelector!==void 0)return m.msMatchesSelector(i);if(m.webkitMatchesSelector!==void 0)return m.webkitMatchesSelector(i);if(m.mozMatchesSelector!==void 0)return m.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Vg=n=>n.nodeType!==qf&&n.nodeType!==Ku&&n.nodeType!==Tc||n.childElementCount===0,U1=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?[]:pt(c.querySelectorAll(n),Ke.fromDom)},Kh=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?he.none():he.from(c.querySelector(n)).map(Ke.fromDom)},vt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},an=n=>Ke.fromDom(n.dom.ownerDocument),Eo=n=>Zg(n)?n:an(n),or=n=>Ke.fromDom(Eo(n).dom.documentElement),Xr=n=>Ke.fromDom(Eo(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ke.fromDom),wi=n=>he.from(n.dom.parentElement).map(Ke.fromDom),oh=(n,i)=>{const c=ce(i)?i:je;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const w=m.parentNode,x=Ke.fromDom(w);if(p.push(x),c(x)===!0)break;m=w}return p},Jb=n=>{const i=c=>At(c,m=>!vt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ke.fromDom),Td=n=>he.from(n.dom.nextSibling).map(Ke.fromDom),Wg=n=>Xs(nh(n,Sa)),il=n=>nh(n,Td),Da=n=>pt(n.dom.childNodes,Ke.fromDom),tf=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ke.fromDom)},ii=n=>tf(n,0),Mu=n=>tf(n,n.dom.childNodes.length-1),dc=n=>n.dom.childNodes.length,Jh=n=>n.dom.hasChildNodes(),Y1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ke.fromDom(i)},sh=n=>Gf(n)&&Oe(n.dom.host),Ug=ce(Element.prototype.attachShadow)&&ce(Node.prototype.getRootNode),rh=Qe(Ug),ql=Ug?n=>Ke.fromDom(n.dom.getRootNode()):Eo,em=n=>sh(n)?n:Y1(Eo(n)),X1=n=>sh(n)?n:Ke.fromDom(Eo(n).dom.body),Wm=n=>{const i=ql(n);return sh(i)?he.some(i):he.none()},Yg=n=>Ke.fromDom(n.dom.host),tm=n=>{if(rh()&&Oe(n.target)){const i=Ke.fromDom(n.target);if(kl(i)&&ih(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return $o(c)}}return he.from(n.target)},ih=n=>Oe(n.dom.shadowRoot),Ed=n=>{const i=sl(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Wm(Ke.fromDom(i)).fold(()=>c.body.contains(i),ut(Ed,Yg))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ce(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ce(c)?c:je;for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m);if(i(w))return he.some(w);if(p(w))break}return he.none()},Zl=(n,i,c)=>ai((p,w)=>w(p),di,n,i,c),Vp=(n,i)=>{const c=n.dom;return c.parentNode?ee(Ke.fromDom(c.parentNode),m=>!vt(n,m)&&i(m)):he.none()},ee=(n,i)=>{const c=p=>i(Ke.fromDom(p));return oo(n.dom.childNodes,c).map(Ke.fromDom)},ue=(n,i)=>{const c=m=>{for(let p=0;p<m.childNodes.length;p++){const w=Ke.fromDom(m.childNodes[p]);if(i(w))return he.some(w);const x=c(m.childNodes[p]);if(x.isSome())return x}return he.none()};return c(n.dom)},Se=(n,i,c)=>di(n,m=>Pu(m,i),c),Je=(n,i)=>Kh(i,n),at=(n,i,c)=>ai((p,w)=>Pu(p,w),Se,n,i,c),Dn=n=>at(n,"[contenteditable]"),wn=(n,i=!1)=>Ed(n)?n.dom.isContentEditable:Dn(n).fold(Qe(i),c=>Ko(c)==="true"),Ko=n=>n.dom.contentEditable,ss=n=>n.style!==void 0&&ce(n.style.getPropertyValue),vo=(n,i,c)=>{if(!L(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);ss(n)&&n.style.setProperty(i,c)},Tr=(n,i)=>{ss(n)&&n.style.removeProperty(i)},Gl=(n,i,c)=>{const m=n.dom;vo(m,i,c)},ua=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{vo(c,p,m)})},Bi=(n,i)=>{const c=n.dom,p=window.getComputedStyle(c).getPropertyValue(i);return p===""&&!Ed(n)?Ru(c,i):p},Ru=(n,i)=>ss(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Ru(c,i);return he.from(m).filter(p=>p.length>0)},nm=n=>{const i={},c=n.dom;if(ss(c))for(let m=0;m<c.style.length;m++){const p=c.style.item(m);i[p]=c.style[p]}return i},Um=(n,i)=>{const c=n.dom;Tr(c,i),Gr(Va(n,"style").map(kc),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},iu=(n,i)=>{Td(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},ah=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},e0=(n,i)=>{Ca(n,i),na(i,n)},Dv=(n,i)=>{Ne(i,(c,m)=>{const p=m===0?n:i[m-1];iu(p,c)})},ni=(n,i)=>{Ne(i,c=>{na(n,c)})},Ad=n=>{n.dom.textContent="",Ne(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Kl=n=>{const i=Da(n);i.length>0&&Dv(n,i),wr(n)},ed=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ke.fromDom(m))},lh=n=>pt(n,Ke.fromDom),Ae=n=>n.dom.innerHTML,Mf=(n,i)=>{const m=an(n).dom,p=Ke.fromDom(m.createDocumentFragment()),w=ed(i,m);ni(p,w),Ad(n),na(n,p)},Xg=n=>{const i=Ke.fromTag("div"),c=Ke.fromDom(n.dom.cloneNode(!0));return na(i,c),Ae(i)},$u=(n,i,c,m,p,w,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:w,raw:x}),hi=n=>{const i=Ke.fromDom(tm(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return $u(i,n.clientX,n.clientY,c,m,p,n)},Pv=(n,i)=>c=>{n(c)&&i(hi(c))},j1=(n,i,c,m,p)=>{const w=Pv(c,m);return n.dom.addEventListener(i,w,p),{unbind:He(td,n,i,w,p)}},t0=(n,i,c,m)=>j1(n,i,c,m,!1),td=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Ym=(n,i)=>({left:n,top:i,translate:(m,p)=>Ym(n+m,i+p)}),jg=Ym,Mv=n=>{const i=n.getBoundingClientRect();return jg(i.left,i.top)},Rf=(n,i)=>n!==void 0?n:i!==void 0?i:0,xy=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return jg(c.offsetLeft,c.offsetTop);const w=Rf(m==null?void 0:m.pageYOffset,p.scrollTop),x=Rf(m==null?void 0:m.pageXOffset,p.scrollLeft),M=Rf(p.clientTop,c.clientTop),B=Rf(p.clientLeft,c.clientLeft);return Nu(n).translate(x-B,w-M)},Nu=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?jg(m.offsetLeft,m.offsetTop):Ed(n)?Mv(i):jg(0,0)},nf=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return jg(c,m)},n0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},o0=(n,i)=>{ys().browser.isSafari()&&ce(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},s0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},q1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),nd=n=>{const i=n===void 0?window:n,c=i.document,m=nf(Ke.fromDom(c));return s0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,x=p.clientHeight;return q1(m.left,m.top,w,x)},p=>q1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},r0=(n,i)=>At(Da(n),i),i0=(n,i)=>{let c=[];return Ne(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(i0(m,i))}),c},pl=(n,i)=>U1(i,n),Ty=(n,i,c)=>Se(n,i,c).isSome();class _i{constructor(i,c){this.node=i,this.rootNode=c,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,c,m,p){if(i){if(!p&&i[c])return i[c];if(i!==this.rootNode){let w=i[m];if(w)return w;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(w=x[m],w)return w}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let w=m.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const fo=n=>i=>!!i&&i.nodeType===n,Dd=n=>!!n&&!Object.getPrototypeOf(n),Jn=fo(1),Ac=n=>{const i=n.toLowerCase();return c=>Oe(c)&&c.nodeName.toLowerCase()===i},$f=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return kt(i,m)}return!1}},ch=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let w=0;w<c.length;w++){const x=p.getComputedStyle(m,null);if((x?x.getPropertyValue(n):null)===c[w])return!0}}return!1}},Vc=n=>i=>Jn(i)&&i.hasAttribute(n),qg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Pd=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Iu=n=>Jn(n)&&n.tagName==="TABLE",Wp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),G1=$f(["textarea","input"]),_n=fo(3),Xm=fo(4),Md=fo(7),uh=fo(8),of=fo(9),K1=fo(11),mi=Ac("br"),Ui=Ac("img"),ba=Wp("true"),Es=Wp("false"),Rd=$f(["td","th"]),xl=$f(["td","th","caption"]),sf=$f(["video","audio","object","embed"]),Wa=Ac("li"),ka=Ac("details"),Up=Ac("summary"),nn="\uFEFF",Kr="\xA0",a0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),Gg=((n,i)=>{const c=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return m(w).getOr("")},m=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:c,getOption:m,set:(w,x)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=x}}})(sl,"text"),Wc=n=>Gg.get(n),od=n=>Gg.getOption(n),sd=(n,i)=>Gg.set(n,i),Yp=["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"],Hl=["td","th"],Er=["thead","tbody","tfoot"],Ya=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],fh=["h1","h2","h3","h4","h5","h6"],Jl=["li","dd","dt"],l0=["ul","ol","dl"],jm=["pre","script","textarea","style"],J1=["pre"].concat(fh),Xa=n=>{let i;return c=>(i=i||dr(n,mt),fn(i,ti(c)))},hc=Xa(Yp),xt=n=>ti(n)==="table",Dc=n=>kl(n)&&!hc(n),au=n=>kl(n)&&ti(n)==="br",mc=Xa(Ya),Bu=Xa(l0),ja=Xa(Jl),qa=Xa(Er),qm=Xa(Hl),lu=Xa(jm),c0=Xa(J1),Ho=n=>c0(n)||Dc(n),z=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ke.fromDom(c)),c=c.lastChild;return i},j=n=>{const i=pl(n,"br"),c=At(z(n).slice(-1),au);i.length===c.length&&Ne(c,wr)},ye=()=>{const n=Ke.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},Pe=n=>{Ad(n),na(n,ye())},ct=n=>{Mu(n).each(i=>{Sa(i).each(c=>{hc(n)&&au(i)&&hc(c)&&wr(i)})})},Ft=nn,Sn=a0,In=xa,Uo=Jn,ts=_n,Si=n=>(ts(n)&&(n=n.parentNode),Uo(n)&&n.hasAttribute("data-mce-caret")),sr=n=>ts(n)&&Sn(n.data),_r=n=>Si(n)||sr(n),Uc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),cu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),w=n.parentNode;if(i){const x=n.previousSibling;if(ts(x)){if(_r(x))return x;if(hr(x))return x.splitText(x.data.length-1)}w==null||w.insertBefore(p,n)}else{const x=n.nextSibling;if(ts(x)){if(_r(x))return x;if(hh(x))return x.splitText(1),x}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},rf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&sr(i.previousSibling):!1},Nf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&sr(i.nextSibling):!1},dh=(n,i,c)=>{var m;const w=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);w.setAttribute("data-mce-caret",c?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(ye().dom);const x=i.parentNode;return c?x==null||x.insertBefore(w,i):i.nextSibling?x==null||x.insertBefore(w,i.nextSibling):x==null||x.appendChild(w),w},hh=n=>ts(n)&&n.data[0]===Ft,hr=n=>ts(n)&&n.data[n.data.length-1]===Ft,Gm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Pd(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},Km=n=>n&&n.hasAttribute("data-mce-caret")?(Gm(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,oa=n=>Si(n.startContainer),uu=ba,Xp=Es,Jm=mi,Ps=_n,Fr=$f(["script","style","textarea"]),Ma=$f(["img","input","textarea","hr","iframe","video","audio","object","embed"]),gc=$f(["table"]),eb=_r,Tl=n=>eb(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Jm(n)||gc(n)||fu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",fu=n=>!Gi(n)&&Xp(n),If=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(fu(c))return!1;if(uu(c))return!0}return!0},Jw=n=>fu(n)?!zn(Rr(n.getElementsByTagName("*")),(i,c)=>i||uu(c),!1):!1,om=n=>Ma(n)||Jw(n),Kg=(n,i)=>Tl(n)&&If(n,i),sm=/^[ \t\r\n]*$/,eg=n=>sm.test(n),Jg=n=>{for(const i of n)if(!a0(i))return!1;return!0},u0=n=>" \f \v".indexOf(n)!==-1,rm=n=>n===`
|
|
`||n==="\r",Ra=(n,i)=>i<n.length&&i>=0?rm(n[i]):!1,mh=(n,i=4,c=!0,m=!0)=>{const p=Tu(" ",i),w=n.replace(/\t/g,p);return zn(w,(M,B)=>u0(B)||B===Kr?M.pcIsSpace||M.str===""&&c||M.str.length===w.length-1&&m||Ra(w,M.str.length+1)?{pcIsSpace:!1,str:M.str+Kr}:{pcIsSpace:!0,str:M.str+" "}:{pcIsSpace:rm(B),str:M.str+B},{pcIsSpace:!1,str:""}).str},$d=(n,i)=>{const c=Ke.fromDom(i),m=Ke.fromDom(n);return Ty(m,"pre,code",He(vt,c))},tg=(n,i)=>_n(n)&&eg(n.data)&&!$d(n,i),ng=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),im=(n,i)=>Tl(n)&&!tg(n,i)||ng(n)||af(n),af=Vc("data-mce-bookmark"),f0=Vc("data-mce-bogus"),tb=qg("data-mce-bogus","all"),e_=(n,i)=>{let c=0;if(im(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new _i(m,n);do{if(i){if(tb(m)){m=p.next(!0);continue}if(f0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(im(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>e_(n.dom,i),ep="data-mce-block",og=n=>At(bs(n),i=>!/[A-Z]/.test(i)),du=n=>og(n).join(","),Bf=(n,i)=>Oe(i.querySelector(n))?(i.setAttribute(ep,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(ep),!1),sg=(n,i)=>{const c=du(n.getTransparentElements()),m=du(n.getBlockElements());return At(i.querySelectorAll(c),p=>Bf(m,p))},gh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ke.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},Lu=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();gh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const w=c.extractContents();gh(w,!1),$a(Ke.fromDom(p))||m.insertBefore(p,n),$a(Ke.fromDom(i))||m.insertBefore(i,n),$a(Ke.fromDom(w))||m.insertBefore(w,n),m.removeChild(n)}},Nd=(n,i,c)=>{const m=n.getBlockElements(),p=Ke.fromDom(i),w=M=>ti(M)in m,x=M=>vt(M,p);Ne(lh(c),M=>{di(M,w,x).each(B=>{const q=r0(M,ae=>w(ae)&&!n.isValidChild(ti(B),ti(ae)));if(q.length>0){const ae=wi(B);Ne(q,fe=>{di(fe,w,x).each(be=>{Lu(be.dom,fe.dom)})}),ae.each(fe=>sg(n,fe.dom))}})})},rg=(n,i,c)=>{Ne([...c,...ig(n,i)?[i]:[]],m=>Ne(pl(Ke.fromDom(m),m.nodeName.toLowerCase()),p=>{Iv(n,p.dom)&&Kl(p)}))},d0=(n,i)=>{const c=sg(n,i);Nd(n,i,c),rg(n,i,c)},Rv=(n,i)=>{if(Nv(n,i)){const c=du(n.getBlockElements());Bf(c,i)}},$v=(n,i,c)=>{const m=w=>vt(w,Ke.fromDom(i)),p=oh(Ke.fromDom(c),m);qr(p,p.length-2).filter(kl).fold(()=>d0(n,i),w=>d0(n,w.dom))},ph=n=>n.hasAttribute(ep),tp=(n,i)=>fn(n.getTransparentElements(),i),Nv=(n,i)=>Jn(i)&&tp(n,i.nodeName),ig=(n,i)=>Nv(n,i)&&ph(i),Iv=(n,i)=>Nv(n,i)&&!ph(i),rr=(n,i)=>i.type===1&&tp(n,i.name)&&L(i.attr(ep)),Ao=ys().browser,bh=n=>oo(n,kl),nb=n=>Ao.isFirefox()&&ti(n)==="table"?bh(Da(n)).filter(i=>ti(i)==="caption").bind(i=>bh(il(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return m<=p?-w:0})).getOr(0):0,np=(n,i)=>n.children&&kt(n.children,i),WC=(n,i,c)=>{let m=0,p=0;const w=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ke.fromDom(n),"position")==="static"){const M=i.getBoundingClientRect();return m=M.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=M.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!np(x,c);){const M=x;m+=M.offsetLeft||0,p+=M.offsetTop||0,x=M.offsetParent}for(x=i.parentNode;x&&x!==c&&x.nodeType&&!np(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=nb(Ke.fromDom(i))}return{x:m,y:p}},Bv=(n,i={})=>{let c=0;const m={},p=Ke.fromDom(n),w=Eo(p),x=Me=>{i.referrerPolicy=Me},M=Me=>{i.contentCssCors=Me},B=Me=>{na(em(p),Me)},q=Me=>{const Ve=em(p);Je(Ve,"#"+Me).each(wr)},ae=Me=>wo(m,Me).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=Me=>new Promise((Ve,gt)=>{let Ot;const wt=gn._addCacheSuffix(Me),Pt=ae(wt);m[wt]=Pt,Pt.count++;const hn=(Zt,yn)=>{Ne(Zt,Cn),Pt.status=yn,Pt.passed=[],Pt.failed=[],Ot&&(Ot.onload=null,Ot.onerror=null,Ot=null)},Hn=()=>hn(Pt.passed,2),$n=()=>hn(Pt.failed,3);if(Ve&&Pt.passed.push(Ve),gt&&Pt.failed.push(gt),Pt.status===1)return;if(Pt.status===2){Hn();return}if(Pt.status===3){$n();return}Pt.status=1;const Lt=Ke.fromTag("link",w.dom);Ju(Lt,{rel:"stylesheet",type:"text/css",id:Pt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),Ot=Lt.dom,Ot.onload=Hn,Ot.onerror=$n,B(Lt),Pr(Lt,"href",wt)}),be=Me=>Promise.allSettled(pt(Me,gt=>fe(gt).then(Qe(gt)))).then(gt=>{const Ot=bn(gt,wt=>wt.status==="fulfilled");return Ot.fail.length>0?Promise.reject(pt(Ot.fail,wt=>wt.reason)):pt(Ot.pass,wt=>wt.value)}),Le=Me=>{const Ve=gn._addCacheSuffix(Me);wo(m,Ve).each(gt=>{--gt.count===0&&(delete m[Ve],q(gt.id))})};return{load:fe,loadAll:be,unload:Le,unloadAll:Me=>{Ne(Me,Ve=>{Le(Ve)})},_setReferrerPolicy:x,_setContentCssCors:M}},Lv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const w=ql(c).dom;return he.from(n.get(w)).getOrThunk(()=>{const x=Bv(w,m);return n.set(w,x),x})}}})(),ob=n=>n.nodeName.toLowerCase()==="span",Ey=(n,i)=>Oe(n)&&(im(n,i)||Dc(Ke.fromDom(n))),on=(n,i)=>{const c=new _i(n,i).prev(!1),m=new _i(n,i).next(!1),p=ve(c)||Ey(c,i),w=ve(m)||Ey(m,i);return p&&w},Id=n=>ob(n)&&n.getAttribute("data-mce-type")==="bookmark",t_=(n,i)=>_n(n)&&n.data.length>0&&on(n,i),h0=n=>Jn(n)?n.childNodes.length>0:!1,UC=n=>K1(n)||of(n),ag=(n,i,c)=>{var m;const p=c||i;if(Jn(i)&&Id(i))return i;const w=i.childNodes;for(let x=w.length-1;x>=0;x--)ag(n,w[x],p);if(Jn(i)){const x=i.childNodes;x.length===1&&Id(x[0])&&((m=i.parentNode)===null||m===void 0||m.insertBefore(x[0],i))}return!UC(i)&&!im(i,p)&&!h0(i)&&!t_(i,p)&&n.remove(i),i},Ay=gn.makeMap,am=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bd=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lg=/[<>&\"\']/g,Ci=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ld={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"},Fd={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},hu={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qs=n=>{const i=Ke.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},jp=(n,i)=>{const c={};if(n){const m=n.split(",");i=i||10;for(let p=0;p<m.length;p+=2){const w=String.fromCharCode(parseInt(m[p],i));if(!Fd[w]){const x="&"+m[p+1]+";";c[w]=x,c[x]=w}}return c}else return},vh=jp("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),op=(n,i)=>n.replace(i?am:Bd,c=>Fd[c]||c),YC=n=>(""+n).replace(lg,i=>Fd[i]||i),m0=(n,i)=>n.replace(i?am:Bd,c=>c.length>1?"&#"+((c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320)+65536)+";":Fd[c]||"&#"+c.charCodeAt(0)+";"),Fv=(n,i,c)=>{const m=c||vh;return n.replace(i?am:Bd,p=>Fd[p]||m[p]||p)},sp={encodeRaw:op,encodeAllRaw:YC,encodeNumeric:m0,encodeNamed:Fv,getEncodeFunc:(n,i)=>{const c=jp(i)||vh,m=(x,M)=>x.replace(M?am:Bd,B=>Fd[B]!==void 0?Fd[B]:c[B]!==void 0?c[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(x,M)=>Fv(x,M,c),w=Ay(n.replace(/\+/g,","));return w.named&&w.numeric?m:w.named?i?p:Fv:w.numeric?m0:op},decode:n=>n.replace(Ci,(i,c)=>c?(c.charAt(0).toLowerCase()==="x"?c=parseInt(c.substr(1),16):c=parseInt(c,10),c>65535?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(c&1023))):Ld[c]||String.fromCharCode(c)):hu[i]||vh[i]||Qs(i))},Al=(n,i)=>(n=gn.trim(n),n?n.split(i||" "):[]),Dy=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),io=n=>{const i=/^(~)?(.+)$/;return $s(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1]==="~",w=p?"span":"div",x=m[2];return[{inline:p,cloneName:w,name:x}]}else return[]})},Py=n=>{let i,c,m,p;if(i="id accesskey class dir lang style tabindex title role",c="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",m="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",c+=" article aside details dialog figure main header footer hgroup section nav "+w,m+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",m=[m,"acronym applet basefont big font strike tt"].join(" "),c=[c,"center dir isindex noframes"].join(" "),p=[c,m].join(" ")),p=p||[c,m].join(" "),{globalAttributes:i,blockContent:c,phrasingContent:m,flowContent:p}},XC=n=>{const{globalAttributes:i,phrasingContent:c,flowContent:m}=Py(n),p={},w=(M,B="",q="")=>{const ae=Al(q),fe=Al(M);let be=fe.length;for(;be--;){const Le=Al([i,B].join(" "));p[fe[be]]={attributes:dr(Le,Qe({})),attributesOrder:Le,children:dr(ae,Qe({}))}}},x=(M,B)=>{const q=Al(M),ae=Al(B);let fe=q.length;for(;fe--;){const be=p[q[fe]];for(let Le=0,Ye=ae.length;Le<Ye;Le++)be.attributes[ae[Le]]={},be.attributesOrder.push(ae[Le])}};return n!=="html5-strict"&&(Ne(Al("acronym applet basefont big font strike tt"),q=>{w(q,"",c)}),Ne(Al("center dir isindex noframes"),q=>{w(q,"",m)})),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",m),w("dd div","",m),w("address dt caption","",n==="html4"?c:m),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","",c),w("blockquote","cite",m),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",m),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?c:m),w("q","cite",c),w("ins del","cite datetime",m),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",m),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[m,"param"].join(" ")),w("param","name value"),w("map","name",[m,"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",m),w("th","colspan rowspan headers scope abbr",m),w("form","accept-charset action autocomplete enctype method name novalidate target",m),w("fieldset","disabled form name",[m,"legend"].join(" ")),w("label","form for",c),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"?m:c),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",[m,"li"].join(" ")),w("noscript","",m),n!=="html4"&&(w("wbr"),w("ruby","",[c,"rt rp"].join(" ")),w("figcaption","",m),w("mark rt rp summary bdi","",c),w("canvas","width height",m),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[m,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[m,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[c,"option"].join(" ")),w("article section nav aside main header footer","",m),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[m,"figcaption"].join(" ")),w("time","datetime",c),w("dialog","open",m),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",c),w("progress","value max",c),w("meter","value min max low high optimum",c),w("details","open",[m,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(x("script","language xml:space"),x("style","xml:space"),x("object","declare classid code codebase codetype archive standby align border hspace vspace"),x("embed","align name hspace vspace"),x("param","valuetype type"),x("a","charset name rev shape coords"),x("br","clear"),x("applet","codebase archive code object alt name width height align hspace vspace"),x("img","name longdesc align border hspace vspace"),x("iframe","longdesc frameborder marginwidth marginheight scrolling align"),x("font basefont","size color face"),x("input","usemap align"),x("select"),x("textarea"),x("h1 h2 h3 h4 h5 h6 div p legend caption","align"),x("ul","type compact"),x("li","type"),x("ol dl menu dir","compact"),x("pre","width xml:space"),x("hr","align noshade size width"),x("isindex","prompt"),x("table","summary width frame rules cellspacing cellpadding align bgcolor"),x("col","width align char charoff valign"),x("colgroup","width align char charoff valign"),x("thead","align char charoff valign"),x("tr","align char charoff valign bgcolor"),x("th","axis align char charoff valign nowrap bgcolor width height"),x("form","accept"),x("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),x("tfoot","align char charoff valign"),x("tbody","align char charoff valign"),x("area","nohref"),x("body","background bgcolor text link vlink alink")),n!=="html4"&&(x("input button select textarea","autofocus"),x("input textarea","placeholder"),x("a","download"),x("link script img","crossorigin"),x("img","loading"),x("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Ne([p.video,p.audio],M=>{delete M.children.audio,delete M.children.video}),Ne(Al("a form meter progress dfn"),M=>{p[M]&&delete p[M].children[M]}),delete p.caption.children.table,delete p.script,p},My=n=>n==="-"?"remove":"add",lm=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 $s(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1],w=p?My(p):"replace",x=m[2],M=Al(m[3],"|");return[{operation:w,name:x,validChildren:M}]}else return[]})},lf=(n,i)=>{const c=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,m=/[*?+]/,{attributes:p,attributesOrder:w}=i;return Ne(Al(n,"|"),x=>{const M=c.exec(x);if(M){const B={},q=M[1],ae=M[2].replace(/[\\:]:/g,":"),fe=M[3],be=M[4];if(q==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ae),B.required=!0),q==="-"){delete p[ae],w.splice(gn.inArray(w,ae),1);return}if(fe&&(fe==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ae,value:be}),B.defaultValue=be):fe==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ae,value:be}),B.forcedValue=be):fe==="<"&&(B.validValues=gn.makeMap(be,"?"))),m.test(ae)){const Le=B;i.attributePatterns=i.attributePatterns||[],Le.pattern=Dy(ae),i.attributePatterns.push(Le)}else p[ae]||w.push(ae),p[ae]=B}})},Oh=(n,i)=>{ln(n.attributes,(c,m)=>{i.attributes[m]=c}),i.attributesOrder.push(...n.attributesOrder)},rp=(n,i)=>{const c=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return $s(Al(i,","),m=>{const p=c.exec(m);if(p){const w=p[1],x=p[2],M=p[3],B=p[4],q=p[5],ae={attributes:{},attributesOrder:[]};if(n.each(fe=>Oh(fe,ae)),w==="#"?ae.paddEmpty=!0:w==="-"&&(ae.removeEmpty=!0),B==="!"&&(ae.removeEmptyAttrs=!0),q&&lf(q,ae),M&&(ae.outputName=x),x==="@")if(n.isNone())n=he.some(ae);else return[];return[M?{name:x,element:ae,aliasName:M}:{name:x,element:ae}]}else return[]})},yh={},g0=gn.makeMap,Lf=gn.each,ip=gn.extend,Ry=gn.explode,qp=(n,i={})=>{const c=g0(n," ",g0(n.toUpperCase()," "));return ip(c,i)},rd=n=>qp("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),$y=(n,i)=>{if(n){const c={};return L(n)&&(n={"*":n}),Lf(n,(m,p)=>{c[p]=c[p.toUpperCase()]=i==="map"?g0(m,/[, ]/):Ry(m,/[, ]/)}),c}else return},wh=(n={})=>{var i;const c={},m={};let p=[];const w={},x={},M=(ho,Us,ci)=>{const Ja=n[ho];if(Ja)return g0(Ja,/[, ]/,g0(Ja.toUpperCase(),/[, ]/));{let Ei=yh[ho];return Ei||(Ei=qp(Us,ci),yh[ho]=Ei),Ei}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",q=XC(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ae=$y(n.valid_styles),fe=$y(n.invalid_styles,"map"),be=$y(n.valid_classes,"map"),Le=M("whitespace_elements","pre script noscript style textarea video audio iframe object code"),Ye=M("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),Me=M("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),Ve=M("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),gt="td th iframe video audio object script code",Ot=M("non_empty_elements",gt+" pre",Me),wt=M("move_caret_before_on_enter_elements",gt+" table",Me),Pt=M("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"),hn=M("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",Pt),Hn=M("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),$n=M("transparent_elements","a ins del canvas map");Lf("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),ho=>{x[ho]=new RegExp("</"+ho+"[^>]*>","gi")});const Lt=ho=>{const Us=he.from(c["@"]),ci=/[*?+]/;Ne(rp(Us,ho!=null?ho:""),({name:Ja,element:Ei,aliasName:$c})=>{if($c&&(c[$c]=Ei),ci.test(Ja)){const Qh=Ei;Qh.pattern=Dy(Ja),p.push(Qh)}else c[Ja]=Ei})},Zt=ho=>{p=[],Ne(bs(c),Us=>{delete c[Us]}),Lt(ho)},yn=ho=>{delete yh.text_block_elements,delete yh.block_elements,Ne(io(ho!=null?ho:""),({inline:Us,name:ci,cloneName:Ja})=>{if(m[ci]=m[Ja],w[ci]=Ja,Ot[ci.toUpperCase()]={},Ot[ci]={},Us||(hn[ci.toUpperCase()]={},hn[ci]={}),!c[ci]){let Ei=c[Ja];Ei=ip({},Ei),delete Ei.removeEmptyAttrs,delete Ei.removeEmpty,c[ci]=Ei}ln(m,(Ei,$c)=>{Ei[Ja]&&(m[$c]=Ei=ip({},m[$c]),Ei[ci]=Ei[Ja])})})},yo=ho=>{Ne(lm(ho!=null?ho:""),({operation:Us,name:ci,validChildren:Ja})=>{const Ei=Us==="replace"?{"#comment":{}}:m[ci];Ne(Ja,$c=>{Us==="remove"?delete Ei[$c]:Ei[$c]={}}),m[ci]=Ei})},Do=ho=>{const Us=c[ho];if(Us)return Us;let ci=p.length;for(;ci--;){const Ja=p[ci];if(Ja.pattern.test(ho))return Ja}};n.valid_elements?(Zt(n.valid_elements),Lf(q,(ho,Us)=>{m[Us]=ho.children})):(Lf(q,(ho,Us)=>{c[Us]={attributes:ho.attributes,attributesOrder:ho.attributesOrder},m[Us]=ho.children}),Lf(Al("strong/b em/i"),ho=>{const Us=Al(ho,"/");c[Us[1]].outputName=Us[0]}),Lf(Hn,(ho,Us)=>{c[Us]&&(n.padd_empty_block_inline_children&&(c[Us].paddInEmptyBlock=!0),c[Us].removeEmpty=!0)}),Lf(Al("ol ul blockquote a table tbody"),ho=>{c[ho]&&(c[ho].removeEmpty=!0)}),Lf(Al("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),ho=>{c[ho]&&(c[ho].paddEmpty=!0)}),Lf(Al("span"),ho=>{c[ho].removeEmptyAttrs=!0})),yn(n.custom_elements),yo(n.valid_children),Lt(n.extended_valid_elements),yo("+ol[ul|ol],+ul[ul|ol]"),Lf({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"},(ho,Us)=>{c[Us]&&(c[Us].parentsRequired=Al(ho))}),n.invalid_elements&&Lf(Ry(n.invalid_elements),ho=>{c[ho]&&delete c[ho]}),Do("span")||Lt("span[!data-mce-type|*]");const Cs=Qe(ae),Ws=Qe(fe),Ir=Qe(be),pi=Qe(Ve),fl=Qe(hn),Il=Qe(Pt),Oc=Qe(Hn),Pn=Qe(Object.seal(Me)),eo=Qe(Ye),Cr=Qe(Ot),Bs=Qe(wt),Co=Qe(Le),Mn=Qe($n),En=Qe(Object.seal(x)),jo=(ho,Us)=>{const ci=m[ho.toLowerCase()];return!!(ci&&ci[Us.toLowerCase()])},Ks=(ho,Us)=>{const ci=Do(ho);if(ci)if(Us){if(ci.attributes[Us])return!0;const Ja=ci.attributePatterns;if(Ja){let Ei=Ja.length;for(;Ei--;)if(Ja[Ei].pattern.test(Us))return!0}}else return!0;return!1},Jr=Qe(w);return{type:B,children:m,elements:c,getValidStyles:Cs,getValidClasses:Ir,getBlockElements:fl,getInvalidStyles:Ws,getVoidElements:Pn,getTextBlockElements:Il,getTextInlineElements:Oc,getBoolAttrs:pi,getElementRule:Do,getSelfClosingElements:eo,getNonEmptyElements:Cr,getMoveCaretBeforeOnEnterElements:Bs,getWhitespaceElements:Co,getTransparentElements:Mn,getSpecialElements:En,isValidChild:jo,isValid:Ks,getCustomElements:Jr,addValidElements:Lt,setValidElements:Zt,addCustomElements:yn,addValidChildren:yo}},Qv=(n={},i)=>{const c=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,m=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let x,M;const B=nn;i&&(x=i.getValidStyles(),M=i.getInvalidStyles());const q=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let fe=0;fe<q.length;fe++)w[q[fe]]=B+fe,w[B+fe]=q[fe];const ae={parse:fe=>{const be={};let Le=!1;const Ye=n.url_converter,Me=n.url_converter_scope||ae,Ve=(Lt,Zt,yn)=>{const yo=be[Lt+"-top"+Zt];if(!yo)return;const Do=be[Lt+"-right"+Zt];if(!Do)return;const Cs=be[Lt+"-bottom"+Zt];if(!Cs)return;const Ws=be[Lt+"-left"+Zt];if(!Ws)return;const Ir=[yo,Do,Cs,Ws];let pi=Ir.length-1;for(;pi--&&Ir[pi]===Ir[pi+1];);pi>-1&&yn||(be[Lt+Zt]=pi===-1?Ir[0]:Ir.join(" "),delete be[Lt+"-top"+Zt],delete be[Lt+"-right"+Zt],delete be[Lt+"-bottom"+Zt],delete be[Lt+"-left"+Zt])},gt=Lt=>{const Zt=be[Lt];if(!Zt)return;const yn=Zt.indexOf(",")>-1?[Zt]:Zt.split(" ");let yo=yn.length;for(;yo--;)if(yn[yo]!==yn[0])return!1;return be[Lt]=yn[0],!0},Ot=(Lt,Zt,yn,yo)=>{!gt(Zt)||!gt(yn)||!gt(yo)||(be[Lt]=be[Zt]+" "+be[yn]+" "+be[yo],delete be[Zt],delete be[yn],delete be[yo])},wt=Lt=>(Le=!0,w[Lt]),Pt=(Lt,Zt)=>(Le&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>w[yn])),Zt||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),hn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),Hn=Lt=>Lt.replace(/\\[0-9a-f]+/gi,hn),$n=(Lt,Zt,yn,yo,Do,Cs)=>{if(Do=Do||Cs,Do)return Do=Pt(Do),"'"+Do.replace(/\'/g,"\\'")+"'";if(Zt=Pt(Zt||yn||yo||""),!n.allow_script_urls){const Ws=Zt.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Ws)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Ws))return""}return Ye&&(Zt=Ye.call(Me,Zt,"style")),"url('"+Zt.replace(/\'/g,"\\'")+"')"};if(fe){fe=fe.replace(/[\u0000-\u001F]/g,""),fe=fe.replace(/\\[\"\';:\uFEFF]/g,wt).replace(/\"[^\"]+\"|\'[^\']+\'/g,Zt=>Zt.replace(/[;:]/g,wt));let Lt;for(;Lt=m.exec(fe);){m.lastIndex=Lt.index+Lt[0].length;let Zt=Lt[1].replace(p,"").toLowerCase(),yn=Lt[2].replace(p,"");if(Zt&&yn){if(Zt=Hn(Zt),yn=Hn(yn),Zt.indexOf(B)!==-1||Zt.indexOf('"')!==-1||!n.allow_script_urls&&(Zt==="behavior"||/expression\s*\(|\/\*|\*\//.test(yn)))continue;Zt==="font-weight"&&yn==="700"?yn="bold":(Zt==="color"||Zt==="background-color")&&(yn=yn.toLowerCase()),yn=yn.replace(c,$n),be[Zt]=Le?Pt(yn,!0):yn}}Ve("border","",!0),Ve("border","-width"),Ve("border","-color"),Ve("border","-style"),Ve("padding",""),Ve("margin",""),Ot("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:(fe,be)=>{let Le="";const Ye=(Ve,gt)=>{const Ot=gt[Ve];if(Ot)for(let wt=0,Pt=Ot.length;wt<Pt;wt++){const hn=Ot[wt],Hn=fe[hn];Hn&&(Le+=(Le.length>0?" ":"")+hn+": "+Hn+";")}},Me=(Ve,gt)=>{if(!M||!gt)return!0;let Ot=M["*"];return Ot&&Ot[Ve]?!1:(Ot=M[gt],!(Ot&&Ot[Ve]))};return be&&x?(Ye("*",x),Ye(be,x)):ln(fe,(Ve,gt)=>{Ve&&Me(gt,be)&&(Le+=(Le.length>0?" ":"")+gt+": "+Ve+";")}),Le}};return ae},n_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ny=n=>n instanceof Event||ce(n.initEvent),ap=n=>n.isDefaultPrevented===mt||n.isDefaultPrevented===je,Ff=n=>Re(n.preventDefault)||Ny(n),mu=(n,i)=>{const c=i!=null?i:{};for(const m in n)fn(n_,m)||(c[m]=n[m]);return Oe(n.composedPath)&&(c.composedPath=()=>n.composedPath()),c},lp=(n,i,c,m)=>{var p;const w=mu(i,m);return w.type=n,Re(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:c),Ff(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=mt,ce(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=mt,ce(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=mt,w.stopPropagation()},ap(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?mt:je,w.isPropagationStopped=w.cancelBubble===!0?mt:je,w.isImmediatePropagationStopped=je)),w},Iy="mce-data-",o_=/^(?:mouse|contextmenu)|click/,p0=(n,i,c,m)=>{n.addEventListener(i,c,m||!1)},Yc=(n,i,c,m)=>{n.removeEventListener(i,c,m||!1)},b0=n=>Oe(n)&&o_.test(n.type),cf=(n,i)=>{const c=lp(n.type,n,document,i);if(b0(n)&&ve(n.pageX)&&!ve(n.clientX)){const m=c.target.ownerDocument||document,p=m.documentElement,w=m.body,x=c;x.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),x.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return c},cp=(n,i,c)=>{const m=n.document,p={type:"ready"};if(c.domLoaded){i(p);return}const w=()=>m.readyState==="complete"||m.readyState==="interactive"&&m.body,x=()=>{Yc(n,"DOMContentLoaded",x),Yc(n,"load",x),c.domLoaded||(c.domLoaded=!0,i(p)),n=null};w()?x():p0(n,"DOMContentLoaded",x),c.domLoaded||p0(n,"load",x)};class cm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Iy+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,c,m,p){const w=this;let x;const M=window,B=be=>{w.executeHandlers(cf(be||M.event),q)};if(!i||_n(i)||uh(i))return m;let q;i[w.expando]?q=i[w.expando]:(q=w.count++,i[w.expando]=q,w.events[q]={}),p=p||i;const ae=c.split(" ");let fe=ae.length;for(;fe--;){let be=ae[fe],Le=B,Ye=!1,Me=!1;if(be==="DOMContentLoaded"&&(be="ready"),w.domLoaded&&be==="ready"&&i.readyState==="complete"){m.call(p,cf({type:be}));continue}!w.hasFocusIn&&(be==="focusin"||be==="focusout")&&(Ye=!0,Me=be==="focusin"?"focus":"blur",Le=Ve=>{const gt=cf(Ve||M.event);gt.type=gt.type==="focus"?"focusin":"focusout",w.executeHandlers(gt,q)}),x=w.events[q][be],x?be==="ready"&&w.domLoaded?m(cf({type:be})):x.push({func:m,scope:p}):(w.events[q][be]=x=[{func:m,scope:p}],x.fakeName=Me,x.capture=Ye,x.nativeHandler=Le,be==="ready"?cp(i,Le,w):p0(i,Me||be,Le,Ye))}return i=x=null,m}unbind(i,c,m){if(!i||_n(i)||uh(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(c){const x=c.split(" ");let M=x.length;for(;M--;){const B=x[M],q=w[B];if(q){if(m){let ae=q.length;for(;ae--;)if(q[ae].func===m){const fe=q.nativeHandler,be=q.fakeName,Le=q.capture,Ye=q.slice(0,ae).concat(q.slice(ae+1));Ye.nativeHandler=fe,Ye.fakeName=be,Ye.capture=Le,w[B]=Ye}}(!m||q.length===0)&&(delete w[B],Yc(i,q.fakeName||B,q.nativeHandler,q.capture))}}}else ln(w,(x,M)=>{Yc(i,x.fakeName||M,x.nativeHandler,x.capture)}),w={};for(const x in w)if(fn(w,x))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,c,m){return this.dispatch(i,c,m)}dispatch(i,c,m){if(!i||_n(i)||uh(i))return this;const p=cf({type:c,target:i},m);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||_n(i)||uh(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const c=i.getElementsByTagName("*");let m=c.length;for(;m--;)i=c[m],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,c){const m=this.events[c],p=m&&m[i.type];if(p)for(let w=0,x=p.length;w<x;w++){const M=p[w];if(M&&M.func.call(M.scope,i)===!1&&i.preventDefault(),i.isImmediatePropagationStopped())return}}}cm.Event=new cm;const Zv=gn.each,s_=gn.grep,Gp="data-mce-style",By=gn.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),up=(n,i,c)=>{Re(c)||c===""?Vi(n,i):Pr(n,i,c)},v0=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),sb=(n,i)=>{let c=0;if(n)for(let m=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&_n(p)&&(w===m||!p.data.length)||(c++,m=w)}return c},Ly=(n,i)=>{const c=Fl(i,"style"),m=n.serialize(n.parse(c),ti(i));up(i,Gp,m)},Fy=(n,i)=>Xe(n)?fn(By,i)?n+"":n+"px":n,r_=(n,i,c)=>{const m=v0(i);Re(c)||c===""?Um(n,m):Gl(n,m,Fy(c,m))},jC=(n,i,c)=>{const m=i.keep_values,p={set:(x,M,B)=>{const q=Ke.fromDom(x);ce(i.url_converter)&&Oe(M)&&(M=i.url_converter.call(i.url_converter_scope||c(),String(M),B,x));const ae="data-mce-"+B;up(q,ae,M),up(q,B,M)},get:(x,M)=>{const B=Ke.fromDom(x);return Fl(B,"data-mce-"+M)||Fl(B,M)}},w={style:{set:(x,M)=>{const B=Ke.fromDom(x);m&&up(B,Gp,M),Vi(B,"style"),L(M)&&ua(B,n.parse(M))},get:x=>{const M=Ke.fromDom(x),B=Fl(M,Gp)||Fl(M,"style");return n.serialize(n.parse(B),ti(M))}}};return m&&(w.href=w.src=p),w},Qr=(n,i={})=>{const c={},m=window,p={};let w=0;const x=!0,M=!0,B=Lv.forElement(Ke.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),q=[],ae=i.schema?i.schema:wh({}),fe=Qv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),be=i.ownEvents?new cm:cm.Event,Le=ae.getBlockElements(),Ye=Mt=>L(Mt)?fn(Le,Mt):Jn(Mt)&&(fn(Le,Mt.nodeName)||ig(ae,Mt)),Me=Mt=>Mt&&n&&L(Mt)?n.getElementById(Mt):Mt,Ve=Mt=>{const Rt=Me(Mt);return Oe(Rt)?Ke.fromDom(Rt):null},gt=(Mt,Rt,Rn="")=>{let xn;const Io=Ve(Mt);if(Oe(Io)&&kl(Io)){const br=Rw[Rt];br&&br.get?xn=br.get(Io.dom,Rt):xn=Fl(Io,Rt)}return Oe(xn)?xn:Rn},Ot=Mt=>{const Rt=Me(Mt);return Re(Rt)?[]:Rt.attributes},wt=(Mt,Rt,Rn)=>{eo(Mt,xn=>{if(Jn(xn)){const Io=Ke.fromDom(xn),br=Rn===""?null:Rn,ha=Fl(Io,Rt),Nc=Rw[Rt];Nc&&Nc.set?Nc.set(Io.dom,br,Rt):up(Io,Rt,br),ha!==br&&i.onSetAttrib&&i.onSetAttrib({attrElm:Io.dom,attrName:Rt,attrValue:br})}})},Pt=(Mt,Rt)=>Mt.cloneNode(Rt),hn=()=>i.root_element||n.body,Hn=Mt=>{const Rt=nd(Mt);return{x:Rt.x,y:Rt.y,w:Rt.width,h:Rt.height}},$n=(Mt,Rt)=>WC(n.body,Me(Mt),Rt),Lt=(Mt,Rt,Rn)=>{eo(Mt,xn=>{const Io=Ke.fromDom(xn);r_(Io,Rt,Rn),i.update_styles&&Ly(fe,Io)})},Zt=(Mt,Rt)=>{eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);ln(Rt,(Io,br)=>{r_(xn,br,Io)}),i.update_styles&&Ly(fe,xn)})},yn=(Mt,Rt,Rn)=>{const xn=Me(Mt);if(!(Re(xn)||!Jn(xn)))return Rn?Bi(Ke.fromDom(xn),v0(Rt)):(Rt=Rt.replace(/-(\D)/g,(Io,br)=>br.toUpperCase()),Rt==="float"&&(Rt="cssFloat"),xn.style?xn.style[Rt]:void 0)},yo=Mt=>{const Rt=Me(Mt);if(!Rt)return{w:0,h:0};let Rn=yn(Rt,"width"),xn=yn(Rt,"height");return(!Rn||Rn.indexOf("px")===-1)&&(Rn="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt(Rn,10)||Rt.offsetWidth||Rt.clientWidth,h:parseInt(xn,10)||Rt.offsetHeight||Rt.clientHeight}},Do=Mt=>{const Rt=Me(Mt),Rn=$n(Rt),xn=yo(Rt);return{x:Rn.x,y:Rn.y,w:xn.w,h:xn.h}},Cs=(Mt,Rt)=>{if(!Mt)return!1;const Rn=oe(Mt)?Mt:[Mt];return jt(Rn,xn=>Pu(Ke.fromDom(xn),Rt))},Ws=(Mt,Rt,Rn,xn)=>{const Io=[];let br=Me(Mt);xn=xn===void 0;const ha=Rn||(hn().nodeName!=="BODY"?hn().parentNode:null);if(L(Rt))if(Rt==="*")Rt=Jn;else{const Nc=Rt;Rt=_u=>Cs(_u,Nc)}for(;br&&!(br===ha||Re(br.nodeType)||of(br)||K1(br));){if(!Rt||Rt(br))if(xn)Io.push(br);else return[br];br=br.parentNode}return xn?Io:null},Ir=(Mt,Rt,Rn)=>{const xn=Ws(Mt,Rt,Rn,!1);return xn&&xn.length>0?xn[0]:null},pi=(Mt,Rt,Rn)=>{let xn=Rt;if(Mt){L(Rt)&&(xn=Io=>Cs(Io,Rt));for(let Io=Mt[Rn];Io;Io=Io[Rn])if(ce(xn)&&xn(Io))return Io}return null},fl=(Mt,Rt)=>pi(Mt,Rt,"nextSibling"),Il=(Mt,Rt)=>pi(Mt,Rt,"previousSibling"),Oc=Mt=>ce(Mt.querySelectorAll),Pn=(Mt,Rt)=>{var Rn,xn;const Io=(xn=(Rn=Me(Rt))!==null&&Rn!==void 0?Rn:i.root_element)!==null&&xn!==void 0?xn:n;return Oc(Io)?Rr(Io.querySelectorAll(Mt)):[]},eo=function(Mt,Rt,Rn){const xn=Rn!=null?Rn:this;if(oe(Mt)){const Io=[];return Zv(Mt,(br,ha)=>{const Nc=Me(br);Nc&&Io.push(Rt.call(xn,Nc,ha))}),Io}else{const Io=Me(Mt);return Io?Rt.call(xn,Io):!1}},Cr=(Mt,Rt)=>{eo(Mt,Rn=>{ln(Rt,(xn,Io)=>{wt(Rn,Io,xn)})})},Bs=(Mt,Rt)=>{eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);Mf(xn,Rt)})},Co=(Mt,Rt,Rn,xn,Io)=>eo(Mt,br=>{const ha=L(Rt)?n.createElement(Rt):Rt;return Oe(Rn)&&Cr(ha,Rn),xn&&(!L(xn)&&xn.nodeType?ha.appendChild(xn):L(xn)&&Bs(ha,xn)),Io?ha:br.appendChild(ha)}),Mn=(Mt,Rt,Rn)=>Co(n.createElement(Mt),Mt,Rt,Rn,!0),En=sp.decode,jo=sp.encodeAllRaw,Ks=(Mt,Rt,Rn="")=>{let xn="<"+Mt;for(const Io in Rt)os(Rt,Io)&&(xn+=" "+Io+'="'+jo(Rt[Io])+'"');return ol(Rn)&&fn(ae.getVoidElements(),Mt)?xn+" />":xn+">"+Rn+"</"+Mt+">"},Jr=Mt=>{const Rt=n.createElement("div"),Rn=n.createDocumentFragment();Rn.appendChild(Rt),Mt&&(Rt.innerHTML=Mt);let xn;for(;xn=Rt.firstChild;)Rn.appendChild(xn);return Rn.removeChild(Rt),Rn},ho=(Mt,Rt)=>eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);return Rt&&Ne(Da(xn),Io=>{sl(Io)&&Io.dom.length===0?wr(Io):Ca(xn,Io)}),wr(xn),xn.dom}),Us=Mt=>eo(Mt,Rt=>{const Rn=Rt.attributes;for(let xn=Rn.length-1;xn>=0;xn--)Rt.removeAttributeNode(Rn.item(xn))}),ci=Mt=>fe.parse(Mt),Ja=(Mt,Rt)=>fe.serialize(Mt,Rt),Ei=Mt=>{if(E1!==Qr.DOM&&n===document){if(c[Mt])return;c[Mt]=!0}let Rt=n.getElementById("mceDefaultStyles");if(!Rt){Rt=n.createElement("style"),Rt.id="mceDefaultStyles",Rt.type="text/css";const Rn=n.head;Rn.firstChild?Rn.insertBefore(Rt,Rn.firstChild):Rn.appendChild(Rt)}Rt.styleSheet?Rt.styleSheet.cssText+=Mt:Rt.appendChild(n.createTextNode(Mt))},$c=Mt=>{Mt||(Mt=""),Ne(Mt.split(","),Rt=>{p[Rt]=!0,B.load(Rt).catch(ot)})},Qh=(Mt,Rt,Rn)=>{eo(Mt,xn=>{if(Jn(xn)){const Io=Ke.fromDom(xn),br=Rt.split(" ");Ne(br,ha=>{Oe(Rn)?(Rn?ef:zc)(Io,ha):Gh(Io,ha)})}})},qd=(Mt,Rt)=>{Qh(Mt,Rt,!0)},Dm=(Mt,Rt)=>{Qh(Mt,Rt,!1)},qO=(Mt,Rt)=>{const Rn=Ve(Mt),xn=Rt.split(" ");return Oe(Rn)&&tr(xn,Io=>Pf(Rn,Io))},Pw=Mt=>{eo(Mt,Rt=>Um(Ke.fromDom(Rt),"display"))},GO=Mt=>{eo(Mt,Rt=>Gl(Ke.fromDom(Rt),"display","none"))},KO=Mt=>{const Rt=Ve(Mt);return Oe(Rt)&&Gr(Pa(Rt,"display"),"none")},Z4=Mt=>(Mt||"mce_")+w++,H4=Mt=>{const Rt=Ve(Mt);return Oe(Rt)?Jn(Rt.dom)?Rt.dom.outerHTML:Xg(Rt):""},z4=(Mt,Rt)=>{eo(Mt,Rn=>{Jn(Rn)&&(Rn.outerHTML=Rt)})},FT=(Mt,Rt)=>{const Rn=Me(Rt);return eo(Mt,xn=>{const Io=Rn==null?void 0:Rn.parentNode,br=Rn==null?void 0:Rn.nextSibling;return Io&&(br?Io.insertBefore(xn,br):Io.appendChild(xn)),xn})},QT=(Mt,Rt,Rn)=>eo(Rt,xn=>{var Io;const br=oe(Rt)?Mt.cloneNode(!0):Mt;return Rn&&Zv(s_(xn.childNodes),ha=>{br.appendChild(ha)}),(Io=xn.parentNode)===null||Io===void 0||Io.replaceChild(br,xn),xn}),ZT=(Mt,Rt)=>{if(Mt.nodeName!==Rt.toUpperCase()){const Rn=Mn(Rt);return Zv(Ot(Mt),xn=>{wt(Rn,xn.nodeName,gt(Mt,xn.nodeName))}),QT(Rn,Mt,!0),Rn}else return Mt},cC=(Mt,Rt)=>{let Rn=Mt;for(;Rn;){let xn=Rt;for(;xn&&Rn!==xn;)xn=xn.parentNode;if(Rn===xn)break;Rn=Rn.parentNode}return!Rn&&Mt.ownerDocument?Mt.ownerDocument.documentElement:Rn},T1=Mt=>{if(Jn(Mt)){const Rt=Mt.nodeName.toLowerCase()==="a"&&!gt(Mt,"href")&>(Mt,"id");if(gt(Mt,"name")||gt(Mt,"data-mce-bookmark")||Rt)return!0}return!1},uC=(Mt,Rt,Rn)=>{let xn=0;if(T1(Mt))return!1;const Io=Mt.firstChild;if(Io){const br=new _i(Io,Mt),ha=ae?ae.getWhitespaceElements():{},Nc=Rt||(ae?ae.getNonEmptyElements():null);let _u=Io;do{if(Jn(_u)){const YT=_u.getAttribute("data-mce-bogus");if(YT){_u=br.next(YT==="all");continue}const XT=_u.nodeName.toLowerCase();if(Nc&&Nc[XT]){if(XT==="br"){xn++,_u=br.next();continue}return!1}if(T1(_u))return!1}if(uh(_u)||_n(_u)&&!eg(_u.data)&&(!(Rn!=null&&Rn.includeZwsp)||!Jg(_u.data))||_n(_u)&&_u.parentNode&&ha[_u.parentNode.nodeName]&&eg(_u.data))return!1;_u=br.next()}while(_u)}return xn<=1},Mw=()=>n.createRange(),vv=(Mt,Rt,Rn)=>{let xn=Mw(),Io,br;if(Mt&&Rt&&Mt.parentNode&&Rt.parentNode){const ha=Mt.parentNode;return xn.setStart(ha,sb(Mt)),xn.setEnd(Rt.parentNode,sb(Rt)),Io=xn.extractContents(),xn=Mw(),xn.setStart(Rt.parentNode,sb(Rt)+1),xn.setEnd(ha,sb(Mt)+1),br=xn.extractContents(),ha.insertBefore(ag(E1,Io),Mt),Rn?ha.insertBefore(Rn,Mt):ha.insertBefore(Rt,Mt),ha.insertBefore(ag(E1,br),Mt),ho(Mt),Rn||Rt}else return},HT=(Mt,Rt,Rn,xn)=>{if(oe(Mt)){let Io=Mt.length;const br=[];for(;Io--;)br[Io]=HT(Mt[Io],Rt,Rn,xn);return br}else return i.collect&&(Mt===n||Mt===m)&&q.push([Mt,Rt,Rn,xn]),be.bind(Mt,Rt,Rn,xn||E1)},zT=(Mt,Rt,Rn)=>{if(oe(Mt)){let xn=Mt.length;const Io=[];for(;xn--;)Io[xn]=zT(Mt[xn],Rt,Rn);return Io}else{if(q.length>0&&(Mt===n||Mt===m)){let xn=q.length;for(;xn--;){const[Io,br,ha]=q[xn];Mt===Io&&(!Rt||Rt===br)&&(!Rn||Rn===ha)&&be.unbind(Io,br,ha)}}return be.unbind(Mt,Rt,Rn)}},Ib=(Mt,Rt,Rn)=>be.dispatch(Mt,Rt,Rn),Ov=(Mt,Rt,Rn)=>be.dispatch(Mt,Rt,Rn),VT=Mt=>{if(Mt&&Jn(Mt)){const Rt=Mt.getAttribute("data-mce-contenteditable");return Rt&&Rt!=="inherit"?Rt:Mt.contentEditable!=="inherit"?Mt.contentEditable:null}else return null},E1={doc:n,settings:i,win:m,files:p,stdMode:x,boxModel:M,styleSheetLoader:B,boundEvents:q,styles:fe,schema:ae,events:be,isBlock:Ye,root:null,clone:Pt,getRoot:hn,getViewPort:Hn,getRect:Do,getSize:yo,getParent:Ir,getParents:Ws,get:Me,getNext:fl,getPrev:Il,select:Pn,is:Cs,add:Co,create:Mn,createHTML:Ks,createFragment:Jr,remove:ho,setStyle:Lt,getStyle:yn,setStyles:Zt,removeAllAttribs:Us,setAttrib:wt,setAttribs:Cr,getAttrib:gt,getPos:$n,parseStyle:ci,serializeStyle:Ja,addStyle:Ei,loadCSS:$c,addClass:qd,removeClass:Dm,hasClass:qO,toggleClass:Qh,show:Pw,hide:GO,isHidden:KO,uniqueId:Z4,setHTML:Bs,getOuterHTML:H4,setOuterHTML:z4,decode:En,encode:jo,insertAfter:FT,replace:QT,rename:ZT,findCommonAncestor:cC,run:eo,getAttribs:Ot,isEmpty:uC,createRng:Mw,nodeIndex:sb,split:vv,bind:HT,unbind:zT,fire:Ov,dispatch:Ib,getContentEditable:VT,getContentEditableParent:Mt=>{const Rt=hn();let Rn=null;for(let xn=Mt;xn&&xn!==Rt&&(Rn=VT(xn),Rn===null);xn=xn.parentNode);return Rn},isEditable:Mt=>{if(Oe(Mt)){const Rt=Jn(Mt)?Mt:Mt.parentElement;return Oe(Rt)&&wn(Ke.fromDom(Rt))}else return!1},destroy:()=>{if(q.length>0){let Mt=q.length;for(;Mt--;){const[Rt,Rn,xn]=q[Mt];be.unbind(Rt,Rn,xn)}}ln(p,(Mt,Rt)=>{B.unload(Rt),delete p[Rt]})},isChildOf:(Mt,Rt)=>Mt===Rt||Rt.contains(Mt),dumpRng:Mt=>"startContainer: "+Mt.startContainer.nodeName+", startOffset: "+Mt.startOffset+", endContainer: "+Mt.endContainer.nodeName+", endOffset: "+Mt.endOffset},Rw=jC(fe,i,Qe(E1));return E1};Qr.DOM=Qr(document),Qr.nodeIndex=sb;const Hv=Qr.DOM,Qy=0,Zy=1,O0=2,qC=3;class um{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((c,m)=>{const p=Hv;let w;const x=()=>{p.remove(q),w&&(w.onerror=w.onload=w=null)},M=()=>{x(),c()},B=()=>{x(),m("Failed to load script: "+i)},q=p.uniqueId();w=document.createElement("script"),w.id=q,w.type="text/javascript",w.src=gn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=M,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===O0}markDone(i){this.states[i]=O0}add(i){const c=this;return c.queue.push(i),c.states[i]===void 0&&(c.states[i]=Qy),new Promise((p,w)=>{c.scriptLoadedCallbacks[i]||(c.scriptLoadedCallbacks[i]=[]),c.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 c=this,m=(B,q)=>{wo(c.scriptLoadedCallbacks,q).each(ae=>{Ne(ae,fe=>fe[B](q))}),delete c.scriptLoadedCallbacks[q]},p=B=>{const q=At(B,ae=>ae.status==="rejected");return q.length>0?Promise.reject($s(q,({reason:ae})=>oe(ae)?ae:[ae])):Promise.resolve()},w=B=>Promise.allSettled(pt(B,q=>c.states[q]===O0?(m("resolve",q),Promise.resolve()):c.states[q]===qC?(m("reject",q),Promise.reject(q)):(c.states[q]=Zy,c.loadScript(q).then(()=>{c.states[q]=O0,m("resolve",q);const ae=c.queue;return ae.length>0?(c.queue=[],w(ae).then(p)):Promise.resolve()},()=>(c.states[q]=qC,m("reject",q),Promise.reject(q)))))),x=B=>(c.loading=!0,w(B).then(q=>{c.loading=!1;const ae=c.queueLoadedCallbacks.shift();return he.from(ae).each(Cn),p(q)})),M=fs(i);return c.loading?new Promise((B,q)=>{c.queueLoadedCallbacks.push(()=>{x(M).then(B,q)})}):x(M)}}um.ScriptLoader=new um;const Ga=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},y0=(n,i)=>{const c=n.indexOf(i);return c!==-1&&n.indexOf(i,c+1)>c},rb=n=>te(n)&&fn(n,"raw"),i_=n=>oe(n)&&n.length>1,w0={},Hy=Ga("en"),Na=()=>wo(w0,Hy.get()),id={getData:()=>vs(w0,n=>({...n})),setCode:n=>{n&&Hy.set(n)},getCode:()=>Hy.get(),add:(n,i)=>{let c=w0[n];c||(w0[n]=c={});const m=pt(bs(i),p=>p.toLowerCase());ln(i,(p,w)=>{const x=w.toLowerCase();x!==w&&y0(m,x)?(fn(i,x)||(c[x]=p),c[w]=p):c[x]=p})},translate:n=>{const i=Na().getOr({}),c=x=>ce(x)?Object.prototype.toString.call(x):m(x)?"":""+x,m=x=>x===""||x===null||x===void 0,p=x=>{const M=c(x);return fn(i,M)?c(i[M]):wo(i,M.toLowerCase()).map(c).getOr(M)},w=x=>x.replace(/{context:\w+}$/,"");if(m(n))return"";if(rb(n))return c(n.raw);if(i_(n)){const x=n.slice(1),M=p(n[0]).replace(/\{([0-9]+)\}/g,(B,q)=>fn(x,q)?c(x[q]):B);return w(M)}return w(p(n))},isRtl:()=>Na().bind(n=>wo(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>fn(w0,n)},Ia=()=>{const n=[],i={},c={},m=[],p=(Me,Ve)=>{const gt=At(m,Ot=>Ot.name===Me&&Ot.state===Ve);Ne(gt,Ot=>Ot.resolve())},w=Me=>fn(i,Me),x=Me=>fn(c,Me),M=Me=>{if(c[Me])return c[Me].instance},B=(Me,Ve)=>{const gt=id.getCode(),Ot=","+(Ve||"")+",";!gt||Ve&&Ot.indexOf(","+gt+",")===-1||um.ScriptLoader.add(i[Me]+"/langs/"+gt+".js")},q=(Me,Ve)=>{Ia.languageLoad!==!1&&(w(Me)?B(Me,Ve):Ye(Me,"loaded").then(()=>B(Me,Ve)))},ae=(Me,Ve)=>(n.push(Ve),c[Me]={instance:Ve},p(Me,"added"),Ve),fe=Me=>{delete i[Me],delete c[Me]},be=(Me,Ve)=>L(Ve)?L(Me)?{prefix:"",resource:Ve,suffix:""}:{prefix:Me.prefix,resource:Ve,suffix:Me.suffix}:Ve,Le=(Me,Ve)=>{if(i[Me])return Promise.resolve();let gt=L(Ve)?Ve:Ve.prefix+Ve.resource+Ve.suffix;gt.indexOf("/")!==0&>.indexOf("://")===-1&&(gt=Ia.baseURL+"/"+gt),i[Me]=gt.substring(0,gt.lastIndexOf("/"));const Ot=()=>(p(Me,"loaded"),Promise.resolve());return c[Me]?Ot():um.ScriptLoader.add(gt).then(Ot)},Ye=(Me,Ve="added")=>Ve==="added"&&x(Me)||Ve==="loaded"&&w(Me)?Promise.resolve():new Promise(gt=>{m.push({name:Me,state:Ve,resolve:gt})});return{items:n,urls:i,lookup:c,get:M,requireLangPack:q,add:ae,remove:fe,createUrl:be,load:Le,waitFor:Ye}};Ia.languageLoad=!0,Ia.baseURL="",Ia.PluginManager=Ia(),Ia.ThemeManager=Ia(),Ia.ModelManager=Ia();const Ta=n=>{const i=Ga(he.none()),c=()=>i.get().each(n);return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(M))}}},KC=n=>{const i=Ga(he.none()),c=()=>i.get().each(M=>clearInterval(M));return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(setInterval(M,n)))}}},Sh=()=>{const n=Ta(ot);return{...n,on:c=>n.get().each(c)}},_0=(n,i)=>{let c=null;return{cancel:()=>{G(c)||(clearTimeout(c),c=null)},throttle:(...w)=>{G(c)&&(c=setTimeout(()=>{c=null,n.apply(null,w)},i))}}},zv=(n,i)=>{let c=null;const m=()=>{G(c)||(clearTimeout(c),c=null)};return{cancel:m,throttle:(...w)=>{m(),c=setTimeout(()=>{c=null,n.apply(null,w)},i)}}},ad=Qe("mce-annotation"),ff=Qe("data-mce-annotation"),Kp=Qe("data-mce-annotation-uid"),ib=Qe("data-mce-annotation-active"),S0=Qe("data-mce-annotation-classes"),C0=Qe("data-mce-annotation-attrs"),a_=n=>i=>vt(i,n),Vy=(n,i)=>{const c=n.selection.getRng(),m=Ke.fromDom(c.startContainer),p=Ke.fromDom(n.getBody()),w=i.fold(()=>"."+ad(),B=>`[${ff()}="${B}"]`),x=tf(m,c.startOffset).getOr(m);return at(x,w,a_(p)).bind(B=>Va(B,`${Kp()}`).bind(q=>Va(B,`${ff()}`).map(ae=>{const fe=c_(n,q);return{uid:q,name:ae,elements:fe}})))},JC=n=>kl(n)&&Pf(n,ad()),l_=(n,i)=>qi(n,"data-mce-bogus")||Ty(n,'[data-mce-bogus="all"]',a_(i)),c_=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${Kp()}="${i}"]`);return At(m,p=>!l_(p,c))},Wy=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${ff()}="${i}"]`),p={};return Ne(m,w=>{if(!l_(w,c)){const x=Fl(w,Kp()),M=wo(p,x).getOr([]);p[x]=M.concat([w])}}),p},u_=(n,i)=>{const c=Ga({}),m=()=>({listeners:[],previous:Sh()}),p=(fe,be)=>{w(fe,Le=>(be(Le),Le))},w=(fe,be)=>{const Le=c.get(),Ye=wo(Le,fe).getOrThunk(m),Me=be(Ye);Le[fe]=Me,c.set(Le)},x=(fe,be,Le)=>{p(fe,Ye=>{Ne(Ye.listeners,Me=>Me(!0,fe,{uid:be,nodes:pt(Le,Ve=>Ve.dom)}))})},M=fe=>{p(fe,be=>{Ne(be.listeners,Le=>Le(!1,fe))})},B=(fe,be)=>{Ne(c_(n,fe),Le=>{be?Pr(Le,ib(),"true"):Vi(Le,ib())})},q=zv(()=>{const fe=Ns(i.getNames());Ne(fe,be=>{w(be,Le=>{const Ye=Le.previous.get();return Vy(n,he.some(be)).fold(()=>{Ye.each(Me=>{M(be),Le.previous.clear(),B(Me,!1)})},({uid:Me,name:Ve,elements:gt})=>{Gr(Ye,Me)||(Ye.each(Ot=>B(Ot,!1)),x(Ve,Me,gt),Le.previous.set(Me),B(Me,!0))}),{previous:Le.previous,listeners:Le.listeners}})})},30);return n.on("remove",()=>{q.cancel()}),n.on("NodeChange",()=>{q.throttle()}),{addListener:(fe,be)=>{w(fe,Le=>({previous:Le.previous,listeners:Le.listeners.concat([be])}))}}},EE=(n,i)=>{const c=ff(),m=w=>he.from(w.attr(c)).bind(i.lookup),p=w=>{var x,M;w.attr(Kp(),null),w.attr(ff(),null),w.attr(ib(),null);const B=he.from(w.attr(C0())).map(be=>be.split(",")).getOr([]),q=he.from(w.attr(S0())).map(be=>be.split(",")).getOr([]);Ne(B,be=>w.attr(be,null));const ae=(M=(x=w.attr("class"))===null||x===void 0?void 0:x.split(" "))!==null&&M!==void 0?M:[],fe=wa(ae,[ad()].concat(q));w.attr("class",fe.length>0?fe.join(" "):null),w.attr(S0(),null),w.attr(C0(),null)};n.serializer.addTempAttr(ib()),n.serializer.addAttributeFilter(c,w=>{for(const x of w)m(x).each(M=>{M.persistent===!1&&(x.name==="span"?x.unwrap():p(x))})})},Vv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>wo(n,p).map(w=>w.settings),getNames:()=>bs(n)}};let f_=0;const Li=n=>{const c=new Date().getTime(),m=Math.floor(Math.random()*1e9);return f_++,n+"_"+m+f_+String(c)},Wv=(n,i)=>{Ne(i,c=>{ef(n,c)})},Uy=(n,i)=>{Ne(i,c=>{zc(n,c)})},d_=(n,i)=>Ke.fromDom(n.dom.cloneNode(i)),ug=n=>d_(n,!1),pc=n=>d_(n,!0),gu=(n,i)=>{const c=Ke.fromTag(i),m=Kf(n);return Ju(c,m),c},h_=(n,i)=>{const c=gu(n,i);iu(n,c);const m=Da(n);return ni(c,m),wr(n),c},Yy=(n,i,c=je)=>{const m=new _i(n,i),p=w=>{let x;do x=m[w]();while(x&&!_n(x)&&!c(x));return he.from(x).filter(_n)};return{current:()=>he.from(m.current()).filter(_n),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},fp=(n,i)=>{const c=i||(x=>n.isBlock(x)||mi(x)||Es(x)),m=(x,M,B,q)=>{if(_n(x)){const ae=q(x,M,x.data);if(ae!==-1)return he.some({container:x,offset:ae})}return B().bind(ae=>m(ae.container,ae.offset,B,q))};return{backwards:(x,M,B,q)=>{const ae=Yy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.prev().map(fe=>({container:fe,offset:fe.length})),B).getOrNull()},forwards:(x,M,B,q)=>{const ae=Yy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.next().map(fe=>({container:fe,offset:0})),B).getOrNull()}}},dp=Math.round,Jp=n=>n?{left:dp(n.left),top:dp(n.top),bottom:dp(n.bottom),right:dp(n.right),width:dp(n.width),height:dp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},e1=(n,i)=>(n=Jp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),fg=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Uv=(n,i,c)=>n>=0&&n<=Math.min(i.height,c.height)/2,sa=(n,i)=>{const c=Math.min(i.height/2,n.height/2);return n.bottom-c<i.top?!0:n.top>i.bottom?!1:Uv(i.top-n.bottom,n,i)},df=(n,i)=>n.top>i.bottom?!0:n.bottom<i.top?!1:Uv(i.bottom-n.top,n,i),ab=(n,i,c)=>i>=n.left&&i<=n.right&&c>=n.top&&c<=n.bottom,ek=n=>zn(n,(i,c)=>i.fold(()=>he.some(c),m=>{const p=Math.min(c.left,m.left),w=Math.min(c.top,m.top),x=Math.max(c.right,m.right),M=Math.max(c.bottom,m.bottom);return he.some({top:w,right:x,bottom:M,left:p,width:x-p,height:M-w})}),he.none()),Xy=(n,i,c)=>{const m=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(c,n.top+n.height),n.top);return Math.sqrt((i-m)*(i-m)+(c-p)*(c-p))},tk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),t1=(n,i,c)=>Math.min(Math.max(n,i),c),lb=n=>{const i=n.startContainer,c=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===c+1?i.childNodes[c]:null},ld=(n,i)=>{if(Jn(n)&&n.hasChildNodes()){const c=n.childNodes,m=t1(i,0,c.length-1);return c[m]}else return n},jy=(n,i)=>{if(!(i<0&&Jn(n)&&n.hasChildNodes()))return ld(n,i)},m_=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]"),g_=n=>L(n)&&n.charCodeAt(0)>=768&&m_.test(n),nk=(...n)=>i=>{for(let c=0;c<n.length;c++)if(n[c](i))return!0;return!1},p_=(...n)=>i=>{for(let c=0;c<n.length;c++)if(!n[c](i))return!1;return!0},k0=Jn,x0=Tl,b_=ch("display","block table"),qy=ch("float","left right"),n1=p_(k0,x0,st(qy)),v_=st(ch("white-space","pre pre-line pre-wrap")),o1=_n,dg=mi,Yv=Qr.nodeIndex,hf=jy,cb=n=>n?n.createRange():Qr.DOM.createRng(),qs=n=>L(n)&&/[\r\n\t ]/.test(n),pu=n=>!!n.setStart&&!!n.setEnd,hg=n=>{const i=n.startContainer,c=n.startOffset;if(qs(n.toString())&&v_(i.parentNode)&&_n(i)){const m=i.data;if(qs(m[c-1])||qs(m[c+1]))return!0}return!1},Gy=n=>{const i=n.ownerDocument,c=cb(i),m=i.createTextNode(Kr),p=n.parentNode;p.insertBefore(m,n),c.setStart(m,0),c.setEnd(m,1);const w=Jp(c.getBoundingClientRect());return p.removeChild(m),w},Yi=n=>{const i=n.startContainer,c=n.endContainer,m=n.startOffset,p=n.endOffset;if(i===c&&_n(c)&&m===0&&p===1){const w=n.cloneRange();return w.setEndAfter(c),mg(w)}else return null},Ky=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,mg=n=>{var i;let c;const m=n.getClientRects();return m.length>0?c=Jp(m[0]):c=Jp(n.getBoundingClientRect()),!pu(n)&&dg(n)&&Ky(c)?Gy(n):Ky(c)&&pu(n)&&(i=Yi(n))!==null&&i!==void 0?i:c},Oa=(n,i)=>{const c=e1(n,i);return c.width=1,c.right=c.left+1,c},fm=n=>{const i=[],c=x=>{x.height!==0&&(i.length>0&&fg(x,i[i.length-1])||i.push(x))},m=(x,M)=>{const B=cb(x.ownerDocument);if(M<x.data.length){if(g_(x.data[M]))return;if(g_(x.data[M-1])&&(B.setStart(x,M),B.setEnd(x,M+1),!hg(B))){c(Oa(mg(B),!1));return}}M>0&&(B.setStart(x,M-1),B.setEnd(x,M),hg(B)||c(Oa(mg(B),!1))),M<x.data.length&&(B.setStart(x,M),B.setEnd(x,M+1),hg(B)||c(Oa(mg(B),!0)))},p=n.container(),w=n.offset();if(o1(p))return m(p,w),i;if(k0(p))if(n.isAtEnd()){const x=hf(p,w);o1(x)&&m(x,x.data.length),n1(x)&&!dg(x)&&c(Oa(mg(x),!1))}else{const x=hf(p,w);if(o1(x)&&m(x,0),n1(x)&&n.isAtEnd())return c(Oa(mg(x),!1)),i;const M=hf(n.container(),n.offset()-1);n1(M)&&!dg(M)&&(b_(M)||b_(x)||!n1(x))&&c(Oa(mg(M),!1)),n1(x)&&c(Oa(mg(x),!0))}return i},Vt=(n,i,c)=>{const m=()=>(o1(n),i===0),p=()=>o1(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ae=cb(n.ownerDocument);return ae.setStart(n,i),ae.setEnd(n,i),ae},x=()=>(c||(c=fm(Vt(n,i))),c),M=()=>x().length>0,B=ae=>ae&&n===ae.container()&&i===ae.offset(),q=ae=>hf(n,ae?i-1:i);return{container:Qe(n),offset:Qe(i),toRange:w,getClientRects:x,isVisible:M,isAtStart:m,isAtEnd:p,isEqual:B,getNode:q}};Vt.fromRangeStart=n=>Vt(n.startContainer,n.startOffset),Vt.fromRangeEnd=n=>Vt(n.endContainer,n.endOffset),Vt.after=n=>Vt(n.parentNode,Yv(n)+1),Vt.before=n=>Vt(n.parentNode,Yv(n)),Vt.isAbove=(n,i)=>ri($o(i.getClientRects()),Po(n.getClientRects()),sa).getOr(!1),Vt.isBelow=(n,i)=>ri(Po(i.getClientRects()),$o(n.getClientRects()),df).getOr(!1),Vt.isAtStart=n=>n?n.isAtStart():!1,Vt.isAtEnd=n=>n?n.isAtEnd():!1,Vt.isTextPosition=n=>n?_n(n.container()):!1,Vt.isElementPosition=n=>!Vt.isTextPosition(n);const T0=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},Jy=(n,i,c)=>{i.insertNode(c),T0(n,c.previousSibling),T0(n,c.nextSibling)},E0=(n,i,c)=>{const m=he.from(c.firstChild),p=he.from(c.lastChild);i.insertNode(c),m.each(w=>T0(n,w.previousSibling)),p.each(w=>T0(n,w.nextSibling))},Ch=(n,i,c)=>{K1(c)?E0(n,i,c):Jy(n,i,c)},mf=_n,ub=Pd,Xv=Qr.nodeIndex,e2=n=>{const i=n.parentNode;return ub(i)?e2(i):i},jv=n=>n?Ge(n.childNodes,(i,c)=>(ub(c)&&c.nodeName!=="BR"?i=i.concat(jv(c)):i.push(c),i),[]):[],A0=(n,i)=>{let c=n;for(;(c=c.previousSibling)&&mf(c);)i+=c.data.length;return i},kh=n=>i=>n===i,cd=n=>{let i,c;i=jv(e2(n)),c=qe(i,kh(n),n),i=i.slice(0,c+1);const m=Ge(i,(p,w,x)=>(mf(w)&&mf(i[x-1])&&p++,p),0);return i=Qa(i,$f([n.nodeName])),c=qe(i,kh(n),n),c-m},Fu=n=>(mf(n)?"text()":n.nodeName.toLowerCase())+"["+cd(n)+"]",zl=(n,i,c)=>{const m=[];for(let p=i.parentNode;p&&p!==n&&!(c&&c(p));p=p.parentNode)m.push(p);return m},t2=(n,i)=>{let c=[],m=i.container(),p=i.offset(),w;if(mf(m))w=A0(m,p);else{const M=m.childNodes;p>=M.length?(w="after",p=M.length-1):w="before",m=M[p]}c.push(Fu(m));let x=zl(n,m);return x=Qa(x,st(Pd)),c=c.concat(Zi(x,M=>Fu(M))),c.reverse().join("/")+","+w},hp=(n,i,c)=>{let m=jv(n);return m=Qa(m,(p,w)=>!mf(p)||!mf(m[w-1])),m=Qa(m,$f([i])),m[c]},O_=(n,i)=>{let c=n,m=0;for(;mf(c);){const p=c.data.length;if(i>=m&&i<=m+p){n=c,i=i-m;break}if(!mf(c.nextSibling)){n=c,i=p;break}m+=p,c=c.nextSibling}return mf(n)&&i>n.data.length&&(i=n.data.length),Vt(n,i)},D0=(n,i)=>{if(!i)return null;const c=i.split(","),m=c[0].split("/"),p=c.length>1?c[1]:"before",w=Ge(m,(x,M)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(M);return B?(B[1]==="text()"&&(B[1]="#text"),hp(x,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!mf(w)&&w.parentNode){let x;return p==="after"?x=Xv(w)+1:x=Xv(w),Vt(w.parentNode,x)}return O_(w,parseInt(p,10))},s1=Es,n2=(n,i,c)=>{let m=n(i.data.slice(0,c)).length;for(let p=i.previousSibling;p&&_n(p);p=p.previousSibling)m+=n(p.data).length;return m},qv=(n,i,c,m,p)=>{const w=p?m.startContainer:m.endContainer;let x=p?m.startOffset:m.endOffset;const M=[],B=n.getRoot();if(_n(w))M.push(c?n2(i,w,x):x);else{let q=0;const ae=w.childNodes;x>=ae.length&&ae.length&&(q=1,x=Math.max(0,ae.length-1)),M.push(n.nodeIndex(ae[x],c)+q)}for(let q=w;q&&q!==B;q=q.parentNode)M.push(n.nodeIndex(q,c));return M},y_=(n,i,c,m)=>{const p=i.dom,w=qv(p,n,c,m,!0),x=i.isForward(),M=oa(m)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:x,...M};{const B=qv(p,n,c,m,!1);return{start:w,end:B,forward:x,...M}}},Gv=(n,i,c)=>{let m=0;return gn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===c)return!1;m++;return}}),m},o2=(n,i)=>{let c=i?n.startContainer:n.endContainer,m=i?n.startOffset:n.endOffset;if(Jn(c)&&c.nodeName==="TR"){const p=c.childNodes;c=p[Math.min(i?m:m-1,p.length-1)],c&&(m=i?0:c.childNodes.length,i?n.setStart(c,m):n.setEnd(c,m))}},vl=n=>(o2(n,!0),o2(n,!1),n),ec=(n,i)=>{if(Jn(n)&&(n=ld(n,i),s1(n)))return n;if(_r(n)){_n(n)&&Si(n)&&(n=n.parentNode);let c=n.previousSibling;if(s1(c)||(c=n.nextSibling,s1(c)))return c}},Qu=n=>ec(n.startContainer,n.startOffset)||ec(n.endContainer,n.endOffset),Zr=(n,i,c)=>{const m=c.getNode(),p=c.getRng();if(m.nodeName==="IMG"||s1(m)){const x=m.nodeName;return{name:x,index:Gv(c.dom,x,m)}}const w=Qu(p);if(w){const x=w.tagName;return{name:x,index:Gv(c.dom,x,w)}}return y_(n,c,i,p)},tc=n=>{const i=n.getRng();return{start:t2(n.dom.getRoot(),Vt.fromRangeStart(i)),end:t2(n.dom.getRoot(),Vt.fromRangeEnd(i)),forward:n.isForward()}},Vl=n=>({rng:n.getRng(),forward:n.isForward()}),dm=(n,i,c)=>{const m={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return c?n.create("span",m,""):n.create("span",m)},Sr=(n,i)=>{const c=n.dom;let m=n.getRng();const p=c.uniqueId(),w=n.isCollapsed(),x=n.getNode(),M=x.nodeName,B=n.isForward();if(M==="IMG")return{name:M,index:Gv(c,M,x)};const q=vl(m.cloneRange());if(!w){q.collapse(!1);const fe=dm(c,p+"_end",i);Ch(c,q,fe)}m=vl(m),m.collapse(!0);const ae=dm(c,p+"_start",i);return Ch(c,m,ae),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},w_=(n,i,c=!1)=>i===2?Zr(In,c,n):i===3?tc(n):i?Vl(n):Sr(n,!1),bu=He(Zr,Bt,!0),Dl=n=>{const i=w=>w(n),c=Qe(n),m=()=>p,p={tag:!0,inner:n,fold:(w,x)=>x(n),isValue:mt,isError:je,map:w=>bc.value(w(n)),mapError:m,bind:i,exists:i,forall:i,getOr:c,or:m,getOrThunk:c,orThunk:m,getOrDie:c,each:w=>{w(n)},toOptional:()=>he.some(n)};return p},s2=n=>{const i=()=>c,c={tag:!1,inner:n,fold:(m,p)=>m(n),isValue:je,isError:mt,map:i,mapError:m=>bc.error(m(n)),bind:i,exists:je,forall:mt,getOr:Bt,or:Bt,getOrThunk:Et,orThunk:Et,getOrDie:rn(String(n)),each:ot,toOptional:he.none};return c},bc={value:Dl,error:s2,fromOption:(n,i)=>n.fold(()=>s2(i),Dl)},pg={generate:n=>{if(!oe(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=[],c={};return Ne(n,(m,p)=>{const w=bs(m);if(w.length!==1)throw new Error("one and only one name per case");const x=w[0],M=m[x];if(c[x]!==void 0)throw new Error("duplicate key detected:"+x);if(x==="cata")throw new Error("cannot have a case named cata (sorry)");if(!oe(M))throw new Error("case arguments must be an array");i.push(x),c[x]=(...B)=>{const q=B.length;if(q!==M.length)throw new Error("Wrong number of arguments to case "+x+". Expected "+M.length+" ("+M+"), got "+q);return{fold:(...fe)=>{if(fe.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+fe.length);return fe[p].apply(null,B)},match:fe=>{const be=bs(fe);if(i.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+`
|
|
Actual: `+be.join(","));if(!tr(i,Ye=>kt(be,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+`
|
|
Required: `+i.join(", "));return fe[x].apply(null,B)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:B})}}}}),c}};pg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ok=n=>{const i=[],c=[];return Ne(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},sk=n=>n.type==="inline-command"||n.type==="inline-format",r2=n=>n.type==="block-command"||n.type==="block-format",i2=n=>{const i=m=>bc.error({message:m,pattern:n}),c=(m,p,w)=>{if(n.format!==void 0){let x;if(oe(n.format)){if(!tr(n.format,L))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(L(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return bc.value(p(x))}else return n.cmd!==void 0?L(n.cmd)?bc.value(w(n.cmd,n.value)):i(m+" pattern has non-string `cmd` parameter"):i(m+" pattern is missing both `format` and `cmd` parameters")};if(!te(n))return i("Raw pattern is not an object");if(!L(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!L(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 m=n.start,p=n.end;return p.length===0&&(p=m,m=""),c("Inline",w=>({type:"inline-format",start:m,end:p,format:w}),(w,x)=>({type:"inline-command",start:m,end:p,cmd:w,value:x}))}else return n.replacement!==void 0?L(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):bc.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"):c("Block",m=>({type:"block-format",start:n.start,format:m[0]}),(m,p)=>({type:"block-command",start:n.start,cmd:m,value:p}))},hm=n=>At(n,r2),a2=n=>At(n,sk),r1=(n,i)=>({inlinePatterns:a2(n),blockPatterns:hm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=ok(pt(n,i2));return Ne(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},Tn=ys().deviceType,rk=Tn.isTouch(),nc=Qr.DOM,ik=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return zn(i,(c,m)=>{const p=m.split("="),w=p[0],x=p.length>1?p[1]:w;return c[kc(w)]=kc(x),c},{})},l2=n=>K(n,RegExp),no=n=>i=>i.options.get(n),Pc=n=>L(n)||te(n),c2=(n,i="")=>c=>{const m=L(c);if(m)if(c.indexOf("=")!==-1){const p=ik(c);return{value:wo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},fb=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:c2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:c2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:c=>{const m=L(c)&&yr(c);return m?{value:c,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:c=>{const m=kt(["block","linebreak","invert","default"],c);return m?{value:c,valid:m}:{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:c=>we(c)?{valid:!0,value:c}:L(c)?{valid:!0,value:c}:{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:c=>{const m=c===!1||L(c)||tt(c,L);return m?L(c)?{value:pt(c.split(","),kc),valid:m}:oe(c)?{value:c,valid:m}:c===!1?{value:[],valid:m}:{value:c,valid:m}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:M_(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:c=>{const m=L(c)||tt(c,L);return m?{value:oe(c)?c:pt(c.split(","),kc),valid:m}:{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:c=>{const m=we(c)||L(c);return m?c===!1||Tn.isiPhone()||Tn.isiPad()?{value:"",valid:m}:{value:c===!0?"table,img,figure.image,div,video,iframe":c,valid:m}:{valid:!1,message:"Must be boolean or a string"}},default:!rk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:c=>c===!1||L(c)||ce(c),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:c=>{const m=c===!1||L(c);return m?{value:c===!1?"":c,valid:m}:{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:Pc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Pc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Pc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:c=>L(c)||c===!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:c=>tt(c,te)||c===!1?{value:Ol(c===!1?[]:c),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:c=>ce(c)?{value:Pl(c),valid:!0}:{valid:!1,message:"Must be a single function"},default:c=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:c=>tt(c,l2)?{value:c,valid:!0}:l2(c)?{value:[c],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:c=>{const m=kt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:c=>{const m=kt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{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:id.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:nc.getAttrib(n.getElement(),"placeholder")})})},gf=no("iframe_attrs"),Kv=no("doctype"),i1=no("document_base_url"),Qf=no("body_id"),al=no("body_class"),Qd=no("content_security_policy"),Zd=no("br_in_pre"),jc=no("forced_root_block"),db=no("forced_root_block_attrs"),u2=no("newline_behavior"),__=no("br_newline_selector"),f2=no("no_newline_selector"),xh=no("keep_styles"),jr=no("end_container_on_empty_block"),Jv=no("automatic_uploads"),ud=no("images_reuse_filename"),S_=no("images_replace_blob_uris"),C_=no("icons"),fa=no("icons_url"),ak=no("images_upload_url"),eO=no("images_upload_base_path"),tO=no("images_upload_credentials"),k_=no("images_upload_handler"),lk=no("content_css_cors"),hb=no("referrer_policy"),x_=no("language"),ck=no("language_url"),T_=no("indent_use_margin"),uk=no("indentation"),E_=no("content_css"),nO=no("content_style"),mp=no("font_css"),mb=no("directionality"),Xi=no("inline_boundaries_selector"),d2=no("object_resizing"),Mc=no("resize_img_proportional"),gb=no("placeholder"),ll=no("event_root"),A_=no("service_message"),mm=no("theme"),fk=no("theme_url"),oc=no("model"),pf=no("model_url"),P0=no("inline_boundaries"),dk=no("formats"),hk=no("preview_styles"),D_=no("format_empty_lines"),M0=no("format_noneditable_selector"),P_=no("custom_ui_selector"),M_=no("inline"),gp=no("hidden_input"),mk=no("submit_patch"),gk=no("add_form_submit_trigger"),pk=no("add_unload_trigger"),h2=no("custom_undo_redo_levels"),oO=no("disable_nodechange"),bg=no("readonly"),R_=no("editable_root"),$_=no("content_css_cors"),sO=no("plugins"),pb=no("external_plugins"),vg=no("block_unsupported_drop"),rO=no("visual"),iO=no("visual_table_class"),R0=no("visual_anchor_class"),N_=no("iframe_aria_text"),Th=no("setup"),$0=no("init_instance_callback"),I_=no("urlconverter_callback"),Eh=no("auto_focus"),pp=no("browser_spellcheck"),m2=no("protect"),B_=no("paste_block_drop"),aO=no("paste_data_images"),bk=no("paste_preprocess"),L_=no("paste_postprocess"),vk=no("newdocument_content"),Ok=no("paste_webkit_styles"),F_=no("paste_remove_styles_if_webkit"),Q_=no("paste_merge_formats"),Z_=no("smart_paste"),yk=no("paste_as_text"),wk=no("paste_tab_spaces"),_k=no("allow_html_data_urls"),H_=no("text_patterns"),g2=no("text_patterns_lookup"),p2=no("noneditable_class"),Sk=no("editable_class"),Ck=no("noneditable_regexp"),lO=no("preserve_cdata"),z_=no("highlight_on_focus"),cO=no("xss_sanitization"),N0=no("init_content_sync"),bb=n=>n.options.isSet("text_patterns_lookup"),uO=n=>gn.explode(n.options.get("font_size_style_values")),b2=n=>gn.explode(n.options.get("font_size_classes")),V_=n=>n.options.get("encoding")==="xml",v2=n=>gn.explode(n.options.get("images_file_types")),kk=no("table_tab_navigation"),fO=no("details_initial_state"),I0=no("details_serialized_state"),xk=Jn,dO=_n,bf=n=>{const i=n.parentNode;i&&i.removeChild(n)},hO=n=>{const i=In(n);return{count:n.length-i.length,text:i}},W_=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},mO=(n,i)=>(yl(n),i),Tk=(n,i)=>{const c=hO(n.data.substr(0,i.offset())),m=hO(n.data.substr(i.offset()));return(c.text+m.text).length>0?(W_(n),Vt(n,i.offset()-c.count)):i},B0=(n,i)=>{const c=i.container(),m=as(Rr(c.childNodes),n).map(p=>p<i.offset()?Vt(c,i.offset()-1):i).getOr(i);return yl(n),m},O2=(n,i)=>dO(n)&&i.container()===n?Tk(n,i):mO(n,i),Ek=(n,i)=>i.container()===n.parentNode?B0(n,i):mO(n,i),gO=(n,i)=>Vt.isTextPosition(i)?O2(n,i):Ek(n,i),yl=n=>{xk(n)&&_r(n)&&(Uc(n)?n.removeAttribute("data-mce-caret"):bf(n)),dO(n)&&(W_(n),n.data.length===0&&bf(n))},Ak=Es,vb=sf,Dk=Rd,Ob="*[contentEditable=false],video,audio,embed,object",y2=(n,i,c)=>{const m=e1(i.getBoundingClientRect(),c);let p,w;if(n.tagName==="BODY"){const M=n.ownerDocument.documentElement;p=n.scrollLeft||M.scrollLeft,w=n.scrollTop||M.scrollTop}else{const M=n.getBoundingClientRect();p=n.scrollLeft-M.left,w=n.scrollTop-M.top}m.left+=p,m.right+=p,m.top+=w,m.bottom+=w,m.width=1;let x=i.offsetWidth-i.clientWidth;return x>0&&(c&&(x*=-1),m.left+=x,m.right+=x),m},Pk=n=>{var i,c;const m=pl(Ke.fromDom(n),Ob);for(let p=0;p<m.length;p++){const w=m[p].dom;let x=w.previousSibling;if(hr(x)){const M=x.data;M.length===1?(i=x.parentNode)===null||i===void 0||i.removeChild(x):x.deleteData(M.length-1,1)}x=w.nextSibling,hh(x)&&(x.data.length===1?(c=x.parentNode)===null||c===void 0||c.removeChild(x):x.deleteData(0,1))}},Mk=(n,i,c,m)=>{const p=Sh();let w,x;const M=jc(n),B=n.dom,q=(Me,Ve)=>{let gt;if(ae(),Dk(Ve))return null;if(c(Ve)){const Ot=dh(M,Ve,Me),wt=y2(i,Ve,Me);B.setStyle(Ot,"top",wt.top),x=Ot;const Pt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Pt,{...wt}),B.add(i,Pt),p.set({caret:Pt,element:Ve,before:Me}),Me&&B.addClass(Pt,"mce-visual-caret-before"),fe(),gt=Ve.ownerDocument.createRange(),gt.setStart(Ot,0),gt.setEnd(Ot,0)}else return x=cu(Ve,Me),gt=Ve.ownerDocument.createRange(),gm(x.nextSibling)?(gt.setStart(x,0),gt.setEnd(x,0)):(gt.setStart(x,1),gt.setEnd(x,1)),gt;return gt},ae=()=>{Pk(i),x&&(yl(x),x=null),p.on(Me=>{B.remove(Me.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},fe=()=>{w=setInterval(()=>{p.on(Me=>{m()?B.toggleClass(Me.caret,"mce-visual-caret-hidden"):B.addClass(Me.caret,"mce-visual-caret-hidden")})},500)};return{show:q,hide:ae,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=y2(i,Me.element,Me.before);B.setStyles(Me.caret,{...Ve})})},destroy:()=>clearInterval(w)}},L0=()=>qn.browser.isFirefox(),gm=n=>Ak(n)||vb(n),yb=n=>(gm(n)||Iu(n)&&L0())&&wi(Ke.fromDom(n)).exists(wn),vu=ba,a1=Es,U_=sf,Y_=ch("display","block table table-cell table-caption list-item"),w2=_r,_2=Si,S2=Jn,Rk=_n,F0=Tl,pO=n=>n>0,bp=n=>n<0,Q0=(n,i)=>{let c;for(;c=n(i);)if(!_2(c))return c;return null},Ah=(n,i,c,m,p)=>{const w=new _i(n,m),x=a1(n)||_2(n);let M;if(bp(i)){if(x&&(M=Q0(w.prev.bind(w),!0),c(M)))return M;for(;M=Q0(w.prev.bind(w),p);)if(c(M))return M}if(pO(i)){if(x&&(M=Q0(w.next.bind(w),!0),c(M)))return M;for(;M=Q0(w.next.bind(w),p);)if(c(M))return M}return null},$k=(n,i)=>{const c=p=>vu(p.dom),m=p=>p.dom===i;return di(Ke.fromDom(n),c,m).map(p=>p.dom).getOr(i)},pm=(n,i)=>{for(;n&&n!==i;){if(Y_(n))return n;n=n.parentNode}return null},Hd=(n,i,c)=>pm(n.container(),c)===pm(i.container(),c),wb=(n,i)=>{if(!i)return he.none();const c=i.container(),m=i.offset();return S2(c)?he.from(c.childNodes[m+n]):he.none()},C2=(n,i)=>{var c;const p=((c=i.ownerDocument)!==null&&c!==void 0?c:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},_b=(n,i,c)=>pm(i,n)===pm(c,n),Og=(n,i,c)=>{const m=n?"previousSibling":"nextSibling";let p=c;for(;p&&p!==i;){let w=p[m];if(w&&w2(w)&&(w=w[m]),a1(w)||U_(w)){if(_b(i,w,p))return w;break}if(F0(w))break;p=p.parentNode}return null},S=He(C2,!0),A=He(C2,!1),H=(n,i,c)=>{let m;const p=He(Og,!0,i),w=He(Og,!1,i),x=c.startContainer,M=c.startOffset;if(Si(x)){const B=Rk(x)?x.parentNode:x,q=B.getAttribute("data-mce-caret");if(q==="before"&&(m=B.nextSibling,yb(m)))return S(m);if(q==="after"&&(m=B.previousSibling,yb(m)))return A(m)}if(!c.collapsed)return c;if(_n(x)){if(w2(x)){if(n===1){if(m=w(x),m)return S(m);if(m=p(x),m)return A(m)}if(n===-1){if(m=p(x),m)return A(m);if(m=w(x),m)return S(m)}return c}if(hr(x)&&M>=x.data.length-1)return n===1&&(m=w(x),m)?S(m):c;if(hh(x)&&M<=1)return n===-1&&(m=p(x),m)?A(m):c;if(M===x.data.length)return m=w(x),m?S(m):c;if(M===0)return m=p(x),m?A(m):c}return c},le=(n,i)=>wb(n?0:-1,i).filter(a1),Ce=(n,i,c)=>{const m=H(n,i,c);return n===-1?Vt.fromRangeStart(m):Vt.fromRangeEnd(m)},We=n=>he.from(n.getNode()).map(Ke.fromDom),ht=n=>he.from(n.getNode(!0)).map(Ke.fromDom),St=(n,i)=>{let c=i;for(;c=n(c);)if(c.isVisible())return c;return c},zt=(n,i)=>{const c=Hd(n,i);return!c&&mi(n.getNode())?!0:c};var vn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(vn||(vn={}));const Zn=Es,Vn=_n,Fo=Jn,ms=mi,Is=Tl,Hr=om,Zs=Kg,gi=(n,i)=>{const c=[];let m=n;for(;m&&m!==i;)c.push(m),m=m.parentNode;return c},ki=(n,i)=>n.hasChildNodes()&&i<n.childNodes.length?n.childNodes[i]:null,Ou=(n,i)=>{if(pO(n)){if(Is(i.previousSibling)&&!Vn(i.previousSibling))return Vt.before(i);if(Vn(i))return Vt(i,0)}if(bp(n)){if(Is(i.nextSibling)&&!Vn(i.nextSibling))return Vt.after(i);if(Vn(i))return Vt(i,i.data.length)}return bp(n)?ms(i)?Vt.before(i):Vt.after(i):Vt.before(i)},Zu=(n,i)=>{const c=i.nextSibling;return c&&Is(c)?Vn(c)?Vt(c,0):Vt.before(c):Zf(vn.Forwards,Vt.after(i),n)},Zf=(n,i,c)=>{let m,p,w,x;if(!Fo(c)||!i)return null;if(i.isEqual(Vt.after(c))&&c.lastChild){if(x=Vt.after(c.lastChild),bp(n)&&Is(c.lastChild)&&Fo(c.lastChild))return ms(c.lastChild)?Vt.before(c.lastChild):x}else x=i;const M=x.container();let B=x.offset();if(Vn(M)){if(bp(n)&&B>0)return Vt(M,--B);if(pO(n)&&B<M.length)return Vt(M,++B);m=M}else{if(bp(n)&&B>0&&(p=ki(M,B-1),Is(p)))return!Hr(p)&&(w=Ah(p,n,Zs,p),w)?Vn(w)?Vt(w,w.data.length):Vt.after(w):Vn(p)?Vt(p,p.data.length):Vt.before(p);if(pO(n)&&B<M.childNodes.length&&(p=ki(M,B),Is(p)))return ms(p)?Zu(c,p):!Hr(p)&&(w=Ah(p,n,Zs,p),w)?Vn(w)?Vt(w,0):Vt.before(w):Vn(p)?Vt(p,0):Vt.after(p);m=p||x.getNode()}if(m&&(pO(n)&&x.isAtEnd()||bp(n)&&x.isAtStart())&&(m=Ah(m,n,mt,c,!0),Zs(m,c)))return Ou(n,m);p=m&&Ah(m,n,Zs,c);const q=Nt(At(gi(M,c),Zn));return q&&(!p||!q.contains(p))?(pO(n)?x=Vt.after(q):x=Vt.before(q),x):p?Ou(n,p):null},Ea=n=>({next:i=>Zf(vn.Forwards,i,n),prev:i=>Zf(vn.Backwards,i,n)}),bm=(n,i,c)=>{const m=n?Vt.before(c):Vt.after(c);return zd(n,i,m)},fd=n=>mi(n)?Vt.before(n):Vt.after(n),k2=n=>Vt.isTextPosition(n)?n.offset()===0:Tl(n.getNode()),yu=n=>{if(Vt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Tl(n.getNode(!0))},X_=(n,i)=>!Vt.isTextPosition(n)&&!Vt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Z0=n=>!Vt.isTextPosition(n)&&mi(n.getNode()),H0=(n,i,c)=>n?!X_(i,c)&&!Z0(i)&&yu(i)&&k2(c):!X_(c,i)&&k2(i)&&yu(c),zd=(n,i,c)=>{const m=Ea(i);return he.from(n?m.next(c):m.prev(c))},Sb=(n,i,c)=>zd(n,i,c).bind(m=>Hd(c,m,i)&&H0(n,c,m)?zd(n,i,m):he.some(m)),Nk=(n,i,c,m)=>Sb(n,i,c).bind(p=>m(p)?Nk(n,i,p,m):he.some(p)),bO=(n,i)=>{const c=n?i.firstChild:i.lastChild;return _n(c)?he.some(Vt(c,n?0:c.data.length)):c?Tl(c)?he.some(n?Vt.before(c):fd(c)):bm(n,i,c):he.none()},Hf=He(zd,!0),Hu=He(zd,!1),cl=He(bO,!0),Vd=He(bO,!1),j_="_mce_caret",qc=n=>Jn(n)&&n.id===j_,Cb=(n,i)=>{let c=i;for(;c&&c!==n;){if(qc(c))return c;c=c.parentNode}return null},vO=n=>L(n.start),x2=n=>fn(n,"rng"),Ik=n=>fn(n,"id"),Bk=n=>fn(n,"name"),l1=n=>gn.isArray(n.start),T2=n=>!Bk(n)&&we(n.forward)?n.forward:!0,yg=(n,i)=>(Jn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='<br data-mce-bogus="1" />'),i),rP=(n,i)=>{const c=he.from(D0(n.getRoot(),i.start)),m=he.from(D0(n.getRoot(),i.end));return ri(c,m,(p,w)=>{const x=n.createRng();return x.setStart(p.container(),p.offset()),x.setEnd(w.container(),w.offset()),{range:x,forward:T2(i)}})},Lk=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},DE=n=>!n.hasChildNodes(),bI=(n,i)=>Vd(n).fold(je,c=>(i.setStart(c.container(),c.offset()),i.setEnd(c.container(),c.offset()),!0)),PE=(n,i,c)=>DE(i)&&Cb(n,i)?(Lk(i,c),!0):!1,ME=(n,i,c,m)=>{const p=c[i?"start":"end"],w=n.getRoot();if(p){let x=w,M=p[0];for(let B=p.length-1;x&&B>=1;B--){const q=x.childNodes;if(PE(w,x,m))return!0;if(p[B]>q.length-1)return PE(w,x,m)?!0:bI(x,m);x=q[p[B]]}_n(x)&&(M=Math.min(p[0],x.data.length)),Jn(x)&&(M=Math.min(p[0],x.childNodes.length)),i?m.setStart(x,M):m.setEnd(x,M)}return!0},Fk=n=>_n(n)&&n.data.length>0,Qk=(n,i,c)=>{const m=n.get(c.id+"_"+i),p=m==null?void 0:m.parentNode,w=c.keep;if(m&&p){let x,M;if(i==="start"?w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.nextSibling)?(x=m.nextSibling,M=0):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)+1):(x=p,M=n.nodeIndex(m)):w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)):(x=p,M=n.nodeIndex(m)),!w){const B=m.previousSibling,q=m.nextSibling;gn.each(gn.grep(m.childNodes),fe=>{_n(fe)&&(fe.data=fe.data.replace(/\uFEFF/g,""))});let ae;for(;ae=n.get(c.id+"_"+i);)n.remove(ae,!0);if(_n(q)&&_n(B)&&!qn.browser.isOpera()){const fe=B.data.length;B.appendData(q.data),n.remove(q),x=B,M=fe}}return he.some(Vt(x,M))}else return he.none()},Zk=(n,i)=>{const c=n.createRng();return ME(n,!0,i,c)&&ME(n,!1,i,c)?he.some({range:c,forward:T2(i)}):he.none()},RE=(n,i)=>{const c=Qk(n,"start",i),m=Qk(n,"end",i);return ri(c,m.or(c),(p,w)=>{const x=n.createRng();return x.setStart(yg(n,p.container()),p.offset()),x.setEnd(yg(n,w.container()),w.offset()),{range:x,forward:T2(i)}})},$E=(n,i)=>he.from(n.select(i.name)[i.index]).map(c=>{const m=n.createRng();return m.selectNode(c),{range:m,forward:!0}}),NE=(n,i)=>{const c=n.dom;if(i){if(l1(i))return Zk(c,i);if(vO(i))return rP(c,i);if(Ik(i))return RE(c,i);if(Bk(i))return $E(c,i);if(x2(i))return he.some({range:i.rng,forward:T2(i)})}return he.none()},iP=(n,i,c)=>w_(n,i,c),aP=(n,i)=>{NE(n,i).each(({range:c,forward:m})=>{n.setRng(c,m)})},Wd=n=>Jn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Gs=(n=>i=>n===i)(Kr),Dh=n=>n!==""&&` \f
|
|
\r \v`.indexOf(n)!==-1,kb=n=>!Dh(n)&&!Gs(n)&&!a0(n),Hk=n=>({value:IE(n)}),IE=n=>ga(n,"#").toUpperCase(),OO=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},cP=n=>{const i=OO(n.red)+OO(n.green)+OO(n.blue);return Hk(i)},zk=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,q_=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,E2=(n,i,c,m)=>({red:n,green:i,blue:c,alpha:m}),uP=(n,i,c,m)=>{const p=parseInt(n,10),w=parseInt(i,10),x=parseInt(c,10),M=parseFloat(m);return E2(p,w,x,M)},Vk=n=>{if(n==="transparent")return he.some(E2(0,0,0,0));const i=zk.exec(n);if(i!==null)return he.some(uP(i[1],i[2],i[3],"1"));const c=q_.exec(n);return c!==null?he.some(uP(c[1],c[2],c[3],c[4])):he.none()},G_=n=>Vk(n).map(cP).map(i=>"#"+i.value).getOr(n),Wk=n=>{const i=[];if(n)for(let c=0;c<n.rangeCount;c++)i.push(n.getRangeAt(c));return i},vI=n=>$s(n,i=>{const c=lb(i);return c?[Ke.fromDom(c)]:[]}),BE=n=>Wk(n).length>1,Uk=n=>At(vI(n),qm),yO=n=>pl(n,"td[data-mce-selected],th[data-mce-selected]"),A2=(n,i)=>{const c=yO(i);return c.length>0?c:Uk(n)},xb=n=>A2(Wk(n.selection.getSel()),Ke.fromDom(n.getBody())),vp=(n,i)=>Se(n,"table",i),LE=n=>{const i=n.startContainer,c=n.startOffset;return _n(i)?c===0?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c]).map(Ke.fromDom)},fP=n=>{const i=n.endContainer,c=n.endOffset;return _n(i)?c===i.data.length?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c-1]).map(Ke.fromDom)},FE=n=>ii(n).fold(Qe([n]),i=>[n].concat(FE(i))),Yk=n=>Mu(n).fold(Qe([n]),i=>ti(i)==="br"?Sa(i).map(c=>[n].concat(Yk(c))).getOr([]):[n].concat(Yk(i))),wO=(n,i)=>ri(LE(i),fP(i),(c,m)=>{const p=oo(FE(n),He(vt,c)),w=oo(Yk(n),He(vt,m));return p.isSome()&&w.isSome()}).getOr(!1),Xk=(n,i,c,m)=>{const p=c,w=new _i(c,p),x=Wt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,q)=>!kt(["td","th","table"],q.toLowerCase()));let M=c;do{if(_n(M)&&gn.trim(M.data).length!==0){m?i.setStart(M,0):i.setEnd(M,M.data.length);return}if(x[M.nodeName]){m?i.setStartBefore(M):M.nodeName==="BR"?i.setEndBefore(M):i.setEndAfter(M);return}}while(M=m?w.next():w.prev());p.nodeName==="BODY"&&(m?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},K_=n=>{const i=n.selection.getSel();return Oe(i)&&i.rangeCount>0},jk=(n,i)=>{const c=xb(n);c.length>0?Ne(c,m=>{const p=m.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},QE=(n,i,c)=>{const m=Sr(n,i);c(m),n.moveToBookmark(m)},D2=n=>Xe(n==null?void 0:n.nodeType),qk=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),dP=(n,i)=>{if(qk(i)&&!/^(TD|TH)$/.test(i.nodeName)){const c=n.getAttrib(i,"data-mce-selected"),m=parseInt(c,10);return!isNaN(m)&&m>0}else return!1},vm=n=>n.isContentEditable===!0,ZE=(n,i,c)=>{const{selection:m,dom:p}=n,w=m.getNode(),x=Es(w);QE(m,!0,()=>{i()}),x&&Es(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):c(m.getStart())&&hP(p,m)},hP=(n,i)=>{var c,m;const p=i.getRng(),{startContainer:w,startOffset:x}=p,M=i.getNode();if(!dP(n,M)&&Jn(w)){const B=w.childNodes,q=n.getRoot();let ae;if(x<B.length){const fe=B[x];ae=new _i(fe,(c=n.getParent(fe,n.isBlock))!==null&&c!==void 0?c:q)}else{const fe=B[B.length-1];ae=new _i(fe,(m=n.getParent(fe,n.isBlock))!==null&&m!==void 0?m:q),ae.next(!0)}for(let fe=ae.current();fe;fe=ae.next()){if(n.getContentEditable(fe)==="false")return;if(_n(fe)&&!sc(fe)){p.setStart(fe,0),i.setRng(p);return}}}},Gn=(n,i,c)=>{if(n){const m=i?"nextSibling":"previousSibling";for(n=c?n:n[m];n;n=n[m])if(Jn(n)||!sc(n))return n}},Wl=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||ig(n,i),Om=(n,i,c)=>n.schema.isValidChild(i,c),sc=(n,i=!1)=>{if(Oe(n)&&_n(n)){const c=i?n.data.replace(/ /g,"\xA0"):n.data;return eg(c)}else return!1},ym=n=>Oe(n)&&_n(n)&&n.length===0,HE=(n,i)=>{const c="[data-mce-cef-wrappable]",m=M0(n),p=ol(m)?c:`${c},${m}`;return Pu(Ke.fromDom(i),p)},P2=(n,i)=>{const c=n.dom;return qk(i)&&c.getContentEditable(i)==="false"&&HE(n,i)&&c.select('[contenteditable="true"]',i).length===0},Ph=(n,i)=>ce(n)?n(i):(Oe(i)&&(n=n.replace(/%(\w+)/g,(c,m)=>i[m]||c)),n),J_=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),M2=(n,i)=>{if(Re(n))return null;{let c=String(n);return(i==="color"||i==="backgroundColor")&&(c=G_(c)),i==="fontWeight"&&n===700&&(c="bold"),i==="fontFamily"&&(c=c.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),c}},R2=(n,i,c)=>{const m=n.getStyle(i,c);return M2(m,c)},Gk=(n,i)=>{let c;return n.getParent(i,m=>Jn(m)?(c=n.getStyle(m,"text-decoration"),!!c&&c!=="none"):!1),c},$2=(n,i,c)=>n.getParents(i,c,n.getRoot()),eS=(n,i,c)=>{const m=n.formatter.get(i);return Oe(m)&&jt(m,c)},Kk=(n,i)=>eS(n,i,m=>{const p=w=>ce(w)||w.length>1&&w.charAt(0)==="%";return jt(["styles","attributes"],w=>wo(m,w).exists(x=>{const M=oe(x)?x:po(x);return jt(M,p)}))}),mP=(n,i,c)=>{const m=["inline","block","selector","attributes","styles","classes"],p=w=>Wt(w,(x,M)=>jt(m,B=>B===M));return eS(n,i,w=>{const x=p(w);return eS(n,c,M=>{const B=p(M);return xo(x,B)})})},wm=n=>os(n,"block"),tS=n=>wm(n)&&n.wrapper===!0,N2=n=>wm(n)&&n.wrapper!==!0,dd=n=>os(n,"selector"),Ml=n=>os(n,"inline"),Jk=n=>dd(n)&&Ml(n)&&Gr(wo(n,"mixed"),!0),I2=n=>dd(n)&&n.expand!==!1&&!Ml(n),Ud=Wd,B2=$2,ex=sc,tx=Wl,gP=n=>mi(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,zE=(n,i)=>{let c=i;for(;c;){if(Jn(c)&&n.getContentEditable(c))return n.getContentEditable(c)==="false"?c:i;c=c.parentNode}return i},L2=(n,i,c,m)=>{const p=i.data;if(n){for(let w=c;w>0;w--)if(m(p.charAt(w-1)))return w}else for(let w=c;w<p.length;w++)if(m(p.charAt(w)))return w;return-1},VE=(n,i,c)=>L2(n,i,c,m=>Gs(m)||Dh(m)),pP=(n,i,c)=>L2(n,i,c,kb),Tb=(n,i,c,m,p,w)=>{let x;const M=n.getParent(c,n.isBlock)||i,B=(ae,fe,be)=>{const Le=fp(n),Ye=p?Le.backwards:Le.forwards;return he.from(Ye(ae,fe,(Me,Ve)=>Ud(Me.parentNode)?-1:(x=Me,be(p,Me,Ve)),M))};return B(c,m,VE).bind(ae=>w?B(ae.container,ae.offset+(p?-1:0),pP):he.some(ae)).orThunk(()=>x?he.some({container:x,offset:p?0:x.length}):he.none())},Gc=(n,i,c,m,p)=>{const w=m[p];_n(m)&&ol(m.data)&&w&&(m=w);const x=B2(n,m);for(let M=0;M<x.length;M++)for(let B=0;B<i.length;B++){const q=i[B];if(!(Oe(q.collapsed)&&q.collapsed!==c.collapsed)&&dd(q)&&n.is(x[M],q.selector))return x[M]}return m},Mh=(n,i,c,m)=>{var p;let w=c;const x=n.getRoot(),M=i[0];if(wm(M)&&(w=M.wrapper?null:n.getParent(c,M.block,x)),!w){const B=(p=n.getParent(c,"LI,TD,TH"))!==null&&p!==void 0?p:x;w=n.getParent(_n(c)?c.parentNode:c,q=>q!==x&&tx(n.schema,q),B)}if(w&&wm(M)&&M.wrapper&&(w=B2(n,w,"ul,ol").reverse()[0]||w),!w)for(w=c;w&&w[m]&&!n.isBlock(w[m])&&(w=w[m],!J_(w,"br")););return w||c},Yd=(n,i,c,m)=>{const p=c.parentNode;return Oe(c[m])?!1:p===i||Re(p)||n.isBlock(p)?!0:Yd(n,i,p,m)},hd=(n,i,c,m,p)=>{let w=c;const x=p?"previousSibling":"nextSibling",M=n.getRoot();if(_n(c)&&!ex(c)&&(p?m>0:m<c.data.length))return c;for(;w;){if(!i[0].block_expand&&n.isBlock(w))return w;for(let B=w[x];B;B=B[x]){const q=_n(B)&&!Yd(n,M,B,x);if(!Ud(B)&&!gP(B)&&!ex(B,q))return w}if(w===M||w.parentNode===M){c=w;break}w=w.parentNode}return c},nS=n=>Ud(n.parentNode)||Ud(n),z0=(n,i,c,m=!1)=>{let{startContainer:p,startOffset:w,endContainer:x,endOffset:M}=i;const B=c[0];return Jn(p)&&p.hasChildNodes()&&(p=ld(p,w),_n(p)&&(w=0)),Jn(x)&&x.hasChildNodes()&&(x=ld(x,i.collapsed?M:M-1),_n(x)&&(M=x.data.length)),p=zE(n,p),x=zE(n,x),nS(p)&&(p=Ud(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,_n(p)&&(w=i.collapsed?p.length:0)),nS(x)&&(x=Ud(x)?x:x.parentNode,i.collapsed?x=x.nextSibling||x:x=x.previousSibling||x,_n(x)&&(M=i.collapsed?0:x.length)),i.collapsed&&(Tb(n,n.getRoot(),p,w,!0,m).each(({container:fe,offset:be})=>{p=fe,w=be}),Tb(n,n.getRoot(),x,M,!1,m).each(({container:fe,offset:be})=>{x=fe,M=be})),(Ml(B)||B.block_expand)&&((!Ml(B)||!_n(p)||w===0)&&(p=hd(n,c,p,w,!0)),(!Ml(B)||!_n(x)||M===x.data.length)&&(x=hd(n,c,x,M,!1))),I2(B)&&(p=Gc(n,c,i,p,"previousSibling"),x=Gc(n,c,i,x,"nextSibling")),(wm(B)||dd(B))&&(p=Mh(n,c,p,"previousSibling"),x=Mh(n,c,x,"nextSibling"),wm(B)&&(n.isBlock(p)||(p=hd(n,c,p,w,!0)),n.isBlock(x)||(x=hd(n,c,x,M,!1)))),Jn(p)&&p.parentNode&&(w=n.nodeIndex(p),p=p.parentNode),Jn(x)&&x.parentNode&&(M=n.nodeIndex(x)+1,x=x.parentNode),{startContainer:p,startOffset:w,endContainer:x,endOffset:M}},c1=(n,i,c)=>{var m;const p=i.startOffset,w=ld(i.startContainer,p),x=i.endOffset,M=ld(i.endContainer,x-1),B=Ve=>{const gt=Ve[0];_n(gt)&>===w&&p>=gt.data.length&&Ve.splice(0,1);const Ot=Ve[Ve.length-1];return x===0&&Ve.length>0&&Ot===M&&_n(Ot)&&Ve.splice(Ve.length-1,1),Ve},q=(Ve,gt,Ot)=>{const wt=[];for(;Ve&&Ve!==Ot;Ve=Ve[gt])wt.push(Ve);return wt},ae=(Ve,gt)=>n.getParent(Ve,Ot=>Ot.parentNode===gt,gt),fe=(Ve,gt,Ot)=>{const wt=Ot?"nextSibling":"previousSibling";for(let Pt=Ve,hn=Pt.parentNode;Pt&&Pt!==gt;Pt=hn){hn=Pt.parentNode;const Hn=q(Pt===Ve?Pt:Pt[wt],wt);Hn.length&&(Ot||Hn.reverse(),c(B(Hn)))}};if(w===M)return c(B([w]));const be=(m=n.findCommonAncestor(w,M))!==null&&m!==void 0?m:n.getRoot();if(n.isChildOf(w,M))return fe(w,be,!0);if(n.isChildOf(M,w))return fe(M,be);const Le=ae(w,be)||w,Ye=ae(M,be)||M;fe(w,Le,!0);const Me=q(Le===w?Le:Le.nextSibling,"nextSibling",Ye===M?Ye.nextSibling:Ye);Me.length&&c(B(Me)),fe(M,Ye)},bP=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],nx=n=>sl(n)&&Wc(n)===Ft,vP=(n,i,c,m)=>fi(i).fold(()=>"skipping",p=>m==="br"||nx(i)?"valid":JC(i)?"existing":qc(i.dom)?"caret":jt(bP,w=>Pu(i,w))?"valid-block":!Om(n,c,m)||!Om(n,ti(p),c)?"invalid-child":"valid"),WE=(n,i)=>{const c=z0(n.dom,i,[{inline:"span"}]);i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset),n.selection.setRng(i)},UE=(n,i,c,m,p,w)=>{const{uid:x=i,...M}=c;ef(n,ad()),Pr(n,`${Kp()}`,x),Pr(n,`${ff()}`,m);const{attributes:B={},classes:q=[]}=p(x,M);if(Ju(n,B),Wv(n,q),w){q.length>0&&Pr(n,`${S0()}`,q.join(","));const ae=bs(B);ae.length>0&&Pr(n,`${C0()}`,ae.join(","))}},YE=n=>{zc(n,ad()),Vi(n,`${Kp()}`),Vi(n,`${ff()}`),Vi(n,`${ib()}`);const i=Va(n,`${C0()}`).map(m=>m.split(",")).getOr([]),c=Va(n,`${S0()}`).map(m=>m.split(",")).getOr([]);Ne(i,m=>Vi(n,m)),Uy(n,c),Vi(n,`${S0()}`),Vi(n,`${C0()}`)},oS=(n,i,c,m,p)=>{const w=Ke.fromTag("span",n);return UE(w,i,c,m,p,!1),w},ox=(n,i,c,m,p,w)=>{const x=[],M=oS(n.getDoc(),c,w,m,p),B=Sh(),q=()=>{B.clear()},ae=()=>B.get().getOrThunk(()=>{const Ye=ug(M);return x.push(Ye),B.set(Ye),Ye}),fe=Ye=>{Ne(Ye,be)},be=Ye=>{switch(vP(n,Ye,"span",ti(Ye))){case"invalid-child":{q();const Ve=Da(Ye);fe(Ve),q();break}case"valid-block":{q(),UE(Ye,c,w,m,p,!0);break}case"valid":{const Ve=ae();e0(Ye,Ve);break}}},Le=Ye=>{const Me=pt(Ye,Ke.fromDom);fe(Me)};return c1(n.dom,i,Ye=>{q(),Le(Ye)}),x},Ri=(n,i,c,m)=>{n.undoManager.transact(()=>{const p=n.selection,w=p.getRng(),x=xb(n).length>0,M=Li("mce-annotation");if(w.collapsed&&!x&&WE(n,w),p.getRng().collapsed&&!x){const B=oS(n.getDoc(),M,m,i,c.decorate);Mf(B,Kr),p.getRng().insertNode(B.dom),p.select(B.dom)}else QE(p,!1,()=>{jk(n,B=>{ox(n,B,M,i,c.decorate,m)})})})},u1=n=>{const i=Vv();EE(n,i);const c=u_(n,i),m=Ec("span"),p=w=>{Ne(w,x=>{m(x)?Kl(x):YE(x)})};return{register:(w,x)=>{i.register(w,x)},annotate:(w,x)=>{i.lookup(w).each(M=>{Ri(n,w,M,x)})},annotationChanged:(w,x)=>{c.addListener(w,x)},remove:w=>{Vy(n,he.some(w)).each(({elements:x})=>{const M=n.selection.getBookmark();p(x),n.selection.moveToBookmark(M)})},removeAll:w=>{const x=n.selection.getBookmark();ln(Wy(n,w),(M,B)=>{p(M)}),n.selection.moveToBookmark(x)},getAll:w=>{const x=Wy(n,w);return vs(x,M=>pt(M,B=>B.dom))}}},_O=n=>({getBookmark:He(iP,n),moveToBookmark:He(aP,n)});_O.isBookmarkNode=Wd;const sx=(n,i,c)=>c.collapsed?!1:jt(c.getClientRects(),m=>ab(m,n,i)),XE=(n,i)=>n.dispatch("PreProcess",i),rx=(n,i)=>n.dispatch("PostProcess",i),jE=n=>{n.dispatch("remove")},sS=n=>{n.dispatch("detach")},OP=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},yP=(n,i,c,m,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:c,height:m,origin:p})},qE=(n,i,c,m,p)=>{n.dispatch("ObjectResized",{target:i,width:c,height:m,origin:p})},wP=n=>{n.dispatch("PreInit")},ix=n=>{n.dispatch("PostRender")},SO=n=>{n.dispatch("Init")},CO=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},rS=(n,i,c)=>{n.dispatch(i,c)},GE=(n,i,c,m)=>{n.dispatch("FormatApply",{format:i,node:c,vars:m})},Rh=(n,i,c,m)=>{n.dispatch("FormatRemove",{format:i,node:c,vars:m})},Kc=(n,i)=>n.dispatch("BeforeSetContent",i),wu=(n,i)=>n.dispatch("SetContent",i),Op=(n,i)=>n.dispatch("BeforeGetContent",i),_P=(n,i)=>n.dispatch("GetContent",i),SP=(n,i)=>{n.dispatch("AutocompleterStart",i)},CP=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},cr=n=>{n.dispatch("AutocompleterEnd")},kP=(n,i,c)=>n.dispatch("PastePreProcess",{content:i,internal:c}),KE=(n,i,c)=>n.dispatch("PastePostProcess",{node:i,internal:c}),iS=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),xP=(n,i)=>n.dispatch("EditableRootStateChange",{state:i}),to={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||to.metaKeyPressed(n),metaKeyPressed:n=>qn.os.isMacOS()||qn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},V0="data-mce-selected",TP="table,img,figure.image,hr,video,span.mce-preview-object,details",JE=Math.abs,aS=Math.round,F2={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},ax=n=>n.type==="longpress"||n.type.indexOf("touch")===0,lx=(n,i)=>{const c=i.dom,m=i.getDoc(),p=document,w=i.getBody();let x,M,B,q,ae,fe,be,Le,Ye,Me,Ve,gt,Ot,wt,Pt,hn,Hn;const $n=En=>Oe(En)&&(Ui(En)||c.is(En,"figure.image")),Lt=En=>sf(En)||c.hasClass(En,"mce-preview-object"),Zt=(En,jo)=>{if(ax(En)){const Ks=En.touches[0];return $n(En.target)&&!sx(Ks.clientX,Ks.clientY,jo)}else return $n(En.target)&&!sx(En.clientX,En.clientY,jo)},yn=En=>{const jo=En.target;Zt(En,i.selection.getRng())&&!En.isDefaultPrevented()&&i.selection.select(jo)},yo=En=>c.hasClass(En,"mce-preview-object")&&Oe(En.firstElementChild)?[En,En.firstElementChild]:c.is(En,"figure.image")?[En.querySelector("img")]:[En],Do=En=>{const jo=d2(i);return!jo||En.getAttribute("data-mce-resize")==="false"||En===i.getBody()?!1:c.hasClass(En,"mce-preview-object")&&Oe(En.firstElementChild)?Pu(Ke.fromDom(En.firstElementChild),jo):Pu(Ke.fromDom(En),jo)},Cs=En=>Lt(En)?c.create("img",{src:qn.transparentSrc}):En.cloneNode(!0),Ws=(En,jo,Ks)=>{if(Oe(Ks)){const Jr=yo(En);Ne(Jr,ho=>{ho.style[jo]||!i.schema.isValid(ho.nodeName.toLowerCase(),jo)?c.setStyle(ho,jo,Ks):c.setAttrib(ho,jo,""+Ks)})}},Ir=(En,jo,Ks)=>{Ws(En,"width",jo),Ws(En,"height",Ks)},pi=En=>{let jo,Ks,Jr,ho,Us;jo=En.screenX-fe,Ks=En.screenY-be,wt=jo*q[2]+Me,Pt=Ks*q[3]+Ve,wt=wt<5?5:wt,Pt=Pt<5?5:Pt,($n(x)||Lt(x))&&Mc(i)!==!1?Jr=!to.modifierPressed(En):Jr=to.modifierPressed(En),Jr&&(JE(jo)>JE(Ks)?(Pt=aS(wt*gt),wt=aS(Pt/gt)):(wt=aS(Pt/gt),Pt=aS(wt*gt))),Ir(M,wt,Pt),ho=q.startPos.x+jo,Us=q.startPos.y+Ks,ho=ho>0?ho:0,Us=Us>0?Us:0,c.setStyles(B,{left:ho,top:Us,display:"block"}),B.innerHTML=wt+" × "+Pt,q[2]<0&&M.clientWidth<=wt&&c.setStyle(M,"left",Le+(Me-wt)),q[3]<0&&M.clientHeight<=Pt&&c.setStyle(M,"top",Ye+(Ve-Pt)),jo=w.scrollWidth-hn,Ks=w.scrollHeight-Hn,jo+Ks!==0&&c.setStyles(B,{left:ho-jo,top:Us-Ks}),Ot||(yP(i,x,Me,Ve,"corner-"+q.name),Ot=!0)},fl=()=>{const En=Ot;Ot=!1,En&&(Ws(x,"width",wt),Ws(x,"height",Pt)),c.unbind(m,"mousemove",pi),c.unbind(m,"mouseup",fl),p!==m&&(c.unbind(p,"mousemove",pi),c.unbind(p,"mouseup",fl)),c.remove(M),c.remove(B),c.remove(ae),Il(x),En&&(qE(i,x,wt,Pt,"corner-"+q.name),c.setAttrib(x,"style",c.getAttrib(x,"style"))),i.nodeChanged()},Il=En=>{Bs();const jo=c.getPos(En,w),Ks=jo.x,Jr=jo.y,ho=En.getBoundingClientRect(),Us=ho.width||ho.right-ho.left,ci=ho.height||ho.bottom-ho.top;x!==En&&(Pn(),x=En,wt=Pt=0);const Ja=i.dispatch("ObjectSelected",{target:En});Do(En)&&!Ja.isDefaultPrevented()?ln(F2,(Ei,$c)=>{const Qh=Dm=>{const qO=yo(x)[0];fe=Dm.screenX,be=Dm.screenY,Me=qO.clientWidth,Ve=qO.clientHeight,gt=Ve/Me,q=Ei,q.name=$c,q.startPos={x:Us*Ei[0]+Ks,y:ci*Ei[1]+Jr},hn=w.scrollWidth,Hn=w.scrollHeight,ae=c.add(w,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),c.setStyles(ae,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),M=Cs(x),c.addClass(M,"mce-clonedresizable"),c.setAttrib(M,"data-mce-bogus","all"),M.contentEditable="false",c.setStyles(M,{left:Ks,top:Jr,margin:0}),Ir(M,Us,ci),M.removeAttribute(V0),w.appendChild(M),c.bind(m,"mousemove",pi),c.bind(m,"mouseup",fl),p!==m&&(c.bind(p,"mousemove",pi),c.bind(p,"mouseup",fl)),B=c.add(w,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},Me+" × "+Ve)};let qd=c.get("mceResizeHandle"+$c);qd&&c.remove(qd),qd=c.add(w,"div",{id:"mceResizeHandle"+$c,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+$c+"-resize; margin:0; padding:0"}),c.bind(qd,"mousedown",Dm=>{Dm.stopImmediatePropagation(),Dm.preventDefault(),Qh(Dm)}),Ei.elm=qd,c.setStyles(qd,{left:Us*Ei[0]+Ks-qd.offsetWidth/2,top:ci*Ei[1]+Jr-qd.offsetHeight/2})}):Pn(!1)},Oc=_0(Il,0),Pn=(En=!0)=>{Oc.cancel(),Bs(),x&&En&&x.removeAttribute(V0),ln(F2,(jo,Ks)=>{const Jr=c.get("mceResizeHandle"+Ks);Jr&&(c.unbind(Jr),c.remove(Jr))})},eo=(En,jo)=>c.isChildOf(En,jo),Cr=En=>{if(Ot||i.removed||i.composing)return;const jo=En.type==="mousedown"?En.target:n.getNode(),Ks=at(Ke.fromDom(jo),TP).map(ho=>ho.dom).filter(ho=>c.isEditable(ho.parentElement)).getOrUndefined(),Jr=Oe(Ks)?c.getAttrib(Ks,V0,"1"):"1";if(Ne(c.select(`img[${V0}],hr[${V0}]`),ho=>{ho.removeAttribute(V0)}),Oe(Ks)&&eo(Ks,w)&&i.hasFocus()){Co();const ho=n.getStart(!0);if(eo(ho,Ks)&&eo(n.getEnd(!0),Ks)){c.setAttrib(Ks,V0,Jr),Oc.throttle(Ks);return}}Pn()},Bs=()=>{ln(F2,En=>{En.elm&&(c.unbind(En.elm),delete En.elm)})},Co=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{Co(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",Cr),i.on("keyup compositionend",En=>{x&&x.nodeName==="TABLE"&&Cr(En)}),i.on("hide blur",Pn),i.on("contextmenu longpress",yn,!0)}),i.on("remove",Bs),{isResizable:Do,showResizeRect:Il,hideResizeRect:Pn,updateResizeRect:Cr,destroy:()=>{Oc.cancel(),x=M=ae=null}}},EP=(n,i)=>{i.fold(c=>{n.setStartBefore(c.dom)},(c,m)=>{n.setStart(c.dom,m)},c=>{n.setStartAfter(c.dom)})},OI=(n,i)=>{i.fold(c=>{n.setEndBefore(c.dom)},(c,m)=>{n.setEnd(c.dom,m)},c=>{n.setEndAfter(c.dom)})},e3=(n,i,c)=>{const m=n.document.createRange();return EP(m,i),OI(m,c),m},t3=(n,i,c,m,p)=>{const w=n.document.createRange();return w.setStart(i.dom,c),w.setEnd(m.dom,p),w},lS=pg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),AP=(n,i,c)=>i(Ke.fromDom(c.startContainer),c.startOffset,Ke.fromDom(c.endContainer),c.endOffset),Jo=(n,i)=>i.match({domRange:c=>({ltr:Qe(c),rtl:he.none}),relative:(c,m)=>({ltr:Ut(()=>e3(n,c,m)),rtl:Ut(()=>he.some(e3(n,m,c)))}),exact:(c,m,p,w)=>({ltr:Ut(()=>t3(n,c,m,p,w)),rtl:Ut(()=>he.some(t3(n,p,w,c,m)))})}),DP=(n,i)=>{const c=i.ltr();return c.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>lS.rtl(Ke.fromDom(p.endContainer),p.endOffset,Ke.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>AP(n,lS.ltr,c)):AP(n,lS.ltr,c)},PP=(n,i)=>{const c=Jo(n,i);return DP(n,c)};lS.ltr,lS.rtl;const Q2={create:(n,i,c,m)=>({start:n,soffset:i,finish:c,foffset:m})},cS=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretPositionFromPoint)===null||p===void 0?void 0:p.call(m,i,c)).bind(w=>{if(w.offsetNode===null)return he.none();const x=n.dom.createRange();return x.setStart(w.offsetNode,w.offset),x.collapse(),he.some(x)})},MP=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretRangeFromPoint)===null||p===void 0?void 0:p.call(m,i,c))},RP=(()=>document.caretPositionFromPoint?cS:document.caretRangeFromPoint?MP:he.none)(),$P=(n,i,c)=>{const m=Ke.fromDom(n.document);return RP(m,i,c).map(p=>Q2.create(Ke.fromDom(p.startContainer),p.startOffset,Ke.fromDom(p.endContainer),p.endOffset))},Z2=pg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),cx=(n,i,c,m)=>n.fold(i,c,m),n3=n=>n.fold(Bt,Bt,Bt),ux=Z2.before,fx=Z2.on,o3=Z2.after,f1={before:ux,on:fx,after:o3,cata:cx,getStart:n3},kO=pg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),dx=n=>kO.exact(n.start,n.soffset,n.finish,n.foffset),NP=n=>n.match({domRange:i=>Ke.fromDom(i.startContainer),relative:(i,c)=>f1.getStart(i),exact:(i,c,m,p)=>i}),IP=kO.domRange,Nr=kO.relative,hx=kO.exact,yp=n=>{const i=NP(n);return Xr(i)},wp=Q2.create,d1={domRange:IP,relative:Nr,exact:hx,exactFromRange:dx,getWin:yp,range:wp},zu=(n,i)=>{const c=ti(n);return c==="input"?f1.after(n):kt(["br","img"],c)?i===0?f1.before(n):f1.after(n):f1.on(n,i)},uS=(n,i)=>{const c=n.fold(f1.before,zu,f1.after),m=i.fold(f1.before,zu,f1.after);return d1.relative(c,m)},xO=(n,i,c,m)=>{const p=zu(n,i),w=zu(c,m);return d1.relative(p,w)},fS=n=>n.match({domRange:i=>{const c=Ke.fromDom(i.startContainer),m=Ke.fromDom(i.endContainer);return xO(c,i.startOffset,m,i.endOffset)},relative:uS,exact:xO}),W0=(n,i)=>{const m=(i||document).createDocumentFragment();return Ne(n,p=>{m.appendChild(p.dom)}),Ke.fromDom(m)},BP=n=>{const i=d1.getWin(n).dom,c=(p,w,x,M)=>t3(i,p,w,x,M),m=fS(n);return PP(i,m).match({ltr:c,rtl:c})},wI=(n,i,c)=>$P(n,i,c),LP=(n,i,c)=>{const m=Xr(Ke.fromDom(c));return wI(m.dom,n,i).map(p=>{const w=c.createRange();return w.setStart(p.start.dom,p.soffset),w.setEnd(p.finish.dom,p.foffset),w}).getOrUndefined()},s3=(n,i)=>Oe(n)&&Oe(i)&&n.startContainer===i.startContainer&&n.startOffset===i.startOffset&&n.endContainer===i.endContainer&&n.endOffset===i.endOffset,ur=(n,i,c)=>{let m=n;for(;m&&m!==i;){if(c(m))return m;m=m.parentNode}return null},_m=(n,i,c)=>ur(n,i,c)!==null,TO=(n,i,c)=>_m(n,i,m=>m.nodeName===c),FP=(n,i)=>_r(n)&&!_m(n,i,qc),U0=(n,i,c)=>{const m=i.parentNode;if(m){const p=new _i(i,n.getParent(m,n.isBlock)||n.getRoot());let w;for(;w=p[c?"prev":"next"]();)if(mi(w))return!0}return!1},mr=(n,i)=>{var c;return((c=n.previousSibling)===null||c===void 0?void 0:c.nodeName)===i},QP=(n,i)=>{let c=i;for(;c&&c!==n;){if(Es(c))return!0;c=c.parentNode}return!1},dS=(n,i,c,m,p)=>{const w=n.getRoot(),x=n.schema.getNonEmptyElements(),M=p.parentNode;let B,q;if(!M)return he.none();const ae=n.getParent(M,n.isBlock)||w;if(m&&mi(p)&&i&&n.isEmpty(ae))return he.some(Vt(M,n.nodeIndex(p)));const fe=new _i(p,ae);for(;q=fe[m?"prev":"next"]();){if(n.getContentEditableParent(q)==="false"||FP(q,w))return he.none();if(_n(q)&&q.data.length>0)return TO(q,w,"A")?he.none():he.some(Vt(q,m?q.data.length:0));if(n.isBlock(q)||x[q.nodeName.toLowerCase()])return he.none();B=q}return uh(B)?he.none():c&&B?he.some(Vt(B,0)):he.none()},hS=(n,i,c,m)=>{const p=n.getRoot();let w,x=!1,M=c?m.startContainer:m.endContainer,B=c?m.startOffset:m.endOffset;const q=Jn(M)&&B===M.childNodes.length,ae=n.schema.getNonEmptyElements();let fe=c;if(_r(M))return he.none();if(Jn(M)&&B>M.childNodes.length-1&&(fe=!1),of(M)&&(M=p,B=0),M===p){if(fe&&(w=M.childNodes[B>0?B-1:0],w&&(_r(w)||ae[w.nodeName]||Iu(w))))return he.none();if(M.hasChildNodes()){if(B=Math.min(!fe&&B>0?B-1:B,M.childNodes.length-1),M=M.childNodes[B],B=_n(M)&&q?M.data.length:0,!i&&M===p.lastChild&&Iu(M)||QP(p,M)||_r(M))return he.none();if(M.hasChildNodes()&&!Iu(M)){w=M;const be=new _i(M,p);do{if(Es(w)||_r(w)){x=!1;break}if(_n(w)&&w.data.length>0){B=fe?0:w.data.length,M=w,x=!0;break}if(ae[w.nodeName.toLowerCase()]&&!xl(w)){B=n.nodeIndex(w),M=w.parentNode,fe||B++,x=!0;break}}while(w=fe?be.next():be.prev())}}}return i&&(_n(M)&&B===0&&dS(n,q,i,!0,M).each(be=>{M=be.container(),B=be.offset(),x=!0}),Jn(M)&&(w=M.childNodes[B],w||(w=M.childNodes[B-1]),w&&mi(w)&&!mr(w,"A")&&!U0(n,w,!1)&&!U0(n,w,!0)&&dS(n,q,i,!0,w).each(be=>{M=be.container(),B=be.offset(),x=!0}))),fe&&!i&&_n(M)&&B===M.data.length&&dS(n,q,i,!1,M).each(be=>{M=be.container(),B=be.offset(),x=!0}),x&&M?he.some(Vt(M,B)):he.none()},mS=(n,i)=>{const c=i.collapsed,m=i.cloneRange(),p=Vt.fromRangeStart(i);return hS(n,c,!0,m).each(w=>{(!c||!Vt.isAbove(p,w))&&m.setStart(w.container(),w.offset())}),c||hS(n,c,!1,m).each(w=>{m.setEnd(w.container(),w.offset())}),c&&m.collapse(!0),s3(i,m)?he.none():he.some(m)},h1=(n,i)=>n.splitText(i),_p=n=>{let i=n.startContainer,c=n.startOffset,m=n.endContainer,p=n.endOffset;if(i===m&&_n(i)){if(c>0&&c<i.data.length)if(m=h1(i,c),i=m.previousSibling,p>c){p=p-c;const w=h1(m,p).previousSibling;i=m=w,p=w.data.length,c=0}else p=0}else if(_n(i)&&c>0&&c<i.data.length&&(i=h1(i,c),c=0),_n(m)&&p>0&&p<m.data.length){const w=h1(m,p).previousSibling;m=w,p=w.data.length}return{startContainer:i,startOffset:c,endContainer:m,endOffset:p}},O=n=>({walk:(w,x)=>c1(n,w,x),split:_p,expand:(w,x={type:"word"})=>{if(x.type==="word"){const M=z0(n,w,[{inline:"span"}]),B=n.createRng();return B.setStart(M.startContainer,M.startOffset),B.setEnd(M.endContainer,M.endOffset),B}return w},normalize:w=>mS(n,w).fold(je,x=>(w.setStart(x.startContainer,x.startOffset),w.setEnd(x.endContainer,x.endOffset),!0))});O.compareRanges=s3,O.getCaretRangeFromPoint=LP,O.getSelectedNode=lb,O.getNode=ld;const D=((n,i)=>{const c=(M,B)=>{if(!Xe(B)&&!B.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+B);const q=M.dom;ss(q)&&(q.style[n]=B+"px")},m=M=>{const B=i(M);if(B<=0||B===null){const q=Bi(M,n);return parseFloat(q)||0}return B},p=m,w=(M,B)=>zn(B,(q,ae)=>{const fe=Bi(M,ae),be=fe===void 0?0:parseInt(fe,10);return isNaN(be)?q:q+be},0);return{set:c,get:m,getOuter:p,aggregate:w,max:(M,B,q)=>{const ae=w(M,q);return B>ae?B-ae:0}}})("height",n=>{const i=n.dom;return Ed(n)?i.getBoundingClientRect().height:i.offsetHeight}),N=n=>D.get(n),Y=()=>Ke.fromDom(document),se=(n,i)=>n.view(i).fold(Qe([]),m=>{const p=n.owner(m),w=se(n,p);return[m].concat(w)}),pe=(n,i)=>{const c=i.owner(n);return se(i,c)};var rt=Object.freeze({__proto__:null,view:n=>{var i;return(n.dom===document?he.none():he.from((i=n.dom.defaultView)===null||i===void 0?void 0:i.frameElement)).map(Ke.fromDom)},owner:n=>Eo(n)});const _t=n=>{const i=Y(),c=nf(i),m=pe(n,rt),p=Nu(n),w=An(m,(x,M)=>{const B=Nu(M);return{left:x.left+B.left,top:x.top+B.top}},{left:0,top:0});return jg(w.left+p.left+c.left,w.top+p.top+c.top)},dn=n=>ti(n)==="textarea",Xn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Wn=(n,i)=>{n.dispatch("AfterScrollIntoView",i)},sn=(n,i)=>{const c=Da(n);if(c.length===0||dn(n))return{element:n,offset:i};if(i<c.length&&!dn(c[i]))return{element:c[i],offset:0};{const m=c[c.length-1];return dn(m)?{element:n,offset:i}:ti(m)==="img"?{element:m,offset:1}:sl(m)?{element:m,offset:Wc(m).length}:{element:m,offset:Da(m).length}}},Un=(n,i)=>{const c=xy(n),m=N(n);return{element:n,bottom:c.top+m,height:m,pos:c,cleanup:i}},tn=(n,i)=>{const c=sn(n,i),m=Ke.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+Ft+"</span>");return Ca(c.element,m),Un(m,()=>wr(m))},Oo=n=>Un(Ke.fromDom(n),ot),cs=(n,i,c,m)=>{wl(n,(p,w)=>da(n,i,c,m),c)},Ds=(n,i,c,m,p)=>{const w={elm:m.element.dom,alignToTop:p};if(Xn(n,w))return;const x=nf(i).top;c(n,i,x,m,p),Wn(n,w)},da=(n,i,c,m)=>{const p=Ke.fromDom(n.getBody()),w=Ke.fromDom(n.getDoc());Wi(p);const x=tn(Ke.fromDom(c.startContainer),c.startOffset);Ds(n,w,i,x,m),x.cleanup()},Rl=(n,i,c,m)=>{const p=Ke.fromDom(n.getDoc());Ds(n,p,c,Oo(i),m)},wl=(n,i,c)=>{const m=c.startContainer,p=c.startOffset,w=c.endContainer,x=c.endOffset;i(Ke.fromDom(m),Ke.fromDom(w));const M=n.dom.createRng();M.setStart(m,p),M.setEnd(w,x),n.selection.setRng(c)},Vu=(n,i,c,m,p)=>{const w=i.pos;if(m)n0(w.left,w.top,p);else{const x=w.top-c+i.height;n0(-n.getBody().getBoundingClientRect().left,x,p)}},Y0=(n,i,c,m,p,w)=>{const x=m+c,M=p.pos.top,B=p.bottom,q=B-M>=m;M<c?Vu(n,p,m,w!==!1,i):M>x?Vu(n,p,m,q?w!==!1:w===!0,i):B>x&&!q&&Vu(n,p,m,w===!0,i)},H2=(n,i,c,m,p)=>{const w=Xr(i).dom.innerHeight;Y0(n,i,c,w,m,p)},gS=(n,i,c,m,p)=>{const w=Xr(i).dom.innerHeight;Y0(n,i,c,w,m,p);const x=_t(m.element),M=nd(window);x.top<M.y?o0(m.element,p!==!1):x.top>M.bottom&&o0(m.element,p===!0)},pS=(n,i,c)=>cs(n,H2,i,c),xi=(n,i,c)=>Rl(n,i,H2,c),Wu=(n,i,c)=>cs(n,gS,i,c),vf=(n,i,c)=>Rl(n,i,gS,c),Sm=(n,i,c)=>{(n.inline?xi:vf)(n,i,c)},Of=(n,i,c)=>{(n.inline?pS:Wu)(n,i,c)},X0=n=>n.dom.focus(),Uu=n=>{const i=ql(n).dom;return n.dom===i.activeElement},z2=(n=Y())=>he.from(n.dom.activeElement).map(Ke.fromDom),V2=n=>z2(ql(n)).filter(i=>n.dom.contains(i.dom)),wg=(n,i)=>{const c=sl(i)?Wc(i).length:Da(i).length+1;return n>c?c:n<0?0:n},vc=n=>d1.range(n.start,wg(n.soffset,n.start),n.finish,wg(n.foffset,n.finish)),mx=(n,i)=>!Dd(i.dom)&&(cn(n,i)||vt(n,i)),r3=n=>i=>mx(n,i.start)&&mx(n,i.finish),i3=n=>n.inline||qn.browser.isFirefox(),a3=n=>d1.range(Ke.fromDom(n.startContainer),n.startOffset,Ke.fromDom(n.endContainer),n.endOffset),ZP=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?he.none():he.from(i.getRangeAt(0))).map(a3)},gx=n=>{const i=Xr(n);return ZP(i.dom).filter(r3(n))},HP=(n,i)=>he.from(i).filter(r3(n)).map(vc),W2=n=>{const i=document.createRange();try{return i.setStart(n.start.dom,n.soffset),i.setEnd(n.finish.dom,n.foffset),he.some(i)}catch{return he.none()}},zP=n=>{const i=i3(n)?gx(Ke.fromDom(n.getBody())):he.none();n.bookmark=i.isSome()?i:n.bookmark},l3=n=>(n.bookmark?n.bookmark:he.none()).bind(c=>HP(Ke.fromDom(n.getBody()),c)).bind(W2),_I=n=>{l3(n).each(i=>n.selection.setRng(i))},SI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},xV=(n,i)=>(Xe(i)||(i=0),setTimeout(n,i)),WP=(n,i)=>(Xe(i)||(i=0),setInterval(n,i)),_g={setEditorTimeout:(n,i,c)=>xV(()=>{n.removed||i()},c),setEditorInterval:(n,i,c)=>{const m=WP(()=>{n.removed?clearInterval(m):i()},c);return m}},CI=n=>n.type==="nodechange"&&n.selectionChange,kI=(n,i)=>{const c=()=>{i.throttle()};Qr.DOM.bind(document,"mouseup",c),n.on("remove",()=>{Qr.DOM.unbind(document,"mouseup",c)})},xI=(n,i)=>{n.on("mouseup touchend",c=>{i.throttle()})},TV=(n,i)=>{xI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",c=>{CI(c)||zP(n)})},EV=n=>{const i=_0(()=>{zP(n)},0);n.on("init",()=>{n.inline&&kI(n,i),TV(n,i)}),n.on("remove",()=>{i.cancel()})};let bS;const UP=Qr.DOM,c3=n=>Jn(n)&&SI.isEditorUIElement(n),u3=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},px=(n,i)=>{const c=P_(n);return UP.getParent(i,p=>c3(p)||(c?n.dom.is(p,c):!1))!==null},f3=n=>{try{const i=ql(Ke.fromDom(n.getElement()));return z2(i).fold(()=>document.body,c=>c.dom)}catch{return document.body}},TI=(n,i)=>{const c=i.editor;EV(c);const m=(p,w)=>{if(z_(p)&&p.inline!==!0){const x=Ke.fromDom(p.getContainer());w(x,"tox-edit-focus")}};c.on("focusin",()=>{const p=n.focusedEditor;u3(f3(c))&&m(c,ef),p!==c&&(p&&p.dispatch("blur",{focusedEditor:c}),n.setActive(c),n.focusedEditor=c,c.dispatch("focus",{blurredEditor:p}),c.focus(!0))}),c.on("focusout",()=>{_g.setEditorTimeout(c,()=>{const p=n.focusedEditor;(!u3(f3(c))||p!==c)&&m(c,zc),!px(c,f3(c))&&p===c&&(c.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),bS||(bS=p=>{const w=n.activeEditor;w&&tm(p).each(x=>{const M=x;M.ownerDocument===document&&M!==document.body&&!px(w,M)&&n.focusedEditor===w&&(w.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},UP.bind(document,"focusin",bS))},AV=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&bS&&(UP.unbind(document,"focusin",bS),bS=null)},DV=n=>{n.on("AddEditor",He(TI,n)),n.on("RemoveEditor",He(AV,n))},PV=(n,i)=>n.dom.getParent(i,c=>n.dom.getContentEditable(c)==="true"),MV=n=>n.collapsed?he.from(ld(n.startContainer,n.startOffset)).map(Ke.fromDom):he.none(),RV=(n,i)=>MV(i).bind(c=>qa(c)?he.some(c):cn(n,c)?he.none():he.some(n)),EI=(n,i)=>{RV(Ke.fromDom(n.getBody()),i).bind(c=>cl(c.dom)).fold(()=>{n.selection.normalize()},c=>n.selection.setRng(c.toRange()))},YP=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},$V=n=>Uu(n)||V2(n).isSome(),NV=n=>Oe(n.iframeElement)&&Uu(Ke.fromDom(n.iframeElement)),IV=n=>{const i=n.getBody();return i&&$V(Ke.fromDom(i))},BV=n=>{const i=ql(Ke.fromDom(n.getElement()));return z2(i).filter(c=>!u3(c.dom)&&px(n,c.dom)).isSome()},U2=n=>n.inline?IV(n):NV(n),d3=n=>U2(n)||BV(n),AI=n=>{const i=n.selection,c=n.getBody();let m=i.getRng();n.quirks.refreshContentEditable(),Oe(n.bookmark)&&!U2(n)&&l3(n).each(w=>{n.selection.setRng(w),m=w});const p=PV(n,i.getNode());if(p&&n.dom.isChildOf(p,c)){YP(p),EI(n,m),h3(n);return}n.inline||(qn.browser.isOpera()||YP(c),n.getWin().focus()),(qn.browser.isFirefox()||n.inline)&&(YP(c),EI(n,m)),h3(n)},h3=n=>n.editorManager.setActive(n),LV=(n,i)=>{n.removed||(i?h3(n):AI(n))},DI=(n,i,c,m,p)=>{const w=c?i.startContainer:i.endContainer,x=c?i.startOffset:i.endOffset;return he.from(w).map(Ke.fromDom).map(M=>!m||!i.collapsed?tf(M,p(M,x)).getOr(M):M).bind(M=>kl(M)?he.some(M):fi(M).filter(kl)).map(M=>M.dom).getOr(n)},PI=(n,i,c=!1)=>DI(n,i,!0,c,(m,p)=>Math.min(dc(m),p)),MI=(n,i,c=!1)=>DI(n,i,!1,c,(m,p)=>p>0?p-1:p),RI=(n,i)=>{const c=n;for(;n&&_n(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||c},FV=(n,i)=>{if(!i)return n;let c=i.startContainer,m=i.endContainer;const p=i.startOffset,w=i.endOffset;let x=i.commonAncestorContainer;i.collapsed||(c===m&&w-p<2&&c.hasChildNodes()&&(x=c.childNodes[p]),_n(c)&&_n(m)&&(c.length===p?c=RI(c.nextSibling,!0):c=c.parentNode,w===0?m=RI(m.previousSibling,!1):m=m.parentNode,c&&c===m&&(x=c)));const M=_n(x)?x.parentNode:x;return Jn(M)?M:n},$I=(n,i,c,m)=>{const p=[],w=n.getRoot(),x=n.getParent(c||PI(w,i,i.collapsed),n.isBlock),M=n.getParent(m||MI(w,i,i.collapsed),n.isBlock);if(x&&x!==w&&p.push(x),x&&M&&x!==M){let B;const q=new _i(x,w);for(;(B=q.next())&&B!==M;)n.isBlock(B)&&p.push(B)}return M&&x!==M&&M!==w&&p.push(M),p},QV=(n,i,c)=>he.from(i).bind(m=>he.from(m.parentNode).map(p=>{const w=n.nodeIndex(m),x=n.createRng();return x.setStart(p,w),x.setEnd(p,w+1),c&&(Xk(n,x,m,!0),Xk(n,x,m,!1)),x})),m3=(n,i)=>pt(i,c=>{const m=n.dispatch("GetSelectionRange",{range:c});return m.range!==c?m.range:c}),NI=n=>ti(n)==="img"?1:od(n).fold(()=>Da(n).length,i=>i.length),ZV=n=>od(n).filter(i=>i.trim().length!==0||i.indexOf(Kr)>-1).isSome(),HV=n=>Mi(n)&&Fl(n,"contenteditable")==="false",zV=["img","br"],II=n=>ZV(n)||kt(zV,ti(n))||HV(n),VV=n=>ue(n,II),WV=n=>UV(n,II),UV=(n,i)=>{const c=m=>{const p=Da(m);for(let w=p.length-1;w>=0;w--){const x=p[w];if(i(x))return he.some(x);const M=c(x);if(M.isSome())return M}return he.none()};return c(n)},BI="[data-mce-autocompleter]",YV=(n,i)=>{if(LI(Ke.fromDom(n.getBody())).isNone()){const c=Ke.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',n.getDoc());na(c,Ke.fromDom(i.extractContents())),i.insertNode(c.dom),fi(c).each(m=>m.dom.normalize()),WV(c).map(m=>{n.selection.setCursorLocation(m.dom,NI(m))})}},XV=n=>at(n,BI),LI=n=>Je(n,BI),jV=(n,i)=>LI(i).each(c=>{const m=n.selection.getBookmark();Kl(c),n.selection.moveToBookmark(m)}),qV={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},g3=(n,i,c)=>{const m=c?"lastChild":"firstChild",p=c?"prev":"next";if(n[m])return n[m];if(n!==i){let w=n[p];if(w)return w;for(let x=n.parent;x&&x!==i;x=x.parent)if(w=x[p],w)return w}},GV=n=>{var i;const c=(i=n.value)!==null&&i!==void 0?i:"";if(!eg(c))return!1;const m=n.parent;return!(m&&(m.name!=="span"||m.attr("style"))&&/^[ ]+$/.test(c))},FI=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 Xd{static create(i,c){const m=new Xd(i,qV[i]||1);return c&&ln(c,(p,w)=>{m.attr(w,p)}),m}constructor(i,c){this.name=i,this.type=c,c===1&&(this.attributes=[],this.attributes.map={})}replace(i){const c=this;return i.parent&&i.remove(),c.insert(i,c),c.remove(),c}attr(i,c){const m=this;if(!L(i))return Oe(i)&&ln(i,(w,x)=>{m.attr(x,w)}),m;const p=m.attributes;if(p){if(c!==void 0){if(c===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),m}return m}if(i in p.map){let w=p.length;for(;w--;)if(p[w].name===i){p[w].value=c;break}}else p.push({name:i,value:c});return p.map[i]=c,m}return p.map[i]}}clone(){const i=this,c=new Xd(i.name,i.type),m=i.attributes;if(m){const p=[];p.map={};for(let w=0,x=m.length;w<x;w++){const M=m[w];M.name!=="id"&&(p[p.length]={name:M.name,value:M.value},p.map[M.name]=M.value)}c.attributes=p}return c.value=i.value,c}wrap(i){const c=this;return c.parent&&(c.parent.insert(i,c),i.append(c)),c}unwrap(){const i=this;for(let c=i.firstChild;c;){const m=c.next;i.insert(c,i,!0),c=m}i.remove()}remove(){const i=this,c=i.parent,m=i.next,p=i.prev;return c&&(c.firstChild===i?(c.firstChild=m,m&&(m.prev=null)):p&&(p.next=m),c.lastChild===i?(c.lastChild=p,p&&(p.next=null)):m&&(m.prev=p),i.parent=i.next=i.prev=null),i}append(i){const c=this;i.parent&&i.remove();const m=c.lastChild;return m?(m.next=i,i.prev=m,c.lastChild=i):c.lastChild=c.firstChild=i,i.parent=c,i}insert(i,c,m){i.parent&&i.remove();const p=c.parent||this;return m?(c===p.firstChild?p.firstChild=i:c.prev&&(c.prev.next=i),i.prev=c.prev,i.next=c,c.prev=i):(c===p.lastChild?p.lastChild=i:c.next&&(c.next.prev=i),i.next=c.next,i.prev=c,c.next=i),i.parent=p,i}getAll(i){const c=this,m=[];for(let p=c.firstChild;p;p=g3(p,c))p.name===i&&m.push(p);return m}children(){const i=this,c=[];for(let m=i.firstChild;m;m=m.next)c.push(m);return c}empty(){const i=this;if(i.firstChild){const c=[];for(let p=i.firstChild;p;p=g3(p,i))c.push(p);let m=c.length;for(;m--;){const p=c[m];p.parent=p.firstChild=p.lastChild=p.next=p.prev=null}}return i.firstChild=i.lastChild=null,i}isEmpty(i,c={},m){var p;const w=this;let x=w.firstChild;if(FI(w))return!1;if(x)do{if(x.type===1){if(x.attr("data-mce-bogus"))continue;if(i[x.name]||FI(x))return!1}if(x.type===8||x.type===3&&!GV(x)||x.type===3&&x.parent&&c[x.parent.name]&&eg((p=x.value)!==null&&p!==void 0?p:"")||m&&m(x))return!1}while(x=g3(x,w));return!0}walk(i){return g3(this,null,i)}}const KV=(n,i)=>/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(n.substr(i)),QI=(n,i,c=0)=>{const m=n.toLowerCase();if(m.indexOf("[if ",c)!==-1&&KV(m,c)){const p=m.indexOf("[endif]",c);return m.indexOf(">",p)}else if(i){const p=m.indexOf(">",c);return p!==-1?p:m.length}else{const p=/--!?>/g;p.lastIndex=c;const w=p.exec(n);return w?w.index+w[0].length:m.length}},No=(n,i,c)=>{const m=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,w=n.getVoidElements();let x=1,M=c;for(;x!==0;)for(m.lastIndex=M;;){const B=m.exec(i);if(B===null)return M;if(B[1]==="!"){Ar(B[2],"--")?M=QI(i,!1,B.index+3):M=QI(i,!0,B.index+1);break}else{p.lastIndex=m.lastIndex;const q=p.exec(i);if(G(q)||q.index!==m.lastIndex)continue;B[1]==="/"?x-=1:fn(w,B[2])||(x+=1),M=m.lastIndex+q[0].length;break}}return M},ZI=(n,i)=>{const c=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(c,"")},XP=(n,i)=>{const c=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,m=n.schema;let p=ZI(n.getTempAttrs(),i);const w=m.getVoidElements();let x;for(;x=c.exec(p);){const M=c.lastIndex,B=x[0].length;let q;w[x[1]]?q=M:q=No(m,p,M),p=p.substring(0,M-B)+p.substring(q),c.lastIndex=M-B}return In(p)},JV=XP,p3=n=>{const i=pl(n,"[data-mce-bogus]");Ne(i,c=>{Fl(c,"data-mce-bogus")==="all"?wr(c):au(c)?(Ca(c,Ke.fromText(nn)),wr(c)):Kl(c)})},HI=n=>{const i=pl(n,"input");Ne(i,c=>{Vi(c,"name")})},eW=(n,i)=>{const c=jc(n),m=new RegExp(`^(<${c}[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/${c}>[\r
|
|
]*|<br \\/>[\r
|
|
]*)$`);return i.replace(m,"")},tW=(n,i)=>{const c=n.getDoc(),m=ql(Ke.fromDom(n.getBody())),p=Ke.fromTag("div",c);Pr(p,"data-mce-bogus","all"),ua(p,{position:"fixed",left:"-9999999px",top:"0"}),Mf(p,i.innerHTML),p3(p),HI(p);const w=X1(m);na(w,p);const x=In(p.dom.innerText);return wr(p),x},nW=(n,i,c)=>{let m;return i.format==="raw"?m=gn.trim(JV(n.serializer,c.innerHTML)):i.format==="text"?m=tW(n,c):i.format==="tree"?m=n.serializer.serialize(c,i):m=eW(n,n.serializer.serialize(c,i)),i.format!=="text"&&!lu(Ke.fromDom(c))&&L(m)?gn.trim(m):m},oW=(n,i)=>he.from(n.getBody()).fold(Qe(i.format==="tree"?new Xd("body",11):""),c=>nW(n,i,c)),bx=gn.makeMap,jP=n=>{const i=[];n=n||{};const c=n.indent,m=bx(n.indent_before||""),p=bx(n.indent_after||""),w=sp.getEncodeFunc(n.entity_encoding||"raw",n.entities),x=n.element_format!=="xhtml";return{start:(M,B,q)=>{if(c&&m[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==`
|
|
`&&i.push(`
|
|
`)}if(i.push("<",M),B)for(let ae=0,fe=B.length;ae<fe;ae++){const be=B[ae];i.push(" ",be.name,'="',w(be.value,!0),'"')}if(!q||x?i[i.length]=">":i[i.length]=" />",q&&c&&p[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==`
|
|
`&&i.push(`
|
|
`)}},end:M=>{let B;i.push("</",M,">"),c&&p[M]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==`
|
|
`&&i.push(`
|
|
`))},text:(M,B)=>{M.length>0&&(i[i.length]=B?M:w(M))},cdata:M=>{i.push("<![CDATA[",M,"]]>")},comment:M=>{i.push("<!--",M,"-->")},pi:(M,B)=>{B?i.push("<?",M," ",w(B),"?>"):i.push("<?",M,"?>"),c&&i.push(`
|
|
`)},doctype:M=>{i.push("<!DOCTYPE",M,">",c?`
|
|
`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Y2=(n={},i=wh())=>{const c=jP(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,x={3:B=>{var q;c.text((q=B.value)!==null&&q!==void 0?q:"",B.raw)},8:B=>{var q;c.comment((q=B.value)!==null&&q!==void 0?q:"")},7:B=>{c.pi(B.name,B.value)},10:B=>{var q;c.doctype((q=B.value)!==null&&q!==void 0?q:"")},4:B=>{var q;c.cdata((q=B.value)!==null&&q!==void 0?q:"")},11:B=>{let q=B;if(q=q.firstChild)do M(q);while(q=q.next)}};c.reset();const M=B=>{var q;const ae=x[B.type];if(ae)ae(B);else{const fe=B.name,be=fe in i.getVoidElements();let Le=B.attributes;if(w&&Le&&Le.length>1){const Ye=[];Ye.map={};const Me=i.getElementRule(B.name);if(Me){for(let Ve=0,gt=Me.attributesOrder.length;Ve<gt;Ve++){const Ot=Me.attributesOrder[Ve];if(Ot in Le.map){const wt=Le.map[Ot];Ye.map[Ot]=wt,Ye.push({name:Ot,value:wt})}}for(let Ve=0,gt=Le.length;Ve<gt;Ve++){const Ot=Le[Ve].name;if(!(Ot in Ye.map)){const wt=Le.map[Ot];Ye.map[Ot]=wt,Ye.push({name:Ot,value:wt})}}Le=Ye}}if(c.start(fe,Le,be),!be){let Ye=B.firstChild;if(Ye){(fe==="pre"||fe==="textarea")&&Ye.type===3&&((q=Ye.value)===null||q===void 0?void 0:q[0])===`
|
|
`&&c.text(`
|
|
`,!0);do M(Ye);while(Ye=Ye.next)}c.end(fe)}}};return p.type===1&&!n.inner?M(p):p.type===3?x[3](p):x[11](p),c.getContent()}}},zI=new Set;Ne(["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=>{zI.add(i)});const gs=["font","text-decoration","text-emphasis"],qP=(n,i)=>bs(n.parseStyle(n.getAttrib(i,"style"))),xs=n=>zI.has(n),VI=(n,i)=>tr(qP(n,i),c=>!xs(c)),yie=n=>At(n,i=>jt(gs,c=>Ar(i,c))),wie=(n,i,c)=>{const m=qP(n,i),p=qP(n,c),w=x=>{var M,B;const q=(M=n.getStyle(i,x))!==null&&M!==void 0?M:"",ae=(B=n.getStyle(c,x))!==null&&B!==void 0?B:"";return yr(q)&&yr(ae)&&q!==ae};return jt(m,x=>{const M=B=>jt(B,q=>q===x);if(!M(p)&&M(gs)){const B=yie(p);return jt(B,w)}else return w(x)})},WI=(n,i,c)=>he.from(c.container()).filter(_n).exists(m=>{const p=n?0:-1;return i(m.data.charAt(c.offset()+p))}),UI=He(WI,!0,Dh),YI=He(WI,!1,Dh),sW=n=>{const i=n.container();return _n(i)&&(i.data.length===0||Sn(i.data)&&_O.isBookmarkNode(i.parentNode))},EO=(n,i)=>c=>wb(n?0:-1,c).filter(i).isSome(),ns=n=>Ui(n)&&Bi(Ke.fromDom(n),"display")==="block",XI=n=>Es(n)&&!bl(n),rW=EO(!0,ns),iW=EO(!1,ns),j0=EO(!0,sf),vS=EO(!1,sf),jI=EO(!0,Iu),qI=EO(!1,Iu),AO=EO(!0,XI),q0=EO(!1,XI),aW=n=>n.slice(0,-1),_ie=(n,i,c)=>cn(i,n)?aW(oh(n,m=>c(m)||vt(m,i))):[],lW=(n,i)=>_ie(n,i,je),G0=(n,i)=>[n].concat(lW(n,i)),GP=(n,i,c)=>Nk(n,i,c,sW),GI=(n,i)=>oo(G0(Ke.fromDom(i.container()),n),hc),KI=(n,i,c)=>GP(n,i.dom,c).forall(m=>GI(i,c).fold(()=>!Hd(m,c,i.dom),p=>!Hd(m,c,i.dom)&&cn(p,Ke.fromDom(m.container())))),KP=(n,i,c)=>GI(i,c).fold(()=>GP(n,i.dom,c).forall(m=>!Hd(m,c,i.dom)),m=>GP(n,m.dom,c).isNone()),JP=He(KP,!1),Ms=He(KP,!0),JI=He(KI,!1),b3=He(KI,!0),eB=n=>We(n).exists(au),vx=(n,i,c)=>{const m=At(G0(Ke.fromDom(c.container()),i),hc),p=$o(m).getOr(i);return zd(n,p.dom,c).filter(eB)},v3=(n,i)=>We(i).exists(au)||vx(!0,n,i).isSome(),O3=(n,i)=>ht(i).exists(au)||vx(!1,n,i).isSome(),tB=He(vx,!1),cW=He(vx,!0),e5=n=>Vt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),nB=(n,i)=>{const c=At(G0(Ke.fromDom(i.container()),n),hc);return $o(c).getOr(n)},oB=(n,i)=>e5(i)?YI(i):YI(i)||Hu(nB(n,i).dom,i).exists(YI),sB=(n,i)=>e5(i)?UI(i):UI(i)||Hf(nB(n,i).dom,i).exists(UI),uW=n=>kt(["pre","pre-wrap"],n),t5=n=>We(n).bind(i=>Zl(i,kl)).exists(i=>uW(Bi(i,"white-space"))),fW=(n,i)=>Hu(n.dom,i).isNone(),dW=(n,i)=>Hf(n.dom,i).isNone(),hW=(n,i)=>fW(n,i)||dW(n,i)||JP(n,i)||Ms(n,i)||O3(n,i)||v3(n,i),n5=n=>Oe(n)&&Es(n)&&Y_(n),y3=(n,i)=>c=>n5(new _i(c,n)[i]()),mW=(n,i)=>{const c=Hf(n.dom,i).getOr(i),m=y3(n.dom,"next");return i.isAtEnd()&&(m(i.container())||m(c.container()))},gW=(n,i)=>{const c=Hu(n.dom,i).getOr(i),m=y3(n.dom,"prev");return i.isAtStart()&&(m(i.container())||m(c.container()))},rB=(n,i)=>t5(i)?!1:hW(n,i)||oB(n,i)||sB(n,i),Ox=(n,i)=>t5(i)?!1:JP(n,i)||JI(n,i)||O3(n,i)||oB(n,i)||gW(n,i),pW=n=>{const i=n.container(),c=n.offset();return _n(i)&&c<i.data.length?Vt(i,c+1):n},yx=(n,i)=>t5(i)?!1:Ms(n,i)||b3(n,i)||v3(n,i)||sB(n,i)||mW(n,i),o5=(n,i)=>Ox(n,i)||yx(n,pW(i)),iB=(n,i)=>Gs(n.charAt(i)),s5=(n,i)=>Dh(n.charAt(i)),bW=n=>{const i=n.container();return _n(i)&&nr(i.data,Kr)},vW=n=>{const i=n.split("");return pt(i,(c,m)=>Gs(c)&&m>0&&m<i.length-1&&kb(i[m-1])&&kb(i[m+1])?" ":c).join("")},DO=(n,i,c)=>{const m=i.data,p=Vt(i,0);return!c&&iB(m,0)&&!o5(n,p)?(i.data=" "+m.slice(1),!0):c&&s5(m,0)&&Ox(n,p)?(i.data=Kr+m.slice(1),!0):!1},OW=n=>{const i=n.data,c=vW(i);return c!==i?(n.data=c,!0):!1},r5=(n,i,c)=>{const m=i.data,p=Vt(i,m.length-1);return!c&&iB(m,m.length-1)&&!o5(n,p)?(i.data=m.slice(0,-1)+" ",!0):c&&s5(m,m.length-1)&&yx(n,p)?(i.data=m.slice(0,-1)+Kr,!0):!1},yW=(n,i)=>{const c=i.container();if(!_n(c))return he.none();if(bW(i)){const m=DO(n,c,!1)||OW(c)||r5(n,c,!1);return ks(m,i)}else if(o5(n,i)){const m=DO(n,c,!0)||r5(n,c,!0);return ks(m,i)}else return he.none()},wW=n=>{const i=Ke.fromDom(n.getBody());n.selection.isCollapsed()&&yW(i,Vt.fromRangeStart(n.selection.getRng())).each(c=>{n.selection.setRng(c.toRange())})},i5=(n,i,c)=>{if(c===0)return;const m=Ke.fromDom(n),p=di(m,hc).getOr(m),w=n.data.slice(i,i+c),x=i+c>=n.data.length&&yx(p,Vt(n,n.data.length)),M=i===0&&Ox(p,Vt(n,0));n.replaceData(i,c,mh(w,4,M,x))},wx=(n,i)=>{const c=n.data.slice(i),m=c.length-nu(c).length;i5(n,i,m)},w3=(n,i)=>{const c=n.data.slice(0,i),m=c.length-xu(c).length;i5(n,i-m,m)},_3=(n,i,c,m=!0)=>{const p=xu(n.data).length,w=m?n:i,x=m?i:n;return m?w.appendData(x.data):w.insertData(0,x.data),wr(Ke.fromDom(x)),c&&wx(w,p),w},md=(n,i)=>{const c=n.container(),m=n.offset();return!Vt.isTextPosition(n)&&c===i.parentNode&&m>Vt.before(i).offset()},_W=(n,i)=>md(i,n)?Vt(i.container(),i.offset()-1):i,SW=n=>_n(n)?Vt(n,0):Vt.before(n),CW=n=>_n(n)?Vt(n,n.data.length):Vt.after(n),aB=n=>Tl(n.previousSibling)?he.some(CW(n.previousSibling)):n.previousSibling?Vd(n.previousSibling):he.none(),lB=n=>Tl(n.nextSibling)?he.some(SW(n.nextSibling)):n.nextSibling?cl(n.nextSibling):he.none(),X2=(n,i)=>he.from(i.previousSibling?i.previousSibling:i.parentNode).bind(c=>Hu(n,Vt.before(c))).orThunk(()=>Hf(n,Vt.after(i))),kW=(n,i)=>Hf(n,Vt.after(i)).orThunk(()=>Hu(n,Vt.before(i))),xW=(n,i)=>aB(i).orThunk(()=>lB(i)).orThunk(()=>X2(n,i)),Ba=(n,i)=>lB(i).orThunk(()=>aB(i)).orThunk(()=>kW(n,i)),S3=(n,i,c)=>n?Ba(i,c):xW(i,c),Sie=(n,i,c)=>S3(n,i,c).map(He(_W,c)),Jc=(n,i,c)=>{c.fold(()=>{n.focus()},m=>{n.selection.setRng(m.toRange(),i)})},oi=n=>i=>i.dom===n,Cm=(n,i)=>i&&fn(n.schema.getBlockElements(),ti(i)),TW=n=>{if($a(n)){const i=Ke.fromHtml('<br data-mce-bogus="1">');return Ad(n),na(n,i),he.some(Vt.before(i.dom))}else return he.none()},cB=(n,i,c)=>{const m=Sa(n).filter(sl),p=Td(n).filter(sl);return wr(n),Ef(m,p,i,(w,x,M)=>{const B=w.dom,q=x.dom,ae=B.data.length;return _3(B,q,c),M.container()===q?Vt(B,ae):M}).orThunk(()=>(c&&(m.each(w=>w3(w.dom,w.dom.length)),p.each(w=>wx(w.dom,0))),i))},a5=(n,i)=>fn(n.schema.getTextInlineElements(),ti(i)),K0=(n,i,c,m=!0)=>{const p=Sie(i,n.getBody(),c.dom),w=di(c,He(Cm,n),oi(n.getBody())),x=cB(c,p,a5(n,c));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):w.bind(TW).fold(()=>{m&&Jc(n,i,x)},M=>{m&&Jc(n,i,he.some(M))})},uB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,fB=n=>uB.test(n),j2=(n,i)=>Pu(Ke.fromDom(i),Xi(n))&&!ig(n.schema,i)&&n.dom.isEditable(i),dB=n=>{var i;return Qr.DOM.getStyle(n,"direction",!0)==="rtl"||fB((i=n.textContent)!==null&&i!==void 0?i:"")},l5=(n,i,c)=>At(Qr.DOM.getParents(c.container(),"*",i),n),J0=(n,i,c)=>{const m=l5(n,i,c);return he.from(m[m.length-1])},Sp=(n,i,c)=>{const m=pm(i,n),p=pm(c,n);return Oe(m)&&m===p},EW=n=>rf(n)||Nf(n),Sg=(n,i)=>{const c=i.container(),m=i.offset();return n?sr(c)?_n(c.nextSibling)?Vt(c.nextSibling,0):Vt.after(c):rf(i)?Vt(c,m+1):i:sr(c)?_n(c.previousSibling)?Vt(c.previousSibling,c.previousSibling.data.length):Vt.before(c):Nf(i)?Vt(c,m-1):i},AW=He(Sg,!0),C3=He(Sg,!1),hB=(n,i)=>{const c=m=>m.stopImmediatePropagation();n.on("beforeinput input",c,!0),n.getDoc().execCommand(i),n.off("beforeinput input",c)},_x=n=>{n.execCommand("delete")},c5=n=>hB(n,"Delete"),OS=n=>hB(n,"ForwardDelete"),Cg=n=>i=>Gr(fi(i),n,vt),Sx=n=>mc(n)||ja(n),Ti=(n,i)=>cn(n,i)?Zl(i,Sx,Cg(n)):he.none(),q2=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},u5=(n,i,c)=>ri(cl(c),Vd(c),(m,p)=>{const w=Sg(!0,m),x=Sg(!1,p),M=Sg(!1,i);return n?Hf(c,M).exists(B=>B.isEqual(x)&&i.isEqual(w)):Hu(c,M).exists(B=>B.isEqual(w)&&i.isEqual(x))}).getOr(!0),f5=n=>(Kb(n)?Sa(n):Mu(n)).bind(f5).orThunk(()=>he.some(n)),k3=(n,i,c,m=!0)=>{var p;i.deleteContents();const w=f5(c).getOr(c),x=Ke.fromDom((p=n.dom.getParent(w.dom,n.dom.isBlock))!==null&&p!==void 0?p:c.dom);if(x.dom===n.getBody()?q2(n,m):$a(x)&&(Pe(x),m&&n.selection.setCursorLocation(x.dom,0)),!vt(c,x)){const M=Gr(fi(x),c)?[]:Jb(x);Ne(M.concat(Da(c)),B=>{!vt(B,x)&&!cn(B,x)&&$a(B)&&wr(B)})}},d5=n=>i=>vt(n,i),Cx=n=>pl(n,"td,th"),h5=(n,i)=>{const c=q=>vp(Ke.fromDom(q),i),m=c(n.startContainer),p=c(n.endContainer),w=m.isSome(),x=p.isSome(),M=ri(m,p,vt).getOr(!1);return{startTable:m,endTable:p,isStartInTable:w,isEndInTable:x,isSameTable:M,isMultiTable:!M&&w&&x}},yS=(n,i)=>({start:n,end:i}),m5=(n,i,c)=>({rng:n,table:i,cells:c}),wS=pg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),kx=(n,i)=>at(Ke.fromDom(n),"td,th",i),g5=n=>!vt(n.start,n.end),p5=(n,i)=>vp(n.start,i).bind(c=>vp(n.end,i).bind(m=>ks(vt(c,m),c))),mB=(n,i)=>!g5(n)&&p5(n,i).exists(c=>{const m=c.dom.rows;return m.length===1&&m[0].cells.length===1}),_S=(n,i)=>{const c=kx(n.startContainer,i),m=kx(n.endContainer,i);return ri(c,m,yS)},gB=n=>i=>vp(i,n).bind(c=>Po(Cx(c)).map(m=>yS(i,m))),b5=n=>i=>vp(i,n).bind(c=>$o(Cx(c)).map(m=>yS(m,i))),v5=n=>i=>p5(i,n).map(c=>m5(i,c,Cx(c))),pB=(n,i,c,m)=>{if(c.collapsed||!n.forall(g5))return he.none();if(i.isSameTable){const p=n.bind(v5(m));return he.some({start:p,end:p})}else{const p=kx(c.startContainer,m),w=kx(c.endContainer,m),x=p.bind(gB(m)).bind(v5(m)),M=w.bind(b5(m)).bind(v5(m));return he.some({start:x,end:M})}},O5=(n,i)=>Ss(n,c=>vt(c,i)),x3=n=>ri(O5(n.cells,n.rng.start),O5(n.cells,n.rng.end),(i,c)=>n.cells.slice(i,c+1)),bB=(n,i,c)=>n.exists(m=>mB(m,c)&&wO(m.start,i)),xx=(n,i)=>{const{startTable:c,endTable:m}=i,p=n.cloneRange();return c.each(w=>p.setStartAfter(w.dom)),m.each(w=>p.setEndBefore(w.dom)),p},vB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>p.or(w)).bind(p=>{const{isSameTable:w}=i,x=x3(p).getOr([]);if(w&&p.cells.length===x.length)return he.some(wS.fullTable(p.table));if(x.length>0){if(w)return he.some(wS.partialTable(x,he.none()));{const M=xx(c,i);return he.some(wS.partialTable(x,he.some({...i,rng:M})))}}else return he.none()}),OB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>{const x=p.bind(x3).getOr([]),M=w.bind(x3).getOr([]);if(x.length>0&&M.length>0){const B=xx(c,i);return he.some(wS.multiTable(x,M,B))}else return he.none()}),yB=(n,i)=>{const c=d5(n),m=_S(i,c),p=h5(i,c);return bB(m,i,c)?m.map(w=>wS.singleCellTable(i,w.start)):p.isMultiTable?OB(m,p,i,c):vB(m,p,i,c)},y5=n=>Ne(n,i=>{Vi(i,"contenteditable"),Pe(i)}),wB=(n,i)=>he.from(n.dom.getParent(i,n.dom.isBlock)).map(Ke.fromDom),_B=(n,i,c)=>{c.each(m=>{i?wr(m):(Pe(m),n.selection.setCursorLocation(m.dom,0))})},T3=(n,i,c,m)=>{const p=c.cloneRange();m?(p.setStart(c.startContainer,c.startOffset),p.setEndAfter(i.dom.lastChild)):(p.setStartBefore(i.dom.firstChild),p.setEnd(c.endContainer,c.endOffset)),Tx(n,p,i,!1).each(w=>w())},w5=n=>{const i=xb(n),c=Ke.fromDom(n.selection.getNode());Rd(c.dom)&&$a(c)?n.selection.setCursorLocation(c.dom,0):n.selection.collapse(!0),i.length>1&&jt(i,m=>vt(m,c))&&Pr(c,"data-mce-selected","1")},_5=(n,i,c)=>he.some(()=>{const m=n.selection.getRng(),p=c.bind(({rng:w,isStartInTable:x})=>{const M=wB(n,x?w.endContainer:w.startContainer);w.deleteContents(),_B(n,x,M.filter($a));const B=x?i[0]:i[i.length-1];return T3(n,B,m,x),$a(B)?he.none():he.some(x?i.slice(1):i.slice(0,-1))}).getOr(i);y5(p),w5(n)}),SB=(n,i,c,m)=>he.some(()=>{const p=n.selection.getRng(),w=i[0],x=c[c.length-1];T3(n,w,p,!0),T3(n,x,p,!1);const M=$a(w)?i:i.slice(1),B=$a(x)?c:c.slice(0,-1);y5(M.concat(B)),m.deleteContents(),w5(n)}),Tx=(n,i,c,m=!0)=>he.some(()=>{k3(n,i,c,m)}),CB=(n,i)=>he.some(()=>K0(n,!1,i)),kB=(n,i,c)=>yB(i,c).bind(m=>m.fold(He(Tx,n),He(CB,n),He(_5,n),He(SB,n))),xB=(n,i)=>Ex(n,i),TB=(n,i,c,m)=>SS(i,m).fold(()=>kB(n,i,c),p=>xB(n,p)),EB=(n,i,c)=>{const m=Ke.fromDom(n.getBody()),p=n.selection.getRng();return c.length!==0?_5(n,c,he.none()):TB(n,m,p,i)},E3=(n,i)=>oo(G0(i,n),qm),SS=(n,i)=>oo(G0(i,n),Ec("caption")),AB=(n,i,c,m,p)=>Sb(c,n.getBody(),p).bind(w=>E3(i,Ke.fromDom(w.getNode())).bind(x=>vt(x,m)?he.none():he.some(ot))),Ex=(n,i)=>he.some(()=>{Pe(i),n.selection.setCursorLocation(i.dom,0)}),A3=(n,i,c,m)=>cl(n.dom).bind(p=>Vd(n.dom).map(w=>i?c.isEqual(p)&&m.isEqual(w):c.isEqual(w)&&m.isEqual(p))).getOr(!0),S5=(n,i)=>Ex(n,i),Ax=(n,i,c)=>SS(n,Ke.fromDom(c.getNode())).fold(()=>he.some(ot),m=>ks(!vt(m,i),ot)),C5=(n,i,c,m,p)=>Sb(c,n.getBody(),p).fold(()=>he.some(ot),w=>A3(m,c,p,w)?S5(n,m):Ax(i,m,w)),DB=(n,i,c,m)=>{const p=Vt.fromRangeStart(n.selection.getRng());return E3(c,m).bind(w=>$a(w)?Ex(n,w):AB(n,c,i,w,p))},CS=(n,i,c,m)=>{const p=Vt.fromRangeStart(n.selection.getRng());return $a(m)?Ex(n,m):C5(n,c,i,m,p)},D3=(n,i)=>n?jI(i):qI(i),k5=(n,i)=>{const c=Vt.fromRangeStart(n.selection.getRng());return D3(i,c)||zd(i,n.getBody(),c).exists(m=>D3(i,m))},Dx=(n,i,c)=>{const m=Ke.fromDom(n.getBody());return SS(m,c).fold(()=>DB(n,i,m,c).orThunk(()=>ks(k5(n,i),ot)),p=>CS(n,i,m,p))},Eb=(n,i)=>{const c=Ke.fromDom(n.selection.getStart(!0)),m=xb(n);return n.selection.isCollapsed()&&m.length===0?Dx(n,i,c):EB(n,c,m)},PO=(n,i)=>{let c=i;for(;c&&c!==n;){if(ba(c)||Es(c))return c;c=c.parentNode}return null},DW=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],PB=gn.each,P3=n=>{const i=n.dom,c=new Set(n.serializer.getTempAttrs()),m=(w,x)=>{if(w.nodeName!==x.nodeName||w.nodeType!==x.nodeType)return!1;const M=q=>{const ae={};return PB(i.getAttribs(q),fe=>{const be=fe.nodeName.toLowerCase();be!=="style"&&!p(be)&&(ae[be]=i.getAttrib(q,be))}),ae},B=(q,ae)=>{for(const fe in q)if(fn(q,fe)){const be=ae[fe];if(ve(be)||q[fe]!==be)return!1;delete ae[fe]}for(const fe in ae)if(fn(ae,fe))return!1;return!0};return Jn(w)&&Jn(x)&&(!B(M(w),M(x))||!B(i.parseStyle(i.getAttrib(w,"style")),i.parseStyle(i.getAttrib(x,"style"))))?!1:!Wd(w)&&!Wd(x)},p=w=>jt(DW,x=>Ar(w,x))||c.has(w);return{compare:m,isAttributeInternal:p}},PW=(n,i)=>{let c=n;for(;c=c.walk();)i(c)},MW=(n,i,c,m)=>{const p=c.name;for(let w=0,x=n.length;w<x;w++){const M=n[w];if(M.name===p){const B=m.nodes[p];B?B.nodes.push(c):m.nodes[p]={filter:M,nodes:[c]}}}if(c.attributes)for(let w=0,x=i.length;w<x;w++){const M=i[w],B=M.name;if(B in c.attributes.map){const q=m.attributes[B];q?q.nodes.push(c):m.attributes[B]={filter:M,nodes:[c]}}}},RW=(n,i,c)=>{const m={nodes:{},attributes:{}};return c.firstChild&&PW(c,p=>{MW(n,i,p,m)}),m},M3=(n,i)=>{const c=(m,p)=>{ln(m,w=>{const x=Rr(w.nodes);Ne(w.filter.callbacks,M=>{for(let B=x.length-1;B>=0;B--){const q=x[B];(!(p?q.attr(w.filter.name)!==void 0:q.name===w.filter.name)||Re(q.parent))&&x.splice(B,1)}x.length>0&&M(x,w.filter.name,i)})})};c(n.nodes,!1),c(n.attributes,!0)},Cp=(n,i,c,m={})=>{const p=RW(n,i,c);M3(p,m)},Px=(n,i,c,m)=>{if((n.pad_empty_with_br||i.insert)&&c(m)){const w=new Xd("br",1);i.insert&&w.attr("data-mce-bogus","1"),m.empty().append(w)}else m.empty().append(new Xd("#text",3)).value=Kr},R3=n=>{var i;return $3(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Kr},$3=(n,i)=>{const c=n==null?void 0:n.firstChild;return Oe(c)&&c===n.lastChild&&c.name===i},$W=(n,i)=>{const c=n.getElementRule(i.name);return(c==null?void 0:c.paddEmpty)===!0},kS=(n,i,c,m)=>m.isEmpty(i,c,p=>$W(n,p)),NW=(n,i)=>Oe(n)&&(i(n)||n.name==="br"),MB=n=>{let i;for(let c=n;c;c=c.parent){const m=c.attr("contenteditable");if(m==="false")break;m==="true"&&(i=c)}return he.from(i)},Mx=(n,i,c=n.parent)=>{if(i.getSpecialElements()[n.name])n.empty().remove();else{const m=n.children();for(const p of m)c&&!i.isValidChild(c.name,p.name)&&Mx(p,i,c);n.unwrap()}},x5=(n,i,c,m=ot)=>{const p=i.getTextBlockElements(),w=i.getNonEmptyElements(),x=i.getWhitespaceElements(),M=gn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),B=new Set,q=ae=>ae!==c&&!M[ae.name];for(let ae=0;ae<n.length;ae++){const fe=n[ae];let be,Le,Ye;if(!fe.parent||B.has(fe))continue;if(p[fe.name]&&fe.parent.name==="li"){let Ve=fe.next;for(;Ve&&p[Ve.name];){Ve.name="li",B.add(Ve),fe.parent.insert(Ve,fe.parent);Ve=Ve.next}fe.unwrap();continue}const Me=[fe];for(be=fe.parent;be&&!i.isValidChild(be.name,fe.name)&&q(be);be=be.parent)Me.push(be);if(be&&Me.length>1)if(i.isValidChild(be.name,fe.name)){Me.reverse(),Le=Me[0].clone(),m(Le);let Ve=Le;for(let gt=0;gt<Me.length-1;gt++){i.isValidChild(Ve.name,Me[gt].name)&>>0?(Ye=Me[gt].clone(),m(Ye),Ve.append(Ye)):Ye=Ve;for(let Ot=Me[gt].firstChild;Ot&&Ot!==Me[gt+1];){const wt=Ot.next;Ye.append(Ot),Ot=wt}Ve=Ye}kS(i,w,x,Le)?be.insert(fe,Me[0],!0):(be.insert(Le,Me[0],!0),be.insert(fe,Le)),be=Me[0],(kS(i,w,x,be)||$3(be,"br"))&&be.empty().remove()}else Mx(fe,i);else if(fe.parent){if(fe.name==="li"){let Ve=fe.prev;if(Ve&&(Ve.name==="ul"||Ve.name==="ol")){Ve.append(fe);continue}if(Ve=fe.next,Ve&&(Ve.name==="ul"||Ve.name==="ol")&&Ve.firstChild){Ve.insert(fe,Ve.firstChild,!0);continue}const gt=new Xd("ul",1);m(gt),fe.wrap(gt);continue}if(i.isValidChild(fe.parent.name,"div")&&i.isValidChild("div",fe.name)){const Ve=new Xd("div",1);m(Ve),fe.wrap(Ve)}else Mx(fe,i)}}},RB=(n,i)=>{let c=n;for(;c;){if(c.name===i)return!0;c=c.parent}return!1},$B=(n,i,c=i.parent)=>c&&n.children[i.name]&&!n.isValidChild(c.name,i.name)?!0:!!(c&&i.name==="a"&&RB(c,"a")),Rx=(n,i,c,m)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(c,m),p},NB=n=>{const i=Vt.fromRangeStart(n),c=Vt.fromRangeEnd(n),m=n.commonAncestorContainer;return zd(!1,m,c).map(p=>!Hd(i,c,m)&&Hd(i,p,m)?Rx(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},T5=n=>n.collapsed?n:NB(n),IB=n=>Oe(n.firstChild)&&n.firstChild===n.lastChild,IW=n=>n.name==="br"||n.value===Kr,BW=(n,i)=>n.getBlockElements()[i.name]&&IB(i)&&IW(i.firstChild),LW=(n,i)=>{const c=n.getNonEmptyElements();return Oe(i)&&(i.isEmpty(c)||BW(n,i))},FW=(n,i)=>{let c=i.firstChild,m=i.lastChild;return c&&c.name==="meta"&&(c=c.next),m&&m.attr("id")==="mce_marker"&&(m=m.prev),LW(n,m)&&(m=m==null?void 0:m.prev),!c||c!==m?!1:c.name==="ul"||c.name==="ol"},QW=n=>{var i,c;const m=n.firstChild,p=n.lastChild;return m&&m.nodeName==="META"&&((i=m.parentNode)===null||i===void 0||i.removeChild(m)),p&&p.id==="mce_marker"&&((c=p.parentNode)===null||c===void 0||c.removeChild(p)),n},BB=(n,i,c)=>{const m=i.serialize(c),p=n.createFragment(m);return QW(p)},ZW=n=>{var i;return At((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],c=>c.nodeName==="LI")},E5=n=>n.data===Kr||mi(n),G2=n=>Oe(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&E5(n.firstChild),HW=n=>!n.firstChild||G2(n),zW=n=>n.length>0&&HW(n[n.length-1])?n.slice(0,-1):n,xS=(n,i)=>{const c=n.getParent(i,n.isBlock);return c&&c.nodeName==="LI"?c:null},LB=(n,i)=>!!xS(n,i),FB=(n,i)=>{const c=i.cloneRange(),m=i.cloneRange();return c.setStartBefore(n),m.setEndAfter(n),[c.cloneContents(),m.cloneContents()]},VW=(n,i)=>{const c=Vt.before(n),p=Ea(i).next(c);return p?p.toRange():null},A5=(n,i)=>{const c=Vt.after(n),p=Ea(i).prev(c);return p?p.toRange():null},WW=(n,i,c,m)=>{const p=FB(n,m),w=n.parentNode;return w&&(w.insertBefore(p[0],n),gn.each(i,x=>{w.insertBefore(x,n)}),w.insertBefore(p[1],n),w.removeChild(n)),A5(i[i.length-1],c)},K2=(n,i,c)=>{const m=n.parentNode;return m&&gn.each(i,p=>{m.insertBefore(p,n)}),VW(n,c)},QB=(n,i,c,m)=>(m.insertAfter(i.reverse(),n),A5(i[0],c)),ZB=(n,i,c,m)=>{const p=BB(i,n,m),w=xS(i,c.startContainer),x=zW(ZW(p.firstChild)),M=1,B=2,q=i.getRoot(),ae=fe=>{const be=Vt.fromRangeStart(c),Le=Ea(i.getRoot()),Ye=fe===M?Le.prev(be):Le.next(be),Me=Ye==null?void 0:Ye.getNode();return Me?xS(i,Me)!==w:!0};return w?ae(M)?K2(w,x,q):ae(B)?QB(w,x,q,i):WW(w,x,q,c):null},HB=["pre"],N3=(n,i,c,m)=>{var p;const w=i.firstChild,x=i.lastChild,M=x.attr("data-mce-type")==="bookmark"?x.prev:x,B=w===M,q=kt(HB,w.name);if(B&&q){const ae=w.attr("contenteditable")!=="false",fe=((p=n.getParent(c,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===w.name,be=he.from(PO(m,c)).forall(ba);return ae&&fe&&be}else return!1},I3=Rd,UW=(n,i,c)=>{if(Oe(c)){const m=n.getParent(i.endContainer,I3);return c===m&&wO(Ke.fromDom(c),i)}else return!1},zB=(n,i,c)=>{var m;if(c.getAttribute("data-mce-bogus")==="all")(m=c.parentNode)===null||m===void 0||m.insertBefore(n.dom.createFragment(i),c);else{const p=c.firstChild,w=c.lastChild;!p||p===w&&p.nodeName==="BR"?n.dom.setHTML(c,i):n.selection.setContent(i,{no_events:!0})}},YW=(n,i)=>{he.from(n.getParent(i,"td,th")).map(Ke.fromDom).each(ct)},XW=(n,i)=>{const c=n.schema.getTextInlineElements(),m=n.dom;if(i){const p=n.getBody(),w=P3(n);gn.each(m.select("*[data-mce-fragment]"),x=>{if(Oe(c[x.nodeName.toLowerCase()])&&VI(m,x)){for(let B=x.parentElement;Oe(B)&&B!==p&&!wie(m,x,B);B=B.parentElement)if(w.compare(B,x)){m.remove(x,!0);break}}})}},B3=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},VB=n=>{gn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},D5=n=>!!n.getAttribute("data-mce-fragment"),jW=(n,i)=>Oe(i)&&!n.schema.getVoidElements()[i.nodeName],qW=(n,i)=>{var c,m,p;let w;const x=n.dom,M=n.selection;if(!i)return;M.scrollIntoView(i);const B=PO(n.getBody(),i);if(B&&x.getContentEditable(B)==="false"){x.remove(i),M.select(B);return}let q=x.createRng();const ae=i.previousSibling;if(_n(ae)){q.setStart(ae,(m=(c=ae.nodeValue)===null||c===void 0?void 0:c.length)!==null&&m!==void 0?m:0);const Le=i.nextSibling;_n(Le)&&(ae.appendData(Le.data),(p=Le.parentNode)===null||p===void 0||p.removeChild(Le))}else q.setStartBefore(i),q.setEndBefore(i);const fe=Le=>{let Ye=Vt.fromRangeStart(Le);return Ye=Ea(n.getBody()).next(Ye),Ye==null?void 0:Ye.toRange()},be=x.getParent(i,x.isBlock);if(x.remove(i),be&&x.isEmpty(be)){const Le=I3(be);Ad(Ke.fromDom(be)),q.setStart(be,0),q.setEnd(be,0),!Le&&!D5(be)&&(w=fe(q))?(q=w,x.remove(be)):x.add(be,x.create("br",Le?{}:{"data-mce-bogus":"1"}))}M.setRng(q)},WB=n=>{const i=n.dom,c=T5(n.selection.getRng());n.selection.setRng(c);const m=i.getParent(c.startContainer,I3);UW(i,c,m)?Tx(n,c,Ke.fromDom(m)):c.startContainer===c.endContainer&&c.endOffset-c.startOffset===1&&_n(c.startContainer.childNodes[c.startOffset])?c.deleteContents():n.getDoc().execCommand("Delete",!1)},P5=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return he.some(i);return he.none()},UB=(n,i,c)=>{var m,p;const w=n.selection,x=n.dom,M=n.parser,B=c.merge,q=Y2({validate:!0},n.schema),ae='<span id="mce_marker" data-mce-type="bookmark"></span>';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ae);let fe=w.getRng();const be=fe.startContainer,Le=n.getBody();be===Le&&w.isCollapsed()&&x.isBlock(Le.firstChild)&&jW(n,Le.firstChild)&&x.isEmpty(Le.firstChild)&&(fe=x.createRng(),fe.setStart(Le.firstChild,0),fe.setEnd(Le.firstChild,0),w.setRng(fe)),w.isCollapsed()||WB(n);const Ye=w.getNode(),Me={context:Ye.nodeName.toLowerCase(),data:c.data,insert:!0},Ve=M.parse(i,Me);if(c.paste===!0&&FW(n.schema,Ve)&&LB(x,Ye))return fe=ZB(q,x,w.getRng(),Ve),fe&&w.setRng(fe),i;c.paste===!0&&N3(x,Ve,Ye,n.getBody())&&((m=Ve.firstChild)===null||m===void 0||m.unwrap()),B3(Ve);let gt=Ve.lastChild;if(gt&>.attr("id")==="mce_marker"){const Ot=gt;for(gt=gt.prev;gt;gt=gt.walk(!0))if(gt.type===3||!x.isBlock(gt.name)){gt.parent&&n.schema.isValidChild(gt.parent.name,"span")&>.parent.insert(Ot,gt,gt.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(Ye),!Me.invalid)i=q.serialize(Ve),zB(n,i,Ye);else{n.selection.setContent(ae);let Ot=w.getNode(),wt;const Pt=n.getBody();for(of(Ot)?Ot=wt=Pt:wt=Ot;wt&&wt!==Pt;)Ot=wt,wt=wt.parentNode;i=Ot===Pt?Pt.innerHTML:x.getOuterHTML(Ot);const hn=M.parse(i),Hn=P5(hn),$n=Hn.bind(MB).getOr(hn);Hn.each(yo=>yo.replace(Ve));const Lt=Ve.children(),Zt=(p=Ve.parent)!==null&&p!==void 0?p:hn;Ve.unwrap();const yn=At(Lt,yo=>$B(n.schema,yo,Zt));x5(yn,n.schema,$n),Cp(M.getNodeFilters(),M.getAttributeFilters(),hn),i=q.serialize(hn),Ot===Pt?x.setHTML(Pt,i):x.setOuterHTML(Ot,i)}return XW(n,B),qW(n,x.get("mce_marker")),VB(n.getBody()),YW(x,w.getStart()),$v(n.schema,n.getBody(),w.getStart()),i},L3=n=>n instanceof Xd,GW=n=>{U2(n)&&cl(n.getBody()).each(i=>{const c=i.getNode(),m=Iu(c)?cl(c).getOr(i):i;n.selection.setRng(m.toRange())})},M5=(n,i,c)=>{n.dom.setHTML(n.getBody(),i),c!==!0&&GW(n)},F3=(n,i,c,m)=>{if(c.length===0||/^\s+$/.test(c)){const p='<br data-mce-bogus="1">';i.nodeName==="TABLE"?c="<tr><td>"+p+"</td></tr>":/^(UL|OL)$/.test(i.nodeName)&&(c="<li>"+p+"</li>");const w=jc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),w.toLowerCase())?(c=p,c=n.dom.createHTML(w,db(n),c)):c||(c=p),M5(n,c,m.no_selection),{content:c,html:c}}else{m.format!=="raw"&&(c=Y2({validate:!1},n.schema).serialize(n.parser.parse(c,{isRootContent:!0,insert:!0})));const p=lu(Ke.fromDom(i))?c:gn.trim(c);return M5(n,p,m.no_selection),{content:p,html:p}}},ev=(n,i,c,m)=>{Cp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),c);const p=Y2({validate:!1},n.schema).serialize(c),w=lu(Ke.fromDom(i))?p:gn.trim(p);return M5(n,w,m.no_selection),{content:c,html:w}},KW=(n,i,c)=>he.from(n.getBody()).map(m=>L3(i)?ev(n,m,i,c):F3(n,m,i,c)).getOr({content:i,html:L3(c.content)?"":c.content}),R5=(n,i,c)=>di(n,i,c).isSome(),$l=(n,i)=>Vp(n,i).isSome(),Q3=n=>ce(n)?n:je,$5=(n,i,c)=>{let m=n.dom;const p=Q3(c);for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m),x=i(w);if(x.isSome())return x;if(p(w))break}return he.none()},m1=(n,i,c)=>{const m=i(n),p=Q3(c);return m.orThunk(()=>p(n)?he.none():$5(n,i,p))},Z3=J_,N5=(n,i,c)=>{const m=n.formatter.get(c);if(m)for(let p=0;p<m.length;p++){const w=m[p];if(dd(w)&&w.inherit===!1&&n.dom.is(i,w.selector))return!0}return!1},J2=(n,i,c,m,p)=>{const w=n.dom.getRoot();if(i===w)return!1;const x=n.dom.getParent(i,M=>N5(n,M,c)?!0:M.parentNode===w||!!$h(n,M,c,m,!0));return!!$h(n,x,c,m,p)},H3=(n,i,c)=>Ml(c)&&Z3(i,c.inline)||wm(c)&&Z3(i,c.block)?!0:dd(c)?Jn(i)&&n.is(i,c.selector):!1,YB=(n,i,c,m,p,w)=>{const x=c[m],M=m==="attributes";if(ce(c.onmatch))return c.onmatch(i,c,m);if(x){if(kr(x)){for(let B=0;B<x.length;B++)if(M?n.getAttrib(i,x[B]):R2(n,i,x[B]))return!0}else for(const B in x)if(fn(x,B)){const q=M?n.getAttrib(i,B):R2(n,i,B),ae=Ph(x[B],w),fe=Re(q)||ol(q);if(fe&&Re(ae))continue;if(p&&fe&&!c.exact||(!p||c.exact)&&!Z3(q,M2(ae,B)))return!1}}return!0},$h=(n,i,c,m,p)=>{const w=n.formatter.get(c),x=n.dom;if(w&&Jn(i))for(let M=0;M<w.length;M++){const B=w[M];if(H3(n.dom,i,B)&&YB(x,i,B,"attributes",p,m)&&YB(x,i,B,"styles",p,m)){const q=B.classes;if(q){for(let ae=0;ae<q.length;ae++)if(!n.dom.hasClass(i,Ph(q[ae],m)))return}return B}}},I5=(n,i,c,m,p)=>{if(m)return J2(n,m,i,c,p);if(m=n.selection.getNode(),J2(n,m,i,c,p))return!0;const w=n.selection.getStart();return!!(w!==m&&J2(n,w,i,c,p))},ew=(n,i,c)=>{const m=[],p={},w=n.selection.getStart();return n.dom.getParent(w,x=>{for(let M=0;M<i.length;M++){const B=i[M];!p[B]&&$h(n,x,B,c)&&(p[B]=!0,m.push(B))}},n.dom.getRoot()),m},JW=(n,i)=>{const c=p=>vt(p,Ke.fromDom(n.getBody())),m=(p,w)=>$h(n,p.dom,w)?he.some(w):he.none();return he.from(n.selection.getStart(!0)).bind(p=>m1(Ke.fromDom(p),w=>Ls(i,x=>m(w,x)),c)).getOrNull()},MO=(n,i)=>{const c=n.formatter.get(i),m=n.dom;if(c&&n.selection.isEditable()){const p=n.selection.getStart(),w=$2(m,p);for(let x=c.length-1;x>=0;x--){const M=c[x];if(!dd(M))return!0;for(let B=w.length-1;B>=0;B--)if(m.is(w[B],M.selector))return!0}}return!1},kg=(n,i,c)=>zn(c,(m,p)=>{const w=Kk(n,p);return n.formatter.matchNode(i,p,{},w)?m.concat([p]):m},[]),tv=Ft,B5=(n,i)=>n.importNode(i,!0),eU=n=>{const i=[];let c=n;for(;c;){if(_n(c)&&c.data!==tv||c.childNodes.length>1)return[];Jn(c)&&i.push(c),c=c.firstChild}return i},XB=n=>eU(n).length>0,$x=n=>{if(n){const i=new _i(n,n);for(let c=i.current();c;c=i.next())if(_n(c))return c}return null},L5=n=>{const i=Ke.fromTag("span");return Ju(i,{id:j_,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&na(i,Ke.fromText(tv)),i},kp=n=>{const i=$x(n);return i&&i.data.charAt(0)===tv&&i.deleteData(0,1),i},TS=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(XB(i))K0(n,!1,Ke.fromDom(i),c);else{const w=p.getRng(),x=m.getParent(i,m.isBlock),M=w.startContainer,B=w.startOffset,q=w.endContainer,ae=w.endOffset,fe=kp(i);m.remove(i,!0),M===fe&&B>0&&w.setStart(fe,B-1),q===fe&&ae>0&&w.setEnd(fe,ae-1),x&&m.isEmpty(x)&&Pe(Ke.fromDom(x)),p.setRng(w)}},z3=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(i)TS(n,i,c);else if(i=Cb(n.getBody(),p.getStart()),!i)for(;i=m.get(j_);)TS(n,i,c)},F5=(n,i,c)=>{var m,p;const w=n.dom,x=w.getParent(c,He(Wl,n.schema));x&&w.isEmpty(x)?(m=c.parentNode)===null||m===void 0||m.replaceChild(i,c):(j(Ke.fromDom(c)),w.isEmpty(c)?(p=c.parentNode)===null||p===void 0||p.replaceChild(i,c):w.insertAfter(i,c))},V3=(n,i)=>(n.appendChild(i),i),RO=(n,i)=>{var c;const m=An(n,(w,x)=>V3(w,x.cloneNode(!1)),i),p=(c=m.ownerDocument)!==null&&c!==void 0?c:document;return V3(m,p.createTextNode(tv))},Q5=(n,i,c,m,p,w)=>{const x=n.formatter,M=n.dom,B=At(bs(x.get()),fe=>fe!==m&&!nr(fe,"removeformat")),q=kg(n,c,B);if(At(q,fe=>!mP(n,fe,m)).length>0){const fe=c.cloneNode(!1);return M.add(i,fe),x.remove(m,p,fe,w),M.remove(fe),he.some(fe)}else return he.none()},tU=(n,i,c)=>{let m;const p=n.selection,w=n.formatter.get(i);if(!w)return;const x=p.getRng();let M=x.startOffset;const q=x.startContainer.nodeValue;m=Cb(n.getBody(),p.getStart());const ae=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(q&&M>0&&M<q.length&&ae.test(q.charAt(M))&&ae.test(q.charAt(M-1))){const fe=p.getBookmark();x.collapse(!0);let be=z0(n.dom,x,w);be=_p(be),n.formatter.apply(i,c,be),p.moveToBookmark(fe)}else{let fe=m?$x(m):null;(!m||(fe==null?void 0:fe.data)!==tv)&&(m=B5(n.getDoc(),L5(!0).dom),fe=m.firstChild,x.insertNode(m),M=1),n.formatter.apply(i,c,m),p.setCursorLocation(fe,M)}},jB=(n,i,c,m)=>{const p=n.dom,w=n.selection;let x=!1;const M=n.formatter.get(i);if(!M)return;const B=w.getRng(),q=B.startContainer,ae=B.startOffset;let fe=q;_n(q)&&(ae!==q.data.length&&(x=!0),fe=fe.parentNode);const be=[];let Le;for(;fe;){if($h(n,fe,i,c,m)){Le=fe;break}fe.nextSibling&&(x=!0),be.push(fe),fe=fe.parentNode}if(!!Le)if(x){const Ye=w.getBookmark();B.collapse(!0);let Me=z0(p,B,M,!0);Me=_p(Me),n.formatter.remove(i,c,Me,m),w.moveToBookmark(Ye)}else{const Ye=Cb(n.getBody(),Le),Me=L5(!1).dom;F5(n,Me,Ye!=null?Ye:Le);const Ve=Q5(n,Me,Le,i,c,m),gt=RO(be.concat(Ve.toArray()),Me);Ye&&TS(n,Ye,!1),w.setCursorLocation(gt,1),p.isEmpty(Le)&&p.remove(Le)}},nU=(n,i,c)=>{const m=n.selection,p=n.getBody();z3(n,null,c),(i===8||i===46)&&m.isCollapsed()&&m.getStart().innerHTML===tv&&z3(n,Cb(p,m.getStart())),(i===37||i===39)&&z3(n,Cb(p,m.getStart()))},oU=n=>_n(n)&&Ki(n.data,Kr),sU=n=>{n.on("mouseup keydown",i=>{nU(n,i.keyCode,oU(n.selection.getRng().endContainer))})},qB=n=>{const i=L5(!1),c=RO(n,i.dom);return{caretContainer:i,caretPosition:Vt(c,0)}},ES=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return Ca(Ke.fromDom(n),c),wr(Ke.fromDom(n)),m},rU=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return n.insertNode(c.dom),m},Z5=(n,i)=>{const c=n.schema.getTextInlineElements();return fn(c,ti(i))&&!qc(i.dom)&&!Pd(i.dom)},W3=n=>qc(n.dom)&&XB(n.dom),Nx={},H5=$f(["pre"]),GB=(n,i)=>{Nx[n]||(Nx[n]=[]),Nx[n].push(i)},iU=(n,i)=>{fn(Nx,n)&&Ne(Nx[n],c=>{c(i)})};GB("pre",n=>{const i=n.selection.getRng(),c=p=>w=>{const x=w.previousSibling;return H5(x)&&kt(p,x)},m=(p,w)=>{const x=Ke.fromDom(w),M=Eo(x).dom;wr(x),ni(Ke.fromDom(p),[Ke.fromTag("br",M),Ke.fromTag("br",M),...Da(x)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),w=At(At(p,H5),c(p));Ne(w,x=>{m(x.previousSibling,x)})}});const KB=["fontWeight","fontStyle","color","fontSize","fontFamily"],aU=n=>te(n.styles)&&jt(bs(n.styles),i=>kt(KB,i)),lU=n=>oo(n,i=>Ml(i)&&i.inline==="span"&&aU(i)),JB=(n,i)=>{const c=n.get(i);return oe(c)?lU(c):he.none()},e8=(n,i)=>Hu(i,Vt.fromRangeStart(n)).isNone(),t8=(n,i)=>Hf(i,Vt.fromRangeEnd(n)).exists(c=>!mi(c.getNode())||Hf(i,c).isSome())===!1,n8=n=>i=>Wa(i)&&n.isEditable(i),cU=n=>{const i=n.getSelectedBlocks(),c=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return e8(c,i[0])&&t8(c,i[0])?i:[];{const m=$o(i).filter(x=>e8(c,x)).toArray(),p=Po(i).filter(x=>t8(c,x)).toArray(),w=i.slice(1,-1);return m.concat(w).concat(p)}},uU=n=>At(cU(n),n8(n.dom)),o8=n=>At(n.getSelectedBlocks(),n8(n.dom)),z5=gn.each,V5=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),W5=(n,i)=>{for(let c=n;c;c=c[i]){if(_n(c)&&yr(c.data))return n;if(Jn(c)&&!Wd(c))return c}return n},s8=(n,i,c)=>{const m=P3(n),p=Jn(i)&&vm(i),w=Jn(c)&&vm(c);if(p&&w){const x=W5(i,"previousSibling"),M=W5(c,"nextSibling");if(m.compare(x,M)){for(let B=x.nextSibling;B&&B!==M;){const q=B;B=B.nextSibling,x.appendChild(q)}return n.dom.remove(M),gn.each(gn.grep(M.childNodes),B=>{x.appendChild(B)}),x}}return c},tw=(n,i,c,m)=>{var p;if(m&&i.merge_siblings!==!1){const w=(p=s8(n,Gn(m),m))!==null&&p!==void 0?p:m;s8(n,w,Gn(w,!0))}},fU=(n,i,c)=>{if(i.clear_child_styles){const m=i.links?"*:not(a)":"*";z5(n.select(m,c),p=>{V5(p)&&vm(p)&&z5(i.styles,(w,x)=>{n.setStyle(p,x,"")})})}},U5=(n,i,c)=>{z5(n.childNodes,m=>{V5(m)&&(i(m)&&c(m),m.hasChildNodes()&&U5(m,i,c))})},dU=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},r8=(n,i)=>c=>!!(c&&R2(n,c,i)),Y5=(n,i,c)=>m=>{n.setStyle(m,i,c),m.getAttribute("style")===""&&m.removeAttribute("style"),dU(n,m)},nw=pg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),hU=/^(src|href|style)$/,X5=gn.each,U3=J_,mU=n=>/^(TR|TH|TD)$/.test(n.nodeName),i8=(n,i,c)=>n.isChildOf(i,c)&&i!==c&&!n.isBlock(c),a8=(n,i,c)=>{let m=i[c?"startContainer":"endContainer"],p=i[c?"startOffset":"endOffset"];if(Jn(m)){const w=m.childNodes.length-1;!c&&p&&p--,m=m.childNodes[p>w?w:p]}return _n(m)&&c&&p>=m.data.length&&(m=new _i(m,n.getBody()).next()||m),_n(m)&&!c&&p===0&&(m=new _i(m,n.getBody()).prev()||m),m},l8=(n,i)=>{const c=i?"firstChild":"lastChild",m=n[c];return mU(n)&&m?n.nodeName==="TR"&&m[c]||m:n},j5=(n,i,c,m)=>{var p;const w=n.create(c,m);return(p=i.parentNode)===null||p===void 0||p.insertBefore(w,i),w.appendChild(i),w},c8=(n,i,c,m,p)=>{const w=Ke.fromDom(i),x=Ke.fromDom(n.create(m,p)),M=c?il(w):Wg(w);return ni(x,M),c?(Ca(w,x),ah(x,w)):(iu(w,x),na(x,w)),x.dom},q5=(n,i)=>i.links&&n.nodeName==="A",G5=(n,i,c)=>{const m=i.parentNode;let p;const w=n.dom,x=jc(n);wm(c)&&m===w.getRoot()&&(!c.list_block||!U3(i,c.list_block))&&Ne(Rr(i.childNodes),M=>{Om(n,x,M.nodeName.toLowerCase())?p?p.appendChild(M):(p=j5(w,M,x),w.setAttribs(p,db(n))):p=null}),!(Jk(c)&&!U3(c.inline,i))&&w.remove(i,!0)},gU=(n,i,c)=>Xe(n)?{name:i,value:null}:{name:n,value:Ph(i,c)},AS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},K5=(n,i,c,m,p)=>{let w=!1;X5(c.styles,(x,M)=>{const{name:B,value:q}=gU(M,x,m),ae=M2(q,B);(c.remove_similar||G(q)||!Jn(p)||U3(R2(n,p,B),ae))&&n.setStyle(i,B,""),w=!0}),w&&AS(n,i)},Ix=(n,i,c)=>{i==="removeformat"?Ne(o8(n.selection),m=>{Ne(KB,p=>n.dom.setStyle(m,p,"")),AS(n.dom,m)}):JB(n.formatter,i).each(m=>{Ne(o8(n.selection),p=>K5(n.dom,p,m,c,null))})},DS=(n,i,c,m,p)=>{const w=n.dom,x=P3(n),M=n.schema;if(Ml(i)&&tp(M,i.inline)&&ig(M,m)&&m.parentElement===n.getBody())return G5(n,m,i),nw.removed();if(!i.ceFalseOverride&&m&&w.getContentEditableParent(m)==="false"||m&&!H3(w,m,i)&&!q5(m,i))return nw.keep();const B=m,q=i.preserve_attributes;if(Ml(i)&&i.remove==="all"&&oe(q)){const ae=At(w.getAttribs(B),fe=>kt(q,fe.name.toLowerCase()));if(w.removeAllAttribs(B),Ne(ae,fe=>w.setAttrib(B,fe.name,fe.value)),ae.length>0)return nw.rename("span")}if(i.remove!=="all"){K5(w,B,i,c,p),X5(i.attributes,(fe,be)=>{const{name:Le,value:Ye}=gU(be,fe,c);if(i.remove_similar||G(Ye)||!Jn(p)||U3(w.getAttrib(p,Le),Ye)){if(Le==="class"){const Me=w.getAttrib(B,Le);if(Me){let Ve="";if(Ne(Me.split(/\s+/),gt=>{/mce\-\w+/.test(gt)&&(Ve+=(Ve?" ":"")+gt)}),Ve){w.setAttrib(B,Le,Ve);return}}}if(hU.test(Le)&&B.removeAttribute("data-mce-"+Le),Le==="style"&&$f(["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)}}),X5(i.classes,fe=>{fe=Ph(fe,c),(!Jn(p)||w.hasClass(p,fe))&&w.removeClass(B,fe)});const ae=w.getAttribs(B);for(let fe=0;fe<ae.length;fe++){const be=ae[fe].nodeName;if(!x.isAttributeInternal(be))return nw.keep()}}return i.remove!=="none"?(G5(n,B,i),nw.removed()):nw.keep()},u8=(n,i,c,m,p)=>{let w;return i.parentNode&&Ne($2(n.dom,i.parentNode).reverse(),x=>{if(!w&&Jn(x)&&x.id!=="_start"&&x.id!=="_end"){const M=$h(n,x,c,m,p);M&&M.split!==!1&&(w=x)}}),w},Cie=(n,i,c,m)=>DS(n,i,c,m,m).fold(Qe(m),p=>(n.dom.createFragment().appendChild(m),n.dom.rename(m,p)),Qe(null)),pU=(n,i,c,m,p,w,x,M)=>{var B,q;let ae,fe;const be=n.dom;if(c){const Le=c.parentNode;for(let Ye=m.parentNode;Ye&&Ye!==Le;Ye=Ye.parentNode){let Me=be.clone(Ye,!1);for(let Ve=0;Ve<i.length&&(Me=Cie(n,i[Ve],M,Me),Me!==null);Ve++);Me&&(ae&&Me.appendChild(ae),fe||(fe=Me),ae=Me)}w&&(!x.mixed||!be.isBlock(c))&&(m=(B=be.split(c,m))!==null&&B!==void 0?B:m),ae&&fe&&((q=p.parentNode)===null||q===void 0||q.insertBefore(ae,p),fe.appendChild(p),Ml(x)&&tw(n,x,M,ae))}return m},kie=(n,i,c,m,p)=>{const w=n.formatter.get(i),x=w[0],M=n.dom,B=n.selection,q=Me=>{const Ve=u8(n,Me,i,c,p);return pU(n,w,Ve,Me,Me,!0,x,c)},ae=Me=>Wd(Me)&&Jn(Me)&&(Me.id==="_start"||Me.id==="_end"),fe=Me=>jt(w,Ve=>Bx(n,Ve,c,Me,Me)),be=Me=>{const Ve=Rr(Me.childNodes),Ot=fe(Me)||jt(w,hn=>H3(M,Me,hn)),wt=Me.parentNode;if(!Ot&&Oe(wt)&&I2(x)&&fe(wt),x.deep&&Ve.length)for(let hn=0;hn<Ve.length;hn++)be(Ve[hn]);Ne(["underline","line-through","overline"],hn=>{Jn(Me)&&n.dom.getStyle(Me,"text-decoration")===hn&&Me.parentNode&&Gk(M,Me.parentNode)===hn&&Bx(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:hn}},void 0,Me)})},Le=Me=>{const Ve=M.get(Me?"_start":"_end");if(Ve){let gt=Ve[Me?"firstChild":"lastChild"];return ae(gt)&&(gt=gt[Me?"firstChild":"lastChild"]),_n(gt)&>.data.length===0&&(gt=Me?Ve.previousSibling||Ve.nextSibling:Ve.nextSibling||Ve.previousSibling),M.remove(Ve,!0),gt}else return null},Ye=Me=>{let Ve,gt,Ot=z0(M,Me,w,Me.collapsed);if(x.split){if(Ot=_p(Ot),Ve=a8(n,Ot,!0),gt=a8(n,Ot),Ve!==gt){if(Ve=l8(Ve,!0),gt=l8(gt,!1),i8(M,Ve,gt)){const Pt=he.from(Ve.firstChild).getOr(Ve);q(c8(M,Pt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Le(!0);return}if(i8(M,gt,Ve)){const Pt=he.from(gt.lastChild).getOr(gt);q(c8(M,Pt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Le(!1);return}Ve=j5(M,Ve,"span",{id:"_start","data-mce-type":"bookmark"}),gt=j5(M,gt,"span",{id:"_end","data-mce-type":"bookmark"});const wt=M.createRng();wt.setStartAfter(Ve),wt.setEndBefore(gt),c1(M,wt,Pt=>{Ne(Pt,hn=>{!Wd(hn)&&!Wd(hn.parentNode)&&q(hn)})}),q(Ve),q(gt),Ve=Le(!0),gt=Le()}else Ve=gt=q(Ve);Ot.startContainer=Ve.parentNode?Ve.parentNode:Ve,Ot.startOffset=M.nodeIndex(Ve),Ot.endContainer=gt.parentNode?gt.parentNode:gt,Ot.endOffset=M.nodeIndex(gt)+1}c1(M,Ot,wt=>{Ne(wt,be)})};if(m){if(D2(m)){const Me=M.createRng();Me.setStartBefore(m),Me.setEndAfter(m),Ye(Me)}else Ye(m);Rh(n,i,m,c);return}!B.isCollapsed()||!Ml(x)||xb(n).length?(ZE(n,()=>jk(n,Ye),Me=>Ml(x)&&I5(n,i,c,Me)),n.nodeChanged()):jB(n,i,c,p),Ix(n,i,c),Rh(n,i,m,c)},f8=(n,i,c,m,p)=>{(m||n.selection.isEditable())&&kie(n,i,c,m,p)},Bx=(n,i,c,m,p)=>DS(n,i,c,m,p).fold(je,w=>(n.dom.rename(m,w),!0),mt),bU=gn.each,vU=(n,i,c,m)=>{const p=w=>{if(Jn(w)&&Jn(w.parentNode)&&vm(w)){const x=Gk(n,w.parentNode);n.getStyle(w,"color")&&x?n.setStyle(w,"text-decoration",x):n.getStyle(w,"text-decoration")===x&&n.setStyle(w,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(gn.walk(m,p,"childNodes"),p(m))},d8=(n,i,c,m)=>{if(i.styles&&i.styles.backgroundColor){const p=r8(n,"fontSize");U5(m,w=>p(w)&&vm(w),Y5(n,"backgroundColor",Ph(i.styles.backgroundColor,c)))}},OU=(n,i,c,m)=>{if(Ml(i)&&(i.inline==="sub"||i.inline==="sup")){const p=r8(n,"fontSize");U5(m,x=>p(x)&&vm(x),Y5(n,"fontSize",""));const w=At(n.select(i.inline==="sup"?"sub":"sup",m),vm);n.remove(w,!0)}},h8=(n,i,c,m)=>{bU(i,p=>{Ml(p)&&bU(n.dom.select(p.inline,m),w=>{V5(w)&&Bx(n,p,c,w,p.exact?w:null)}),fU(n.dom,p,m)})},yU=(n,i,c,m,p)=>{const w=p.parentNode;$h(n,w,c,m)&&Bx(n,i,m,p)||i.merge_with_parents&&w&&n.dom.getParent(w,x=>$h(n,x,c,m)?(Bx(n,i,m,p),!0):!1)},ow=gn.each,m8=(n,i,c,m)=>{if(D_(n)&&Ml(i)&&c.parentNode){const p=rd(n.schema),w=$l(Ke.fromDom(c),x=>qc(x.dom));return os(p,m)&&$a(Ke.fromDom(c.parentNode),!1)&&!w}else return!1},rc=(n,i,c,m)=>{if(ow(c.styles,(p,w)=>{n.setStyle(i,w,Ph(p,m))}),c.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},xie=(n,i,c,m)=>{const p=n.formatter.get(i),w=p[0],x=!m&&n.selection.isCollapsed(),M=n.dom,B=n.selection,q=(Ye,Me=w)=>{ce(Me.onformat)&&Me.onformat(Ye,Me,c,m),rc(M,Ye,Me,c),ow(Me.attributes,(Ve,gt)=>{M.setAttrib(Ye,gt,Ph(Ve,c))}),ow(Me.classes,Ve=>{const gt=Ph(Ve,c);M.hasClass(Ye,gt)||M.addClass(Ye,gt)})},ae=(Ye,Me)=>{let Ve=!1;return ow(Ye,gt=>dd(gt)?M.getContentEditable(Me)==="false"&&!gt.ceFalseOverride||Oe(gt.collapsed)&>.collapsed!==x?!0:M.is(Me,gt.selector)&&!qc(Me)?(q(Me,gt),Ve=!0,!1):!0:!1),Ve},fe=Ye=>{if(L(Ye)){const Me=M.create(Ye);return q(Me),Me}else return null},be=(Ye,Me,Ve)=>{const gt=[];let Ot=!0;const wt=w.inline||w.block,Pt=fe(wt),hn=Lt=>tS(w)&&$h(n,Lt,i,c),Hn=(Lt,Zt,yn)=>{const yo=N2(w)&&Wl(n.schema,Lt)&&Om(n,Zt,wt);return yn&&yo},$n=(Lt,Zt,yn,yo)=>{const Do=Lt.nodeName.toLowerCase(),Cs=Om(n,wt,Do)&&Om(n,Zt,wt),Ws=!Ve&&_n(Lt)&&Sn(Lt.data),Ir=qc(Lt),pi=!Ml(w)||!Ye.isBlock(Lt);return(yn||yo)&&Cs&&!Ws&&!Ir&&pi};c1(Ye,Me,Lt=>{let Zt;const yn=yo=>{let Do=!1,Cs=Ot,Ws=!1;const Ir=yo.parentNode,pi=Ir.nodeName.toLowerCase(),fl=Ye.getContentEditable(yo);Oe(fl)&&(Cs=Ot,Ot=fl==="true",Do=!0,Ws=P2(n,yo));const Il=Ot&&!Do;if(mi(yo)&&!m8(n,w,yo,pi)){Zt=null,wm(w)&&Ye.remove(yo);return}if(hn(yo)){Zt=null;return}if(Hn(yo,pi,Il)){const Oc=Ye.rename(yo,wt);q(Oc),gt.push(Oc),Zt=null;return}if(dd(w)){let Oc=ae(p,yo);if(!Oc&&Oe(Ir)&&I2(w)&&(Oc=ae(p,Ir)),!Ml(w)||Oc){Zt=null;return}}Oe(Pt)&&$n(yo,pi,Il,Ws)?(Zt||(Zt=Ye.clone(Pt,!1),Ir.insertBefore(Zt,yo),gt.push(Zt)),Ws&&Do&&(Ot=Cs),Zt.appendChild(yo)):(Zt=null,Ne(Rr(yo.childNodes),yn),Do&&(Ot=Cs),Zt=null)};Ne(Lt,yn)}),w.links===!0&&Ne(gt,Lt=>{const Zt=yn=>{yn.nodeName==="A"&&q(yn,w),Ne(Rr(yn.childNodes),Zt)};Zt(Lt)}),Ne(gt,Lt=>{const Zt=Do=>{let Cs=0;return Ne(Do.childNodes,Ws=>{!ym(Ws)&&!Wd(Ws)&&Cs++}),Cs},yn=Do=>oo(Do.childNodes,qk).filter(Ws=>Ye.getContentEditable(Ws)!=="false"&&H3(Ye,Ws,w)).map(Ws=>{const Ir=Ye.clone(Ws,!1);return q(Ir),Ye.replace(Ir,Do,!0),Ye.remove(Ws,!0),Ir}).getOr(Do),yo=Zt(Lt);if((gt.length>1||!Ye.isBlock(Lt))&&yo===0){Ye.remove(Lt,!0);return}(Ml(w)||wm(w)&&w.wrapper)&&(!w.exact&&yo===1&&(Lt=yn(Lt)),h8(n,p,c,Lt),yU(n,w,i,c,Lt),d8(Ye,w,c,Lt),vU(Ye,w,c,Lt),OU(Ye,w,c,Lt),tw(n,w,c,Lt))})},Le=D2(m)?m:B.getNode();if(M.getContentEditable(Le)==="false"&&!P2(n,Le)){m=Le,ae(p,m),GE(n,i,m,c);return}if(w){if(m)if(D2(m)){if(!ae(p,m)){const Ye=M.createRng();Ye.setStartBefore(m),Ye.setEndAfter(m),be(M,z0(M,Ye,p),!0)}}else be(M,m,!0);else!x||!Ml(w)||xb(n).length?(B.setRng(T5(B.getRng())),ZE(n,()=>{jk(n,(Ye,Me)=>{const Ve=Me?Ye:z0(M,Ye,p);be(M,Ve,!1)})},mt),n.nodeChanged()):tU(n,i,c),JB(n.formatter,i).each(Ye=>{Ne(uU(n.selection),Me=>rc(M,Me,Ye,c))});iU(i,n)}GE(n,i,m,c)},wU=(n,i,c,m)=>{(m||n.selection.isEditable())&&xie(n,i,c,m)},_U=n=>fn(n,"vars"),Tie=(n,i)=>{n.set({}),i.on("NodeChange",c=>{ov(i,c.element,n.get())}),i.on("FormatApply FormatRemove",c=>{const m=he.from(c.node).map(p=>D2(p)?p:p.startContainer).bind(p=>Jn(p)?he.some(p):he.from(p.parentElement)).getOrThunk(()=>xg(i));ov(i,m,n.get())})},xg=n=>n.selection.getStart(),Lx=(n,i,c,m,p)=>ps(i,M=>{const B=n.formatter.matchNode(M,c,p!=null?p:{},m);return!ve(B)},M=>N5(n,M,c)?!0:m?!1:Oe(n.formatter.matchNode(M,c,p,!0))),nv=(n,i)=>{const c=i!=null?i:xg(n);return At($2(n.dom,c),m=>Jn(m)&&!Pd(m))},ov=(n,i,c)=>{const m=nv(n,i);ln(c,(p,w)=>{const x=M=>{const B=Lx(n,m,w,M.similar,_U(M)?M.vars:void 0),q=B.isSome();if(M.state.get()!==q){M.state.set(q);const ae=B.getOr(i);_U(M)?M.callback(q,{node:ae,format:w,parents:m}):Ne(M.callbacks,fe=>fe(q,{node:ae,format:w,parents:m}))}};Ne([p.withSimilar,p.withoutSimilar],x),Ne(p.withVars,x)})},SU=(n,i,c,m,p,w)=>{const x=i.get();Ne(c.split(","),M=>{const B=wo(x,M).getOrThunk(()=>{const ae={withSimilar:{state:Ga(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ga(!1),similar:!1,callbacks:[]},withVars:[]};return x[M]=ae,ae}),q=()=>{const ae=nv(n);return Lx(n,ae,M,p,w).isSome()};if(ve(w)){const ae=p?B.withSimilar:B.withoutSimilar;ae.callbacks.push(m),ae.callbacks.length===1&&ae.state.set(q())}else B.withVars.push({state:Ga(q()),similar:p,vars:w,callback:m})}),i.set(x)},CU=(n,i,c)=>{const m=n.get();Ne(i.split(","),p=>wo(m,p).each(w=>{m[p]={withSimilar:{...w.withSimilar,callbacks:At(w.withSimilar.callbacks,x=>x!==c)},withoutSimilar:{...w.withoutSimilar,callbacks:At(w.withoutSimilar.callbacks,x=>x!==c)},withVars:At(w.withVars,x=>x.callback!==c)}})),n.set(m)},PS=(n,i,c,m,p,w)=>(SU(n,i,c,m,p,w),{unbind:()=>CU(i,c,m)}),MS=(n,i,c,m)=>{const p=n.formatter.get(i);p&&(I5(n,i,c,m)&&(!("toggle"in p[0])||p[0].toggle)?f8(n,i,c,m):wU(n,i,c,m))},sw=gn.explode,J5=()=>{const n={};return{addFilter:(p,w)=>{Ne(sw(p),x=>{fn(n,x)||(n[x]={name:x,callbacks:[]}),n[x].callbacks.push(w)})},getFilters:()=>po(n),removeFilter:(p,w)=>{Ne(sw(p),x=>{if(fn(n,x))if(Oe(w)){const M=n[x],B=At(M.callbacks,q=>q!==w);B.length>0?M.callbacks=B:delete n[x]}else delete n[x]})}}},eM=(n,i)=>{Ne(i,c=>{n.attr(c,null)})},g8=(n,i,c)=>{n.addNodeFilter("font",m=>{Ne(m,p=>{const w=i.parse(p.attr("style")),x=p.attr("color"),M=p.attr("face"),B=p.attr("size");x&&(w.color=x),M&&(w["font-family"]=M),B&&ou(B).each(q=>{w["font-size"]=c[q-1]}),p.name="span",p.attr("style",i.serialize(w)),eM(p,["color","face","size"])})})},p8=(n,i,c)=>{n.addNodeFilter("strike",m=>{const p=i.type!=="html4";Ne(m,w=>{if(p)w.name="s";else{const x=c.parse(w.attr("style"));x["text-decoration"]="line-through",w.name="span",w.attr("style",c.serialize(x))}})})},kU=(n,i,c)=>{var m;const p=Qv();i.convert_fonts_to_spans&&g8(n,p,gn.explode((m=i.font_size_legacy_values)!==null&&m!==void 0?m:"")),p8(n,c,p)},xU=(n,i,c)=>{i.inline_styles&&kU(n,i,c)},tM=(n,i,c)=>{i.addNodeFilter("br",(m,p,w)=>{const x=gn.extend({},c.getBlockElements()),M=c.getNonEmptyElements(),B=c.getWhitespaceElements();x.body=1;const q=ae=>ae.name in x||rr(c,ae);for(let ae=0,fe=m.length;ae<fe;ae++){let be=m[ae],Le=be.parent;if(Le&&q(Le)&&be===Le.lastChild){let Ye=be.prev;for(;Ye;){const Me=Ye.name;if(Me!=="span"||Ye.attr("data-mce-type")!=="bookmark"){Me==="br"&&(be=null);break}Ye=Ye.prev}if(be&&(be.remove(),kS(c,M,B,Le))){const Me=c.getElementRule(Le.name);Me&&(Me.removeEmpty?Le.remove():Me.paddEmpty&&Px(n,w,q,Le))}}else{let Ye=be;for(;Le&&Le.firstChild===Ye&&Le.lastChild===Ye&&(Ye=Le,!x[Le.name]);)Le=Le.parent;if(Ye===Le){const Me=new Xd("#text",3);Me.value=Kr,be.replace(Me)}}}})},TU=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"})),EU=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},nM=n=>{const[i,...c]=n.split(","),m=c.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const w=p[2]===";base64",x=w?EU(m):decodeURIComponent(m);return he.some({type:p[1],data:x,base64Encoded:w})}else return he.none()},b8=(n,i,c=!0)=>{let m=i;if(c)try{m=atob(i)}catch{return he.none()}const p=new Uint8Array(m.length);for(let w=0;w<p.length;w++)p[w]=m.charCodeAt(w);return he.some(new Blob([p],{type:n}))},AU=n=>new Promise((i,c)=>{nM(n).bind(({type:m,data:p,base64Encoded:w})=>b8(m,p,w)).fold(()=>c("Invalid data URI"),i)}),v8=n=>Ar(n,"blob:")?TU(n):Ar(n,"data:")?AU(n):Promise.reject("Unknown URI format"),O8=n=>new Promise((i,c)=>{const m=new FileReader;m.onloadend=()=>{i(m.result)},m.onerror=()=>{var p;c((p=m.error)===null||p===void 0?void 0:p.message)},m.readAsDataURL(n)});let Fx=0;const y8=n=>(n||"blobid")+Fx++,w8=(n,i,c)=>nM(n).bind(({data:m,type:p,base64Encoded:w})=>{if(i&&!w)return he.none();{const x=w?m:btoa(m);return c(x,p)}}),oM=(n,i,c)=>{const m=n.create(y8(),i,c);return n.add(m),m},_8=(n,i,c=!1)=>w8(i,c,(m,p)=>he.from(n.getByData(m,p)).orThunk(()=>b8(p,m).map(w=>oM(n,w,m)))),S8=(n,i)=>{const c=()=>Promise.reject("Invalid data URI");if(Ar(i,"blob:")){const m=n.getByUri(i);return Oe(m)?Promise.resolve(m):v8(i).then(p=>O8(p).then(w=>w8(w,!1,x=>he.some(oM(n,p,x))).getOrThunk(c)))}else return Ar(i,"data:")?_8(n,i).fold(c,m=>Promise.resolve(m)):Promise.reject("Unknown image data format")},DU=n=>Oe(n.attr("data-mce-bogus")),PU=n=>n.attr("src")===qn.transparentSrc||Oe(n.attr("data-mce-placeholder")),C8=(n,i)=>{const{blob_cache:c}=i;if(c){const m=p=>{const w=p.attr("src");PU(p)||DU(p)||Re(w)||_8(c,w,!0).each(x=>{p.attr("src",x.blobUri())})};n.addAttributeFilter("src",p=>Ne(p,m))}},k8=(n,i)=>{const c=n.schema;i.remove_trailing_brs&&tM(i,n,c),n.addAttributeFilter("href",p=>{let w=p.length;const x=B=>B.split(" ").filter(ae=>ae.length>0).concat(["noopener"]).sort().join(" "),M=B=>{const q=B?gn.trim(B):"";return/\b(noopener)\b/g.test(q)?q:x(q)};if(!i.allow_unsafe_link_target)for(;w--;){const B=p[w];B.name==="a"&&B.attr("target")==="_blank"&&B.attr("rel",M(B.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let w=p.length,x,M,B,q;for(;w--;)if(q=p[w],q.name==="a"&&q.firstChild&&!q.attr("href"))for(B=q.parent,x=q.lastChild;x&&B;)M=x.prev,B.insert(x,q),x=M}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let w=p.length,x,M;for(;w--;)if(x=p[w],M=x.parent,M&&(M.name==="ul"||M.name==="ol"))if(x.prev&&x.prev.name==="li")x.prev.append(x);else{const B=new Xd("li",1);B.attr("style","list-style-type: none"),x.wrap(B)}});const m=c.getValidClasses();i.validate&&m&&n.addAttributeFilter("class",p=>{var w;let x=p.length;for(;x--;){const M=p[x],B=(w=M.attr("class"))!==null&&w!==void 0?w:"",q=gn.explode(B," ");let ae="";for(let fe=0;fe<q.length;fe++){const be=q[fe];let Le=!1,Ye=m["*"];Ye&&Ye[be]&&(Le=!0),Ye=m[M.name],!Le&&Ye&&Ye[be]&&(Le=!0),Le&&(ae&&(ae+=" "),ae+=be)}ae.length||(ae=null),M.attr("class",ae)}}),C8(n,i)};function $O(n){return $O=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},$O(n)}function Y3(n,i){return Y3=Object.setPrototypeOf||function(m,p){return m.__proto__=p,m},Y3(n,i)}function x8(){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 Qx(n,i,c){return x8()?Qx=Reflect.construct:Qx=function(p,w,x){var M=[null];M.push.apply(M,w);var B=Function.bind.apply(p,M),q=new B;return x&&Y3(q,x.prototype),q},Qx.apply(null,arguments)}function g1(n){return MU(n)||RU(n)||sM(n)||T8()}function MU(n){if(Array.isArray(n))return rw(n)}function RU(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function sM(n,i){if(!!n){if(typeof n=="string")return rw(n,i);var c=Object.prototype.toString.call(n).slice(8,-1);if(c==="Object"&&n.constructor&&(c=n.constructor.name),c==="Map"||c==="Set")return Array.from(n);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return rw(n,i)}}function rw(n,i){(i==null||i>n.length)&&(i=n.length);for(var c=0,m=new Array(i);c<i;c++)m[c]=n[c];return m}function T8(){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 E8=Object.hasOwnProperty,Zx=Object.setPrototypeOf,$U=Object.isFrozen,NU=Object.getPrototypeOf,NO=Object.getOwnPropertyDescriptor,gd=Object.freeze,p1=Object.seal,Hx=Object.create,rM=typeof Reflect<"u"&&Reflect,RS=rM.apply,X3=rM.construct;RS||(RS=function(i,c,m){return i.apply(c,m)}),gd||(gd=function(i){return i}),p1||(p1=function(i){return i}),X3||(X3=function(i,c){return Qx(i,g1(c))});var A8=Tg(Array.prototype.forEach),IU=Tg(Array.prototype.pop),zx=Tg(Array.prototype.push),j3=Tg(String.prototype.toLowerCase),iM=Tg(String.prototype.match),IO=Tg(String.prototype.replace),D8=Tg(String.prototype.indexOf),BU=Tg(String.prototype.trim),Nh=Tg(RegExp.prototype.test),aM=zf(TypeError);function Tg(n){return function(i){for(var c=arguments.length,m=new Array(c>1?c-1:0),p=1;p<c;p++)m[p-1]=arguments[p];return RS(n,i,m)}}function zf(n){return function(){for(var i=arguments.length,c=new Array(i),m=0;m<i;m++)c[m]=arguments[m];return X3(n,c)}}function Fi(n,i){Zx&&Zx(n,null);for(var c=i.length;c--;){var m=i[c];if(typeof m=="string"){var p=j3(m);p!==m&&($U(i)||(i[c]=p),m=p)}n[m]=!0}return n}function Ab(n){var i=Hx(null),c;for(c in n)RS(E8,n,[c])&&(i[c]=n[c]);return i}function Db(n,i){for(;n!==null;){var c=NO(n,i);if(c){if(c.get)return Tg(c.get);if(typeof c.value=="function")return Tg(c.value)}n=NU(n)}function m(p){return console.warn("fallback value for",p),null}return m}var lM=gd(["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"]),pd=gd(["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"]),sv=gd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),P8=gd(["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"]),cM=gd(["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"]),M8=gd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R8=gd(["#text"]),uM=gd(["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"]),iw=gd(["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"]),q3=gd(["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"]),G3=gd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$8=p1(/\{\{[\w\W]*|[\w\W]*\}\}/gm),LU=p1(/<%[\w\W]*|[\w\W]*%>/gm),fM=p1(/^data-[\-\w.\u00B7-\uFFFF]/),dM=p1(/^aria-[\-\w]+$/),FU=p1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QU=p1(/^(?:\w+script|data):/i),Pb=p1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hM=p1(/^html$/i),ZU=function(){return typeof window>"u"?null:window},mM=function(i,c){if($O(i)!=="object"||typeof i.createPolicy!="function")return null;var m=null,p="data-tt-policy-suffix";c.currentScript&&c.currentScript.hasAttribute(p)&&(m=c.currentScript.getAttribute(p));var w="dompurify"+(m?"#"+m:"");try{return i.createPolicy(w,{createHTML:function(M){return M}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}};function K3(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZU(),i=function(Xt){return K3(Xt)};if(i.version="2.3.8",i.removed=[],!n||!n.document||n.document.nodeType!==9)return i.isSupported=!1,i;var c=n.document,m=n.document,p=n.DocumentFragment,w=n.HTMLTemplateElement,x=n.Node,M=n.Element,B=n.NodeFilter,q=n.NamedNodeMap,ae=q===void 0?n.NamedNodeMap||n.MozNamedAttrMap:q,fe=n.HTMLFormElement,be=n.DOMParser,Le=n.trustedTypes,Ye=M.prototype,Me=Db(Ye,"cloneNode"),Ve=Db(Ye,"nextSibling"),gt=Db(Ye,"childNodes"),Ot=Db(Ye,"parentNode");if(typeof w=="function"){var wt=m.createElement("template");wt.content&&wt.content.ownerDocument&&(m=wt.content.ownerDocument)}var Pt=mM(Le,c),hn=Pt?Pt.createHTML(""):"",Hn=m,$n=Hn.implementation,Lt=Hn.createNodeIterator,Zt=Hn.createDocumentFragment,yn=Hn.getElementsByTagName,yo=c.importNode,Do={};try{Do=Ab(m).documentMode?m.documentMode:{}}catch{}var Cs={};i.isSupported=typeof Ot=="function"&&$n&&typeof $n.createHTMLDocument<"u"&&Do!==9;var Ws=$8,Ir=LU,pi=fM,fl=dM,Il=QU,Oc=Pb,Pn=FU,eo=null,Cr=Fi({},[].concat(g1(lM),g1(pd),g1(sv),g1(cM),g1(R8))),Bs=null,Co=Fi({},[].concat(g1(uM),g1(iw),g1(q3),g1(G3))),Mn=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}})),En=null,jo=null,Ks=!0,Jr=!0,ho=!1,Us=!1,ci=!1,Ja=!1,Ei=!1,$c=!1,Qh=!1,qd=!1,Dm=!0,qO=!0,Pw=!1,GO={},KO=null,Z4=Fi({},["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"]),H4=null,z4=Fi({},["audio","video","img","source","image","track"]),FT=null,QT=Fi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ZT="http://www.w3.org/1998/Math/MathML",cC="http://www.w3.org/2000/svg",T1="http://www.w3.org/1999/xhtml",uC=T1,Mw=!1,vv,HT=["application/xhtml+xml","text/html"],zT="text/html",Ib,Ov=null,VT=m.createElement("form"),WT=function(Xt){return Xt instanceof RegExp||Xt instanceof Function},UT=function(Xt){Ov&&Ov===Xt||((!Xt||$O(Xt)!=="object")&&(Xt={}),Xt=Ab(Xt),eo="ALLOWED_TAGS"in Xt?Fi({},Xt.ALLOWED_TAGS):Cr,Bs="ALLOWED_ATTR"in Xt?Fi({},Xt.ALLOWED_ATTR):Co,FT="ADD_URI_SAFE_ATTR"in Xt?Fi(Ab(QT),Xt.ADD_URI_SAFE_ATTR):QT,H4="ADD_DATA_URI_TAGS"in Xt?Fi(Ab(z4),Xt.ADD_DATA_URI_TAGS):z4,KO="FORBID_CONTENTS"in Xt?Fi({},Xt.FORBID_CONTENTS):Z4,En="FORBID_TAGS"in Xt?Fi({},Xt.FORBID_TAGS):{},jo="FORBID_ATTR"in Xt?Fi({},Xt.FORBID_ATTR):{},GO="USE_PROFILES"in Xt?Xt.USE_PROFILES:!1,Ks=Xt.ALLOW_ARIA_ATTR!==!1,Jr=Xt.ALLOW_DATA_ATTR!==!1,ho=Xt.ALLOW_UNKNOWN_PROTOCOLS||!1,Us=Xt.SAFE_FOR_TEMPLATES||!1,ci=Xt.WHOLE_DOCUMENT||!1,$c=Xt.RETURN_DOM||!1,Qh=Xt.RETURN_DOM_FRAGMENT||!1,qd=Xt.RETURN_TRUSTED_TYPE||!1,Ei=Xt.FORCE_BODY||!1,Dm=Xt.SANITIZE_DOM!==!1,qO=Xt.KEEP_CONTENT!==!1,Pw=Xt.IN_PLACE||!1,Pn=Xt.ALLOWED_URI_REGEXP||Pn,uC=Xt.NAMESPACE||T1,Xt.CUSTOM_ELEMENT_HANDLING&&WT(Xt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Mn.tagNameCheck=Xt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Xt.CUSTOM_ELEMENT_HANDLING&&WT(Xt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Mn.attributeNameCheck=Xt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Xt.CUSTOM_ELEMENT_HANDLING&&typeof Xt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Mn.allowCustomizedBuiltInElements=Xt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vv=HT.indexOf(Xt.PARSER_MEDIA_TYPE)===-1?vv=zT:vv=Xt.PARSER_MEDIA_TYPE,Ib=vv==="application/xhtml+xml"?function(So){return So}:j3,Us&&(Jr=!1),Qh&&($c=!0),GO&&(eo=Fi({},g1(R8)),Bs=[],GO.html===!0&&(Fi(eo,lM),Fi(Bs,uM)),GO.svg===!0&&(Fi(eo,pd),Fi(Bs,iw),Fi(Bs,G3)),GO.svgFilters===!0&&(Fi(eo,sv),Fi(Bs,iw),Fi(Bs,G3)),GO.mathMl===!0&&(Fi(eo,cM),Fi(Bs,q3),Fi(Bs,G3))),Xt.ADD_TAGS&&(eo===Cr&&(eo=Ab(eo)),Fi(eo,Xt.ADD_TAGS)),Xt.ADD_ATTR&&(Bs===Co&&(Bs=Ab(Bs)),Fi(Bs,Xt.ADD_ATTR)),Xt.ADD_URI_SAFE_ATTR&&Fi(FT,Xt.ADD_URI_SAFE_ATTR),Xt.FORBID_CONTENTS&&(KO===Z4&&(KO=Ab(KO)),Fi(KO,Xt.FORBID_CONTENTS)),qO&&(eo["#text"]=!0),ci&&Fi(eo,["html","head","body"]),eo.table&&(Fi(eo,["tbody"]),delete En.tbody),gd&&gd(Xt),Ov=Xt)},V4=Fi({},["mi","mo","mn","ms","mtext"]),W4=Fi({},["foreignobject","desc","title","annotation-xml"]),kZ=Fi({},["title","style","font","a","script"]),E1=Fi({},pd);Fi(E1,sv),Fi(E1,P8);var Rw=Fi({},cM);Fi(Rw,M8);var Mt=function(Xt){var So=Ot(Xt);(!So||!So.tagName)&&(So={namespaceURI:T1,tagName:"template"});var ws=j3(Xt.tagName),Sl=j3(So.tagName);return Xt.namespaceURI===cC?So.namespaceURI===T1?ws==="svg":So.namespaceURI===ZT?ws==="svg"&&(Sl==="annotation-xml"||V4[Sl]):Boolean(E1[ws]):Xt.namespaceURI===ZT?So.namespaceURI===T1?ws==="math":So.namespaceURI===cC?ws==="math"&&W4[Sl]:Boolean(Rw[ws]):Xt.namespaceURI===T1?So.namespaceURI===cC&&!W4[Sl]||So.namespaceURI===ZT&&!V4[Sl]?!1:!Rw[ws]&&(kZ[ws]||!E1[ws]):!1},Rt=function(Xt){zx(i.removed,{element:Xt});try{Xt.parentNode.removeChild(Xt)}catch{try{Xt.outerHTML=hn}catch{Xt.remove()}}},Rn=function(Xt,So){try{zx(i.removed,{attribute:So.getAttributeNode(Xt),from:So})}catch{zx(i.removed,{attribute:null,from:So})}if(So.removeAttribute(Xt),Xt==="is"&&!Bs[Xt])if($c||Qh)try{Rt(So)}catch{}else try{So.setAttribute(Xt,"")}catch{}},xn=function(Xt){var So,ws;if(Ei)Xt="<remove></remove>"+Xt;else{var Sl=iM(Xt,/^[\r\n\t ]+/);ws=Sl&&Sl[0]}vv==="application/xhtml+xml"&&(Xt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Xt+"</body></html>");var Pm=Pt?Pt.createHTML(Xt):Xt;if(uC===T1)try{So=new be().parseFromString(Pm,vv)}catch{}if(!So||!So.documentElement){So=$n.createDocument(uC,"template",null);try{So.documentElement.innerHTML=Mw?"":Pm}catch{}}var Gd=So.body||So.documentElement;return Xt&&ws&&Gd.insertBefore(m.createTextNode(ws),Gd.childNodes[0]||null),uC===T1?yn.call(So,ci?"html":"body")[0]:ci?So.documentElement:Gd},Io=function(Xt){return Lt.call(Xt.ownerDocument||Xt,Xt,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null,!1)},br=function(Xt){return Xt instanceof fe&&(typeof Xt.nodeName!="string"||typeof Xt.textContent!="string"||typeof Xt.removeChild!="function"||!(Xt.attributes instanceof ae)||typeof Xt.removeAttribute!="function"||typeof Xt.setAttribute!="function"||typeof Xt.namespaceURI!="string"||typeof Xt.insertBefore!="function")},ha=function(Xt){return $O(x)==="object"?Xt instanceof x:Xt&&$O(Xt)==="object"&&typeof Xt.nodeType=="number"&&typeof Xt.nodeName=="string"},Nc=function(Xt,So,ws){!Cs[Xt]||A8(Cs[Xt],function(Sl){Sl.call(i,So,ws,Ov)})},_u=function(Xt){var So;if(Nc("beforeSanitizeElements",Xt,null),br(Xt)||Nh(/[\u0080-\uFFFF]/,Xt.nodeName))return Rt(Xt),!0;var ws=Ib(Xt.nodeName);if(Nc("uponSanitizeElement",Xt,{tagName:ws,allowedTags:eo}),Xt.hasChildNodes()&&!ha(Xt.firstElementChild)&&(!ha(Xt.content)||!ha(Xt.content.firstElementChild))&&Nh(/<[/\w]/g,Xt.innerHTML)&&Nh(/<[/\w]/g,Xt.textContent)||ws==="select"&&Nh(/<template/i,Xt.innerHTML))return Rt(Xt),!0;if(!eo[ws]||En[ws]){if(!En[ws]&&XT(ws)&&(Mn.tagNameCheck instanceof RegExp&&Nh(Mn.tagNameCheck,ws)||Mn.tagNameCheck instanceof Function&&Mn.tagNameCheck(ws)))return!1;if(qO&&!KO[ws]){var Sl=Ot(Xt)||Xt.parentNode,Pm=gt(Xt)||Xt.childNodes;if(Pm&&Sl)for(var Gd=Pm.length,Vf=Gd-1;Vf>=0;--Vf)Sl.insertBefore(Me(Pm[Vf],!0),Ve(Xt))}return Rt(Xt),!0}return Xt instanceof M&&!Mt(Xt)||(ws==="noscript"||ws==="noembed")&&Nh(/<\/no(script|embed)/i,Xt.innerHTML)?(Rt(Xt),!0):(Us&&Xt.nodeType===3&&(So=Xt.textContent,So=IO(So,Ws," "),So=IO(So,Ir," "),Xt.textContent!==So&&(zx(i.removed,{element:Xt.cloneNode()}),Xt.textContent=So)),Nc("afterSanitizeElements",Xt,null),!1)},YT=function(Xt,So,ws){if(Dm&&(So==="id"||So==="name")&&(ws in m||ws in VT))return!1;if(!(Jr&&!jo[So]&&Nh(pi,So))){if(!(Ks&&Nh(fl,So))){if(!Bs[So]||jo[So]){if(!(XT(Xt)&&(Mn.tagNameCheck instanceof RegExp&&Nh(Mn.tagNameCheck,Xt)||Mn.tagNameCheck instanceof Function&&Mn.tagNameCheck(Xt))&&(Mn.attributeNameCheck instanceof RegExp&&Nh(Mn.attributeNameCheck,So)||Mn.attributeNameCheck instanceof Function&&Mn.attributeNameCheck(So))||So==="is"&&Mn.allowCustomizedBuiltInElements&&(Mn.tagNameCheck instanceof RegExp&&Nh(Mn.tagNameCheck,ws)||Mn.tagNameCheck instanceof Function&&Mn.tagNameCheck(ws))))return!1}else if(!FT[So]){if(!Nh(Pn,IO(ws,Oc,""))){if(!((So==="src"||So==="xlink:href"||So==="href")&&Xt!=="script"&&D8(ws,"data:")===0&&H4[Xt])){if(!(ho&&!Nh(Il,IO(ws,Oc,"")))){if(ws)return!1}}}}}}return!0},XT=function(Xt){return Xt.indexOf("-")>0},DN=function(Xt){var So,ws,Sl,Pm;Nc("beforeSanitizeAttributes",Xt,null);var Gd=Xt.attributes;if(!!Gd){var Vf={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Bs};for(Pm=Gd.length;Pm--;){So=Gd[Pm];var fC=So,vd=fC.name,xZ=fC.namespaceURI;ws=vd==="value"?So.value:BU(So.value),Sl=Ib(vd);var TZ=ws;if(Vf.attrName=Sl,Vf.attrValue=ws,Vf.keepAttr=!0,Vf.forceKeepAttr=void 0,Nc("uponSanitizeAttribute",Xt,Vf),ws=Vf.attrValue,!Vf.forceKeepAttr){if(!Vf.keepAttr){Rn(vd,Xt);continue}if(Nh(/\/>/i,ws)){Rn(vd,Xt);continue}Us&&(ws=IO(ws,Ws," "),ws=IO(ws,Ir," "));var Zte=Ib(Xt.nodeName);if(!YT(Zte,Sl,ws)){Rn(vd,Xt);continue}if(ws!==TZ)try{xZ?Xt.setAttributeNS(xZ,vd,ws):Xt.setAttribute(vd,ws)}catch{Rn(vd,Xt)}}}Nc("afterSanitizeAttributes",Xt,null)}},Qte=function Hs(Xt){var So,ws=Io(Xt);for(Nc("beforeSanitizeShadowDOM",Xt,null);So=ws.nextNode();)Nc("uponSanitizeShadowNode",So,null),!_u(So)&&(So.content instanceof p&&Hs(So.content),DN(So));Nc("afterSanitizeShadowDOM",Xt,null)};return i.sanitize=function(Hs,Xt){var So,ws,Sl,Pm,Gd;if(Mw=!Hs,Mw&&(Hs="<!-->"),typeof Hs!="string"&&!ha(Hs)){if(typeof Hs.toString!="function")throw aM("toString is not a function");if(Hs=Hs.toString(),typeof Hs!="string")throw aM("dirty is not a string, aborting")}if(!i.isSupported){if($O(n.toStaticHTML)==="object"||typeof n.toStaticHTML=="function"){if(typeof Hs=="string")return n.toStaticHTML(Hs);if(ha(Hs))return n.toStaticHTML(Hs.outerHTML)}return Hs}if(Ja||UT(Xt),i.removed=[],typeof Hs=="string"&&(Pw=!1),Pw){if(Hs.nodeName){var Vf=Ib(Hs.nodeName);if(!eo[Vf]||En[Vf])throw aM("root node is forbidden and cannot be sanitized in-place")}}else if(Hs instanceof x)So=xn("<!---->"),ws=So.ownerDocument.importNode(Hs,!0),ws.nodeType===1&&ws.nodeName==="BODY"||ws.nodeName==="HTML"?So=ws:So.appendChild(ws);else{if(!$c&&!Us&&!ci&&Hs.indexOf("<")===-1)return Pt&&qd?Pt.createHTML(Hs):Hs;if(So=xn(Hs),!So)return $c?null:qd?hn:""}So&&Ei&&Rt(So.firstChild);for(var fC=Io(Pw?Hs:So);Sl=fC.nextNode();)Sl.nodeType===3&&Sl===Pm||_u(Sl)||(Sl.content instanceof p&&Qte(Sl.content),DN(Sl),Pm=Sl);if(Pm=null,Pw)return Hs;if($c){if(Qh)for(Gd=Zt.call(So.ownerDocument);So.firstChild;)Gd.appendChild(So.firstChild);else Gd=So;return Bs.shadowroot&&(Gd=yo.call(c,Gd,!0)),Gd}var vd=ci?So.outerHTML:So.innerHTML;return ci&&eo["!doctype"]&&So.ownerDocument&&So.ownerDocument.doctype&&So.ownerDocument.doctype.name&&Nh(hM,So.ownerDocument.doctype.name)&&(vd="<!DOCTYPE "+So.ownerDocument.doctype.name+`>
|
|
`+vd),Us&&(vd=IO(vd,Ws," "),vd=IO(vd,Ir," ")),Pt&&qd?Pt.createHTML(vd):vd},i.setConfig=function(Hs){UT(Hs),Ja=!0},i.clearConfig=function(){Ov=null,Ja=!1},i.isValidAttribute=function(Hs,Xt,So){Ov||UT({});var ws=Ib(Hs),Sl=Ib(Xt);return YT(ws,Sl,So)},i.addHook=function(Hs,Xt){typeof Xt=="function"&&(Cs[Hs]=Cs[Hs]||[],zx(Cs[Hs],Xt))},i.removeHook=function(Hs){if(Cs[Hs])return IU(Cs[Hs])},i.removeHooks=function(Hs){Cs[Hs]&&(Cs[Hs]=[])},i.removeAllHooks=function(){Cs={}},i}var N8=K3();const gM=gn.each,I8=gn.trim,HU=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],zU={ftp:21,http:80,https:443,mailto:25},VU=["img","video"],WU=(n,i)=>Oe(n)?!n:Oe(i)?!kt(VU,i):!0,UU=n=>{try{return decodeURIComponent(n)}catch{return unescape(n)}},pM=(n,i,c)=>{const m=UU(i).replace(/\s/g,"");return n.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(m)?!0:n.allow_html_data_urls?!1:/^data:image\//i.test(m)?WU(n.allow_svg_data_urls,c)&&/^data:image\/svg\+xml/i.test(m):/^data:/i.test(m)};class b1{static parseDataUri(i){let c;const m=decodeURIComponent(i).split(","),p=/data:([^;]+)/.exec(m[0]);return p&&(c=p[1]),{type:c,data:m[1]}}static isDomSafe(i,c,m={}){if(m.allow_script_urls)return!0;{const p=sp.decode(i).replace(/[\s\u0000-\u001F]+/g,"");return!pM(m,p,c)}}static getDocumentBaseUrl(i){var c;let m;return i.protocol.indexOf("http")!==0&&i.protocol!=="file:"?m=(c=i.href)!==null&&c!==void 0?c:"":m=i.protocol+"//"+i.host+i.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(m)&&(m=m.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(m)||(m+="/")),m}constructor(i,c={}){this.path="",this.directory="",i=I8(i),this.settings=c;const m=c.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=(m&&m.protocol||"http")+"://mce_host"+i),!/^[\w\-]*:?\/\//.test(i)){const M=m?m.path:new b1(document.location.href).directory;if((m==null?void 0:m.protocol)==="")i="//mce_host"+p.toAbsPath(M,i);else{const B=/([^#?]*)([#?]?.*)/.exec(i);B&&(i=(m&&m.protocol||"http")+"://mce_host"+p.toAbsPath(M,B[1])+B[2])}}i=i.replace(/@@/g,"(mce_at)");const x=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(i);x&&gM(HU,(M,B)=>{let q=x[B];q&&(q=q.replace(/\(mce_at\)/g,"@@")),p[M]=q}),m&&(p.protocol||(p.protocol=m.protocol),p.userInfo||(p.userInfo=m.userInfo),!p.port&&p.host==="mce_host"&&(p.port=m.port),(!p.host||p.host==="mce_host")&&(p.host=m.host),p.source=""),w&&(p.protocol="")}setPath(i){const c=/^(.*?)\/?(\w+)?$/.exec(i);c&&(this.path=c[0],this.directory=c[1],this.file=c[2]),this.source="",this.getURI()}toRelative(i){if(i==="./")return i;const c=new b1(i,{base_uri:this});if(c.host!=="mce_host"&&this.host!==c.host&&c.host||this.port!==c.port||this.protocol!==c.protocol&&c.protocol!=="")return c.getURI();const m=this.getURI(),p=c.getURI();if(m===p||m.charAt(m.length-1)==="/"&&m.substr(0,m.length-1)===p)return m;let w=this.toRelPath(this.path,c.path);return c.query&&(w+="?"+c.query),c.anchor&&(w+="#"+c.anchor),w}toAbsolute(i,c){const m=new b1(i,{base_uri:this});return m.getURI(c&&this.isSameOrigin(m))}isSameOrigin(i){if(this.host==i.host&&this.protocol==i.protocol){if(this.port==i.port)return!0;const c=this.protocol?zU[this.protocol]:null;if(c&&(this.port||c)==(i.port||c))return!0}return!1}toRelPath(i,c){let m=0,p="",w,x;const M=i.substring(0,i.lastIndexOf("/")).split("/"),B=c.split("/");if(M.length>=B.length){for(w=0,x=M.length;w<x;w++)if(w>=B.length||M[w]!==B[w]){m=w+1;break}}if(M.length<B.length){for(w=0,x=B.length;w<x;w++)if(w>=M.length||M[w]!==B[w]){m=w+1;break}}if(m===1)return c;for(w=0,x=M.length-(m-1);w<x;w++)p+="../";for(w=m-1,x=B.length;w<x;w++)w!==m-1?p+="/"+B[w]:p+=B[w];return p}toAbsPath(i,c){let m=0;const p=/\/$/.test(c)?"/":"",w=i.split("/"),x=c.split("/"),M=[];gM(w,fe=>{fe&&M.push(fe)});const B=[];for(let fe=x.length-1;fe>=0;fe--)if(!(x[fe].length===0||x[fe]===".")){if(x[fe]===".."){m++;continue}if(m>0){m--;continue}B.push(x[fe])}const q=M.length-m;let ae;return q<=0?ae=Xs(B).join("/"):ae=M.slice(0,q).join("/")+"/"+Xs(B).join("/"),ae.indexOf("/")!==0&&(ae="/"+ae),p&&ae.lastIndexOf("/")!==ae.length-1&&(ae+=p),ae}getURI(i=!1){let c;return(!this.source||i)&&(c="",i||(this.protocol?c+=this.protocol+"://":c+="//",this.userInfo&&(c+=this.userInfo+"@"),this.host&&(c+=this.host),this.port&&(c+=":"+this.port)),this.path&&(c+=this.path),this.query&&(c+="?"+this.query),this.anchor&&(c+="#"+this.anchor),this.source=c),this.source}}const YU=gn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),bM="data-mce-type";let vM=0;const J3=(n,i,c,m)=>{var p,w,x,M;const B=i.validate,q=c.getSpecialElements();n.nodeType===Gu&&!i.allow_conditional_comments&&/^\[if/i.test((p=n.nodeValue)!==null&&p!==void 0?p:"")&&(n.nodeValue=" "+n.nodeValue);const ae=(w=m==null?void 0:m.tagName)!==null&&w!==void 0?w:n.nodeName.toLowerCase();if(n.nodeType!==qf||ae==="body")return;const fe=Ke.fromDom(n),be=qi(fe,bM),Le=Fl(fe,"data-mce-bogus");if(!be&&L(Le)){Le==="all"?wr(fe):Kl(fe);return}const Ye=c.getElementRule(ae);if(B&&!Ye){fn(q,ae)?wr(fe):Kl(fe);return}else Oe(m)&&(m.allowedTags[ae]=!0);if(B&&Ye&&!be){if(Ne((x=Ye.attributesForced)!==null&&x!==void 0?x:[],Me=>{Pr(fe,Me.name,Me.value==="{$uid}"?`mce_${vM++}`:Me.value)}),Ne((M=Ye.attributesDefault)!==null&&M!==void 0?M:[],Me=>{qi(fe,Me.name)||Pr(fe,Me.name,Me.value==="{$uid}"?`mce_${vM++}`:Me.value)}),Ye.attributesRequired&&!jt(Ye.attributesRequired,Me=>qi(fe,Me))){Kl(fe);return}if(Ye.removeEmptyAttrs&&fc(fe)){Kl(fe);return}Ye.outputName&&Ye.outputName!==ae&&h_(fe,Ye.outputName)}},OM=(n,i,c,m,p)=>!(m in YU&&pM(n,p,c))&&(!n.validate||i.isValid(c,m)||Ar(m,"data-")||Ar(m,"aria-")),yM=(n,i)=>n.hasAttribute(bM)&&(i==="id"||i==="class"||i==="style"),eA=(n,i)=>n in i.getBoolAttrs(),B8=(n,i,c)=>{const{attributes:m}=n;for(let p=m.length-1;p>=0;p--){const w=m[p],x=w.name,M=w.value;!OM(i,c,n.tagName.toLowerCase(),x,M)&&!yM(n,x)?n.removeAttribute(x):eA(x,c)&&n.setAttribute(x,x)}},L8=(n,i)=>{const c=N8();return c.addHook("uponSanitizeElement",(m,p)=>{J3(m,n,i,p)}),c.addHook("uponSanitizeAttribute",(m,p)=>{const w=m.tagName.toLowerCase(),{attrName:x,attrValue:M}=p;p.keepAttr=OM(n,i,w,x,M),p.keepAttr?(p.allowedAttributes[x]=!0,eA(x,i)&&(p.attrValue=x),n.allow_svg_data_urls&&Ar(M,"data:image/svg+xml")&&(p.forceKeepAttr=!0)):yM(m,x)&&(p.forceKeepAttr=!0)}),c},F8=(n,i)=>{const m={...{IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]}};return m.PARSER_MEDIA_TYPE=i,n.allow_script_urls?m.ALLOWED_URI_REGEXP=/.*/:n.allow_html_data_urls&&(m.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),m},Q8=(n,i)=>{if(n.sanitize){const c=L8(n,i);return(m,p)=>{c.sanitize(m,F8(n,p)),c.removed=[]}}else return(c,m)=>{const p=document.createNodeIterator(c,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let w;for(;w=p.nextNode();)J3(w,n,i),Jn(w)&&B8(w,n,i)}},Z8=gn.makeMap,tA=gn.extend,H8=(n,i,c)=>{const m=n.name,p=m in c&&m!=="title"&&m!=="textarea",w=i.childNodes;for(let x=0,M=w.length;x<M;x++){const B=w[x],q=new Xd(B.nodeName.toLowerCase(),B.nodeType);if(Jn(B)){const ae=B.attributes;for(let fe=0,be=ae.length;fe<be;fe++){const Le=ae[fe];q.attr(Le.name,Le.value)}}else _n(B)?(q.value=B.data,p&&(q.raw=!0)):(uh(B)||Xm(B)||Md(B))&&(q.value=B.data);H8(q,B,c),n.append(q)}},nA=(n,i,c)=>{const m=[];for(let p=n,w=p;p;w=p,p=p.walk()){const x=p;Ne(i,M=>M(x)),Re(x.parent)&&x!==n?p=w:m.push(x)}for(let p=m.length-1;p>=0;p--){const w=m[p];Ne(c,x=>x(w))}},XU=(n,i,c,m)=>{const p=c.validate,w=i.getNonEmptyElements(),x=i.getWhitespaceElements(),M=tA(Z8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),B=rd(i),q=/[ \t\r\n]+/g,ae=/^[ \t\r\n]+/,fe=/[ \t\r\n]+$/,be=Ot=>{let wt=Ot.parent;for(;Oe(wt);){if(wt.name in x)return!0;wt=wt.parent}return!1},Le=Ot=>{let wt=Ot;for(;Oe(wt);){if(wt.name in B)return kS(i,w,x,wt);wt=wt.parent}return!1},Ye=Ot=>Ot.name in M||rr(i,Ot),Me=(Ot,wt)=>{const Pt=wt?Ot.prev:Ot.next;return Oe(Pt)||Re(Ot.parent)?!1:Ye(Ot.parent)&&(Ot.parent!==n||m.isRootContent===!0)};return[Ot=>{var wt;if(Ot.type===3&&!be(Ot)){let Pt=(wt=Ot.value)!==null&&wt!==void 0?wt:"";Pt=Pt.replace(q," "),(NW(Ot.prev,Ye)||Me(Ot,!0))&&(Pt=Pt.replace(ae,"")),Pt.length===0?Ot.remove():Ot.value=Pt}},Ot=>{var wt;if(Ot.type===1){const Pt=i.getElementRule(Ot.name);if(p&&Pt){const hn=kS(i,w,x,Ot);Pt.paddInEmptyBlock&&hn&&Le(Ot)?Px(c,m,Ye,Ot):Pt.removeEmpty&&hn?Ye(Ot)?Ot.remove():Ot.unwrap():Pt.paddEmpty&&(hn||R3(Ot))&&Px(c,m,Ye,Ot)}}else if(Ot.type===3&&!be(Ot)){let Pt=(wt=Ot.value)!==null&&wt!==void 0?wt:"";(Ot.next&&Ye(Ot.next)||Me(Ot,!1))&&(Pt=Pt.replace(fe,"")),Pt.length===0?Ot.remove():Ot.value=Pt}}]},jU=(n,i)=>{var c;const m=(c=i.forced_root_block)!==null&&c!==void 0?c:n.forced_root_block;return m===!1?"":m===!0?"p":m},$S=(n={},i=wh())=>{const c=J5(),m=J5(),p={validate:!0,root_name:"body",sanitize:!0,...n},w=new DOMParser,x=Q8(p,i),M=(wt,Pt,hn="html")=>{const Hn=hn==="xhtml"?"application/xhtml+xml":"text/html",$n=fn(i.getSpecialElements(),Pt.toLowerCase()),Lt=$n?`<${Pt}>${wt}</${Pt}>`:wt,Zt=hn==="xhtml"?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${Lt}</body></html>`:`<body>${Lt}</body>`,yn=w.parseFromString(Zt,Hn).body;return x(yn,Hn),$n?yn.firstChild:yn},B=c.addFilter,q=c.getFilters,ae=c.removeFilter,fe=m.addFilter,be=m.getFilters,Le=m.removeFilter,Ye=(wt,Pt)=>{$B(i,wt)&&Pt.push(wt)},Me=(wt,Pt)=>{const hn=L(Pt.attr(bM)),Hn=Pt.type===1&&!fn(wt,Pt.name)&&!rr(i,Pt);return Pt.type===3||Hn&&!hn},Ve=(wt,Pt)=>{const hn=tA(Z8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),Hn=/^[ \t\r\n]+/,$n=/[ \t\r\n]+$/;let Lt=wt.firstChild,Zt=null;const yn=yo=>{var Do,Cs;yo&&(Lt=yo.firstChild,Lt&&Lt.type===3&&(Lt.value=(Do=Lt.value)===null||Do===void 0?void 0:Do.replace(Hn,"")),Lt=yo.lastChild,Lt&&Lt.type===3&&(Lt.value=(Cs=Lt.value)===null||Cs===void 0?void 0:Cs.replace($n,"")))};if(!!i.isValidChild(wt.name,Pt.toLowerCase())){for(;Lt;){const yo=Lt.next;Me(hn,Lt)?(Zt||(Zt=new Xd(Pt,1),Zt.attr(p.forced_root_block_attrs),wt.insert(Zt,Lt)),Zt.append(Lt)):(yn(Zt),Zt=null),Lt=yo}yn(Zt)}},Ot={schema:i,addAttributeFilter:fe,getAttributeFilters:be,removeAttributeFilter:Le,addNodeFilter:B,getNodeFilters:q,removeNodeFilter:ae,parse:(wt,Pt={})=>{var hn;const Hn=p.validate,$n=(hn=Pt.context)!==null&&hn!==void 0?hn:p.root_name,Lt=M(wt,$n,Pt.format);d0(i,Lt);const Zt=new Xd($n,11);H8(Zt,Lt,i.getSpecialElements()),Lt.innerHTML="";const[yn,yo]=XU(Zt,i,p,Pt),Do=[],Cs=Hn?fl=>Ye(fl,Do):ot,Ws={nodes:{},attributes:{}},Ir=fl=>MW(q(),be(),fl,Ws);if(nA(Zt,[yn,Ir],[yo,Cs]),Do.reverse(),Hn&&Do.length>0)if(Pt.context){const{pass:fl,fail:Il}=bn(Do,Oc=>Oc.parent===Zt);x5(Il,i,Zt,Ir),Pt.invalid=fl.length>0}else x5(Do,i,Zt,Ir);const pi=jU(p,Pt);return pi&&(Zt.name==="body"||Pt.isRootContent)&&Ve(Zt,pi),Pt.invalid||M3(Ws,Pt),Zt}};return k8(Ot,p),xU(Ot,p,i),Ot},z8=n=>L3(n)?Y2({validate:!1}).serialize(n):n,wM=(n,i,c)=>{const m=z8(n),p=i(m);if(p.isDefaultPrevented())return p;if(L3(n))if(p.content!==m){const w=$S({validate:!1,forced_root_block:!1,sanitize:c}).parse(p.content,{context:n.name});return{...p,content:w}}else return{...p,content:n};else return p},V8=(n,i)=>{if(i.no_events)return bc.value(i);{const c=Op(n,i);return c.isDefaultPrevented()?bc.error(_P(n,{content:"",...c}).content):bc.value(c)}},W8=(n,i,c)=>c.no_events?i:wM(i,p=>_P(n,{...c,content:p}),cO(n)).content,_M=(n,i)=>{if(i.no_events)return bc.value(i);{const c=wM(i.content,m=>Kc(n,{...i,content:m}),cO(n));return c.isDefaultPrevented()?(wu(n,c),bc.error(void 0)):bc.value(c)}},SM=(n,i,c)=>{c.no_events||wu(n,{...c,content:i})},CM=(n,i,c)=>({element:n,width:i,rows:c}),kM=(n,i)=>({element:n,cells:i}),Eie=(n,i)=>({x:n,y:i}),U8=(n,i)=>Va(n,i).bind(ou).getOr(1),qU=(n,i,c,m,p)=>{const w=U8(p,"rowspan"),x=U8(p,"colspan"),M=n.rows;for(let B=c;B<c+w;B++){M[B]||(M[B]=kM(pc(m),[]));for(let q=i;q<i+x;q++){const ae=M[B].cells;ae[q]=B===c&&q===i?p:ug(p)}}},GU=(n,i,c)=>{const m=n.rows;return!!(m[c]?m[c].cells:[])[i]},KU=(n,i,c)=>{for(;GU(n,i,c);)i++;return i},Y8=n=>zn(n,(i,c)=>c.cells.length>i?c.cells.length:i,0),X8=(n,i)=>{const c=n.rows;for(let m=0;m<c.length;m++){const p=c[m].cells;for(let w=0;w<p.length;w++)if(vt(p[w],i))return he.some(Eie(w,m))}return he.none()},j8=(n,i,c,m,p)=>{const w=[],x=n.rows;for(let M=c;M<=p;M++){const B=x[M].cells,q=i<m?B.slice(i,m+1):B.slice(m,i+1);w.push(kM(x[M].element,q))}return w},q8=(n,i,c)=>{const m=i.x,p=i.y,w=c.x,x=c.y,M=p<x?j8(n,m,p,w,x):j8(n,m,x,w,p);return CM(n.element,Y8(M),M)},JU=(n,i)=>{const c=ug(n.element),m=Ke.fromTag("tbody");return ni(m,i),na(c,m),c},eY=n=>pt(n.rows,i=>{const c=pt(i.cells,p=>{const w=pc(p);return Vi(w,"colspan"),Vi(w,"rowspan"),w}),m=ug(i.element);return ni(m,c),m}),tY=n=>{const i=CM(ug(n),0,[]);return Ne(pl(n,"tr"),(c,m)=>{Ne(pl(c,"td,th"),(p,w)=>{qU(i,KU(i,w,m),m,c,p)})}),CM(i.element,Y8(i.rows),i.rows)},nY=n=>JU(n,eY(n)),oY=(n,i,c)=>X8(n,i).bind(m=>X8(n,c).map(p=>q8(n,m,p))),Aie=n=>oo(n,i=>ti(i)==="ul"||ti(i)==="ol"),Die=(n,i)=>oo(n,c=>ti(c)==="li"&&wO(c,i)).fold(Qe([]),c=>Aie(n).map(m=>{const p=Ke.fromTag(ti(m)),w=Wt(nm(m),(x,M)=>Ar(M,"list-style"));return ua(p,w),[Ke.fromTag("li"),p]}).getOr([])),sY=(n,i)=>{const c=zn(i,(m,p)=>(na(p,m),p),n);return i.length>0?W0([c]):c},rY=n=>ja(n)?fi(n).filter(Bu).fold(Qe([]),i=>[n,i]):Bu(n)?[n]:[],Pie=(n,i)=>{const c=Ke.fromDom(i.commonAncestorContainer),m=G0(c,n),p=At(m,Ho),w=Die(m,i),x=p.concat(w.length?w:rY(c));return pt(x,ug)},G8=()=>W0([]),ul=(n,i)=>sY(Ke.fromDom(i.cloneContents()),Pie(n,i)),xM=(n,i)=>Se(i,"table",He(vt,n)),Mie=(n,i)=>xM(n,i[0]).bind(c=>{const m=i[0],p=i[i.length-1],w=tY(c);return oY(w,m,p).map(x=>W0([nY(x)]))}).getOrThunk(G8),iY=(n,i)=>i.length>0&&i[0].collapsed?G8():ul(n,i[0]),aY=(n,i)=>{const c=A2(i,n);return c.length>0?Mie(n,c):iY(n,i)},rv=(n,i)=>i>=0&&i<n.length&&Dh(n.charAt(i)),lY=n=>In(n.innerText),Rie=n=>n.map(i=>i.nodeName).getOr("div").toLowerCase(),Yu=n=>he.from(n.selection.getRng()).map(i=>{var c;const m=he.from(n.dom.getParent(i.commonAncestorContainer,n.dom.isBlock)),p=n.getBody(),w=Rie(m),x=Ke.fromDom(i.cloneContents());p3(x),HI(x);const M=n.dom.add(p,w,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},x.dom),B=lY(M),q=In((c=M.textContent)!==null&&c!==void 0?c:"");if(n.dom.remove(M),rv(q,0)||rv(q,q.length-1)){const ae=m.getOr(p),fe=lY(ae),be=fe.indexOf(B);if(be===-1)return B;{const Le=rv(fe,be-1),Ye=rv(fe,be+B.length);return(Le?" ":"")+B+(Ye?" ":"")}}else return B}).getOr(""),K8=(n,i)=>{const c=n.selection.getRng(),m=n.dom.create("body"),p=n.selection.getSel(),w=m3(n,Wk(p)),x=i.contextual?aY(Ke.fromDom(n.getBody()),w).dom:c.cloneContents();return x&&m.appendChild(x),n.selection.serializer.serialize(m,i)},J8=(n,i)=>{if(i.format==="text")return Yu(n);{const c=K8(n,i);return i.format==="tree"?c:n.selection.isCollapsed()?"":c}},eL=(n,i)=>({...n,format:i,get:!0,selection:!0,getInner:!0}),cY=(n,i,c={})=>{const m=eL(c,i);return V8(n,m).fold(Bt,p=>{const w=J8(n,p);return W8(n,w,p)})},TM=0,Vx=1,tL=2,EM=(n,i)=>{const c=n.length+i.length+2,m=new Array(c),p=new Array(c),w=(ae,fe,be)=>({start:ae,end:fe,diag:be}),x=(ae,fe,be,Le,Ye)=>{const Me=B(ae,fe,be,Le);if(Me===null||Me.start===fe&&Me.diag===fe-Le||Me.end===ae&&Me.diag===ae-be){let Ve=ae,gt=be;for(;Ve<fe||gt<Le;)Ve<fe&><Le&&n[Ve]===i[gt]?(Ye.push([TM,n[Ve]]),++Ve,++gt):fe-ae>Le-be?(Ye.push([tL,n[Ve]]),++Ve):(Ye.push([Vx,i[gt]]),++gt)}else{x(ae,Me.start,be,Me.start-Me.diag,Ye);for(let Ve=Me.start;Ve<Me.end;++Ve)Ye.push([TM,n[Ve]]);x(Me.end,fe,Me.end-Me.diag,Le,Ye)}},M=(ae,fe,be,Le)=>{let Ye=ae;for(;Ye-fe<Le&&Ye<be&&n[Ye]===i[Ye-fe];)++Ye;return w(ae,Ye,fe)},B=(ae,fe,be,Le)=>{const Ye=fe-ae,Me=Le-be;if(Ye===0||Me===0)return null;const Ve=Ye-Me,gt=Me+Ye,Ot=(gt%2===0?gt:gt+1)/2;m[1+Ot]=ae,p[1+Ot]=fe+1;let wt,Pt,hn,Hn,$n;for(wt=0;wt<=Ot;++wt){for(Pt=-wt;Pt<=wt;Pt+=2){for(hn=Pt+Ot,Pt===-wt||Pt!==wt&&m[hn-1]<m[hn+1]?m[hn]=m[hn+1]:m[hn]=m[hn-1]+1,Hn=m[hn],$n=Hn-ae+be-Pt;Hn<fe&&$n<Le&&n[Hn]===i[$n];)m[hn]=++Hn,++$n;if(Ve%2!==0&&Ve-wt<=Pt&&Pt<=Ve+wt&&p[hn-Ve]<=m[hn])return M(p[hn-Ve],Pt+ae-be,fe,Le)}for(Pt=Ve-wt;Pt<=Ve+wt;Pt+=2){for(hn=Pt+Ot-Ve,Pt===Ve-wt||Pt!==Ve+wt&&p[hn+1]<=p[hn-1]?p[hn]=p[hn+1]-1:p[hn]=p[hn-1],Hn=p[hn]-1,$n=Hn-ae+be-Pt;Hn>=ae&&$n>=be&&n[Hn]===i[$n];)p[hn]=Hn--,$n--;if(Ve%2===0&&-wt<=Pt&&Pt<=wt&&p[hn]<=m[hn+Ve])return M(p[hn],Pt+ae-be,fe,Le)}}return null},q=[];return x(0,n.length,0,i.length,q),q},nL=n=>Jn(n)?n.outerHTML:_n(n)?sp.encodeRaw(n.data,!1):uh(n)?"<!--"+n.data+"-->":"",oL=n=>{let i;const c=document.createElement("div"),m=document.createDocumentFragment();for(n&&(c.innerHTML=n);i=c.firstChild;)m.appendChild(i);return m},sL=(n,i,c)=>{const m=oL(i);if(n.hasChildNodes()&&c<n.childNodes.length){const p=n.childNodes[c];n.insertBefore(m,p)}else n.appendChild(m)},AM=(n,i)=>{if(n.hasChildNodes()&&i<n.childNodes.length){const c=n.childNodes[i];n.removeChild(c)}},rL=(n,i)=>{let c=0;Ne(n,m=>{m[0]===TM?c++:m[0]===Vx?(sL(i,m[1],c),c++):m[0]===tL&&AM(i,c)})},DM=n=>At(pt(Rr(n.childNodes),nL),i=>i.length>0),uY=(n,i)=>{const c=pt(Rr(i.childNodes),nL);return rL(EM(c,n),i),i},fY=Ut(()=>document.implementation.createHTMLDocument("undo")),dY=n=>n.indexOf("</iframe>")!==-1,Eg=n=>({type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}),hY=n=>({type:"complete",fragments:null,content:n,bookmark:null,beforeBookmark:null}),oA=n=>{const i=DM(n.getBody()),c=$s(i,p=>{const w=XP(n.serializer,p);return w.length>0?[w]:[]}),m=c.join("");return dY(m)?Eg(c):hY(m)},PM=(n,i,c)=>{const m=c?i.beforeBookmark:i.bookmark;i.type==="fragmented"?uY(i.fragments,n.getBody()):n.setContent(i.content,{format:"raw",no_selection:Oe(m)&&l1(m)?!m.isFakeCaret:!0}),m&&(n.selection.moveToBookmark(m),n.selection.scrollIntoView())},MM=n=>n.type==="fragmented"?n.fragments.join(""):n.content,iL=n=>{const i=Ke.fromTag("body",fY());return Mf(i,MM(n)),Ne(pl(i,"*[data-mce-bogus]"),Kl),Ae(i)},aL=(n,i)=>MM(n)===MM(i),mY=(n,i)=>iL(n)===iL(i),RM=(n,i)=>!n||!i?!1:aL(n,i)?!0:mY(n,i),$M=n=>n.get()===0,aw=(n,i,c)=>{$M(c)&&(n.typing=i)},lL=(n,i)=>{n.typing&&(aw(n,!1,i),n.add())},gY=n=>{n.typing&&(n.typing=!1,n.add())},cL=(n,i,c)=>{$M(i)&&c.set(bu(n.selection))},NM=(n,i,c,m,p,w,x)=>{const M=oA(n),B=gn.extend(w||{},M);if(!$M(m)||n.removed)return null;const q=i.data[c.get()];if(n.dispatch("BeforeAddUndo",{level:B,lastLevel:q,originalEvent:x}).isDefaultPrevented()||q&&RM(q,B))return null;i.data[c.get()]&&p.get().each(be=>{i.data[c.get()].beforeBookmark=be});const ae=h2(n);if(ae&&i.data.length>ae){for(let be=0;be<i.data.length-1;be++)i.data[be]=i.data[be+1];i.data.length--,c.set(i.data.length)}B.bookmark=bu(n.selection),c.get()<i.data.length-1&&(i.data.length=c.get()+1),i.data.push(B),c.set(i.data.length-1);const fe={level:B,lastLevel:q,originalEvent:x};return c.get()>0?(n.setDirty(!0),n.dispatch("AddUndo",fe),n.dispatch("change",fe)):n.dispatch("AddUndo",fe),B},pY=(n,i,c)=>{i.data=[],c.set(0),i.typing=!1,n.dispatch("ClearUndos")},bY=(n,i,c,m,p)=>{if(i.transact(m)){const w=i.data[c.get()].bookmark,x=i.data[c.get()-1];PM(n,x,!0),i.transact(p)&&(i.data[c.get()-1].beforeBookmark=w)}},$ie=(n,i,c)=>{let m;return i.get()<c.length-1&&(i.set(i.get()+1),m=c[i.get()],PM(n,m,!1),n.setDirty(!0),n.dispatch("Redo",{level:m})),m},vY=(n,i,c,m)=>{let p;return i.typing&&(i.add(),i.typing=!1,aw(i,!1,c)),m.get()>0&&(m.set(m.get()-1),p=i.data[m.get()],PM(n,p,!0),n.setDirty(!0),n.dispatch("Undo",{level:p})),p},OY=n=>{n.clear(),n.add()},uL=(n,i,c)=>c.get()>0||i.typing&&i.data[0]&&!RM(oA(n),i.data[0]),fL=(n,i)=>i.get()<n.data.length-1&&!n.typing,yY=(n,i,c)=>(lL(n,i),n.beforeChange(),n.ignore(c),n.add()),lw=(n,i)=>{try{n.set(n.get()+1),i()}finally{n.set(n.get()-1)}},NS=(n,i)=>{const c=n.dom,m=Oe(i)?i:n.getBody();Ne(c.select("table,a",m),p=>{switch(p.nodeName){case"TABLE":const w=iO(n),x=c.getAttrib(p,"border");(!x||x==="0")&&n.hasVisual?c.addClass(p,w):c.removeClass(p,w);break;case"A":if(!c.getAttrib(p,"href")){const M=c.getAttrib(p,"name")||p.id,B=R0(n);M&&n.hasVisual?c.addClass(p,B):c.removeClass(p,B)}break}}),n.dispatch("VisualAid",{element:i,hasVisual:n.hasVisual})},IS=n=>({init:{bindEvents:ot},undoManager:{beforeChange:(i,c)=>cL(n,i,c),add:(i,c,m,p,w,x)=>NM(n,i,c,m,p,w,x),undo:(i,c,m)=>vY(n,i,c,m),redo:(i,c)=>$ie(n,i,c),clear:(i,c)=>pY(n,i,c),reset:i=>OY(i),hasUndo:(i,c)=>uL(n,i,c),hasRedo:(i,c)=>fL(i,c),transact:(i,c,m)=>yY(i,c,m),ignore:(i,c)=>lw(i,c),extra:(i,c,m,p)=>bY(n,i,c,m,p)},formatter:{match:(i,c,m,p)=>I5(n,i,c,m,p),matchAll:(i,c)=>ew(n,i,c),matchNode:(i,c,m,p)=>$h(n,i,c,m,p),canApply:i=>MO(n,i),closest:i=>JW(n,i),apply:(i,c,m)=>wU(n,i,c,m),remove:(i,c,m,p)=>f8(n,i,c,m,p),toggle:(i,c,m)=>MS(n,i,c,m),formatChanged:(i,c,m,p,w)=>PS(n,i,c,m,p,w)},editor:{getContent:i=>oW(n,i),setContent:(i,c)=>KW(n,i,c),insertContent:(i,c)=>UB(n,i,c),addVisual:i=>NS(n,i)},selection:{getContent:(i,c)=>cY(n,i,c)},autocompleter:{addDecoration:i=>YV(n,i),removeDecoration:()=>jV(n,Ke.fromDom(n.getBody()))},raw:{getModel:()=>he.none()}}),dL=n=>{const i=q=>te(q)?q:{},{init:c,undoManager:m,formatter:p,editor:w,selection:x,autocompleter:M,raw:B}=n;return{init:{bindEvents:c.bindEvents},undoManager:{beforeChange:m.beforeChange,add:m.add,undo:m.undo,redo:m.redo,clear:m.clear,reset:m.reset,hasUndo:m.hasUndo,hasRedo:m.hasRedo,transact:(q,ae,fe)=>m.transact(fe),ignore:(q,ae)=>m.ignore(ae),extra:(q,ae,fe,be)=>m.extra(fe,be)},formatter:{match:(q,ae,fe,be)=>p.match(q,i(ae),be),matchAll:p.matchAll,matchNode:p.matchNode,canApply:q=>p.canApply(q),closest:q=>p.closest(q),apply:(q,ae,fe)=>p.apply(q,i(ae)),remove:(q,ae,fe,be)=>p.remove(q,i(ae)),toggle:(q,ae,fe)=>p.toggle(q,i(ae)),formatChanged:(q,ae,fe,be,Le)=>p.formatChanged(ae,fe,be,Le)},editor:{getContent:q=>w.getContent(q),setContent:(q,ae)=>({content:w.setContent(q,ae),html:""}),insertContent:(q,ae)=>(w.insertContent(q),""),addVisual:w.addVisual},selection:{getContent:(q,ae)=>x.getContent(ae)},autocompleter:{addDecoration:M.addDecoration,removeDecoration:M.removeDecoration},raw:{getModel:()=>he.some(B.getRawModel())}}},hL=()=>{const n=Qe(null),i=Qe("");return{init:{bindEvents:ot},undoManager:{beforeChange:ot,add:n,undo:n,redo:n,clear:ot,reset:ot,hasUndo:je,hasRedo:je,transact:n,ignore:ot,extra:ot},formatter:{match:je,matchAll:Qe([]),matchNode:Qe(void 0),canApply:je,closest:i,apply:ot,remove:ot,toggle:ot,formatChanged:Qe({unbind:ot})},editor:{getContent:i,setContent:Qe({content:"",html:""}),insertContent:Qe(""),addVisual:ot},selection:{getContent:i},autocompleter:{addDecoration:ot,removeDecoration:ot},raw:{getModel:Qe(he.none())}}},Mb=n=>fn(n.plugins,"rtc"),mL=n=>wo(n.plugins,"rtc").bind(i=>he.from(i.setup)),wY=n=>{const i=n;return mL(n).fold(()=>(i.rtcInstance=IS(n),he.none()),c=>(i.rtcInstance=hL(),he.some(()=>c().then(m=>(i.rtcInstance=dL(m),m.rtc.isRemote)))))},IM=n=>n.rtcInstance?n.rtcInstance:IS(n),ic=n=>{const i=n.rtcInstance;if(i)return i;throw new Error("Failed to get RTC instance not yet initialized.")},_Y=(n,i,c)=>{ic(n).undoManager.beforeChange(i,c)},gL=(n,i,c,m,p,w,x)=>ic(n).undoManager.add(i,c,m,p,w,x),SY=(n,i,c,m)=>ic(n).undoManager.undo(i,c,m),CY=(n,i,c)=>ic(n).undoManager.redo(i,c),Wx=(n,i,c)=>{ic(n).undoManager.clear(i,c)},pL=(n,i)=>{ic(n).undoManager.reset(i)},bL=(n,i,c)=>ic(n).undoManager.hasUndo(i,c),kY=(n,i,c)=>ic(n).undoManager.hasRedo(i,c),xY=(n,i,c,m)=>ic(n).undoManager.transact(i,c,m),TY=(n,i,c)=>{ic(n).undoManager.ignore(i,c)},vL=(n,i,c,m,p)=>{ic(n).undoManager.extra(i,c,m,p)},EY=(n,i,c,m,p)=>ic(n).formatter.match(i,c,m,p),AY=(n,i,c)=>ic(n).formatter.matchAll(i,c),DY=(n,i,c,m,p)=>ic(n).formatter.matchNode(i,c,m,p),PY=(n,i)=>ic(n).formatter.canApply(i),Nie=(n,i)=>ic(n).formatter.closest(i),v1=(n,i,c,m)=>{ic(n).formatter.apply(i,c,m)},BM=(n,i,c,m,p)=>{ic(n).formatter.remove(i,c,m,p)},MY=(n,i,c,m)=>{ic(n).formatter.toggle(i,c,m)},RY=(n,i,c,m,p,w)=>ic(n).formatter.formatChanged(i,c,m,p,w),$Y=(n,i)=>IM(n).editor.getContent(i),NY=(n,i,c)=>IM(n).editor.setContent(i,c),si=(n,i,c)=>IM(n).editor.insertContent(i,c),Iie=(n,i,c)=>ic(n).selection.getContent(i,c),IY=(n,i)=>ic(n).editor.addVisual(i),OL=n=>ic(n).init.bindEvents(),Ka=(n,i)=>ic(n).autocompleter.addDecoration(i),BY=n=>ic(n).autocompleter.removeDecoration(),Ux=(n,i={})=>{const c=i.format?i.format:"html";return Iie(n,c,i)},yL=n=>n.dom.length===0?(wr(n),he.none()):he.some(n),LY=(n,i)=>n.filter(c=>_O.isBookmarkNode(c.dom)).bind(i?Td:Sa),FY=(n,i,c,m)=>{const p=n.dom,w=i.dom,x=m?p.length:w.length;m?(_3(p,w,!1,!m),c.setStart(w,x)):(_3(w,p,!1,!m),c.setEnd(w,x))},wL=(n,i)=>{fi(n).each(c=>{const m=n.dom;i&&Ox(c,Vt(m,0))?wx(m,0):!i&&yx(c,Vt(m,m.length))&&w3(m,m.length)})},iv=(n,i,c,m)=>{n.bind(p=>((m?w3:wx)(p.dom,m?p.dom.length:0),i.filter(sl).map(x=>FY(p,x,c,m)))).orThunk(()=>LY(i,m).or(i).filter(sl).map(w=>wL(w,m)))},Ih=(n,i)=>{const c=he.from(i.firstChild).map(Ke.fromDom),m=he.from(i.lastChild).map(Ke.fromDom);n.deleteContents(),n.insertNode(i);const p=c.bind(Sa).filter(sl).bind(yL),w=m.bind(Td).filter(sl).bind(yL);iv(p,c,n,!0),iv(w,m,n,!1),n.collapse(!1)},Yx=(n,i)=>({format:"html",...n,set:!0,selection:!0,content:i}),BO=(n,i)=>{if(i.format!=="raw"){const c=n.selection.getRng(),m=n.dom.getParent(c.commonAncestorContainer,n.dom.isBlock),p=m?{context:m.nodeName.toLowerCase()}:{},w=n.parser.parse(i.content,{forced_root_block:!1,...p,...i});return Y2({validate:!1},n.schema).serialize(w)}else return i.content},Rb=(n,i,c={})=>{const m=Yx(c,i);_M(n,m).each(p=>{const w=BO(n,p),x=n.selection.getRng();Ih(x,x.createContextualFragment(w)),n.selection.setRng(x),Of(n,x),SM(n,w,p)})},BS=(n,i,c)=>{if(fn(n,i)){const m=At(n[i],p=>p!==c);m.length===0?delete n[i]:n[i]=m}};var LM=(n,i)=>{let c,m;const p=(M,B)=>oo(B,q=>n.is(q,M)),w=M=>n.getParents(M,void 0,n.getRoot()),x=()=>{c={},m={},i.on("NodeChange",M=>{const B=M.element,q=w(B),ae={};ln(c,(fe,be)=>{p(be,q).each(Le=>{m[be]||(Ne(fe,Ye=>{Ye(!0,{node:Le,selector:be,parents:q})}),m[be]=fe),ae[be]=fe})}),ln(m,(fe,be)=>{ae[be]||(delete m[be],Ne(fe,Le=>{Le(!1,{node:B,selector:be,parents:q})}))})})};return{selectorChangedWithUnbind:(M,B)=>(c||x(),c[M]||(c[M]=[]),c[M].push(B),p(M,w(i.selection.getStart())).each(()=>{m[M]=c[M]}),{unbind:()=>{BS(c,M,B),BS(m,M,B)}})}};const sA=n=>!!(n&&n.ownerDocument)&&cn(Ke.fromDom(n.ownerDocument),Ke.fromDom(n)),_L=n=>n?sA(n.startContainer)&&sA(n.endContainer):!1,FM=(n,i,c,m)=>{let p,w;const{selectorChangedWithUnbind:x}=LM(n,m),M=(Pn,eo)=>{const Cr=n.createRng();Oe(Pn)&&Oe(eo)?(Cr.setStart(Pn,eo),Cr.setEnd(Pn,eo),Pt(Cr),gt(!1)):(Xk(n,Cr,m.getBody(),!0),Pt(Cr))},B=Pn=>Ux(m,Pn),q=(Pn,eo)=>Rb(m,Pn,eo),ae=Pn=>PI(m.getBody(),wt(),Pn),fe=Pn=>MI(m.getBody(),wt(),Pn),be=(Pn,eo)=>Il.getBookmark(Pn,eo),Le=Pn=>Il.moveToBookmark(Pn),Ye=(Pn,eo)=>(QV(n,Pn,eo).each(Pt),Pn),Me=()=>{const Pn=wt(),eo=Ot();return!Pn||Pn.item?!1:Pn.compareEndPoints?Pn.compareEndPoints("StartToEnd",Pn)===0:!eo||Pn.collapsed},Ve=()=>{const Pn=wt(),eo=m.getBody().querySelectorAll('[data-mce-selected="1"]');return eo.length>0?tr(eo,Cr=>n.isEditable(Cr.parentElement)):Pn.startContainer===Pn.endContainer?n.isEditable(Pn.startContainer):n.isEditable(Pn.startContainer)&&n.isEditable(Pn.endContainer)},gt=Pn=>{const eo=wt();eo.collapse(!!Pn),Pt(eo)},Ot=()=>i.getSelection?i.getSelection():i.document.selection,wt=()=>{let Pn;const eo=(Bs,Co,Mn)=>{try{return Co.compareBoundaryPoints(Bs,Mn)}catch{return-1}},Cr=i.document;if(Oe(m.bookmark)&&!U2(m)){const Bs=l3(m);if(Bs.isSome())return Bs.map(Co=>m3(m,[Co])[0]).getOr(Cr.createRange())}try{const Bs=Ot();Bs&&!Dd(Bs.anchorNode)&&(Bs.rangeCount>0?Pn=Bs.getRangeAt(0):Pn=Cr.createRange(),Pn=m3(m,[Pn])[0])}catch{}if(Pn||(Pn=Cr.createRange()),of(Pn.startContainer)&&Pn.collapsed){const Bs=n.getRoot();Pn.setStart(Bs,0),Pn.setEnd(Bs,0)}return p&&w&&(eo(Pn.START_TO_START,Pn,p)===0&&eo(Pn.END_TO_END,Pn,p)===0?Pn=w:(p=null,w=null)),Pn},Pt=(Pn,eo)=>{if(!_L(Pn))return;const Cr=Ot();if(Pn=m.dispatch("SetSelectionRange",{range:Pn,forward:eo}).range,Cr){w=Pn;try{Cr.removeAllRanges(),Cr.addRange(Pn)}catch{}eo===!1&&Cr.extend&&(Cr.collapse(Pn.endContainer,Pn.endOffset),Cr.extend(Pn.startContainer,Pn.startOffset)),p=Cr.rangeCount>0?Cr.getRangeAt(0):null}if(!Pn.collapsed&&Pn.startContainer===Pn.endContainer&&(Cr==null?void 0:Cr.setBaseAndExtent)&&Pn.endOffset-Pn.startOffset<2&&Pn.startContainer.hasChildNodes()){const Co=Pn.startContainer.childNodes[Pn.startOffset];Co&&Co.nodeName==="IMG"&&(Cr.setBaseAndExtent(Pn.startContainer,Pn.startOffset,Pn.endContainer,Pn.endOffset),(Cr.anchorNode!==Pn.startContainer||Cr.focusNode!==Pn.endContainer)&&Cr.setBaseAndExtent(Co,0,Co,1))}m.dispatch("AfterSetSelectionRange",{range:Pn,forward:eo})},hn=Pn=>(q(n.getOuterHTML(Pn)),Pn),Hn=()=>FV(m.getBody(),wt()),$n=(Pn,eo)=>$I(n,wt(),Pn,eo),Lt=()=>{const Pn=Ot(),eo=Pn==null?void 0:Pn.anchorNode,Cr=Pn==null?void 0:Pn.focusNode;if(!Pn||!eo||!Cr||Dd(eo)||Dd(Cr))return!0;const Bs=n.createRng(),Co=n.createRng();try{Bs.setStart(eo,Pn.anchorOffset),Bs.collapse(!0),Co.setStart(Cr,Pn.focusOffset),Co.collapse(!0)}catch{return!0}return Bs.compareBoundaryPoints(Bs.START_TO_START,Co)<=0},fl={dom:n,win:i,serializer:c,editor:m,expand:(Pn={type:"word"})=>Pt(O(n).expand(wt(),Pn)),collapse:gt,setCursorLocation:M,getContent:B,setContent:q,getBookmark:be,moveToBookmark:Le,select:Ye,isCollapsed:Me,isEditable:Ve,isForward:Lt,setNode:hn,getNode:Hn,getSel:Ot,setRng:Pt,getRng:wt,getStart:ae,getEnd:fe,getSelectedBlocks:$n,normalize:()=>{const Pn=wt(),eo=Ot();if(!BE(eo)&&K_(m)){const Cr=mS(n,Pn);return Cr.each(Bs=>{Pt(Bs,Lt())}),Cr.getOr(Pn)}return Pn},selectorChanged:(Pn,eo)=>(x(Pn,eo),fl),selectorChangedWithUnbind:x,getScrollContainer:()=>{let Pn,eo=n.getRoot();for(;eo&&eo.nodeName!=="BODY";){if(eo.scrollHeight>eo.clientHeight){Pn=eo;break}eo=eo.parentNode}return Pn},scrollIntoView:(Pn,eo)=>{Oe(Pn)?Sm(m,Pn,eo):Of(m,wt(),eo)},placeCaretAt:(Pn,eo)=>Pt(LP(Pn,eo,m.getDoc())),getBoundingClientRect:()=>{const Pn=wt();return Pn.collapsed?Vt.fromRangeStart(Pn).getClientRects()[0]:Pn.getBoundingClientRect()},destroy:()=>{i=p=w=null,Oc.destroy()}},Il=_O(fl),Oc=lx(fl,m);return fl.bookmarkManager=Il,fl.controlSelection=Oc,fl},QY=(n,i,c)=>{n.addAttributeFilter("data-mce-tabindex",(m,p)=>{let w=m.length;for(;w--;){const x=m[w];x.attr("tabindex",x.attr("data-mce-tabindex")),x.attr(p,null)}}),n.addAttributeFilter("src,href,style",(m,p)=>{const w="data-mce-"+p,x=i.url_converter,M=i.url_converter_scope;let B=m.length;for(;B--;){const q=m[B];let ae=q.attr(w);ae!==void 0?(q.attr(p,ae.length>0?ae:null),q.attr(w,null)):(ae=q.attr(p),p==="style"?ae=c.serializeStyle(c.parseStyle(ae),q.name):x&&(ae=x.call(M,ae,p,q.name)),q.attr(p,ae.length>0?ae:null))}}),n.addAttributeFilter("class",m=>{let p=m.length;for(;p--;){const w=m[p];let x=w.attr("class");x&&(x=x.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),w.attr("class",x.length>0?x:null))}}),n.addAttributeFilter("data-mce-type",(m,p,w)=>{let x=m.length;for(;x--;){const M=m[x];M.attr("data-mce-type")==="bookmark"&&!w.cleanup&&(he.from(M.firstChild).exists(q=>{var ae;return!Sn((ae=q.value)!==null&&ae!==void 0?ae:"")})?M.unwrap():M.remove())}}),n.addNodeFilter("noscript",m=>{var p;let w=m.length;for(;w--;){const x=m[w].firstChild;x&&(x.value=sp.decode((p=x.value)!==null&&p!==void 0?p:""))}}),n.addNodeFilter("script,style",(m,p)=>{var w;const x=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 M=m.length;for(;M--;){const B=m[M],q=B.firstChild,ae=(w=q==null?void 0:q.value)!==null&&w!==void 0?w:"";if(p==="script"){const fe=B.attr("type");fe&&B.attr("type",fe==="mce-no/type"?null:fe.replace(/^mce\-/,"")),i.element_format==="xhtml"&&q&&ae.length>0&&(q.value=`// <![CDATA[
|
|
`+x(ae)+`
|
|
// ]]>`)}else i.element_format==="xhtml"&&q&&ae.length>0&&(q.value=`<!--
|
|
`+x(ae)+`
|
|
-->`)}}),n.addNodeFilter("#comment",m=>{let p=m.length;for(;p--;){const w=m[p],x=w.value;i.preserve_cdata&&(x==null?void 0:x.indexOf("[CDATA["))===0?(w.name="#cdata",w.type=4,w.value=c.decode(x.replace(/^\[CDATA\[|\]\]$/g,""))):(x==null?void 0:x.indexOf("mce:protected "))===0&&(w.name="#text",w.type=3,w.raw=!0,w.value=unescape(x).substr(14))}}),n.addNodeFilter("xml:namespace,input",(m,p)=>{let w=m.length;for(;w--;){const x=m[w];x.type===7?x.remove():x.type===1&&p==="input"&&!x.attr("type")&&x.attr("type","text")}}),n.addAttributeFilter("data-mce-type",m=>{Ne(m,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",(m,p)=>{let w=m.length;for(;w--;)m[w].attr(p,null)}),i.remove_trailing_brs&&tM(i,n,n.schema)},ZY=n=>{const i=m=>(m==null?void 0:m.name)==="br",c=n.lastChild;if(i(c)){const m=c.prev;i(m)&&(c.remove(),m.remove())}},SL=(n,i,c)=>{let m;const p=n.dom;let w=i.cloneNode(!0);const x=document.implementation;if(x.createHTMLDocument){const M=x.createHTMLDocument("");gn.each(w.nodeName==="BODY"?w.childNodes:[w],B=>{M.body.appendChild(M.importNode(B,!0))}),w.nodeName!=="BODY"?w=M.body.firstChild:w=M.body,m=p.doc,p.doc=M}return XE(n,{...c,node:w}),m&&(p.doc=m),w},CL=(n,i)=>Oe(n)&&n.hasEventListeners("PreProcess")&&!i.no_events,kL=(n,i,c)=>CL(n,c)?SL(n,i,c):i,xL=(n,i,c)=>{gn.inArray(i,c)===-1&&(n.addAttributeFilter(c,(m,p)=>{let w=m.length;for(;w--;)m[w].attr(p,null)}),i.push(c))},QM=(n,i,c)=>!i.no_events&&n?rx(n,{...i,content:c}).content:c,Bie=(n,i,c)=>{const m=In(c.getInner?i.innerHTML:n.getOuterHTML(i));return c.selection||lu(Ke.fromDom(i))?m:gn.trim(m)},HY=(n,i,c)=>{const m=c.selection?{forced_root_block:!1,...c}:c,p=n.parse(i,m);return ZY(p),p},Lie=(n,i,c)=>Y2(n,i).serialize(c),zY=(n,i,c,m,p)=>{const w=Lie(i,c,m);return QM(n,p,w)},VY=(n,i)=>{const c=["data-mce-selected"],m={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...n},p=i&&i.dom?i.dom:Qr.DOM,w=i&&i.schema?i.schema:wh(m),x=$S(m,w);QY(x,m,p);const M=(B,q={})=>{const ae={format:"html",...q},fe=kL(i,B,ae),be=Bie(p,fe,ae),Le=HY(x,be,ae);return ae.format==="tree"?Le:zY(i,m,w,Le,ae)};return{schema:w,addNodeFilter:x.addNodeFilter,addAttributeFilter:x.addAttributeFilter,serialize:M,addRules:w.addValidElements,setRules:w.setValidElements,addTempAttr:He(xL,x,c),getTempAttrs:Qe(c),getNodeFilters:x.getNodeFilters,getAttributeFilters:x.getAttributeFilters,removeNodeFilter:x.removeNodeFilter,removeAttributeFilter:x.removeAttributeFilter}},O1=(n,i)=>{const c=VY(n,i);return{schema:c.schema,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,serialize:c.serialize,addRules:c.addRules,setRules:c.setRules,addTempAttr:c.addTempAttr,getTempAttrs:c.getTempAttrs,getNodeFilters:c.getNodeFilters,getAttributeFilters:c.getAttributeFilters,removeNodeFilter:c.removeNodeFilter,removeAttributeFilter:c.removeAttributeFilter}},Fie="html",Qie=(n,i)=>({...n,format:i,get:!0,getInner:!0}),WY=(n,i={})=>{const c=i.format?i.format:Fie,m=Qie(i,c);return V8(n,m).fold(Bt,p=>{const w=$Y(n,p);return W8(n,w,p)})},Xx="html",UY=(n,i)=>({format:Xx,...n,set:!0,content:i}),rA=(n,i,c={})=>{const m=UY(c,i);return _M(n,m).map(p=>{const w=NY(n,p.content,p);return SM(n,w.html,p),w.content}).getOr(i)},TL="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(","),EL="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(","),YY="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),AL=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],av=(n,i)=>{const c=At(i,m=>fn(n,m));return Ns(c)},XY=n=>{const i=av(n,TL),c=n.forced_root_block;return(c===!1||c==="")&&i.push("forced_root_block (false only)"),Ns(i)},jY=n=>av(n,EL),DL=(n,i)=>{const c=gn.makeMap(n.plugins," "),p=At(i,w=>fn(c,w));return Ns(p)},qY=n=>DL(n,YY),GY=n=>DL(n,AL.map(i=>i.name)),KY=(n,i)=>{const c=XY(n),m=qY(i),p=m.length>0,w=c.length>0,x=i.theme==="mobile";if(p||w||x){const M=`
|
|
- `,B=x?`
|
|
|
|
Themes:${M}mobile`:"",q=p?`
|
|
|
|
Plugins:${M}${m.join(M)}`:"",ae=w?`
|
|
|
|
Options:${M}${c.join(M)}`:"";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+q+ae)}},JY=n=>oo(AL,i=>i.name===n).fold(()=>n,i=>i.replacedWith?`${n}, replaced by ${i.replacedWith}`:n),eX=(n,i)=>{const c=jY(n),m=GY(i),p=m.length>0,w=c.length>0;if(p||w){const x=`
|
|
- `,M=p?`
|
|
|
|
Plugins:${x}${m.map(JY).join(x)}`:"",B=w?`
|
|
|
|
Options:${x}${c.join(x)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+M+B)}},tX=(n,i)=>{KY(n,i),eX(n,i)},iA=Qr.DOM,nX=n=>{iA.setStyle(n.id,"display",n.orgDisplay)},ZM=n=>he.from(n).each(i=>i.destroy()),jx=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 c=n.selection;if(c){const m=c.dom;i.selection=c.win=c.dom=m.doc=null}},oX=n=>{const i=n.formElement;i&&(i._mceOldSubmit&&(i.submit=i._mceOldSubmit,delete i._mceOldSubmit),iA.unbind(i,"submit reset",n.formEventDelegate))},HM=n=>{if(!n.removed){const{_selectionOverrides:i,editorUpload:c}=n,m=n.getBody(),p=n.getElement();m&&n.save({is_removing:!0}),n.removed=!0,n.unbindAllNativeEvents(),n.hasHiddenInput&&Oe(p==null?void 0:p.nextSibling)&&iA.remove(p.nextSibling),jE(n),n.editorManager.remove(n),!n.inline&&m&&nX(n),sS(n),iA.remove(n.getContainer()),ZM(i),ZM(c),n.destroy()}},sX=(n,i)=>{const{selection:c,dom:m}=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(),ZM(c),ZM(m)),oX(n),jx(n),n.destroyed=!0}},aA=(()=>{const n={};return{add:(p,w)=>{n[p]=w},get:p=>n[p]?n[p]:{icons:{}},has:p=>fn(n,p)}})(),LS=Ia.ModelManager,LO=(n,i)=>i.dom[n],FO=(n,i)=>parseInt(Bi(i,n),10),lA=He(LO,"clientWidth"),cA=He(LO,"clientHeight"),cw=He(FO,"margin-top"),uw=He(FO,"margin-left"),uA=n=>n.dom.getBoundingClientRect(),fA=(n,i,c)=>{const m=lA(n),p=cA(n);return i>=0&&c>=0&&i<=m&&c<=p},PL=(n,i,c,m)=>{const p=uA(i),w=n?p.left+i.dom.clientLeft+uw(i):0,x=n?p.top+i.dom.clientTop+cw(i):0,M=c-w,B=m-x;return{x:M,y:B}},zM=(n,i,c)=>{const m=Ke.fromDom(n.getBody()),p=n.inline?m:or(m),w=PL(n.inline,p,i,c);return fA(p,w.x,w.y)},VM=n=>he.from(n).map(Ke.fromDom),ML=n=>{const i=n.inline?n.getBody():n.getContentAreaContainer();return VM(i).map(Ed).getOr(!1)};var RL=()=>{const n=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:n,close:n,getArgs:n}};const fw=n=>{const i=[],c=()=>{const be=n.theme;return be&&be.getNotificationManagerImpl?be.getNotificationManagerImpl():RL()},m=()=>he.from(i[0]),p=(be,Le)=>be.type===Le.type&&be.text===Le.text&&!be.progressBar&&!be.timeout&&!Le.progressBar&&!Le.timeout,w=()=>{Ne(i,be=>{be.reposition()})},x=be=>{i.push(be)},M=be=>{Ss(i,Le=>Le===be).each(Le=>{i.splice(Le,1)})},B=(be,Le=!0)=>n.removed||!ML(n)?{}:(Le&&n.dispatch("BeforeOpenNotification",{notification:be}),oo(i,Ye=>p(c().getArgs(Ye),be)).getOrThunk(()=>{n.editorManager.setActive(n);const Ye=c().open(be,()=>{M(Ye),w(),m().fold(()=>n.focus(),Me=>X0(Ke.fromDom(Me.getEl())))});return x(Ye),w(),n.dispatch("OpenNotification",{notification:{...Ye}}),Ye})),q=()=>{m().each(be=>{c().close(be),M(be),w()})},ae=Qe(i);return(be=>{be.on("SkinLoaded",()=>{const Le=A_(be);Le&&B({text:Le,type:"warning",timeout:0},!1),w()}),be.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(w)}),be.on("remove",()=>{Ne(i.slice(),Le=>{c().close(Le)})})})(n),{open:B,close:q,getNotifications:ae}},dw=Ia.PluginManager,QO=Ia.ThemeManager;var $L=()=>{const n=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:n,openUrl:n,alert:n,confirm:n,close:n}};const qx=n=>{let i=[];const c=()=>{const Me=n.theme;return Me&&Me.getWindowManagerImpl?Me.getWindowManagerImpl():$L()},m=(Me,Ve)=>(...gt)=>Ve?Ve.apply(Me,gt):void 0,p=Me=>{n.dispatch("OpenWindow",{dialog:Me})},w=Me=>{n.dispatch("CloseWindow",{dialog:Me})},x=Me=>{i.push(Me),p(Me)},M=Me=>{w(Me),i=At(i,Ve=>Ve!==Me),i.length===0&&n.focus()},B=()=>he.from(i[i.length-1]),q=Me=>{n.editorManager.setActive(n),zP(n),n.ui.show();const Ve=Me();return x(Ve),Ve},ae=(Me,Ve)=>q(()=>c().open(Me,Ve,M)),fe=Me=>q(()=>c().openUrl(Me,M)),be=(Me,Ve,gt)=>{const Ot=c();Ot.alert(Me,m(gt||Ot,Ve))},Le=(Me,Ve,gt)=>{const Ot=c();Ot.confirm(Me,m(gt||Ot,Ve))},Ye=()=>{B().each(Me=>{c().close(Me),M(Me)})};return n.on("remove",()=>{Ne(i,Me=>{c().close(Me)})}),{open:ae,openUrl:fe,alert:be,confirm:Le,close:Ye}},WM=(n,i)=>{n.notificationManager.open({type:"error",text:i})},Gx=(n,i)=>{n._skinLoaded?WM(n,i):n.on("SkinLoaded",()=>{WM(n,i)})},NL=(n,i)=>{Gx(n,id.translate(["Failed to upload image: {0}",i]))},FS=(n,i,c)=>{rS(n,i,{message:c}),console.error(c)},Ag=(n,i,c)=>c?`Failed to load ${n}: ${c} from url ${i}`:`Failed to load ${n} url: ${i}`,ZO=(n,i,c)=>{FS(n,"PluginLoadError",Ag("plugin",i,c))},xp=(n,i,c)=>{FS(n,"IconsLoadError",Ag("icons",i,c))},rX=(n,i,c)=>{FS(n,"LanguageLoadError",Ag("language",i,c))},iX=(n,i,c)=>{FS(n,"ThemeLoadError",Ag("theme",i,c))},aX=(n,i,c)=>{FS(n,"ModelLoadError",Ag("model",i,c))},lX=(n,i,c)=>{const m=id.translate(["Failed to initialize plugin: {0}",i]);rS(n,"PluginLoadError",{message:m}),dA(m,c),Gx(n,m)},dA=(n,...i)=>{const c=window.console;c&&(c.error?c.error(n,...i):c.log(n,...i))},cX=n=>/^[a-z0-9\-]+$/i.test(n),uX=n=>IL(n,E_(n)),fX=n=>IL(n,mp(n)),IL=(n,i)=>{const c=n.editorManager.baseURL+"/skins/content",p=`content${n.editorManager.suffix}.css`;return pt(i,w=>cX(w)&&!n.inline?`${c}/${w}/${p}`:n.documentBaseURI.toAbsolute(w))},dX=n=>{n.contentCSS=n.contentCSS.concat(uX(n),fX(n))},hX=n=>n?Rr(n.getElementsByTagName("img")):[],mX=(n,i)=>{const c={};return{findAll:(p,w=mt)=>{const x=At(hX(p),B=>{const q=B.src;return B.hasAttribute("data-mce-bogus")||B.hasAttribute("data-mce-placeholder")||!q||q===qn.transparentSrc?!1:Ar(q,"blob:")?!n.isUploaded(q)&&w(B):Ar(q,"data:")?w(B):!1}),M=pt(x,B=>{const q=B.src;if(fn(c,q))return c[q].then(ae=>L(ae)?ae:{image:B,blobInfo:ae.blobInfo});{const ae=S8(i,q).then(fe=>(delete c[q],{image:B,blobInfo:fe})).catch(fe=>(delete c[q],fe));return c[q]=ae,ae}});return Promise.all(M)}}},hA=()=>{let c={};const m=(be,Le)=>({status:be,resultUri:Le}),p=be=>be in c;return{hasBlobUri:p,getResultUri:be=>{const Le=c[be];return Le?Le.resultUri:null},isPending:be=>p(be)?c[be].status===1:!1,isUploaded:be=>p(be)?c[be].status===2:!1,markPending:be=>{c[be]=m(1,null)},markUploaded:(be,Le)=>{c[be]=m(2,Le)},removeFailed:be=>{delete c[be]},destroy:()=>{c={}}}};let UM=0;const BL=()=>{const n=()=>Math.round(Math.random()*4294967295).toString(36);return"s"+new Date().getTime().toString(36)+n()+n()+n()},gX=n=>n+UM+++BL(),pX=()=>{let n=[];const i=fe=>({"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"})[fe.toLowerCase()]||"dat",c=(fe,be,Le,Ye,Me)=>{if(L(fe))return m({id:fe,name:Ye,filename:Me,blob:be,base64:Le});if(te(fe))return m(fe);throw new Error("Unknown input type")},m=fe=>{if(!fe.blob||!fe.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const be=fe.id||gX("blobid"),Le=fe.name||be,Ye=fe.blob;return{id:Qe(be),name:Qe(Le),filename:Qe(fe.filename||Le+"."+i(Ye.type)),blob:Qe(Ye),base64:Qe(fe.base64),blobUri:Qe(fe.blobUri||URL.createObjectURL(Ye)),uri:Qe(fe.uri)}},p=fe=>{x(fe.id())||n.push(fe)},w=fe=>oo(n,fe).getOrUndefined(),x=fe=>w(be=>be.id()===fe);return{create:c,add:p,get:x,getByUri:fe=>w(be=>be.blobUri()===fe),getByData:(fe,be)=>w(Le=>Le.base64()===fe&&Le.blob().type===be),findFirst:w,removeByUri:fe=>{n=At(n,be=>be.blobUri()===fe?(URL.revokeObjectURL(be.blobUri()),!1):!0)},destroy:()=>{Ne(n,fe=>{URL.revokeObjectURL(fe.blobUri())}),n=[]}}},LL=(n,i)=>{const c={},m=(Me,Ve)=>Me?Me.replace(/\/$/,"")+"/"+Ve.replace(/^\//,""):Ve,p=(Me,Ve)=>new Promise((gt,Ot)=>{const wt=new XMLHttpRequest;wt.open("POST",i.url),wt.withCredentials=i.credentials,wt.upload.onprogress=hn=>{Ve(hn.loaded/hn.total*100)},wt.onerror=()=>{Ot("Image upload failed due to a XHR Transport error. Code: "+wt.status)},wt.onload=()=>{if(wt.status<200||wt.status>=300){Ot("HTTP Error: "+wt.status);return}const hn=JSON.parse(wt.responseText);if(!hn||!L(hn.location)){Ot("Invalid JSON: "+wt.responseText);return}gt(m(i.basePath,hn.location))};const Pt=new FormData;Pt.append("file",Me.blob(),Me.filename()),wt.send(Pt)}),w=ce(i.handler)?i.handler:p,x=()=>new Promise(Me=>{Me([])}),M=(Me,Ve)=>({url:Ve,blobInfo:Me,status:!0}),B=(Me,Ve)=>({url:"",blobInfo:Me,status:!1,error:Ve}),q=(Me,Ve)=>{gn.each(c[Me],gt=>{gt(Ve)}),delete c[Me]},ae=(Me,Ve,gt)=>(n.markPending(Me.blobUri()),new Promise(Ot=>{let wt,Pt;try{const hn=()=>{wt&&(wt.close(),Pt=ot)},Hn=Lt=>{hn(),n.markUploaded(Me.blobUri(),Lt),q(Me.blobUri(),M(Me,Lt)),Ot(M(Me,Lt))},$n=Lt=>{hn(),n.removeFailed(Me.blobUri()),q(Me.blobUri(),B(Me,Lt)),Ot(B(Me,Lt))};Pt=Lt=>{Lt<0||Lt>100||he.from(wt).orThunk(()=>he.from(gt).map(Et)).each(Zt=>{wt=Zt,Zt.progressBar.value(Lt)})},Ve(Me,Pt).then(Hn,Lt=>{$n(L(Lt)?{message:Lt}:Lt)})}catch(hn){Ot(B(Me,hn))}})),fe=Me=>Me===p,be=Me=>{const Ve=Me.blobUri();return new Promise(gt=>{c[Ve]=c[Ve]||[],c[Ve].push(gt)})},Le=(Me,Ve)=>(Me=gn.grep(Me,gt=>!n.isUploaded(gt.blobUri())),Promise.all(gn.map(Me,gt=>n.isPending(gt.blobUri())?be(gt):ae(gt,w,Ve))));return{upload:(Me,Ve)=>!i.url&&fe(w)?x():Le(Me,Ve)}},YM=n=>()=>n.notificationManager.open({text:n.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),mA=(n,i)=>LL(i,{url:ak(n),basePath:eO(n),credentials:tO(n),handler:k_(n)}),FL=n=>{const i=hA(),c=mA(n,i);return{upload:(m,p=!0)=>c.upload(m,p?YM(n):void 0)}},QL=(n,i)=>n.dom.isEmpty(i.dom)&&Oe(n.schema.getTextBlockElements()[ti(i)]),XM=n=>i=>{QL(n,i)&&na(i,Ke.fromHtml('<br data-mce-bogus="1" />'))},bX=n=>{const i=pX();let c,m;const p=hA(),w=[],x=wt=>Pt=>n.selection?wt(Pt):[],M=wt=>wt+(wt.indexOf("?")===-1?"?":"&")+new Date().getTime(),B=(wt,Pt,hn)=>{let Hn=0;do Hn=wt.indexOf(Pt,Hn),Hn!==-1&&(wt=wt.substring(0,Hn)+hn+wt.substr(Hn+Pt.length),Hn+=hn.length-Pt.length+1);while(Hn!==-1);return wt},q=(wt,Pt,hn)=>{const Hn=`src="${hn}"${hn===qn.transparentSrc?' data-mce-placeholder="1"':""}`;return wt=B(wt,`src="${Pt}"`,Hn),wt=B(wt,'data-mce-src="'+Pt+'"','data-mce-src="'+hn+'"'),wt},ae=(wt,Pt)=>{Ne(n.undoManager.data,hn=>{hn.type==="fragmented"?hn.fragments=pt(hn.fragments,Hn=>q(Hn,wt,Pt)):hn.content=q(hn.content,wt,Pt)})},fe=(wt,Pt)=>{const hn=n.convertURL(Pt,"src");ae(wt.src,Pt),Ju(Ke.fromDom(wt),{src:ud(n)?M(Pt):Pt,"data-mce-src":hn})},be=()=>(c||(c=mA(n,p)),Ve().then(x(wt=>{const Pt=pt(wt,hn=>hn.blobInfo);return c.upload(Pt,YM(n)).then(x(hn=>{const Hn=[];let $n=!1;const Lt=pt(hn,(Zt,yn)=>{const{blobInfo:yo,image:Do}=wt[yn];let Cs=!1;return Zt.status&&S_(n)?(Zt.url&&!nr(Do.src,Zt.url)&&($n=!0),i.removeByUri(Do.src),Mb(n)||fe(Do,Zt.url)):Zt.error&&(Zt.error.remove&&(ae(Do.src,qn.transparentSrc),Hn.push(Do),Cs=!0),NL(n,Zt.error.message)),{element:Do,status:Zt.status,uploadUri:Zt.url,blobInfo:yo,removed:Cs}});return Hn.length>0&&!Mb(n)?n.undoManager.transact(()=>{Ne(lh(Hn),Zt=>{const yn=fi(Zt);wr(Zt),yn.each(XM(n)),i.removeByUri(Zt.dom.src)})}):$n&&n.undoManager.dispatchChange(),Lt}))}))),Le=()=>Jv(n)?be():Promise.resolve([]),Ye=wt=>tr(w,Pt=>Pt(wt)),Me=wt=>{w.push(wt)},Ve=()=>(m||(m=mX(p,i)),m.findAll(n.getBody(),Ye).then(x(wt=>{const Pt=At(wt,hn=>L(hn)?(Gx(n,hn),!1):hn.uriType!=="blob");return Mb(n)||Ne(Pt,hn=>{ae(hn.image.src,hn.blobInfo.blobUri()),hn.image.src=hn.blobInfo.blobUri(),hn.image.removeAttribute("data-mce-src")}),Pt}))),gt=()=>{i.destroy(),p.destroy(),m=c=null},Ot=wt=>wt.replace(/src="(blob:[^"]+)"/g,(Pt,hn)=>{const Hn=p.getResultUri(hn);if(Hn)return'src="'+Hn+'"';let $n=i.getByUri(hn);return $n||($n=zn(n.editorManager.get(),(Lt,Zt)=>Lt||Zt.editorUpload&&Zt.editorUpload.blobCache.getByUri(hn),void 0)),$n?'src="data:'+$n.blob().type+";base64,"+$n.base64()+'"':Pt});return n.on("SetContent",()=>{Jv(n)?Le():Ve()}),n.on("RawSaveContent",wt=>{wt.content=Ot(wt.content)}),n.on("GetContent",wt=>{wt.source_view||wt.format==="raw"||wt.format==="tree"||(wt.content=Ot(wt.content))}),n.on("PostRender",()=>{n.parser.addNodeFilter("img",wt=>{Ne(wt,Pt=>{const hn=Pt.attr("src");if(!hn||i.getByUri(hn))return;const Hn=p.getResultUri(hn);Hn&&Pt.attr("src",Hn)})})}),{blobCache:i,addFilter:Me,uploadImages:be,uploadImagesAuto:Le,scanForImages:Ve,destroy:gt}},vX=n=>{const i=n.dom,c=n.schema.type,m={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"]},x={inline:"s",remove:"all",preserve_attributes:["class","style"]};return c!=="html4"?[x,p,w]:[p,x,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,x)=>Jn(p)&&p.hasAttribute("href"),onformat:(p,w,x)=>{gn.each(x,(M,B)=>{i.setAttrib(p,B,M)})}},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 gn.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),p=>{m[p]={block:p,remove:"all"}}),m},y1={remove_similar:!0,inherit:!1},bd={selector:"td,th",...y1},gA={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...bd},tablecellverticalalign:{styles:{"vertical-align":"%value"},...bd},tablecellbordercolor:{styles:{borderColor:"%value"},...bd},tablecellclass:{classes:["%value"],...bd},tableclass:{selector:"table",classes:["%value"],...y1},tablecellborderstyle:{styles:{borderStyle:"%value"},...bd},tablecellborderwidth:{styles:{borderWidth:"%value"},...bd}},ZL=Qe(gA),pA=n=>{const i={},c=x=>Oe(x)?i[x]:i,m=x=>fn(i,x),p=(x,M)=>{x&&(L(x)?(oe(M)||(M=[M]),Ne(M,B=>{ve(B.deep)&&(B.deep=!dd(B)),ve(B.split)&&(B.split=!dd(B)||Ml(B)),ve(B.remove)&&dd(B)&&!Ml(B)&&(B.remove="none"),dd(B)&&Ml(B)&&(B.mixed=!0,B.block_expand=!0),L(B.classes)&&(B.classes=B.classes.split(/\s+/))}),i[x]=M):ln(x,(B,q)=>{p(q,B)}))},w=x=>(x&&i[x]&&delete i[x],i);return p(vX(n)),p(ZL()),p(dk(n)),{get:c,has:m,register:p,unregister:w}},Kx=gn.each,km=Qr.DOM,bA=n=>Oe(n)&&te(n),jM=(n,i)=>{const c=i&&i.schema||wh({}),m=(B,q)=>{q.classes.length>0&&km.addClass(B,q.classes.join(" ")),km.setAttribs(B,q.attrs)},p=B=>{const q=L(B)?{name:B,classes:[],attrs:{}}:B,ae=km.create(q.name);return m(ae,q),ae},w=(B,q)=>{const ae=c.getElementRule(B.nodeName.toLowerCase()),fe=ae==null?void 0:ae.parentsRequired;return fe&&fe.length?q&&kt(fe,q)?q:fe[0]:!1},x=(B,q,ae)=>{let fe;const be=q[0],Le=bA(be)?be.name:void 0,Ye=w(B,Le);if(Ye)Le===Ye?(fe=be,q=q.slice(1)):fe=Ye;else if(be)fe=be,q=q.slice(1);else if(!ae)return B;const Me=fe?p(fe):km.create("div");Me.appendChild(B),ae&&gn.each(ae,gt=>{const Ot=p(gt);Me.insertBefore(Ot,B)});const Ve=bA(fe)?fe.siblings:void 0;return x(Me,q,Ve)},M=km.create("div");if(n.length>0){const B=n[0],q=p(B),ae=bA(B)?B.siblings:void 0;M.appendChild(x(q,n.slice(1),ae))}return M},HL=n=>{n=gn.trim(n);let i="div";const c={name:i,classes:[],attrs:{},selector:n};return n!=="*"&&(i=n.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(m,p,w,x,M)=>{switch(p){case"#":c.attrs.id=w;break;case".":c.classes.push(w);break;case":":gn.inArray("checked disabled enabled read-only required".split(" "),w)!==-1&&(c.attrs[w]=w);break}if(x==="["){const B=M.match(/([\w\-]+)(?:\=\"([^\"]+))?/);B&&(c.attrs[B[1]]=B[2])}return""})),c.name=i||"div",c},zL=n=>L(n)?(n=n.split(/\s*,\s*/)[0],n=n.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),gn.map(n.split(/(?:>|\s+(?![^\[\]]+\]))/),i=>{const c=gn.map(i.split(/(?:~\+|~|\+)/),HL),m=c.pop();return c.length&&(m.siblings=c),m}).reverse()):[],vA=(n,i)=>{let c="",m=hk(n);if(m==="")return"";const p=be=>L(be)?be.replace(/%(\w+)/g,""):"",w=(be,Le)=>km.getStyle(Le!=null?Le:n.getBody(),be,!0);if(L(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"";m=be||m}let x=i.block||i.inline||"span",M;const B=zL(i.selector);B.length>0?(B[0].name||(B[0].name=x),x=i.selector,M=jM(B,n)):M=jM([x],n);const q=km.select(x,M)[0]||M.firstChild;Kx(i.styles,(be,Le)=>{const Ye=p(be);Ye&&km.setStyle(q,Le,Ye)}),Kx(i.attributes,(be,Le)=>{const Ye=p(be);Ye&&km.setAttrib(q,Le,Ye)}),Kx(i.classes,be=>{const Le=p(be);km.hasClass(q,Le)||km.addClass(q,Le)}),n.dispatch("PreviewFormats"),km.setStyles(M,{position:"absolute",left:-65535}),n.getBody().appendChild(M);const ae=w("fontSize"),fe=/px$/.test(ae)?parseInt(ae,10):0;return Kx(m.split(" "),be=>{let Le=w(be,q);if(!(be==="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(Le)&&(Le=w(be),G_(Le).toLowerCase()==="#ffffff"))&&!(be==="color"&&G_(Le).toLowerCase()==="#000000")){if(be==="font-size"&&/em|%$/.test(Le)){if(fe===0)return;Le=parseFloat(Le)/(/%$/.test(Le)?100:1)*fe+"px"}be==="border"&&Le&&(c+="padding:0 2px;"),c+=be+":"+Le+";"}}),n.dispatch("AfterPreviewFormats"),km.remove(M),c},qM=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"])},VL=n=>{const i=pA(n),c=Ga({});return qM(n),sU(n),Mb(n)||Tie(c,n),{get:i.get,has:i.has,register:i.register,unregister:i.unregister,apply:(m,p,w)=>{v1(n,m,p,w)},remove:(m,p,w,x)=>{BM(n,m,p,w,x)},toggle:(m,p,w)=>{MY(n,m,p,w)},match:(m,p,w,x)=>EY(n,m,p,w,x),closest:m=>Nie(n,m),matchAll:(m,p)=>AY(n,m,p),matchNode:(m,p,w,x)=>DY(n,m,p,w,x),canApply:m=>PY(n,m),formatChanged:(m,p,w,x)=>RY(n,c,m,p,w,x),getCssText:He(vA,n)}},WL=n=>{switch(n.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},OX=(n,i,c)=>{const m=Ga(!1),p=B=>{aw(i,!1,c),i.add({},B)};n.on("init",()=>{i.add()}),n.on("BeforeExecCommand",B=>{const q=B.command;WL(q)||(lL(i,c),i.beforeChange())}),n.on("ExecCommand",B=>{const q=B.command;WL(q)||p(B)}),n.on("ObjectResizeStart cut",()=>{i.beforeChange()}),n.on("SaveContent ObjectResized blur",p),n.on("dragend",p),n.on("keyup",B=>{const q=B.keyCode;if(B.isDefaultPrevented())return;const ae=qn.os.isMacOS()&&B.key==="Meta";(q>=33&&q<=36||q>=37&&q<=40||q===45||B.ctrlKey||ae)&&(p(),n.nodeChanged()),(q===46||q===8)&&n.nodeChanged(),m.get()&&i.typing&&!RM(oA(n),i.data[0])&&(n.isDirty()||n.setDirty(!0),n.dispatch("TypingUndo"),m.set(!1),n.nodeChanged())}),n.on("keydown",B=>{const q=B.keyCode;if(B.isDefaultPrevented())return;if(q>=33&&q<=36||q>=37&&q<=40||q===45){i.typing&&p(B);return}const ae=B.ctrlKey&&!B.altKey||B.metaKey;if((q<16||q>20)&&q!==224&&q!==91&&!i.typing&&!ae){i.beforeChange(),aw(i,!0,c),i.add({},B),m.set(!0);return}(qn.os.isMacOS()?B.metaKey:B.ctrlKey&&!B.altKey)&&i.beforeChange()}),n.on("mousedown",B=>{i.typing&&p(B)});const w=B=>B.inputType==="insertReplacementText",x=B=>B.inputType==="insertText"&&B.data===null,M=B=>B.inputType==="insertFromPaste"||B.inputType==="insertFromDrop";n.on("input",B=>{B.inputType&&(w(B)||x(B)||M(B))&&p(B)}),n.on("AddUndo Undo Redo ClearUndos",B=>{B.isDefaultPrevented()||n.nodeChanged()})},yX=n=>{n.addShortcut("meta+z","","Undo"),n.addShortcut("meta+y,meta+shift+z","","Redo")},GM=n=>{const i=Sh(),c=Ga(0),m=Ga(0),p={data:[],typing:!1,beforeChange:()=>{_Y(n,c,i)},add:(w,x)=>gL(n,p,m,c,i,w,x),dispatchChange:()=>{n.setDirty(!0);const w=oA(n);w.bookmark=bu(n.selection),n.dispatch("change",{level:w,lastLevel:qr(p.data,m.get()).getOrUndefined()})},undo:()=>SY(n,p,c,m),redo:()=>CY(n,m,p.data),clear:()=>{Wx(n,p,m)},reset:()=>{pL(n,p)},hasUndo:()=>bL(n,p,m),hasRedo:()=>kY(n,p,m),transact:w=>xY(n,p,c,w),ignore:w=>{TY(n,c,w)},extra:(w,x)=>{vL(n,p,m,w,x)}};return Mb(n)||OX(n,p,c),yX(n),p},wX=[9,27,to.HOME,to.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,to.DOWN,to.UP,to.LEFT,to.RIGHT].concat(qn.browser.isFirefox()?[224]:[]),UL="data-mce-placeholder",OA=n=>n.type==="keydown"||n.type==="keyup",YL=n=>{const i=n.keyCode;return i===to.BACKSPACE||i===to.DELETE},_X=n=>{if(OA(n)){const i=n.keyCode;return!YL(n)&&(to.metaKeyPressed(n)||n.altKey||i>=112&&i<=123||kt(wX,i))}else return!1},SX=n=>OA(n)&&!(YL(n)||n.type==="keyup"&&n.keyCode===229),CX=(n,i,c)=>{if($a(Ke.fromDom(i),!1)){const m=i.firstElementChild;return m?n.getStyle(i.firstElementChild,"padding-left")||n.getStyle(i.firstElementChild,"padding-right")?!1:c===m.nodeName.toLowerCase():!0}else return!1},kX=n=>{var i;const c=n.dom,m=jc(n),p=(i=gb(n))!==null&&i!==void 0?i:"",w=(x,M)=>{if(_X(x))return;const B=n.getBody(),q=SX(x)?!1:CX(c,B,m);(c.getAttrib(B,UL)!==""!==q||M)&&(c.setAttrib(B,UL,q?p:null),c.setAttrib(B,"aria-placeholder",q?p:null),CO(n,q),n.on(q?"keydown":"keyup",w),n.off(q?"keyup":"keydown",w))};yr(p)&&n.on("init",x=>{w(x,!0),n.on("change SetContent ExecCommand",w),n.on("paste",M=>_g.setEditorTimeout(n,()=>w(M)))})},xX=(n,i)=>({block:n,position:i}),TX=(n,i)=>({from:n,to:i}),QS=(n,i)=>{const c=Ke.fromDom(n),m=Ke.fromDom(i.container());return Ti(c,m).map(p=>xX(p,i))},KM=n=>!vt(n.from.block,n.to.block),XL=(n,i)=>Zl(i,p=>qm(p)||ba(p.dom),p=>vt(p,n)).filter(kl).getOr(n),EX=(n,i)=>{const c=Ke.fromDom(n);return vt(XL(c,i.from.block),XL(c,i.to.block))},AX=n=>Es(n.from.block.dom)===!1&&Es(n.to.block.dom)===!1,DX=n=>{const i=c=>mc(c)||ph(c.dom);return i(n.from.block)&&i(n.to.block)},jL=(n,i,c)=>mi(c.position.getNode())&&!$a(c.block)?bO(!1,c.block.dom).bind(m=>m.isEqual(c.position)?zd(i,n,m).bind(p=>QS(n,p)):he.some(c)).getOr(c):c,PX=(n,i,c)=>{const m=QS(n,Vt.fromRangeStart(c)),p=m.bind(w=>zd(i,n,w.position).bind(x=>QS(n,x).map(M=>jL(n,i,M))));return ri(m,p,TX).filter(w=>KM(w)&&EX(n,w)&&AX(w)&&DX(w))},MX=(n,i,c)=>c.collapsed?PX(n,i,c):he.none(),JM=n=>{const i=Da(n);return Ss(i,hc).fold(Qe(i),c=>i.slice(0,c))},qL=n=>{const i=JM(n);return Ne(i,wr),i},GL=(n,i)=>{const c=G0(i,n);return oo(c.reverse(),m=>$a(m)).each(wr)},RX=n=>At(Wg(n),i=>!$a(i)).length===0,$X=(n,i,c,m)=>{if($a(c))return Pe(c),cl(c.dom);RX(m)&&$a(i)&&Ca(m,Ke.fromTag("br"));const p=Hu(c.dom,Vt.before(m.dom));return Ne(qL(i),w=>{Ca(m,w)}),GL(n,i),p},NX=(n,i,c)=>{if($a(c)){if($a(i)){const w=An((x=>{const M=(B,q)=>ii(B).fold(()=>q,ae=>Dc(ae)?M(ae,q.concat(ug(ae))):q);return M(x,[])})(c),(x,M)=>(e0(x,M),M),ye());Ad(i),na(i,w)}return wr(c),cl(i.dom)}const m=Vd(c.dom);return Ne(qL(i),p=>{na(c,p)}),GL(n,i),m},IX=(n,i)=>{const c=G0(i,n);return he.from(c[c.length-1])},BX=(n,i)=>cn(i,n)?IX(i,n):he.none(),Jx=(n,i)=>{bO(n,i.dom).bind(c=>he.from(c.getNode())).map(Ke.fromDom).filter(au).each(wr)},eT=(n,i,c)=>(Jx(!0,i),Jx(!1,c),BX(i,c).fold(He(NX,n,i,c),He($X,n,i,c))),KL=(n,i,c,m)=>i?eT(n,m,c):eT(n,c,m),eR=(n,i)=>{const c=Ke.fromDom(n.getBody());return MX(c.dom,i,n.selection.getRng()).map(p=>()=>{KL(c,i,p.from.block,p.to.block).each(w=>{n.selection.setRng(w.toRange())})})},yA=(n,i)=>{const c=i.getRng();return ri(Ti(n,Ke.fromDom(c.startContainer)),Ti(n,Ke.fromDom(c.endContainer)),(m,p)=>vt(m,p)?he.none():he.some(()=>{c.deleteContents(),KL(n,!0,m,p).each(w=>{i.setRng(w.toRange())})})).getOr(he.none())},JL=(n,i)=>{const c=Ke.fromDom(i),m=He(vt,n);return di(c,qm,m).isSome()},LX=(n,i)=>JL(n,i.startContainer)||JL(n,i.endContainer),FX=(n,i)=>{const c=Hu(n.dom,Vt.fromRangeStart(i)).isNone(),m=Hf(n.dom,Vt.fromRangeEnd(i)).isNone();return!LX(n,i)&&c&&m},QX=n=>he.some(()=>{n.setContent(""),n.selection.setCursorLocation()}),ZX=n=>{const i=Ke.fromDom(n.getBody()),c=n.selection.getRng();return FX(i,c)?QX(n):yA(i,n.selection)},tR=(n,i)=>n.selection.isCollapsed()?he.none():ZX(n),lv=(n,i,c,m,p)=>he.from(i._selectionOverrides.showCaret(n,c,m,p)),HX=n=>{const i=n.ownerDocument.createRange();return i.selectNode(n),i},tT=(n,i)=>n.dispatch("BeforeObjectSelected",{target:i}).isDefaultPrevented()?he.none():he.some(HX(i)),zX=(n,i,c)=>{const m=H(1,n.getBody(),i),p=Vt.fromRangeStart(m),w=p.getNode();if(gm(w))return lv(1,n,w,!p.isAtEnd(),!1);const x=p.getNode(!0);if(gm(x))return lv(1,n,x,!1,!1);const M=PO(n.dom.getRoot(),p.getNode());return gm(M)?lv(1,n,M,!1,c):he.none()},nR=(n,i,c)=>i.collapsed?zX(n,i,c).getOr(i):i,Hie=n=>AO(n)||j0(n),Tp=n=>q0(n)||vS(n),oR=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},sR=(n,i,c,m,p,w)=>{lv(m,n,w.getNode(!p),p,!0).each(x=>{if(i.collapsed){const M=i.cloneRange();p?M.setEnd(x.startContainer,x.startOffset):M.setStart(x.endContainer,x.endOffset),M.deleteContents()}else i.deleteContents();n.selection.setRng(x)}),oR(n.dom,c)},e7=(n,i)=>{const c=n.selection.getRng();if(!_n(c.commonAncestorContainer))return he.none();const m=i?vn.Forwards:vn.Backwards,p=Ea(n.getBody()),w=He(St,i?p.next:p.prev),x=i?Hie:Tp,M=Ce(m,n.getBody(),c),B=w(M),q=B&&Sg(i,B);if(!q||!zt(M,q))return he.none();if(x(q))return he.some(()=>sR(n,c,M.getNode(),m,i,q));const ae=w(q);return ae&&x(ae)&&zt(q,ae)?he.some(()=>sR(n,c,M.getNode(),m,i,ae)):he.none()},rR=(n,i)=>e7(n,i),wA=(n,i)=>{const c=n.getBody();return i?cl(c).filter(AO):Vd(c).filter(q0)},iR=n=>{const i=n.selection.getRng();return!i.collapsed&&(wA(n,!0).exists(c=>c.isEqual(Vt.fromRangeStart(i)))||wA(n,!1).exists(c=>c.isEqual(Vt.fromRangeEnd(i))))},t7=n=>Oe(n)&&(qm(Ke.fromDom(n))||ja(Ke.fromDom(n))),xm=pg.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),VX=(n,i)=>{const c=i.getNode(!n),m=n?"after":"before";return Jn(c)&&c.getAttribute("data-mce-caret")===m},WX=(n,i,c,m)=>{const p=w=>Dc(Ke.fromDom(w))&&!Hd(c,m,n);return le(!i,c).fold(()=>le(i,m).fold(je,p),p)},hw=(n,i,c,m)=>{const p=m.getNode(!i);return Ti(Ke.fromDom(n),Ke.fromDom(c.getNode())).map(w=>$a(w)?xm.remove(w.dom):xm.moveToElement(p)).orThunk(()=>he.some(xm.moveToElement(p)))},aR=(n,i,c)=>zd(i,n,c).bind(m=>t7(m.getNode())||WX(n,i,c,m)?he.none():i&&Es(m.getNode())||!i&&Es(m.getNode(!0))?hw(n,i,c,m):i&&q0(c)||!i&&AO(c)?he.some(xm.moveToPosition(m)):he.none()),n7=(n,i)=>Re(i)?he.none():n&&Es(i.nextSibling)?he.some(xm.moveToElement(i.nextSibling)):!n&&Es(i.previousSibling)?he.some(xm.moveToElement(i.previousSibling)):he.none(),o7=(n,i,c)=>c.fold(m=>he.some(xm.remove(m)),m=>he.some(xm.moveToElement(m)),m=>Hd(i,m,n)?he.none():he.some(xm.moveToPosition(m))),lR=(n,i,c)=>VX(i,c)?n7(i,c.getNode(!i)).orThunk(()=>aR(n,i,c)):aR(n,i,c).bind(m=>o7(n,c,m)),UX=(n,i,c)=>{const m=H(i?1:-1,n,c),p=Vt.fromRangeStart(m),w=Ke.fromDom(n);return!i&&q0(p)?he.some(xm.remove(p.getNode(!0))):i&&AO(p)?he.some(xm.remove(p.getNode())):!i&&AO(p)&&O3(w,p)?tB(w,p).map(x=>xm.remove(x.getNode())):i&&q0(p)&&v3(w,p)?cW(w,p).map(x=>xm.remove(x.getNode())):lR(n,i,p)},YX=(n,i)=>c=>(n._selectionOverrides.hideFakeCaret(),K0(n,i,Ke.fromDom(c)),!0),XX=(n,i)=>c=>{const m=i?Vt.before(c):Vt.after(c);return n.selection.setRng(m.toRange()),!0},zie=n=>i=>(n.selection.setRng(i.toRange()),!0),jX=(n,i)=>he.from(PO(n.getBody(),i)),Vie=(n,i)=>{const c=n.selection.getNode();return jX(n,c).filter(Es).fold(()=>UX(n.getBody(),i,n.selection.getRng()).map(m=>()=>m.fold(YX(n,i),XX(n,i),zie(n))),()=>he.some(ot))},Ep=n=>{Ne(pl(n,".mce-offscreen-selection"),wr)},qX=(n,i)=>{const c=n.selection.getNode();return Es(c)&&!Rd(c)?jX(n,c.parentNode).filter(Es).fold(()=>he.some(()=>{Ep(Ke.fromDom(n.getBody())),K0(n,i,Ke.fromDom(n.selection.getNode())),q2(n)}),()=>he.some(ot)):iR(n)?he.some(()=>{k3(n,n.selection.getRng(),Ke.fromDom(n.getBody()))}):he.none()},s7=n=>{const i=n.dom,c=n.selection,m=PO(n.getBody(),c.getNode());if(ba(m)&&i.isBlock(m)&&i.isEmpty(m)){const p=i.create("br",{"data-mce-bogus":"1"});i.setHTML(m,""),m.appendChild(p),c.setRng(Vt.before(p).toRange())}return!0},cv=(n,i)=>n.selection.isCollapsed()?Vie(n,i):qX(n,i),r7=(n,i)=>{const c=Vt.fromRangeStart(n.selection.getRng());return zd(i,n.getBody(),c).filter(m=>i?rW(m):iW(m)).bind(m=>wb(i?0:-1,m)).map(m=>()=>n.selection.select(m))},cR=(n,i)=>n.selection.isCollapsed()?r7(n,i):he.none(),uv=_n,i7=n=>uv(n)&&n.data[0]===Ft,a7=n=>uv(n)&&n.data[n.data.length-1]===Ft,l7=n=>{var i;return((i=n.ownerDocument)!==null&&i!==void 0?i:document).createTextNode(Ft)},GX=n=>{var i;if(uv(n.previousSibling))return a7(n.previousSibling)||n.previousSibling.appendData(Ft),n.previousSibling;if(uv(n))return i7(n)||n.insertData(0,Ft),n;{const c=l7(n);return(i=n.parentNode)===null||i===void 0||i.insertBefore(c,n),c}},KX=n=>{var i,c;if(uv(n.nextSibling))return i7(n.nextSibling)||n.nextSibling.insertData(0,Ft),n.nextSibling;if(uv(n))return a7(n)||n.appendData(Ft),n;{const m=l7(n);return n.nextSibling?(i=n.parentNode)===null||i===void 0||i.insertBefore(m,n.nextSibling):(c=n.parentNode)===null||c===void 0||c.appendChild(m),m}},_A=(n,i)=>n?GX(i):KX(i),fv=He(_A,!0),JX=He(_A,!1),c7=(n,i)=>_n(n.container())?_A(i,n.container()):_A(i,n.getNode()),u7=(n,i)=>{const c=i.get();return c&&n.container()===c&&sr(c)},uR=(n,i)=>i.fold(c=>{yl(n.get());const m=fv(c);return n.set(m),he.some(Vt(m,m.length-1))},c=>cl(c).map(m=>{if(u7(m,n)){const p=n.get();return Vt(p,1)}else{yl(n.get());const p=c7(m,!0);return n.set(p),Vt(p,1)}}),c=>Vd(c).map(m=>{if(u7(m,n)){const p=n.get();return Vt(p,p.length-1)}else{yl(n.get());const p=c7(m,!1);return n.set(p),Vt(p,p.length-1)}}),c=>{yl(n.get());const m=JX(c);return n.set(m),he.some(Vt(m,1))}),f7=(n,i)=>{for(let c=0;c<n.length;c++){const m=n[c].apply(null,i);if(m.isSome())return m}return he.none()},yf=pg.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),SA=(n,i)=>{const c=pm(i,n);return c||n},fR=(n,i,c)=>{const m=AW(c),p=SA(i,m.container());return J0(n,p,m).fold(()=>Hf(p,m).bind(He(J0,n,p)).map(w=>yf.before(w)),he.none)},d7=(n,i)=>Cb(n,i)===null,dR=(n,i,c)=>J0(n,i,c).filter(He(d7,i)),h7=(n,i,c)=>{const m=C3(c);return dR(n,i,m).bind(p=>Hu(p,m).isNone()?he.some(yf.start(p)):he.none())},ej=(n,i,c)=>{const m=AW(c);return dR(n,i,m).bind(p=>Hf(p,m).isNone()?he.some(yf.end(p)):he.none())},nT=(n,i,c)=>{const m=C3(c),p=SA(i,m.container());return J0(n,p,m).fold(()=>Hu(p,m).bind(He(J0,n,p)).map(w=>yf.after(w)),he.none)},CA=n=>!dB(kA(n)),w1=(n,i,c)=>f7([fR,h7,ej,nT],[n,i,c]).filter(CA),kA=n=>n.fold(Bt,Bt,Bt,Bt),hR=n=>n.fold(Qe("before"),Qe("start"),Qe("end"),Qe("after")),oT=n=>n.fold(yf.before,yf.before,yf.after,yf.after),ZS=n=>n.fold(yf.start,yf.start,yf.end,yf.end),mR=(n,i)=>hR(n)===hR(i)&&kA(n)===kA(i),sT=(n,i,c,m,p,w)=>ri(J0(i,c,m),J0(i,c,p),(x,M)=>x!==M&&Sp(c,x,M)?yf.after(n?x:M):w).getOr(w),tj=(n,i)=>n.fold(mt,c=>!mR(c,i)),m7=(n,i,c,m,p)=>{const w=Sg(n,p);return zd(n,c,w).map(He(Sg,n)).fold(()=>m.map(oT),B=>w1(i,c,B).map(He(sT,n,i,c,w,B)).filter(He(tj,m))).filter(CA)},nj=(n,i)=>n?i.fold(V(he.some,yf.start),he.none,V(he.some,yf.after),he.none):i.fold(he.none,V(he.some,yf.before),he.none,V(he.some,yf.end)),oj=(n,i,c,m)=>{const p=Sg(n,m),w=w1(i,c,p);return w1(i,c,p).bind(He(nj,n)).orThunk(()=>m7(n,i,c,w,m))},g7=n=>ce(n.selection.getSel().modify),p7=(n,i,c)=>{const m=n?1:-1;return i.setRng(Vt(c.container(),c.offset()+m).toRange()),i.getSel().modify("move",n?"forward":"backward","word"),!0},b7=(n,i)=>{const c=i.selection.getRng(),m=n?Vt.fromRangeEnd(c):Vt.fromRangeStart(c);return g7(i)?n&&rf(m)?p7(!0,i.selection,m):!n&&Nf(m)?p7(!1,i.selection,m):!1:!1};var dv;(function(n){n[n.Br=0]="Br",n[n.Block=1]="Block",n[n.Wrap=2]="Wrap",n[n.Eol=3]="Eol"})(dv||(dv={}));const xA=(n,i)=>n===vn.Backwards?Xs(i):i,sj=(n,i,c)=>n===vn.Forwards?i.next(c):i.prev(c),rj=(n,i,c,m)=>mi(m.getNode(i===vn.Forwards))?dv.Br:Hd(c,m)===!1?dv.Block:dv.Wrap,v7=(n,i,c,m)=>{const p=Ea(c);let w=m;const x=[];for(;w;){const M=sj(i,p,w);if(!M)break;if(mi(M.getNode(!1)))return i===vn.Forwards?{positions:xA(i,x).concat([M]),breakType:dv.Br,breakAt:he.some(M)}:{positions:xA(i,x),breakType:dv.Br,breakAt:he.some(M)};if(!M.isVisible()){w=M;continue}if(n(w,M)){const B=rj(c,i,w,M);return{positions:xA(i,x),breakType:B,breakAt:he.some(M)}}x.push(M),w=M}return{positions:xA(i,x),breakType:dv.Eol,breakAt:he.none()}},O7=(n,i,c,m)=>i(c,m).breakAt.map(p=>{const w=i(c,p).positions;return n===vn.Backwards?w.concat(p):[p].concat(w)}).getOr([]),gR=(n,i)=>zn(n,(c,m)=>c.fold(()=>he.some(m),p=>ri($o(p.getClientRects()),$o(m.getClientRects()),(w,x)=>{const M=Math.abs(i-w.left);return Math.abs(i-x.left)<=M?m:p}).or(c)),he.none()),TA=(n,i)=>$o(i.getClientRects()).bind(c=>gR(n,c.left)),rT=He(v7,Vt.isAbove,-1),HS=He(v7,Vt.isBelow,1),y7=He(O7,-1,rT),HO=He(O7,1,HS),pR=(n,i)=>rT(n,i).breakAt.isNone(),EA=(n,i)=>HS(n,i).breakAt.isNone(),w7=n=>cl(n).map(i=>[i].concat(HS(n,i).positions)).getOr([]),bR=n=>Vd(n).map(i=>rT(n,i).positions.concat(i)).getOr([]),zO=(n,i)=>TA(y7(n,i),i),_7=(n,i)=>TA(HO(n,i),i),Dg=Es,VO=(n,i)=>Math.abs(n.left-i),AA=(n,i)=>Math.abs(n.right-i),ij=n=>os(n,"node"),vR=(n,i)=>Ge(n,(c,m)=>{const p=Math.min(VO(c,i),AA(c,i)),w=Math.min(VO(m,i),AA(m,i));return w===p&&ij(m)&&Dg(m.node)||w<p?m:c}),aj=n=>{const i=c=>pt(c,m=>{const p=Jp(m);return p.node=n,p});if(Jn(n))return i(n.getClientRects());if(_n(n)){const c=n.ownerDocument.createRange();return c.setStart(n,0),c.setEnd(n,n.data.length),i(c.getClientRects())}else return[]},S7=n=>$s(n,aj);var iT;(function(n){n[n.Up=-1]="Up",n[n.Down=1]="Down"})(iT||(iT={}));const lj=(n,i,c,m)=>{let p=m;for(;p=Ah(p,n,Kg,i);)if(c(p))return},C7=(n,i,c,m,p,w)=>{let x=0;const M=[],B=fe=>{let be=S7([fe]);n===-1&&(be=be.reverse());for(let Le=0;Le<be.length;Le++){const Ye=be[Le];if(!c(Ye,q)){if(M.length>0&&i(Ye,Nt(M))&&x++,Ye.line=x,p(Ye))return!0;M.push(Ye)}}return!1},q=Nt(w.getClientRects());if(!q)return M;const ae=w.getNode();return ae&&(B(ae),lj(n,m,B,ae)),M},k7=(n,i)=>i.line>n,cj=(n,i)=>i.line===n,uj=He(C7,iT.Up,sa,df),zS=He(C7,iT.Down,df,sa),DA=n=>Nt(n.getClientRects()),x7=(n,i,c,m)=>{const p=Ea(i);let w,x,M,B;const q=[];let ae=0;n===1?(w=p.next,x=df,M=sa,B=Vt.after(m)):(w=p.prev,x=sa,M=df,B=Vt.before(m));const fe=DA(B);do{if(!B.isVisible())continue;const be=DA(B);if(M(be,fe))continue;q.length>0&&x(be,Nt(q))&&ae++;const Le=Jp(be);if(Le.position=B,Le.line=ae,c(Le))return q;q.push(Le)}while(B=w(B));return q},OR=n=>i=>k7(n,i),aT=n=>i=>cj(n,i),hv=(n,i)=>{n.selection.setRng(i),Of(n,n.selection.getRng())},yR=(n,i,c)=>he.some(nR(n,i,c)),T7=(n,i,c,m,p,w)=>{const x=i===vn.Forwards,M=Ea(n.getBody()),B=He(St,x?M.next:M.prev),q=x?m:p;if(!c.collapsed){const Ye=lb(c);if(w(Ye))return lv(i,n,Ye,i===vn.Backwards,!1);if(iR(n)){const Me=c.cloneRange();return Me.collapse(i===vn.Backwards),he.from(Me)}}const ae=Ce(i,n.getBody(),c);if(q(ae))return tT(n,ae.getNode(!x));let fe=B(ae);const be=oa(c);if(fe)fe=Sg(x,fe);else return be?he.some(c):he.none();if(q(fe))return lv(i,n,fe.getNode(!x),x,!1);const Le=B(fe);return Le&&q(Le)&&zt(fe,Le)?lv(i,n,Le.getNode(!x),x,!1):be?yR(n,fe.toRange(),!1):he.none()},E7=(n,i,c,m,p,w)=>{const x=Ce(i,n.getBody(),c),M=Nt(x.getClientRects()),B=i===iT.Down,q=n.getBody();if(!M)return he.none();if(iR(n)){const Ve=B?Vt.fromRangeEnd(c):Vt.fromRangeStart(c);return(B?_7:zO)(q,Ve).orThunk(()=>he.from(Ve)).map(Ot=>Ot.toRange())}const fe=(B?zS:uj)(q,OR(1),x),be=At(fe,aT(1)),Le=M.left,Ye=vR(be,Le);if(Ye&&w(Ye.node)){const Ve=Math.abs(Le-Ye.left),gt=Math.abs(Le-Ye.right);return lv(i,n,Ye.node,Ve<gt,!1)}let Me;if(m(x)?Me=x.getNode():p(x)?Me=x.getNode(!0):Me=lb(c),Me){const Ve=x7(i,q,OR(1),Me);let gt=vR(At(Ve,aT(1)),Le);if(gt||(gt=Nt(At(Ve,aT(0))),gt))return yR(n,gt.position.toRange(),!1)}return be.length===0?wR(n,B).filter(B?p:m).map(Ve=>nR(n,Ve.toRange(),!1)):he.none()},wR=(n,i)=>{const c=n.selection.getRng(),m=i?Vt.fromRangeEnd(c):Vt.fromRangeStart(c),p=$k(m.container(),n.getBody());if(i){const w=HS(p,m);return Po(w.positions)}else{const w=rT(p,m);return $o(w.positions)}},A7=(n,i,c)=>wR(n,i).filter(c).exists(m=>(n.selection.setRng(m.toRange()),!0)),PA=(n,i)=>{const c=n.dom.createRng();c.setStart(i.container(),i.offset()),c.setEnd(i.container(),i.offset()),n.selection.setRng(c)},_R=(n,i)=>{n?i.setAttribute("data-mce-selected","inline-boundary"):i.removeAttribute("data-mce-selected")},D7=(n,i,c)=>uR(i,c).map(m=>(PA(n,m),c)),fj=(n,i,c)=>{const m=Vt.fromRangeStart(n);if(n.collapsed)return m;{const p=Vt.fromRangeEnd(n);return c?Hu(i,p).getOr(p):Hf(i,m).getOr(m)}},Tm=(n,i,c)=>{const m=n.getBody(),p=fj(n.selection.getRng(),m,c),w=He(j2,n);return oj(c,w,m,p).bind(M=>D7(n,i,M))},dj=(n,i,c)=>{const m=pt(pl(Ke.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),x=>x.dom),p=At(m,n),w=At(c,n);Ne(wa(p,w),He(_R,!1)),Ne(wa(w,p),He(_R,!0))},SR=(n,i)=>{const c=i.get();if(n.selection.isCollapsed()&&!n.composing&&c){const m=Vt.fromRangeStart(n.selection.getRng());Vt.isTextPosition(m)&&!EW(m)&&(PA(n,gO(c,m)),i.set(null))}},P7=(n,i,c,m)=>{if(i.selection.isCollapsed()){const p=At(m,n);Ne(p,w=>{const x=Vt.fromRangeStart(i.selection.getRng());w1(n,i.getBody(),x).bind(M=>D7(i,c,M))})}},MA=(n,i,c)=>P0(n)?Tm(n,i,c).isSome():!1,M7=(n,i,c)=>P0(i)?b7(n,i):!1,hj=n=>{const i=Ga(null),c=He(j2,n);return n.on("NodeChange",m=>{P0(n)&&(dj(c,n.dom,m.parents),SR(n,i),P7(c,n,i,m.parents))}),i},mj=He(M7,!0),gj=He(M7,!1),RA=(n,i,c)=>{if(P0(n)){const m=wR(n,i).getOrThunk(()=>{const p=n.selection.getRng();return i?Vt.fromRangeEnd(p):Vt.fromRangeStart(p)});return w1(He(j2,n),n.getBody(),m).exists(p=>{const w=oT(p);return uR(c,w).exists(x=>(PA(n,x),!0))})}else return!1},R7=(n,i)=>{const c=document.createRange();return c.setStart(n.container(),n.offset()),c.setEnd(i.container(),i.offset()),c},pj=n=>ri(cl(n),Vd(n),(i,c)=>{const m=Sg(!0,i),p=Sg(!1,c);return Hf(n,m).forall(w=>w.isEqual(p))}).getOr(!0),$7=(n,i)=>c=>uR(i,c).map(m=>()=>PA(n,m)),VS=(n,i,c,m)=>{const p=n.getBody(),w=He(j2,n);n.undoManager.ignore(()=>{n.selection.setRng(R7(c,m)),c5(n),w1(w,p,Vt.fromRangeStart(n.selection.getRng())).map(ZS).bind($7(n,i)).each(Cn)}),n.nodeChanged()},mv=(n,i)=>{const c=pm(i,n);return c||n},mw=(n,i,c,m)=>{const p=mv(n.getBody(),m.container()),w=He(j2,n),x=w1(w,p,m);return x.bind(B=>c?B.fold(Qe(he.some(ZS(B))),he.none,Qe(he.some(oT(B))),he.none):B.fold(he.none,Qe(he.some(oT(B))),he.none,Qe(he.some(ZS(B))))).map($7(n,i)).getOrThunk(()=>{const B=Sb(c,p,m),q=B.bind(ae=>w1(w,p,ae));return ri(x,q,()=>J0(w,p,m).bind(ae=>pj(ae)?he.some(()=>{K0(n,c,Ke.fromDom(ae))}):he.none())).getOrThunk(()=>q.bind(()=>B.map(ae=>()=>{c?VS(n,i,m,ae):VS(n,i,ae,m)})))})},WS=(n,i,c)=>{if(n.selection.isCollapsed()&&P0(n)){const m=Vt.fromRangeStart(n.selection.getRng());return mw(n,i,c,m)}return he.none()},CR=n=>dc(n)>1,$A=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=Ke.fromDom(n.selection.getStart()),p=G0(m,c);return Ss(p,i).fold(Qe(p),w=>p.slice(0,w))},N7=n=>dc(n)===1,bj=n=>$A(n,i=>hc(i)||CR(i)),I7=n=>$A(n,hc),kR=(n,i)=>{const c=He(Z5,n);return $s(i,m=>c(m)?[m.dom]:[])},B7=n=>{const i=I7(n);return kR(n,i)},vj=(n,i,c,m)=>{const p=kR(i,m);if(p.length===0)K0(i,n,c);else{const w=ES(c.dom,p);i.selection.setRng(w.toRange())}},Oj=(n,i)=>{const c=At(bj(n),N7);return Po(c).bind(m=>{const p=Vt.fromRangeStart(n.selection.getRng());return u5(i,p,m.dom)&&!W3(m)?he.some(()=>vj(i,n,m,c)):he.none()})},yj=(n,i)=>{const c=i.parentElement;return mi(i)&&!G(c)&&n.dom.isEmpty(c)},wj=n=>W3(Ke.fromDom(n)),L7=(n,i)=>{const c=n.selection.getStart(),m=yj(n,c)||wj(c)?ES(c,i):rU(n.selection.getRng(),i);n.selection.setRng(m.toRange())},F7=(n,i)=>{const c=wa(i,B7(n));c.length>0&&L7(n,c)},xR=n=>_n(n.startContainer),Wie=n=>n.startOffset===0&&xR(n),Uie=(n,i)=>{const c=i.startContainer.parentElement;return!G(c)&&Z5(n,Ke.fromDom(c))},Yie=n=>{const i=n.startContainer.parentNode,c=n.endContainer.parentNode;return!G(i)&&!G(c)&&i.isEqualNode(c)},_j=n=>{const i=n.endContainer;return n.endOffset===(_n(i)?i.length:i.childNodes.length)},Xie=n=>Yie(n)&&_j(n),jie=n=>!n.endContainer.isEqualNode(n.commonAncestorContainer),Sj=n=>Xie(n)||jie(n),Cj=n=>{const i=n.selection.getRng();return Wie(i)&&Uie(n,i)&&Sj(i)},qie=n=>{if(Cj(n)){const i=B7(n);return he.some(()=>{c5(n),F7(n,i)})}else return he.none()},TR=(n,i)=>n.selection.isCollapsed()?Oj(n,i):qie(n),Bh=n=>R5(n,i=>qc(i.dom),hc),Q7=n=>Bh(Ke.fromDom(n.selection.getStart())),lT=n=>{const i=n.selection.getRng();return i.collapsed&&(xR(i)||n.dom.isEmpty(i.startContainer))&&!Q7(n)},cT=n=>(lT(n)&&L7(n,[]),!0),NA=(n,i,c)=>Oe(c)?he.some(()=>{n._selectionOverrides.hideFakeCaret(),K0(n,i,Ke.fromDom(c))}):he.none(),Z7=(n,i)=>{const c=i?j0:vS,m=i?vn.Forwards:vn.Backwards,p=Ce(m,n.getBody(),n.selection.getRng());return c(p)?NA(n,i,p.getNode(!i)):he.from(Sg(i,p)).filter(w=>c(w)&&zt(p,w)).bind(w=>NA(n,i,w.getNode(!i)))},ER=(n,i)=>{const c=n.selection.getNode();return sf(c)?NA(n,i,c):he.none()},AR=(n,i)=>n.selection.isCollapsed()?Z7(n,i):ER(n,i),kj=n=>Zl(n,i=>ba(i.dom)||Es(i.dom)).exists(i=>ba(i.dom)),IA=n=>ou(n!=null?n:"").getOr(0),H7=(n,i)=>{const c=n||xt(i)?"margin":"padding",m=Bi(i,"direction")==="rtl"?"-right":"-left";return c+m},xj=(n,i,c,m,p,w)=>{const x=H7(c,Ke.fromDom(w)),M=IA(n.getStyle(w,x));if(i==="outdent"){const B=Math.max(0,M-m);n.setStyle(w,x,B?B+p:"")}else{const B=M+m+p;n.setStyle(w,x,B)}},Tj=(n,i)=>tr(i,c=>{const m=H7(T_(n),c),p=Pa(c,m).map(IA).getOr(0);return n.dom.getContentEditable(c.dom)!=="false"&&p>0}),BA=n=>{const i=Aj(n);return!n.mode.isReadOnly()&&(i.length>1||Tj(n,i))},z7=n=>Bu(n)||ja(n),Ej=n=>fi(n).exists(z7),Aj=n=>At(lh(n.selection.getSelectedBlocks()),i=>!z7(i)&&!Ej(i)&&kj(i)),V7=(n,i)=>{var c,m;const{dom:p}=n,w=uk(n),x=(m=(c=/[a-z%]+$/i.exec(w))===null||c===void 0?void 0:c[0])!==null&&m!==void 0?m:"px",M=IA(w),B=T_(n);Ne(Aj(n),q=>{xj(p,i,B,M,x,q.dom)})},W7=n=>V7(n,"indent"),Dj=n=>V7(n,"outdent"),U7=n=>{if(n.selection.isCollapsed()&&BA(n)){const i=n.dom,c=n.selection.getRng(),m=Vt.fromRangeStart(c),p=i.getParent(c.startContainer,i.isBlock);if(p!==null&&JP(Ke.fromDom(p),m))return he.some(()=>Dj(n))}return he.none()},Y7=(n,i,c)=>Ls([U7,cv,rR,(m,p)=>WS(m,i,p),eR,Eb,cR,AR,tR,TR],m=>m(n,c)).filter(m=>n.selection.isEditable()),Pj=(n,i)=>{Y7(n,i,!1).fold(()=>{c5(n),q2(n)},Cn)},DR=(n,i)=>{Y7(n,i,!0).fold(()=>OS(n),Cn)},LA=(n,i)=>{n.addCommand("delete",()=>{Pj(n,i)}),n.addCommand("forwardDelete",()=>{DR(n,i)})},PR=5,X7=400,j7=n=>n.touches===void 0||n.touches.length!==1?he.none():he.some(n.touches[0]),Mj=(n,i)=>{const c=Math.abs(n.clientX-i.x),m=Math.abs(n.clientY-i.y);return c>PR||m>PR},MR=n=>{const i=Sh(),c=Ga(!1),m=zv(p=>{n.dispatch("longpress",{...p,type:"longpress"}),c.set(!0)},X7);n.on("touchstart",p=>{j7(p).each(w=>{m.cancel();const x={x:w.clientX,y:w.clientY,target:p.target};m.throttle(p),c.set(!1),i.set(x)})},!0),n.on("touchmove",p=>{m.cancel(),j7(p).each(w=>{i.on(x=>{Mj(w,x)&&(i.clear(),c.set(!1),n.dispatch("longpresscancel"))})})},!0),n.on("touchend touchcancel",p=>{m.cancel(),p.type!=="touchcancel"&&i.get().filter(w=>w.target.isEqualNode(p.target)).each(()=>{c.get()?p.preventDefault():n.dispatch("tap",{...p,type:"tap"})})},!0)},RR=(n,i)=>fn(n,i.nodeName),Rj=(n,i)=>_n(i)?!0:Jn(i)?!RR(n.getBlockElements(),i)&&!Wd(i)&&!ig(n,i):!1,$j=(n,i,c)=>jt(lW(Ke.fromDom(c),Ke.fromDom(i)),m=>RR(n,m.dom)),Nj=(n,i)=>{if(_n(i)){if(i.data.length===0)return!0;if(/^\s+$/.test(i.data)&&(!i.nextSibling||RR(n,i.nextSibling)))return!0}return!1},Pg=n=>n.dom.create(jc(n),db(n)),q7=n=>{const i=n.dom,c=n.selection,m=n.schema,p=m.getBlockElements(),w=c.getStart(),x=n.getBody();let M,B,q=!1;const ae=jc(n);if(!w||!Jn(w))return;const fe=x.nodeName.toLowerCase();if(!m.isValidChild(fe,ae.toLowerCase())||$j(p,x,w))return;const be=c.getRng(),{startContainer:Le,startOffset:Ye,endContainer:Me,endOffset:Ve}=be,gt=U2(n);let Ot=x.firstChild;for(;Ot;)if(Jn(Ot)&&Rv(m,Ot),Rj(m,Ot)){if(Nj(p,Ot)){B=Ot,Ot=Ot.nextSibling,i.remove(B);continue}M||(M=Pg(n),x.insertBefore(M,Ot),q=!0),B=Ot,Ot=Ot.nextSibling,M.appendChild(B)}else M=null,Ot=Ot.nextSibling;q&>&&(be.setStart(Le,Ye),be.setEnd(Me,Ve),c.setRng(be),n.nodeChanged())},$R=(n,i,c)=>{const m=Ke.fromDom(Pg(n)),p=ye();na(m,p),c(i,m);const w=document.createRange();return w.setStartBefore(p.dom),w.setEndBefore(p.dom),w},Gie=n=>{n.on("NodeChange",He(q7,n))},Ij=n=>i=>(" "+i.attr("class")+" ").indexOf(n)!==-1,Kie=(n,i,c)=>function(m){const p=arguments,w=p[p.length-2],x=w>0?i.charAt(w-1):"";if(x==='"')return m;if(x===">"){const M=i.lastIndexOf("<",w);if(M!==-1&&i.substring(M,w).indexOf('contenteditable="false"')!==-1)return m}return'<span class="'+c+'" data-mce-content="'+n.dom.encode(p[0])+'">'+n.dom.encode(typeof p[1]=="string"?p[1]:p[0])+"</span>"},Jie=(n,i,c)=>{let m=i.length,p=c.content;if(c.format!=="raw"){for(;m--;)p=p.replace(i[m],Kie(n,p,p2(n)));c.content=p}},Bj=n=>{const i="contenteditable",c=" "+gn.trim(Sk(n))+" ",m=" "+gn.trim(p2(n))+" ",p=Ij(c),w=Ij(m),x=Ck(n);x.length>0&&n.on("BeforeSetContent",M=>{Jie(n,x,M)}),n.parser.addAttributeFilter("class",M=>{let B=M.length;for(;B--;){const q=M[B];p(q)?q.attr(i,"true"):w(q)&&q.attr(i,"false")}}),n.serializer.addAttributeFilter(i,M=>{let B=M.length;for(;B--;){const q=M[B];!p(q)&&!w(q)||(x.length>0&&q.attr("data-mce-content")?(q.name="#text",q.type=3,q.raw=!0,q.value=q.attr("data-mce-content")):q.attr(i,null))}})},FA=n=>Je(Ke.fromDom(n.getBody()),"*[data-mce-caret]").map(i=>i.dom).getOrNull(),G7=(n,i)=>{i.hasAttribute("data-mce-caret")&&(Km(i),n.selection.setRng(n.selection.getRng()),n.selection.scrollIntoView(i))},NR=(n,i)=>{const c=FA(n);if(!!c){if(i.type==="compositionstart"){i.preventDefault(),i.stopPropagation(),G7(n,c);return}Uc(c)&&(G7(n,c),n.undoManager.add())}},K7=n=>{n.on("keyup compositionstart",He(NR,n))},IR=Es,J7=(n,i,c)=>T7(i,n,c,AO,q0,IR),Lj=(n,i,c)=>E7(i,n,c,w=>AO(w)||jI(w),w=>q0(w)||qI(w),IR),Fj=n=>{const i=n.dom.create(jc(n));return i.innerHTML='<br data-mce-bogus="1">',i},eF=(n,i,c)=>{const m=Ea(n.getBody()),p=He(St,i===1?m.next:m.prev);if(c.collapsed){const w=n.dom.getParent(c.startContainer,"PRE");if(!w)return;if(!p(Vt.fromRangeStart(c))){const M=Ke.fromDom(Fj(n));i===1?iu(Ke.fromDom(w),M):Ca(Ke.fromDom(w),M),n.selection.select(M.dom,!0),n.selection.collapse()}}},Qj=(n,i)=>{const c=i?vn.Forwards:vn.Backwards,m=n.selection.getRng();return J7(c,n,m).orThunk(()=>(eF(n,c,m),he.none()))},QA=(n,i)=>{const c=i?1:-1,m=n.selection.getRng();return Lj(c,n,m).orThunk(()=>(eF(n,c,m),he.none()))},Zj=(n,i)=>{const c=i?n.getEnd(!0):n.getStart(!0);return dB(c)?!i:i},tF=(n,i)=>Qj(n,Zj(n.selection,i)).exists(c=>(hv(n,c),!0)),nF=(n,i)=>QA(n,i).exists(c=>(hv(n,c),!0)),ZA=(n,i)=>A7(n,i,i?q0:AO),HA=(n,i)=>wA(n,!i).map(c=>{const m=c.toRange(),p=n.selection.getRng();return i?m.setStart(p.startContainer,p.startOffset):m.setEnd(p.endContainer,p.endOffset),m}).exists(c=>(hv(n,c),!0)),Hj=n=>kt(["figcaption"],ti(n)),oF=(n,i)=>{const c=He(vt,i);return Zl(Ke.fromDom(n.container()),hc,c).filter(Hj)},zj=(n,i,c)=>i?EA(n.dom,c):pR(n.dom,c),Vj=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=Vt.fromRangeStart(n.selection.getRng());return oF(m,c).exists(()=>{if(zj(c,i,m)){const w=$R(n,c,i?na:ah);return n.selection.setRng(w),!0}else return!1})},sF=(n,i)=>n.selection.isCollapsed()?Vj(n,i):!1,Wj=(n,i,c)=>{const m=n.selection.getRng(),p=Vt.fromRangeStart(m);return n.getBody().firstChild===i&&pR(c,p)?(n.execCommand("InsertNewBlockBefore"),!0):!1},Uj=(n,i)=>{const c=n.selection.getRng(),m=Vt.fromRangeStart(c);return n.getBody().lastChild===i&&EA(i,m)?(n.execCommand("InsertNewBlockAfter"),!0):!1},Yj=(n,i)=>i?he.from(n.dom.getParent(n.selection.getNode(),"details")).map(c=>Uj(n,c)).getOr(!1):he.from(n.dom.getParent(n.selection.getNode(),"summary")).bind(c=>he.from(n.dom.getParent(c,"details")).map(m=>Wj(n,m,c))).getOr(!1),zA=(n,i)=>Yj(n,i),rF={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},iF=n=>pt(n,i=>({...rF,...i})),Xj=n=>pt(n,i=>({...rF,...i})),aF=(n,i)=>i.keyCode===n.keyCode&&i.shiftKey===n.shiftKey&&i.altKey===n.altKey&&i.ctrlKey===n.ctrlKey&&i.metaKey===n.metaKey,jj=(n,i)=>$s(iF(n),c=>aF(c,i)?[c]:[]),qj=(n,i)=>$s(Xj(n),c=>aF(c,i)?[c]:[]),ds=(n,...i)=>()=>n.apply(null,i),uT=(n,i)=>oo(jj(n,i),c=>c.action()),ac=(n,i)=>Ls(qj(n,i),c=>c.action()),lF=(n,i)=>{const c=i?vn.Forwards:vn.Backwards,m=n.selection.getRng();return T7(n,c,m,j0,vS,sf).exists(p=>(hv(n,p),!0))},cF=(n,i)=>{const c=i?1:-1,m=n.selection.getRng();return E7(n,c,m,j0,vS,sf).exists(p=>(hv(n,p),!0))},uF=(n,i)=>A7(n,i,i?vS:j0),BR=pg.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),US={...BR,none:n=>BR.none(n)},WO=(n,i)=>VA(n,i,mt),VA=(n,i,c)=>$s(Da(n),m=>Pu(m,i)?c(m)?[m]:[]:VA(m,i,c)),dF=(n,i,c=je)=>{if(c(i))return he.none();if(kt(n,ti(i)))return he.some(i);const m=p=>Pu(p,"table")||c(p);return Se(i,n.join(","),m)},LR=(n,i)=>dF(["td","th"],n,i),FR=n=>WO(n,"th,td"),WA=(n,i)=>at(n,"table",i),UA=(n,i,c,m,p=mt)=>{const w=m===1;if(!w&&c<=0)return US.first(n[0]);if(w&&c>=n.length-1)return US.last(n[n.length-1]);{const x=c+m,M=n[x];return p(M)?US.middle(i,M):UA(n,i,x,m,p)}},fT=(n,i)=>WA(n,i).bind(c=>{const m=FR(c);return Ss(m,w=>vt(n,w)).map(w=>({index:w,all:m}))}),YA=(n,i,c)=>fT(n,c).fold(()=>US.none(n),p=>UA(p.all,n,p.index,1,i)),dT=(n,i,c)=>fT(n,c).fold(()=>US.none(),p=>UA(p.all,n,p.index,-1,i)),hT=(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}),Ap=(n,i)=>$s(i,c=>{const m=hT(Jp(c.getBoundingClientRect()),-1);return[{x:m.left,y:n(m),cell:c},{x:m.right,y:n(m),cell:c}]}),mT=(n,i,c)=>zn(n,(m,p)=>m.fold(()=>he.some(p),w=>{const x=Math.sqrt(Math.abs(w.x-i)+Math.abs(w.y-c)),M=Math.sqrt(Math.abs(p.x-i)+Math.abs(p.y-c));return he.some(M<x?p:w)}),he.none()),QR=(n,i,c,m,p)=>{const w=pl(Ke.fromDom(c),"td,th,caption").map(M=>M.dom),x=At(Ap(n,w),M=>i(M,p));return mT(x,m,p).map(M=>M.cell)},hF=n=>n.bottom,Gj=n=>n.top,mF=(n,i)=>n.y<i,Kj=(n,i)=>n.y>i,Jj=He(QR,hF,mF),gT=He(QR,Gj,Kj),eq=(n,i)=>$o(i.getClientRects()).bind(c=>Jj(n,c.left,c.top)).bind(c=>TA(bR(c),i)),tq=(n,i)=>Po(i.getClientRects()).bind(c=>gT(n,c.left,c.top)).bind(c=>TA(w7(c),i)),nq=(n,i,c)=>c.breakAt.exists(m=>n(i,m).breakAt.isSome()),oq=n=>n.breakType===dv.Wrap&&n.positions.length===0,sq=n=>n.breakType===dv.Br&&n.positions.length===1,gF=(n,i,c)=>{const m=n(i,c);return oq(m)||!mi(c.getNode())&&sq(m)?!nq(n,i,m):m.breakAt.isNone()},rq=He(gF,rT),iq=He(gF,HS),aq=(n,i,c)=>{const m=Vt.fromRangeStart(i);return bO(!n,c).exists(p=>p.isEqual(m))},lq=(n,i,c,m)=>{const p=n.selection.getRng(),w=i?1:-1;return L0()&&aq(i,p,c)?(lv(w,n,c,!i,!1).each(x=>{hv(n,x)}),!0):!1},cq=(n,i,c)=>eq(i,c).orThunk(()=>$o(c.getClientRects()).bind(m=>gR(y7(n,Vt.before(i)),m.left))).getOr(Vt.before(i)),uq=(n,i,c)=>tq(i,c).orThunk(()=>$o(c.getClientRects()).bind(m=>gR(HO(n,Vt.after(i)),m.left))).getOr(Vt.after(i)),pF=(n,i)=>{const c=i.getNode(n);return Iu(c)?he.some(c):he.none()},fq=(n,i,c)=>{i.undoManager.transact(()=>{const m=n?iu:Ca,p=$R(i,Ke.fromDom(c),m);hv(i,p)})},ZR=(n,i,c)=>{const m=pF(!!i,c),p=i===!1;m.fold(()=>hv(n,c.toRange()),w=>bO(p,n.getBody()).filter(x=>x.isEqual(c)).fold(()=>hv(n,c.toRange()),x=>fq(i,n,w)))},bF=(n,i,c,m)=>{const p=n.selection.getRng(),w=Vt.fromRangeStart(p),x=n.getBody();if(!i&&rq(m,w)){const M=cq(x,c,w);return ZR(n,i,M),!0}else if(i&&iq(m,w)){const M=uq(x,c,w);return ZR(n,i,M),!0}else return!1},HR=(n,i,c)=>he.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(m=>he.from(n.dom.getParent(m,"table")).map(p=>c(n,i,p,m))).getOr(!1),vF=(n,i)=>HR(n,i,lq),zR=(n,i)=>HR(n,i,bF),dq=n=>{const i=d1.exact(n,0,n,0);return BP(i)},OF=(n,i,c)=>c.fold(he.none,he.none,(m,p)=>VV(p).map(w=>dq(w)),m=>(n.execCommand("mceTableInsertRowAfter"),VR(n,i,m))),VR=(n,i,c)=>OF(n,i,YA(c,wn)),hq=(n,i,c)=>OF(n,i,dT(c,wn)),WR=(n,i)=>{const c=["table","li","dl"],m=Ke.fromDom(n.getBody()),p=M=>{const B=ti(M);return vt(M,m)||kt(c,B)},w=n.selection.getRng(),x=Ke.fromDom(i?w.endContainer:w.startContainer);return LR(x,p).map(M=>(WA(M,p).each(ae=>{n.model.table.clearSelectedCells(ae.dom)}),n.selection.collapse(!i),(i?VR:hq)(n,p,M).each(ae=>{n.selection.setRng(ae)}),!0)).getOr(!1)},mq=(n,i,c)=>{const m=qn.os.isMacOS()||qn.os.isiOS();uT([{keyCode:to.RIGHT,action:ds(tF,n,!0)},{keyCode:to.LEFT,action:ds(tF,n,!1)},{keyCode:to.UP,action:ds(nF,n,!1)},{keyCode:to.DOWN,action:ds(nF,n,!0)},...m?[{keyCode:to.UP,action:ds(HA,n,!1),metaKey:!0,shiftKey:!0},{keyCode:to.DOWN,action:ds(HA,n,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:to.RIGHT,action:ds(vF,n,!0)},{keyCode:to.LEFT,action:ds(vF,n,!1)},{keyCode:to.UP,action:ds(zR,n,!1)},{keyCode:to.DOWN,action:ds(zR,n,!0)},{keyCode:to.UP,action:ds(zR,n,!1)},{keyCode:to.UP,action:ds(zA,n,!1)},{keyCode:to.DOWN,action:ds(zA,n,!0)},{keyCode:to.RIGHT,action:ds(lF,n,!0)},{keyCode:to.LEFT,action:ds(lF,n,!1)},{keyCode:to.UP,action:ds(cF,n,!1)},{keyCode:to.DOWN,action:ds(cF,n,!0)},{keyCode:to.RIGHT,action:ds(MA,n,i,!0)},{keyCode:to.LEFT,action:ds(MA,n,i,!1)},{keyCode:to.RIGHT,ctrlKey:!m,altKey:m,action:ds(mj,n,i)},{keyCode:to.LEFT,ctrlKey:!m,altKey:m,action:ds(gj,n,i)},{keyCode:to.UP,action:ds(sF,n,!1)},{keyCode:to.DOWN,action:ds(sF,n,!0)}],c).each(p=>{c.preventDefault()})},yF=(n,i)=>{n.on("keydown",c=>{c.isDefaultPrevented()||mq(n,i,c)})},Dp=(n,i)=>({container:n,offset:i}),XA=Qr.DOM,jA=n=>i=>n===i?-1:0,gq=n=>i=>n.isBlock(i)||kt(["BR","IMG","HR","INPUT"],i.nodeName)||n.getContentEditable(i)==="false",qA=(n,i,c)=>{if(_n(n)&&i>=0)return he.some(Dp(n,i));{const m=fp(XA);return he.from(m.backwards(n,i,jA(n),c)).map(p=>Dp(p.container,p.container.data.length))}},pq=(n,i,c)=>{if(_n(n)&&i>=n.length)return he.some(Dp(n,i));{const m=fp(XA);return he.from(m.forwards(n,i,jA(n),c)).map(p=>Dp(p.container,0))}},UR=(n,i,c)=>{if(!_n(n))return he.none();const m=n.data;if(i>=0&&i<=m.length)return he.some(Dp(n,i));{const p=fp(XA);return he.from(p.backwards(n,i,jA(n),c)).bind(w=>{const x=w.container.data;return UR(w.container,i+x.length,c)})}},YR=(n,i,c)=>{if(!_n(n))return he.none();const m=n.data;if(i<=m.length)return he.some(Dp(n,i));{const p=fp(XA);return he.from(p.forwards(n,i,jA(n),c)).bind(w=>YR(w.container,i-m.length,c))}},XR=(n,i,c,m,p)=>{const w=fp(n,gq(n));return he.from(w.backwards(i,c,m,p))},bq=n=>n.collapsed&&_n(n.startContainer),jR=n=>In(n.toString().replace(/\u00A0/g," ")),wF=n=>n!==""&&` \xA0\f
|
|
\r \v`.indexOf(n)!==-1,qR=(n,i)=>n.substring(i.length),vq=(n,i,c)=>{let m;const p=c.charAt(0);for(m=i-1;m>=0;m--){const w=n.charAt(m);if(wF(w))return he.none();if(p===w&&nr(n,c,m,i))break}return he.some(m)},_F=(n,i,c,m=0)=>{if(!bq(i))return he.none();const p={text:"",offset:0},w=(M,B,q)=>(p.text=q+p.text,p.offset+=B,vq(p.text,p.offset,c).getOr(B)),x=n.getParent(i.startContainer,n.isBlock)||n.getRoot();return XR(n,i.startContainer,i.startOffset,w,x).bind(M=>{const B=i.cloneRange();if(B.setStart(M.container,M.offset),B.setEnd(i.endContainer,i.endOffset),B.collapsed)return he.none();const q=jR(B);return q.lastIndexOf(c)!==0||qR(q,c).length<m?he.none():he.some({text:qR(q,c),range:B,trigger:c})})},GR=(n,i,c,m=0)=>XV(Ke.fromDom(i.startContainer)).fold(()=>_F(n,i,c,m),p=>{const w=n.createRng();w.selectNode(p.dom);const x=jR(w);return he.some({range:w,text:qR(x,c),trigger:c})}),Oq=n=>n.nodeType===eh,yq=n=>n.nodeType===qf,SF=n=>{if(Oq(n))return Dp(n,n.data.length);{const i=n.childNodes;return i.length>0?SF(i[i.length-1]):Dp(n,i.length)}},CF=(n,i)=>{const c=n.childNodes;return c.length>0&&i<c.length?CF(c[i],0):c.length>0&&yq(n)&&c.length===i?SF(c[c.length-1]):Dp(n,i)},wq=(n,i)=>{var c;const m=(c=n.getParent(i.container,n.isBlock))!==null&&c!==void 0?c:n.getRoot();return XR(n,i.container,i.offset,(p,w)=>w===0?-1:w,m).filter(p=>{const w=p.container.data.charAt(p.offset-1);return!wF(w)}).isSome()},_q=n=>i=>{const c=CF(i.startContainer,i.startOffset);return!wq(n,c)},Sq=(n,i,c)=>Ls(c.triggers,m=>GR(n,i,m)),Cq=(n,i)=>{const c=i(),m=n.selection.getRng();return Sq(n.dom,m,c).bind(p=>kq(n,i,p))},kq=(n,i,c,m={})=>{var p;const w=i(),M=(p=n.selection.getRng().startContainer.nodeValue)!==null&&p!==void 0?p:"",B=At(w.lookupByTrigger(c.trigger),ae=>c.text.length>=ae.minChars&&ae.matches.getOrThunk(()=>_q(n.dom))(c.range,M,c.text));if(B.length===0)return he.none();const q=Promise.all(pt(B,ae=>ae.fetch(c.text,ae.maxResults,m).then(be=>({matchText:c.text,items:be,columns:ae.columns,onAction:ae.onAction,highlightOn:ae.highlightOn}))));return he.some({lookupData:q,context:c})};var _1;(function(n){n[n.Error=0]="Error",n[n.Value=1]="Value"})(_1||(_1={}));const YS=(n,i,c)=>n.stype===_1.Error?i(n.serror):c(n.svalue),kF=n=>{const i=[],c=[];return Ne(n,m=>{YS(m,p=>c.push(p),p=>i.push(p))}),{values:i,errors:c}},xF=(n,i)=>n.stype===_1.Error?{stype:_1.Error,serror:i(n.serror)}:n,xq=(n,i)=>n.stype===_1.Value?{stype:_1.Value,svalue:i(n.svalue)}:n,TF=(n,i)=>n.stype===_1.Value?i(n.svalue):n,EF=(n,i)=>n.stype===_1.Error?i(n.serror):n,AF=n=>({stype:_1.Value,svalue:n}),DF=n=>({stype:_1.Error,serror:n}),Xu={fromResult:n=>n.fold(DF,AF),toResult:n=>YS(n,bc.error,bc.value),svalue:AF,partition:kF,serror:DF,bind:TF,bindError:EF,map:xq,mapError:xF,fold:YS},pT=n=>te(n)&&bs(n).length>100?" removed due to size":JSON.stringify(n,null,2),Eq=n=>{const i=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:Qe("... (only showing first ten failures)")}]):n;return pt(i,c=>"Failed path: ("+c.path.join(" > ")+`)
|
|
`+c.getErrorInfo())},GA=(n,i)=>Xu.serror([{path:n,getErrorInfo:i}]),Aq=(n,i,c)=>GA(n,()=>'Could not find valid *required* value for "'+i+'" in '+pT(c)),PF=(n,i)=>GA(n,()=>'Choice schema did not contain choice key: "'+i+'"'),Dq=(n,i,c)=>GA(n,()=>'The chosen schema: "'+c+'" did not exist in branches: '+pT(i)),Pq=(n,i)=>GA(n,Qe(i)),Mq=(n,i,c,m)=>wo(c,m).fold(()=>Dq(n,c,m),w=>w.extract(n.concat(["branch: "+m]),i)),Rq=(n,i)=>({extract:(p,w)=>wo(w,n).fold(()=>PF(p,n),M=>Mq(p,w,i,M)),toString:()=>"chooseOn("+n+"). Possible values: "+bs(i)}),$q=(n,i)=>i,Rc=(n,i)=>ne(n)&&ne(i)?KA(n,i):i,S1=n=>(...i)=>{if(i.length===0)throw new Error("Can't merge zero objects");const c={};for(let m=0;m<i.length;m++){const p=i[m];for(const w in p)fn(p,w)&&(c[w]=n(c[w],p[w]))}return c},KA=S1(Rc),tae=S1($q),MF=()=>({tag:"required",process:{}}),Nq=n=>({tag:"defaultedThunk",process:n}),RF=n=>Nq(Qe(n)),Iq=()=>({tag:"option",process:{}}),$F=(n,i)=>n.length>0?Xu.svalue(KA(i,tae.apply(void 0,n))):Xu.svalue(i),gw=n=>V(Xu.serror,Mr)(n),Bq={consolidateObj:(n,i)=>{const c=Xu.partition(n);return c.errors.length>0?gw(c.errors):$F(c.values,i)},consolidateArr:n=>{const i=Xu.partition(n);return i.errors.length>0?gw(i.errors):Xu.svalue(i.values)}},C1=(n,i,c,m)=>({tag:"field",key:n,newKey:i,presence:c,prop:m}),Lq=(n,i)=>({tag:"custom",newKey:n,instantiator:i}),NF=(n,i,c)=>{switch(n.tag){case"field":return i(n.key,n.newKey,n.presence,n.prop);case"custom":return c(n.newKey,n.instantiator)}},JA=n=>{const i=(m,p)=>Xu.bindError(n(p),w=>Pq(m,w)),c=Qe("val");return{extract:i,toString:c}},Fq=JA(Xu.svalue),KR=(n,i,c,m)=>wo(i,c).fold(()=>Aq(n,c,i),m),JR=(n,i,c,m)=>{const p=wo(n,i).getOrThunk(()=>c(n));return m(p)},Qq=(n,i,c)=>c(wo(n,i)),Zq=(n,i,c,m)=>{const p=wo(n,i).map(w=>w===!0?c(n):w);return m(p)},Hq=(n,i,c,m,p)=>{const w=M=>p.extract(i.concat([m]),M),x=M=>M.fold(()=>Xu.svalue(he.none()),B=>{const q=p.extract(i.concat([m]),B);return Xu.map(q,he.some)});switch(n.tag){case"required":return KR(i,c,m,w);case"defaultedThunk":return JR(c,m,n.process,w);case"option":return Qq(c,m,x);case"defaultedOptionThunk":return Zq(c,m,n.process,x);case"mergeWithThunk":return JR(c,m,Qe({}),M=>{const B=KA(n.process(c),M);return w(B)})}},IF=(n,i,c)=>{const m={},p=[];for(const w of c)NF(w,(x,M,B,q)=>{const ae=Hq(B,n,i,x,q);Xu.fold(ae,fe=>{p.push(...fe)},fe=>{m[M]=fe})},(x,M)=>{m[x]=M(i)});return p.length>0?Xu.serror(p):Xu.svalue(m)},e4=n=>({extract:(m,p)=>IF(m,p,n),toString:()=>`obj{
|
|
`+pt(n,p=>NF(p,(w,x,M,B)=>w+" -> "+B.toString(),(w,x)=>"state("+w+")")).join(`
|
|
`)+"}"}),t4=n=>({extract:(m,p)=>{const w=pt(p,(x,M)=>n.extract(m.concat(["["+M+"]"]),x));return Bq.consolidateArr(w)},toString:()=>"array("+n.toString()+")"}),e$=n=>JA(i=>n(i).fold(Xu.serror,Xu.svalue)),t$=(n,i,c)=>{const m=i.extract([n],c);return Xu.mapError(m,p=>({input:c,errors:p}))},zq=(n,i,c)=>Xu.toResult(t$(n,i,c)),Vq=n=>`Errors:
|
|
`+Eq(n.errors).join(`
|
|
`)+`
|
|
|
|
Input object: `+pT(n.input),BF=(n,i)=>Rq(n,vs(i,e4)),Wq=Qe(Fq),XS=(n,i)=>JA(c=>{const m=typeof c;return n(c)?Xu.svalue(c):Xu.serror(`Expected type: ${i} but got: ${m}`)}),LF=XS(Xe,"number"),n4=XS(L,"string"),FF=XS(we,"boolean"),n$=XS(ce,"function"),pw=C1,QF=Lq,Uq=n=>e$(i=>kt(n,i)?bc.value(i):bc.error(`Unsupported value: "${i}", choose one of "${n.join(", ")}".`)),ZF=(n,i)=>pw(n,n,MF(),i),HF=n=>ZF(n,n4),zF=n=>ZF(n,n$),VF=(n,i)=>pw(n,n,MF(),t4(i)),bT=(n,i)=>pw(n,n,Iq(),i),vT=n=>bT(n,n4),WF=n=>bT(n,n$),Yq=(n,i)=>pw(n,n,RF(i),Wq()),jS=(n,i,c)=>pw(n,n,RF(i),c),UF=(n,i)=>jS(n,i,LF),o4=(n,i)=>jS(n,i,n4),o$=(n,i,c)=>jS(n,i,Uq(c)),s4=(n,i)=>jS(n,i,FF),s$=(n,i)=>jS(n,i,n$),Xq=(n,i,c)=>jS(n,i,t4(c)),oae=HF("type"),sae=zF("fetch"),YF=zF("onAction"),jq=s$("onSetup",()=>ot),rae=vT("text"),qq=vT("icon"),Gq=vT("tooltip"),iae=vT("label"),Kq=s4("active",!1),_l=s4("enabled",!0),r4=s4("primary",!1),$b=n=>Yq("columns",n),qS=n=>o4("type",n),XF=e4([oae,HF("trigger"),UF("minChars",1),$b(1),UF("maxResults",10),WF("matches"),sae,YF,Xq("highlightOn",[],n4)]),Jq=n=>zq("Autocompleter",XF,{trigger:n.ch,...n}),GS=[_l,Gq,qq,rae,jq],i4=[Kq].concat(GS),jF=[s$("predicate",je),o$("scope","node",["node","editor"]),o$("position","selection",["node","selection","line"])],qF=GS.concat([qS("contextformbutton"),r4,YF,QF("original",Bt)]),eG=i4.concat([qS("contextformbutton"),r4,YF,QF("original",Bt)]),tG=GS.concat([qS("contextformbutton")]),nG=i4.concat([qS("contextformtogglebutton")]),oG=BF("type",{contextformbutton:qF,contextformtogglebutton:eG});e4([qS("contextform"),s$("initValue",Qe("")),iae,VF("commands",oG),bT("launch",BF("type",{contextformbutton:tG,contextformtogglebutton:nG}))].concat(jF));const sG=n=>{const i=n.ui.registry.getAll().popups,c=vs(i,x=>Jq(x).fold(M=>{throw new Error(Vq(M))},Bt)),m=fs(Yn(c,x=>x.trigger)),p=po(c);return{dataset:c,triggers:m,lookupByTrigger:x=>At(p,M=>M.trigger===x)}},GF=(n,i)=>{const c=zv(i.load,50);n.on("keypress compositionend",m=>{m.which!==27&&c.throttle()}),n.on("keydown",m=>{const p=m.which;p===8?c.throttle():p===27&&i.cancelIfNecessary()}),n.on("remove",c.cancel)},rG=n=>{const i=Sh(),c=Ga(!1),m=i.isSet,p=()=>{m()&&(BY(n),cr(n),c.set(!1),i.clear())},w=q=>{m()||(Ka(n,q.range),i.set({trigger:q.trigger,matchLength:q.text.length}))},x=Ut(()=>sG(n)),M=q=>i.get().map(ae=>GR(n.dom,n.selection.getRng(),ae.trigger).bind(fe=>kq(n,x,fe,q))).getOrThunk(()=>Cq(n,x)),B=q=>{M(q).fold(p,ae=>{w(ae.context),ae.lookupData.then(fe=>{i.get().map(be=>{const Le=ae.context;be.trigger===Le.trigger&&(Le.text.length-be.matchLength>=10?p():(i.set({...be,matchLength:Le.text.length}),c.get()?CP(n,{lookupData:fe}):(c.set(!0),SP(n,{lookupData:fe}))))})})})};n.addCommand("mceAutocompleterReload",(q,ae)=>{const fe=te(ae)?ae.fetchOptions:{};B(fe)}),n.addCommand("mceAutocompleterClose",p),GF(n,{cancelIfNecessary:p,load:B})},iG=ys().browser.isSafari(),KF=n=>Pe(Ke.fromDom(n)),JF=(n,i)=>{var c;return n.startOffset===0&&n.endOffset===((c=i.textContent)===null||c===void 0?void 0:c.length)},OT=(n,i)=>he.from(n.getParent(i.container(),"details")),r$=(n,i)=>OT(n,i).isSome(),aG=(n,i)=>{const c=he.from(n.getParent(i.startContainer,"details")),m=he.from(n.getParent(i.endContainer,"details"));if(c.isSome()||m.isSome()){const p=c.bind(w=>he.from(n.select("summary",w)[0]));return he.some({startSummary:p,startDetails:c,endDetails:m})}else return he.none()},lG=(n,i)=>cl(i).exists(c=>c.isEqual(n)),lae=(n,i)=>Vd(i).exists(c=>mi(c.getNode())&&Hu(i,c).exists(m=>m.isEqual(n))||c.isEqual(n)),i$=(n,i)=>i.startSummary.exists(c=>lG(n,c)),cG=(n,i)=>i.startSummary.exists(c=>lae(n,c)),uG=(n,i)=>i.startDetails.exists(c=>Hu(c,n).forall(m=>i.startSummary.exists(p=>!p.contains(n.container())&&p.contains(m.container())))),fG=(n,i,c)=>c.startDetails.exists(m=>Hf(n,i).forall(p=>!m.contains(p.container()))),a$=(n,i)=>{const c=i.getNode();ve(c)||n.selection.setCursorLocation(c,i.offset())},e9=(n,i,c)=>{const m=n.dom.getParent(i.container(),"details");if(m&&!m.open){const p=n.dom.select("summary",m)[0];p&&(c?cl(p):Vd(p)).each(x=>a$(n,x))}else a$(n,i)},t9=(n,i)=>{const c=B=>B.contains(n.startContainer),m=B=>B.contains(n.endContainer),p=i.startSummary.exists(c),w=i.startSummary.exists(m),x=i.startDetails.forall(B=>i.endDetails.forall(q=>B!==q));return(p||w)&&!(p&&w)||x},n9=(n,i,c)=>{const{dom:m,selection:p}=n,w=n.getBody();if(c==="character"){const x=Vt.fromRangeStart(p.getRng()),M=m.getParent(x.container(),m.isBlock),B=OT(m,x),q=M&&m.isEmpty(M),ae=G(M==null?void 0:M.previousSibling),fe=G(M==null?void 0:M.nextSibling);return q&&(i?fe:ae)&&Sb(!i,w,x).exists(Ye=>r$(m,Ye)&&!Ll(B,OT(m,Ye)))?!0:Sb(i,w,x).fold(je,be=>{const Le=OT(m,be);if(r$(m,be)&&!Ll(B,Le)){if(i||e9(n,be,!1),M&&q){if(i&&ae)return!0;if(!i&&fe)return!0;e9(n,be,i),n.dom.remove(M)}return!0}else return!1})}else return!1},dG=(n,i,c,m)=>{const w=n.selection.getRng(),x=Vt.fromRangeStart(w),M=n.getBody();return m==="selection"?t9(w,i):c?cG(x,i)||fG(M,x,i):i$(x,i)||uG(x,i)},cae=(n,i,c)=>aG(n.dom,n.selection.getRng()).fold(()=>n9(n,i,c),m=>dG(n,m,i,c)||n9(n,i,c)),wf=(n,i,c)=>{const m=n.selection,p=m.getNode(),w=m.getRng(),x=Vt.fromRangeStart(w);return Up(p)?(c==="selection"&&JF(w,p)||u5(i,x,p)?KF(p):n.undoManager.transact(()=>{const M=m.getSel();let{anchorNode:B,anchorOffset:q,focusNode:ae,focusOffset:fe}=M!=null?M:{};const be=()=>{Oe(B)&&Oe(q)&&Oe(ae)&&Oe(fe)&&(M==null||M.setBaseAndExtent(B,q,ae,fe))},Le=()=>{B=M==null?void 0:M.anchorNode,q=M==null?void 0:M.anchorOffset,ae=M==null?void 0:M.focusNode,fe=M==null?void 0:M.focusOffset},Ye=(Ve,gt)=>{Ne(Ve.childNodes,Ot=>{D2(Ot)&>.appendChild(Ot)})},Me=n.dom.create("span",{"data-mce-bogus":"1"});Ye(p,Me),p.appendChild(Me),be(),(c==="word"||c==="line")&&(M==null||M.modify("extend",i?"right":"left",c)),!m.isCollapsed()&&JF(m.getRng(),Me)?KF(p):(n.execCommand(i?"ForwardDelete":"Delete"),Le(),Ye(Me,p),be()),n.dom.remove(Me)}),!0):!1},bw=(n,i,c)=>cae(n,i,c)||iG&&wf(n,i,c)?he.some(ot):he.none(),o9=n=>(i,c,m={})=>{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:ot,inputType:c},x=mu(new InputEvent(n));return i.dispatch(n,{...x,...w,...m})},yT=o9("input"),a4=o9("beforeinput"),s9=ys(),r9=s9.os,i9=r9.isMacOS()||r9.isiOS(),hG=s9.browser.isFirefox(),mG=(n,i,c)=>{const m=c.keyCode===to.BACKSPACE?"deleteContentBackward":"deleteContentForward",p=n.selection.isCollapsed(),w=p?"character":"selection",x=M=>p?M?"word":"line":"selection";ac([{keyCode:to.BACKSPACE,action:ds(U7,n)},{keyCode:to.BACKSPACE,action:ds(cv,n,!1)},{keyCode:to.DELETE,action:ds(cv,n,!0)},{keyCode:to.BACKSPACE,action:ds(rR,n,!1)},{keyCode:to.DELETE,action:ds(rR,n,!0)},{keyCode:to.BACKSPACE,action:ds(WS,n,i,!1)},{keyCode:to.DELETE,action:ds(WS,n,i,!0)},{keyCode:to.BACKSPACE,action:ds(Eb,n,!1)},{keyCode:to.DELETE,action:ds(Eb,n,!0)},{keyCode:to.BACKSPACE,action:ds(bw,n,!1,w)},{keyCode:to.DELETE,action:ds(bw,n,!0,w)},...i9?[{keyCode:to.BACKSPACE,altKey:!0,action:ds(bw,n,!1,x(!0))},{keyCode:to.DELETE,altKey:!0,action:ds(bw,n,!0,x(!0))},{keyCode:to.BACKSPACE,metaKey:!0,action:ds(bw,n,!1,x(!1))}]:[{keyCode:to.BACKSPACE,ctrlKey:!0,action:ds(bw,n,!1,x(!0))},{keyCode:to.DELETE,ctrlKey:!0,action:ds(bw,n,!0,x(!0))}],{keyCode:to.BACKSPACE,action:ds(cR,n,!1)},{keyCode:to.DELETE,action:ds(cR,n,!0)},{keyCode:to.BACKSPACE,action:ds(AR,n,!1)},{keyCode:to.DELETE,action:ds(AR,n,!0)},{keyCode:to.BACKSPACE,action:ds(tR,n,!1)},{keyCode:to.DELETE,action:ds(tR,n,!0)},{keyCode:to.BACKSPACE,action:ds(eR,n,!1)},{keyCode:to.DELETE,action:ds(eR,n,!0)},{keyCode:to.BACKSPACE,action:ds(TR,n,!1)},{keyCode:to.DELETE,action:ds(TR,n,!0)}],c).filter(M=>n.selection.isEditable()).each(M=>{c.preventDefault(),a4(n,m).isDefaultPrevented()||(M(),yT(n,m))})},c$=(n,i,c)=>uT([{keyCode:to.BACKSPACE,action:ds(s7,n)},{keyCode:to.DELETE,action:ds(s7,n)},...i9?[{keyCode:to.BACKSPACE,altKey:!0,action:ds(cT,n)},{keyCode:to.DELETE,altKey:!0,action:ds(cT,n)},...c?[{keyCode:hG?224:91,action:ds(cT,n)}]:[]]:[{keyCode:to.BACKSPACE,ctrlKey:!0,action:ds(cT,n)},{keyCode:to.DELETE,ctrlKey:!0,action:ds(cT,n)}]],i),u$=(n,i)=>{let c=!1;n.on("keydown",m=>{c=m.keyCode===to.BACKSPACE,m.isDefaultPrevented()||mG(n,i,m)}),n.on("keyup",m=>{m.isDefaultPrevented()||c$(n,m,c),c=!1})},gG=n=>{for(;n;){if(Jn(n)||_n(n)&&n.data&&/[\r\n\s]/.test(n.data))return n;n=n.nextSibling}return null},wT=(n,i)=>{const c=n.dom,m=n.schema.getMoveCaretBeforeOnEnterElements();if(!i)return;if(/^(LI|DT|DD)$/.test(i.nodeName)){const w=gG(i.firstChild);w&&/^(UL|OL|DL)$/.test(w.nodeName)&&i.insertBefore(c.doc.createTextNode(Kr),i.firstChild)}const p=c.createRng();if(i.normalize(),i.hasChildNodes()){const w=new _i(i,i);let x=i,M;for(;M=w.current();){if(_n(M)){p.setStart(M,0),p.setEnd(M,0);break}if(m[M.nodeName.toLowerCase()]){p.setStartBefore(M),p.setEndBefore(M);break}x=M,M=w.next()}M||(p.setStart(x,0),p.setEnd(x,0))}else mi(i)?i.nextSibling&&c.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),Of(n,p)},l4=(n,i)=>{const c=n.getRoot();let m,p=i;for(;p!==c&&p&&n.getContentEditable(p)!=="false";){if(n.getContentEditable(p)==="true"){m=p;break}p=p.parentNode}return p!==c?m:c},a9=n=>he.from(n.dom.getParent(n.selection.getStart(!0),n.dom.isBlock)),pG=n=>a9(n).fold(Qe(""),i=>i.nodeName.toUpperCase()),bG=n=>a9(n).filter(i=>ja(Ke.fromDom(i))).isSome(),l9=n=>{n.innerHTML='<br data-mce-bogus="1">'},vG=(n,i,c)=>{const m=n.dom;he.from(c.style).map(m.parseStyle).each(B=>{const ae={...nm(Ke.fromDom(i)),...B};m.setStyles(i,ae)});const p=he.from(c.class).map(B=>B.split(/\s+/)),w=he.from(i.className).map(B=>At(B.split(/\s+/),q=>q!==""));ri(p,w,(B,q)=>{const ae=At(q,be=>!kt(B,be)),fe=[...B,...ae];m.setAttrib(i,"class",fe.join(" "))});const x=["style","class"],M=Wt(c,(B,q)=>!kt(x,q));m.setAttribs(i,M)},Lh=(n,i)=>{if(jc(n).toLowerCase()===i.tagName.toLowerCase()){const m=db(n);vG(n,i,m)}},c9=(n,i,c,m,p=!0,w)=>{const x=n.dom,M=n.schema,B=jc(n),q=c?c.nodeName.toUpperCase():"";let ae=i;const fe=M.getTextInlineElements();let be;w||q==="TABLE"||q==="HR"?be=x.create(w||B):be=c.cloneNode(!1);let Le=be;if(!p)x.setAttrib(be,"style",null),x.setAttrib(be,"class",null);else do if(fe[ae.nodeName]){if(qc(ae)||Wd(ae))continue;const Ye=ae.cloneNode(!1);x.setAttrib(Ye,"id",""),be.hasChildNodes()?(Ye.appendChild(be.firstChild),be.appendChild(Ye)):(Le=Ye,be.appendChild(Ye))}while((ae=ae.parentNode)&&ae!==m);return Lh(n,be),l9(Le),be},OG=(n,i)=>n.dom.getParent(i,ka),UO=(n,i,c)=>{let m=i;for(;m&&m!==n&&G(m.nextSibling);){const p=m.parentElement;if(!p||!c(p))return ka(p);m=p}return!1},yG=(n,i,c)=>!i&&c.nodeName.toLowerCase()===jc(n)&&n.dom.isEmpty(c)&&UO(n.getBody(),c,m=>fn(n.schema.getTextBlockElements(),m.nodeName.toLowerCase())),u9=(n,i,c)=>{var m,p,w;const x=i(jc(n)),M=OG(n,c);!M||(n.dom.insertAfter(x,M),wT(n,x),((w=(p=(m=c.parentElement)===null||m===void 0?void 0:m.childNodes)===null||p===void 0?void 0:p.length)!==null&&w!==void 0?w:0)>1&&n.dom.remove(c))},wG=(n,i)=>n.firstChild&&n.firstChild.nodeName===i,_G=n=>{var i;return((i=n.parentNode)===null||i===void 0?void 0:i.firstChild)===n},f9=(n,i)=>{const c=n==null?void 0:n.parentNode;return Oe(c)&&c.nodeName===i},d9=n=>Oe(n)&&/^(OL|UL|LI)$/.test(n.nodeName),SG=n=>Oe(n)&&/^(LI|DT|DD)$/.test(n.nodeName),CG=n=>d9(n)&&d9(n.parentNode),c4=n=>{const i=n.parentNode;return SG(i)?i:n},KS=(n,i,c)=>{let m=n[c?"firstChild":"lastChild"];for(;m&&!Jn(m);)m=m[c?"nextSibling":"previousSibling"];return m===i},h9=(n,i,c,m,p)=>{const w=n.dom,x=n.selection.getRng(),M=c.parentNode;if(c===n.getBody()||!M)return;CG(c)&&(p="LI");let B=i(p);if(KS(c,m,!0)&&KS(c,m,!1))if(f9(c,"LI")){const q=c4(c);w.insertAfter(B,q),_G(c)?w.remove(q):w.remove(c)}else w.replace(B,c);else if(KS(c,m,!0))f9(c,"LI")?(w.insertAfter(B,c4(c)),B.appendChild(w.doc.createTextNode(" ")),B.appendChild(c)):M.insertBefore(B,c),w.remove(m);else if(KS(c,m,!1))w.insertAfter(B,c4(c)),w.remove(m);else{c=c4(c);const q=x.cloneRange();q.setStartAfter(m),q.setEndAfter(c);const ae=q.extractContents();p==="LI"&&wG(ae,"LI")?(B=ae.firstChild,w.insertAfter(ae,c)):(w.insertAfter(ae,c),w.insertAfter(B,c)),w.remove(m)}wT(n,B)},u4=n=>{Ne(i0(Ke.fromDom(n),sl),i=>{const c=i.dom;c.nodeValue=In(c.data)})},kG=(n,i)=>{const c=n.dom.getParent(i,"ol,ul,dl");return c!==null&&n.dom.getContentEditableParent(c)==="false"},xG=(n,i)=>i&&i.nodeName==="A"&&n.isEmpty(i),f$=(n,i)=>n.nodeName===i||n.previousSibling&&n.previousSibling.nodeName===i,d$=(n,i)=>Oe(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",TG=(n,i,c)=>{var m;const p=[];if(!c)return;let w=c;for(;w=w.firstChild;){if(n.isBlock(w))return;Jn(w)&&!i[w.nodeName.toLowerCase()]&&p.push(w)}let x=p.length;for(;x--;)w=p[x],(!w.hasChildNodes()||w.firstChild===w.lastChild&&((m=w.firstChild)===null||m===void 0?void 0:m.nodeValue)===""||xG(n,w))&&n.remove(w)},f4=(n,i,c)=>_n(i)?n?c===1&&i.data.charAt(c-1)===Ft?0:c:c===i.data.length-1&&i.data.charAt(c)===Ft?i.data.length:c:c,EG=n=>{const i=n.cloneRange();return i.setStart(n.startContainer,f4(!0,n.startContainer,n.startOffset)),i.setEnd(n.endContainer,f4(!1,n.endContainer,n.endOffset)),i},m9=n=>{let i=n;do _n(i)&&(i.data=i.data.replace(/^[\r\n]+/,"")),i=i.firstChild;while(i)},g9=(n,i,c,m,p)=>{var w,x;const M=n.dom,B=(w=l4(M,m))!==null&&w!==void 0?w:M.getRoot();let q=M.getParent(m,M.isBlock);if(!q||!d$(M,q)){if(q=q||B,!q.hasChildNodes()){const Le=M.create(i);return Lh(n,Le),q.appendChild(Le),c.setStart(Le,0),c.setEnd(Le,0),Le}let ae=m;for(;ae&&ae.parentNode!==q;)ae=ae.parentNode;let fe;for(;ae&&!M.isBlock(ae);)fe=ae,ae=ae.previousSibling;const be=(x=fe==null?void 0:fe.parentElement)===null||x===void 0?void 0:x.nodeName;if(fe&&be&&n.schema.isValidChild(be,i.toLowerCase())){const Le=fe.parentNode,Ye=M.create(i);for(Lh(n,Ye),Le.insertBefore(Ye,fe),ae=fe;ae&&!M.isBlock(ae);){const Me=ae.nextSibling;Ye.appendChild(ae),ae=Me}c.setStart(m,p),c.setEnd(m,p)}}return m},AG=(n,i)=>{i.normalize();const c=i.lastChild;(!c||Jn(c)&&/^(left|right)$/gi.test(n.getStyle(c,"float",!0)))&&n.add(i,"br")},DG=(n,i)=>{const c=jr(n);return Re(i)?!1:L(c)?kt(gn.explode(c),i.nodeName.toLowerCase()):c},b9={insert:(n,i)=>{let c,m,p,w,x=!1;const M=n.dom,B=n.schema,q=B.getNonEmptyElements(),ae=n.selection.getRng(),fe=jc(n),be=Ke.fromDom(ae.startContainer),Le=tf(be,ae.startOffset),Ye=Le.exists(yn=>Mi(yn)&&!wn(yn)),Me=ae.collapsed&&Ye,Ve=yn=>c9(n,c,Hn,hn,xh(n),yn),gt=yn=>{const yo=f4(yn,c,m);if(_n(c)&&(yn?yo>0:yo<c.data.length))return!1;if(c.parentNode===Hn&&x&&!yn||yn&&Jn(c)&&c===Hn.firstChild)return!0;if(f$(c,"TABLE")||f$(c,"HR"))return x&&!yn||!x&&yn;const Do=new _i(c,Hn);_n(c)&&(yn&&yo===0?Do.prev():!yn&&yo===c.data.length&&Do.next());let Cs;for(;Cs=Do.current();){if(Jn(Cs)){if(!Cs.getAttribute("data-mce-bogus")){const Ws=Cs.nodeName.toLowerCase();if(q[Ws]&&Ws!=="br")return!1}}else if(_n(Cs)&&!eg(Cs.data))return!1;yn?Do.prev():Do.next()}return!0},Ot=()=>{let yn;return/^(H[1-6]|PRE|FIGURE)$/.test(p)&&$n!=="HGROUP"?yn=Ve(fe):yn=Ve(),DG(n,w)&&d$(M,w)&&M.isEmpty(Hn,void 0,{includeZwsp:!0})?yn=M.split(w,Hn):M.insertAfter(yn,Hn),wT(n,yn),yn};mS(M,ae).each(yn=>{ae.setStart(yn.startContainer,yn.startOffset),ae.setEnd(yn.endContainer,yn.endOffset)}),c=ae.startContainer,m=ae.startOffset;const wt=!!(i&&i.shiftKey),Pt=!!(i&&i.ctrlKey);Jn(c)&&c.hasChildNodes()&&!Me&&(x=m>c.childNodes.length-1,c=c.childNodes[Math.min(m,c.childNodes.length-1)]||c,x&&_n(c)?m=c.data.length:m=0);const hn=l4(M,c);if(!hn||kG(n,c))return;wt||(c=g9(n,fe,ae,c,m));let Hn=M.getParent(c,M.isBlock)||M.getRoot();w=Oe(Hn==null?void 0:Hn.parentNode)?M.getParent(Hn.parentNode,M.isBlock):null,p=Hn?Hn.nodeName.toUpperCase():"";const $n=w?w.nodeName.toUpperCase():"";if($n==="LI"&&!Pt){const yn=w;Hn=yn,w=yn.parentNode,p=$n}if(Jn(w)&&yG(n,wt,Hn))return u9(n,Ve,Hn);if(/^(LI|DT|DD)$/.test(p)&&Jn(w)&&M.isEmpty(Hn)){h9(n,Ve,w,Hn,fe);return}if(!Me&&(Hn===n.getBody()||!d$(M,Hn)))return;const Lt=Hn.parentNode;let Zt;if(Me)Zt=Ve(fe),Le.fold(()=>{na(be,Ke.fromDom(Zt))},yn=>{Ca(yn,Ke.fromDom(Zt))}),n.selection.setCursorLocation(Zt,0);else if(Si(Hn))Zt=Km(Hn),M.isEmpty(Hn)&&l9(Hn),Lh(n,Zt),wT(n,Zt);else if(gt(!1))Zt=Ot();else if(gt(!0)&&Lt){Zt=Lt.insertBefore(Ve(),Hn);const yn=Jh(Ke.fromDom(ae.startContainer))&&ae.collapsed;wT(n,f$(Hn,"HR")||yn?Zt:Hn)}else{const yn=EG(ae).cloneRange();yn.setEndAfter(Hn);const yo=yn.extractContents();u4(yo),m9(yo),Zt=yo.firstChild,M.insertAfter(yo,Hn),TG(M,q,Zt),AG(M,Hn),M.isEmpty(Hn)&&l9(Hn),Zt.normalize(),M.isEmpty(Zt)?(M.remove(Zt),Ot()):(Lh(n,Zt),wT(n,Zt))}M.setAttrib(Zt,"id",""),n.dispatch("NewBlock",{newBlock:Zt})},fakeEventName:"insertParagraph"},d4=(n,i,c)=>{const m=new _i(i,c);let p;const w=n.getNonEmptyElements();for(;p=m.next();)if(w[p.nodeName.toLowerCase()]||_n(p)&&p.length>0)return!0;return!1},v9=(n,i,c)=>{const m=n.dom.createRng();c?(m.setStartBefore(i),m.setEndBefore(i)):(m.setStartAfter(i),m.setEndAfter(i)),n.selection.setRng(m),Of(n,m)},h$=(n,i)=>{const c=n.selection,m=n.dom,p=c.getRng();let w,x=!1;mS(m,p).each(Le=>{p.setStart(Le.startContainer,Le.startOffset),p.setEnd(Le.endContainer,Le.endOffset)});let M=p.startOffset,B=p.startContainer;if(Jn(B)&&B.hasChildNodes()){const Le=M>B.childNodes.length-1;B=B.childNodes[Math.min(M,B.childNodes.length-1)]||B,Le&&_n(B)?M=B.data.length:M=0}let q=m.getParent(B,m.isBlock);const ae=q&&q.parentNode?m.getParent(q.parentNode,m.isBlock):null,fe=ae?ae.nodeName.toUpperCase():"",be=!!(i&&i.ctrlKey);fe==="LI"&&!be&&(q=ae),_n(B)&&M>=B.data.length&&(d4(n.schema,B,q||m.getRoot())||(w=m.create("br"),p.insertNode(w),p.setStartAfter(w),p.setEndAfter(w),x=!0)),w=m.create("br"),Ch(m,p,w),v9(n,w,x),n.undoManager.add()},m$=(n,i)=>{const c=Ke.fromTag("br");Ca(Ke.fromDom(i),c),n.undoManager.add()},O9=(n,i)=>{fae(n.getBody(),i)||iu(Ke.fromDom(i),Ke.fromTag("br"));const c=Ke.fromTag("br");iu(Ke.fromDom(i),c),v9(n,c.dom,!1),n.undoManager.add()},PG=n=>mi(n.getNode()),fae=(n,i)=>PG(Vt.after(i))?!0:Hf(n,Vt.after(i)).map(c=>mi(c.getNode())).getOr(!1),gv=n=>n&&n.nodeName==="A"&&"href"in n,MG=n=>n.fold(je,gv,gv,je),RG=n=>{const i=He(j2,n),c=Vt.fromRangeStart(n.selection.getRng());return w1(i,n.getBody(),c).filter(MG)},$G=(n,i)=>{i.fold(ot,He(m$,n),He(O9,n),ot)},p$={insert:(n,i)=>{const c=RG(n);c.isSome()?c.each(He($G,n)):h$(n,i)},fakeEventName:"insertLineBreak"},y9=(n,i)=>a9(n).filter(c=>i.length>0&&Pu(Ke.fromDom(c),i)).isSome(),w9=n=>y9(n,__(n)),IG=n=>y9(n,f2(n)),Em=pg.generate([{br:[]},{block:[]},{none:[]}]),BG=(n,i)=>IG(n),b$=n=>(i,c)=>bG(i)===n,h4=(n,i)=>(c,m)=>pG(c)===n.toUpperCase()===i,LG=n=>{const i=l4(n.dom,n.selection.getStart());return Re(i)},vw=n=>h4("pre",n),_9=()=>h4("summary",!0),Ow=n=>(i,c)=>Zd(i)===n,S9=(n,i)=>w9(n),_T=(n,i)=>i,FG=n=>{const i=jc(n),c=l4(n.dom,n.selection.getStart());return Oe(c)&&n.schema.isValidChild(c.nodeName,i)},QG=n=>{const i=n.selection.getRng(),c=Ke.fromDom(i.startContainer),p=tf(c,i.startOffset).map(w=>Mi(w)&&!wn(w));return i.collapsed&&p.getOr(!0)},jd=(n,i)=>(c,m)=>zn(n,(w,x)=>w&&x(c,m),!0)?he.some(i):he.none(),C9=(n,i)=>f7([jd([BG],Em.none()),jd([vw(!0),LG],Em.none()),jd([_9()],Em.br()),jd([vw(!0),Ow(!1),_T],Em.br()),jd([vw(!0),Ow(!1)],Em.block()),jd([vw(!0),Ow(!0),_T],Em.block()),jd([vw(!0),Ow(!0)],Em.br()),jd([b$(!0),_T],Em.br()),jd([b$(!0)],Em.block()),jd([S9],Em.br()),jd([_T],Em.br()),jd([FG],Em.block()),jd([QG],Em.block())],[n,!!(i&&i.shiftKey)]).getOr(Em.none()),m4=(n,i,c)=>{i.selection.isCollapsed()||_x(i),!(Oe(c)&&a4(i,n.fakeEventName).isDefaultPrevented())&&(n.insert(i,c),Oe(c)&&yT(i,n.fakeEventName))},k9=(n,i)=>{const c=()=>m4(p$,n,i),m=()=>m4(b9,n,i),p=C9(n,i);switch(u2(n)){case"linebreak":p.fold(c,c,ot);break;case"block":p.fold(m,m,ot);break;case"invert":p.fold(m,c,ot);break;default:p.fold(c,m,ot);break}},v$=ys(),ZG=v$.os.isiOS()&&v$.browser.isSafari(),x9=(n,i)=>{i.isDefaultPrevented()||(i.preventDefault(),gY(n.undoManager),n.undoManager.transact(()=>{k9(n,i)}))},HG=n=>{if(!n.collapsed)return!1;const i=n.startContainer;if(_n(i)){const c=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,m=i.data.charAt(n.startOffset-1);return c.test(m)}else return!1},zG=n=>{let i=he.none();const c=p=>{i=he.some(p.selection.getBookmark()),p.undoManager.add()},m=(p,w)=>{p.undoManager.undo(),i.fold(ot,x=>p.selection.moveToBookmark(x)),x9(p,w),i=he.none()};n.on("keydown",p=>{p.keyCode===to.ENTER&&(ZG&&HG(n.selection.getRng())?c(n):x9(n,p))}),n.on("keyup",p=>{p.keyCode===to.ENTER&&i.each(()=>m(n,p))})},VG=(n,i,c)=>{const m=qn.os.isMacOS()||qn.os.isiOS();uT([{keyCode:to.END,action:ds(ZA,n,!0)},{keyCode:to.HOME,action:ds(ZA,n,!1)},...m?[]:[{keyCode:to.HOME,action:ds(HA,n,!1),ctrlKey:!0,shiftKey:!0},{keyCode:to.END,action:ds(HA,n,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:to.END,action:ds(uF,n,!0)},{keyCode:to.HOME,action:ds(uF,n,!1)},{keyCode:to.END,action:ds(RA,n,!0,i)},{keyCode:to.HOME,action:ds(RA,n,!1,i)}],c).each(p=>{c.preventDefault()})},T9=(n,i)=>{n.on("keydown",c=>{c.isDefaultPrevented()||VG(n,i,c)})},WG=n=>{n.on("input",i=>{i.isComposing||wW(n)})},E9=ys(),UG=(n,i,c)=>{uT([{keyCode:to.PAGE_UP,action:ds(RA,n,!1,i)},{keyCode:to.PAGE_DOWN,action:ds(RA,n,!0,i)}],c)},A9=n=>n.stopImmediatePropagation(),D9=n=>n.keyCode===to.PAGE_UP||n.keyCode===to.PAGE_DOWN,P9=(n,i,c)=>{c&&!n.get()?i.on("NodeChange",A9,!0):!c&&n.get()&&i.off("NodeChange",A9),n.set(c)},YG=(n,i)=>{if(E9.os.isMacOS())return;const c=Ga(!1);n.on("keydown",m=>{D9(m)&&P9(c,n,!0)}),n.on("keyup",m=>{m.isDefaultPrevented()||UG(n,i,m),D9(m)&&c.get()&&(P9(c,n,!1),n.nodeChanged())})},yw=(n,i)=>{const c=i.container(),m=i.offset();return _n(c)?(c.insertData(m,n),he.some(Vt(c,m+n.length))):We(i).map(p=>{const w=Ke.fromText(n);return i.isAtEnd()?iu(p,w):Ca(p,w),Vt(w.dom,n.length)})},M9=He(yw,Kr),R9=He(yw," "),$9=(n,i)=>rB(n,i)?M9(i):R9(i),XG=n=>i=>i.fold(c=>Hu(n.dom,Vt.before(c)),c=>cl(c),c=>Vd(c),c=>Hf(n.dom,Vt.after(c))),jG=(n,i)=>c=>rB(n,c)?M9(i):R9(i),N9=n=>i=>{n.selection.setRng(i.toRange()),n.nodeChanged()},I9=(n,i)=>n.isEditable(n.getParent(i,"summary")),qG=n=>{const i=Vt.fromRangeStart(n.selection.getRng()),c=Ke.fromDom(n.getBody());if(n.selection.isCollapsed()){const m=He(j2,n),p=Vt.fromRangeStart(n.selection.getRng());return w1(m,n.getBody(),p).bind(XG(c)).map(w=>()=>jG(c,i)(w).each(N9(n)))}else return he.none()},GG=n=>{const i=()=>{const c=Ke.fromDom(n.getBody());n.selection.isCollapsed()||n.getDoc().execCommand("Delete");const m=Vt.fromRangeStart(n.selection.getRng());$9(c,m).each(N9(n))};return ks(qn.browser.isFirefox()&&n.selection.isEditable()&&I9(n.dom,n.selection.getRng().startContainer),i)},dae=(n,i)=>{ac([{keyCode:to.SPACEBAR,action:ds(qG,n)},{keyCode:to.SPACEBAR,action:ds(GG,n)}],i).each(c=>{i.preventDefault(),a4(n,"insertText",{data:" "}).isDefaultPrevented()||(c(),yT(n,"insertText",{data:" "}))})},g4=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||dae(n,i)})},KG=n=>kk(n)?[{keyCode:to.TAB,action:ds(WR,n,!0)},{keyCode:to.TAB,shiftKey:!0,action:ds(WR,n,!1)}]:[],JG=(n,i)=>{uT([...KG(n)],i).each(c=>{i.preventDefault()})},eK=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||JG(n,i)})},tK=n=>{if(n.addShortcut("Meta+P","","mcePrint"),rG(n),Mb(n))return Ga(null);{const i=hj(n);return K7(n),yF(n,i),u$(n,i),zG(n),g4(n),WG(n),eK(n),T9(n,i),YG(n,i),i}};class nK{constructor(i){this.lastPath=[],this.editor=i;let c;const m=this;"onselectionchange"in i.getDoc()||i.on("NodeChange click mouseup keyup focus",p=>{const w=i.selection.getRng(),x={startContainer:w.startContainer,startOffset:w.startOffset,endContainer:w.endContainer,endOffset:w.endOffset};(p.type==="nodechange"||!s3(x,c))&&i.dispatch("SelectionChange"),c=x}),i.on("contextmenu",()=>{i.dispatch("SelectionChange")}),i.on("SelectionChange",()=>{const p=i.selection.getStart(!0);!p||K_(i)&&!m.isSameElementPath(p)&&i.dom.isChildOf(p,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("mouseup",p=>{!p.isDefaultPrevented()&&K_(i)&&(i.selection.getNode().nodeName==="IMG"?_g.setEditorTimeout(i,()=>{i.nodeChanged()}):i.nodeChanged())})}nodeChanged(i={}){const c=this.editor.selection;let m;if(this.editor.initialized&&c&&!oO(this.editor)&&!this.editor.mode.isReadOnly()){const p=this.editor.getBody();m=c.getStart(!0)||p,(m.ownerDocument!==this.editor.getDoc()||!this.editor.dom.isChildOf(m,p))&&(m=p);const w=[];this.editor.dom.getParent(m,x=>x===p?!0:(w.push(x),!1)),this.editor.dispatch("NodeChange",{...i,element:m,parents:w})}}isSameElementPath(i){let c;const m=this.editor,p=Xs(m.dom.getParents(i,mt,m.getBody()));if(p.length===this.lastPath.length){for(c=p.length;c>=0&&p[c]===this.lastPath[c];c--);if(c===-1)return this.lastPath=p,!0}return this.lastPath=p,!1}}const B9=Li("image"),oK=n=>{const i=n;return he.from(i[B9])},sK=(n,i)=>{const c=n;c[B9]=i},O$=Li("event"),rK=n=>{const i=n;return he.from(i[O$])},p4=n=>i=>{const c=i;c[O$]=n},iK=(n,i)=>p4(i)(n),L9=p4(0),ji=p4(2),aK=p4(1),cK=(n=>i=>{const c=i;return he.from(c[O$]).exists(m=>m===n)})(0),y$=()=>Object.freeze({length:0,item:n=>null}),b4=Li("mode"),F9=n=>{const i=n;return he.from(i[b4])},v4=n=>i=>{const c=i;c[b4]=n},w$=(n,i)=>v4(i)(n),Q9=v4(0),_$=v4(2),Z9=v4(1),H9=n=>i=>{const c=i;return he.from(c[b4]).exists(m=>m===n)},JS=H9(0),z9=H9(1),eC=(n,i)=>({...i,get length(){return i.length},add:(c,m)=>{if(JS(n))if(L(c)){if(!ve(m))return i.add(c,m)}else return i.add(c);return null},remove:c=>{JS(n)&&i.remove(c)},clear:()=>{JS(n)&&i.clear()}}),ST=["none","copy","link","move"],uK=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],S$=()=>{const n=new window.DataTransfer;let i="move",c="all";const m={get dropEffect(){return i},set dropEffect(p){kt(ST,p)&&(i=p)},get effectAllowed(){return c},set effectAllowed(p){cK(m)&&kt(uK,p)&&(c=p)},get items(){return eC(m,n.items)},get files(){return z9(m)?y$():n.files},get types(){return n.types},setDragImage:(p,w,x)=>{JS(m)&&(sK(m,{image:p,x:w,y:x}),n.setDragImage(p,w,x))},getData:p=>z9(m)?"":n.getData(p),setData:(p,w)=>{JS(m)&&n.setData(p,w)},clearData:p=>{JS(m)&&n.clearData(p)}};return Q9(m),m},tC=n=>{const i=S$(),c=F9(n);return _$(n),L9(i),i.dropEffect=n.dropEffect,i.effectAllowed=n.effectAllowed,oK(n).each(m=>i.setDragImage(m.image,m.x,m.y)),Ne(n.types,m=>{m!=="Files"&&i.setData(m,n.getData(m))}),Ne(n.files,m=>i.items.add(m)),rK(n).each(m=>{iK(i,m)}),c.each(m=>{w$(n,m),w$(i,m)}),i},fK=n=>{const i=n.getData("text/html");return i===""?he.none():he.some(i)},O4=(n,i)=>n.setData("text/html",i),y4="x-tinymce/html",CT=Qe(y4),C$="<!-- "+y4+" -->",dK=n=>C$+n,V9=n=>n.replace(C$,""),k$=n=>n.indexOf(C$)!==-1,hK=n=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(n),mK=(n,i)=>{let c="<"+n;const m=Yn(i,(p,w)=>w+'="'+sp.encodeAllRaw(p)+'"');return m.length&&(c+=" "+m.join(" ")),c+">"},gK=(n,i,c)=>{const m=n.split(/\n\n/),p=mK(i,c),w="</"+i+">",x=pt(m,B=>B.split(/\n/).join("<br />")),M=B=>p+B+w;return x.length===1?x[0]:pt(x,M).join("")},x$="%MCEPASTEBIN%",pK=(n,i)=>{const{dom:c,selection:m}=n,p=n.getBody();i.set(m.getRng());const w=c.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"},x$);qn.browser.isFirefox()&&c.setStyle(w,"left",c.getStyle(p,"direction",!0)==="rtl"?65535:-65535),c.bind(w,"beforedeactivate focusin focusout",x=>{x.stopPropagation()}),w.focus(),m.select(w,!0)},W9=(n,i)=>{const c=n.dom;if(T$(n)){let m;const p=i.get();for(;m=T$(n);)c.remove(m),c.unbind(m);p&&n.selection.setRng(p)}i.set(null)},T$=n=>n.dom.get("mcepastebin"),bK=n=>Oe(n)&&n.id==="mcepastebin",vK=n=>{const i=n.dom,c=(x,M)=>{x.appendChild(M),i.remove(M,!0)},[m,...p]=At(n.getBody().childNodes,bK);Ne(p,x=>{c(m,x)});const w=i.select("div[id=mcepastebin]",m);for(let x=w.length-1;x>=0;x--){const M=i.create("div");m.insertBefore(M,w[x]),c(M,w[x])}return m?m.innerHTML:""},U9=n=>n===x$,OK=n=>{const i=Ga(null);return{create:()=>pK(n,i),remove:()=>W9(n,i),getEl:()=>T$(n),getHtml:()=>vK(n),getLastRng:i.get}},kT=(n,i)=>(gn.each(i,c=>{K(c,RegExp)?n=n.replace(c,""):n=n.replace(c[0],c[1])}),n),yK=n=>{const i=wh(),c=$S({},i);let m="";const p=i.getVoidElements(),w=gn.makeMap("script noscript style textarea video audio iframe object"," "),x=i.getBlockElements(),M=B=>{const q=B.name,ae=B;if(q==="br"){m+=`
|
|
`;return}if(q!=="wbr"){if(p[q]&&(m+=" "),w[q]){m+=" ";return}if(B.type===3&&(m+=B.value),!(B.name in i.getVoidElements())){let fe=B.firstChild;if(fe)do M(fe);while(fe=fe.next)}x[q]&&ae.next&&(m+=`
|
|
`,q==="p"&&(m+=`
|
|
`))}};return n=kT(n,[/<!\[[^\]]+\]>/g]),M(c.parse(n)),m},E$=n=>(n=kT(n,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(c,m,p)=>!m&&!p?" ":Kr],/<br class="Apple-interchange-newline">/g,/<br>$/i]),n),wK=n=>{let i=0;return()=>n+i++},_K=n=>{const i=n.toLowerCase(),c={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return gn.hasOwn(c,i)?"image/"+c[i]:"image/"+i},SK=(n,i)=>{const c=$S({sanitize:cO(n)},n.schema);c.addNodeFilter("meta",p=>{gn.each(p,w=>{w.remove()})});const m=c.parse(i,{forced_root_block:!1,isRootContent:!0});return Y2({validate:!0},n.schema).serialize(m)},Y9=(n,i)=>({content:n,cancelled:i}),CK=(n,i,c)=>{const m=n.dom.create("div",{style:"display:none"},i),p=KE(n,m,c);return Y9(p.node.innerHTML,p.isDefaultPrevented())},kK=(n,i,c)=>{const m=kP(n,i,c),p=SK(n,m.content);return n.hasEventListeners("PastePostProcess")&&!m.isDefaultPrevented()?CK(n,p,c):Y9(p,m.isDefaultPrevented())},X9=(n,i,c)=>kK(n,i,c),A$=(n,i)=>(n.insertContent(i,{merge:Q_(n),paste:!0}),!0),D$=n=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(n),xK=(n,i)=>D$(i)&&jt(v2(n),c=>Ki(i.toLowerCase(),`.${c.toLowerCase()}`)),TK=(n,i,c)=>(n.undoManager.extra(()=>{c(n,i)},()=>{n.insertContent('<img src="'+i+'">')}),!0),EK=(n,i,c)=>(n.undoManager.extra(()=>{c(n,i)},()=>{n.execCommand("mceInsertLink",!1,i)}),!0),AK=(n,i,c)=>!n.selection.isCollapsed()&&D$(i)?EK(n,i,c):!1,DK=(n,i,c)=>xK(n,i)?TK(n,i,c):!1,j9=(n,i)=>{gn.each([AK,DK,A$],c=>!c(n,i,A$))},PK=(n,i,c)=>{c||!Z_(n)?A$(n,i):j9(n,i)},MK=wK("mceclip"),RK=n=>{const i=S$();return O4(i,n),_$(i),i},q9=(n,i,c,m,p)=>{const w=X9(n,i,c);if(!w.cancelled){const x=w.content,M=()=>PK(n,x,m);p?a4(n,"insertFromPaste",{dataTransfer:RK(x)}).isDefaultPrevented()||(M(),yT(n,"insertFromPaste")):M()}},w4=(n,i,c,m)=>{const p=c||k$(i);q9(n,V9(i),p,!1,m)},P$=(n,i,c)=>{const m=n.dom.encode(i).replace(/\r\n/g,`
|
|
`),p=mh(m,wk(n)),w=gK(p,jc(n),db(n));q9(n,w,!1,!0,c)},G9=n=>{const i={};if(n&&n.types)for(let c=0;c<n.types.length;c++){const m=n.types[c];try{i[m]=n.getData(m)}catch{i[m]=""}}return i},k1=(n,i)=>i in n&&n[i].length>0,M$=n=>k1(n,"text/html")||k1(n,"text/plain"),$K=(n,i)=>{const c=i.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return Oe(c)?n.dom.encode(c[1]):void 0},K9=(n,i,c,m)=>{const p=MK(),w=ud(n)&&Oe(c.name),x=w?$K(n,c.name):p,M=w?c.name:void 0,B=i.create(p,c,m,x,M);return i.add(B),B},J9=(n,i)=>{nM(i.uri).each(({data:c,type:m,base64Encoded:p})=>{const w=p?c:btoa(c),x=i.file,M=n.editorUpload.blobCache,B=M.getByData(w,m),q=B!=null?B:K9(n,M,x,w);w4(n,`<img src="${q.blobUri()}">`,!1,!0)})},R$=n=>n.type==="paste",NK=n=>Promise.all(pt(n,i=>O8(i).then(c=>({file:i,uri:c})))),eQ=n=>{const i=v2(n);return c=>Ar(c.type,"image/")&&jt(i,m=>_K(m)===c.type)},IK=(n,i)=>{const c=i.items?$s(Rr(i.items),p=>p.kind==="file"?[p.getAsFile()]:[]):[],m=i.files?Rr(i.files):[];return At(c.length>0?c:m,eQ(n))},$$=(n,i,c)=>{const m=R$(i)?i.clipboardData:i.dataTransfer;if(aO(n)&&m){const p=IK(n,m);if(p.length>0)return i.preventDefault(),NK(p).then(w=>{c&&n.selection.setRng(c),Ne(w,x=>{J9(n,x)})}),!0}return!1},BK=n=>{var i,c;return qn.os.isAndroid()&&((c=(i=n.clipboardData)===null||i===void 0?void 0:i.items)===null||c===void 0?void 0:c.length)===0},tQ=n=>to.metaKeyPressed(n)&&n.keyCode===86||n.shiftKey&&n.keyCode===45,N$=(n,i,c,m,p)=>{let w=E$(c);const x=k1(i,CT())||k$(c),M=!x&&hK(w),B=D$(w);(U9(w)||!w.length||M&&!B)&&(m=!0),(m||B)&&(k1(i,"text/plain")&&M?w=i["text/plain"]:w=yK(w)),!U9(w)&&(m?P$(n,w,p):w4(n,w,x,p))},LK=(n,i,c)=>{let m;const p=()=>i.getLastRng()||n.selection.getRng();n.on("keydown",w=>{tQ(w)&&!w.isDefaultPrevented()&&(m=w.shiftKey&&w.keyCode===86)}),n.on("paste",w=>{if(w.isDefaultPrevented()||BK(w))return;const x=c.get()==="text"||m;m=!1;const M=G9(w.clipboardData);!M$(M)&&$$(n,w,p())||(k1(M,"text/html")?(w.preventDefault(),N$(n,M,M["text/html"],x,!0)):k1(M,"text/plain")&&k1(M,"text/uri-list")?(w.preventDefault(),N$(n,M,M["text/plain"],x,!0)):(i.create(),_g.setEditorTimeout(n,()=>{const B=i.getHtml();i.remove(),N$(n,M,B,x,!1)},0)))})},FK=n=>{const i=p=>Ar(p,"webkit-fake-url"),c=p=>Ar(p,"data:"),m=p=>{var w;return((w=p.data)===null||w===void 0?void 0:w.paste)===!0};n.parser.addNodeFilter("img",(p,w,x)=>{if(!aO(n)&&m(x))for(const M of p){const B=M.attr("src");L(B)&&!M.attr("data-mce-object")&&B!==qn.transparentSrc&&(i(B)||!_k(n)&&c(B))&&M.remove()}})},xT=(n,i,c)=>{LK(n,i,c),FK(n)},QK=(n,i)=>{i.get()==="text"?(i.set("html"),iS(n,!1)):(i.set("text"),iS(n,!0)),n.focus()},ZK=(n,i)=>{n.addCommand("mceTogglePlainTextPaste",()=>{QK(n,i)}),n.addCommand("mceInsertClipboardContent",(c,m)=>{m.html&&w4(n,m.html,m.internal,!1),m.text&&P$(n,m.text,!1)})},nQ=(n,i,c)=>{if(n)try{return n.clearData(),n.setData("text/html",i),n.setData("text/plain",c),n.setData(CT(),i),!0}catch{return!1}else return!1},oQ=(n,i,c,m)=>{nQ(n.clipboardData,i.html,i.text)?(n.preventDefault(),m()):c(i.html,m)},sQ=n=>(i,c)=>{const{dom:m,selection:p}=n,w=m.create("div",{contenteditable:"false","data-mce-bogus":"all"}),x=m.create("div",{contenteditable:"true"},i);m.setStyles(w,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),w.appendChild(x),m.add(n.getBody(),w);const M=p.getRng();x.focus();const B=m.createRng();B.selectNodeContents(x),p.setRng(B),_g.setEditorTimeout(n,()=>{p.setRng(M),m.remove(w),c()},0)},rQ=n=>({html:dK(n.selection.getContent({contextual:!0})),text:n.selection.getContent({format:"text"})}),HK=n=>!!n.dom.getParent(n.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",n.getBody()),iQ=n=>!n.selection.isCollapsed()||HK(n),_4=n=>i=>{!i.isDefaultPrevented()&&iQ(n)&&oQ(i,rQ(n),sQ(n),()=>{if(qn.browser.isChromium()||qn.browser.isFirefox()){const c=n.selection.getRng();_g.setEditorTimeout(n,()=>{n.selection.setRng(c),n.execCommand("Delete")},0)}else n.execCommand("Delete")})},aQ=n=>i=>{!i.isDefaultPrevented()&&iQ(n)&&oQ(i,rQ(n),sQ(n),ot)},lQ=n=>{n.on("cut",_4(n)),n.on("copy",aQ(n))},cQ=(n,i)=>{var c,m;return O.getCaretRangeFromPoint((c=i.clientX)!==null&&c!==void 0?c:0,(m=i.clientY)!==null&&m!==void 0?m:0,n.getDoc())},zK=n=>{const i=n["text/plain"];return i?i.indexOf("file://")===0:!1},uQ=(n,i)=>{n.focus(),i&&n.selection.setRng(i)},hae=n=>jt(n.files,i=>/^image\//.test(i.type)),VK=(n,i,c,m)=>{const p=n.getParent(c,x=>ig(i,x));if(!G(n.getParent(c,"summary")))return!0;if(p&&fn(m,"text/html")){const x=new DOMParser().parseFromString(m["text/html"],"text/html").body;return!G(x.querySelector(p.nodeName.toLowerCase()))}else return!1},I$=n=>{n.on("input",i=>{const c=m=>G(m.querySelector("summary"));if(i.inputType==="deleteByDrag"){const m=At(n.dom.select("details"),c);Ne(m,p=>{mi(p.firstChild)&&p.firstChild.remove();const w=n.dom.create("summary");w.appendChild(ye().dom),p.prepend(w)})}})},B$=(n,i)=>{B_(n)&&n.on("dragend dragover draggesture dragdrop drop drag",c=>{c.preventDefault(),c.stopPropagation()}),aO(n)||n.on("drop",c=>{const m=c.dataTransfer;m&&hae(m)&&c.preventDefault()}),n.on("drop",c=>{if(c.isDefaultPrevented())return;const m=cQ(n,c);if(Re(m))return;const p=G9(c.dataTransfer),w=k1(p,CT());if((!M$(p)||zK(p))&&$$(n,c,m))return;const x=p[CT()],M=x||p["text/html"]||p["text/plain"],B=VK(n.dom,n.schema,m.startContainer,p),q=i.get();q&&!B||M&&(c.preventDefault(),_g.setEditorTimeout(n,()=>{n.undoManager.transact(()=>{(x||q&&B)&&n.execCommand("Delete"),uQ(n,m);const ae=E$(M);p["text/html"]?w4(n,ae,w,!0):P$(n,ae,!0)})}))}),n.on("dragstart",c=>{i.set(!0)}),n.on("dragover dragend",c=>{aO(n)&&!i.get()&&(c.preventDefault(),uQ(n,cQ(n,c))),c.type==="dragend"&&i.set(!1)}),I$(n)},S4=n=>{const i=p=>w=>{p(n,w)},c=bk(n);ce(c)&&n.on("PastePreProcess",i(c));const m=L_(n);ce(m)&&n.on("PastePostProcess",i(m))},WK=(n,i)=>{n.on("PastePreProcess",c=>{c.content=i(n,c.content,c.internal)})},UK=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,L$=n=>gn.trim(n).replace(UK,G_).toLowerCase(),YK=(n,i,c)=>{const m=Ok(n);if(c||m==="all"||!F_(n))return i;const p=m?m.split(/[, ]/):[];if(p&&m!=="none"){const w=n.dom,x=n.selection.getNode();i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(M,B,q,ae)=>{const fe=w.parseStyle(w.decode(q)),be={};for(let Ye=0;Ye<p.length;Ye++){const Me=fe[p[Ye]];let Ve=Me,gt=w.getStyle(x,p[Ye],!0);/color/.test(p[Ye])&&(Ve=L$(Ve),gt=L$(gt)),gt!==Ve&&(be[p[Ye]]=Me)}const Le=w.serializeStyle(be,"span");return Le?B+' style="'+Le+'"'+ae:B+ae})}else i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return i=i.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(w,x,M,B)=>x+' style="'+M+'"'+B),i},F$=n=>{(qn.browser.isChromium()||qn.browser.isSafari())&&WK(n,YK)},fQ=n=>{const i=Ga(!1),c=Ga(yk(n)?"text":"html"),m=OK(n);F$(n),ZK(n,c),S4(n),n.on("PreInit",()=>{lQ(n),B$(n,i),xT(n,m,c)})},XK=n=>{n.on("click",i=>{n.dom.getParent(i.target,"details")&&i.preventDefault()})},jK=n=>{n.parser.addNodeFilter("details",i=>{const c=fO(n);Ne(i,m=>{c==="expanded"?m.attr("open","open"):c==="collapsed"&&m.attr("open",null)})}),n.serializer.addNodeFilter("details",i=>{const c=I0(n);Ne(i,m=>{c==="expanded"?m.attr("open","open"):c==="collapsed"&&m.attr("open",null)})})},dQ=n=>{XK(n),jK(n)},qK=mi,GK=_n,KK=n=>Es(n.dom),JK=n=>ba(n.dom),hQ=n=>i=>vt(Ke.fromDom(n),i),mQ=(n,i)=>Zl(Ke.fromDom(n),c=>JK(c)||hc(c),hQ(i)).getOr(Ke.fromDom(i)).dom,gQ=(n,i)=>Zl(Ke.fromDom(n),KK,hQ(i)),Q$=(n,i,c)=>{const m=new _i(n,i),p=c?m.next.bind(m):m.prev.bind(m);let w=n;for(let x=c?n:p();x&&!qK(x);x=p())Tl(x)&&(w=x);return w},eJ=(n,i)=>{const m=Vt.fromRangeStart(n).getNode(),p=mQ(m,i),w=Q$(m,p,!1),x=Q$(m,p,!0),M=document.createRange();return gQ(w,p).fold(()=>{GK(w)?M.setStart(w,0):M.setStartBefore(w)},B=>M.setStartBefore(B.dom)),gQ(x,p).fold(()=>{GK(x)?M.setEnd(x,x.data.length):M.setEndAfter(x)},B=>M.setEndAfter(B.dom)),M},tJ=n=>{const i=eJ(n.selection.getRng(),n.getBody());n.selection.setRng(T5(i))},nJ=n=>{n.on("mousedown",i=>{i.detail>=3&&(i.preventDefault(),tJ(n))})};var nC;(function(n){n.Before="before",n.After="after"})(nC||(nC={}));const oJ=(n,i)=>Math.abs(n.left-i),pQ=(n,i)=>Math.abs(n.right-i),mae=(n,i)=>n>=i.top&&n<=i.bottom,sJ=(n,i)=>n.top<i.bottom&&n.bottom>i.top,bQ=(n,i)=>{const c=tk(n,i)/Math.min(n.height,i.height);return sJ(n,i)&&c>.5},rJ=(n,i)=>{const c=At(n,m=>mae(i,m));return ek(c).fold(()=>[[],n],m=>{const{pass:p,fail:w}=bn(n,x=>bQ(x,m));return[p,w]})},Z$=(n,i)=>({node:n.node,position:oJ(n,i)<pQ(n,i)?nC.Before:nC.After}),iJ=(n,i,c)=>i>n.left&&i<n.right?0:Math.min(Math.abs(n.left-i),Math.abs(n.right-i)),H$=(n,i,c)=>{const m=ae=>Tl(ae.node)?he.some(ae):Jn(ae.node)?H$(Rr(ae.node.childNodes),i,c):he.none(),p=(ae,fe)=>{if(ae.length>=2){const be=m(ae[0]).getOr(ae[0]),Le=m(ae[1]).getOr(ae[1]);if(Math.abs(fe(be,i,c)-fe(Le,i,c))<2){if(_n(be.node))return he.some(be);if(_n(Le.node))return he.some(Le)}}return he.none()},w=(ae,fe)=>{const be=Ns(ae,(Le,Ye)=>fe(Le,i,c)-fe(Ye,i,c));return p(be,fe).orThunk(()=>Ls(be,m))},[x,M]=rJ(S7(n),c),{pass:B,fail:q}=bn(M,ae=>ae.top<c);return w(x,iJ).orThunk(()=>w(q,Xy)).orThunk(()=>w(B,Xy))},aJ=(n,i,c,m)=>{const p=(w,x)=>{const M=q=>Jn(q)&&q.classList.contains("mce-drag-container"),B=At(w.dom.childNodes,st(M));return x.fold(()=>H$(B,c,m),q=>{const ae=At(B,fe=>fe!==q.dom);return H$(ae,c,m)}).orThunk(()=>(vt(w,n)?he.none():wi(w)).bind(ae=>p(ae,he.some(w))))};return p(i,he.none())},vQ=(n,i,c)=>{const m=Ke.fromDom(n),p=Eo(m),x=Ke.fromPoint(p,i,c).filter(M=>cn(m,M)).getOr(m);return aJ(m,x,i,c)},TT=(n,i,c)=>vQ(n,i,c).filter(m=>yb(m.node)).map(m=>Z$(m,i)),z$=n=>{var i,c;const m=n.getBoundingClientRect(),p=n.ownerDocument,w=p.documentElement,x=p.defaultView;return{top:m.top+((i=x==null?void 0:x.scrollY)!==null&&i!==void 0?i:0)-w.clientTop,left:m.left+((c=x==null?void 0:x.scrollX)!==null&&c!==void 0?c:0)-w.clientLeft}},OQ=n=>n.inline?z$(n.getBody()):{left:0,top:0},lJ=n=>{const i=n.getBody();return n.inline?{left:i.scrollLeft,top:i.scrollTop}:{left:0,top:0}},cJ=n=>{const i=n.getBody(),c=n.getDoc().documentElement,m={left:i.scrollLeft,top:i.scrollTop},p={left:i.scrollLeft||c.scrollLeft,top:i.scrollTop||c.scrollTop};return n.inline?m:p},yQ=(n,i)=>{if(i.target.ownerDocument!==n.getDoc()){const c=z$(n.getContentAreaContainer()),m=cJ(n);return{left:i.pageX-c.left+m.left,top:i.pageY-c.top+m.top}}return{left:i.pageX,top:i.pageY}},uJ=(n,i,c)=>({pageX:c.left-n.left+i.left,pageY:c.top-n.top+i.top}),fJ=(n,i)=>uJ(OQ(n),lJ(n),yQ(n,i)),wQ=n=>({target:n,srcElement:n}),V$=(n,i,c,m)=>({...i,dataTransfer:m,type:n,...wQ(c)}),dJ=(n,i,c)=>{const m=rn("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:m,initEvent:m,preventDefault:ot,stopImmediatePropagation:ot,stopPropagation:ot,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:m,initMouseEvent:m,getModifierState:m,dataTransfer:c,...wQ(i)}},hJ=(n,i)=>{const c=tC(n);return i==="dragstart"?(L9(c),Q9(c)):i==="drop"?(ji(c),_$(c)):(aK(c),Z9(c)),c},mJ=(n,i,c,m)=>{const p=hJ(c,n);return ve(m)?dJ(n,i,p):V$(n,m,i,p)},C4=32,gJ=100,k4=8,ET=16,W$=Es,U$=nk(W$,ba),Y$=(n,i,c)=>W$(c)&&c!==i&&n.isEditable(c.parentElement),pJ=(n,i,c)=>Re(i)||i===c||n.dom.isChildOf(i,c)?!1:n.dom.isEditable(i),X$=(n,i,c,m)=>{const p=n.dom,w=i.cloneNode(!0);p.setStyles(w,{width:c,height:m}),p.setAttrib(w,"data-mce-selected",null);const x=p.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return p.setStyles(x,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:c,height:m}),p.setStyles(w,{margin:0,boxSizing:"border-box"}),x.appendChild(w),x},bJ=(n,i)=>{n.parentNode!==i&&i.appendChild(n)},x4=(n,i)=>c=>()=>{const m=n==="left"?c.scrollX:c.scrollY;c.scroll({[n]:m+i,behavior:"smooth"})},j$=x4("left",-C4),_Q=x4("left",C4),SQ=x4("top",-C4),CQ=x4("top",C4),vJ=(n,i,c,m,p,w,x,M,B,q,ae,fe)=>{let be=0,Le=0;n.style.left=i.pageX+"px",n.style.top=i.pageY+"px",i.pageX+c>p&&(be=i.pageX+c-p),i.pageY+m>w&&(Le=i.pageY+m-w),n.style.width=c-be+"px",n.style.height=m-Le+"px";const Ye=B.clientHeight,Me=B.clientWidth,Ve=x+B.getBoundingClientRect().top,gt=M+B.getBoundingClientRect().left;ae.on(Ot=>{Ot.intervalId.clear(),Ot.dragging&&fe&&(x+k4>=Ye?Ot.intervalId.set(CQ(q)):x-k4<=0?Ot.intervalId.set(SQ(q)):M+k4>=Me?Ot.intervalId.set(_Q(q)):M-k4<=0?Ot.intervalId.set(j$(q)):Ve+ET>=window.innerHeight?Ot.intervalId.set(CQ(window)):Ve-ET<=0?Ot.intervalId.set(SQ(window)):gt+ET>=window.innerWidth?Ot.intervalId.set(_Q(window)):gt-ET<=0&&Ot.intervalId.set(j$(window)))})},kQ=n=>{n&&n.parentNode&&n.parentNode.removeChild(n)},OJ=(n,i)=>{const c=n.getParent(i.parentNode,n.isBlock);kQ(i),c&&c!==n.getRoot()&&n.isEmpty(c)&&Pe(Ke.fromDom(c))},yJ=n=>n.button===0,xQ=(n,i)=>({pageX:i.pageX-n.relX,pageY:i.pageY+5}),wJ=(n,i)=>c=>{if(yJ(c)){const m=oo(i.dom.getParents(c.target),U$).getOr(null);if(Oe(m)&&Y$(i.dom,i.getBody(),m)){const p=i.dom.getPos(m),w=i.getBody(),x=i.getDoc().documentElement;n.set({element:m,dataTransfer:S$(),dragging:!1,screenX:c.screenX,screenY:c.screenY,maxX:(i.inline?w.scrollWidth:x.offsetWidth)-2,maxY:(i.inline?w.scrollHeight:x.offsetHeight)-2,relX:c.pageX-p.x,relY:c.pageY-p.y,width:m.offsetWidth,height:m.offsetHeight,ghost:X$(i,m,m.offsetWidth,m.offsetHeight),intervalId:KC(gJ)})}}},q$=(n,i,c)=>{n._selectionOverrides.hideFakeCaret(),TT(n.getBody(),i,c).fold(()=>n.selection.placeCaretAt(i,c),m=>{const p=n._selectionOverrides.showCaret(1,m.node,m.position===nC.Before,!1);p?n.selection.setRng(p):n.selection.placeCaretAt(i,c)})},AT=(n,i,c,m,p)=>{i==="dragstart"&&O4(m,n.dom.getOuterHTML(c));const w=mJ(i,c,m,p);return n.dispatch(i,w)},_J=(n,i)=>{const c=_0((p,w)=>q$(i,p,w),0);i.on("remove",c.cancel);const m=n;return p=>n.on(w=>{const x=Math.max(Math.abs(p.screenX-w.screenX),Math.abs(p.screenY-w.screenY));if(!w.dragging&&x>10){const M=AT(i,"dragstart",w.element,w.dataTransfer,p);if(Oe(M.dataTransfer)&&(w.dataTransfer=M.dataTransfer),M.isDefaultPrevented())return;w.dragging=!0,i.focus()}if(w.dragging){const M=p.currentTarget===i.getDoc().documentElement,B=xQ(w,fJ(i,p));bJ(w.ghost,i.getBody()),vJ(w.ghost,B,w.width,w.height,w.maxX,w.maxY,p.clientY,p.clientX,i.getContentAreaContainer(),i.getWin(),m,M),c.throttle(p.clientX,p.clientY)}})},SJ=n=>{const i=n.getSel();if(Oe(i)){const m=i.getRangeAt(0).startContainer;return _n(m)?m.parentNode:m}else return null},CJ=(n,i)=>c=>{n.on(m=>{var p;if(m.intervalId.clear(),m.dragging){if(pJ(i,SJ(i.selection),m.element)){const w=(p=i.getDoc().elementFromPoint(c.clientX,c.clientY))!==null&&p!==void 0?p:i.getBody();AT(i,"drop",w,m.dataTransfer,c).isDefaultPrevented()||i.undoManager.transact(()=>{OJ(i.dom,m.element),fK(m.dataTransfer).each(M=>i.insertContent(M)),i._selectionOverrides.hideFakeCaret()})}AT(i,"dragend",i.getBody(),m.dataTransfer,c)}}),DT(n)},TQ=(n,i,c)=>{n.on(m=>{m.intervalId.clear(),m.dragging&&c.fold(()=>AT(i,"dragend",m.element,m.dataTransfer),p=>AT(i,"dragend",m.element,m.dataTransfer,p))}),DT(n)},kJ=(n,i)=>c=>TQ(n,i,he.some(c)),DT=n=>{n.on(i=>{i.intervalId.clear(),kQ(i.ghost)}),n.clear()},xJ=n=>{const i=Sh(),c=Qr.DOM,m=document,p=wJ(i,n),w=_J(i,n),x=CJ(i,n),M=kJ(i,n);n.on("mousedown",p),n.on("mousemove",w),n.on("mouseup",x),c.bind(m,"mousemove",w),c.bind(m,"mouseup",M),n.on("remove",()=>{c.unbind(m,"mousemove",w),c.unbind(m,"mouseup",M)}),n.on("keydown",B=>{B.keyCode===to.ESC&&TQ(i,n,he.none())})},TJ=n=>{const i=p=>{if(!p.isDefaultPrevented()){const w=p.dataTransfer;w&&(kt(w.types,"Files")||w.files.length>0)&&(p.preventDefault(),p.type==="drop"&&Gx(n,"Dropped file type is not supported"))}},c=p=>{px(n,p.target)&&i(p)},m=()=>{const p=Qr.DOM,w=n.dom,x=document,M=n.inline?n.getBody():n.getDoc(),B=["drop","dragover"];Ne(B,q=>{p.bind(x,q,c),w.bind(M,q,i)}),n.on("remove",()=>{Ne(B,q=>{p.unbind(x,q,c),w.unbind(M,q,i)})})};n.on("init",()=>{_g.setEditorTimeout(n,m,0)})},EJ=n=>{xJ(n),vg(n)&&TJ(n)},AJ=n=>{const i=_0(()=>{if(!n.removed&&n.getBody().contains(document.activeElement)){const c=n.selection.getRng();if(c.collapsed){const m=nR(n,c,!1);n.selection.setRng(m)}}},0);n.on("focus",()=>{i.throttle()}),n.on("blur",()=>{i.cancel()})},DJ=n=>{n.on("init",()=>{n.on("focusin",i=>{const c=i.target;if(sf(c)){const m=PO(n.getBody(),c),p=Es(m)?m:c;n.selection.getNode()!==p&&tT(n,p).each(w=>n.selection.setRng(w))}})})},PT=Es,EQ=(n,i)=>PO(n.getBody(),i),PJ=n=>{const i=n.selection,c=n.dom,m=n.getBody(),p=Mk(n,m,c.isBlock,()=>U2(n)),w="sel-"+c.uniqueId(),x="data-mce-selected";let M;const B=$n=>Oe($n)&&c.hasClass($n,"mce-offscreen-selection"),q=$n=>$n!==m&&(PT($n)||sf($n))&&c.isChildOf($n,m)&&c.isEditable($n.parentNode),ae=$n=>{$n&&i.setRng($n)},fe=($n,Lt,Zt,yn=!0)=>n.dispatch("ShowCaret",{target:Lt,direction:$n,before:Zt}).isDefaultPrevented()?null:(yn&&i.scrollIntoView(Lt,$n===-1),p.show(Zt,Lt)),be=$n=>{$n.hasAttribute("data-mce-caret")&&(Km($n),i.scrollIntoView($n))},Le=()=>{n.on("click",Lt=>{c.isEditable(Lt.target)||(Lt.preventDefault(),n.focus())}),n.on("blur NewBlock",Pt),n.on("ResizeWindow FullscreenStateChanged",p.reposition),n.on("tap",Lt=>{const Zt=Lt.target,yn=EQ(n,Zt);PT(yn)?(Lt.preventDefault(),tT(n,yn).each(wt)):q(Zt)&&tT(n,Zt).each(wt)},!0),n.on("mousedown",Lt=>{const Zt=Lt.target;if(Zt!==m&&Zt.nodeName!=="HTML"&&!c.isChildOf(Zt,m)||!zM(n,Lt.clientX,Lt.clientY))return;Pt(),Hn();const yn=EQ(n,Zt);PT(yn)?(Lt.preventDefault(),tT(n,yn).each(wt)):TT(m,Lt.clientX,Lt.clientY).each(yo=>{Lt.preventDefault();const Do=fe(1,yo.node,yo.position===nC.Before,!1);ae(Do),Jn(yn)?yn.focus():n.getBody().focus()})}),n.on("keypress",Lt=>{to.modifierPressed(Lt)||PT(i.getNode())&&Lt.preventDefault()}),n.on("GetSelectionRange",Lt=>{let Zt=Lt.range;if(M){if(!M.parentNode){M=null;return}Zt=Zt.cloneRange(),Zt.selectNode(M),Lt.range=Zt}}),n.on("SetSelectionRange",Lt=>{Lt.range=Ve(Lt.range);const Zt=wt(Lt.range,Lt.forward);Zt&&(Lt.range=Zt)});const $n=Lt=>Jn(Lt)&&Lt.id==="mcepastebin";n.on("AfterSetSelectionRange",Lt=>{const Zt=Lt.range,yn=Zt.startContainer.parentElement;!Me(Zt)&&!$n(yn)&&Hn(),B(yn)||Pt()}),EJ(n),AJ(n),DJ(n)},Ye=$n=>_r($n)||hh($n)||hr($n),Me=$n=>Ye($n.startContainer)||Ye($n.endContainer),Ve=$n=>{const Lt=n.schema.getVoidElements(),Zt=c.createRng(),yn=$n.startContainer,yo=$n.startOffset,Do=$n.endContainer,Cs=$n.endOffset;return fn(Lt,yn.nodeName.toLowerCase())?yo===0?Zt.setStartBefore(yn):Zt.setStartAfter(yn):Zt.setStart(yn,yo),fn(Lt,Do.nodeName.toLowerCase())?Cs===0?Zt.setEndBefore(Do):Zt.setEndAfter(Do):Zt.setEnd(Do,Cs),Zt},gt=($n,Lt)=>{const Zt=Ke.fromDom(n.getBody()),yn=n.getDoc(),yo=Je(Zt,"#"+w).getOrThunk(()=>{const Ws=Ke.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',yn);return Pr(Ws,"id",w),na(Zt,Ws),Ws}),Do=c.createRng();Ad(yo),ni(yo,[Ke.fromText(Kr,yn),Ke.fromDom(Lt),Ke.fromText(Kr,yn)]),Do.setStart(yo.dom.firstChild,1),Do.setEnd(yo.dom.lastChild,0),ua(yo,{top:c.getPos($n,n.getBody()).y+"px"}),X0(yo);const Cs=i.getSel();return Cs&&(Cs.removeAllRanges(),Cs.addRange(Do)),Do},Ot=$n=>{const Lt=$n.cloneNode(!0),Zt=n.dispatch("ObjectSelected",{target:$n,targetClone:Lt});if(Zt.isDefaultPrevented())return null;const yn=gt($n,Zt.targetClone),yo=Ke.fromDom($n);return Ne(pl(Ke.fromDom(n.getBody()),`*[${x}]`),Do=>{vt(yo,Do)||Vi(Do,x)}),c.getAttrib($n,x)||$n.setAttribute(x,"1"),M=$n,Hn(),yn},wt=($n,Lt)=>{if(!$n)return null;if($n.collapsed){if(!Me($n)){const Do=Lt?1:-1,Cs=Ce(Do,m,$n),Ws=Cs.getNode(!Lt);if(Oe(Ws)){if(yb(Ws))return fe(Do,Ws,Lt?!Cs.isAtEnd():!1,!1);if(sr(Ws)&&Es(Ws.nextSibling)){const pi=c.createRng();return pi.setStart(Ws,0),pi.setEnd(Ws,0),pi}}const Ir=Cs.getNode(Lt);if(Oe(Ir)){if(yb(Ir))return fe(Do,Ir,Lt?!1:!Cs.isAtEnd(),!1);if(sr(Ir)&&Es(Ir.previousSibling)){const pi=c.createRng();return pi.setStart(Ir,1),pi.setEnd(Ir,1),pi}}}return null}let Zt=$n.startContainer,yn=$n.startOffset;const yo=$n.endOffset;if(_n(Zt)&&yn===0&&PT(Zt.parentNode)&&(Zt=Zt.parentNode,yn=c.nodeIndex(Zt),Zt=Zt.parentNode),!Jn(Zt))return null;if(yo===yn+1&&Zt===$n.endContainer){const Do=Zt.childNodes[yn];if(q(Do))return Ot(Do)}return null},Pt=()=>{M&&M.removeAttribute(x),Je(Ke.fromDom(n.getBody()),"#"+w).each(wr),M=null},hn=()=>{p.destroy(),M=null},Hn=()=>{p.hide()};return Mb(n)||Le(),{showCaret:fe,showBlockCaretContainer:be,hideFakeCaret:Hn,destroy:hn}},MJ=(n,i)=>{let c=i;for(let m=n.previousSibling;_n(m);m=m.previousSibling)c+=m.data.length;return c},G$=(n,i,c,m,p)=>{if(_n(c)&&(m<0||m>c.data.length))return[];const w=p&&_n(c)?[MJ(c,m)]:[m];let x=c;for(;x!==i&&x.parentNode;)w.push(n.nodeIndex(x,p)),x=x.parentNode;return x===i?w.reverse():[]},K$=(n,i,c,m,p,w,x=!1)=>{const M=G$(n,i,c,m,x),B=G$(n,i,p,w,x);return{start:M,end:B}},J$=(n,i)=>{const c=i.slice(),m=c.pop();return Xe(m)?zn(c,(w,x)=>w.bind(M=>he.from(M.childNodes[x])),he.some(n)).bind(w=>_n(w)&&(m<0||m>w.data.length)?he.none():he.some({node:w,offset:m})):he.none()},AQ=(n,i)=>J$(n,i.start).bind(({node:c,offset:m})=>J$(n,i.end).map(({node:p,offset:w})=>{const x=document.createRange();return x.setStart(c,m),x.setEnd(p,w),x})),RJ=(n,i,c,m=!1)=>K$(n,i,c.startContainer,c.startOffset,c.endContainer,c.endOffset,m),ww=(n,i,c)=>{if(i&&n.isEmpty(i)&&!c(i)){const m=i.parentNode;n.remove(i,_n(i.firstChild)&&eg(i.firstChild.data)),ww(n,m,c)}},YO=(n,i,c,m=!0)=>{const p=i.startContainer.parentNode,w=i.endContainer.parentNode;i.deleteContents(),m&&!c(i.startContainer)&&(_n(i.startContainer)&&i.startContainer.data.length===0&&n.remove(i.startContainer),_n(i.endContainer)&&i.endContainer.data.length===0&&n.remove(i.endContainer),ww(n,p,c),p!==w&&ww(n,w,c))},eN=(n,i)=>he.from(n.dom.getParent(i.startContainer,n.dom.isBlock)),tN=(n,i,c)=>{const m=n.dynamicPatternsLookup({text:c,block:i});return{...n,blockPatterns:hm(m).concat(n.blockPatterns),inlinePatterns:a2(m).concat(n.inlinePatterns)}},DQ=(n,i,c,m)=>{const p=n.createRng();return p.setStart(i,0),p.setEnd(c,m),p.toString()},$J=n=>/^\s[^\s]/.test(n),PQ=(n,i,c)=>{pq(i,0,i).each(p=>{const w=p.container;YR(w,c.start.length,i).each(B=>{const q=n.createRng();q.setStart(w,0),q.setEnd(B.container,B.offset),YO(n,q,ae=>ae===i)});const x=Ke.fromDom(w),M=Wc(x);$J(M)&&sd(x,M.slice(1))})},NJ=(n,i)=>{const c=n.dom,m=i.pattern,p=AQ(c.getRoot(),i.range).getOrDie("Unable to resolve path range"),w=(x,M)=>{const B=M.get(x);return oe(B)&&$o(B).exists(q=>fn(q,"block"))};return eN(n,p).each(x=>{m.type==="block-format"?w(m.format,n.formatter)&&n.undoManager.transact(()=>{PQ(n.dom,x,m),n.formatter.apply(m.format)}):m.type==="block-command"&&n.undoManager.transact(()=>{PQ(n.dom,x,m),n.execCommand(m.cmd,!1,m.value)})}),!0},MQ=n=>Ns(n,(i,c)=>c.start.length-i.start.length),IJ=(n,i)=>{const c=MQ(n),m=i.replace(Kr," ");return oo(c,p=>i.indexOf(p.start)===0||m.indexOf(p.start)===0)},RQ=(n,i,c,m)=>{var p;const w=n.dom,x=jc(n);if(!w.is(i,x))return[];const M=(p=i.textContent)!==null&&p!==void 0?p:"";return IJ(c.blockPatterns,M).map(B=>gn.trim(M).length===B.start.length?[]:[{pattern:B,range:K$(w,w.getRoot(),i,0,i,0,m)}]).getOr([])},BJ=(n,i)=>{if(i.length===0)return;const c=n.selection.getBookmark();Ne(i,m=>NJ(n,m)),n.selection.moveToBookmark(c)},$Q=(n,i)=>n.create("span",{"data-mce-type":"bookmark",id:i}),T4=(n,i)=>{const c=n.createRng();return c.setStartAfter(i.start),c.setEndBefore(i.end),c},NQ=(n,i,c)=>{const m=AQ(n.getRoot(),c).getOrDie("Unable to resolve path range"),p=m.startContainer,w=m.endContainer,x=m.endOffset===0?w:w.splitText(m.endOffset),M=m.startOffset===0?p:p.splitText(m.startOffset),B=M.parentNode,q=x.parentNode;return{prefix:i,end:q.insertBefore($Q(n,i+"-end"),x),start:B.insertBefore($Q(n,i+"-start"),M)}},IQ=(n,i,c)=>{ww(n,n.get(i.prefix+"-end"),c),ww(n,n.get(i.prefix+"-start"),c)},nN=n=>n.start.length===0,LJ=n=>(i,c)=>{const p=i.data.substring(0,c),w=p.lastIndexOf(n.charAt(n.length-1)),x=p.lastIndexOf(n);return x!==-1?x+n.length:w!==-1?w+1:-1},BQ=(n,i,c,m)=>{const p=i.start;return XR(n,m.container,m.offset,LJ(p),c).bind(x=>{var M,B;const q=(B=(M=c.textContent)===null||M===void 0?void 0:M.indexOf(p))!==null&&B!==void 0?B:-1;if(q!==-1&&x.offset>=q+p.length){const fe=n.createRng();return fe.setStart(x.container,x.offset-p.length),fe.setEnd(x.container,x.offset),he.some(fe)}else{const fe=x.offset-p.length;return UR(x.container,fe,c).map(be=>{const Le=n.createRng();return Le.setStart(be.container,be.offset),Le.setEnd(x.container,x.offset),Le}).filter(be=>be.toString()===p).orThunk(()=>BQ(n,i,c,Dp(x.container,0)))}})},FJ=(n,i,c,m,p,w=!1)=>{if(i.start.length===0&&!w){const x=n.createRng();return x.setStart(c,m),x.setEnd(c,m),he.some(x)}return qA(c,m,p).bind(x=>BQ(n,i,p,x).bind(B=>{var q;if(w){if(B.endContainer===x.container&&B.endOffset===x.offset)return he.none();if(x.offset===0&&((q=B.endContainer.textContent)===null||q===void 0?void 0:q.length)===B.endOffset)return he.none()}return he.some(B)}))},LQ=(n,i,c,m)=>{const p=n.dom,w=p.getRoot(),x=c.pattern,M=c.position.container,B=c.position.offset;return UR(M,B-c.pattern.end.length,i).bind(q=>{const ae=K$(p,w,q.container,q.offset,M,B,m);if(nN(x))return he.some({matches:[{pattern:x,startRng:ae,endRng:ae}],position:q});{const fe=oC(n,c.remainingPatterns,q.container,q.offset,i,m),be=fe.getOr({matches:[],position:q}),Le=be.position;return FJ(p,x,Le.container,Le.offset,i,fe.isNone()).map(Me=>{const Ve=RJ(p,w,Me,m);return{matches:be.matches.concat([{pattern:x,startRng:Ve,endRng:ae}]),position:Dp(Me.startContainer,Me.startOffset)}})}})},oC=(n,i,c,m,p,w)=>{const x=n.dom;return qA(c,m,x.getRoot()).bind(M=>{const B=DQ(x,p,c,m);for(let q=0;q<i.length;q++){const ae=i[q];if(!Ki(B,ae.end))continue;const fe=i.slice();fe.splice(q,1);const be=LQ(n,p,{pattern:ae,remainingPatterns:fe,position:M},w);if(be.isNone()&&m>0)return oC(n,i,c,m-1,p,w);if(be.isSome())return be}return he.none()})},oN=(n,i,c)=>{n.selection.setRng(c),i.type==="inline-format"?Ne(i.format,m=>{n.formatter.apply(m)}):n.execCommand(i.cmd,!1,i.value)},FQ=(n,i,c,m)=>{const p=T4(n.dom,c);YO(n.dom,p,m),oN(n,i,p)},QJ=(n,i,c,m,p)=>{const w=n.dom,x=T4(w,m),M=T4(w,c);YO(w,M,p),YO(w,x,p);const B={prefix:c.prefix,start:c.end,end:m.start},q=T4(w,B);oN(n,i,q)},ZJ=(n,i)=>{const c=Li("mce_textpattern"),m=An(i,(p,w)=>{const x=NQ(n,c+`_end${p.length}`,w.endRng);return p.concat([{...w,endMarker:x}])},[]);return An(m,(p,w)=>{const x=m.length-p.length-1,M=nN(w.pattern)?w.endMarker:NQ(n,c+`_start${x}`,w.startRng);return p.concat([{...w,startMarker:M}])},[])},HJ=n=>Ns(n,(i,c)=>c.end.length-i.end.length),QQ=(n,i)=>{const c=tr(n,m=>jt(i,p=>m.pattern.start===p.pattern.start&&m.pattern.end===p.pattern.end));return n.length===i.length?c?n:i:n.length>i.length?n:i},sN=(n,i,c,m,p,w)=>{const x=oC(n,p.inlinePatterns,c,m,i,w).fold(()=>[],B=>B.matches),M=oC(n,HJ(p.inlinePatterns),c,m,i,w).fold(()=>[],B=>B.matches);return QQ(x,M)},ZQ=(n,i)=>{if(i.length===0)return;const c=n.dom,m=n.selection.getBookmark(),p=ZJ(c,i);Ne(p,w=>{const x=c.getParent(w.startMarker.start,c.isBlock),M=B=>B===x;nN(w.pattern)?FQ(n,w.pattern,w.endMarker,M):QJ(n,w.pattern,w.startMarker,w.endMarker,M),IQ(c,w.endMarker,M),IQ(c,w.startMarker,M)}),n.selection.moveToBookmark(m)},zJ=(n,i)=>{const c=n.selection.getRng();return eN(n,c).map(m=>{var p;const w=Math.max(0,c.startOffset),x=tN(i,m,(p=m.textContent)!==null&&p!==void 0?p:""),M=sN(n,m,c.startContainer,w,x,!0),B=RQ(n,m,x,!0);return B.length>0||M.length>0?(n.undoManager.add(),n.undoManager.extra(()=>{n.execCommand("mceInsertNewLine")},()=>{n.insertContent(nn),ZQ(n,M),BJ(n,B);const q=n.selection.getRng(),ae=qA(q.startContainer,q.startOffset,n.dom.getRoot());n.execCommand("mceInsertNewLine"),ae.each(fe=>{const be=fe.container;be.data.charAt(fe.offset-1)===nn&&(be.deleteData(fe.offset-1,1),ww(n.dom,be.parentNode,Le=>Le===n.dom.getRoot()))})}),!0):!1}).getOr(!1)},rN=(n,i)=>{const c=n.selection.getRng();eN(n,c).map(m=>{const p=Math.max(0,c.startOffset-1),w=DQ(n.dom,m,c.startContainer,p),x=tN(i,m,w),M=sN(n,m,c.startContainer,p,x,!1);M.length>0&&n.undoManager.transact(()=>{ZQ(n,M)})})},MT=(n,i,c)=>{for(let m=0;m<n.length;m++)if(c(n[m],i))return!0;return!1},E4=(n,i)=>MT(n,i,(c,m)=>c===m.keyCode&&!to.modifierPressed(m)),pv=(n,i)=>MT(n,i,(c,m)=>c.charCodeAt(0)===m.charCode),A4=n=>{const i=[",",".",";",":","!","?"],c=[32],m=()=>r1(H_(n),g2(n)),p=()=>bb(n);n.on("keydown",x=>{if(x.keyCode===13&&!to.modifierPressed(x)&&n.selection.isCollapsed()){const M=m();(M.inlinePatterns.length>0||M.blockPatterns.length>0||p())&&zJ(n,M)&&x.preventDefault()}},!0);const w=()=>{if(n.selection.isCollapsed()){const x=m();(x.inlinePatterns.length>0||p())&&rN(n,x)}};n.on("keyup",x=>{E4(c,x)&&w()}),n.on("keypress",x=>{pv(i,x)&&_g.setEditorTimeout(n,w)})},sC=n=>{A4(n)},HQ=n=>{const i=gn.each,c=to.BACKSPACE,m=to.DELETE,p=n.dom,w=n.selection,x=n.parser,M=qn.browser,B=M.isFirefox(),q=M.isChromium()||M.isSafari(),ae=qn.deviceType.isiPhone()||qn.deviceType.isiPad(),fe=qn.os.isMacOS()||qn.os.isiOS(),be=(Co,Mn)=>{try{n.getDoc().execCommand(Co,!1,String(Mn))}catch{}},Le=Co=>Co.isDefaultPrevented(),Ye=()=>{const Co=jo=>{const Ks=p.create("body"),Jr=jo.cloneContents();return Ks.appendChild(Jr),w.serializer.serialize(Ks,{format:"html"})},Mn=jo=>{const Ks=Co(jo),Jr=p.createRng();Jr.selectNode(n.getBody());const ho=Co(Jr);return Ks===ho},En=jo=>{const Ks=Ke.fromDom(jo),Jr=ho=>wi(ho).exists(Us=>!wn(Us));return jt(pl(Ks,'[contenteditable="true"]'),Jr)};n.on("keydown",jo=>{const Ks=jo.keyCode;if(!Le(jo)&&(Ks===m||Ks===c)&&n.selection.isEditable()){const Jr=n.selection.isCollapsed(),ho=n.getBody();if(Jr&&(!p.isEmpty(ho)||En(ho))||!Jr&&!Mn(n.selection.getRng()))return;jo.preventDefault(),n.setContent(""),ho.firstChild&&p.isBlock(ho.firstChild)?n.selection.setCursorLocation(ho.firstChild,0):n.selection.setCursorLocation(ho,0),n.nodeChanged()}})},Me=()=>{n.shortcuts.add("meta+a",null,"SelectAll")},Ve=()=>{n.inline||p.bind(n.getDoc(),"mousedown mouseup",Co=>{let Mn;if(Co.target===n.getDoc().documentElement)if(Mn=w.getRng(),n.getBody().focus(),Co.type==="mousedown"){if(_r(Mn.startContainer))return;w.placeCaretAt(Co.clientX,Co.clientY)}else w.setRng(Mn)})},gt=()=>{n.on("keydown",Co=>{if(!Le(Co)&&Co.keyCode===c){if(!n.getBody().getElementsByTagName("hr").length)return;if(w.isCollapsed()&&w.getRng().startOffset===0){const Mn=w.getNode(),En=Mn.previousSibling;if(Mn.nodeName==="HR"){p.remove(Mn),Co.preventDefault();return}En&&En.nodeName&&En.nodeName.toLowerCase()==="hr"&&(p.remove(En),Co.preventDefault())}}})},Ot=()=>{Range.prototype.getClientRects||n.on("mousedown",Co=>{if(!Le(Co)&&Co.target.nodeName==="HTML"){const Mn=n.getBody();Mn.blur(),_g.setEditorTimeout(n,()=>{Mn.focus()})}})},wt=()=>{const Co=R0(n);n.on("click",Mn=>{const En=Mn.target;/^(IMG|HR)$/.test(En.nodeName)&&p.isEditable(En.parentNode)&&(Mn.preventDefault(),n.selection.select(En),n.nodeChanged()),En.nodeName==="A"&&p.hasClass(En,Co)&&En.childNodes.length===0&&p.isEditable(En.parentNode)&&(Mn.preventDefault(),w.select(En))})},Pt=()=>{const Co=()=>{const En=p.getAttribs(w.getStart().cloneNode(!1));return()=>{const jo=w.getStart();jo!==n.getBody()&&(p.setAttrib(jo,"style",null),i(En,Ks=>{jo.setAttributeNode(Ks.cloneNode(!0))}))}},Mn=()=>!w.isCollapsed()&&p.getParent(w.getStart(),p.isBlock)!==p.getParent(w.getEnd(),p.isBlock);n.on("keypress",En=>{let jo;return!Le(En)&&(En.keyCode===8||En.keyCode===46)&&Mn()?(jo=Co(),n.getDoc().execCommand("delete",!1),jo(),En.preventDefault(),!1):!0}),p.bind(n.getDoc(),"cut",En=>{if(!Le(En)&&Mn()){const jo=Co();_g.setEditorTimeout(n,()=>{jo()})}})},hn=()=>{n.on("keydown",Co=>{if(!Le(Co)&&Co.keyCode===c&&w.isCollapsed()&&w.getRng().startOffset===0){const Mn=w.getNode().previousSibling;if(Mn&&Mn.nodeName&&Mn.nodeName.toLowerCase()==="table")return Co.preventDefault(),!1}return!0})},Hn=()=>{n.on("keydown",Co=>{if(Le(Co)||Co.keyCode!==to.BACKSPACE)return;let Mn=w.getRng();const En=Mn.startContainer,jo=Mn.startOffset,Ks=p.getRoot();let Jr=En;if(!(!Mn.collapsed||jo!==0)){for(;Jr.parentNode&&Jr.parentNode.firstChild===Jr&&Jr.parentNode!==Ks;)Jr=Jr.parentNode;Jr.nodeName==="BLOCKQUOTE"&&(n.formatter.toggle("blockquote",void 0,Jr),Mn=p.createRng(),Mn.setStart(En,0),Mn.setEnd(En,0),w.setRng(Mn))}})},$n=()=>{const Co=()=>{be("StyleWithCSS",!1),be("enableInlineTableEditing",!1),d2(n)||be("enableObjectResizing",!1)};bg(n)||n.on("BeforeExecCommand mousedown",Co)},Lt=()=>{const Co=()=>{i(p.select("a:not([data-mce-block])"),Mn=>{var En;let jo=Mn.parentNode;const Ks=p.getRoot();if((jo==null?void 0:jo.lastChild)===Mn){for(;jo&&!p.isBlock(jo);){if(((En=jo.parentNode)===null||En===void 0?void 0:En.lastChild)!==jo||jo===Ks)return;jo=jo.parentNode}p.add(jo,"br",{"data-mce-bogus":1})}})};n.on("SetContent ExecCommand",Mn=>{(Mn.type==="setcontent"||Mn.command==="mceInsertLink")&&Co()})},Zt=()=>{n.on("init",()=>{be("DefaultParagraphSeparator",jc(n))})},yn=Co=>{const Mn=Co.getBody(),En=Co.selection.getRng();return En.startContainer===En.endContainer&&En.startContainer===Mn&&En.startOffset===0&&En.endOffset===Mn.childNodes.length},yo=()=>{n.on("keyup focusin mouseup",Co=>{!to.modifierPressed(Co)&&!yn(n)&&w.normalize()},!0)},Do=()=>{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()})},Ws=()=>{n.inline||(n.contentStyles.push("body {min-height: 150px}"),n.on("click",Co=>{let Mn;Co.target.nodeName==="HTML"&&(Mn=n.selection.getRng(),n.getBody().focus(),n.selection.setRng(Mn),n.selection.normalize(),n.nodeChanged())}))},Ir=()=>{fe&&n.on("keydown",Co=>{to.metaKeyPressed(Co)&&!Co.shiftKey&&(Co.keyCode===37||Co.keyCode===39)&&(Co.preventDefault(),n.selection.getSel().modify("move",Co.keyCode===37?"backward":"forward","lineboundary"))})},pi=()=>{n.on("click",Co=>{let Mn=Co.target;do if(Mn.tagName==="A"){Co.preventDefault();return}while(Mn=Mn.parentNode)}),n.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},fl=()=>{n.on("init",()=>{n.dom.bind(n.getBody(),"submit",Co=>{Co.preventDefault()})})},Il=()=>{x.addNodeFilter("br",Co=>{let Mn=Co.length;for(;Mn--;)Co[Mn].attr("class")==="Apple-interchange-newline"&&Co[Mn].remove()})},Oc=ot,Pn=()=>{if(!B||n.removed)return!1;const Co=n.selection.getSel();return!Co||!Co.rangeCount||Co.rangeCount===0},eo=()=>{q&&(Ve(),wt(),fl(),Me(),ae&&(Cs(),Ws(),pi())),B&&(Ot(),$n(),Do(),Ir())},Cr=()=>{n.on("drop",Co=>{var Mn;const En=(Mn=Co.dataTransfer)===null||Mn===void 0?void 0:Mn.getData("text/html");L(En)&&/^<img[^>]*>$/.test(En)&&n.dispatch("dragend",new window.DragEvent("dragend",Co))})},Bs=()=>{Hn(),Ye(),qn.windowsPhone||yo(),q&&(Ve(),wt(),Zt(),fl(),hn(),Il(),ae?(Cs(),Ws(),pi()):Me()),B&&(gt(),Ot(),Pt(),$n(),Lt(),Do(),Ir(),hn(),Cr())};return Mb(n)?eo():Bs(),{refreshContentEditable:Oc,isHidden:Pn}},iN=Qr.DOM,VJ=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=em(ql(c)),p=Ke.fromTag("style");Pr(p,"type","text/css"),na(p,Ke.fromText(i)),na(m,p),n.on("remove",()=>{wr(p)})},zQ=n=>n.inline?n.getElement().nodeName.toLowerCase():void 0,aN=n=>Wt(n,i=>ve(i)===!1),D4=n=>{const i=n.options.get,c=n.editorUpload.blobCache;return aN({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:zQ(n),sanitize:i("xss_sanitization"),validate:!0,blob_cache:c,document:n.getDoc()})},RT=n=>{const i=n.options.get;return aN({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")})},XO=n=>{const i=n.options.get;return{...D4(n),...RT(n),...aN({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")})}},_w=n=>{const i=$S(D4(n),n.schema);return i.addAttributeFilter("src,href,style,tabindex",(c,m)=>{const p=n.dom,w="data-mce-"+m;let x=c.length;for(;x--;){const M=c[x];let B=M.attr(m);if(B&&!M.attr(w)){if(B.indexOf("data:")===0||B.indexOf("blob:")===0)continue;m==="style"?(B=p.serializeStyle(p.parseStyle(B),M.name),B.length||(B=null),M.attr(w,B),M.attr(m,B)):m==="tabindex"?(M.attr(w,B),M.attr(m,null)):M.attr(w,n.convertURL(B,m,M.name))}}}),i.addNodeFilter("script",c=>{let m=c.length;for(;m--;){const p=c[m],w=p.attr("type")||"no/type";w.indexOf("mce-")!==0&&p.attr("type","mce-"+w)}}),lO(n)&&i.addNodeFilter("#cdata",c=>{var m;let p=c.length;for(;p--;){const w=c[p];w.type=8,w.name="#comment",w.value="[CDATA["+n.dom.encode((m=w.value)!==null&&m!==void 0?m:"")+"]]"}}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",c=>{let m=c.length;const p=n.schema.getNonEmptyElements();for(;m--;){const w=c[m];w.isEmpty(p)&&w.getAll("br").length===0&&w.append(new Xd("br",1))}}),i},VQ=n=>{const i=Eh(n);i&&_g.setEditorTimeout(n,()=>{let c;i===!0?c=n:c=n.editorManager.get(i),c&&!c.destroyed&&(c.focus(),c.selection.scrollIntoView())},100)},WJ=n=>{const i=n.dom.getRoot();!n.inline&&(!K_(n)||n.selection.getStart(!0)===i)&&cl(i).each(c=>{const m=c.getNode(),p=Iu(m)?cl(m).getOr(c):c;n.selection.setRng(p.toRange())})},UJ=n=>{n.bindPendingEventDelegates(),n.initialized=!0,SO(n),n.focus(!0),WJ(n),n.nodeChanged({initial:!0});const i=$0(n);ce(i)&&i.call(n,n),VQ(n)},WQ=n=>n.inline?n.ui.styleSheetLoader:n.dom.styleSheetLoader,YJ=(n,i,c)=>{const m=[WQ(n).loadAll(i)];return n.inline?m:m.concat([n.ui.styleSheetLoader.loadAll(c)])},UQ=n=>{const i=WQ(n),c=mp(n),m=n.contentCSS,p=()=>{i.unloadAll(m),n.inline||n.ui.styleSheetLoader.unloadAll(c)},w=()=>{n.removed?p():n.on("remove",p)};if(n.contentStyles.length>0){let B="";gn.each(n.contentStyles,q=>{B+=q+`\r
|
|
`}),n.dom.addStyle(B)}const x=Promise.all(YJ(n,m,c)).then(w).catch(w),M=nO(n);return M&&VJ(n,M),x},XJ=n=>{const i=n.getDoc(),c=n.getBody();wP(n),pp(n)||(i.body.spellcheck=!1,iN.setAttrib(c,"spellcheck","false")),n.quirks=HQ(n),ix(n);const m=mb(n);m!==void 0&&(c.dir=m);const p=m2(n);p&&n.on("BeforeSetContent",w=>{gn.each(p,x=>{w.content=w.content.replace(x,M=>"<!--mce:protected "+escape(M)+"-->")})}),n.on("SetContent",()=>{n.addVisual(n.getBody())}),n.on("compositionstart compositionend",w=>{n.composing=w.type==="compositionstart"})},YQ=n=>{Mb(n)||n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"})},lN=n=>{n.removed!==!0&&(YQ(n),UJ(n))},jJ=n=>{let i=!1;const c=setTimeout(()=>{i||n.setProgressState(!0)},500);return()=>{clearTimeout(c),i=!0,n.setProgressState(!1)}},XQ=n=>{const i=n.getElement();let c=n.getDoc();n.inline&&(iN.addClass(i,"mce-content-body"),n.contentDocument=c=document,n.contentWindow=window,n.bodyElement=i,n.contentAreaContainer=i);const m=n.getBody();m.disabled=!0,n.readonly=bg(n),n._editableRoot=R_(n),!n.readonly&&n.hasEditableRoot()&&(n.inline&&iN.getStyle(m,"position",!0)==="static"&&(m.style.position="relative"),m.contentEditable="true"),m.disabled=!1,n.editorUpload=bX(n),n.schema=wh(RT(n)),n.dom=Qr(c,{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:lk(n),referrerPolicy:hb(n),onSetAttrib:x=>{n.dispatch("SetAttrib",x)}}),n.parser=_w(n),n.serializer=O1(XO(n),n),n.selection=FM(n.dom,n.getWin(),n.serializer,n),n.annotator=u1(n),n.formatter=VL(n),n.undoManager=GM(n),n._nodeChangeDispatcher=new nK(n),n._selectionOverrides=PJ(n),MR(n),dQ(n),Bj(n),Mb(n)||(nJ(n),sC(n));const p=tK(n);LA(n,p),Gie(n),kX(n),fQ(n);const w=wY(n);XJ(n),w.fold(()=>{const x=jJ(n);UQ(n).then(()=>{lN(n),x()})},x=>{n.setProgressState(!0),UQ(n).then(()=>{x().then(M=>{n.setProgressState(!1),lN(n),OL(n)},M=>{n.notificationManager.open({type:"error",text:String(M)}),lN(n),OL(n)})})})},gae=mt,qJ=(n,i,c)=>t0(n,i,gae,c),$T=Qr.DOM,GJ=(n,i,c,m)=>{const p=Ke.fromTag("iframe");return m.each(w=>Pr(p,"tabindex",w)),Ju(p,c),Ju(p,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:i}),ef(p,"tox-edit-area__iframe"),p},KJ=n=>{let i=Kv(n)+"<html><head>";i1(n)!==n.documentBaseUrl&&(i+='<base href="'+n.documentBaseURI.getURI()+'" />'),i+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const c=Qf(n),m=al(n),p=n.translate(N_(n));return Qd(n)&&(i+='<meta http-equiv="Content-Security-Policy" content="'+Qd(n)+'" />'),i+=`</head><body id="${c}" class="mce-content-body ${m}" data-id="${n.id}" aria-label="${p}"><br></body></html>`,i},jQ=(n,i)=>{const c=n.translate("Rich Text Area"),m=Va(Ke.fromDom(n.getElement()),"tabindex").bind(ou),p=GJ(n.id,c,gf(n),m).dom;p.onload=()=>{p.onload=null,n.dispatch("load")},n.contentAreaContainer=i.iframeContainer,n.iframeElement=p,n.iframeHTML=KJ(n),$T.add(i.iframeContainer,p)},JJ=n=>{const i=n.iframeElement,c=()=>{n.contentDocument=i.contentDocument,XQ(n)};if(N0(n)||qn.browser.isFirefox()){const m=n.getDoc();m.open(),m.write(n.iframeHTML),m.close(),c()}else{const m=qJ(Ke.fromDom(i),"load",()=>{m.unbind(),c()});i.srcdoc=n.iframeHTML}},qQ=(n,i)=>{jQ(n,i),i.editorContainer&&(i.editorContainer.style.display=n.orgDisplay,n.hidden=$T.isHidden(i.editorContainer)),n.getElement().style.display="none",$T.setAttrib(n.id,"aria-hidden","true"),n.getElement().style.visibility=n.orgVisibility,JJ(n)},GQ=Qr.DOM,cN=(n,i,c)=>{const m=dw.get(c),p=dw.urls[c]||n.documentBaseUrl.replace(/\/$/,"");if(c=gn.trim(c),m&&gn.inArray(i,c)===-1){if(n.plugins[c])return;try{const w=m(n,p)||{};n.plugins[c]=w,ce(w.init)&&(w.init(n,p),i.push(c))}catch(w){lX(n,c,w)}}},eee=n=>n.replace(/^\-/,""),tee=n=>{const i=[];Ne(sO(n),c=>{cN(n,i,eee(c))})},nee=n=>{const i=gn.trim(C_(n)),c=n.ui.registry.getAll().icons,m={...aA.get("default").icons,...aA.get(i).icons};ln(m,(p,w)=>{fn(c,w)||n.ui.registry.addIcon(w,p)})},oee=n=>{const i=mm(n);if(L(i)){const c=QO.get(i);n.theme=c(n,QO.urls[i])||{},ce(n.theme.init)&&n.theme.init(n,QO.urls[i]||n.documentBaseUrl.replace(/\/$/,""))}else n.theme={}},KQ=n=>{const i=oc(n),c=LS.get(i);n.model=c(n,LS.urls[i])},uN=n=>{const i=n.theme.renderUI;return i?i():ree(n)},JQ=n=>{const i=n.getElement(),m=mm(n)(n,i);return m.editorContainer.nodeType&&(m.editorContainer.id=m.editorContainer.id||n.id+"_parent"),m.iframeContainer&&m.iframeContainer.nodeType&&(m.iframeContainer.id=m.iframeContainer.id||n.id+"_iframecontainer"),m.height=m.iframeHeight?m.iframeHeight:i.offsetHeight,m},P4=(n,i)=>({editorContainer:n,iframeContainer:i,api:{}}),see=n=>{const i=GQ.create("div");return GQ.insertAfter(i,n),P4(i,i)},ree=n=>{const i=n.getElement();return n.inline?P4(null):see(i)},pae=n=>{const i=n.getElement();return n.orgDisplay=i.style.display,L(mm(n))?uN(n):ce(mm(n))?JQ(n):ree(n)},iee=(n,i)=>{const c={show:he.from(i.show).getOr(ot),hide:he.from(i.hide).getOr(ot),isEnabled:he.from(i.isEnabled).getOr(mt),setEnabled:m=>{n.mode.isReadOnly()||he.from(i.setEnabled).each(p=>p(m))}};n.ui={...n.ui,...c}},eZ=async n=>{n.dispatch("ScriptsLoaded"),nee(n),oee(n),KQ(n),tee(n);const i=await pae(n);iee(n,he.from(i.api).getOr({})),n.editorContainer=i.editorContainer,dX(n),n.inline?XQ(n):qQ(n,{editorContainer:i.editorContainer,iframeContainer:i.iframeContainer})},Sw=Qr.DOM,tZ=n=>n.charAt(0)==="-",aee=(n,i)=>{const c=x_(i),m=ck(i);if(!id.hasCode(c)&&c!=="en"){const p=yr(m)?m:`${i.editorManager.baseURL}/langs/${c}.js`;n.add(p).catch(()=>{rX(i,p,c)})}},bae=(n,i)=>{const c=mm(n);if(L(c)&&!tZ(c)&&!fn(QO.urls,c)){const m=fk(n),p=m?n.documentBaseURI.toAbsolute(m):`themes/${c}/theme${i}.js`;QO.load(c,p).catch(()=>{iX(n,p,c)})}},vae=(n,i)=>{const c=oc(n);if(c!=="plugin"&&!fn(LS.urls,c)){const m=pf(n),p=L(m)?n.documentBaseURI.toAbsolute(m):`models/${c}/model${i}.js`;LS.load(c,p).catch(()=>{aX(n,p,c)})}},nZ=n=>he.from(fa(n)).filter(yr).map(i=>({url:i,name:he.none()})),fN=(n,i,c)=>he.from(i).filter(m=>yr(m)&&!aA.has(m)).map(m=>({url:`${n.editorManager.baseURL}/icons/${m}/icons${c}.js`,name:he.some(m)})),lee=(n,i,c)=>{const m=fN(i,"default",c),p=nZ(i).orThunk(()=>fN(i,C_(i),""));Ne(ea([m,p]),w=>{n.add(w.url).catch(()=>{xp(i,w.url,w.name.getOrUndefined())})})},cee=(n,i)=>{const c=(m,p)=>{dw.load(m,p).catch(()=>{ZO(n,p,m)})};ln(pb(n),(m,p)=>{c(p,m),n.options.set("plugins",sO(n).concat(p))}),Ne(sO(n),m=>{m=gn.trim(m),m&&!dw.urls[m]&&!tZ(m)&&c(m,`plugins/${m}/plugin${i}.js`)})},uee=n=>{const i=mm(n);return!L(i)||Oe(QO.get(i))},Oae=n=>{const i=oc(n);return Oe(LS.get(i))},yae=(n,i)=>{const c=um.ScriptLoader,m=()=>{!n.removed&&uee(n)&&Oae(n)&&eZ(n)};bae(n,i),vae(n,i),aee(c,n),lee(c,n,i),cee(n,i),c.loadQueue().then(m,m)},wae=(n,i)=>Lv.forElement(n,{contentCssCors:$_(i),referrerPolicy:hb(i)}),fee=n=>{const i=n.id;id.setCode(x_(n));const c=()=>{Sw.unbind(window,"ready",c),n.render()};if(!cm.Event.domLoaded){Sw.bind(window,"ready",c);return}if(!n.getElement())return;const m=Ke.fromDom(n.getElement()),p=Kf(m);n.on("remove",()=>{Gt(m.dom.attributes,x=>Vi(m,x.name)),Ju(m,p)}),n.ui.styleSheetLoader=wae(m,n),M_(n)?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");const w=n.getElement().form||Sw.getParent(i,"form");w&&(n.formElement=w,gp(n)&&!G1(n.getElement())&&(Sw.insertAfter(Sw.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=x=>{n.dispatch(x.type,x)},Sw.bind(w,"submit reset",n.formEventDelegate),n.on("reset",()=>{n.resetContent()}),mk(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=qx(n),n.notificationManager=fw(n),V_(n)&&n.on("GetContent",x=>{x.save&&(x.content=Sw.encode(x.content))}),gk(n)&&n.on("submit",()=>{n.initialized&&n.save()}),pk(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),yae(n,n.suffix)},_ae=(n,i)=>{n._editableRoot!==i&&(n._editableRoot=i,n.readonly||(n.getBody().contentEditable=String(n.hasEditableRoot()),n.nodeChanged()),xP(n,i))},dee=n=>n._editableRoot,Cw=(n,i)=>({sections:Qe(n),options:Qe(i)}),M4=ys().deviceType,NT=M4.isPhone(),oZ=M4.isTablet(),rC=n=>{if(Re(n))return[];{const i=oe(n)?n:n.split(/[ ,]/),c=pt(i,kc);return At(c,yr)}},sZ=(n,i)=>{const c=Tt(i,(m,p)=>kt(n,p));return Cw(c.t,c.f)},hee=(n,i,c={})=>{const m=n.sections(),p=wo(m,i).getOr({});return gn.extend({},c,p)},dN=(n,i)=>fn(n.sections(),i),mee=(n,i)=>dN(n,i)?n.sections()[i]:{},gee=(n,i)=>({...{table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:wo(n,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},...i?{menubar:!1}:{}}),jO=(n,i)=>{var c;const m=(c=i.external_plugins)!==null&&c!==void 0?c:{};return n&&n.external_plugins?gn.extend({},n.external_plugins,m):m},pee=(n,i)=>[...rC(n),...rC(i)],rZ=(n,i,c,m)=>n&&dN(i,"mobile")?m:c,bee=(n,i,c,m)=>{const p=rC(c.forced_plugins),w=rC(m.plugins),x=mee(i,"mobile"),M=x.plugins?rC(x.plugins):w,B=rZ(n,i,w,M),q=pee(p,B);return gn.extend(m,{forced_plugins:p,plugins:q})},R4=(n,i)=>n&&dN(i,"mobile"),vee=(n,i,c,m,p)=>{var w;const x=n?{mobile:gee((w=p.mobile)!==null&&w!==void 0?w:{},i)}:{},M=sZ(["mobile"],KA(x,p)),B=gn.extend(c,m,M.options(),R4(n,M)?hee(M,"mobile"):{},{external_plugins:jO(m,M.options())});return bee(n,M,m,B)},Oee=(n,i)=>vee(NT||oZ,NT,i,n,i),yee=(n,i)=>IY(n,i),iZ=n=>{const i=(m,p)=>{n.formatter.toggle(m,p),n.nodeChanged()},c=m=>()=>{Ne("left,center,right,justify".split(","),p=>{m!==p&&n.formatter.remove("align"+p)}),m!=="none"&&i("align"+m)};n.editorCommands.addCommands({JustifyLeft:c("left"),JustifyCenter:c("center"),JustifyRight:c("right"),JustifyFull:c("justify"),JustifyNone:c("none")})},wee=n=>{const i=c=>()=>{const m=n.selection,p=m.isCollapsed()?[n.dom.getParent(m.getNode(),n.dom.isBlock)]:m.getSelectedBlocks();return jt(p,w=>Oe(n.formatter.matchNode(w,c)))};n.editorCommands.addCommands({JustifyLeft:i("alignleft"),JustifyCenter:i("aligncenter"),JustifyRight:i("alignright"),JustifyFull:i("alignjustify")},"state")},_ee=n=>{iZ(n),wee(n)},See=n=>{n.editorCommands.addCommands({"Cut,Copy,Paste":i=>{const c=n.getDoc();let m;try{c.execCommand(i)}catch{m=!0}if(i==="paste"&&!c.queryCommandEnabled(i)&&(m=!0),m||!c.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.");(qn.os.isMacOS()||qn.os.isiOS())&&(p=p.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:p,type:"error"})}}})},hN=(n,i,c)=>{const m=Ke.fromDom(n.getRoot());return Ox(m,Vt.fromRangeStart(i))?c=c.replace(/^ /," "):c=c.replace(/^ /," "),yx(m,Vt.fromRangeEnd(i))?c=c.replace(/( | )(<br( \/)>)?$/," "):c=c.replace(/ (<br( \/)?>)?$/," "),c},Cee=n=>{if(typeof n!="string"){const i=gn.extend({paste:n.paste,data:{paste:n.paste}},n);return{content:n.content,details:i}}return{content:n,details:{}}},kee=(n,i)=>{const c=n.selection,m=n.dom;return/^ | $/.test(i)?hN(m,c.getRng(),i):i},Nl=(n,i)=>{if(n.selection.isEditable()){const{content:c,details:m}=Cee(i);_M(n,{...m,content:kee(n,c),format:"html",set:!1,selection:!0}).each(p=>{const w=si(n,p.content,m);SM(n,w,p),n.addVisual()})}},xee=n=>{n.editorCommands.addCommands({mceCleanup:()=>{const i=n.selection.getBookmark();n.setContent(n.getContent()),n.selection.moveToBookmark(i)},insertImage:(i,c,m)=>{Nl(n,n.dom.createHTML("img",{src:m}))},insertHorizontalRule:()=>{n.execCommand("mceInsertContent",!1,"<hr>")},insertText:(i,c,m)=>{Nl(n,n.dom.encode(m))},insertHTML:(i,c,m)=>{Nl(n,m)},mceInsertContent:(i,c,m)=>{Nl(n,m)},mceSetContent:(i,c,m)=>{n.setContent(m)},mceReplaceContent:(i,c,m)=>{n.execCommand("mceInsertContent",!1,m.replace(/\{\$selection\}/g,n.selection.getContent({format:"text"})))},mceNewDocument:()=>{n.setContent(vk(n))}})},Tee={"font-size":"size","font-family":"face"},mN=Ec("font"),aZ=(n,i,c)=>{const m=w=>Pa(w,n).orThunk(()=>mN(w)?wo(Tee,n).bind(x=>Va(w,x)):he.none()),p=w=>vt(Ke.fromDom(i),w);return m1(Ke.fromDom(c),w=>m(w),p)},gN=n=>n.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),Eee=(n,i)=>he.from(Qr.DOM.getStyle(i,n,!0)),lZ=n=>(i,c)=>he.from(c).map(Ke.fromDom).filter(kl).bind(m=>aZ(n,i,m.dom).or(Eee(n,m.dom))).getOr(""),Aee=lZ("font-size"),Dee=V(gN,lZ("font-family")),Pee=n=>cl(n.getBody()).bind(i=>{const c=i.container();return he.from(_n(c)?c.parentNode:c)}),Mee=n=>he.from(n.selection.getRng()).bind(i=>{const c=n.getBody();return i.startContainer===c&&i.startOffset===0?he.none():he.from(n.selection.getStart(!0))}),Ree=(n,i)=>Mee(n).orThunk(He(Pee,n)).map(Ke.fromDom).filter(kl).bind(i),pN=(n,i)=>Ree(n,ut(he.some,i)),kw=(n,i)=>{if(/^[0-9.]+$/.test(i)){const c=parseInt(i,10);if(c>=1&&c<=7){const m=uO(n),p=b2(n);return p.length>0?p[c-1]||i:m[c-1]||i}else return i}else return i},x1=n=>{const i=n.split(/\s*,\s*/);return pt(i,c=>c.indexOf(" ")!==-1&&!(Ar(c,'"')||Ar(c,"'"))?`'${c}'`:c).join(",")},$ee=(n,i)=>{const c=kw(n,i);n.formatter.toggle("fontname",{value:x1(c)}),n.nodeChanged()},Nee=n=>pN(n,i=>Dee(n.getBody(),i.dom)).getOr(""),Iee=(n,i)=>{n.formatter.toggle("fontsize",{value:kw(n,i)}),n.nodeChanged()},Bee=n=>pN(n,i=>Aee(n.getBody(),i.dom)).getOr(""),Lee=n=>pN(n,i=>{const c=Ke.fromDom(n.getBody()),m=m1(i,w=>Pa(w,"line-height"),He(vt,c)),p=()=>{const w=parseFloat(Bi(i,"line-height")),x=parseFloat(Bi(i,"font-size"));return String(w/x)};return m.getOrThunk(p)}).getOr(""),Fee=(n,i)=>{n.formatter.toggle("lineheight",{value:String(i)}),n.nodeChanged()},Qee=n=>{const i=(c,m)=>{n.formatter.toggle(c,m),n.nodeChanged()};n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":c=>{i(c)},"ForeColor,HiliteColor":(c,m,p)=>{i(c,{value:p})},BackColor:(c,m,p)=>{i("hilitecolor",{value:p})},FontName:(c,m,p)=>{$ee(n,p)},FontSize:(c,m,p)=>{Iee(n,p)},LineHeight:(c,m,p)=>{Fee(n,p)},Lang:(c,m,p)=>{var w;i(c,{value:p.code,customValue:(w=p.customCode)!==null&&w!==void 0?w:null})},RemoveFormat:c=>{n.formatter.remove(c)},mceBlockQuote:()=>{i("blockquote")},FormatBlock:(c,m,p)=>{i(L(p)?p:"p")},mceToggleFormat:(c,m,p)=>{i(p)}})},Zee=n=>{const i=c=>n.formatter.match(c);n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":c=>i(c),mceBlockQuote:()=>i("blockquote")},"state"),n.editorCommands.addQueryValueHandler("FontName",()=>Nee(n)),n.editorCommands.addQueryValueHandler("FontSize",()=>Bee(n)),n.editorCommands.addQueryValueHandler("LineHeight",()=>Lee(n))},Hee=n=>{Qee(n),Zee(n)},Sae=n=>{n.editorCommands.addCommands({mceAddUndoLevel:()=>{n.undoManager.add()},mceEndUndoLevel:()=>{n.undoManager.add()},Undo:()=>{n.undoManager.undo()},Redo:()=>{n.undoManager.redo()}})},zee=n=>{n.editorCommands.addCommands({Indent:()=>{W7(n)},Outdent:()=>{Dj(n)}}),n.editorCommands.addCommands({Outdent:()=>BA(n)},"state")},Vee=n=>{const i=(c,m,p)=>{const w=L(p)?{href:p}:p,x=n.dom.getParent(n.selection.getNode(),"a");te(w)&&L(w.href)&&(w.href=w.href.replace(/ /g,"%20"),(!x||!w.href)&&n.formatter.remove("link"),w.href&&n.formatter.apply("link",w,x))};n.editorCommands.addCommands({unlink:()=>{if(n.selection.isEditable()){if(n.selection.isCollapsed()){const c=n.dom.getParent(n.selection.getStart(),"a");c&&n.dom.remove(c,!0);return}n.formatter.remove("link")}},mceInsertLink:i,createLink:i})},Wee=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{n.getDoc().execCommand(i);const c=n.dom.getParent(n.selection.getNode(),"ol,ul");if(c){const m=c.parentNode;if(m&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(m.nodeName)){const p=n.selection.getBookmark();n.dom.split(m,c),n.selection.moveToBookmark(p)}}}})},Uee=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{const c=n.dom.getParent(n.selection.getNode(),"ul,ol");return c&&(i==="insertunorderedlist"&&c.tagName==="UL"||i==="insertorderedlist"&&c.tagName==="OL")}},"state")},Yee=n=>{Wee(n),Uee(n)},Xee=(n,i,c,m)=>{const p=n.dom,w=M=>p.isBlock(M)&&M.parentElement===c,x=w(i)?i:p.getParent(m,w,c);return he.from(x).map(Ke.fromDom)},jee=(n,i)=>{const c=n.dom,m=n.selection.getRng(),p=i?n.selection.getStart():n.selection.getEnd(),w=i?m.startContainer:m.endContainer,x=l4(c,w);if(!x||!x.isContentEditable)return;const M=i?Ca:iu,B=jc(n);Xee(n,p,x,w).each(q=>{const ae=c9(n,w,q.dom,x,!1,B);M(q,Ke.fromDom(ae)),n.selection.setCursorLocation(ae,0),n.dispatch("NewBlock",{newBlock:ae}),yT(n,"insertParagraph")})},qee=n=>jee(n,!0),Gee=n=>jee(n,!1),Kee=n=>{n.editorCommands.addCommands({InsertNewBlockBefore:()=>{qee(n)},InsertNewBlockAfter:()=>{Gee(n)}})},Jee=n=>{n.editorCommands.addCommands({insertParagraph:()=>{m4(b9,n)},mceInsertNewLine:(i,c,m)=>{k9(n,m)},InsertLineBreak:(i,c,m)=>{m4(p$,n)}})},ete=n=>{n.editorCommands.addCommands({mceSelectNodeDepth:(i,c,m)=>{let p=0;n.dom.getParent(n.selection.getNode(),w=>Jn(w)&&p++===m?(n.selection.select(w),!1):!0,n.getBody())},mceSelectNode:(i,c,m)=>{n.selection.select(m)},selectAll:()=>{const i=n.dom.getParent(n.selection.getStart(),ba);if(i){const c=n.dom.createRng();c.selectNodeContents(i),n.selection.setRng(c)}}})},tte=n=>{n.editorCommands.addCommands({mceRemoveNode:(i,c,m)=>{const p=m!=null?m: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,c,m)=>{LV(n,m===!0)},mceToggleVisualAid:()=>{n.hasVisual=!n.hasVisual,n.addVisual()}})},nte=n=>{_ee(n),See(n),Sae(n),ete(n),xee(n),Vee(n),zee(n),Kee(n),Jee(n),Yee(n),Hee(n),tte(n)},ote=["toggleview"],cZ=n=>kt(ote,n.toLowerCase());class uZ{constructor(i){this.commands={state:{},exec:{},value:{}},this.editor=i}execCommand(i,c=!1,m,p){const w=this.editor,x=i.toLowerCase(),M=p==null?void 0:p.skip_focus;if(w.removed||(x!=="mcefocus"&&(!/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(x)&&!M?w.focus():_I(w)),w.dispatch("BeforeExecCommand",{command:i,ui:c,value:m}).isDefaultPrevented()))return!1;const q=this.commands.exec[x];return ce(q)?(q(x,c,m),w.dispatch("ExecCommand",{command:i,ui:c,value:m}),!0):!1}queryCommandState(i){if(!cZ(i)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const c=i.toLowerCase(),m=this.commands.state[c];return ce(m)?m(c):!1}queryCommandValue(i){if(!cZ(i)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const c=i.toLowerCase(),m=this.commands.value[c];return ce(m)?m(c):""}addCommands(i,c="exec"){const m=this.commands;ln(i,(p,w)=>{Ne(w.toLowerCase().split(","),x=>{m[c][x]=p})})}addCommand(i,c,m){const p=i.toLowerCase();this.commands.exec[p]=(w,x,M)=>c.call(m!=null?m:this.editor,x,M)}queryCommandSupported(i){const c=i.toLowerCase();return!!this.commands.exec[c]}addQueryStateHandler(i,c,m){this.commands.state[i.toLowerCase()]=()=>c.call(m!=null?m:this.editor)}addQueryValueHandler(i,c,m){this.commands.value[i.toLowerCase()]=()=>c.call(m!=null?m:this.editor)}}const xw="data-mce-contenteditable",ste=(n,i,c)=>{Pf(n,i)&&!c?zc(n,i):c&&ef(n,i)},bN=(n,i,c)=>{try{n.getDoc().execCommand(i,!1,String(c))}catch{}},$4=(n,i)=>{n.dom.contentEditable=i?"true":"false"},rte=n=>{Ne(pl(n,'*[contenteditable="true"]'),i=>{Pr(i,xw,"true"),$4(i,!1)})},ite=n=>{Ne(pl(n,`*[${xw}="true"]`),i=>{Vi(i,xw),$4(i,!0)})},fZ=n=>{he.from(n.selection.getNode()).each(i=>{i.removeAttribute("data-mce-selected")})},ate=n=>{n.selection.setRng(n.selection.getRng())},lte=(n,i)=>{const c=Ke.fromDom(n.getBody());ste(c,"mce-content-readonly",i),i?(n.selection.controlSelection.hideResizeRect(),n._selectionOverrides.hideFakeCaret(),fZ(n),n.readonly=!0,$4(c,!1),rte(c)):(n.readonly=!1,n.hasEditableRoot()&&$4(c,!0),ite(c),bN(n,"StyleWithCSS",!1),bN(n,"enableInlineTableEditing",!1),bN(n,"enableObjectResizing",!1),d3(n)&&n.focus(),ate(n),n.nodeChanged())},Tw=n=>n.readonly,dZ=n=>{n.parser.addAttributeFilter("contenteditable",i=>{Tw(n)&&Ne(i,c=>{c.attr(xw,c.attr("contenteditable")),c.attr("contenteditable","false")})}),n.serializer.addAttributeFilter(xw,i=>{Tw(n)&&Ne(i,c=>{c.attr("contenteditable",c.attr(xw))})}),n.serializer.addTempAttr(xw)},cte=n=>{n.serializer?dZ(n):n.on("PreInit",()=>{dZ(n)})},ute=n=>n.type==="click",fte=["copy"],dte=n=>kt(fte,n.type),hZ=(n,i)=>at(i,"a",m=>vt(m,Ke.fromDom(n.getBody()))).bind(m=>Va(m,"href")),hte=(n,i)=>{if(ute(i)&&!to.metaKeyPressed(i)){const c=Ke.fromDom(i.target);hZ(n,c).each(m=>{if(i.preventDefault(),/^#/.test(m)){const p=n.dom.select(`${m},[name="${ga(m,"#")}"]`);p.length&&n.selection.scrollIntoView(p[0],!0)}else window.open(m,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})}else dte(i)&&n.dispatch(i.type,i)},mte=n=>{n.on("ShowCaret",i=>{Tw(n)&&i.preventDefault()}),n.on("ObjectSelected",i=>{Tw(n)&&i.preventDefault()})},gte=gn.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 vN{static isNative(i){return!!gte[i.toLowerCase()]}constructor(i){this.bindings={},this.settings=i||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||je}fire(i,c){return this.dispatch(i,c)}dispatch(i,c){const m=i.toLowerCase(),p=lp(m,c!=null?c:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(p);const w=this.bindings[m];if(w)for(let x=0,M=w.length;x<M;x++){const B=w[x];if(!B.removed){if(B.once&&this.off(m,B.func),p.isImmediatePropagationStopped())return p;if(B.func.call(this.scope,p)===!1)return p.preventDefault(),p}}return p}on(i,c,m,p){if(c===!1&&(c=je),c){const w={func:c,removed:!1};p&&gn.extend(w,p);const x=i.toLowerCase().split(" ");let M=x.length;for(;M--;){const B=x[M];let q=this.bindings[B];q||(q=[],this.toggleEvent(B,!0)),m?q=[w,...q]:q=[...q,w],this.bindings[B]=q}}return this}off(i,c){if(i){const m=i.toLowerCase().split(" ");let p=m.length;for(;p--;){const w=m[p];let x=this.bindings[w];if(!w)return ln(this.bindings,(M,B)=>{this.toggleEvent(B,!1),delete this.bindings[B]}),this;if(x){if(!c)x.length=0;else{const M=bn(x,B=>B.func===c);x=M.fail,this.bindings[w]=x,Ne(M.pass,B=>{B.removed=!0})}x.length||(this.toggleEvent(i,!1),delete this.bindings[w])}}}else ln(this.bindings,(m,p)=>{this.toggleEvent(p,!1)}),this.bindings={};return this}once(i,c,m){return this.on(i,c,m,{once:!0})}has(i){i=i.toLowerCase();const c=this.bindings[i];return!(!c||c.length===0)}}const IT=n=>(n._eventDispatcher||(n._eventDispatcher=new vN({scope:n,toggleEvent:(i,c)=>{vN.isNative(i)&&n.toggleNativeEvent&&n.toggleNativeEvent(i,c)}})),n._eventDispatcher),ON={fire(n,i,c){return this.dispatch(n,i,c)},dispatch(n,i,c){const m=this;if(m.removed&&n!=="remove"&&n!=="detach")return lp(n.toLowerCase(),i!=null?i:{},m);const p=IT(m).dispatch(n,i);if(c!==!1&&m.parent){let w=m.parent();for(;w&&!p.isPropagationStopped();)w.dispatch(n,p,!1),w=w.parent?w.parent():void 0}return p},on(n,i,c){return IT(this).on(n,i,c)},off(n,i){return IT(this).off(n,i)},once(n,i){return IT(this).once(n,i)},hasEventListeners(n){return IT(this).has(n)}},N4=Qr.DOM;let Ew;const BT=(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 c=ll(n);return c?(n.eventRoot||(n.eventRoot=N4.select(c)[0]),n.eventRoot):n.getBody()},Cae=n=>!n.hidden&&!Tw(n),yN=(n,i,c)=>{Cae(n)?n.dispatch(i,c):Tw(n)&&hte(n,c)},mZ=(n,i)=>{if(n.delegates||(n.delegates={}),n.delegates[i]||n.removed)return;const c=BT(n,i);if(ll(n)){if(Ew||(Ew={},n.editorManager.on("removeEditor",()=>{n.editorManager.activeEditor||Ew&&(ln(Ew,(p,w)=>{n.dom.unbind(BT(n,w))}),Ew=null)})),Ew[i])return;const m=p=>{const w=p.target,x=n.editorManager.get();let M=x.length;for(;M--;){const B=x[M].getBody();(B===w||N4.isChildOf(w,B))&&yN(x[M],i,p)}};Ew[i]=m,N4.bind(c,i,m)}else{const m=p=>{yN(n,i,p)};N4.bind(c,i,m),n.delegates[i]=m}},wN={...ON,bindPendingEventDelegates(){const n=this;gn.each(n._pendingNativeEvents,i=>{mZ(n,i)})},toggleNativeEvent(n,i){const c=this;n==="focus"||n==="blur"||c.removed||(i?c.initialized?mZ(c,n):c._pendingNativeEvents?c._pendingNativeEvents.push(n):c._pendingNativeEvents=[n]:c.initialized&&c.delegates&&(c.dom.unbind(BT(c,n),n,c.delegates[n]),delete c.delegates[n]))},unbindAllNativeEvents(){const n=this,i=n.getBody(),c=n.dom;n.delegates&&(ln(n.delegates,(m,p)=>{n.dom.unbind(BT(n,p),p,m)}),delete n.delegates),!n.inline&&i&&c&&(i.onload=null,c.unbind(n.getWin()),c.unbind(n.getDoc())),c&&(c.unbind(i),c.unbind(n.getContainer()))}},pte=n=>L(n)?{value:n.split(/[ ,]/),valid:!0}:tt(n,L)?{value:n,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},bte=n=>{const i=(()=>{switch(n){case"array":return oe;case"boolean":return we;case"function":return ce;case"number":return Xe;case"object":return te;case"string":return L;case"string[]":return pte;case"object[]":return c=>tt(c,te);case"regexp":return c=>K(c,RegExp);default:return mt}})();return c=>_N(c,i,`The value must be a ${n}.`)},vte=n=>L(n.processor),gZ=(n,i)=>{const c=ol(i.message)?"":`. ${i.message}`;return n+c},pZ=n=>n.valid,_N=(n,i,c="")=>{const m=i(n);return we(m)?m?{value:n,valid:!0}:{valid:!1,message:c}:m},SN=(n,i,c)=>{if(!ve(i)){const m=_N(i,c);if(pZ(m))return m.value;console.error(gZ(`Invalid default value passed for the "${n}" option`,m))}},CN=(n,i)=>{const c={},m={},p=(fe,be,Le)=>{const Ye=_N(be,Le);return pZ(Ye)?(m[fe]=Ye.value,!0):(console.warn(gZ(`Invalid value passed for the ${fe} option`,Ye)),!1)},w=(fe,be)=>{const Le=vte(be)?bte(be.processor):be.processor,Ye=SN(fe,be.default,Le);c[fe]={...be,default:Ye,processor:Le},wo(m,fe).orThunk(()=>wo(i,fe)).each(Ve=>p(fe,Ve,Le))},x=fe=>fn(c,fe);return{register:w,isRegistered:x,get:fe=>wo(m,fe).orThunk(()=>wo(c,fe).map(be=>be.default)).getOrUndefined(),set:(fe,be)=>{if(x(fe)){const Le=c[fe];return Le.immutable?(console.error(`"${fe}" is an immutable option and cannot be updated`),!1):p(fe,be,Le.processor)}else return console.warn(`"${fe}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:fe=>{const be=x(fe);return be&&delete m[fe],be},isSet:fe=>fn(m,fe)}},Ote=["design","readonly"],kN=(n,i,c,m)=>{const p=c[i.get()],w=c[m];try{w.activate()}catch(x){console.error(`problem while activating editor mode ${m}:`,x);return}p.deactivate(),p.editorReadOnly!==w.editorReadOnly&<e(n,w.editorReadOnly),i.set(m),OP(n,m)},yte=(n,i,c,m)=>{if(m!==c.get()){if(!fn(i,m))throw new Error(`Editor mode '${m}' is invalid`);n.initialized?kN(n,c,i,m):n.on("init",()=>kN(n,c,i,m))}},wte=(n,i,c)=>{if(kt(Ote,i))throw new Error(`Cannot override default mode ${i}`);return{...n,[i]:{...c,deactivate:()=>{try{c.deactivate()}catch(m){console.error(`problem while deactivating editor mode ${i}:`,m)}}}}},_te=n=>{const i=Ga("design"),c=Ga({design:{activate:ot,deactivate:ot,editorReadOnly:!1},readonly:{activate:ot,deactivate:ot,editorReadOnly:!0}});return cte(n),mte(n),{isReadOnly:()=>Tw(n),set:m=>yte(n,c.get(),i,m),get:()=>i.get(),register:(m,p)=>{c.set(wte(c.get(),m,p))}}},xN=gn.each,TN=gn.explode,Ste={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},bZ=gn.makeMap("alt,ctrl,shift,meta,access"),Cte=n=>n in bZ,kte=n=>{const i={},c=qn.os.isMacOS()||qn.os.isiOS();xN(TN(n.toLowerCase(),"+"),w=>{Cte(w)?i[w]=!0:/^[0-9]{2,}$/.test(w)?i.keyCode=parseInt(w,10):(i.charCode=w.charCodeAt(0),i.keyCode=Ste[w]||w.toUpperCase().charCodeAt(0))});const m=[i.keyCode];let p;for(p in bZ)i[p]?m.push(p):i[p]=!1;return i.id=m.join(","),i.access&&(i.alt=!0,c?i.ctrl=!0:i.shift=!0),i.meta&&(c?i.meta=!0:(i.ctrl=!0,i.meta=!1)),i};class vZ{constructor(i){this.shortcuts={},this.pendingPatterns=[],this.editor=i;const c=this;i.on("keyup keypress keydown",m=>{(c.hasModifier(m)||c.isFunctionKey(m))&&!m.isDefaultPrevented()&&(xN(c.shortcuts,p=>{c.matchShortcut(m,p)&&(c.pendingPatterns=p.subpatterns.slice(0),m.type==="keydown"&&c.executeShortcutAction(p))}),c.matchShortcut(m,c.pendingPatterns[0])&&(c.pendingPatterns.length===1&&m.type==="keydown"&&c.executeShortcutAction(c.pendingPatterns[0]),c.pendingPatterns.shift()))})}add(i,c,m,p){const w=this,x=w.normalizeCommandFunc(m);return xN(TN(gn.trim(i)),M=>{const B=w.createShortcut(M,c,x,p);w.shortcuts[B.id]=B}),!0}remove(i){const c=this.createShortcut(i);return this.shortcuts[c.id]?(delete this.shortcuts[c.id],!0):!1}normalizeCommandFunc(i){const c=this,m=i;return typeof m=="string"?()=>{c.editor.execCommand(m,!1,null)}:gn.isArray(m)?()=>{c.editor.execCommand(m[0],m[1],m[2])}:m}createShortcut(i,c,m,p){const w=gn.map(TN(i,">"),kte);return w[w.length-1]=gn.extend(w[w.length-1],{func:m,scope:p||this.editor}),gn.extend(w[0],{desc:this.editor.translate(c),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,c){return!c||c.ctrl!==i.ctrlKey||c.meta!==i.metaKey||c.alt!==i.altKey||c.shift!==i.shiftKey?!1:i.keyCode===c.keyCode||i.charCode&&i.charCode===c.charCode?(i.preventDefault(),!0):!1}executeShortcutAction(i){return i.func?i.func.call(i.scope):null}}const EN=()=>{const n={},i={},c={},m={},p={},w={},x={},M={},B=(ae,fe)=>(be,Le)=>{ae[be.toLowerCase()]={...Le,type:fe}},q=(ae,fe)=>m[ae.toLowerCase()]=fe;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(c,"autocompleter"),addContextMenu:B(p,"contextmenu"),addContextToolbar:B(w,"contexttoolbar"),addContextForm:B(w,"contextform"),addSidebar:B(x,"sidebar"),addView:B(M,"views"),addIcon:q,getAll:()=>({buttons:n,menuItems:i,icons:m,popups:c,contextMenus:p,contextToolbars:w,sidebars:x,views:M})}},xte=()=>{const n=EN();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}},Aw=Qr.DOM,OZ=gn.extend,Tte=gn.each;class I4{constructor(i,c,m){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=m,this.documentBaseUrl=m.documentBaseURL,OZ(this,wN);const p=this;this.id=i,this.hidden=!1;const w=Oee(m.defaultOptions,c);this.options=CN(p,w),fb(p);const x=this.options.get;x("deprecation_warnings")&&tX(c,w);const M=x("suffix");M&&(m.suffix=M),this.suffix=m.suffix;const B=x("base_url");B&&m._setBaseUrl(B),this.baseUri=m.baseURI;const q=hb(p);q&&(um.ScriptLoader._setReferrerPolicy(q),Qr.DOM.styleSheetLoader._setReferrerPolicy(q));const ae=$_(p);Oe(ae)&&Qr.DOM.styleSheetLoader._setContentCssCors(ae),Ia.languageLoad=x("language_load"),Ia.baseURL=m.baseURL,this.setDirty(!1),this.documentBaseURI=new b1(i1(p),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=M_(p),this.hasVisual=rO(p),this.shortcuts=new vZ(this),this.editorCommands=new uZ(this),nte(this);const fe=x("cache_suffix");fe&&(qn.cacheSuffix=fe.replace(/^[\?\&]+/,"")),this.ui={registry:xte(),styleSheetLoader:void 0,show:ot,hide:ot,setEnabled:ot,isEnabled:mt},this.mode=_te(p),m.dispatch("SetupEditor",{editor:this});const be=Th(p);ce(be)&&be.call(p,p)}render(){fee(this)}focus(i){this.execCommand("mceFocus",!1,i)}hasFocus(){return U2(this)}translate(i){return id.translate(i)}getParam(i,c,m){const p=this.options;return p.isRegistered(i)||(Oe(m)?p.register(i,{processor:m,default:c}):p.register(i,{processor:mt,default:c})),!p.isSet(i)&&!ve(c)?c:p.get(i)}hasPlugin(i,c){return kt(sO(this),i)?c?dw.get(i)!==void 0:!0:!1}nodeChanged(i){this._nodeChangeDispatcher.nodeChanged(i)}addCommand(i,c,m){this.editorCommands.addCommand(i,c,m)}addQueryStateHandler(i,c,m){this.editorCommands.addQueryStateHandler(i,c,m)}addQueryValueHandler(i,c,m){this.editorCommands.addQueryValueHandler(i,c,m)}addShortcut(i,c,m,p){this.shortcuts.add(i,c,m,p)}execCommand(i,c,m,p){return this.editorCommands.execCommand(i,c,m,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":(Aw.show(i.getContainer()),Aw.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)):(Aw.hide(i.getContainer()),Aw.setStyle(i.id,"display",i.orgDisplay)),i.hidden=!0,i.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(i,c){this.dispatch("ProgressState",{state:i,time:c})}load(i={}){const c=this,m=c.getElement();if(c.removed)return"";if(m){const p={...i,load:!0},w=G1(m)?m.value:m.innerHTML,x=c.setContent(w,p);return p.no_events||c.dispatch("LoadContent",{...p,element:m}),x}else return""}save(i={}){const c=this;let m=c.getElement();if(!m||!c.initialized||c.removed)return"";const p={...i,save:!0,element:m};let w=c.getContent(p);const x={...p,content:w};if(x.no_events||c.dispatch("SaveContent",x),x.format==="raw"&&c.dispatch("RawSaveContent",x),w=x.content,G1(m))m.value=w;else{(i.is_removing||!c.inline)&&(m.innerHTML=w);const M=Aw.getParent(c.id,"form");M&&Tte(M.elements,B=>B.name===c.id?(B.value=w,!1):!0)}return x.element=p.element=m=null,x.set_dirty!==!1&&c.setDirty(!1),w}setContent(i,c){return rA(this,i,c)}getContent(i){return WY(this,i)}insertContent(i,c){c&&(i=OZ({content:i},c)),this.execCommand("mceInsertContent",!1,i)}resetContent(i){i===void 0?rA(this,this.startContent,{format:"raw"}):rA(this,i),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(i){const c=!this.isNotDirty;this.isNotDirty=!i,i&&i!==c&&this.dispatch("dirty")}getContainer(){const i=this;return i.container||(i.container=i.editorContainer||Aw.get(i.id+"_parent")),i.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=Aw.get(this.id)),this.targetElm}getWin(){const i=this;if(!i.contentWindow){const c=i.iframeElement;c&&(i.contentWindow=c.contentWindow)}return i.contentWindow}getDoc(){const i=this;if(!i.contentDocument){const c=i.getWin();c&&(i.contentDocument=c.document)}return i.contentDocument}getBody(){var i,c;const m=this.getDoc();return(c=(i=this.bodyElement)!==null&&i!==void 0?i:m==null?void 0:m.body)!==null&&c!==void 0?c:null}convertURL(i,c,m){const p=this,w=p.options.get,x=I_(p);return ce(x)?x.call(p,i,m,!0,c):!w("convert_urls")||m==="link"||te(m)&&m.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){yee(this,i)}setEditableRoot(i){_ae(this,i)}hasEditableRoot(){return dee(this)}remove(){HM(this)}destroy(i){sX(this,i)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const Dw=Qr.DOM,Nb=gn.each;let Ete=!1,B4,Fh=[];const L4=n=>{const i=n.type;Nb(bv.get(),c=>{switch(i){case"scroll":c.dispatch("ScrollWindow",n);break;case"resize":c.dispatch("ResizeWindow",n);break}})},yZ=n=>{if(n!==Ete){const i=Qr.DOM;n?(i.bind(window,"resize",L4),i.bind(window,"scroll",L4)):(i.unbind(window,"resize",L4),i.unbind(window,"scroll",L4)),Ete=n}},Ate=n=>{const i=Fh;return Fh=At(Fh,c=>n!==c),bv.activeEditor===n&&(bv.activeEditor=Fh.length>0?Fh[0]:null),bv.focusedEditor===n&&(bv.focusedEditor=null),i.length!==Fh.length},Dte=n=>{n&&n.initialized&&!(n.getContainer()||n.getBody()).parentNode&&(Ate(n),n.unbindAllNativeEvents(),n.destroy(!0),n.removed=!0)},Am=document.compatMode!=="CSS1Compat",bv={...ON,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"7.0",releaseDate:"2023-08-30",i18n:id,activeEditor:null,focusedEditor:null,setup(){const n=this;let i="",c="",m=b1.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(m)&&(m=m.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(m)||(m+="/"));const p=window.tinymce||window.tinyMCEPreInit;if(p)i=p.base||p.baseURL,c=p.suffix;else{const w=document.getElementsByTagName("script");for(let x=0;x<w.length;x++){const M=w[x].src||"";if(M==="")continue;const B=M.substring(M.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(M)){B.indexOf(".min")!==-1&&(c=".min"),i=M.substring(0,M.lastIndexOf("/"));break}}if(!i&&document.currentScript){const x=document.currentScript.src;x.indexOf(".min")!==-1&&(c=".min"),i=x.substring(0,x.lastIndexOf("/"))}}n.baseURL=new b1(m).toAbsolute(i),n.documentBaseURL=m,n.baseURI=new b1(n.baseURL),n.suffix=c,DV(n)},overrideDefaults(n){const i=n.base_url;i&&this._setBaseUrl(i);const c=n.suffix;c&&(this.suffix=c),this.defaultOptions=n;const m=n.plugin_base_urls;m!==void 0&&ln(m,(p,w)=>{Ia.PluginManager.urls[w]=p})},init(n){const i=this;let c;const m=gn.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=(ae,fe)=>ae.inline&&fe.tagName.toLowerCase()in m,w=ae=>{let fe=ae.id;return fe||(fe=wo(ae,"name").filter(be=>!Dw.get(be)).getOrThunk(Dw.uniqueId),ae.setAttribute("id",fe)),fe},x=ae=>{const fe=n[ae];if(!!fe)return fe.apply(i,[])},M=ae=>qn.browser.isIE()||qn.browser.isEdge()?(dA("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"),[]):Am?(dA("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):L(ae.selector)?Dw.select(ae.selector):Oe(ae.target)?[ae.target]:[];let B=ae=>{c=ae};const q=()=>{let ae=0;const fe=[];let be;const Le=(Ye,Me,Ve)=>{const gt=new I4(Ye,Me,i);fe.push(gt),gt.on("init",()=>{++ae===be.length&&B(fe)}),gt.targetElm=gt.targetElm||Ve,gt.render()};Dw.unbind(window,"ready",q),x("onpageload"),be=aa(M(n)),gn.each(be,Ye=>{Dte(i.get(Ye.id))}),be=gn.grep(be,Ye=>!i.get(Ye.id)),be.length===0?B([]):Nb(be,Ye=>{p(n,Ye)?dA("Could not initialize inline editor on invalid inline target element",Ye):Le(w(Ye),n,Ye)})};return Dw.bind(window,"ready",q),new Promise(ae=>{c?ae(c):B=fe=>{ae(fe)}})},get(n){return arguments.length===0?Fh.slice(0):L(n)?oo(Fh,i=>i.id===n).getOr(null):Xe(n)&&Fh[n]?Fh[n]:null},add(n){const i=this,c=i.get(n.id);return c===n||(c===null&&Fh.push(n),yZ(!0),i.activeEditor=n,i.dispatch("AddEditor",{editor:n}),B4||(B4=m=>{const p=i.dispatch("BeforeUnload");if(p.returnValue)return m.preventDefault(),m.returnValue=p.returnValue,p.returnValue},window.addEventListener("beforeunload",B4))),n},createEditor(n,i){return this.add(new I4(n,i,this))},remove(n){const i=this;let c;if(!n){for(let m=Fh.length-1;m>=0;m--)i.remove(Fh[m]);return}if(L(n)){Nb(Dw.select(n),m=>{c=i.get(m.id),c&&i.remove(c)});return}return c=n,G(i.get(c.id))?null:(Ate(c)&&i.dispatch("RemoveEditor",{editor:c}),Fh.length===0&&window.removeEventListener("beforeunload",B4),c.remove(),yZ(Fh.length>0),c)},execCommand(n,i,c){var m;const p=this,w=te(c)?(m=c.id)!==null&&m!==void 0?m:c.index:c;switch(n){case"mceAddEditor":{if(!p.get(w)){const x=c.options;new I4(w,x,p).render()}return!0}case"mceRemoveEditor":{const x=p.get(w);return x&&x.remove(),!0}case"mceToggleEditor":{const x=p.get(w);return x?(x.isHidden()?x.show():x.hide(),!0):(p.execCommand("mceAddEditor",!1,c),!0)}}return p.activeEditor?p.activeEditor.execCommand(n,i,c):!1},triggerSave:()=>{Nb(Fh,n=>{n.save()})},addI18n:(n,i)=>{id.add(n,i)},translate:n=>id.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 b1(this.documentBaseURL).toAbsolute(n.replace(/\/+$/,"")),this.baseURI=new b1(this.baseURL)}};bv.setup();const Pte=(()=>{const n=Sh(),i=w=>({items:w,types:bs(w),getType:x=>wo(w,x).getOrUndefined()}),c=w=>{n.set(w)},m=()=>n.get().getOrUndefined(),p=n.clear;return{FakeClipboardItem:i,write:c,read:m,clear:p}})(),wZ=Math.min,iC=Math.max,F4=Math.round,_Z=(n,i,c)=>{let m=i.x,p=i.y;const w=n.w,x=n.h,M=i.w,B=i.h,q=(c||"").split("");return q[0]==="b"&&(p+=B),q[1]==="r"&&(m+=M),q[0]==="c"&&(p+=F4(B/2)),q[1]==="c"&&(m+=F4(M/2)),q[3]==="b"&&(p-=x),q[4]==="r"&&(m-=w),q[3]==="c"&&(p-=F4(x/2)),q[4]==="c"&&(m-=F4(w/2)),aC(m,p,w,x)},Mte=(n,i,c,m)=>{for(let p=0;p<m.length;p++){const w=_Z(n,i,m[p]);if(w.x>=c.x&&w.x+w.w<=c.w+c.x&&w.y>=c.y&&w.y+w.h<=c.h+c.y)return m[p]}return null},SZ=(n,i,c)=>aC(n.x-i,n.y-c,n.w+i*2,n.h+c*2),Rte=(n,i)=>{const c=iC(n.x,i.x),m=iC(n.y,i.y),p=wZ(n.x+n.w,i.x+i.w),w=wZ(n.y+n.h,i.y+i.h);return p-c<0||w-m<0?null:aC(c,m,p-c,w-m)},$te=(n,i,c)=>{let m=n.x,p=n.y,w=n.x+n.w,x=n.y+n.h;const M=i.x+i.w,B=i.y+i.h,q=iC(0,i.x-m),ae=iC(0,i.y-p),fe=iC(0,w-M),be=iC(0,x-B);return m+=q,p+=ae,c&&(w+=q,x+=ae,m-=fe,p-=be),w-=fe,x-=be,aC(m,p,w-m,x-p)},aC=(n,i,c,m)=>({x:n,y:i,w:c,h:m}),Nte={inflate:SZ,relativePosition:_Z,findBestRelativePosition:Mte,intersect:Rte,clamp:$te,create:aC,fromClientRect:n=>aC(n.left,n.top,n.width,n.height)},Ite=(n,i,c=1e3)=>{let m=!1,p=null;const w=q=>(...ae)=>{m||(m=!0,p!==null&&(clearTimeout(p),p=null),q.apply(null,ae))},x=w(n),M=w(i);return{start:(...q)=>{!m&&p===null&&(p=setTimeout(()=>M.apply(null,q),c))},resolve:x,reject:M}},lC=(()=>{const n={},i={};return{load:(w,x)=>{const M=`Script at URL "${x}" failed to load`,B=`Script at URL "${x}" did not call \`tinymce.Resource.add('${w}', data)\` within 1 second`;if(n[w]!==void 0)return n[w];{const q=new Promise((ae,fe)=>{const be=Ite(ae,fe);i[w]=be.resolve,um.ScriptLoader.loadScript(x).then(()=>be.start(B),()=>be.reject(M))});return n[w]=q,q}},add:(w,x)=>{i[w]!==void 0&&(i[w](x),delete i[w]),n[w]=Promise.resolve(x)},unload:w=>{delete n[w]}}})(),Bte=()=>(()=>{let n={},i=[];const c={getItem:m=>{const p=n[m];return p||null},setItem:(m,p)=>{i.push(m),n[m]=String(p)},key:m=>i[m],removeItem:m=>{i=i.filter(p=>p===m),delete n[m]},clear:()=>{i=[],n={}},length:0};return Object.defineProperty(c,"length",{get:()=>i.length,configurable:!1,enumerable:!1}),c})();let LT;try{const n="__storage_test__";LT=window.localStorage,LT.setItem(n,n),LT.removeItem(n)}catch{LT=Bte()}var Lte=LT;const Fte={geom:{Rect:Nte},util:{Delay:_g,Tools:gn,VK:to,URI:b1,EventDispatcher:vN,Observable:ON,I18n:id,LocalStorage:Lte,ImageUploader:FL},dom:{EventUtils:cm,TreeWalker:_i,TextSeeker:fp,DOMUtils:Qr,ScriptLoader:um,RangeUtils:O,Serializer:O1,StyleSheetLoader:Bv,ControlSelection:lx,BookmarkManager:_O,Selection:FM,Event:cm.Event},html:{Styles:Qv,Entities:sp,Node:Xd,Schema:wh,DomParser:$S,Writer:jP,Serializer:Y2},Env:qn,AddOnManager:Ia,Annotator:u1,Formatter:VL,UndoManager:GM,EditorCommands:uZ,WindowManager:qx,NotificationManager:fw,EditorObservable:wN,Shortcuts:vZ,Editor:I4,FocusManager:SI,EditorManager:bv,DOM:Qr.DOM,ScriptLoader:um.ScriptLoader,PluginManager:dw,ThemeManager:QO,ModelManager:LS,IconManager:aA,Resource:lC,FakeClipboard:Pte,trim:gn.trim,isArray:gn.isArray,is:gn.is,toArray:gn.toArray,makeMap:gn.makeMap,each:gn.each,map:gn.map,grep:gn.grep,inArray:gn.inArray,extend:gn.extend,walk:gn.walk,resolve:gn.resolve,explode:gn.explode,_addCacheSuffix:gn._addCacheSuffix},AN=gn.extend(bv,Fte),Q4=n=>{try{o.exports=n}catch{}};(n=>{window.tinymce=n,window.tinyMCE=n})(AN),Q4(AN)})()})(p1e);const ITe=p1e.exports;(function(){var o=tinymce.util.Tools.resolve("tinymce.ModelManager");const e=(O,k,D)=>{var N;return D(O,k.prototype)?!0:((N=O.constructor)===null||N===void 0?void 0:N.name)===k.name},t=O=>{const k=typeof O;return O===null?"null":k==="object"&&Array.isArray(O)?"array":k==="object"&&e(O,String,(D,N)=>N.isPrototypeOf(D))?"string":k},s=O=>k=>t(k)===O,a=O=>k=>typeof k===O,l=O=>k=>O===k,u=s("string"),d=s("object"),h=s("array"),b=l(null),y=a("boolean"),C=l(void 0),E=O=>O==null,R=O=>!E(O),$=a("function"),Q=a("number"),F=()=>{},U=(O,k)=>(...D)=>O(k.apply(null,D)),K=(O,k)=>D=>O(k(D)),L=O=>()=>O,te=O=>O,ne=(O,k)=>O===k;function oe(O,...k){return(...D)=>{const N=k.concat(D);return O.apply(null,N)}}const G=O=>k=>!O(k),we=O=>()=>{throw new Error(O)},ve=O=>O(),Re=L(!1),Oe=L(!0);class ce{constructor(k,D){this.tag=k,this.value=D}static some(k){return new ce(!0,k)}static none(){return ce.singletonNone}fold(k,D){return this.tag?D(this.value):k()}isSome(){return this.tag}isNone(){return!this.tag}map(k){return this.tag?ce.some(k(this.value)):ce.none()}bind(k){return this.tag?k(this.value):ce.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:ce.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 R(k)?ce.some(k):ce.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()"}}ce.singletonNone=new ce(!1);const Xe=Array.prototype.slice,tt=Array.prototype.indexOf,ot=Array.prototype.push,V=(O,k)=>tt.call(O,k),ut=(O,k)=>V(O,k)>-1,Qe=(O,k)=>{for(let D=0,N=O.length;D<N;D++){const Y=O[D];if(k(Y,D))return!0}return!1},Bt=(O,k)=>{const D=[];for(let N=0;N<O;N++)D.push(k(N));return D},Ct=(O,k)=>{const D=O.length,N=new Array(D);for(let Y=0;Y<D;Y++){const se=O[Y];N[Y]=k(se,Y)}return N},He=(O,k)=>{for(let D=0,N=O.length;D<N;D++){const Y=O[D];k(Y,D)}},st=(O,k)=>{for(let D=O.length-1;D>=0;D--){const N=O[D];k(N,D)}},rn=(O,k)=>{const D=[],N=[];for(let Y=0,se=O.length;Y<se;Y++){const pe=O[Y];(k(pe,Y)?D:N).push(pe)}return{pass:D,fail:N}},Et=(O,k)=>{const D=[];for(let N=0,Y=O.length;N<Y;N++){const se=O[N];k(se,N)&&D.push(se)}return D},Cn=(O,k,D)=>(st(O,(N,Y)=>{D=k(D,N,Y)}),D),je=(O,k,D)=>(He(O,(N,Y)=>{D=k(D,N,Y)}),D),mt=(O,k,D)=>{for(let N=0,Y=O.length;N<Y;N++){const se=O[N];if(k(se,N))return ce.some(se);if(D(se,N))break}return ce.none()},he=(O,k)=>mt(O,k,Re),Zo=(O,k)=>{for(let D=0,N=O.length;D<N;D++){const Y=O[D];if(k(Y,D))return ce.some(D)}return ce.none()},Kn=O=>{const k=[];for(let D=0,N=O.length;D<N;++D){if(!h(O[D]))throw new Error("Arr.flatten item "+D+" was not an array, input: "+O);ot.apply(k,O[D])}return k},so=(O,k)=>Kn(Ct(O,k)),Yo=(O,k)=>{for(let D=0,N=O.length;D<N;++D){const Y=O[D];if(k(Y,D)!==!0)return!1}return!0},as=O=>{const k=Xe.call(O,0);return k.reverse(),k},kt=(O,k)=>{const D={};for(let N=0,Y=O.length;N<Y;N++){const se=O[N];D[String(se)]=k(se,N)}return D},jt=(O,k)=>{const D=Xe.call(O,0);return D.sort(k),D},pt=(O,k)=>k>=0&&k<O.length?ce.some(O[k]):ce.none(),Ne=O=>pt(O,0),Gt=O=>pt(O,O.length-1),bn=(O,k)=>{for(let D=0;D<O.length;D++){const N=k(O[D],D);if(N.isSome())return N}return ce.none()},At=Object.keys,An=Object.hasOwnProperty,zn=(O,k)=>{const D=At(O);for(let N=0,Y=D.length;N<Y;N++){const se=D[N],pe=O[se];k(pe,se)}},ps=(O,k)=>oo(O,(D,N)=>({k:N,v:k(D,N)})),oo=(O,k)=>{const D={};return zn(O,(N,Y)=>{const se=k(N,Y);D[se.k]=se.v}),D},Ss=O=>(k,D)=>{O[D]=k},Mr=(O,k,D,N)=>{zn(O,(Y,se)=>{(k(Y,se)?D:N)(Y,se)})},$s=(O,k)=>{const D={};return Mr(O,k,Ss(D),F),D},tr=(O,k)=>{const D=[];return zn(O,(N,Y)=>{D.push(k(N,Y))}),D},Xs=O=>tr(O,te),wa=(O,k)=>dr(O,k)?ce.from(O[k]):ce.none(),dr=(O,k)=>An.call(O,k),Ns=(O,k)=>dr(O,k)&&O[k]!==void 0&&O[k]!==null,qr=O=>{for(const k in O)if(An.call(O,k))return!1;return!0},$o=typeof window<"u"?window:Function("return this;")(),Po=(O,k)=>{let D=k!=null?k:$o;for(let N=0;N<O.length&&D!==void 0&&D!==null;++N)D=D[O[N]];return D},Rr=(O,k)=>{const D=O.split(".");return Po(D,k)},Ls=(O,k)=>Rr(O,k),aa=(O,k)=>{const D=Ls(O,k);if(D==null)throw new Error(O+" not available on this browser");return D},bs=Object.getPrototypeOf,_a=O=>aa("HTMLElement",O),ln=O=>{const k=Rr("ownerDocument.defaultView",O);return d(O)&&(_a(k).prototype.isPrototypeOf(O)||/^HTML\w*Element$/.test(bs(O).constructor.name))},vs=8,Qi=9,ze=11,et=1,Tt=3,Wt=O=>O.dom.nodeName.toLowerCase(),Yn=O=>O.dom.nodeType,po=O=>k=>Yn(k)===O,wo=O=>Yn(O)===vs||Wt(O)==="#comment",fn=O=>os(O)&&ln(O.dom),os=po(et),xo=po(Tt),fs=po(Qi),kr=po(ze),Lr=O=>k=>os(k)&&Wt(k)===O,Vs=(O,k,D)=>{if(u(D)||y(D)||Q(D))O.setAttribute(k,D+"");else throw console.error("Invalid call to Attribute.set. Key ",k,":: Value ",D,":: Element ",O),new Error("Attribute value was not simple")},Yr=(O,k,D)=>{Vs(O.dom,k,D)},Zi=(O,k)=>{const D=O.dom;zn(k,(N,Y)=>{Vs(D,Y,N)})},Qa=(O,k)=>{zn(k,(D,N)=>{D.fold(()=>{qe(O,N)},Y=>{Vs(O.dom,N,Y)})})},Oi=(O,k)=>{const D=O.dom.getAttribute(k);return D===null?void 0:D},Ge=(O,k)=>ce.from(Oi(O,k)),qe=(O,k)=>{O.dom.removeAttribute(k)},Nt=O=>je(O.dom.attributes,(k,D)=>(k[D.name]=D.value,k),{}),Ut=(O,k)=>{const N=(k||document).createElement("div");if(N.innerHTML=O,!N.hasChildNodes()||N.childNodes.length>1){const Y="HTML does not have a single root node";throw console.error(Y,O),new Error(Y)}return Go(N.childNodes[0])},bo=(O,k)=>{const N=(k||document).createElement(O);return Go(N)},Lo=(O,k)=>{const N=(k||document).createTextNode(O);return Go(N)},Go=O=>{if(O==null)throw new Error("Node cannot be null or undefined");return{dom:O}},lt={fromHtml:Ut,fromTag:bo,fromText:Lo,fromDom:Go,fromPoint:(O,k,D)=>ce.from(O.dom.elementFromPoint(k,D)).map(Go)},Xo=(O,k)=>{const D=O.dom;if(D.nodeType!==et)return!1;{const N=D;if(N.matches!==void 0)return N.matches(k);if(N.msMatchesSelector!==void 0)return N.msMatchesSelector(k);if(N.webkitMatchesSelector!==void 0)return N.webkitMatchesSelector(k);if(N.mozMatchesSelector!==void 0)return N.mozMatchesSelector(k);throw new Error("Browser lacks native selectors")}},Ni=O=>O.nodeType!==et&&O.nodeType!==Qi&&O.nodeType!==ze||O.childElementCount===0,la=(O,k)=>{const D=k===void 0?document:k.dom;return Ni(D)?[]:Ct(D.querySelectorAll(O),lt.fromDom)},ma=(O,k)=>{const D=k===void 0?document:k.dom;return Ni(D)?ce.none():ce.from(D.querySelector(O)).map(lt.fromDom)},gr=(O,k)=>O.dom===k.dom,Fc=(O,k)=>{const D=O.dom,N=k.dom;return D===N?!1:D.contains(N)},Cc=Xo,nl=O=>lt.fromDom(O.dom.ownerDocument),ga=O=>fs(O)?O:nl(O),nr=O=>lt.fromDom(ga(O).dom.documentElement),Ar=O=>lt.fromDom(ga(O).dom.defaultView),Ki=O=>ce.from(O.dom.parentNode).map(lt.fromDom),gl=O=>ce.from(O.dom.parentElement).map(lt.fromDom),kc=(O,k)=>{const D=$(k)?k:Re;let N=O.dom;const Y=[];for(;N.parentNode!==null&&N.parentNode!==void 0;){const se=N.parentNode,pe=lt.fromDom(se);if(Y.push(pe),D(pe)===!0)break;N=se}return Y},nu=O=>ce.from(O.dom.previousSibling).map(lt.fromDom),xu=O=>ce.from(O.dom.nextSibling).map(lt.fromDom),yr=O=>Ct(O.dom.childNodes,lt.fromDom),ol=(O,k)=>{const D=O.dom.childNodes;return ce.from(D[k]).map(lt.fromDom)},Tu=O=>ol(O,0),ou=(O,k)=>{Ki(O).each(N=>{N.dom.insertBefore(k.dom,O.dom)})},Yl=(O,k)=>{xu(O).fold(()=>{Ki(O).each(Y=>{Dr(Y,k)})},N=>{ou(N,k)})},Aa=(O,k)=>{Tu(O).fold(()=>{Dr(O,k)},N=>{O.dom.insertBefore(k.dom,N.dom)})},Dr=(O,k)=>{O.dom.appendChild(k.dom)},Qm=(O,k,D)=>{ol(O,D).fold(()=>{Dr(O,k)},N=>{ou(N,k)})},xf=(O,k)=>{ou(O,k),Dr(k,O)},xr=(O,k)=>{He(k,(D,N)=>{const Y=N===0?O:k[N-1];Yl(Y,D)})},Za=(O,k)=>{He(k,D=>{Dr(O,D)})},ca=O=>{O.dom.textContent="",He(yr(O),k=>{Ji(k)})},Ji=O=>{const k=O.dom;k.parentNode!==null&&k.parentNode.removeChild(k)},Eu=O=>{const k=yr(O);k.length>0&&xr(O,k),Ji(O)},Qc=(O,k)=>lt.fromDom(O.dom.cloneNode(k)),Ha=O=>Qc(O,!1),Zc=O=>Qc(O,!0),xc=(O,k)=>{const D=lt.fromTag(k),N=Nt(O);return Zi(D,N),D},Cd=(O,k)=>{const D=xc(O,k),N=yr(Zc(O));return Za(D,N),D},Yf=(O,k)=>{const D=xc(O,k);Yl(O,D);const N=yr(O);return Za(D,N),Ji(O),D},Au=["tfoot","thead","tbody","colgroup"],Xl=O=>ut(Au,O),Hc=(O,k)=>({rows:O,columns:k}),Tf=(O,k)=>({row:O,column:k}),su=(O,k,D)=>({element:O,rowspan:k,colspan:D}),kd=(O,k,D,N)=>({element:O,rowspan:k,colspan:D,isNew:N}),De=(O,k,D,N,Y,se)=>({element:O,rowspan:k,colspan:D,row:N,column:Y,isLocked:se}),nt=(O,k,D)=>({element:O,cells:k,section:D}),bt=(O,k,D,N)=>({element:O,cells:k,section:D,isNew:N}),$t=(O,k,D)=>({element:O,isNew:k,isLocked:D}),On=(O,k,D,N)=>({element:O,cells:k,section:D,isNew:N}),Mo=(O,k,D,N)=>({startRow:O,startCol:k,finishRow:D,finishCol:N}),$r=(O,k,D)=>({element:O,colspan:k,column:D}),ys=(O,k)=>({element:O,columns:k}),ls=O=>kr(O)&&R(O.dom.host),Di=$(Element.prototype.attachShadow)&&$(Node.prototype.getRootNode),js=L(Di),Hi=Di?O=>lt.fromDom(O.dom.getRootNode()):ga,Du=O=>{const k=Hi(O);return ls(k)?ce.some(k):ce.none()},xd=O=>lt.fromDom(O.dom.host),qn=O=>{if(js()&&R(O.target)){const k=lt.fromDom(O.target);if(os(k)&&Zm(k)&&O.composed&&O.composedPath){const D=O.composedPath();if(D)return Ne(D)}}return ce.from(O.target)},Zm=O=>R(O.dom.shadowRoot),zi=O=>{const k=xo(O)?O.dom.parentNode:O.dom;if(k==null||k.ownerDocument===null)return!1;const D=k.ownerDocument;return Du(lt.fromDom(k)).fold(()=>D.body.contains(k),K(zi,xd))},me=()=>$e(lt.fromDom(document)),$e=O=>{const k=O.dom.body;if(k==null)throw new Error("Body is not available yet");return lt.fromDom(k)},Ue=(O,k,D)=>Et(kc(O,D),k),It=(O,k)=>Et(yr(O),k),Bn=(O,k)=>{let D=[];return He(yr(O),N=>{k(N)&&(D=D.concat([N])),D=D.concat(Bn(N,k))}),D},es=(O,k,D)=>Ue(O,N=>Xo(N,k),D),ro=(O,k)=>It(O,D=>Xo(D,k)),yi=(O,k)=>la(k,O);var gn=(O,k,D,N,Y)=>O(D,N)?ce.some(D):$(Y)&&Y(D)?ce.none():k(D,N,Y);const Gr=(O,k,D)=>{let N=O.dom;const Y=$(D)?D:Re;for(;N.parentNode;){N=N.parentNode;const se=lt.fromDom(N);if(k(se))return ce.some(se);if(Y(se))break}return ce.none()},Ll=(O,k,D)=>gn((Y,se)=>se(Y),Gr,O,k,D),ea=(O,k)=>{const D=Y=>k(lt.fromDom(Y));return he(O.dom.childNodes,D).map(lt.fromDom)},ri=(O,k)=>{const D=N=>{for(let Y=0;Y<N.childNodes.length;Y++){const se=lt.fromDom(N.childNodes[Y]);if(k(se))return ce.some(se);const pe=D(N.childNodes[Y]);if(pe.isSome())return pe}return ce.none()};return D(O.dom)},Ef=(O,k,D)=>Gr(O,N=>Xo(N,k),D),ks=(O,k)=>ea(O,D=>Xo(D,k)),ru=(O,k)=>ma(k,O),Pi=(O,k,D)=>gn((Y,se)=>Xo(Y,se),Ef,O,k,D),uc=(O,k,D=ne)=>O.exists(N=>D(N,k)),Ii=O=>{const k=[],D=N=>{k.push(N)};for(let N=0;N<O.length;N++)O[N].each(D);return k},Xf=(O,k)=>O!=null?k(O):ce.none(),pa=(O,k)=>O?ce.some(k):ce.none(),jf=(O,k,D)=>k===""||O.length>=k.length&&O.substr(D,D+k.length)===k,pr=(O,k,D=0,N)=>{const Y=O.indexOf(k,D);return Y!==-1?C(N)?!0:Y+k.length<=N:!1},Gu=(O,k)=>jf(O,k,0),Ku=(O,k)=>jf(O,k,O.length-k.length),qf=(O=>k=>k.replace(O,""))(/^\s+|\s+$/g),eh=O=>O.length>0,ti=O=>{const k=parseFloat(O);return isNaN(k)?ce.none():ce.some(k)},ta=O=>O.style!==void 0&&$(O.style.getPropertyValue),za=(O,k,D)=>{if(!u(D))throw console.error("Invalid call to CSS.set. Property ",k,":: Value ",D,":: Element ",O),new Error("CSS value must be a string: "+D);ta(O)&&O.style.setProperty(k,D)},Kb=(O,k)=>{ta(O)&&O.style.removeProperty(k)},Mi=(O,k,D)=>{const N=O.dom;za(N,k,D)},kl=(O,k)=>{const D=O.dom;zn(k,(N,Y)=>{za(D,Y,N)})},sl=(O,k)=>{const D=O.dom,Y=window.getComputedStyle(D).getPropertyValue(k);return Y===""&&!zi(O)?Zg(D,k):Y},Zg=(O,k)=>ta(O)?O.style.getPropertyValue(k):"",Gf=(O,k)=>{const D=O.dom,N=Zg(D,k);return ce.from(N).filter(Y=>Y.length>0)},Ec=(O,k)=>{const D=O.dom;Kb(D,k),uc(Ge(O,"style").map(qf),"")&&qe(O,"style")},Af=(O,k)=>{const D=O.dom,N=k.dom;ta(D)&&ta(N)&&(N.style.cssText=D.style.cssText)},Pr=(O,k,D=0)=>Ge(O,k).map(N=>parseInt(N,10)).getOr(D),Ju=(O,k)=>Pr(O,k,1),Fl=O=>Lr("col")(O)?Pr(O,"span",1)>1:Ju(O,"colspan")>1,Va=O=>Ju(O,"rowspan")>1,qi=(O,k)=>parseInt(sl(O,k),10),Vi=L(10),fc=L(10),Kf=(O,k)=>th(O,k,Oe),th=(O,k,D)=>so(yr(O),N=>Xo(N,k)?D(N)?[N]:[]:th(N,k,D)),Hg=(O,k,D=Re)=>{if(D(k))return ce.none();if(ut(O,Wt(k)))return ce.some(k);const N=Y=>Xo(Y,"table")||D(Y);return Ef(k,O.join(","),N)},Hm=(O,k)=>Hg(["td","th"],O,k),Ql=O=>Kf(O,"th,td"),zm=O=>Xo(O,"colgroup")?ro(O,"col"):so(jh(O),k=>ro(k,"col")),rl=(O,k)=>Pi(O,"table",k),Df=O=>Kf(O,"tr"),jh=O=>rl(O).fold(L([]),k=>ro(k,"colgroup")),ef=(O,k)=>Ct(O,D=>{if(Wt(D)==="colgroup"){const N=Ct(zm(D),Y=>{const se=Pr(Y,"span",1);return su(Y,1,se)});return nt(D,N,"colgroup")}else{const N=Ct(Ql(D),Y=>{const se=Pr(Y,"rowspan",1),pe=Pr(Y,"colspan",1);return su(Y,se,pe)});return nt(D,N,k(D))}}),qh=O=>Ki(O).map(k=>{const D=Wt(k);return Xl(D)?D:"tbody"}).getOr("tbody"),zc=O=>{const k=Df(O),N=[...jh(O),...k];return ef(N,qh)},Gh=(O,k)=>ef(O,()=>k),Pf=O=>{let k=!1,D;return(...N)=>(k||(k=!0,D=O.apply(null,N)),D)},zp=(O,k,D,N)=>{const Y=O.isiOS()&&/ipad/i.test(D)===!0,se=O.isiOS()&&!Y,pe=O.isiOS()||O.isAndroid(),Ee=pe||N("(pointer:coarse)"),Fe=Y||!se&&pe&&N("(min-device-width:768px)"),rt=se||pe&&!Fe,_t=k.isSafari()&&O.isiOS()&&/safari/i.test(D)===!1,dn=!rt&&!Fe&&!_t;return{isiPad:L(Y),isiPhone:L(se),isTablet:L(Fe),isPhone:L(rt),isTouch:L(Ee),isAndroid:O.isAndroid,isiOS:O.isiOS,isWebView:L(_t),isDesktop:L(dn)}},Vm=(O,k)=>{for(let D=0;D<O.length;D++){const N=O[D];if(N.test(k))return N}},Jf=(O,k)=>{const D=Vm(O,k);if(!D)return{major:0,minor:0};const N=Y=>Number(k.replace(D,"$"+Y));return Ke(N(1),N(2))},jl=(O,k)=>{const D=String(k).toLowerCase();return O.length===0?zg():Jf(O,D)},zg=()=>Ke(0,0),Ke=(O,k)=>({major:O,minor:k}),nh={nu:Ke,detect:jl,unknown:zg},Pu=(O,k)=>bn(k.brands,D=>{const N=D.brand.toLowerCase();return he(O,Y=>{var se;return N===((se=Y.brand)===null||se===void 0?void 0:se.toLowerCase())}).map(Y=>({current:Y.name,version:nh.nu(parseInt(D.version,10),0)}))}),Vg=(O,k)=>{const D=String(k).toLowerCase();return he(O,N=>N.search(D))},U1=(O,k)=>Vg(O,k).map(D=>{const N=nh.detect(D.versionRegexes,k);return{current:D.name,version:N}}),Kh=(O,k)=>Vg(O,k).map(D=>{const N=nh.detect(D.versionRegexes,k);return{current:D.name,version:N}}),vt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,cn=O=>k=>pr(k,O),an=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:O=>pr(O,"edge/")&&pr(O,"chrome")&&pr(O,"safari")&&pr(O,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,vt],search:O=>pr(O,"chrome")&&!pr(O,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:O=>pr(O,"msie")||pr(O,"trident")},{name:"Opera",versionRegexes:[vt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:cn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:cn("firefox")},{name:"Safari",versionRegexes:[vt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:O=>(pr(O,"safari")||pr(O,"mobile/"))&&pr(O,"applewebkit")}],Eo=[{name:"Windows",search:cn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:O=>pr(O,"iphone")||pr(O,"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]+).*/]}],or={browsers:L(an),oses:L(Eo)},Xr="Edge",fi="Chromium",wi="IE",oh="Opera",Jb="Firefox",Sa="Safari",Td=()=>Wg({current:void 0,version:nh.unknown()}),Wg=O=>{const k=O.current,D=O.version,N=Y=>()=>k===Y;return{current:k,version:D,isEdge:N(Xr),isChromium:N(fi),isIE:N(wi),isOpera:N(oh),isFirefox:N(Jb),isSafari:N(Sa)}},il={unknown:Td,nu:Wg,edge:L(Xr),chromium:L(fi),ie:L(wi),opera:L(oh),firefox:L(Jb),safari:L(Sa)},Da="Windows",tf="iOS",ii="Android",Mu="Linux",dc="macOS",Jh="Solaris",Y1="FreeBSD",sh="ChromeOS",Ug=()=>rh({current:void 0,version:nh.unknown()}),rh=O=>{const k=O.current,D=O.version,N=Y=>()=>k===Y;return{current:k,version:D,isWindows:N(Da),isiOS:N(tf),isAndroid:N(ii),isMacOS:N(dc),isLinux:N(Mu),isSolaris:N(Jh),isFreeBSD:N(Y1),isChromeOS:N(sh)}},ql={unknown:Ug,nu:rh,windows:L(Da),ios:L(tf),android:L(ii),linux:L(Mu),macos:L(dc),solaris:L(Jh),freebsd:L(Y1),chromeos:L(sh)},X1={detect:(O,k,D)=>{const N=or.browsers(),Y=or.oses(),se=k.bind(Fe=>Pu(N,Fe)).orThunk(()=>U1(N,O)).fold(il.unknown,il.nu),pe=Kh(Y,O).fold(ql.unknown,ql.nu),Ee=zp(pe,se,O,D);return{browser:se,os:pe,deviceType:Ee}}},Wm=O=>window.matchMedia(O).matches;let Yg=Pf(()=>X1.detect(navigator.userAgent,ce.from(navigator.userAgentData),Wm));const tm=()=>Yg(),ih=(O,k)=>{const D=(Ee,Fe)=>{if(!Q(Fe)&&!Fe.match(/^[0-9]+$/))throw new Error(O+".set accepts only positive integer values. Value was "+Fe);const rt=Ee.dom;ta(rt)&&(rt.style[O]=Fe+"px")},N=Ee=>{const Fe=k(Ee);if(Fe<=0||Fe===null){const rt=sl(Ee,O);return parseFloat(rt)||0}return Fe},Y=N,se=(Ee,Fe)=>je(Fe,(rt,_t)=>{const dn=sl(Ee,_t),Xn=dn===void 0?0:parseInt(dn,10);return isNaN(Xn)?rt:rt+Xn},0);return{set:D,get:N,getOuter:Y,aggregate:se,max:(Ee,Fe,rt)=>{const _t=se(Ee,rt);return Fe>_t?Fe-_t:0}}},Ed=(O,k)=>ti(O).getOr(k),ai=(O,k,D)=>Ed(sl(O,k),D),di=(O,k,D,N)=>{const Y=ai(O,`padding-${D}`,0),se=ai(O,`padding-${N}`,0),pe=ai(O,`border-${D}-width`,0),Ee=ai(O,`border-${N}-width`,0);return k-Y-se-pe-Ee},Zl=(O,k)=>{const D=O.dom,N=D.getBoundingClientRect().width||D.offsetWidth;return k==="border-box"?N:di(O,N,"left","right")},Vp=O=>ai(O,"height",O.dom.offsetHeight),ee=O=>ai(O,"width",O.dom.offsetWidth),ue=O=>Zl(O,"content-box"),Se=ih("width",O=>O.dom.offsetWidth),Je=O=>Se.get(O),at=O=>Se.getOuter(O),Dn=ue,wn=ee,Ko=(O,k,D)=>{const N=O.cells,Y=N.slice(0,k),se=N.slice(k),pe=Y.concat(D).concat(se);return Tr(O,pe)},ss=(O,k,D)=>Ko(O,k,[D]),vo=(O,k,D)=>{const N=O.cells;N[k]=D},Tr=(O,k)=>On(O.element,k,O.section,O.isNew),Gl=(O,k)=>{const D=O.cells,N=Ct(D,k);return On(O.element,N,O.section,O.isNew)},ua=(O,k)=>O.cells[k],Bi=(O,k)=>ua(O,k).element,Ru=O=>O.cells.length,Pa=O=>{const k=rn(O,D=>D.section==="colgroup");return{rows:k.fail,cols:k.pass}},nm=(O,k,D)=>{const N=Ct(O.cells,D);return On(k(O.element),N,O.section,!0)},Um="data-snooker-locked-cols",Wi=O=>Ge(O,Um).bind(k=>ce.from(k.match(/\d+/g))).map(k=>kt(k,Oe)),Ca=O=>{const k=je(Pa(O).rows,(N,Y)=>(He(Y.cells,(se,pe)=>{se.isLocked&&(N[pe]=!0)}),N),{}),D=tr(k,(N,Y)=>parseInt(Y,10));return jt(D)},iu=(O,k)=>O+","+k,ah=(O,k,D)=>ce.from(O.access[iu(k,D)]),na=(O,k,D)=>{const N=e0(O,Y=>D(k,Y.element));return N.length>0?ce.some(N[0]):ce.none()},e0=(O,k)=>{const D=so(O.all,N=>N.cells);return Et(D,k)},Dv=O=>{const k={};let D=0;return He(O.cells,N=>{const Y=N.colspan;Bt(Y,se=>{const pe=D+se;k[pe]=$r(N.element,Y,pe)}),D+=Y}),k},ni=O=>{const k={},D=[],Y=Ne(O).map(Wn=>Wn.element).bind(rl).bind(Wi).getOr({});let se=0,pe=0,Ee=0;const{pass:Fe,fail:rt}=rn(O,Wn=>Wn.section==="colgroup");He(rt,Wn=>{const sn=[];He(Wn.cells,Un=>{let tn=0;for(;k[iu(Ee,tn)]!==void 0;)tn++;const Oo=Ns(Y,tn.toString()),cs=De(Un.element,Un.rowspan,Un.colspan,Ee,tn,Oo);for(let Ds=0;Ds<Un.colspan;Ds++)for(let da=0;da<Un.rowspan;da++){const Rl=Ee+da,wl=tn+Ds,Vu=iu(Rl,wl);k[Vu]=cs,pe=Math.max(pe,wl+1)}sn.push(cs)}),se++,D.push(nt(Wn.element,sn,Wn.section)),Ee++});const{columns:_t,colgroups:dn}=Gt(Fe).map(Wn=>{const sn=Dv(Wn);return{colgroups:[ys(Wn.element,Xs(sn))],columns:sn}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Hc(se,pe),access:k,all:D,columns:_t,colgroups:dn}},Ae={fromTable:O=>{const k=zc(O);return ni(k)},generate:ni,getAt:ah,findItem:na,filterItems:e0,justCells:O=>so(O.all,k=>k.cells),justColumns:O=>Xs(O.columns),hasColumns:O=>At(O.columns).length>0,getColumnAt:(O,k)=>ce.from(O.columns[k])},Mf=(O,k=Oe)=>{const D=O.grid,N=Bt(D.columns,te),Y=Bt(D.rows,te);return Ct(N,se=>Xg(()=>so(Y,rt=>Ae.getAt(O,rt,se).filter(_t=>_t.column===se).toArray()),rt=>rt.colspan===1&&k(rt.element),()=>Ae.getAt(O,0,se)))},Xg=(O,k,D)=>{const N=O();return he(N,k).orThunk(()=>ce.from(N[0]).orThunk(D)).map(pe=>pe.element)},$u=O=>{const k=O.grid,D=Bt(k.rows,te),N=Bt(k.columns,te);return Ct(D,Y=>Xg(()=>so(N,Fe=>Ae.getAt(O,Y,Fe).filter(rt=>rt.row===Y).fold(L([]),rt=>[rt])),Fe=>Fe.rowspan===1,()=>Ae.getAt(O,Y,0)))},hi=(O,k)=>{if(k<0||k>=O.length-1)return ce.none();const D=O[k].fold(()=>{const Y=as(O.slice(0,k));return bn(Y,(se,pe)=>se.map(Ee=>({value:Ee,delta:pe+1})))},Y=>ce.some({value:Y,delta:0})),N=O[k+1].fold(()=>{const Y=O.slice(k+1);return bn(Y,(se,pe)=>se.map(Ee=>({value:Ee,delta:pe+1})))},Y=>ce.some({value:Y,delta:1}));return D.bind(Y=>N.map(se=>{const pe=se.delta+Y.delta;return Math.abs(se.value-Y.value)/pe}))},Pv=(O,k)=>D=>j1(D)==="rtl"?k:O,j1=O=>sl(O,"direction")==="rtl"?"rtl":"ltr",t0=ih("height",O=>{const k=O.dom;return zi(O)?k.getBoundingClientRect().height:k.offsetHeight}),td=O=>t0.get(O),Ym=O=>t0.getOuter(O),jg=Vp,Mv=(O,k)=>({left:O,top:k,translate:(N,Y)=>Mv(O+N,k+Y)}),Rf=Mv,xy=O=>{const k=O.getBoundingClientRect();return Rf(k.left,k.top)},Nu=(O,k)=>O!==void 0?O:k!==void 0?k:0,nf=O=>{const k=O.dom.ownerDocument,D=k.body,N=k.defaultView,Y=k.documentElement;if(D===O.dom)return Rf(D.offsetLeft,D.offsetTop);const se=Nu(N==null?void 0:N.pageYOffset,Y.scrollTop),pe=Nu(N==null?void 0:N.pageXOffset,Y.scrollLeft),Ee=Nu(Y.clientTop,D.clientTop),Fe=Nu(Y.clientLeft,D.clientLeft);return n0(O).translate(pe-Fe,se-Ee)},n0=O=>{const k=O.dom,N=k.ownerDocument.body;return N===k?Rf(N.offsetLeft,N.offsetTop):zi(O)?xy(k):Rf(0,0)},o0=(O,k)=>({row:O,y:k}),s0=(O,k)=>({col:O,x:k}),q1=O=>nf(O).left+at(O),nd=O=>nf(O).left,r0=(O,k)=>s0(O,nd(k)),i0=(O,k)=>s0(O,q1(k)),pl=O=>nf(O).top,Ty=(O,k)=>o0(O,pl(k)),_i=(O,k)=>o0(O,pl(k)+Ym(k)),fo=(O,k,D)=>{if(D.length===0)return[];const N=Ct(D.slice(1),(se,pe)=>se.map(Ee=>O(pe,Ee))),Y=D[D.length-1].map(se=>k(D.length-1,se));return N.concat([Y])},Dd=O=>-O,Jn={delta:te,positions:O=>fo(Ty,_i,O),edge:pl},ch=Pv({delta:te,edge:nd,positions:O=>fo(r0,i0,O)},{delta:Dd,edge:q1,positions:O=>fo(i0,r0,O)}),Vc={delta:(O,k)=>ch(k).delta(O,k),positions:(O,k)=>ch(k).positions(O,k),edge:O=>ch(O).edge(O)},qg={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:[""]},Pd=(()=>{const O="[0-9]+",D="[eE]"+("[+-]?"+O),N="\\.",Y=Ee=>`(?:${Ee})?`,pe=`[+-]?(?:${["Infinity",O+N+Y(O)+Y(D),N+O+Y(D),O+Y(D)].join("|")})`;return new RegExp(`^(${pe})(.*)$`)})(),bl=(O,k)=>Qe(k,D=>Qe(qg[D],N=>O===N)),Iu=(O,k)=>ce.from(Pd.exec(O)).bind(N=>{const Y=Number(N[1]),se=N[2];return bl(se,k)?ce.some({value:Y,unit:se}):ce.none()}),Wp=/(\d+(\.\d+)?)%/,G1=/(\d+(\.\d+)?)px|em/,_n=Lr("col"),Xm=(O,k,D)=>{const N=gl(O).getOrThunk(()=>$e(nl(O)));return k(O)/D(N)*100},Md=(O,k)=>{Mi(O,"width",k+"px")},uh=(O,k)=>{Mi(O,"width",k+"%")},of=(O,k)=>{Mi(O,"height",k+"px")},K1=O=>jg(O)+"px",mi=(O,k,D,N)=>{const Y=rl(O).map(se=>{const pe=D(se);return Math.floor(k/100*pe)}).getOr(k);return N(O,Y),Y},Ui=(O,k,D,N)=>{const Y=parseFloat(O);return Ku(O,"%")&&Wt(k)!=="table"?mi(k,Y,D,N):Y},ba=O=>{const k=K1(O);return k?Ui(k,O,td,of):td(O)},Es=(O,k,D)=>{const N=D(O),Y=Ju(O,k);return N/Y},Rd=(O,k)=>Gf(O,k).orThunk(()=>Ge(O,k).map(D=>D+"px")),xl=O=>Rd(O,"width"),sf=O=>Rd(O,"height"),Wa=O=>Xm(O,Je,Dn),ka=O=>_n(O)?Je(O):wn(O),Up=O=>Es(O,"rowspan",ba),nn=O=>xl(O).bind(D=>Iu(D,["fixed","relative","empty"])),Kr=(O,k,D)=>{Mi(O,"width",k+D)},a0=O=>Je(O)+"px",xa=O=>Xm(O,Je,Dn)+"%",Ua=O=>xl(O).exists(k=>Wp.test(k)),Gg=O=>xl(O).exists(k=>G1.test(k)),Wc=O=>xl(O).isNone(),od=L(Wp),sd=Lr("col"),Yp=O=>xl(O).getOrThunk(()=>ka(O)+"px"),Hl=O=>sf(O).getOrThunk(()=>Up(O)+"px"),Er=O=>Ct(Ae.justColumns(O),k=>ce.from(k.element)),Ya=O=>{const k=tm().browser,D=k.isChromium()||k.isFirefox();return sd(O)?D:!0},fh=(O,k,D,N,Y,se)=>O.filter(N).fold(()=>se(hi(D,k)),pe=>Y(pe)),Jl=(O,k,D,N)=>{const Y=Mf(O),se=Ae.hasColumns(O)?Er(O):Y,pe=[ce.some(Vc.edge(k))].concat(Ct(Vc.positions(Y,k),Fe=>Fe.map(rt=>rt.x))),Ee=G(Fl);return Ct(se,(Fe,rt)=>fh(Fe,rt,pe,Ee,_t=>{if(Ya(_t))return D(_t);{const dn=Xf(Y[rt],te);return fh(dn,rt,pe,Ee,Xn=>N(ce.some(Je(Xn))),N)}},N))},l0=O=>O.map(k=>k+"px").getOr(""),jm=(O,k)=>Jl(O,k,Yp,l0),J1=(O,k,D)=>Jl(O,k,Wa,N=>N.fold(()=>D.minCellWidth(),Y=>Y/D.pixelWidth()*100)),Xa=(O,k,D)=>Jl(O,k,ka,N=>N.getOrThunk(D.minCellWidth)),hc=(O,k,D,N,Y)=>{const se=$u(O),pe=[ce.some(D.edge(k))].concat(Ct(D.positions(se,k),Ee=>Ee.map(Fe=>Fe.y)));return Ct(se,(Ee,Fe)=>fh(Ee,Fe,pe,G(Va),N,Y))},xt=(O,k,D)=>hc(O,k,D,Up,N=>N.getOrThunk(fc)),Dc=(O,k,D)=>hc(O,k,D,Hl,l0),au=(O,k)=>()=>zi(O)?k(O):parseFloat(Gf(O,"width").getOr("0")),mc=O=>{const k=au(O,Je),D=L(0);return{width:k,pixelWidth:k,getWidths:(Y,se)=>Xa(Y,O,se),getCellDelta:D,singleColumnWidth:L([0]),minCellWidth:D,setElementWidth:F,adjustTableWidth:F,isRelative:!0,label:"none"}},Bu=O=>{const k=au(O,Fe=>parseFloat(xa(Fe))),D=au(O,Je);return{width:k,pixelWidth:D,getWidths:(Fe,rt)=>J1(Fe,O,rt),getCellDelta:Fe=>Fe/D()*100,singleColumnWidth:(Fe,rt)=>[100-Fe],minCellWidth:()=>Vi()/D()*100,setElementWidth:uh,adjustTableWidth:Fe=>{const rt=k(),_t=Fe/100*rt,dn=rt+_t;uh(O,dn)},isRelative:!0,label:"percent"}},ja=O=>{const k=au(O,Je);return{width:k,pixelWidth:k,getWidths:(pe,Ee)=>Xa(pe,O,Ee),getCellDelta:te,singleColumnWidth:(pe,Ee)=>[Math.max(Vi(),pe+Ee)-pe],minCellWidth:Vi,setElementWidth:Md,adjustTableWidth:pe=>{const Ee=k()+pe;Md(O,Ee)},isRelative:!1,label:"pixel"}},qa=(O,k)=>od().exec(k)!==null?Bu(O):ja(O),lu={getTableSize:O=>xl(O).fold(()=>mc(O),D=>qa(O,D)),pixelSize:ja,percentageSize:Bu,noneSize:mc},c0=(O,k,D,N,Y,se)=>({minRow:O,minCol:k,maxRow:D,maxCol:N,allCells:Y,selectedCells:se}),Ho=(O,k)=>{const D=O.grid.columns;let Y=O.grid.rows,se=D,pe=0,Ee=0;const Fe=[],rt=[];return zn(O.access,_t=>{if(Fe.push(_t),k(_t)){rt.push(_t);const dn=_t.row,Xn=dn+_t.rowspan-1,Wn=_t.column,sn=Wn+_t.colspan-1;dn<Y?Y=dn:Xn>pe&&(pe=Xn),Wn<se?se=Wn:sn>Ee&&(Ee=sn)}}),c0(Y,se,pe,Ee,Fe,rt)},z=(O,k,D)=>{const N=O[D].element,Y=lt.fromTag("td");Dr(Y,lt.fromTag("br")),(k?Dr:Aa)(N,Y)},j=(O,k,D,N)=>{const Y=Et(O,Ee=>Ee.section!=="colgroup"),se=k.grid.columns,pe=k.grid.rows;for(let Ee=0;Ee<pe;Ee++){let Fe=!1;for(let rt=0;rt<se;rt++)Ee<D.minRow||Ee>D.maxRow||rt<D.minCol||rt>D.maxCol||(Ae.getAt(k,Ee,rt).filter(N).isNone()?z(Y,Fe,Ee):Fe=!0)}},ye=(O,k,D,N)=>{zn(D.columns,pe=>{(pe.column<k.minCol||pe.column>k.maxCol)&&Ji(pe.element)});const Y=Et(Kf(O,"tr"),pe=>pe.dom.childElementCount===0);He(Y,Ji),(k.minCol===k.maxCol||k.minRow===k.maxRow)&&He(Kf(O,"th,td"),pe=>{qe(pe,"rowspan"),qe(pe,"colspan")}),qe(O,Um),qe(O,"data-snooker-col-series"),lu.getTableSize(O).adjustTableWidth(N)},Pe=(O,k,D,N)=>{if(N.minCol===0&&k.grid.columns===N.maxCol+1)return 0;const Y=Xa(k,O,D),se=je(Y,(rt,_t)=>rt+_t,0),Fe=je(Y.slice(N.minCol,N.maxCol+1),(rt,_t)=>rt+_t,0)/se*D.pixelWidth()-D.pixelWidth();return D.getCellDelta(Fe)},ct=(O,k)=>{const D=Xn=>Xo(Xn.element,k),N=Zc(O),Y=zc(N),se=lu.getTableSize(O),pe=Ae.generate(Y),Ee=Ho(pe,D),Fe="th:not("+k+"),td:not("+k+")",rt=th(N,"th,td",Xn=>Xo(Xn,Fe));He(rt,Ji),j(Y,pe,Ee,D);const _t=Ae.fromTable(O),dn=Pe(O,_t,se,Ee);return ye(N,Ee,pe,dn),N},Ft="\xA0",In=((O,k)=>{const D=se=>{if(!O(se))throw new Error("Can only get "+k+" value of a "+k+" node");return N(se).getOr("")},N=se=>O(se)?ce.from(se.dom.nodeValue):ce.none();return{get:D,getOption:N,set:(se,pe)=>{if(!O(se))throw new Error("Can only set raw "+k+" value of a "+k+" node");se.dom.nodeValue=pe}}})(xo,"text"),Uo=O=>In.get(O),ts=O=>In.getOption(O),Si=(O,k)=>In.set(O,k),sr=O=>Wt(O)==="img"?1:ts(O).fold(()=>yr(O).length,k=>k.length),_r=O=>ts(O).filter(k=>k.trim().length!==0||k.indexOf(Ft)>-1).isSome(),Uc=O=>fn(O)&&Oi(O,"contenteditable")==="false",cu=["img","br"],rf=O=>_r(O)||ut(cu,Wt(O))||Uc(O),Nf=O=>ri(O,rf),dh=O=>hh(O,rf),hh=(O,k)=>{const D=N=>{const Y=yr(N);for(let se=Y.length-1;se>=0;se--){const pe=Y[se];if(k(pe))return ce.some(pe);const Ee=D(pe);if(Ee.isSome())return Ee}return ce.none()};return D(O)},hr={scope:["row","col"]},Gm=O=>()=>{const k=lt.fromTag("td",O.dom);return Dr(k,lt.fromTag("br",O.dom)),k},Km=O=>()=>lt.fromTag("col",O.dom),oa=O=>()=>lt.fromTag("colgroup",O.dom),uu=O=>()=>lt.fromTag("tr",O.dom),Xp=(O,k,D)=>{const N=Cd(O,k);return zn(D,(Y,se)=>{Y===null?qe(N,se):Yr(N,se,Y)}),N},Jm=O=>O,Ps=(O,k,D)=>Nf(O).map(Y=>{const se=D.join(","),pe=es(Y,se,Ee=>gr(Ee,O));return Cn(pe,(Ee,Fe)=>{const rt=Ha(Fe);return Dr(Ee,rt),rt},k)}).getOr(k),Fr=(O,k)=>{zn(hr,(D,N)=>Ge(O,N).filter(Y=>ut(D,Y)).each(Y=>Yr(k,N,Y)))},Ma=(O,k,D)=>{const N=(pe,Ee)=>{Af(pe.element,Ee),Ec(Ee,"height"),pe.colspan!==1&&Ec(Ee,"width")},Y=pe=>{const Ee=lt.fromTag(Wt(pe.element),k.dom),Fe=D.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),rt=Fe.length>0?Ps(pe.element,Ee,Fe):Ee;return Dr(rt,lt.fromTag("br")),N(pe,Ee),Fr(pe.element,Ee),O(pe.element,Ee),Ee};return{col:pe=>{const Ee=lt.fromTag(Wt(pe.element),k.dom);return N(pe,Ee),O(pe.element,Ee),Ee},colgroup:oa(k),row:uu(k),cell:Y,replace:Xp,colGap:Km(k),gap:Gm(k)}},gc=O=>({col:Km(O),colgroup:oa(O),row:uu(O),cell:Gm(O),replace:Jm,colGap:Km(O),gap:Gm(O)}),eb=(O,k)=>{const N=(k||document).createElement("div");return N.innerHTML=O,yr(lt.fromDom(N))},Tl=O=>Ct(O,lt.fromDom),Gi=O=>k=>k.options.get(O),fu="100%",If=O=>{var k;const D=O.dom,N=(k=D.getParent(O.selection.getStart(),D.isBlock))!==null&&k!==void 0?k:O.getBody();return Dn(lt.fromDom(N))+"px"},Jw=(O,k)=>ng(O)||!af(O)?k:tg(O)?{...k,width:If(O)}:{...k,width:fu},om=(O,k)=>ng(O)||af(O)?k:tg(O)?{...k,width:If(O)}:{...k,width:fu},Kg=O=>{const k=O.options.register;k("table_clone_elements",{processor:"string[]"}),k("table_use_colgroups",{processor:"boolean",default:!0}),k("table_header_type",{processor:D=>{const N=ut(["section","cells","sectionCells","auto"],D);return N?{value:D,valid:N}:{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 N=ut(["preservetable","resizetable"],D);return N?{value:D,valid:N}:{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})},sm=O=>ce.from(O.options.get("table_clone_elements")),eg=O=>{const k=O.options.get("object_resizing");return ut(k.split(","),"table")},Jg=Gi("table_header_type"),u0=Gi("table_column_resizing"),rm=O=>u0(O)==="preservetable",Ra=O=>u0(O)==="resizetable",mh=Gi("table_sizing_mode"),$d=O=>mh(O)==="relative",tg=O=>mh(O)==="fixed",ng=O=>mh(O)==="responsive",im=Gi("table_resize_bars"),af=Gi("table_style_by_css"),f0=Gi("table_merge_content_on_paste"),tb=O=>{const k=O.options,D=k.get("table_default_attributes");return k.isSet("table_default_attributes")?D:om(O,D)},e_=O=>{const k=O.options,D=k.get("table_default_styles");return k.isSet("table_default_styles")?D:Jw(O,D)},$a=Gi("table_use_colgroups"),ep=O=>Pi(O,"[contenteditable]"),og=(O,k=!1)=>zi(O)?O.dom.isContentEditable:ep(O).fold(L(k),D=>du(D)==="true"),du=O=>O.dom.contentEditable,Bf=O=>lt.fromDom(O.getBody()),sg=O=>k=>gr(k,Bf(O)),gh=O=>{qe(O,"data-mce-style");const k=D=>qe(D,"data-mce-style");He(Ql(O),k),He(zm(O),k),He(Df(O),k)},Lu=O=>lt.fromDom(O.selection.getStart()),Nd=O=>O.getBoundingClientRect().width,rg=O=>O.getBoundingClientRect().height,d0=(O,k)=>{const D=O.dom.getStyle(k,"width")||O.dom.getAttrib(k,"width");return ce.from(D).filter(eh)},Rv=O=>/^(\d+(\.\d+)?)%$/.test(O),$v=O=>/^(\d+(\.\d+)?)px$/.test(O),ph=O=>Ll(O,Lr("table")).exists(og),tp=(O,k)=>{const D=k.column,N=k.column+k.colspan-1,Y=k.row,se=k.row+k.rowspan-1;return D<=O.finishCol&&N>=O.startCol&&Y<=O.finishRow&&se>=O.startRow},Nv=(O,k)=>k.column>=O.startCol&&k.column+k.colspan-1<=O.finishCol&&k.row>=O.startRow&&k.row+k.rowspan-1<=O.finishRow,ig=(O,k)=>{let D=!0;const N=oe(Nv,k);for(let Y=k.startRow;Y<=k.finishRow;Y++)for(let se=k.startCol;se<=k.finishCol;se++)D=D&&Ae.getAt(O,Y,se).exists(N);return D?ce.some(k):ce.none()},Iv=(O,k)=>Mo(Math.min(O.row,k.row),Math.min(O.column,k.column),Math.max(O.row+O.rowspan-1,k.row+k.rowspan-1),Math.max(O.column+O.colspan-1,k.column+k.colspan-1)),rr=(O,k,D)=>{const N=Ae.findItem(O,k,gr),Y=Ae.findItem(O,D,gr);return N.bind(se=>Y.map(pe=>Iv(se,pe)))},Ao=(O,k,D)=>rr(O,k,D).bind(N=>ig(O,N)),bh=(O,k,D,N)=>Ae.findItem(O,k,gr).bind(Y=>{const se=D>0?Y.row+Y.rowspan-1:Y.row,pe=N>0?Y.column+Y.colspan-1:Y.column;return Ae.getAt(O,se+D,pe+N).map(Fe=>Fe.element)}),nb=(O,k,D)=>rr(O,k,D).map(N=>{const Y=Ae.filterItems(O,oe(tp,N));return Ct(Y,se=>se.element)}),np=(O,k)=>{const D=(N,Y)=>Fc(Y,N);return Ae.findItem(O,k,D).map(N=>N.element)},WC=(O,k,D)=>rl(O).bind(N=>{const Y=ob(N);return bh(Y,O,k,D)}),Bv=(O,k,D)=>{const N=ob(O);return nb(N,k,D)},li=(O,k,D,N,Y)=>{const se=ob(O),pe=gr(O,D)?ce.some(k):np(se,k),Ee=gr(O,Y)?ce.some(N):np(se,N);return pe.bind(Fe=>Ee.bind(rt=>nb(se,Fe,rt)))},Lv=(O,k,D)=>{const N=ob(O);return Ao(N,k,D)},ob=Ae.fromTable;var Ey=["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"],on=()=>{const O=rt=>lt.fromDom(rt.dom.cloneNode(!1)),k=rt=>ga(rt).dom,D=rt=>os(rt)?Wt(rt)==="body"?!0:ut(Ey,Wt(rt)):!1,N=rt=>os(rt)?ut(["br","img","hr","input"],Wt(rt)):!1,Y=rt=>os(rt)&&Oi(rt,"contenteditable")==="false",se=(rt,_t)=>rt.dom.compareDocumentPosition(_t.dom),pe=(rt,_t)=>{const dn=Nt(rt);Zi(_t,dn)},Ee=rt=>{const _t=Wt(rt);return ut(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],_t)},Fe=rt=>os(rt)?Ge(rt,"lang"):ce.none();return{up:L({selector:Ef,closest:Pi,predicate:Gr,all:kc}),down:L({selector:yi,predicate:Bn}),styles:L({get:sl,getRaw:Gf,set:Mi,remove:Ec}),attrs:L({get:Oi,set:Yr,remove:qe,copyTo:pe}),insert:L({before:ou,after:Yl,afterAll:xr,append:Dr,appendAll:Za,prepend:Aa,wrap:xf}),remove:L({unwrap:Eu,remove:Ji}),create:L({nu:lt.fromTag,clone:O,text:lt.fromText}),query:L({comparePosition:se,prevSibling:nu,nextSibling:xu}),property:L({children:yr,name:Wt,parent:Ki,document:k,isText:xo,isComment:wo,isElement:os,isSpecial:Ee,getLanguage:Fe,getText:Uo,setText:Si,isBoundary:D,isEmptyTag:N,isNonEditable:Y}),eq:gr,is:Cc}};const Id=(O,k,D,N)=>{const Y=D[0],se=D.slice(1);return N(O,k,Y,se)},t_=(O,k,D)=>D.length>0?Id(O,k,D,h0):ce.none(),h0=(O,k,D,N)=>{const Y=k(O,D);return Cn(N,(se,pe)=>{const Ee=k(O,pe);return UC(O,se,Ee)},Y)},UC=(O,k,D)=>k.bind(N=>D.filter(oe(O.eq,N))),ag=(O,k)=>oe(O.eq,k),Ay=(O,k,D,N=Re)=>{const Y=[k].concat(O.up().all(k)),se=[D].concat(O.up().all(D)),pe=_t=>Zo(_t,N).fold(()=>_t,Xn=>_t.slice(0,Xn+1)),Ee=pe(Y),Fe=pe(se),rt=he(Ee,_t=>Qe(Fe,ag(O,_t)));return{firstpath:Ee,secondpath:Fe,shared:rt}},am=t_,Bd=Ay,lg=on(),Ci=(O,k)=>am(lg,(D,N)=>O(N),k),Ld=(O,k,D)=>Bd(lg,O,k,D),Fd=O=>Ef(O,"table"),hu=(O,k,D)=>{const N=Y=>se=>D!==void 0&&D(se)||gr(se,Y);return gr(O,k)?ce.some({boxes:ce.some([O]),start:O,finish:k}):Fd(O).bind(Y=>Fd(k).bind(se=>{if(gr(Y,se))return ce.some({boxes:Bv(Y,O,k),start:O,finish:k});if(Fc(Y,se)){const pe=es(k,"td,th",N(Y)),Ee=pe.length>0?pe[pe.length-1]:k;return ce.some({boxes:li(Y,O,Y,k,se),start:O,finish:Ee})}else if(Fc(se,Y)){const pe=es(O,"td,th",N(se)),Ee=pe.length>0?pe[pe.length-1]:O;return ce.some({boxes:li(se,O,Y,k,se),start:O,finish:Ee})}else return Ld(O,k).shared.bind(pe=>Pi(pe,"table",D).bind(Ee=>{const Fe=es(k,"td,th",N(Ee)),rt=Fe.length>0?Fe[Fe.length-1]:k,_t=es(O,"td,th",N(Ee)),dn=_t.length>0?_t[_t.length-1]:O;return ce.some({boxes:li(Ee,O,Y,k,se),start:dn,finish:rt})}))}))},Qs=(O,k)=>{const D=yi(O,k);return D.length>0?ce.some(D):ce.none()},jp=(O,k)=>he(O,D=>Xo(D,k)),vh=(O,k,D)=>ru(O,k).bind(N=>ru(O,D).bind(Y=>Ci(Fd,[N,Y]).map(se=>({first:N,last:Y,table:se})))),op=(O,k)=>Ef(O,"table").bind(D=>ru(D,k).bind(N=>hu(N,O).bind(Y=>Y.boxes.map(se=>({boxes:se,start:Y.start,finish:Y.finish}))))),YC=(O,k,D,N,Y)=>jp(O,Y).bind(se=>WC(se,k,D).bind(pe=>op(pe,N))),m0=(O,k)=>Qs(O,k),Fv=(O,k,D)=>vh(O,k,D).bind(N=>{const Y=Fe=>gr(O,Fe),se="thead,tfoot,tbody,table",pe=Ef(N.first,se,Y),Ee=Ef(N.last,se,Y);return pe.bind(Fe=>Ee.bind(rt=>gr(Fe,rt)?Lv(N.table,N.first,N.last):ce.none()))}),El=te,TE=O=>{const k=(N,Y)=>Ge(N,Y).exists(se=>parseInt(se,10)>1),D=N=>k(N,"rowspan")||k(N,"colspan");return O.length>0&&Yo(O,D)?ce.some(O):ce.none()},sp=(O,k,D)=>k.length<=1?ce.none():Fv(O,D.firstSelectedSelector,D.lastSelectedSelector).map(N=>({bounds:N,cells:k})),Al="data-mce-selected",Dy="td["+Al+"],th["+Al+"]",io="["+Al+"]",Py="data-mce-first-selected",XC="td["+Py+"],th["+Py+"]",My="data-mce-last-selected",lm="td["+My+"],th["+My+"]",lf=io,Oh={selected:Al,selectedSelector:Dy,firstSelected:Py,firstSelectedSelector:XC,lastSelected:My,lastSelectedSelector:lm},rp=(O,k,D)=>({element:D,mergable:sp(k,O,Oh),unmergable:TE(O),selection:El(O)}),yh=(O,k,D)=>({element:O,clipboard:k,generators:D}),g0=(O,k,D,N)=>({selection:El(O),clipboard:D,generators:N}),Lf=O=>rl(O).bind(k=>m0(k,Oh.firstSelectedSelector)).fold(L(O),k=>k[0]),ip=O=>(k,D)=>{const N=Wt(k),Y=N==="col"||N==="colgroup"?Lf(k):k;return Pi(Y,O,D)},Ry=ip("th,td,caption"),qp=ip("th,td"),rd=O=>Tl(O.model.table.getSelectedCells()),$y=O=>Et(rd(O),k=>Xo(k,Oh.selectedSelector)),wh=O=>rl(O[0]).map(k=>{const D=ct(k,lf);return gh(D),[D]}),Qv=(O,k)=>Ct(k,D=>O.selection.serializer.serialize(D.dom,{})).join(""),n_=O=>Ct(O,k=>k.dom.innerText).join(""),Ny=(O,k)=>{O.on("BeforeGetContent",D=>{const N=Y=>{D.preventDefault(),wh(Y).each(se=>{D.content=D.format==="text"?n_(se):Qv(O,se)})};if(D.selection===!0){const Y=$y(O);Y.length>=1&&N(Y)}}),O.on("BeforeSetContent",D=>{if(D.selection===!0&&D.paste===!0){const N=rd(O);Ne(N).each(Y=>{rl(Y).each(se=>{const pe=Et(eb(D.content),Fe=>Wt(Fe)!=="meta"),Ee=Lr("table");if(f0(O)&&pe.length===1&&Ee(pe[0])){D.preventDefault();const Fe=lt.fromDom(O.getDoc()),rt=gc(Fe),_t=yh(Y,pe[0],rt);k.pasteCells(se,_t).each(()=>{O.focus()})}})})}})},ap=(O,k)=>({element:O,offset:k}),Ff=(O,k,D)=>O.property().isText(k)&&O.property().getText(k).trim().length===0||O.property().isComment(k)?D(k).bind(N=>Ff(O,N,D).orThunk(()=>ce.some(N))):ce.none(),mu=(O,k)=>O.property().isText(k)?O.property().getText(k).length:O.property().children(k).length,lp=(O,k)=>{const D=Ff(O,k,O.query().prevSibling).getOr(k);if(O.property().isText(D))return ap(D,mu(O,D));const N=O.property().children(D);return N.length>0?lp(O,N[N.length-1]):ap(D,mu(O,D))},Iy=lp,o_=on(),p0=O=>Iy(o_,O),Yc=(O,k)=>{Fl(O)||nn(O).each(N=>{const Y=N.value/2;Kr(O,Y,N.unit),Kr(k,Y,N.unit)})},b0=O=>Ct(O,L(0)),cf=(O,k,D,N,Y)=>Y(O.slice(0,k)).concat(N).concat(Y(O.slice(D))),cp=O=>(k,D,N,Y)=>{if(O(N)){const se=Math.max(Y,k[D]-Math.abs(N)),pe=Math.abs(se-k[D]);return N>=0?pe:-pe}else return N},cm=cp(O=>O<0),Zv=cp(Oe),s_=()=>{const O=(Ee,Fe,rt,_t,dn)=>{const Xn=cm(Ee,Fe,_t,dn);return cf(Ee,Fe,rt+1,[Xn,0],b0)},k=(Ee,Fe,rt,_t)=>{const dn=(100+rt)/100,Xn=Math.max(_t,(Ee[Fe]+rt)/dn);return Ct(Ee,(Wn,sn)=>(sn===Fe?Xn:Wn/dn)-Wn)},D=(Ee,Fe,rt,_t,dn,Xn)=>Xn?k(Ee,Fe,_t,dn):O(Ee,Fe,rt,_t,dn);return{resizeTable:(Ee,Fe)=>Ee(Fe),clampTableDelta:cm,calcLeftEdgeDeltas:D,calcMiddleDeltas:(Ee,Fe,rt,_t,dn,Xn,Wn)=>D(Ee,rt,_t,dn,Xn,Wn),calcRightEdgeDeltas:(Ee,Fe,rt,_t,dn,Xn)=>{if(Xn)return k(Ee,rt,_t,dn);{const Wn=cm(Ee,rt,_t,dn);return b0(Ee.slice(0,rt)).concat([Wn])}},calcRedestributedWidths:(Ee,Fe,rt,_t)=>{if(_t){const Xn=(Fe+rt)/Fe,Wn=Ct(Ee,sn=>sn/Xn);return{delta:Xn*100-100,newSizes:Wn}}else return{delta:rt,newSizes:Ee}}}},Gp=()=>{const O=(pe,Ee,Fe,rt,_t)=>{const dn=rt>=0?Fe:Ee,Xn=Zv(pe,dn,rt,_t);return cf(pe,Ee,Fe+1,[Xn,-Xn],b0)};return{resizeTable:(pe,Ee,Fe)=>{Fe&&pe(Ee)},clampTableDelta:(pe,Ee,Fe,rt,_t)=>{if(_t){if(Fe>=0)return Fe;{const dn=je(pe,(Xn,Wn)=>Xn+Wn-rt,0);return Math.max(-dn,Fe)}}else return cm(pe,Ee,Fe,rt)},calcLeftEdgeDeltas:O,calcMiddleDeltas:(pe,Ee,Fe,rt,_t,dn)=>O(pe,Fe,rt,_t,dn),calcRightEdgeDeltas:(pe,Ee,Fe,rt,_t,dn)=>{if(dn)return b0(pe);{const Xn=rt/pe.length;return Ct(pe,L(Xn))}},calcRedestributedWidths:(pe,Ee,Fe,rt)=>({delta:0,newSizes:pe})}},By=O=>Ae.fromTable(O).grid,up=Lr("th"),v0=O=>Yo(O,k=>up(k.element)),sb=(O,k)=>O&&k?"sectionCells":O?"section":"cells",Ly=O=>{const k=O.section==="thead",D=uc(Fy(O.cells),"th");return O.section==="tfoot"?{type:"footer"}:k||D?{type:"header",subType:sb(k,D)}:{type:"body"}},Fy=O=>{const k=Et(O,D=>up(D.element));return k.length===0?ce.some("td"):k.length===O.length?ce.some("th"):ce.none()},r_=O=>{const k=Ct(O,Y=>Ly(Y).type),D=ut(k,"header"),N=ut(k,"footer");if(!D&&!N)return ce.some("body");{const Y=ut(k,"body");return D&&!Y&&!N?ce.some("header"):!D&&!Y&&N?ce.some("footer"):ce.none()}},jC=O=>bn(O.all,k=>{const D=Ly(k);return D.type==="header"?ce.from(D.subType):ce.none()}),Qr=(O,k,D)=>$t(D(O.element,k),!0,O.isLocked),Hv=(O,k)=>O.section!==k?On(O.element,O.cells,k,O.isNew):O,Qy=()=>({transformRow:Hv,transformCell:(O,k,D)=>{const N=D(O.element,k),Y=Wt(N)!=="td"?Yf(N,"td"):N;return $t(Y,O.isNew,O.isLocked)}}),Zy=()=>({transformRow:Hv,transformCell:Qr}),O0=()=>({transformRow:(O,k)=>Hv(O,k==="thead"?"tbody":k),transformCell:Qr}),Ga={getTableSectionType:(O,k)=>{const D=Ae.fromTable(O);switch(jC(D).getOr(k)){case"section":return Qy();case"sectionCells":return Zy();case"cells":return O0()}},section:Qy,sectionCells:Zy,cells:O0,fallback:()=>({transformRow:te,transformCell:Qr})},y0=(O,k,D,N)=>{D===N?qe(O,k):Yr(O,k,D)},rb=(O,k,D)=>{Gt(ro(O,k)).fold(()=>Aa(O,D),N=>Yl(N,D))},i_=(O,k)=>{const D=ks(O,k).getOrThunk(()=>{const N=lt.fromTag(k,nl(O).dom);return k==="thead"?rb(O,"caption,colgroup",N):k==="colgroup"?rb(O,"caption",N):Dr(O,N),N});return ca(D),D},w0=(O,k)=>{const D=[],N=[],Y=Wn=>Ct(Wn,sn=>{sn.isNew&&D.push(sn.element);const Un=sn.element;return ca(Un),He(sn.cells,tn=>{tn.isNew&&N.push(tn.element),y0(tn.element,"colspan",tn.colspan,1),y0(tn.element,"rowspan",tn.rowspan,1),Dr(Un,tn.element)}),Un}),se=Wn=>so(Wn,sn=>Ct(sn.cells,Un=>(y0(Un.element,"span",Un.colspan,1),Un.element))),pe=(Wn,sn)=>{const Un=i_(O,sn),Oo=(sn==="colgroup"?se:Y)(Wn);Za(Un,Oo)},Ee=Wn=>{ks(O,Wn).each(Ji)},Fe=(Wn,sn)=>{Wn.length>0?pe(Wn,sn):Ee(sn)},rt=[],_t=[],dn=[],Xn=[];return He(k,Wn=>{switch(Wn.section){case"thead":rt.push(Wn);break;case"tbody":_t.push(Wn);break;case"tfoot":dn.push(Wn);break;case"colgroup":Xn.push(Wn);break}}),Fe(Xn,"colgroup"),Fe(rt,"thead"),Fe(_t,"tbody"),Fe(dn,"tfoot"),{newRows:D,newCells:N}},Hy=O=>Ct(O,k=>{const D=Ha(k.element);return He(k.cells,N=>{const Y=Zc(N.element);y0(Y,"colspan",N.colspan,1),y0(Y,"rowspan",N.rowspan,1),Dr(D,Y)}),D}),Na=(O,k)=>Ct(O,D=>ua(D,k)),_h=(O,k)=>O[k],va=(O,k)=>{if(O.length===0)return 0;const D=O[0];return Zo(O,Y=>!k(D.element,Y.element)).getOr(O.length)},uf=(O,k,D,N)=>{const Y=_h(O,k),se=Y.section==="colgroup",pe=va(Y.cells.slice(D),N),Ee=se?1:va(Na(O.slice(k),D),N);return{colspan:pe,rowspan:Ee}},cg=(O,k)=>{const D=Ct(O,Y=>Ct(Y.cells,Re)),N=(Y,se,pe,Ee)=>{for(let Fe=Y;Fe<Y+pe;Fe++)for(let rt=se;rt<se+Ee;rt++)D[Fe][rt]=!0};return Ct(O,(Y,se)=>{const pe=so(Y.cells,(Ee,Fe)=>{if(D[se][Fe]===!1){const rt=uf(O,se,Fe,k);return N(se,Fe,rt.rowspan,rt.colspan),[kd(Ee.element,rt.rowspan,rt.colspan,Ee.isNew)]}else return[]});return bt(Y.element,pe,Y.section,Y.isNew)})},Xc=(O,k,D)=>{const N=[];He(O.colgroups,Y=>{const se=[];for(let pe=0;pe<O.grid.columns;pe++){const Ee=Ae.getColumnAt(O,pe).map(Fe=>$t(Fe.element,D,!1)).getOrThunk(()=>$t(k.colGap(),!0,!1));se.push(Ee)}N.push(On(Y.element,se,"colgroup",D))});for(let Y=0;Y<O.grid.rows;Y++){const se=[];for(let Fe=0;Fe<O.grid.columns;Fe++){const rt=Ae.getAt(O,Y,Fe).map(_t=>$t(_t.element,D,_t.isLocked)).getOrThunk(()=>$t(k.gap(),!0,!1));se.push(rt)}const pe=O.all[Y],Ee=On(pe.element,se,pe.section,D);N.push(Ee)}return N},GC=(O,k)=>Xc(O,k,!1),zy=O=>cg(O,gr),id=(O,k)=>bn(O.all,D=>he(D.cells,N=>gr(k,N.element))),Ia=(O,k,D)=>{const N=Ct(k.selection,se=>Hm(se).bind(pe=>id(O,pe)).filter(D)),Y=Ii(N);return pa(Y.length>0,Y)},Ta=(O,k,D,N,Y)=>(se,pe,Ee,Fe)=>{const rt=Ae.fromTable(se),_t=ce.from(Fe==null?void 0:Fe.section).getOrThunk(Ga.fallback);return k(rt,pe).map(Xn=>{const Wn=GC(rt,Ee),sn=O(Wn,Xn,gr,Y(Ee),_t),Un=Ca(sn.grid),tn=zy(sn.grid);return{info:Xn,grid:tn,cursor:sn.cursor,lockedColumns:Un}}).bind(Xn=>{const Wn=w0(se,Xn.grid),sn=ce.from(Fe==null?void 0:Fe.sizing).getOrThunk(()=>lu.getTableSize(se)),Un=ce.from(Fe==null?void 0:Fe.resize).getOrThunk(Gp);return D(se,Xn.grid,Xn.info,{sizing:sn,resize:Un,section:_t}),N(se),qe(se,Um),Xn.lockedColumns.length>0&&Yr(se,Um,Xn.lockedColumns.join(",")),ce.some({cursor:Xn.cursor,newRows:Wn.newRows,newCells:Wn.newCells})})},KC=(O,k)=>Hm(k.element).bind(D=>id(O,D).map(N=>({...N,generators:k.generators,clipboard:k.clipboard}))),Sh=(O,k)=>Ia(O,k,Oe).map(D=>({cells:D,generators:k.generators,clipboard:k.clipboard})),_0=(O,k)=>k.mergable,zv=(O,k)=>k.unmergable,ad=(O,k)=>Ia(O,k,Oe),ff=(O,k)=>Ia(O,k,D=>!D.isLocked),Kp=(O,k)=>id(O,k).exists(D=>!D.isLocked),ib=(O,k)=>Yo(k,D=>Kp(O,D)),S0=(O,k)=>_0(O,k).filter(D=>ib(O,D.cells)),C0=(O,k)=>zv(O,k).filter(D=>ib(O,D)),a_=(O,k,D,N)=>{const Y=Pa(O).rows;if(Y.length===0)return O;for(let se=k.startRow;se<=k.finishRow;se++)for(let pe=k.startCol;pe<=k.finishCol;pe++){const Ee=Y[se],Fe=ua(Ee,pe).isLocked;vo(Ee,pe,$t(N(),!1,Fe))}return O},Vy=(O,k,D,N)=>{const Y=Pa(O).rows;let se=!0;for(let pe=0;pe<Y.length;pe++)for(let Ee=0;Ee<Ru(Y[0]);Ee++){const Fe=Y[pe],rt=ua(Fe,Ee),_t=rt.element,dn=D(_t,k);dn&&!se?vo(Fe,Ee,$t(N(),!0,rt.isLocked)):dn&&(se=!1)}return O},JC=(O,k)=>je(O,(D,N)=>Qe(D,Y=>k(Y.element,N.element))?D:D.concat([N]),[]),l_=(O,k,D,N)=>(k>0&&k<O[0].cells.length&&He(O,Y=>{const se=Y.cells[k-1];let pe=0;const Ee=N();for(;Y.cells.length>k+pe&&D(se.element,Y.cells[k+pe].element);)vo(Y,k+pe,$t(Ee,!0,Y.cells[k+pe].isLocked)),pe++}),O),c_=(O,k,D,N)=>{const Y=Pa(O).rows;if(k>0&&k<Y.length){const se=Y[k-1].cells,pe=JC(se,D);He(pe,Ee=>{let Fe=ce.none();for(let rt=k;rt<Y.length;rt++)for(let _t=0;_t<Ru(Y[0]);_t++){const dn=Y[rt],Xn=ua(dn,_t);D(Xn.element,Ee.element)&&(Fe.isNone()&&(Fe=ce.some(N())),Fe.each(sn=>{vo(dn,_t,$t(sn,!0,Xn.isLocked))}))}})}return O},Wy=O=>{const k=se=>se(O),D=L(O),N=()=>Y,Y={tag:!0,inner:O,fold:(se,pe)=>pe(O),isValue:Oe,isError:Re,map:se=>Vv.value(se(O)),mapError:N,bind:k,exists:k,forall:k,getOr:D,or:N,getOrThunk:D,orThunk:N,getOrDie:D,each:se=>{se(O)},toOptional:()=>ce.some(O)};return Y},u_=O=>{const k=()=>D,D={tag:!1,inner:O,fold:(N,Y)=>N(O),isValue:Re,isError:Oe,map:k,mapError:N=>Vv.error(N(O)),bind:k,exists:Re,forall:Oe,getOr:te,or:te,getOrThunk:ve,orThunk:ve,getOrDie:we(String(O)),each:F,toOptional:ce.none};return D},Vv={value:Wy,error:u_,fromOption:(O,k)=>O.fold(()=>u_(k),Wy)},f_=(O,k,D)=>{if(O.row>=k.length||O.column>Ru(k[0]))return Vv.error("invalid start address out of table bounds, row: "+O.row+", column: "+O.column);const N=k.slice(O.row),Y=N[0].cells.slice(O.column),se=Ru(D[0]),pe=D.length;return Vv.value({rowDelta:N.length-pe,colDelta:Y.length-se})},Li=(O,k)=>{const D=Ru(O[0]),N=Ru(k[0]);return{rowDelta:0,colDelta:D-N}},Wv=(O,k)=>{const D=O.length,N=k.length;return{rowDelta:D-N,colDelta:0}},Uy=(O,k,D,N)=>{const Y=k.section==="colgroup"?D.col:D.cell;return Bt(O,se=>$t(Y(),!0,N(se)))},d_=(O,k,D,N)=>{const Y=O[O.length-1];return O.concat(Bt(k,()=>{const se=Y.section==="colgroup"?D.colgroup:D.row,pe=nm(Y,se,te),Ee=Uy(pe.cells.length,pe,D,Fe=>dr(N,Fe.toString()));return Tr(pe,Ee)}))},ug=(O,k,D,N)=>Ct(O,Y=>{const se=Uy(k,Y,D,Re);return Ko(Y,N,se)}),pc=(O,k,D)=>Ct(O,N=>je(D,(Y,se)=>{const pe=Uy(1,N,k,Oe)[0];return ss(Y,se,pe)},N)),gu=(O,k,D)=>{const N=k.colDelta<0?ug:te,Y=k.rowDelta<0?d_:te,se=Ca(O),pe=Ru(O[0]),Ee=Qe(se,_t=>_t===pe-1),Fe=N(O,Math.abs(k.colDelta),D,Ee?pe-1:pe),rt=Ca(Fe);return Y(Fe,Math.abs(k.rowDelta),D,kt(rt,Oe))},h_=(O,k,D,N)=>{const Y=ua(O[k],D),se=oe(N,Y.element),pe=O[k];return O.length>1&&Ru(pe)>1&&(D>0&&se(Bi(pe,D-1))||D<pe.cells.length-1&&se(Bi(pe,D+1))||k>0&&se(Bi(O[k-1],D))||k<O.length-1&&se(Bi(O[k+1],D)))},Yy=(O,k,D,N,Y,se)=>{const pe=O.row,Ee=O.column,Fe=D.length,rt=Ru(D[0]),_t=pe+Fe,dn=Ee+rt+se.length,Xn=kt(se,Oe);for(let Wn=pe;Wn<_t;Wn++){let sn=0;for(let Un=Ee;Un<dn;Un++){if(Xn[Un]){sn++;continue}h_(k,Wn,Un,Y)&&Vy(k,Bi(k[Wn],Un),Y,N.cell);const tn=Un-Ee-sn,Oo=ua(D[Wn-pe],tn),cs=Oo.element,Ds=N.replace(cs);vo(k[Wn],Un,$t(Ds,!0,Oo.isLocked))}}return k},fp=(O,k,D)=>{const N=Ru(k[0]),Y=Pa(k).cols.length+O.row,se=Bt(N-O.column,Ee=>Ee+O.column),pe=he(se,Ee=>Yo(D,Fe=>Fe!==Ee)).getOr(N-1);return{row:Y,column:pe}},dp=(O,k,D)=>Et(D,N=>N>=O.column&&N<=Ru(k[0])+O.column),Jp=(O,k,D,N,Y)=>{const se=Ca(k),pe=fp(O,k,se),Ee=Pa(D).rows,Fe=dp(pe,Ee,se);return f_(pe,k,Ee).map(_t=>{const dn={..._t,colDelta:_t.colDelta-Fe.length},Xn=gu(k,dn,N),Wn=Ca(Xn),sn=dp(pe,Ee,Wn);return Yy(pe,Xn,Ee,N,Y,sn)})},e1=(O,k,D,N,Y)=>{l_(k,O,Y,N.cell);const se=Wv(D,k),pe=gu(D,se,N),Ee=Wv(k,pe),Fe=gu(k,Ee,N);return Ct(Fe,(rt,_t)=>Ko(rt,O,pe[_t].cells))},fg=(O,k,D,N,Y)=>{c_(k,O,Y,N.cell);const se=Ca(k),pe=Li(k,D),Ee={...pe,colDelta:pe.colDelta-se.length},Fe=gu(k,Ee,N),{cols:rt,rows:_t}=Pa(Fe),dn=Ca(Fe),Xn=Li(D,k),Wn={...Xn,colDelta:Xn.colDelta+dn.length},sn=pc(D,N,dn),Un=gu(sn,Wn,N);return[...rt,..._t.slice(0,O),...Un,..._t.slice(O,_t.length)]},Uv=(O,k,D,N)=>nm(O,Y=>N(Y,D),k),sa=(O,k,D,N,Y)=>{const{rows:se,cols:pe}=Pa(O),Ee=se.slice(0,k),Fe=se.slice(k),rt=Uv(se[D],(_t,dn)=>k>0&&k<se.length&&N(Bi(se[k-1],dn),Bi(se[k],dn))?ua(se[k],dn):$t(Y(_t.element,N),!0,_t.isLocked),N,Y);return[...pe,...Ee,rt,...Fe]},df=(O,k,D,N,Y,se,pe)=>{if(D==="colgroup"||!N){const Ee=ua(O,Y);return $t(pe(Ee.element,se),!0,!1)}else return ua(O,k)},ab=(O,k,D,N,Y)=>Ct(O,se=>{const pe=k>0&&k<Ru(se)&&N(Bi(se,k-1),Bi(se,k)),Ee=df(se,k,se.section,pe,D,N,Y);return ss(se,k,Ee)}),ek=(O,k)=>so(O,D=>{const N=D.cells,Y=Cn(k,(se,pe)=>pe>=0&&pe<se.length?se.slice(0,pe).concat(se.slice(pe+1)):se,N);return Y.length>0?[On(D.element,Y,D.section,D.isNew)]:[]}),Xy=(O,k,D)=>{const{rows:N,cols:Y}=Pa(O);return[...Y,...N.slice(0,k),...N.slice(D+1)]},tk=(O,k,D,N)=>Bi(O[k],D)!==void 0&&k>0&&N(Bi(O[k-1],D),Bi(O[k],D)),t1=(O,k,D)=>k>0&&D(Bi(O,k-1),Bi(O,k)),lb=(O,k,D,N)=>tk(O,k,D,N)||t1(O[k],D,N),ld=(O,k)=>Yo(k,te)&&v0(O.cells)?Oe:(N,Y,se)=>!(Wt(N.element)==="th"&&k[se]),jy=(O,k)=>Yo(k,te)&&v0(O)?Oe:(N,Y,se)=>!(Wt(N.element)==="th"&&k[Y]),m_=(O,k,D,N)=>{const Y=pe=>pe==="row"?Va(k):Fl(k),se=pe=>Y(pe)?`${pe}group`:pe;return O?up(k)?se(D):null:N&&up(k)?se(D==="row"?"col":"row"):null},g_=(O,k)=>(D,N,Y)=>ce.some(m_(O,D.element,"col",k[Y])),nk=(O,k)=>(D,N)=>ce.some(m_(O,D.element,"row",k[N])),p_=(O,k,D)=>$t(D(O.element,k),!0,O.isLocked),k0=(O,k,D,N,Y,se,pe)=>{const Ee=Fe=>Qe(k,rt=>D(Fe.element,rt.element));return Ct(O,(Fe,rt)=>Gl(Fe,(_t,dn)=>{if(Ee(_t)){const Xn=pe(_t,rt,dn)?Y(_t,D,N):_t;return se(Xn,rt,dn).each(Wn=>{Qa(Xn.element,{scope:ce.from(Wn)})}),Xn}else return _t}))},x0=(O,k,D)=>so(O,(N,Y)=>lb(O,Y,k,D)?[]:[ua(N,k)]),b_=(O,k,D)=>{const N=O[k];return so(N.cells,(Y,se)=>lb(O,k,se,D)?[]:[Y])},qy=(O,k,D,N,Y)=>{const se=Pa(O).rows,pe=so(k,_t=>x0(se,_t,N)),Ee=Ct(se,_t=>v0(_t.cells)),Fe=jy(pe,Ee),rt=nk(D,Ee);return k0(O,pe,N,Y,p_,rt,Fe)},n1=(O,k,D,N,Y,se,pe)=>{const{cols:Ee,rows:Fe}=Pa(O),rt=Fe[k[0]],_t=so(k,tn=>b_(Fe,tn,Y)),dn=Ct(rt.cells,(tn,Oo)=>v0(x0(Fe,Oo,Y))),Xn=[...Fe];He(k,tn=>{Xn[tn]=pe.transformRow(Fe[tn],D)});const Wn=[...Ee,...Xn],sn=ld(rt,dn),Un=g_(N,dn);return k0(Wn,_t,Y,se,pe.transformCell,Un,sn)},v_=(O,k,D,N)=>{const Y=Pa(O).rows,se=Ct(k,pe=>ua(Y[pe.row],pe.column));return k0(O,se,D,N,p_,ce.none,Oe)},dg={generate:O=>{if(!h(O))throw new Error("cases must be an array");if(O.length===0)throw new Error("there must be at least one case");const k=[],D={};return He(O,(N,Y)=>{const se=At(N);if(se.length!==1)throw new Error("one and only one name per case");const pe=se[0],Ee=N[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(!h(Ee))throw new Error("case arguments must be an array");k.push(pe),D[pe]=(...Fe)=>{const rt=Fe.length;if(rt!==Ee.length)throw new Error("Wrong number of arguments to case "+pe+". Expected "+Ee.length+" ("+Ee+"), got "+rt);return{fold:(...dn)=>{if(dn.length!==O.length)throw new Error("Wrong number of arguments to fold. Expected "+O.length+", got "+dn.length);return dn[Y].apply(null,Fe)},match:dn=>{const Xn=At(dn);if(k.length!==Xn.length)throw new Error("Wrong number of arguments to match. Expected: "+k.join(",")+`
|
|
Actual: `+Xn.join(","));if(!Yo(k,sn=>ut(Xn,sn)))throw new Error("Not all branches were specified when using match. Specified: "+Xn.join(", ")+`
|
|
Required: `+k.join(", "));return dn[pe].apply(null,Fe)},log:dn=>{console.log(dn,{constructors:k,constructor:pe,params:Fe})}}}}),D}},hf={...dg.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},cb=(O,k)=>O.length===0?hf.none():O.length===1?hf.only(0):k===0?hf.left(0,1):k===O.length-1?hf.right(k-1,k):k>0&&k<O.length-1?hf.middle(k-1,k,k+1):hf.none(),qs=(O,k,D,N,Y)=>{const se=O.slice(0),pe=cb(O,k),Ee=L(Ct(se,L(0))),Fe=Xn=>N.singleColumnWidth(se[Xn],D),rt=(Xn,Wn)=>Y.calcLeftEdgeDeltas(se,Xn,Wn,D,N.minCellWidth(),N.isRelative),_t=(Xn,Wn,sn)=>Y.calcMiddleDeltas(se,Xn,Wn,sn,D,N.minCellWidth(),N.isRelative),dn=(Xn,Wn)=>Y.calcRightEdgeDeltas(se,Xn,Wn,D,N.minCellWidth(),N.isRelative);return pe.fold(Ee,Fe,rt,_t,dn)},pu=(O,k,D)=>{let N=0;for(let Y=O;Y<k;Y++)N+=D[Y]!==void 0?D[Y]:0;return N},hg=(O,k)=>{const D=Ae.justCells(O);return Ct(D,N=>{const Y=pu(N.column,N.column+N.colspan,k);return{element:N.element,width:Y,colspan:N.colspan}})},Gy=(O,k)=>{const D=Ae.justColumns(O);return Ct(D,(N,Y)=>({element:N.element,width:k[Y],colspan:N.colspan}))},Yi=(O,k)=>{const D=Ae.justCells(O);return Ct(D,N=>{const Y=pu(N.row,N.row+N.rowspan,k);return{element:N.element,height:Y,rowspan:N.rowspan}})},Ky=(O,k)=>Ct(O.all,(D,N)=>({element:D.element,height:k[N]})),mg=O=>Cn(O,(k,D)=>k+D,0),Oa=(O,k)=>Ae.hasColumns(O)?Gy(O,k):hg(O,k),fm=(O,k,D)=>{const N=Oa(O,k);He(N,Y=>{D.setElementWidth(Y.element,Y.width)})},Vt=(O,k,D,N,Y)=>{const se=Ae.fromTable(O),pe=Y.getCellDelta(k),Ee=Y.getWidths(se,Y),Fe=D===se.grid.columns-1,rt=N.clampTableDelta(Ee,D,pe,Y.minCellWidth(),Fe),_t=qs(Ee,D,rt,Y,N),dn=Ct(_t,(Xn,Wn)=>Xn+Ee[Wn]);fm(se,dn,Y),N.resizeTable(Y.adjustTableWidth,rt,Fe)},T0=(O,k,D,N)=>{const Y=Ae.fromTable(O),se=xt(Y,O,N),pe=Ct(se,(_t,dn)=>D===dn?Math.max(k+_t,fc()):_t),Ee=Yi(Y,pe),Fe=Ky(Y,pe);He(Fe,_t=>{of(_t.element,_t.height)}),He(Ee,_t=>{of(_t.element,_t.height)});const rt=mg(pe);of(O,rt)},Jy=(O,k,D,N,Y)=>{const se=Ae.generate(k),pe=N.getWidths(se,N),Ee=N.pixelWidth(),{newSizes:Fe,delta:rt}=Y.calcRedestributedWidths(pe,Ee,D.pixelDelta,N.isRelative);fm(se,Fe,N),N.adjustTableWidth(rt)},E0=(O,k,D,N)=>{const Y=Ae.generate(k),se=N.getWidths(Y,N);fm(Y,se,N)},Ch=O=>je(O,(D,N)=>Qe(D,se=>se.column===N.column)?D:D.concat([N]),[]).sort((D,N)=>D.column-N.column),mf=Lr("col"),ub=Lr("colgroup"),Xv=O=>Wt(O)==="tr"||ub(O),e2=O=>{const k=Pr(O,"colspan",1),D=Pr(O,"rowspan",1);return{element:O,colspan:k,rowspan:D}},jv=(O,k=e2)=>{const D=Ee=>mf(Ee.element)?O.col(Ee):O.cell(Ee),N=Ee=>ub(Ee.element)?O.colgroup(Ee):O.row(Ee),Y=Ee=>{if(Xv(Ee))return N({element:Ee});{const Fe=Ee,rt=D(k(Fe));return se=ce.some({item:Fe,replacement:rt}),rt}};let se=ce.none();return{getOrInit:(Ee,Fe)=>se.fold(()=>Y(Ee),rt=>Fe(Ee,rt.item)?rt.replacement:Y(Ee))}},A0=O=>k=>{const D=[],N=(pe,Ee)=>he(D,Fe=>Ee(Fe.item,pe)),Y=pe=>{const Ee=O==="td"?{scope:null}:{},Fe=k.replace(pe,O,Ee);return D.push({item:pe,sub:Fe}),Fe};return{replaceOrInit:(pe,Ee)=>{if(Xv(pe)||mf(pe))return pe;{const Fe=pe;return N(Fe,Ee).fold(()=>Y(Fe),rt=>Ee(pe,rt.item)?rt.sub:Y(Fe))}}}},kh=O=>Ge(O,"scope").map(k=>k.substr(0,3)),Fu={modification:jv,transform:A0,merging:O=>({unmerge:N=>{const Y=kh(N);return Y.each(se=>Yr(N,"scope",se)),()=>{const se=O.cell({element:N,colspan:1,rowspan:1});return Ec(se,"width"),Ec(N,"width"),Y.each(pe=>Yr(se,"scope",pe)),se}},merge:N=>{const Y=()=>{const se=Ii(Ct(N,kh));if(se.length===0)return ce.none();{const pe=se[0],Ee=["row","col"];return Qe(se,rt=>rt!==pe&&ut(Ee,rt))?ce.none():ce.from(pe)}};return Ec(N[0],"width"),Y().fold(()=>qe(N[0],"scope"),se=>Yr(N[0],"scope",se+"group")),L(N[0])}})},zl=["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"],t2=(O,k)=>{const D=O.property().name(k);return ut(["ol","ul"],D)},hp=(O,k)=>{const D=O.property().name(k);return ut(zl,D)},O_=(O,k)=>ut(["br","img","hr","input"],O.property().name(k)),D0=on(),s1=O=>hp(D0,O),n2=O=>t2(D0,O),qv=O=>O_(D0,O),y_=O=>{const k=Lr("br"),D=Fe=>Yo(Fe,rt=>k(rt)||xo(rt)&&Uo(rt).trim().length===0),N=Fe=>Wt(Fe)==="li"||Gr(Fe,n2).isSome(),Y=Fe=>xu(Fe).map(rt=>s1(rt)?!0:qv(rt)?Wt(rt)!=="img":!1).getOr(!1),se=Fe=>dh(Fe).bind(rt=>{const _t=Y(rt);return Ki(rt).map(dn=>_t===!0||N(dn)||k(rt)||s1(dn)&&!gr(Fe,dn)?[]:[lt.fromTag("br")])}).getOr([]),Ee=(()=>{const Fe=so(O,rt=>{const _t=yr(rt);return D(_t)?[]:_t.concat(se(rt))});return Fe.length===0?[lt.fromTag("br")]:Fe})();ca(O[0]),Za(O[0],Ee)},Gv=O=>og(O,!0),o2=O=>{Ql(O).length===0&&Ji(O)},vl=(O,k)=>({grid:O,cursor:k}),ec=O=>bn(O,k=>bn(k.cells,D=>{const N=D.element;return pa(Gv(N),N)})),Qu=(O,k,D)=>{var N,Y;const se=Pa(O).rows;return ce.from((Y=(N=se[k])===null||N===void 0?void 0:N.cells[D])===null||Y===void 0?void 0:Y.element).filter(Gv).orThunk(()=>ec(se))},Zr=(O,k,D)=>{const N=Qu(O,k,D);return vl(O,N)},tc=O=>je(O,(D,N)=>Qe(D,se=>se.row===N.row)?D:D.concat([N]),[]).sort((D,N)=>D.row-N.row),Vl=(O,k,D,N)=>{const Y=k[0].row,se=tc(k),pe=Cn(se,(Ee,Fe)=>({grid:sa(Ee.grid,Y,Fe.row+Ee.delta,D,N.getOrInit),delta:Ee.delta+1}),{grid:O,delta:0}).grid;return Zr(pe,Y,k[0].column)},dm=(O,k,D,N)=>{const Y=tc(k),se=Y[Y.length-1],pe=se.row+se.rowspan,Ee=Cn(Y,(Fe,rt)=>sa(Fe,pe,rt.row,D,N.getOrInit),O);return Zr(Ee,pe,k[0].column)},Sr=(O,k,D,N)=>{const Y=k.details,se=Ch(Y),pe=se[0].column,Ee=Cn(se,(Fe,rt)=>({grid:ab(Fe.grid,pe,rt.column+Fe.delta,D,N.getOrInit),delta:Fe.delta+1}),{grid:O,delta:0}).grid;return Zr(Ee,Y[0].row,pe)},w_=(O,k,D,N)=>{const Y=k.details,se=Y[Y.length-1],pe=se.column+se.colspan,Ee=Ch(Y),Fe=Cn(Ee,(rt,_t)=>ab(rt,pe,_t.column,D,N.getOrInit),O);return Zr(Fe,Y[0].row,pe)},bu=(O,k,D,N)=>{const Y=Ch(k),se=Ct(Y,Ee=>Ee.column),pe=qy(O,se,!0,D,N.replaceOrInit);return Zr(pe,k[0].row,k[0].column)},Dl=(O,k,D,N)=>{const Y=v_(O,k,D,N.replaceOrInit);return Zr(Y,k[0].row,k[0].column)},s2=(O,k,D,N)=>{const Y=Ch(k),se=Ct(Y,Ee=>Ee.column),pe=qy(O,se,!1,D,N.replaceOrInit);return Zr(pe,k[0].row,k[0].column)},gg=(O,k,D,N)=>{const Y=v_(O,k,D,N.replaceOrInit);return Zr(Y,k[0].row,k[0].column)},bc=(O,k)=>(D,N,Y,se,pe)=>{const Ee=tc(N),Fe=Ct(Ee,_t=>_t.row),rt=n1(D,Fe,O,k,Y,se.replaceOrInit,pe);return Zr(rt,N[0].row,N[0].column)},AE=bc("thead",!0),pg=bc("tbody",!1),ok=bc("tfoot",!1),sk=(O,k,D,N)=>{const Y=Ch(k.details),se=ek(O,Ct(Y,Ee=>Ee.column)),pe=se.length>0?se[0].cells.length-1:0;return Zr(se,Y[0].row,Math.min(Y[0].column,pe))},r2=(O,k,D,N)=>{const Y=tc(k),se=Xy(O,Y[0].row,Y[Y.length-1].row),pe=se.length>0?se.length-1:0;return Zr(se,Math.min(k[0].row,pe),k[0].column)},i2=(O,k,D,N)=>{const Y=k.cells;y_(Y);const se=a_(O,k.bounds,D,N.merge(Y));return vl(se,ce.from(Y[0]))},hm=(O,k,D,N)=>{const se=Cn(k,(pe,Ee)=>Vy(pe,Ee,D,N.unmerge(Ee)),O);return vl(se,ce.from(k[0]))},a2=(O,k,D,N)=>{const se=((Fe,rt)=>{const _t=Ae.fromTable(Fe);return Xc(_t,rt,!0)})(k.clipboard,k.generators),pe=Tf(k.row,k.column);return Jp(pe,O,se,k.generators,D).fold(()=>vl(O,ce.some(k.element)),Fe=>Zr(Fe,k.row,k.column))},r1=(O,k,D)=>{const N=Gh(O,D.section),Y=Ae.generate(N);return Xc(Y,k,!0)},Ol=(O,k,D,N)=>{const Y=Pa(O).rows,se=k.cells[0].column,pe=Y[k.cells[0].row],Ee=r1(k.clipboard,k.generators,pe),Fe=e1(se,O,Ee,k.generators,D);return Zr(Fe,k.cells[0].row,k.cells[0].column)},Pl=(O,k,D,N)=>{const Y=Pa(O).rows,se=k.cells[k.cells.length-1].column+k.cells[k.cells.length-1].colspan,pe=Y[k.cells[0].row],Ee=r1(k.clipboard,k.generators,pe),Fe=e1(se,O,Ee,k.generators,D);return Zr(Fe,k.cells[0].row,k.cells[0].column)},Tn=(O,k,D,N)=>{const Y=Pa(O).rows,se=k.cells[0].row,pe=Y[se],Ee=r1(k.clipboard,k.generators,pe),Fe=fg(se,O,Ee,k.generators,D);return Zr(Fe,k.cells[0].row,k.cells[0].column)},rk=(O,k,D,N)=>{const Y=Pa(O).rows,se=k.cells[k.cells.length-1].row+k.cells[k.cells.length-1].rowspan,pe=Y[k.cells[0].row],Ee=r1(k.clipboard,k.generators,pe),Fe=fg(se,O,Ee,k.generators,D);return Zr(Fe,k.cells[0].row,k.cells[0].column)},nc=(O,k)=>{const D=Ae.fromTable(O);return ad(D,k).bind(Y=>{const se=Y[Y.length-1],pe=Y[0].column,Ee=se.column+se.colspan,Fe=Kn(Ct(D.all,rt=>Et(rt.cells,_t=>_t.column>=pe&&_t.column<Ee)));return Fy(Fe)}).getOr("")},ik=(O,k)=>{const D=Ae.fromTable(O);return ad(D,k).bind(Fy).getOr("")},l2=(O,k)=>{const D=Ae.fromTable(O);return ad(D,k).bind(Y=>{const se=Y[Y.length-1],pe=Y[0].row,Ee=se.row+se.rowspan,Fe=D.all.slice(pe,Ee);return r_(Fe)}).getOr("")},no=(O,k,D,N)=>E0(O,k,D,N.sizing),Pc=(O,k,D,N)=>Jy(O,k,D,N.sizing,N.resize),c2=(O,k)=>Qe(k,D=>D.column===0&&D.isLocked),fb=(O,k)=>Qe(k,D=>D.column+D.colspan>=O.grid.columns&&D.isLocked),gf=(O,k)=>{const D=Mf(O),N=Ch(k);return je(N,(Y,se)=>{const Ee=D[se.column].map(at).getOr(0);return Y+Ee},0)},Kv=O=>(k,D)=>ad(k,D).filter(N=>!(O?c2:fb)(k,N)).map(N=>({details:N,pixelDelta:gf(k,N)})),i1=(O,k)=>ff(O,k).map(D=>({details:D,pixelDelta:-gf(O,D)})),Qf=O=>(k,D)=>Sh(k,D).filter(N=>!(O?c2:fb)(k,N.cells)),al=Fu.transform("th"),Qd=Fu.transform("td"),Zd=Ta(Vl,ad,F,F,Fu.modification),jc=Ta(dm,ad,F,F,Fu.modification),db=Ta(Sr,Kv(!0),Pc,F,Fu.modification),u2=Ta(w_,Kv(!1),Pc,F,Fu.modification),__=Ta(sk,i1,Pc,o2,Fu.modification),f2=Ta(r2,ad,F,o2,Fu.modification),xh=Ta(bu,ff,F,F,al),jr=Ta(s2,ff,F,F,Qd),Jv=Ta(AE,ff,F,F,al),ud=Ta(pg,ff,F,F,Qd),S_=Ta(ok,ff,F,F,Qd),C_=Ta(Dl,ff,F,F,al),fa=Ta(gg,ff,F,F,Qd),ak=Ta(i2,S0,no,F,Fu.merging),eO=Ta(hm,C0,no,F,Fu.merging),tO=Ta(a2,KC,no,F,Fu.modification),k_=Ta(Ol,Qf(!0),F,F,Fu.modification),lk=Ta(Pl,Qf(!1),F,F,Fu.modification),hb=Ta(Tn,Sh,F,F,Fu.modification),x_=Ta(rk,Sh,F,F,Fu.modification),ck=nc,T_=ik,uk=l2,E_=(O,k)=>O.dispatch("NewRow",{node:k}),nO=(O,k)=>O.dispatch("NewCell",{node:k}),mp=(O,k,D)=>{O.dispatch("TableModified",{...D,table:k})},mb=(O,k,D,N,Y)=>{O.dispatch("TableSelectionChange",{cells:k,start:D,finish:N,otherCells:Y})},Xi=O=>{O.dispatch("TableSelectionClear")},d2=(O,k,D,N,Y)=>{O.dispatch("ObjectResizeStart",{target:k,width:D,height:N,origin:Y})},Mc=(O,k,D,N,Y)=>{O.dispatch("ObjectResized",{target:k,width:D,height:N,origin:Y})},gb={structure:!1,style:!0},ll={structure:!0,style:!1},A_={structure:!0,style:!0},mm=(O,k)=>$d(O)?lu.percentageSize(k):tg(O)?lu.pixelSize(k):lu.getTableSize(k),fk=(O,k,D)=>{const N=Uu=>Wt(Bf(Uu))==="table",Y=Uu=>!N(O)||By(Uu).rows>1,se=Uu=>!N(O)||By(Uu).columns>1,pe=sm(O),Ee=Ra(O)?F:Yc,Fe=Uu=>{switch(Jg(O)){case"section":return Ga.section();case"sectionCells":return Ga.sectionCells();case"cells":return Ga.cells();default:return Ga.getTableSectionType(Uu,"section")}},rt=(Uu,z2)=>z2.cursor.fold(()=>{const V2=Ql(Uu);return Ne(V2).filter(zi).map(wg=>{D.clearSelectedCells(Uu.dom);const vc=O.dom.createRng();return vc.selectNode(wg.dom),O.selection.setRng(vc),Yr(wg,"data-mce-selected","1"),vc})},V2=>{const wg=p0(V2),vc=O.dom.createRng();return vc.setStart(wg.element.dom,wg.offset),vc.setEnd(wg.element.dom,wg.offset),O.selection.setRng(vc),D.clearSelectedCells(Uu.dom),ce.some(vc)}),_t=(Uu,z2,V2,wg)=>(vc,mx,r3=!1)=>{gh(vc);const i3=lt.fromDom(O.getDoc()),a3=Ma(V2,i3,pe),ZP={sizing:mm(O,vc),resize:Ra(O)?s_():Gp(),section:Fe(vc)};return z2(vc)?Uu(vc,mx,a3,ZP).bind(gx=>{k.refresh(vc.dom),He(gx.newRows,W2=>{E_(O,W2.dom)}),He(gx.newCells,W2=>{nO(O,W2.dom)});const HP=rt(vc,gx);return zi(vc)&&(gh(vc),r3||mp(O,vc.dom,wg)),HP.map(W2=>({rng:W2,effect:wg}))}):ce.none()},dn=_t(f2,Y,F,ll),Xn=_t(__,se,F,ll),Wn=_t(Zd,Oe,F,ll),sn=_t(jc,Oe,F,ll),Un=_t(db,Oe,Ee,ll),tn=_t(u2,Oe,Ee,ll),Oo=_t(ak,Oe,F,ll),cs=_t(eO,Oe,F,ll),Ds=_t(k_,Oe,F,ll),da=_t(lk,Oe,F,ll),Rl=_t(hb,Oe,F,ll),wl=_t(x_,Oe,F,ll),Vu=_t(tO,Oe,F,A_),Y0=_t(C_,Oe,F,ll),H2=_t(fa,Oe,F,ll),gS=_t(xh,Oe,F,ll),pS=_t(jr,Oe,F,ll),xi=_t(Jv,Oe,F,ll),Wu=_t(ud,Oe,F,ll),vf=_t(S_,Oe,F,ll);return{deleteRow:dn,deleteColumn:Xn,insertRowsBefore:Wn,insertRowsAfter:sn,insertColumnsBefore:Un,insertColumnsAfter:tn,mergeCells:Oo,unmergeCells:cs,pasteColsBefore:Ds,pasteColsAfter:da,pasteRowsBefore:Rl,pasteRowsAfter:wl,pasteCells:Vu,makeCellsHeader:Y0,unmakeCellsHeader:H2,makeColumnsHeader:gS,unmakeColumnsHeader:pS,makeRowsHeader:xi,makeRowsBody:Wu,makeRowsFooter:vf,getTableRowType:uk,getTableCellType:T_,getTableColType:ck}},oc=(O,k,D)=>{const N=Pr(O,k,1);D===1||N<=1?qe(O,k):Yr(O,k,Math.min(D,N))},pf=(O,k)=>D=>{const N=D.column+D.colspan-1,Y=D.column;return N>=O&&Y<k},P0=(O,k,D)=>{if(Ae.hasColumns(O)){const N=Et(Ae.justColumns(O),pf(k,D)),Y=Ct(N,pe=>{const Ee=Zc(pe.element);return oc(Ee,"span",D-k),Ee}),se=lt.fromTag("colgroup");return Za(se,Y),[se]}else return[]},dk=(O,k,D)=>Ct(O.all,N=>{const Y=Et(N.cells,pf(k,D)),se=Ct(Y,Ee=>{const Fe=Zc(Ee.element);return oc(Fe,"colspan",D-k),Fe}),pe=lt.fromTag("tr");return Za(pe,se),pe}),hk=(O,k)=>{const D=Ae.fromTable(O);return ff(D,k).map(Y=>{const se=Y[Y.length-1],pe=Y[0].column,Ee=se.column+se.colspan,Fe=P0(D,pe,Ee),rt=dk(D,pe,Ee);return[...Fe,...rt]})},D_=(O,k,D)=>{const N=Ae.fromTable(O);return ad(N,k).bind(se=>{const pe=Xc(N,D,!1),Fe=Pa(pe).rows.slice(se[0].row,se[se.length-1].row+se[se.length-1].rowspan),rt=so(Fe,dn=>{const Xn=Et(dn.cells,Wn=>!Wn.isLocked);return Xn.length>0?[{...dn,cells:Xn}]:[]}),_t=zy(rt);return pa(_t.length>0,_t)}).map(se=>Hy(se))},M0=dg.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),P_=(O,k,D)=>{const N=D.substring(0,D.length-O.length),Y=parseFloat(N);return N===Y.toString()?k(Y):M0.invalid(D)},gp={...M0,from:O=>Ku(O,"%")?P_("%",M0.percent,O):Ku(O,"px")?P_("px",M0.pixels,O):M0.invalid(O)},mk=(O,k)=>Ct(O,D=>gp.from(D).fold(()=>D,Y=>Y/k*100+"%",Y=>Y+"%")),gk=(O,k,D)=>{const N=D/k;return Ct(O,Y=>gp.from(Y).fold(()=>Y,pe=>pe*N+"px",pe=>pe/100*D+"px"))},pk=(O,k)=>{const D=O.fold(()=>L(""),N=>{const Y=N/k;return L(Y+"px")},()=>{const N=100/k;return L(N+"%")});return Bt(k,D)},h2=(O,k,D)=>O.fold(()=>k,N=>gk(k,D,N),N=>mk(k,D)),oO=(O,k,D)=>{const N=gp.from(D),Y=Yo(O,se=>se==="0px")?pk(N,O.length):h2(N,O,k);return sO(Y)},bg=(O,k)=>O.length===0?k:Cn(O,(D,N)=>gp.from(N).fold(L(0),te,te)+D,0),R_=(O,k)=>{const D=Math.floor(O);return{value:D+k,remainder:O-D}},$_=(O,k)=>gp.from(O).fold(L(O),D=>D+k+"px",D=>D+k+"%"),sO=O=>{if(O.length===0)return O;const k=Cn(O,(N,Y)=>{const se=gp.from(Y).fold(()=>({value:Y,remainder:0}),pe=>R_(pe,"px"),pe=>({value:pe+"%",remainder:0}));return{output:[se.value].concat(N.output),remainder:N.remainder+se.remainder}},{output:[],remainder:0}),D=k.output;return D.slice(0,D.length-1).concat([$_(D[D.length-1],Math.round(k.remainder))])},pb=gp.from,vg=(O,k,D)=>{He(k,N=>{const Y=O.slice(N.column,N.colspan+N.column),se=bg(Y,Vi());Mi(N.element,"width",se+D)})},rO=(O,k,D)=>{He(k,(N,Y)=>{const se=bg([O[Y]],Vi());Mi(N.element,"width",se+D)})},iO=(O,k,D,N)=>{He(D,Y=>{const se=O.slice(Y.row,Y.rowspan+Y.row),pe=bg(se,fc());Mi(Y.element,"height",pe+N)}),He(k,(Y,se)=>{Mi(Y.element,"height",O[se])})},R0=O=>pb(O).fold(L("px"),L("px"),L("%")),N_=(O,k,D)=>{const N=Ae.fromTable(O),Y=N.all,se=Ae.justCells(N),pe=Ae.justColumns(N);k.each(Ee=>{const Fe=R0(Ee),rt=Je(O),_t=jm(N,O),dn=oO(_t,rt,Ee);Ae.hasColumns(N)?rO(dn,pe,Fe):vg(dn,se,Fe),Mi(O,"width",Ee)}),D.each(Ee=>{const Fe=R0(Ee),rt=td(O),_t=Dc(N,O,Jn),dn=oO(_t,rt,Ee);iO(dn,Y,se,Fe),Mi(O,"height",Ee)})},Th=Ua,$0=Gg,I_=Wc,Eh=O=>{qe(O,"width")},pp=O=>{const k=xa(O);N_(O,ce.some(k),ce.none()),Eh(O)},m2=O=>{const k=a0(O);N_(O,ce.some(k),ce.none()),Eh(O)},B_=O=>{Ec(O,"width");const k=zm(O),D=k.length>0?k:Ql(O);He(D,N=>{Ec(N,"width"),Eh(N)}),Eh(O)},aO={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},bk=()=>lt.fromTag("th"),L_=()=>lt.fromTag("td"),vk=()=>lt.fromTag("col"),Ok=(O,k,D,N)=>{const Y=lt.fromTag("tr");for(let se=0;se<O;se++){const pe=N<k||se<D?bk():L_();se<D&&Yr(pe,"scope","row"),N<k&&Yr(pe,"scope","col"),Dr(pe,lt.fromTag("br")),Dr(Y,pe)}return Y},F_=O=>{const k=lt.fromTag("colgroup");return Bt(O,()=>Dr(k,vk())),k},Q_=(O,k,D,N)=>Bt(O,Y=>Ok(k,D,N,Y)),Z_=(O,k,D,N,Y,se=aO)=>{const pe=lt.fromTag("table"),Ee=Y!=="cells";kl(pe,se.styles),Zi(pe,se.attributes),se.colGroups&&Dr(pe,F_(k));const Fe=Math.min(O,D);if(Ee&&D>0){const Wn=lt.fromTag("thead");Dr(pe,Wn);const Un=Q_(D,k,Y==="sectionCells"?Fe:0,N);Za(Wn,Un)}const rt=lt.fromTag("tbody");Dr(pe,rt);const _t=Ee?O-Fe:O,Xn=Q_(_t,k,Ee?0:D,N);return Za(rt,Xn),pe},yk=O=>O.dom.innerHTML,wk=O=>{const k=lt.fromTag("div"),D=lt.fromDom(O.dom.cloneNode(!0));return Dr(k,D),yk(k)},_k=(O,k)=>{O.selection.select(k.dom,!0),O.selection.collapse(!0)},H_=(O,k)=>{ru(k,"td,th").each(oe(_k,O))},g2=(O,k)=>{He(yi(k,"tr"),D=>{E_(O,D.dom),He(yi(D,"th,td"),N=>{nO(O,N.dom)})})},p2=O=>u(O)&&O.indexOf("%")!==-1,Sk=(O,k,D,N,Y)=>{const se=e_(O),pe={styles:se,attributes:tb(O),colGroups:$a(O)};return O.undoManager.ignore(()=>{const Ee=Z_(D,k,Y,N,Jg(O),pe);Yr(Ee,"data-mce-id","__mce");const Fe=wk(Ee);O.insertContent(Fe),O.addVisual()}),ru(Bf(O),'table[data-mce-id="__mce"]').map(Ee=>(tg(O)?m2(Ee):ng(O)?B_(Ee):($d(O)||p2(se.width))&&pp(Ee),gh(Ee),qe(Ee,"data-mce-id"),g2(O,Ee),H_(O,Ee),Ee.dom)).getOrNull()},Ck=(O,k,D,N={})=>{const Y=se=>Q(se)&&se>0;if(Y(k)&&Y(D)){const se=N.headerRows||0,pe=N.headerColumns||0;return Sk(O,D,k,pe,se)}else return console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table."),null};var lO=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const z_="x-tinymce/dom-table-",cO=z_+"rows",N0=z_+"columns",bb=O=>{const k=lO.FakeClipboardItem(O);lO.write([k])},uO=O=>{var k;const D=(k=lO.read())!==null&&k!==void 0?k:[];return bn(D,N=>ce.from(N.getType(O)))},b2=O=>{uO(O).isSome()&&lO.clear()},V_=O=>{O.fold(kk,k=>bb({[cO]:k}))},v2=()=>uO(cO),kk=()=>b2(cO),fO=O=>{O.fold(xk,k=>bb({[N0]:k}))},I0=()=>uO(N0),xk=()=>b2(N0),dO=O=>Ry(Lu(O),sg(O)).filter(ph),bf=O=>qp(Lu(O),sg(O)).filter(ph),hO=(O,k)=>{const D=sg(O),N=()=>dO(O).each(tn=>{rl(tn,D).filter(G(D)).each(Oo=>{const cs=lt.fromText("");if(Yl(Oo,cs),Ji(Oo),O.dom.isEmpty(O.getBody()))O.setContent(""),O.selection.setCursorLocation();else{const Ds=O.dom.createRng();Ds.setStart(cs.dom,0),Ds.setEnd(cs.dom,0),O.selection.setRng(Ds),O.nodeChanged()}})}),Y=tn=>dO(O).each(Oo=>{ng(O)||tg(O)||$d(O)||rl(Oo,D).each(Ds=>{tn==="relative"&&!Th(Ds)?pp(Ds):tn==="fixed"&&!$0(Ds)?m2(Ds):tn==="responsive"&&!I_(Ds)&&B_(Ds),gh(Ds),mp(O,Ds.dom,ll)})}),se=tn=>rl(tn,D),pe=tn=>bf(O).bind(Oo=>se(Oo).map(cs=>tn(cs,Oo))),Ee=(tn,Oo)=>{pe(cs=>{O.formatter.toggle("tableclass",{value:Oo},cs.dom),mp(O,cs.dom,gb)})},Fe=(tn,Oo)=>{pe(cs=>{const Ds=rd(O),Rl=Yo(Ds,wl=>O.formatter.match("tablecellclass",{value:Oo},wl.dom))?O.formatter.remove:O.formatter.apply;He(Ds,wl=>Rl("tablecellclass",{value:Oo},wl.dom)),mp(O,cs.dom,gb)})},rt=()=>{dO(O).each(tn=>{rl(tn,D).each(Oo=>{ks(Oo,"caption").fold(()=>{const cs=lt.fromTag("caption");Dr(cs,lt.fromText("Caption")),Qm(Oo,cs,0),O.selection.setCursorLocation(cs.dom,0)},cs=>{Lr("caption")(tn)&&ma("td",Oo).each(Ds=>O.selection.setCursorLocation(Ds.dom,0)),Ji(cs)}),mp(O,Oo.dom,ll)})})},_t=tn=>{O.focus()},dn=(tn,Oo=!1)=>pe((cs,Ds)=>{const da=rp(rd(O),cs,Ds);tn(cs,da,Oo).each(_t)}),Xn=()=>pe((tn,Oo)=>{const cs=rp(rd(O),tn,Oo),Ds=Ma(F,lt.fromDom(O.getDoc()),ce.none());return D_(tn,cs,Ds)}),Wn=()=>pe((tn,Oo)=>{const cs=rp(rd(O),tn,Oo);return hk(tn,cs)}),sn=(tn,Oo)=>Oo().each(cs=>{const Ds=Ct(cs,da=>Zc(da));pe((da,Rl)=>{const wl=gc(lt.fromDom(O.getDoc())),Vu=g0(rd(O),Rl,Ds,wl);tn(da,Vu).each(_t)})}),Un=tn=>(Oo,cs)=>wa(cs,"type").each(Ds=>{dn(tn(Ds),cs.no_events)});zn({mceTableSplitCells:()=>dn(k.unmergeCells),mceTableMergeCells:()=>dn(k.mergeCells),mceTableInsertRowBefore:()=>dn(k.insertRowsBefore),mceTableInsertRowAfter:()=>dn(k.insertRowsAfter),mceTableInsertColBefore:()=>dn(k.insertColumnsBefore),mceTableInsertColAfter:()=>dn(k.insertColumnsAfter),mceTableDeleteCol:()=>dn(k.deleteColumn),mceTableDeleteRow:()=>dn(k.deleteRow),mceTableCutCol:()=>Wn().each(tn=>{fO(tn),dn(k.deleteColumn)}),mceTableCutRow:()=>Xn().each(tn=>{V_(tn),dn(k.deleteRow)}),mceTableCopyCol:()=>Wn().each(tn=>fO(tn)),mceTableCopyRow:()=>Xn().each(tn=>V_(tn)),mceTablePasteColBefore:()=>sn(k.pasteColsBefore,I0),mceTablePasteColAfter:()=>sn(k.pasteColsAfter,I0),mceTablePasteRowBefore:()=>sn(k.pasteRowsBefore,v2),mceTablePasteRowAfter:()=>sn(k.pasteRowsAfter,v2),mceTableDelete:N,mceTableCellToggleClass:Fe,mceTableToggleClass:Ee,mceTableToggleCaption:rt,mceTableSizingMode:(tn,Oo)=>Y(Oo),mceTableCellType:Un(tn=>tn==="th"?k.makeCellsHeader:k.unmakeCellsHeader),mceTableColType:Un(tn=>tn==="th"?k.makeColumnsHeader:k.unmakeColumnsHeader),mceTableRowType:Un(tn=>{switch(tn){case"header":return k.makeRowsHeader;case"footer":return k.makeRowsFooter;default:return k.makeRowsBody}})},(tn,Oo)=>O.addCommand(Oo,tn)),O.addCommand("mceInsertTable",(tn,Oo)=>{Ck(O,Oo.rows,Oo.columns,Oo.options)}),O.addCommand("mceTableApplyCellStyle",(tn,Oo)=>{const cs=Rl=>"tablecell"+Rl.toLowerCase().replace("-","");if(!d(Oo))return;const Ds=Et(rd(O),ph);if(Ds.length===0)return;const da=$s(Oo,(Rl,wl)=>O.formatter.has(cs(wl))&&u(Rl));qr(da)||(zn(da,(Rl,wl)=>{const Vu=cs(wl);He(Ds,Y0=>{Rl===""?O.formatter.remove(Vu,{value:null},Y0.dom,!0):O.formatter.apply(Vu,{value:Rl},Y0.dom)})}),se(Ds[0]).each(Rl=>mp(O,Rl.dom,gb)))})},W_=(O,k)=>{const D=sg(O),N=Y=>qp(Lu(O)).bind(se=>rl(se,D).map(pe=>{const Ee=rp(rd(O),pe,se);return Y(pe,Ee)})).getOr("");zn({mceTableRowType:()=>N(k.getTableRowType),mceTableCellType:()=>N(k.getTableCellType),mceTableColType:()=>N(k.getTableColType)},(Y,se)=>O.addQueryValueHandler(se,Y))},mO=dg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Tk=(O,k,D,N)=>O.fold(k,D,N),B0=O=>O.fold(te,te,te),O2=mO.before,Ek=mO.on,gO=mO.after,yl={before:O2,on:Ek,after:gO,cata:Tk,getStart:B0},vb={create:(O,k)=>({selection:O,kill:k})},Dk=(O,k)=>{const D=O.document.createRange();return D.selectNode(k.dom),D},Ob=(O,k)=>{const D=O.document.createRange();return y2(D,k),D},y2=(O,k)=>O.selectNodeContents(k.dom),Pk=(O,k)=>{k.fold(D=>{O.setStartBefore(D.dom)},(D,N)=>{O.setStart(D.dom,N)},D=>{O.setStartAfter(D.dom)})},Mk=(O,k)=>{k.fold(D=>{O.setEndBefore(D.dom)},(D,N)=>{O.setEnd(D.dom,N)},D=>{O.setEndAfter(D.dom)})},L0=(O,k,D)=>{const N=O.document.createRange();return Pk(N,k),Mk(N,D),N},gm=(O,k,D,N,Y)=>{const se=O.document.createRange();return se.setStart(k.dom,D),se.setEnd(N.dom,Y),se},yb=O=>({left:O.left,top:O.top,right:O.right,bottom:O.bottom,width:O.width,height:O.height}),vu=O=>{const k=O.getClientRects(),D=k.length>0?k[0]:O.getBoundingClientRect();return D.width>0||D.height>0?ce.some(D).map(yb):ce.none()},a1=dg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),U_=(O,k,D)=>k(lt.fromDom(D.startContainer),D.startOffset,lt.fromDom(D.endContainer),D.endOffset),Y_=(O,k)=>k.match({domRange:D=>({ltr:L(D),rtl:ce.none}),relative:(D,N)=>({ltr:Pf(()=>L0(O,D,N)),rtl:Pf(()=>ce.some(L0(O,N,D)))}),exact:(D,N,Y,se)=>({ltr:Pf(()=>gm(O,D,N,Y,se)),rtl:Pf(()=>ce.some(gm(O,Y,se,D,N)))})}),w2=(O,k)=>{const D=k.ltr();return D.collapsed?k.rtl().filter(Y=>Y.collapsed===!1).map(Y=>a1.rtl(lt.fromDom(Y.endContainer),Y.endOffset,lt.fromDom(Y.startContainer),Y.startOffset)).getOrThunk(()=>U_(O,a1.ltr,D)):U_(O,a1.ltr,D)},_2=(O,k)=>{const D=Y_(O,k);return w2(O,D)},S2=(O,k)=>_2(O,k).match({ltr:(N,Y,se,pe)=>{const Ee=O.document.createRange();return Ee.setStart(N.dom,Y),Ee.setEnd(se.dom,pe),Ee},rtl:(N,Y,se,pe)=>{const Ee=O.document.createRange();return Ee.setStart(se.dom,pe),Ee.setEnd(N.dom,Y),Ee}});a1.ltr,a1.rtl;const F0={create:(O,k,D,N)=>({start:O,soffset:k,finish:D,foffset:N})},bp={create:(O,k,D,N)=>({start:yl.on(O,k),finish:yl.on(D,N)})},Q0=(O,k)=>{const D=S2(O,k);return F0.create(lt.fromDom(D.startContainer),D.startOffset,lt.fromDom(D.endContainer),D.endOffset)},Ah=bp.create,$k=(O,k,D,N,Y,se,pe)=>gr(D,Y)&&N===se?ce.none():Pi(D,"td,th",k).bind(Ee=>Pi(Y,"td,th",k).bind(Fe=>pm(O,k,Ee,Fe,pe))),pm=(O,k,D,N,Y)=>gr(D,N)?ce.none():hu(D,N,k).bind(se=>{const pe=se.boxes.getOr([]);return pe.length>1?(Y(O,pe,se.start,se.finish),ce.some(vb.create(ce.some(Ah(D,0,D,sr(D))),!0))):ce.none()}),Hd=(O,k,D,N,Y)=>{const se=pe=>(Y.clearBeforeUpdate(D),Y.selectRange(D,pe.boxes,pe.start,pe.finish),pe.boxes);return YC(N,O,k,Y.firstSelectedSelector,Y.lastSelectedSelector).map(se)},wb=(O,k)=>({item:O,mode:k}),C2=(O,k,D,N=_b)=>O.property().parent(k).map(Y=>wb(Y,N)),_b=(O,k,D,N=Og)=>D.sibling(O,k).map(Y=>wb(Y,N)),Og=(O,k,D,N=Og)=>{const Y=O.property().children(k);return D.first(Y).map(pe=>wb(pe,N))},S=[{current:C2,next:_b,fallback:ce.none()},{current:_b,next:Og,fallback:ce.some(C2)},{current:Og,next:Og,fallback:ce.some(_b)}],A=(O,k,D,N,Y=S)=>he(Y,pe=>pe.current===D).bind(pe=>pe.current(O,k,N,pe.next).orThunk(()=>pe.fallback.bind(Ee=>A(O,k,Ee,N)))),Ce={left:()=>({sibling:(D,N)=>D.query().prevSibling(N),first:D=>D.length>0?ce.some(D[D.length-1]):ce.none()}),right:()=>({sibling:(D,N)=>D.query().nextSibling(N),first:D=>D.length>0?ce.some(D[0]):ce.none()})},We=(O,k,D,N,Y,se)=>A(O,k,N,Y).bind(Ee=>se(Ee.item)?ce.none():D(Ee.item)?ce.some(Ee.item):We(O,Ee.item,D,Ee.mode,Y,se)),ht=(O,k,D,N)=>We(O,k,D,_b,Ce.left(),N),St=(O,k,D,N)=>We(O,k,D,_b,Ce.right(),N),zt=O=>k=>O.property().children(k).length===0,vn=(O,k,D)=>Vn(O,k,zt(O),D),Zn=(O,k,D)=>Fo(O,k,zt(O),D),Vn=ht,Fo=St,ms=on(),Is=(O,k)=>vn(ms,O,k),Hr=(O,k)=>Zn(ms,O,k),Zs=(O,k,D)=>Vn(ms,O,k,D),gi=(O,k,D)=>Fo(ms,O,k,D),ki=(O,k,D)=>Gr(O,k,D).isSome(),Ou=dg.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Zu=(O,k,D)=>{const N=O.getRect(k),Y=O.getRect(D);return Y.right>N.left&&Y.left<N.right},Zf=O=>Pi(O,"tr"),fd={...Ou,verify:(O,k,D,N,Y,se,pe)=>Pi(N,"td,th",pe).bind(Ee=>Pi(k,"td,th",pe).map(Fe=>gr(Ee,Fe)?gr(N,Ee)&&sr(Ee)===Y?se(Fe):Ou.none("in same cell"):Ci(Zf,[Ee,Fe]).fold(()=>Zu(O,Fe,Ee)?Ou.success():se(Fe),rt=>se(Fe)))).getOr(Ou.none("default")),cata:(O,k,D,N,Y)=>O.fold(k,D,N,Y)},k2=(O,k,D,N)=>({parent:O,children:k,element:D,index:N}),yu=O=>Ki(O).bind(k=>{const D=yr(k);return X_(D,O).map(N=>k2(k,D,O,N))}),X_=(O,k)=>Zo(O,oe(gr,k)),Z0=Lr("br"),H0=(O,k,D)=>k(O,D).bind(N=>xo(N)&&Uo(N).trim().length===0?H0(N,k,D):ce.some(N)),zd=(O,k,D)=>D.traverse(k).orThunk(()=>H0(k,D.gather,O)).map(D.relative),Sb=(O,k)=>ol(O,k).filter(Z0).orThunk(()=>ol(O,k-1).filter(Z0)),Nk=(O,k,D,N)=>Sb(k,D).bind(Y=>N.traverse(Y).fold(()=>H0(Y,N.gather,O).map(N.relative),se=>yu(se).map(pe=>yl.on(pe.parent,pe.index)))),bO=(O,k,D,N)=>(Z0(k)?zd(O,k,N):Nk(O,k,D,N)).map(se=>({start:se,finish:se})),Hf=O=>fd.cata(O,k=>ce.none(),()=>ce.none(),k=>ce.some(ap(k,0)),k=>ce.some(ap(k,sr(k)))),Hu=(O,k)=>({left:O.left,top:O.top+k,right:O.right,bottom:O.bottom+k}),cl=(O,k)=>({left:O.left,top:O.top-k,right:O.right,bottom:O.bottom-k}),Vd=(O,k,D)=>({left:O.left+k,top:O.top+D,right:O.right+k,bottom:O.bottom+D}),j_=O=>O.top,qc=O=>O.bottom,Cb=(O,k,D)=>D>=0&&D<sr(k)?O.getRangedRect(k,D,k,D+1):D>0?O.getRangedRect(k,D-1,k,D):ce.none(),vO=O=>({left:O.left,top:O.top,right:O.right,bottom:O.bottom}),x2=(O,k)=>ce.some(O.getRect(k)),Ik=(O,k,D)=>os(k)?x2(O,k).map(vO):xo(k)?Cb(O,k,D).map(vO):ce.none(),Bk=(O,k)=>os(k)?x2(O,k).map(vO):xo(k)?O.getRangedRect(k,0,k,sr(k)).map(vO):ce.none(),l1=5,T2=100,yg=dg.generate([{none:[]},{retry:["caret"]}]),rP=(O,k)=>O.left<k.left||Math.abs(k.right-O.left)<1||O.left>k.right,Lk=(O,k,D)=>Ll(k,s1).fold(Re,N=>Bk(O,N).exists(Y=>rP(D,Y))),DE=(O,k,D,N,Y)=>{const se=Hu(Y,l1);return Math.abs(D.bottom-N.bottom)<1||D.top>Y.bottom?yg.retry(se):D.top===Y.bottom?yg.retry(Hu(Y,1)):Lk(O,k,Y)?yg.retry(Vd(se,l1,0)):yg.none()},PE={point:j_,adjuster:(O,k,D,N,Y)=>{const se=cl(Y,l1);return Math.abs(D.top-N.top)<1||D.bottom<Y.top?yg.retry(se):D.bottom===Y.top?yg.retry(cl(Y,1)):Lk(O,k,Y)?yg.retry(Vd(se,l1,0)):yg.none()},move:cl,gather:Is},ME={point:qc,adjuster:DE,move:Hu,gather:Hr},Fk=(O,k,D)=>O.elementFromPoint(k,D).filter(N=>Wt(N)==="table").isSome(),Qk=(O,k,D,N,Y)=>Zk(O,k,D,k.move(N,l1),Y),Zk=(O,k,D,N,Y)=>Y===0?ce.some(N):Fk(O,N.left,k.point(N))?Qk(O,k,D,N,Y-1):O.situsFromPoint(N.left,k.point(N)).bind(se=>se.start.fold(ce.none,pe=>Bk(O,pe).bind(Ee=>k.adjuster(O,pe,Ee,D,N).fold(ce.none,Fe=>Zk(O,k,D,Fe,Y-1))).orThunk(()=>ce.some(N)),ce.none)),RE=(O,k,D)=>O.point(k)>D.getInnerHeight()?ce.some(O.point(k)-D.getInnerHeight()):O.point(k)<0?ce.some(-O.point(k)):ce.none(),$E=(O,k,D)=>{const N=O.move(D,l1),Y=Zk(k,O,D,N,T2).getOr(N);return RE(O,Y,k).fold(()=>k.situsFromPoint(Y.left,O.point(Y)),se=>(k.scrollBy(0,se),k.situsFromPoint(Y.left,O.point(Y)-se)))},NE={tryUp:oe($E,PE),tryDown:oe($E,ME),getJumpSize:L(l1)},iP=20,aP=(O,k,D)=>O.getSelection().bind(N=>bO(k,N.finish,N.foffset,D).fold(()=>ce.some(ap(N.finish,N.foffset)),Y=>{const se=O.fromSitus(Y),pe=fd.verify(O,N.finish,N.foffset,se.finish,se.foffset,D.failure,k);return Hf(pe)})),Wd=(O,k,D,N,Y,se)=>se===0?ce.none():Dh(O,k,D,N,Y).bind(pe=>{const Ee=O.fromSitus(pe),Fe=fd.verify(O,D,N,Ee.finish,Ee.foffset,Y.failure,k);return fd.cata(Fe,()=>ce.none(),()=>ce.some(pe),rt=>gr(D,rt)&&N===0?lP(O,D,N,cl,Y):Wd(O,k,rt,0,Y,se-1),rt=>gr(D,rt)&&N===sr(rt)?lP(O,D,N,Hu,Y):Wd(O,k,rt,sr(rt),Y,se-1))}),lP=(O,k,D,N,Y)=>Ik(O,k,D).bind(se=>Gs(O,Y,N(se,NE.getJumpSize()))),Gs=(O,k,D)=>{const N=tm().browser;return N.isChromium()||N.isSafari()||N.isFirefox()?k.retry(O,D):ce.none()},Dh=(O,k,D,N,Y)=>Ik(O,D,N).bind(se=>Gs(O,Y,se)),kb=(O,k,D)=>aP(O,k,D).bind(N=>Wd(O,k,N.element,N.offset,D,iP).map(O.fromSitus)),Hk=(O,k)=>ki(O,D=>Ki(D).exists(N=>gr(N,k))),IE=(O,k,D,N,Y)=>Pi(N,"td,th",k).bind(se=>Pi(se,"table",k).bind(pe=>Hk(Y,pe)?kb(O,k,D).bind(Ee=>Pi(Ee.finish,"td,th",k).map(Fe=>({start:se,finish:Fe,range:Ee}))):ce.none())),OO=(O,k,D,N,Y,se)=>se(N,k).orThunk(()=>IE(O,k,D,N,Y).map(pe=>{const Ee=pe.range;return vb.create(ce.some(Ah(Ee.start,Ee.soffset,Ee.finish,Ee.foffset)),!0)})),cP=(O,k)=>Pi(O,"tr",k).bind(D=>Pi(D,"table",k).bind(N=>{const Y=yi(N,"tr");return gr(D,Y[0])?Zs(N,se=>dh(se).isSome(),k).map(se=>{const pe=sr(se);return vb.create(ce.some(Ah(se,pe,se,pe)),!0)}):ce.none()})),zk=(O,k)=>Pi(O,"tr",k).bind(D=>Pi(D,"table",k).bind(N=>{const Y=yi(N,"tr");return gr(D,Y[Y.length-1])?gi(N,se=>Nf(se).isSome(),k).map(se=>vb.create(ce.some(Ah(se,0,se,0)),!0)):ce.none()})),q_=(O,k,D,N,Y,se,pe)=>IE(O,D,N,Y,se).bind(Ee=>pm(k,D,Ee.start,Ee.finish,pe)),E2=O=>{let k=O;return{get:()=>k,set:Y=>{k=Y}}},uP=O=>{const k=E2(ce.none()),D=()=>k.get().each(O);return{clear:()=>{D(),k.set(ce.none())},isSet:()=>k.get().isSome(),get:()=>k.get(),set:Ee=>{D(),k.set(ce.some(Ee))}}},Vk=()=>{const O=uP(F);return{...O,on:D=>O.get().each(D)}},G_=(O,k)=>Pi(O,"td,th",k),Wk=O=>gl(O).exists(og),vI=(O,k,D,N)=>{const Y=Vk(),se=Y.clear,pe=_t=>{Y.on(dn=>{N.clearBeforeUpdate(k),G_(_t.target,D).each(Xn=>{hu(dn,Xn,D).each(Wn=>{const sn=Wn.boxes.getOr([]);if(sn.length===1){const Un=sn[0],tn=du(Un)==="false",Oo=uc(ep(_t.target),Un,gr);tn&&Oo&&(N.selectRange(k,sn,Un,Un),O.selectContents(Un))}else sn.length>1&&(N.selectRange(k,sn,Wn.start,Wn.finish),O.selectContents(Xn))})})})};return{clearstate:se,mousedown:_t=>{N.clear(k),G_(_t.target,D).filter(Wk).each(Y.set)},mouseover:_t=>{pe(_t)},mouseup:_t=>{pe(_t),se()}}},BE={traverse:xu,gather:Hr,relative:yl.before,retry:NE.tryDown,failure:fd.failedDown},Uk={traverse:nu,gather:Is,relative:yl.before,retry:NE.tryUp,failure:fd.failedUp},yO=O=>k=>k===O,A2=yO(38),xb=yO(40),vp=O=>O>=37&&O<=40,LE={isBackward:yO(37),isForward:yO(39)},fP={isBackward:yO(39),isForward:yO(37)},FE=O=>{const k=O!==void 0?O.dom:document,D=k.body.scrollLeft||k.documentElement.scrollLeft,N=k.body.scrollTop||k.documentElement.scrollTop;return Rf(D,N)},Yk=(O,k,D)=>{const Y=(D!==void 0?D.dom:document).defaultView;Y&&Y.scrollBy(O,k)},wO=dg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Xk=O=>wO.exact(O.start,O.soffset,O.finish,O.foffset),K_=O=>O.match({domRange:k=>lt.fromDom(k.startContainer),relative:(k,D)=>yl.getStart(k),exact:(k,D,N,Y)=>k}),jk=wO.domRange,QE=wO.relative,D2=wO.exact,qk=O=>{const k=K_(O);return Ar(k)},dP=F0.create,vm={domRange:jk,relative:QE,exact:D2,exactFromRange:Xk,getWin:qk,range:dP},ZE=(O,k,D)=>{var N,Y;return ce.from((Y=(N=O.dom).caretPositionFromPoint)===null||Y===void 0?void 0:Y.call(N,k,D)).bind(se=>{if(se.offsetNode===null)return ce.none();const pe=O.dom.createRange();return pe.setStart(se.offsetNode,se.offset),pe.collapse(),ce.some(pe)})},hP=(O,k,D)=>{var N,Y;return ce.from((Y=(N=O.dom).caretRangeFromPoint)===null||Y===void 0?void 0:Y.call(N,k,D))},Gn=(()=>document.caretPositionFromPoint?ZE:document.caretRangeFromPoint?hP:ce.none)(),Wl=(O,k,D)=>{const N=lt.fromDom(O.document);return Gn(N,k,D).map(Y=>F0.create(lt.fromDom(Y.startContainer),Y.startOffset,lt.fromDom(Y.endContainer),Y.endOffset))},Om=(O,k)=>{const D=Wt(O);return D==="input"?yl.after(O):ut(["br","img"],D)?k===0?yl.before(O):yl.after(O):yl.on(O,k)},sc=(O,k)=>{const D=O.fold(yl.before,Om,yl.after),N=k.fold(yl.before,Om,yl.after);return vm.relative(D,N)},ym=(O,k,D,N)=>{const Y=Om(O,k),se=Om(D,N);return vm.relative(Y,se)},HE=(O,k,D,N)=>{const se=nl(O).dom.createRange();return se.setStart(O.dom,k),se.setEnd(D.dom,N),se},P2=(O,k,D,N)=>{const Y=HE(O,k,D,N),se=gr(O,D)&&k===N;return Y.collapsed&&!se},Ph=O=>ce.from(O.getSelection()),J_=(O,k)=>{Ph(O).each(D=>{D.removeAllRanges(),D.addRange(k)})},M2=(O,k,D,N,Y)=>{const se=gm(O,k,D,N,Y);J_(O,se)},R2=(O,k,D,N,Y,se)=>{k.collapse(D.dom,N),k.extend(Y.dom,se)},Gk=(O,k)=>_2(O,k).match({ltr:(D,N,Y,se)=>{M2(O,D,N,Y,se)},rtl:(D,N,Y,se)=>{Ph(O).each(pe=>{if(pe.setBaseAndExtent)pe.setBaseAndExtent(D.dom,N,Y.dom,se);else if(pe.extend)try{R2(O,pe,D,N,Y,se)}catch{M2(O,Y,se,D,N)}else M2(O,Y,se,D,N)})}}),$2=(O,k,D,N,Y)=>{const se=ym(k,D,N,Y);Gk(O,se)},eS=(O,k,D)=>{const N=sc(k,D);Gk(O,N)},Kk=O=>{if(O.rangeCount>0){const k=O.getRangeAt(0),D=O.getRangeAt(O.rangeCount-1);return ce.some(F0.create(lt.fromDom(k.startContainer),k.startOffset,lt.fromDom(D.endContainer),D.endOffset))}else return ce.none()},mP=O=>{if(O.anchorNode===null||O.focusNode===null)return Kk(O);{const k=lt.fromDom(O.anchorNode),D=lt.fromDom(O.focusNode);return P2(k,O.anchorOffset,D,O.focusOffset)?ce.some(F0.create(k,O.anchorOffset,D,O.focusOffset)):Kk(O)}},wm=(O,k,D=!0)=>{const Y=(D?Ob:Dk)(O,k);J_(O,Y)},tS=O=>Ph(O).filter(k=>k.rangeCount>0).bind(mP),N2=O=>tS(O).map(k=>vm.exact(k.start,k.soffset,k.finish,k.foffset)),dd=(O,k)=>{const D=S2(O,k);return vu(D)},Ml=(O,k,D)=>Wl(O,k,D),Jk=O=>{Ph(O).each(k=>k.removeAllRanges())},I2=O=>({elementFromPoint:(tn,Oo)=>lt.fromPoint(lt.fromDom(O.document),tn,Oo),getRect:tn=>tn.dom.getBoundingClientRect(),getRangedRect:(tn,Oo,cs,Ds)=>{const da=vm.exact(tn,Oo,cs,Ds);return dd(O,da)},getSelection:()=>N2(O).map(tn=>Q0(O,tn)),fromSitus:tn=>{const Oo=vm.relative(tn.start,tn.finish);return Q0(O,Oo)},situsFromPoint:(tn,Oo)=>Ml(O,tn,Oo).map(cs=>bp.create(cs.start,cs.soffset,cs.finish,cs.foffset)),clearSelection:()=>{Jk(O)},collapseSelection:(tn=!1)=>{N2(O).each(Oo=>Oo.fold(cs=>cs.collapse(tn),(cs,Ds)=>{const da=tn?cs:Ds;eS(O,da,da)},(cs,Ds,da,Rl)=>{const wl=tn?cs:da,Vu=tn?Ds:Rl;$2(O,wl,Vu,wl,Vu)}))},setSelection:tn=>{$2(O,tn.start,tn.soffset,tn.finish,tn.foffset)},setRelativeSelection:(tn,Oo)=>{eS(O,tn,Oo)},selectNode:tn=>{wm(O,tn,!1)},selectContents:tn=>{wm(O,tn)},getInnerHeight:()=>O.innerHeight,getScrollY:()=>FE(lt.fromDom(O.document)).top,scrollBy:(tn,Oo)=>{Yk(tn,Oo,lt.fromDom(O.document))}}),Ud=(O,k)=>({rows:O,cols:k}),B2=(O,k,D,N)=>{const Y=I2(O),se=vI(Y,k,D,N);return{clearstate:se.clearstate,mousedown:se.mousedown,mouseover:se.mouseover,mouseup:se.mouseup}},ex=O=>Ll(O,fn).exists(og),tx=(O,k)=>ex(O)||ex(k),gP=(O,k,D,N)=>{const Y=I2(O),se=()=>(N.clear(k),ce.none());return{keydown:(Fe,rt,_t,dn,Xn,Wn)=>{const sn=Fe.raw,Un=sn.which,tn=sn.shiftKey===!0;return Qs(k,N.selectedSelector).fold(()=>(vp(Un)&&!tn&&N.clearBeforeUpdate(k),vp(Un)&&tn&&!tx(rt,dn)?ce.none:xb(Un)&&tn?oe(q_,Y,k,D,BE,dn,rt,N.selectRange):A2(Un)&&tn?oe(q_,Y,k,D,Uk,dn,rt,N.selectRange):xb(Un)?oe(OO,Y,D,BE,dn,rt,zk):A2(Un)?oe(OO,Y,D,Uk,dn,rt,cP):ce.none),cs=>{const Ds=da=>()=>bn(da,wl=>Hd(wl.rows,wl.cols,k,cs,N)).fold(()=>vh(k,N.firstSelectedSelector,N.lastSelectedSelector).map(wl=>{const Vu=xb(Un)||Wn.isForward(Un)?yl.after:yl.before;return Y.setRelativeSelection(yl.on(wl.first,0),Vu(wl.table)),N.clear(k),vb.create(ce.none(),!0)}),wl=>ce.some(vb.create(ce.none(),!0)));return vp(Un)&&tn&&!tx(rt,dn)?ce.none:xb(Un)&&tn?Ds([Ud(1,0)]):A2(Un)&&tn?Ds([Ud(-1,0)]):Wn.isBackward(Un)&&tn?Ds([Ud(0,-1),Ud(-1,0)]):Wn.isForward(Un)&&tn?Ds([Ud(0,1),Ud(1,0)]):vp(Un)&&!tn?se:ce.none})()},keyup:(Fe,rt,_t,dn,Xn)=>Qs(k,N.selectedSelector).fold(()=>{const Wn=Fe.raw,sn=Wn.which;return Wn.shiftKey===!0&&vp(sn)&&tx(rt,dn)?$k(k,D,rt,_t,dn,Xn,N.selectRange):ce.none()},ce.none)}},zE=(O,k,D,N)=>{const Y=I2(O);return(se,pe)=>{N.clearBeforeUpdate(k),hu(se,pe,D).each(Ee=>{const Fe=Ee.boxes.getOr([]);N.selectRange(k,Fe,Ee.start,Ee.finish),Y.selectContents(pe),Y.collapseSelection()})}},L2=(O,k)=>{const D=Oi(O,k);return D===void 0||D===""?[]:D.split(" ")},VE=(O,k,D)=>{const Y=L2(O,k).concat([D]);return Yr(O,k,Y.join(" ")),!0},pP=(O,k,D)=>{const N=Et(L2(O,k),Y=>Y!==D);return N.length>0?Yr(O,k,N.join(" ")):qe(O,k),!1},Tb=O=>O.dom.classList!==void 0,Gc=O=>L2(O,"class"),Mh=(O,k)=>VE(O,"class",k),Yd=(O,k)=>pP(O,"class",k),hd=(O,k)=>{Tb(O)?O.dom.classList.add(k):Mh(O,k)},nS=O=>{(Tb(O)?O.dom.classList:Gc(O)).length===0&&qe(O,"class")},z0=(O,k)=>{Tb(O)?O.dom.classList.remove(k):Yd(O,k),nS(O)},c1=(O,k)=>Tb(O)&&O.dom.classList.contains(k),bP=(O,k)=>{He(k,D=>{z0(O,D)})},nx=O=>k=>{hd(k,O)},vP=O=>k=>{bP(k,O)},YE={byClass:O=>{const k=nx(O.selected),D=vP([O.selected,O.lastSelected,O.firstSelected]),N=se=>{const pe=yi(se,O.selectedSelector);He(pe,D)};return{clearBeforeUpdate:N,clear:N,selectRange:(se,pe,Ee,Fe)=>{N(se),He(pe,k),hd(Ee,O.firstSelected),hd(Fe,O.lastSelected)},selectedSelector:O.selectedSelector,firstSelectedSelector:O.firstSelectedSelector,lastSelectedSelector:O.lastSelectedSelector}},byAttr:(O,k,D)=>{const N=Fe=>{qe(Fe,O.selected),qe(Fe,O.firstSelected),qe(Fe,O.lastSelected)},Y=Fe=>{Yr(Fe,O.selected,"1")},se=Fe=>{pe(Fe),D()},pe=Fe=>{const rt=yi(Fe,`${O.selectedSelector},${O.firstSelectedSelector},${O.lastSelectedSelector}`);He(rt,N)};return{clearBeforeUpdate:pe,clear:se,selectRange:(Fe,rt,_t,dn)=>{se(Fe),He(rt,Y),Yr(_t,O.firstSelected,"1"),Yr(dn,O.lastSelected,"1"),k(rt,_t,dn)},selectedSelector:O.selectedSelector,firstSelectedSelector:O.firstSelectedSelector,lastSelectedSelector:O.lastSelectedSelector}}},oS=(O,k,D,N)=>{switch(O.tag){case"none":return k();case"single":return N(O.element);case"multiple":return D(O.elements)}},ox=()=>({tag:"none"}),Ri=O=>({tag:"multiple",elements:O}),u1=O=>({tag:"single",element:O}),_O=(O,k,D)=>({get:()=>m0(O(),D).fold(()=>k().fold(ox,u1),Ri)}),sx=(O,k)=>{const D=O.slice(0,k[k.length-1].row+1),N=zy(D);return so(N,Y=>{const se=Y.cells.slice(0,k[k.length-1].column+1);return Ct(se,pe=>pe.element)})},XE=(O,k)=>{const D=O.slice(k[0].row+k[0].rowspan-1,O.length),N=zy(D);return so(N,Y=>{const se=Y.cells.slice(k[0].column+k[0].colspan-1,Y.cells.length);return Ct(se,pe=>pe.element)})},rx=(O,k,D)=>{const N=Ae.fromTable(O);return ad(N,k).map(se=>{const pe=Xc(N,D,!1),{rows:Ee}=Pa(pe),Fe=sx(Ee,se),rt=XE(Ee,se);return{upOrLeftCells:Fe,downOrRightCells:rt}})},jE=(O,k,D,N,Y,se,pe)=>({target:O,x:k,y:D,stop:N,prevent:Y,kill:se,raw:pe}),sS=O=>{const k=lt.fromDom(qn(O).getOr(O.target)),D=()=>O.stopPropagation(),N=()=>O.preventDefault(),Y=U(N,D);return jE(k,O.clientX,O.clientY,D,N,Y,O)},OP=(O,k)=>D=>{O(D)&&k(sS(D))},yP=(O,k,D,N,Y)=>{const se=OP(D,N);return O.dom.addEventListener(k,se,Y),{unbind:oe(wP,O,k,se,Y)}},qE=(O,k,D,N)=>yP(O,k,D,N,!1),wP=(O,k,D,N)=>{O.dom.removeEventListener(k,D,N)},ix=Oe,SO=(O,k,D)=>qE(O,k,ix,D),CO=sS,rS=O=>!c1(lt.fromDom(O.target),"ephox-snooker-resizer-bar"),GE=(O,k)=>{const D=_O(()=>lt.fromDom(O.getBody()),()=>qp(Lu(O),sg(O)),Oh.selectedSelector),N=(Fe,rt,_t)=>{rl(rt).each(Xn=>{const Wn=sm(O),sn=Ma(F,lt.fromDom(O.getDoc()),Wn),Un=rd(O),tn=rx(Xn,{selection:Un},sn);mb(O,Fe,rt,_t,tn)})},Y=()=>Xi(O),se=YE.byAttr(Oh,N,Y);return O.on("init",Fe=>{const rt=O.getWin(),_t=Bf(O),dn=sg(O),Xn=()=>{const xi=O.selection,Wu=lt.fromDom(xi.getStart()),vf=lt.fromDom(xi.getEnd());Ci(rl,[Wu,vf]).fold(()=>se.clear(_t),F)},Wn=B2(rt,_t,dn,se),sn=gP(rt,_t,dn,se),Un=zE(rt,_t,dn,se),tn=xi=>xi.raw.shiftKey===!0;O.on("TableSelectorChange",xi=>Un(xi.start,xi.finish));const Oo=(xi,Wu)=>{!tn(xi)||(Wu.kill&&xi.kill(),Wu.selection.each(vf=>{const Sm=vm.relative(vf.start,vf.finish),Of=S2(rt,Sm);O.selection.setRng(Of)}))},cs=xi=>{const Wu=CO(xi);if(Wu.raw.shiftKey&&vp(Wu.raw.which)){const vf=O.selection.getRng(),Sm=lt.fromDom(vf.startContainer),Of=lt.fromDom(vf.endContainer);sn.keyup(Wu,Sm,vf.startOffset,Of,vf.endOffset).each(X0=>{Oo(Wu,X0)})}},Ds=xi=>{const Wu=CO(xi);k.hide();const vf=O.selection.getRng(),Sm=lt.fromDom(vf.startContainer),Of=lt.fromDom(vf.endContainer),X0=Pv(LE,fP)(lt.fromDom(O.selection.getStart()));sn.keydown(Wu,Sm,vf.startOffset,Of,vf.endOffset,X0).each(Uu=>{Oo(Wu,Uu)}),k.show()},da=xi=>xi.button===0,Rl=xi=>xi.buttons===void 0?!0:(xi.buttons&1)!==0,wl=xi=>{Wn.clearstate()},Vu=xi=>{da(xi)&&rS(xi)&&Wn.mousedown(CO(xi))},Y0=xi=>{Rl(xi)&&rS(xi)&&Wn.mouseover(CO(xi))},H2=xi=>{da(xi)&&rS(xi)&&Wn.mouseup(CO(xi))},pS=(()=>{const xi=E2(lt.fromDom(_t)),Wu=E2(0);return{touchEnd:Sm=>{const Of=lt.fromDom(Sm.target);if(Lr("td")(Of)||Lr("th")(Of)){const X0=xi.get(),Uu=Wu.get();gr(X0,Of)&&Sm.timeStamp-Uu<300&&(Sm.preventDefault(),Un(Of,Of))}xi.set(Of),Wu.set(Sm.timeStamp)}}})();O.on("dragstart",wl),O.on("mousedown",Vu),O.on("mouseover",Y0),O.on("mouseup",H2),O.on("touchend",pS.touchEnd),O.on("keyup",cs),O.on("keydown",Ds),O.on("NodeChange",Xn)}),O.on("PreInit",()=>{O.serializer.addTempAttr(Oh.firstSelected),O.serializer.addTempAttr(Oh.lastSelected)}),{getSelectedCells:()=>oS(D.get(),L([]),Fe=>Ct(Fe,rt=>rt.dom),Fe=>[Fe.dom]),clearSelectedCells:Fe=>se.clear(lt.fromDom(Fe))}},Rh=O=>{let k=[];return{bind:se=>{if(se===void 0)throw new Error("Event bind error: undefined handler");k.push(se)},unbind:se=>{k=Et(k,pe=>pe!==se)},trigger:(...se)=>{const pe={};He(O,(Ee,Fe)=>{pe[Ee]=se[Fe]}),He(k,Ee=>{Ee(pe)})}}},Kc=O=>{const k=ps(O,N=>({bind:N.bind,unbind:N.unbind})),D=ps(O,N=>N.trigger);return{registry:k,trigger:D}},wu=(O,k)=>{let D=null;const N=()=>{b(D)||(clearTimeout(D),D=null)};return{cancel:N,throttle:(...se)=>{N(),D=setTimeout(()=>{D=null,O.apply(null,se)},k)}}},Op=O=>O.slice(0).sort(),_P=(O,k)=>{throw new Error("All required keys ("+Op(O).join(", ")+") were not specified. Specified keys were: "+Op(k).join(", ")+".")},SP=O=>{throw new Error("Unsupported keys for object: "+Op(O).join(", "))},CP=(O,k)=>{if(!h(k))throw new Error("The "+O+" fields must be an array. Was: "+k+".");He(k,D=>{if(!u(D))throw new Error("The value "+D+" in the "+O+" fields was not a string.")})},cr=(O,k)=>{throw new Error("All values need to be of type: "+k+". Keys ("+Op(O).join(", ")+") were not.")},kP=O=>{const k=Op(O);he(k,(N,Y)=>Y<k.length-1&&N===k[Y+1]).each(N=>{throw new Error("The field: "+N+" occurs more than once in the combined fields: ["+k.join(", ")+"].")})},KE=(O,k)=>iS(O,k,{validate:$,label:"function"}),iS=(O,k,D)=>{if(k.length===0)throw new Error("You must specify at least one required field.");return CP("required",k),kP(k),N=>{const Y=At(N);Yo(k,Ee=>ut(Y,Ee))||_P(k,Y),O(k,Y);const pe=Et(k,Ee=>!D.validate(N[Ee],Ee));return pe.length>0&&cr(pe,D.label),N}},xP=(O,k)=>{const D=Et(k,N=>!ut(O,N));D.length>0&&SP(D)},to=O=>KE(xP,O),V0=to(["compare","extract","mutate","sink"]),TP=to(["element","start","stop","destroy"]),JE=to(["forceDrop","drop","move","delayDrop"]),aS=()=>{let O=ce.none();const k=()=>{O=ce.none()},D=(se,pe)=>{const Ee=O.map(Fe=>se.compare(Fe,pe));return O=ce.some(pe),Ee},N=(se,pe)=>{pe.extract(se).each(Fe=>{D(pe,Fe).each(_t=>{Y.trigger.move(_t)})})},Y=Kc({move:Rh(["info"])});return{onEvent:N,reset:k,events:Y.registry}},F2=()=>{const O=Kc({move:Rh(["info"])});return{onEvent:F,reset:F,events:O.registry}},ax=()=>{const O=F2(),k=aS();let D=O;return{on:()=>{D.reset(),D=k},off:()=>{D.reset(),D=O},isOn:()=>D===k,onEvent:(Ee,Fe)=>{D.onEvent(Ee,Fe)},events:k.events}},lx=(O,k,D)=>{let N=!1;const Y=Kc({start:Rh([]),stop:Rh([])}),se=ax(),pe=()=>{sn.stop(),se.isOn()&&(se.off(),Y.trigger.stop())},Ee=wu(pe,200),Fe=tn=>{sn.start(tn),se.on(),Y.trigger.start()},rt=tn=>{Ee.cancel(),se.onEvent(tn,k)};se.events.move.bind(tn=>{k.mutate(O,tn.info)});const _t=()=>{N=!0},dn=()=>{N=!1},Xn=()=>N,Wn=tn=>(...Oo)=>{N&&tn.apply(null,Oo)},sn=k.sink(JE({forceDrop:pe,drop:Wn(pe),move:Wn(rt),delayDrop:Wn(Ee.throttle)}),D),Un=()=>{sn.destroy()};return{element:sn.element,go:Fe,on:_t,off:dn,isActive:Xn,destroy:Un,events:Y.registry}},EP=O=>{const k=O.replace(/\./g,"-");return{resolve:N=>k+"-"+N}},e3=EP("ephox-dragster").resolve,t3=O=>{const k={layerClass:e3("blocker"),...O},D=lt.fromTag("div");return Yr(D,"role","presentation"),kl(D,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),hd(D,e3("blocker")),hd(D,k.layerClass),{element:L(D),destroy:()=>{Ji(D)}}};var PP=V0({compare:(O,k)=>Rf(k.left-O.left,k.top-O.top),extract:O=>ce.some(Rf(O.x,O.y)),sink:(O,k)=>{const D=t3(k),N=SO(D.element(),"mousedown",O.forceDrop),Y=SO(D.element(),"mouseup",O.drop),se=SO(D.element(),"mousemove",O.move),pe=SO(D.element(),"mouseout",O.delayDrop),Ee=()=>{D.destroy(),Y.unbind(),se.unbind(),pe.unbind(),N.unbind()},Fe=_t=>{Dr(_t,D.element())},rt=()=>{Ji(D.element())};return TP({element:D.element,start:Fe,stop:rt,destroy:Ee})},mutate:(O,k)=>{O.mutate(k.left,k.top)}});const yI=(O,k={})=>{var D;const N=(D=k.mode)!==null&&D!==void 0?D:PP;return lx(O,N,k)},cS=EP("ephox-snooker").resolve,MP=()=>{const O=Kc({drag:Rh(["xDelta","yDelta"])});return{mutate:(D,N)=>{O.trigger.drag(D,N)},events:O.registry}},RP=()=>{const O=Kc({drag:Rh(["xDelta","yDelta","target"])});let k=ce.none();const D=MP();return D.events.drag.bind(se=>{k.each(pe=>{O.trigger.drag(se.xDelta,se.yDelta,pe)})}),{assign:se=>{k=ce.some(se)},get:()=>k,mutate:D.mutate,events:O.registry}},$P=(O,k,D,N,Y)=>{const se=lt.fromTag("div");return kl(se,{position:"absolute",left:k-N/2+"px",top:D+"px",height:Y+"px",width:N+"px"}),Zi(se,{"data-column":O,role:"presentation"}),se},Z2=(O,k,D,N,Y)=>{const se=lt.fromTag("div");return kl(se,{position:"absolute",left:k+"px",top:D-Y/2+"px",height:Y+"px",width:N+"px"}),Zi(se,{"data-row":O,role:"presentation"}),se},cx=cS("resizer-bar"),n3=cS("resizer-rows"),ux=cS("resizer-cols"),fx=7,o3=(O,k)=>so(O.all,(D,N)=>k(D.element)?[N]:[]),f1=(O,k)=>{const D=[];return Bt(O.grid.columns,N=>{Ae.getColumnAt(O,N).map(se=>se.element).forall(k)&&D.push(N)}),Et(D,N=>{const Y=Ae.filterItems(O,se=>se.column===N);return Yo(Y,se=>k(se.element))})},kO=O=>{const k=yi(O.parent(),"."+cx);He(k,Ji)},dx=(O,k,D)=>{const N=O.origin();He(k,Y=>{Y.each(se=>{const pe=D(N,se);hd(pe,cx),Dr(O.parent(),pe)})})},NP=(O,k,D,N)=>{dx(O,k,(Y,se)=>{const pe=$P(se.col,se.x-Y.left,D.top-Y.top,fx,N);return hd(pe,ux),pe})},IP=(O,k,D,N)=>{dx(O,k,(Y,se)=>{const pe=Z2(se.row,D.left-Y.left,se.y-Y.top,N,fx);return hd(pe,n3),pe})},Nr=(O,k,D,N,Y)=>{const se=nf(D),pe=k.isResizable,Ee=N.length>0?Jn.positions(N,D):[],Fe=Ee.length>0?o3(O,pe):[],rt=Et(Ee,(Wn,sn)=>Qe(Fe,Un=>sn===Un));IP(k,rt,se,at(D));const _t=Y.length>0?Vc.positions(Y,D):[],dn=_t.length>0?f1(O,pe):[],Xn=Et(_t,(Wn,sn)=>Qe(dn,Un=>sn===Un));NP(k,Xn,se,Ym(D))},hx=(O,k)=>{if(kO(O),O.isResizable(k)){const D=Ae.fromTable(k),N=$u(D),Y=Mf(D);Nr(D,O,k,N,Y)}},yp=(O,k)=>{const D=yi(O.parent(),"."+cx);He(D,k)},wp=O=>{yp(O,k=>{Mi(k,"display","none")})},d1=O=>{yp(O,k=>{Mi(k,"display","block")})},zu=O=>c1(O,n3),uS=O=>c1(O,ux),xO=cS("resizer-bar-dragging"),fS=O=>{const k=RP(),D=yI(k,{});let N=ce.none();const Y=(sn,Un)=>ce.from(Oi(sn,Un));k.events.drag.bind(sn=>{Y(sn.target,"data-row").each(Un=>{const tn=qi(sn.target,"top");Mi(sn.target,"top",tn+sn.yDelta+"px")}),Y(sn.target,"data-column").each(Un=>{const tn=qi(sn.target,"left");Mi(sn.target,"left",tn+sn.xDelta+"px")})});const se=(sn,Un)=>{const tn=qi(sn,Un),Oo=Pr(sn,"data-initial-"+Un,0);return tn-Oo};D.events.stop.bind(()=>{k.get().each(sn=>{N.each(Un=>{Y(sn,"data-row").each(tn=>{const Oo=se(sn,"top");qe(sn,"data-initial-top"),Wn.trigger.adjustHeight(Un,Oo,parseInt(tn,10))}),Y(sn,"data-column").each(tn=>{const Oo=se(sn,"left");qe(sn,"data-initial-left"),Wn.trigger.adjustWidth(Un,Oo,parseInt(tn,10))}),hx(O,Un)})})});const pe=(sn,Un)=>{Wn.trigger.startAdjust(),k.assign(sn),Yr(sn,"data-initial-"+Un,qi(sn,Un)),hd(sn,xO),Mi(sn,"opacity","0.2"),D.go(O.parent())},Ee=SO(O.parent(),"mousedown",sn=>{zu(sn.target)&&pe(sn.target,"top"),uS(sn.target)&&pe(sn.target,"left")}),Fe=sn=>gr(sn,O.view()),rt=sn=>Pi(sn,"table",Fe).filter(og),_t=SO(O.view(),"mouseover",sn=>{rt(sn.target).fold(()=>{zi(sn.target)&&kO(O)},Un=>{D.isActive()&&(N=ce.some(Un),hx(O,Un))})}),dn=()=>{Ee.unbind(),_t.unbind(),D.destroy(),kO(O)},Xn=sn=>{hx(O,sn)},Wn=Kc({adjustHeight:Rh(["table","delta","row"]),adjustWidth:Rh(["table","delta","column"]),startAdjust:Rh([])});return{destroy:dn,refresh:Xn,on:D.on,off:D.off,hideBars:oe(wp,O),showBars:oe(d1,O),events:Wn.registry}},BP={create:(O,k,D)=>{const N=Jn,Y=Vc,se=fS(O),pe=Kc({beforeResize:Rh(["table","type"]),afterResize:Rh(["table","type"]),startDrag:Rh([])});return se.events.adjustHeight.bind(Ee=>{const Fe=Ee.table;pe.trigger.beforeResize(Fe,"row");const rt=N.delta(Ee.delta,Fe);T0(Fe,rt,Ee.row,N),pe.trigger.afterResize(Fe,"row")}),se.events.startAdjust.bind(Ee=>{pe.trigger.startDrag()}),se.events.adjustWidth.bind(Ee=>{const Fe=Ee.table;pe.trigger.beforeResize(Fe,"col");const rt=Y.delta(Ee.delta,Fe),_t=D(Fe);Vt(Fe,rt,Ee.column,k,_t),pe.trigger.afterResize(Fe,"col")}),{on:se.on,off:se.off,refreshBars:se.refresh,hideBars:se.hideBars,showBars:se.showBars,destroy:se.destroy,events:pe.registry}}},ur={only:(O,k)=>{const D=fs(O)?nr(O):O;return{parent:L(D),view:L(O),origin:L(Rf(0,0)),isResizable:k}},detached:(O,k,D)=>{const N=()=>nf(k);return{parent:L(k),view:L(O),origin:N,isResizable:D}},body:(O,k,D)=>({parent:L(k),view:L(O),origin:L(Rf(0,0)),isResizable:D})},_m=()=>{const O=lt.fromTag("div");return kl(O,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Dr(me(),O),O},TO=(O,k)=>O.inline?ur.body(lt.fromDom(O.getBody()),_m(),k):ur.only(lt.fromDom(O.getDoc()),k),FP=(O,k)=>{O.inline&&Ji(k.parent())},U0=O=>R(O)&&O.nodeName==="TABLE",mr="bar-",QP=O=>Oi(O,"data-mce-resize")!=="false",dS=O=>{const k=Ae.fromTable(O);Ae.hasColumns(k)||He(Ql(O),D=>{const N=sl(D,"width");Mi(D,"width",N),qe(D,"width")})},hS=O=>{const k=Vk(),D=Vk(),N=Vk();let Y,se;const pe=sn=>mm(O,sn),Ee=()=>rm(O)?Gp():s_(),Fe=sn=>By(sn).columns,rt=(sn,Un,tn)=>{const Oo=Ku(Un,"e");if(se===""&&pp(sn),tn!==Y&&se!==""){Mi(sn,"width",se);const cs=Ee(),Ds=pe(sn),da=rm(O)||Oo?Fe(sn)-1:0;Vt(sn,tn-Y,da,cs,Ds)}else if(Rv(se)){const cs=parseFloat(se.replace("%","")),Ds=tn*cs/Y;Mi(sn,"width",Ds+"%")}$v(se)&&dS(sn)},_t=()=>{D.on(sn=>{sn.destroy()}),N.on(sn=>{FP(O,sn)})};return O.on("init",()=>{const sn=TO(O,QP);if(N.set(sn),eg(O)&&im(O)){const Un=Ee(),tn=BP.create(sn,Un,pe);tn.on(),tn.events.startDrag.bind(Oo=>{k.set(O.selection.getRng())}),tn.events.beforeResize.bind(Oo=>{const cs=Oo.table.dom;d2(O,cs,Nd(cs),rg(cs),mr+Oo.type)}),tn.events.afterResize.bind(Oo=>{const cs=Oo.table,Ds=cs.dom;gh(cs),k.on(da=>{O.selection.setRng(da),O.focus()}),Mc(O,Ds,Nd(Ds),rg(Ds),mr+Oo.type),O.undoManager.add()}),D.set(tn)}}),O.on("ObjectResizeStart",sn=>{const Un=sn.target;if(U0(Un)){const tn=lt.fromDom(Un);He(O.dom.select(".mce-clonedresizable"),Oo=>{O.dom.addClass(Oo,"mce-"+u0(O)+"-columns")}),!$0(tn)&&tg(O)?m2(tn):!Th(tn)&&$d(O)&&pp(tn),I_(tn)&&Gu(sn.origin,mr)&&pp(tn),Y=sn.width,se=ng(O)?"":d0(O,Un).getOr("")}}),O.on("ObjectResized",sn=>{const Un=sn.target;if(U0(Un)){const tn=lt.fromDom(Un),Oo=sn.origin;Gu(Oo,"corner-")&&rt(tn,Oo,sn.width),gh(tn),mp(O,tn.dom,gb)}}),O.on("SwitchMode",()=>{D.on(sn=>{O.mode.isReadOnly()?sn.hideBars():sn.showBars()})}),O.on("dragstart dragend",sn=>{D.on(Un=>{sn.type==="dragstart"?(Un.hideBars(),Un.off()):(Un.on(),Un.showBars())})}),O.on("remove",()=>{_t()}),{refresh:sn=>{D.on(Un=>Un.refreshBars(lt.fromDom(sn)))},hide:()=>{D.on(sn=>sn.hideBars())},show:()=>{D.on(sn=>sn.showBars())}}},mS=O=>{Kg(O);const k=hS(O),D=GE(O,k),N=fk(O,k,D);return hO(O,N),W_(O,N),Ny(O,N),{getSelectedCells:D.getSelectedCells,clearSelectedCells:D.clearSelectedCells}},h1=O=>({table:mS(O)});var _p=()=>{o.add("dom",h1)};_p()})();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 o=Object.getPrototypeOf,e=(r,f,g)=>{var v;return g(r,f.prototype)?!0:((v=r.constructor)===null||v===void 0?void 0:v.name)===f.name},t=r=>{const f=typeof r;return r===null?"null":f==="object"&&Array.isArray(r)?"array":f==="object"&&e(r,String,(g,v)=>v.isPrototypeOf(g))?"string":f},s=r=>f=>t(f)===r,a=r=>f=>typeof f===r,l=r=>f=>r===f,u=(r,f)=>h(r)&&e(r,f,(g,v)=>o(g)===v),d=s("string"),h=s("object"),b=r=>u(r,Object),y=s("array"),C=l(null),E=a("boolean"),R=l(void 0),$=r=>r==null,Q=r=>!$(r),F=a("function"),U=a("number"),K=(r,f)=>{if(y(r)){for(let g=0,v=r.length;g<v;++g)if(!f(r[g]))return!1;return!0}return!1},L=()=>{},te=r=>()=>r(),ne=(r,f)=>(...g)=>r(f.apply(null,g)),oe=(r,f)=>g=>r(f(g)),G=r=>()=>r,we=r=>r,ve=(r,f)=>r===f;function Re(r,...f){return(...g)=>{const v=f.concat(g);return r.apply(null,v)}}const Oe=r=>f=>!r(f),ce=r=>()=>{throw new Error(r)},Xe=r=>r(),tt=G(!1),ot=G(!0);class V{constructor(f,g){this.tag=f,this.value=g}static some(f){return new V(!0,f)}static none(){return V.singletonNone}fold(f,g){return this.tag?g(this.value):f()}isSome(){return this.tag}isNone(){return!this.tag}map(f){return this.tag?V.some(f(this.value)):V.none()}bind(f){return this.tag?f(this.value):V.none()}exists(f){return this.tag&&f(this.value)}forall(f){return!this.tag||f(this.value)}filter(f){return!this.tag||f(this.value)?this:V.none()}getOr(f){return this.tag?this.value:f}or(f){return this.tag?this:f}getOrThunk(f){return this.tag?this.value:f()}orThunk(f){return this.tag?this:f()}getOrDie(f){if(this.tag)return this.value;throw new Error(f!=null?f:"Called getOrDie on None")}static from(f){return Q(f)?V.some(f):V.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(f){this.tag&&f(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,Qe=Array.prototype.indexOf,Bt=Array.prototype.push,Ct=(r,f)=>Qe.call(r,f),He=(r,f)=>{const g=Ct(r,f);return g===-1?V.none():V.some(g)},st=(r,f)=>Ct(r,f)>-1,rn=(r,f)=>{for(let g=0,v=r.length;g<v;g++){const _=r[g];if(f(_,g))return!0}return!1},Et=(r,f)=>{const g=[];for(let v=0;v<r;v++)g.push(f(v));return g},Cn=(r,f)=>{const g=[];for(let v=0;v<r.length;v+=f){const _=ut.call(r,v,v+f);g.push(_)}return g},je=(r,f)=>{const g=r.length,v=new Array(g);for(let _=0;_<g;_++){const T=r[_];v[_]=f(T,_)}return v},mt=(r,f)=>{for(let g=0,v=r.length;g<v;g++){const _=r[g];f(_,g)}},he=(r,f)=>{for(let g=r.length-1;g>=0;g--){const v=r[g];f(v,g)}},Zo=(r,f)=>{const g=[],v=[];for(let _=0,T=r.length;_<T;_++){const P=r[_];(f(P,_)?g:v).push(P)}return{pass:g,fail:v}},Kn=(r,f)=>{const g=[];for(let v=0,_=r.length;v<_;v++){const T=r[v];f(T,v)&&g.push(T)}return g},so=(r,f,g)=>(he(r,(v,_)=>{g=f(g,v,_)}),g),Yo=(r,f,g)=>(mt(r,(v,_)=>{g=f(g,v,_)}),g),as=(r,f,g)=>{for(let v=0,_=r.length;v<_;v++){const T=r[v];if(f(T,v))return V.some(T);if(g(T,v))break}return V.none()},kt=(r,f)=>as(r,f,tt),jt=(r,f)=>{for(let g=0,v=r.length;g<v;g++){const _=r[g];if(f(_,g))return V.some(g)}return V.none()},pt=r=>{const f=[];for(let g=0,v=r.length;g<v;++g){if(!y(r[g]))throw new Error("Arr.flatten item "+g+" was not an array, input: "+r);Bt.apply(f,r[g])}return f},Ne=(r,f)=>pt(je(r,f)),Gt=(r,f)=>{for(let g=0,v=r.length;g<v;++g){const _=r[g];if(f(_,g)!==!0)return!1}return!0},bn=r=>{const f=ut.call(r,0);return f.reverse(),f},At=(r,f)=>Kn(r,g=>!st(f,g)),An=(r,f)=>{const g={};for(let v=0,_=r.length;v<_;v++){const T=r[v];g[String(T)]=f(T,v)}return g},zn=r=>[r],ps=(r,f)=>{const g=ut.call(r,0);return g.sort(f),g},oo=(r,f)=>f>=0&&f<r.length?V.some(r[f]):V.none(),Ss=r=>oo(r,0),Mr=r=>oo(r,r.length-1),$s=F(Array.from)?Array.from:r=>ut.call(r),tr=(r,f)=>{for(let g=0;g<r.length;g++){const v=f(r[g],g);if(v.isSome())return v}return V.none()},Xs=Object.keys,wa=Object.hasOwnProperty,dr=(r,f)=>{const g=Xs(r);for(let v=0,_=g.length;v<_;v++){const T=g[v],P=r[T];f(P,T)}},Ns=(r,f)=>qr(r,(g,v)=>({k:v,v:f(g,v)})),qr=(r,f)=>{const g={};return dr(r,(v,_)=>{const T=f(v,_);g[T.k]=T.v}),g},$o=r=>(f,g)=>{r[g]=f},Po=(r,f,g,v)=>{dr(r,(_,T)=>{(f(_,T)?g:v)(_,T)})},Rr=(r,f)=>{const g={},v={};return Po(r,f,$o(g),$o(v)),{t:g,f:v}},Ls=(r,f)=>{const g={};return Po(r,f,$o(g),L),g},aa=(r,f)=>{const g=[];return dr(r,(v,_)=>{g.push(f(v,_))}),g},bs=(r,f)=>{const g=Xs(r);for(let v=0,_=g.length;v<_;v++){const T=g[v],P=r[T];if(f(P,T,r))return V.some(P)}return V.none()},_a=r=>aa(r,we),ln=(r,f)=>vs(r,f)?V.from(r[f]):V.none(),vs=(r,f)=>wa.call(r,f),Qi=(r,f)=>vs(r,f)&&r[f]!==void 0&&r[f]!==null,ze=(r,f,g=ve)=>r.exists(v=>g(v,f)),et=(r,f,g=ve)=>Yn(r,f,g).getOr(r.isNone()&&f.isNone()),Tt=r=>{const f=[],g=v=>{f.push(v)};for(let v=0;v<r.length;v++)r[v].each(g);return f},Wt=r=>{const f=[];for(let g=0;g<r.length;g++){const v=r[g];if(v.isSome())f.push(v.getOrDie());else return V.none()}return V.some(f)},Yn=(r,f,g)=>r.isSome()&&f.isSome()?V.some(g(r.getOrDie(),f.getOrDie())):V.none(),po=(r,f,g,v)=>r.isSome()&&f.isSome()&&g.isSome()?V.some(v(r.getOrDie(),f.getOrDie(),g.getOrDie())):V.none(),wo=(r,f)=>r!=null?V.some(f(r)):V.none(),fn=(r,f)=>r?V.some(f):V.none(),os=(r,f)=>r+f,xo=(r,f)=>r.substring(f),fs=(r,f,g)=>f===""||r.length>=f.length&&r.substr(g,g+f.length)===f,kr=(r,f)=>Yr(r,f)?xo(r,f.length):r,Lr=(r,f)=>Zi(r,f)?r:os(r,f),Vs=(r,f,g=0,v)=>{const _=r.indexOf(f,g);return _!==-1?R(v)?!0:_+f.length<=v:!1},Yr=(r,f)=>fs(r,f,0),Zi=(r,f)=>fs(r,f,r.length-f.length),Oi=(r=>f=>f.replace(r,""))(/^\s+|\s+$/g),Ge=r=>r.length>0,qe=r=>!Ge(r),Nt=r=>r.style!==void 0&&F(r.style.getPropertyValue),Ut=(r,f)=>{const v=(f||document).createElement("div");if(v.innerHTML=r,!v.hasChildNodes()||v.childNodes.length>1){const _="HTML does not have a single root node";throw console.error(_,r),new Error(_)}return Go(v.childNodes[0])},bo=(r,f)=>{const v=(f||document).createElement(r);return Go(v)},Lo=(r,f)=>{const v=(f||document).createTextNode(r);return Go(v)},Go=r=>{if(r==null)throw new Error("Node cannot be null or undefined");return{dom:r}},lt={fromHtml:Ut,fromTag:bo,fromText:Lo,fromDom:Go,fromPoint:(r,f,g)=>V.from(r.dom.elementFromPoint(f,g)).map(Go)},Xo=typeof window<"u"?window:Function("return this;")(),Ni=(r,f)=>{let g=f!=null?f:Xo;for(let v=0;v<r.length&&g!==void 0&&g!==null;++v)g=g[r[v]];return g},la=(r,f)=>{const g=r.split(".");return Ni(g,f)},ma=(r,f)=>la(r,f),gr=(r,f)=>{const g=ma(r,f);if(g==null)throw new Error(r+" not available on this browser");return g},Fc=Object.getPrototypeOf,Cc=r=>gr("HTMLElement",r),nl=r=>{const f=la("ownerDocument.defaultView",r);return h(r)&&(Cc(f).prototype.isPrototypeOf(r)||/^HTML\w*Element$/.test(Fc(r).constructor.name))},ga=9,nr=11,Ar=1,Ki=3,gl=r=>r.dom.nodeName.toLowerCase(),kc=r=>r.dom.nodeType,nu=r=>f=>kc(f)===r,xu=r=>yr(r)&&nl(r.dom),yr=nu(Ar),ol=nu(Ki),Tu=nu(ga),ou=nu(nr),Yl=r=>f=>yr(f)&&gl(f)===r,Aa=(r,f)=>{const g=r.dom;if(g.nodeType!==Ar)return!1;{const v=g;if(v.matches!==void 0)return v.matches(f);if(v.msMatchesSelector!==void 0)return v.msMatchesSelector(f);if(v.webkitMatchesSelector!==void 0)return v.webkitMatchesSelector(f);if(v.mozMatchesSelector!==void 0)return v.mozMatchesSelector(f);throw new Error("Browser lacks native selectors")}},Dr=r=>r.nodeType!==Ar&&r.nodeType!==ga&&r.nodeType!==nr||r.childElementCount===0,Qm=(r,f)=>{const g=f===void 0?document:f.dom;return Dr(g)?[]:je(g.querySelectorAll(r),lt.fromDom)},xf=(r,f)=>{const g=f===void 0?document:f.dom;return Dr(g)?V.none():V.from(g.querySelector(r)).map(lt.fromDom)},xr=(r,f)=>r.dom===f.dom,Za=(r,f)=>{const g=r.dom,v=f.dom;return g===v?!1:g.contains(v)},ca=r=>lt.fromDom(r.dom.ownerDocument),Ji=r=>Tu(r)?r:ca(r),Eu=r=>lt.fromDom(Ji(r).dom.documentElement),Qc=r=>lt.fromDom(Ji(r).dom.defaultView),Ha=r=>V.from(r.dom.parentNode).map(lt.fromDom),Zc=r=>Ha(r),xc=r=>V.from(r.dom.parentElement).map(lt.fromDom),Cd=(r,f)=>{const g=F(f)?f:tt;let v=r.dom;const _=[];for(;v.parentNode!==null&&v.parentNode!==void 0;){const T=v.parentNode,P=lt.fromDom(T);if(_.push(P),g(P)===!0)break;v=T}return _},Yf=r=>V.from(r.dom.offsetParent).map(lt.fromDom),Au=r=>V.from(r.dom.nextSibling).map(lt.fromDom),Xl=r=>je(r.dom.childNodes,lt.fromDom),Hc=(r,f)=>{const g=r.dom.childNodes;return V.from(g[f]).map(lt.fromDom)},Tf=r=>Hc(r,0),su=(r,f)=>({element:r,offset:f}),kd=(r,f)=>{const g=Xl(r);return g.length>0&&f<g.length?su(g[f],0):su(r,f)},De=r=>ou(r)&&Q(r.dom.host),nt=F(Element.prototype.attachShadow)&&F(Node.prototype.getRootNode),bt=G(nt),$t=nt?r=>lt.fromDom(r.dom.getRootNode()):Ji,On=r=>De(r)?r:lt.fromDom(Ji(r).dom.body),Mo=r=>$r(r).isSome(),$r=r=>{const f=$t(r);return De(f)?V.some(f):V.none()},ys=r=>lt.fromDom(r.dom.host),ls=r=>{if(bt()&&Q(r.target)){const f=lt.fromDom(r.target);if(yr(f)&&Di(f)&&r.composed&&r.composedPath){const g=r.composedPath();if(g)return Ss(g)}}return V.from(r.target)},Di=r=>Q(r.dom.shadowRoot),js=r=>{const f=ol(r)?r.dom.parentNode:r.dom;if(f==null||f.ownerDocument===null)return!1;const g=f.ownerDocument;return $r(lt.fromDom(f)).fold(()=>g.body.contains(f),oe(js,ys))},Hi=()=>Du(lt.fromDom(document)),Du=r=>{const f=r.dom.body;if(f==null)throw new Error("Body is not available yet");return lt.fromDom(f)},xd=(r,f,g)=>{if(d(g)||E(g)||U(g))r.setAttribute(f,g+"");else throw console.error("Invalid call to Attribute.set. Key ",f,":: Value ",g,":: Element ",r),new Error("Attribute value was not simple")},qn=(r,f,g)=>{xd(r.dom,f,g)},Zm=(r,f)=>{const g=r.dom;dr(f,(v,_)=>{xd(g,_,v)})},zi=(r,f)=>{const g=r.dom.getAttribute(f);return g===null?void 0:g},me=(r,f)=>V.from(zi(r,f)),$e=(r,f)=>{const g=r.dom;return g&&g.hasAttribute?g.hasAttribute(f):!1},Ue=(r,f)=>{r.dom.removeAttribute(f)},It=r=>Yo(r.dom.attributes,(f,g)=>(f[g.name]=g.value,f),{}),Bn=(r,f,g)=>{if(!d(g))throw console.error("Invalid call to CSS.set. Property ",f,":: Value ",g,":: Element ",r),new Error("CSS value must be a string: "+g);Nt(r)&&r.style.setProperty(f,g)},es=(r,f)=>{Nt(r)&&r.style.removeProperty(f)},ro=(r,f,g)=>{const v=r.dom;Bn(v,f,g)},yi=(r,f)=>{const g=r.dom;dr(f,(v,_)=>{Bn(g,_,v)})},gn=(r,f)=>{const g=r.dom;dr(f,(v,_)=>{v.fold(()=>{es(g,_)},T=>{Bn(g,_,T)})})},Gr=(r,f)=>{const g=r.dom,_=window.getComputedStyle(g).getPropertyValue(f);return _===""&&!js(r)?Ll(g,f):_},Ll=(r,f)=>Nt(r)?r.style.getPropertyValue(f):"",ea=(r,f)=>{const g=r.dom,v=Ll(g,f);return V.from(v).filter(_=>_.length>0)},ri=r=>{const f={},g=r.dom;if(Nt(g))for(let v=0;v<g.style.length;v++){const _=g.style.item(v);f[_]=g.style[_]}return f},Ef=(r,f,g)=>{const v=lt.fromTag(r);return ro(v,f,g),ea(v,f).isSome()},ks=(r,f)=>{const g=r.dom;es(g,f),ze(me(r,"style").map(Oi),"")&&Ue(r,"style")},ru=r=>r.dom.offsetWidth,Pi=(r,f)=>{const g=(I,W)=>{if(!U(W)&&!W.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+W);const J=I.dom;Nt(J)&&(J.style[r]=W+"px")},v=I=>{const W=f(I);if(W<=0||W===null){const J=Gr(I,r);return parseFloat(J)||0}return W},_=v,T=(I,W)=>Yo(W,(J,ie)=>{const de=Gr(I,ie),ge=de===void 0?0:parseInt(de,10);return isNaN(ge)?J:J+ge},0);return{set:g,get:v,getOuter:_,aggregate:T,max:(I,W,J)=>{const ie=T(I,J);return W>ie?W-ie:0}}},uc=Pi("height",r=>{const f=r.dom;return js(r)?f.getBoundingClientRect().height:f.offsetHeight}),Ii=r=>uc.get(r),Xf=r=>uc.getOuter(r),pa=(r,f)=>{const g=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],v=uc.max(r,f,g);ro(r,"max-height",v+"px")},jf=(r,f)=>({left:r,top:f,translate:(v,_)=>jf(r+v,f+_)}),pr=jf,Gu=r=>{const f=r.getBoundingClientRect();return pr(f.left,f.top)},Ku=(r,f)=>r!==void 0?r:f!==void 0?f:0,Tc=r=>{const f=r.dom.ownerDocument,g=f.body,v=f.defaultView,_=f.documentElement;if(g===r.dom)return pr(g.offsetLeft,g.offsetTop);const T=Ku(v==null?void 0:v.pageYOffset,_.scrollTop),P=Ku(v==null?void 0:v.pageXOffset,_.scrollLeft),I=Ku(_.clientTop,g.clientTop),W=Ku(_.clientLeft,g.clientLeft);return qf(r).translate(P-W,T-I)},qf=r=>{const f=r.dom,v=f.ownerDocument.body;return v===f?pr(v.offsetLeft,v.offsetTop):js(r)?Gu(f):pr(0,0)},eh=Pi("width",r=>r.dom.offsetWidth),ti=(r,f)=>eh.set(r,f),ta=r=>eh.get(r),za=r=>eh.getOuter(r),Kb=(r,f)=>{const g=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],v=eh.max(r,f,g);ro(r,"max-width",v+"px")},Mi=r=>{let f=!1,g;return(...v)=>(f||(f=!0,g=r.apply(null,v)),g)},kl=(r,f,g,v)=>{const _=r.isiOS()&&/ipad/i.test(g)===!0,T=r.isiOS()&&!_,P=r.isiOS()||r.isAndroid(),I=P||v("(pointer:coarse)"),W=_||!T&&P&&v("(min-device-width:768px)"),J=T||P&&!W,ie=f.isSafari()&&r.isiOS()&&/safari/i.test(g)===!1,de=!J&&!W&&!ie;return{isiPad:G(_),isiPhone:G(T),isTablet:G(W),isPhone:G(J),isTouch:G(I),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:G(ie),isDesktop:G(de)}},sl=(r,f)=>{for(let g=0;g<r.length;g++){const v=r[g];if(v.test(f))return v}},Zg=(r,f)=>{const g=sl(r,f);if(!g)return{major:0,minor:0};const v=_=>Number(f.replace(g,"$"+_));return Af(v(1),v(2))},Gf=(r,f)=>{const g=String(f).toLowerCase();return r.length===0?Ec():Zg(r,g)},Ec=()=>Af(0,0),Af=(r,f)=>({major:r,minor:f}),Pr={nu:Af,detect:Gf,unknown:Ec},Ju=(r,f)=>tr(f.brands,g=>{const v=g.brand.toLowerCase();return kt(r,_=>{var T;return v===((T=_.brand)===null||T===void 0?void 0:T.toLowerCase())}).map(_=>({current:_.name,version:Pr.nu(parseInt(g.version,10),0)}))}),Fl=(r,f)=>{const g=String(f).toLowerCase();return kt(r,v=>v.search(g))},Va=(r,f)=>Fl(r,f).map(g=>{const v=Pr.detect(g.versionRegexes,f);return{current:g.name,version:v}}),qi=(r,f)=>Fl(r,f).map(g=>{const v=Pr.detect(g.versionRegexes,f);return{current:g.name,version:v}}),Vi=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,fc=r=>f=>Vs(f,r),Kf=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:r=>Vs(r,"edge/")&&Vs(r,"chrome")&&Vs(r,"safari")&&Vs(r,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Vi],search:r=>Vs(r,"chrome")&&!Vs(r,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:r=>Vs(r,"msie")||Vs(r,"trident")},{name:"Opera",versionRegexes:[Vi,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:fc("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:fc("firefox")},{name:"Safari",versionRegexes:[Vi,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:r=>(Vs(r,"safari")||Vs(r,"mobile/"))&&Vs(r,"applewebkit")}],th=[{name:"Windows",search:fc("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:r=>Vs(r,"iphone")||Vs(r,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:fc("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:fc("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:fc("linux"),versionRegexes:[]},{name:"Solaris",search:fc("sunos"),versionRegexes:[]},{name:"FreeBSD",search:fc("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:fc("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Hg={browsers:G(Kf),oses:G(th)},Hm="Edge",Ql="Chromium",zm="IE",rl="Opera",Df="Firefox",jh="Safari",ef=()=>qh({current:void 0,version:Pr.unknown()}),qh=r=>{const f=r.current,g=r.version,v=_=>()=>f===_;return{current:f,version:g,isEdge:v(Hm),isChromium:v(Ql),isIE:v(zm),isOpera:v(rl),isFirefox:v(Df),isSafari:v(jh)}},zc={unknown:ef,nu:qh,edge:G(Hm),chromium:G(Ql),ie:G(zm),opera:G(rl),firefox:G(Df),safari:G(jh)},Gh="Windows",Pf="iOS",zp="Android",Vm="Linux",Jf="macOS",jl="Solaris",zg="FreeBSD",Ke="ChromeOS",nh=()=>Pu({current:void 0,version:Pr.unknown()}),Pu=r=>{const f=r.current,g=r.version,v=_=>()=>f===_;return{current:f,version:g,isWindows:v(Gh),isiOS:v(Pf),isAndroid:v(zp),isMacOS:v(Jf),isLinux:v(Vm),isSolaris:v(jl),isFreeBSD:v(zg),isChromeOS:v(Ke)}},Vg={unknown:nh,nu:Pu,windows:G(Gh),ios:G(Pf),android:G(zp),linux:G(Vm),macos:G(Jf),solaris:G(jl),freebsd:G(zg),chromeos:G(Ke)},Kh={detect:(r,f,g)=>{const v=Hg.browsers(),_=Hg.oses(),T=f.bind(W=>Ju(v,W)).orThunk(()=>Va(v,r)).fold(zc.unknown,zc.nu),P=qi(_,r).fold(Vg.unknown,Vg.nu),I=kl(P,T,r,g);return{browser:T,os:P,deviceType:I}}},vt=r=>window.matchMedia(r).matches;let cn=Mi(()=>Kh.detect(navigator.userAgent,V.from(navigator.userAgentData),vt));const an=()=>cn(),Eo=(r,f,g,v,_,T,P)=>({target:r,x:f,y:g,stop:v,prevent:_,kill:T,raw:P}),or=r=>{const f=lt.fromDom(ls(r).getOr(r.target)),g=()=>r.stopPropagation(),v=()=>r.preventDefault(),_=ne(v,g);return Eo(f,r.clientX,r.clientY,g,v,_,r)},Xr=(r,f)=>g=>{r(g)&&f(or(g))},fi=(r,f,g,v,_)=>{const T=Xr(g,v);return r.dom.addEventListener(f,T,_),{unbind:Re(Jb,r,f,T,_)}},wi=(r,f,g,v)=>fi(r,f,g,v,!1),oh=(r,f,g,v)=>fi(r,f,g,v,!0),Jb=(r,f,g,v)=>{r.dom.removeEventListener(f,g,v)},Sa=(r,f)=>{Ha(r).each(v=>{v.dom.insertBefore(f.dom,r.dom)})},Td=(r,f)=>{Au(r).fold(()=>{Ha(r).each(_=>{il(_,f)})},v=>{Sa(v,f)})},Wg=(r,f)=>{Tf(r).fold(()=>{il(r,f)},v=>{r.dom.insertBefore(f.dom,v.dom)})},il=(r,f)=>{r.dom.appendChild(f.dom)},Da=(r,f,g)=>{Hc(r,g).fold(()=>{il(r,f)},v=>{Sa(v,f)})},tf=(r,f)=>{mt(f,g=>{il(r,g)})},ii=r=>{r.dom.textContent="",mt(Xl(r),f=>{Mu(f)})},Mu=r=>{const f=r.dom;f.parentNode!==null&&f.parentNode.removeChild(f)},dc=r=>{const f=r!==void 0?r.dom:document,g=f.body.scrollLeft||f.documentElement.scrollLeft,v=f.body.scrollTop||f.documentElement.scrollTop;return pr(g,v)},Jh=(r,f,g)=>{const _=(g!==void 0?g.dom:document).defaultView;_&&_.scrollTo(r,f)},Y1=r=>{const f=r===void 0?window:r;return an().browser.isFirefox()?V.none():V.from(f.visualViewport)},sh=(r,f,g,v)=>({x:r,y:f,width:g,height:v,right:r+g,bottom:f+v}),Ug=r=>{const f=r===void 0?window:r,g=f.document,v=dc(lt.fromDom(g));return Y1(f).fold(()=>{const _=f.document.documentElement,T=_.clientWidth,P=_.clientHeight;return sh(v.left,v.top,T,P)},_=>sh(Math.max(_.pageLeft,v.left),Math.max(_.pageTop,v.top),_.width,_.height))},rh=()=>lt.fromDom(document),ql=(r,f)=>r.view(f).fold(G([]),v=>{const _=r.owner(v),T=ql(r,_);return[v].concat(T)}),em=(r,f)=>{const g=f.owner(r),v=ql(f,g);return V.some(v)};var Yg=Object.freeze({__proto__:null,view:r=>{var f;return(r.dom===document?V.none():V.from((f=r.dom.defaultView)===null||f===void 0?void 0:f.frameElement)).map(lt.fromDom)},owner:r=>ca(r)});const tm=r=>{const f=rh(),g=dc(f);return em(r,Yg).fold(Re(Tc,r),_=>{const T=qf(r),P=so(_,(I,W)=>{const J=qf(W);return{left:I.left+J.left,top:I.top+J.top}},{left:0,top:0});return pr(P.left+T.left+g.left,P.top+T.top+g.top)})},ih=(r,f,g)=>({point:r,width:f,height:g}),Ed=(r,f,g,v)=>({x:r,y:f,width:g,height:v}),ai=(r,f,g,v)=>({x:r,y:f,width:g,height:v,right:r+g,bottom:f+v}),di=r=>{const f=Tc(r),g=za(r),v=Xf(r);return ai(f.left,f.top,g,v)},Zl=r=>{const f=tm(r),g=za(r),v=Xf(r);return ai(f.left,f.top,g,v)},Vp=(r,f)=>{const g=Math.max(r.x,f.x),v=Math.max(r.y,f.y),_=Math.min(r.right,f.right),T=Math.min(r.bottom,f.bottom),P=_-g,I=T-v;return ai(g,v,P,I)},ee=(r,f)=>Yo(f,(g,v)=>Vp(g,v),r),ue=()=>Ug(window);var Se=tinymce.util.Tools.resolve("tinymce.ThemeManager");const Je=r=>{const f=T=>T(r),g=G(r),v=()=>_,_={tag:!0,inner:r,fold:(T,P)=>P(r),isValue:ot,isError:tt,map:T=>wn.value(T(r)),mapError:v,bind:f,exists:f,forall:f,getOr:g,or:v,getOrThunk:g,orThunk:v,getOrDie:g,each:T=>{T(r)},toOptional:()=>V.some(r)};return _},at=r=>{const f=()=>g,g={tag:!1,inner:r,fold:(v,_)=>v(r),isValue:tt,isError:ot,map:f,mapError:v=>wn.error(v(r)),bind:f,exists:tt,forall:ot,getOr:we,or:we,getOrThunk:Xe,orThunk:Xe,getOrDie:ce(String(r)),each:L,toOptional:V.none};return g},wn={value:Je,error:at,fromOption:(r,f)=>r.fold(()=>at(f),Je)};var Ko;(function(r){r[r.Error=0]="Error",r[r.Value=1]="Value"})(Ko||(Ko={}));const ss=(r,f,g)=>r.stype===Ko.Error?f(r.serror):g(r.svalue),vo=r=>{const f=[],g=[];return mt(r,v=>{ss(v,_=>g.push(_),_=>f.push(_))}),{values:f,errors:g}},Tr=(r,f)=>r.stype===Ko.Error?{stype:Ko.Error,serror:f(r.serror)}:r,Gl=(r,f)=>r.stype===Ko.Value?{stype:Ko.Value,svalue:f(r.svalue)}:r,ua=(r,f)=>r.stype===Ko.Value?f(r.svalue):r,Bi=(r,f)=>r.stype===Ko.Error?f(r.serror):r,Ru=r=>({stype:Ko.Value,svalue:r}),Pa=r=>({stype:Ko.Error,serror:r}),Wi={fromResult:r=>r.fold(Pa,Ru),toResult:r=>ss(r,wn.error,wn.value),svalue:Ru,partition:vo,serror:Pa,bind:ua,bindError:Bi,map:Gl,mapError:Tr,fold:ss},Ca=(r,f,g,v)=>({tag:"field",key:r,newKey:f,presence:g,prop:v}),iu=(r,f)=>({tag:"custom",newKey:r,instantiator:f}),ah=(r,f,g)=>{switch(r.tag){case"field":return f(r.key,r.newKey,r.presence,r.prop);case"custom":return g(r.newKey,r.instantiator)}},na=(r,f)=>f,e0=(r,f)=>b(r)&&b(f)?ni(r,f):f,Dv=r=>(...f)=>{if(f.length===0)throw new Error("Can't merge zero objects");const g={};for(let v=0;v<f.length;v++){const _=f[v];for(const T in _)vs(_,T)&&(g[T]=r(g[T],_[T]))}return g},ni=Dv(e0),Ad=Dv(na),wr=()=>({tag:"required",process:{}}),Kl=r=>({tag:"defaultedThunk",process:r}),ed=r=>Kl(G(r)),lh=()=>({tag:"option",process:{}}),Ae=r=>({tag:"mergeWithThunk",process:r}),Mf=r=>Ae(G(r)),Xg=(r,f)=>r.length>0?Wi.svalue(ni(f,Ad.apply(void 0,r))):Wi.svalue(f),$u=r=>ne(Wi.serror,pt)(r),j1={consolidateObj:(r,f)=>{const g=Wi.partition(r);return g.errors.length>0?$u(g.errors):Xg(g.values,f)},consolidateArr:r=>{const f=Wi.partition(r);return f.errors.length>0?$u(f.errors):Wi.svalue(f.values)}},t0=r=>h(r)&&Xs(r).length>100?" removed due to size":JSON.stringify(r,null,2),td=r=>{const f=r.length>10?r.slice(0,10).concat([{path:[],getErrorInfo:G("... (only showing first ten failures)")}]):r;return je(f,g=>"Failed path: ("+g.path.join(" > ")+`)
|
|
`+g.getErrorInfo())},Ym=(r,f)=>Wi.serror([{path:r,getErrorInfo:f}]),jg=(r,f,g)=>Ym(r,()=>'Could not find valid *required* value for "'+f+'" in '+t0(g)),Mv=(r,f)=>Ym(r,()=>'Choice schema did not contain choice key: "'+f+'"'),Rf=(r,f,g)=>Ym(r,()=>'The chosen schema: "'+g+'" did not exist in branches: '+t0(f)),xy=(r,f)=>Ym(r,()=>"There are unsupported fields: ["+f.join(", ")+"] specified"),Nu=(r,f)=>Ym(r,G(f)),nf=r=>{const f=(v,_)=>Wi.bindError(r(_),T=>Nu(v,T)),g=G("val");return{extract:f,toString:g}},n0=nf(Wi.svalue),o0=(r,f,g,v)=>ln(f,g).fold(()=>jg(r,g,f),v),s0=(r,f,g,v)=>{const _=ln(r,f).getOrThunk(()=>g(r));return v(_)},q1=(r,f,g)=>g(ln(r,f)),nd=(r,f,g,v)=>{const _=ln(r,f).map(T=>T===!0?g(r):T);return v(_)},r0=(r,f,g,v,_)=>{const T=I=>_.extract(f.concat([v]),I),P=I=>I.fold(()=>Wi.svalue(V.none()),W=>{const J=_.extract(f.concat([v]),W);return Wi.map(J,V.some)});switch(r.tag){case"required":return o0(f,g,v,T);case"defaultedThunk":return s0(g,v,r.process,T);case"option":return q1(g,v,P);case"defaultedOptionThunk":return nd(g,v,r.process,P);case"mergeWithThunk":return s0(g,v,G({}),I=>{const W=ni(r.process(g),I);return T(W)})}},i0=(r,f,g)=>{const v={},_=[];for(const T of g)ah(T,(P,I,W,J)=>{const ie=r0(W,r,f,P,J);Wi.fold(ie,de=>{_.push(...de)},de=>{v[I]=de})},(P,I)=>{v[P]=I(f)});return _.length>0?Wi.serror(_):Wi.svalue(v)},pl=r=>({extract:(v,_)=>r().extract(v,_),toString:()=>r().toString()}),Ty=r=>Xs(Ls(r,Q)),_i=r=>{const f=fo(r),g=so(r,(_,T)=>ah(T,P=>ni(_,{[P]:!0}),G(_)),{});return{extract:(_,T)=>{const P=E(T)?[]:Ty(T),I=Kn(P,W=>!Qi(g,W));return I.length===0?f.extract(_,T):xy(_,I)},toString:f.toString}},fo=r=>({extract:(v,_)=>i0(v,_,r),toString:()=>`obj{
|
|
`+je(r,_=>ah(_,(T,P,I,W)=>T+" -> "+W.toString(),(T,P)=>"state("+T+")")).join(`
|
|
`)+"}"}),Dd=r=>({extract:(v,_)=>{const T=je(_,(P,I)=>r.extract(v.concat(["["+I+"]"]),P));return j1.consolidateArr(T)},toString:()=>"array("+r.toString()+")"}),Jn=(r,f)=>{const g=f!==void 0?f:we;return{extract:(T,P)=>{const I=[];for(const W of r){const J=W.extract(T,P);if(J.stype===Ko.Value)return{stype:Ko.Value,svalue:g(J.svalue)};I.push(J)}return j1.consolidateArr(I)},toString:()=>"oneOf("+je(r,T=>T.toString()).join(", ")+")"}},Ac=(r,f)=>{const g=(T,P)=>Dd(nf(r)).extract(T,P);return{extract:(T,P)=>{const I=Xs(P),W=g(T,I);return Wi.bind(W,J=>{const ie=je(J,de=>Ca(de,de,wr(),f));return fo(ie).extract(T,P)})},toString:()=>"setOf("+f.toString()+")"}},$f=(r,f)=>{const g=Mi(f);return{extract:(T,P)=>g().extract(T,P),toString:()=>g().toString()}},ch=ne(Dd,fo),Vc=G(n0),qg=(r,f)=>nf(g=>{const v=typeof g;return r(g)?Wi.svalue(g):Wi.serror(`Expected type: ${f} but got: ${v}`)}),Pd=qg(U,"number"),bl=qg(d,"string"),Iu=qg(E,"boolean"),Wp=qg(F,"function"),G1=r=>{if(Object(r)!==r)return!0;switch({}.toString.call(r).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(r).every(f=>G1(r[f]));default:return!1}},_n=nf(r=>G1(r)?Wi.svalue(r):Wi.serror("Expected value to be acceptable for sending via postMessage")),Xm=(r,f,g,v)=>ln(g,v).fold(()=>Rf(r,g,v),T=>T.extract(r.concat(["branch: "+v]),f)),Md=(r,f)=>({extract:(_,T)=>ln(T,r).fold(()=>Mv(_,r),I=>Xm(_,T,f,I)),toString:()=>"chooseOn("+r+"). Possible values: "+Xs(f)}),uh=()=>Dd(n0),of=r=>nf(f=>r(f).fold(Wi.serror,Wi.svalue)),K1=(r,f)=>Ac(g=>Wi.fromResult(r(g)),f),mi=(r,f,g)=>{const v=f.extract([r],g);return Wi.mapError(v,_=>({input:g,errors:_}))},Ui=(r,f,g)=>Wi.toResult(mi(r,f,g)),ba=r=>r.fold(f=>{throw new Error(Rd(f))},we),Es=(r,f,g)=>ba(Ui(r,f,g)),Rd=r=>`Errors:
|
|
`+td(r.errors).join(`
|
|
`)+`
|
|
|
|
Input object: `+t0(r.input),xl=(r,f)=>Md(r,Ns(f,fo)),sf=(r,f)=>$f(r,f),Wa=Ca,ka=iu,Up=r=>of(f=>st(r,f)?wn.value(f):wn.error(`Unsupported value: "${f}", choose one of "${r.join(", ")}".`)),nn=r=>Wa(r,r,wr(),Vc()),Kr=(r,f)=>Wa(r,r,wr(),f),a0=r=>Kr(r,Pd),xa=r=>Kr(r,bl),Ua=(r,f)=>Wa(r,r,wr(),Up(f)),Gg=r=>Kr(r,Iu),Wc=r=>Kr(r,Wp),od=(r,f)=>Wa(r,r,lh(),nf(g=>Wi.serror("The field: "+r+" is forbidden. "+f))),sd=(r,f)=>Wa(r,r,wr(),fo(f)),Yp=(r,f)=>Wa(r,r,wr(),ch(f)),Hl=(r,f)=>Wa(r,r,wr(),Dd(f)),Er=r=>Wa(r,r,lh(),Vc()),Ya=(r,f)=>Wa(r,r,lh(),f),fh=r=>Ya(r,Pd),Jl=r=>Ya(r,bl),l0=(r,f)=>Ya(r,Up(f)),jm=r=>Ya(r,Wp),J1=(r,f)=>Ya(r,Dd(f)),Xa=(r,f)=>Ya(r,fo(f)),hc=(r,f)=>Ya(r,_i(f)),xt=(r,f)=>Wa(r,r,ed(f),Vc()),Dc=(r,f,g)=>Wa(r,r,ed(f),g),au=(r,f)=>Dc(r,f,Pd),mc=(r,f)=>Dc(r,f,bl),Bu=(r,f,g)=>Dc(r,f,Up(g)),ja=(r,f)=>Dc(r,f,Iu),qa=(r,f)=>Dc(r,f,Wp),qm=(r,f)=>Dc(r,f,_n),lu=(r,f,g)=>Dc(r,f,Dd(g)),c0=(r,f,g)=>Dc(r,f,fo(g)),Ho=r=>{let f=r;return{get:()=>f,set:_=>{f=_}}},j={generate:r=>{if(!y(r))throw new Error("cases must be an array");if(r.length===0)throw new Error("there must be at least one case");const f=[],g={};return mt(r,(v,_)=>{const T=Xs(v);if(T.length!==1)throw new Error("one and only one name per case");const P=T[0],I=v[P];if(g[P]!==void 0)throw new Error("duplicate key detected:"+P);if(P==="cata")throw new Error("cannot have a case named cata (sorry)");if(!y(I))throw new Error("case arguments must be an array");f.push(P),g[P]=(...W)=>{const J=W.length;if(J!==I.length)throw new Error("Wrong number of arguments to case "+P+". Expected "+I.length+" ("+I+"), got "+J);return{fold:(...de)=>{if(de.length!==r.length)throw new Error("Wrong number of arguments to fold. Expected "+r.length+", got "+de.length);return de[_].apply(null,W)},match:de=>{const ge=Xs(de);if(f.length!==ge.length)throw new Error("Wrong number of arguments to match. Expected: "+f.join(",")+`
|
|
Actual: `+ge.join(","));if(!Gt(f,Ie=>st(ge,Ie)))throw new Error("Not all branches were specified when using match. Specified: "+ge.join(", ")+`
|
|
Required: `+f.join(", "));return de[P].apply(null,W)},log:de=>{console.log(de,{constructors:f,constructor:P,params:W})}}}}),g}};j.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ye=r=>{const f=[],g=[];return mt(r,v=>{v.fold(_=>{f.push(_)},_=>{g.push(_)})}),{errors:f,values:g}},Pe=(r,f)=>{const g={};return dr(r,(v,_)=>{st(f,_)||(g[_]=v)}),g},ct=(r,f)=>({[r]:f}),Ft=r=>{const f={};return mt(r,g=>{f[g.key]=g.value}),f},Sn=(r,f)=>Pe(r,f),In=(r,f)=>ct(r,f),Uo=r=>Ft(r),ts=(r,f)=>r.length===0?wn.value(f):wn.value(ni(f,Ad.apply(void 0,r))),Si=r=>wn.error(pt(r)),sr=(r,f)=>{const g=ye(r);return g.errors.length>0?Si(g.errors):ts(g.values,f)},_r=r=>F(r)?r:tt,Uc=(r,f,g)=>{let v=r.dom;const _=_r(g);for(;v.parentNode;){v=v.parentNode;const T=lt.fromDom(v),P=f(T);if(P.isSome())return P;if(_(T))break}return V.none()},cu=(r,f,g)=>{const v=f(r),_=_r(g);return v.orThunk(()=>_(r)?V.none():Uc(r,f,_))},rf=(r,f)=>xr(r.element,f.event.target),Nf={can:ot,abort:tt,run:L},dh=r=>{if(!Qi(r,"can")&&!Qi(r,"abort")&&!Qi(r,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(r,null,2)+" does not have can, abort, or run!");return{...Nf,...r}},hh=(r,f)=>(...g)=>Yo(r,(v,_)=>v&&f(_).apply(void 0,g),!0),hr=(r,f)=>(...g)=>Yo(r,(v,_)=>v||f(_).apply(void 0,g),!1),Gm=r=>F(r)?{can:ot,abort:tt,run:r}:r,Km=r=>{const f=hh(r,_=>_.can),g=hr(r,_=>_.abort);return{can:f,abort:g,run:(..._)=>{mt(r,T=>{T.run.apply(void 0,_)})}}},oa=G,uu=oa("touchstart"),Xp=oa("touchmove"),Jm=oa("touchend"),Ps=oa("touchcancel"),Fr=oa("mousedown"),Ma=oa("mousemove"),gc=oa("mouseout"),eb=oa("mouseup"),Tl=oa("mouseover"),Gi=oa("focusin"),fu=oa("focusout"),If=oa("keydown"),Jw=oa("keyup"),om=oa("input"),Kg=oa("change"),sm=oa("click"),eg=oa("transitioncancel"),Jg=oa("transitionend"),u0=oa("transitionstart"),rm=oa("selectstart"),Ra=r=>G("alloy."+r),mh={tap:Ra("tap")},$d=Ra("focus"),tg=Ra("blur.post"),ng=Ra("paste.post"),im=Ra("receive"),af=Ra("execute"),f0=Ra("focus.item"),tb=mh.tap,e_=Ra("longpress"),$a=Ra("sandbox.close"),ep=Ra("typeahead.cancel"),og=Ra("system.init"),du=Ra("system.touchmove"),Bf=Ra("system.touchend"),sg=Ra("system.scroll"),gh=Ra("system.resize"),Lu=Ra("system.attached"),Nd=Ra("system.detached"),rg=Ra("system.dismissRequested"),d0=Ra("system.repositionRequested"),Rv=Ra("focusmanager.shifted"),$v=Ra("slotcontainer.visibility"),ph=Ra("system.external.element.scroll"),tp=Ra("change.tab"),Nv=Ra("dismiss.tab"),ig=Ra("highlight"),Iv=Ra("dehighlight"),rr=(r,f)=>{np(r,r.element,f,{})},Ao=(r,f,g)=>{np(r,r.element,f,g)},bh=r=>{rr(r,af())},nb=(r,f,g)=>{np(r,f,g,{})},np=(r,f,g,v)=>{const _={target:f,...v};r.getSystem().triggerEvent(g,f,_)},WC=(r,f,g,v)=>{const _={...v,target:f};r.getSystem().triggerEvent(g,f,_)},Bv=(r,f,g,v)=>{r.getSystem().triggerEvent(g,f,v.event)},li=r=>Uo(r),Lv=(r,f)=>({key:r,value:dh({abort:f})}),ob=(r,f)=>({key:r,value:dh({can:f})}),Ey=r=>({key:r,value:dh({run:(f,g)=>{g.event.prevent()}})}),on=(r,f)=>({key:r,value:dh({run:f})}),Id=(r,f,g)=>({key:r,value:dh({run:(v,_)=>{f.apply(void 0,[v,_].concat(g))}})}),t_=r=>f=>on(r,f),h0=r=>f=>({key:r,value:dh({run:(g,v)=>{rf(g,v)&&f(g,v)}})}),UC=(r,f)=>on(r,(g,v)=>{g.getSystem().getByUid(f).each(_=>{Bv(_,_.element,r,v)})}),ag=(r,f,g)=>{const v=f.partUids[g];return UC(r,v)},Ay=(r,f)=>on(r,(g,v)=>{const _=v.event,T=g.getSystem().getByDom(_.target).getOrThunk(()=>cu(_.target,I=>g.getSystem().getByDom(I).toOptional(),tt).getOr(g));f(g,T,v)}),am=r=>on(r,(f,g)=>{g.cut()}),Bd=r=>on(r,(f,g)=>{g.stop()}),lg=(r,f)=>h0(r)(f),Ci=h0(Lu()),Ld=h0(Nd()),Fd=h0(og()),hu=t_(af()),Qs=(r,f)=>{const v=(f||document).createElement("div");return v.innerHTML=r,Xl(lt.fromDom(v))},jp=r=>r.dom.innerHTML,vh=(r,f)=>{const v=ca(r).dom,_=lt.fromDom(v.createDocumentFragment()),T=Qs(f,v);tf(_,T),ii(r),il(r,_)},op=r=>{const f=lt.fromTag("div"),g=lt.fromDom(r.dom.cloneNode(!0));return il(f,g),jp(f)},YC=(r,f)=>lt.fromDom(r.dom.cloneNode(f)),m0=r=>YC(r,!1),Fv=r=>{if(De(r))return"#shadow-root";{const f=m0(r);return op(f)}},El=r=>Fv(r),TE=(r,f,g)=>xr(f,r.element)&&!xr(f,g),sp=li([ob($d(),(r,f)=>{const g=f.event,v=g.originator,_=g.target;return TE(r,v,_)?(console.warn($d()+` did not get interpreted by the desired target.
|
|
Originator: `+El(v)+`
|
|
Target: `+El(_)+`
|
|
Check the `+$d()+" event handlers"),!1):!0})]);var Al=Object.freeze({__proto__:null,events:sp});let Dy=0;const io=r=>{const g=new Date().getTime(),v=Math.floor(Math.random()*1e9);return Dy++,r+"_"+v+Dy+String(g)},Py=G("alloy-id-"),XC=G("data-alloy-id"),My=Py(),lm=XC(),lf=(r,f)=>{const g=io(My+r);return Oh(f,g),g},Oh=(r,f)=>{Object.defineProperty(r.dom,lm,{value:f,writable:!0})},rp=r=>{const f=yr(r)?r.dom[lm]:null;return V.from(f)},yh=r=>io(r),g0=we,Lf=r=>{const f=_=>`The component must be in a context to execute: ${_}`+(r?`
|
|
`+El(r().element)+" is not in context.":""),g=_=>()=>{throw new Error(f(_))},v=_=>()=>{console.warn(f(_))};return{debugInfo:G("fake"),triggerEvent:v("triggerEvent"),triggerFocus:v("triggerFocus"),triggerEscape:v("triggerEscape"),broadcast:v("broadcast"),broadcastOn:v("broadcastOn"),broadcastEvent:v("broadcastEvent"),build:g("build"),buildOrPatch:g("buildOrPatch"),addToWorld:g("addToWorld"),removeFromWorld:g("removeFromWorld"),addToGui:g("addToGui"),removeFromGui:g("removeFromGui"),getByUid:g("getByUid"),getByDom:g("getByDom"),isConnected:tt}},ip=Lf(),Ry=(r,f,g)=>{const v=g.toString(),_=v.indexOf(")")+1,T=v.indexOf("("),P=v.substring(T+1,_-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:f,parameters:qp(P.slice(0,1).concat(P.slice(3)))}),r},qp=r=>je(r,f=>Zi(f,"/*")?f.substring(0,f.length-2):f),rd=(r,f)=>{const g=r.toString(),v=g.indexOf(")")+1,_=g.indexOf("("),T=g.substring(_+1,v-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:f,parameters:qp(T)}),r},$y=(r,f)=>{const g=f.toString(),v=g.indexOf(")")+1,_=g.indexOf("("),T=g.substring(_+1,v-1).split(/,\s*/);return r.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:qp(T.slice(1))}),r},wh=io("alloy-premade"),Qv=r=>(Object.defineProperty(r.element.dom,wh,{value:r.uid,writable:!0}),In(wh,r)),n_=r=>vs(r.dom,wh),Ny=r=>ln(r,wh),ap=r=>$y((f,...g)=>r(f.getApis(),f,...g),r),Ff={init:()=>mu({readState:G("No State required")})},mu=r=>r,lp=(r,f)=>{const g=je(f,_=>Xa(_.name(),[nn("config"),xt("state",Ff)])),v=Ui("component.behaviours",fo(g),r.behaviours).fold(_=>{throw new Error(Rd(_)+`
|
|
Complete spec:
|
|
`+JSON.stringify(r,null,2))},we);return{list:f,data:Ns(v,_=>{const T=_.map(P=>({config:P.config,state:P.state.init(P.config)}));return G(T)})}},Iy=r=>r.list,o_=r=>r.data,p0=(r,f)=>{const g={};return dr(r,(v,_)=>{dr(v,(T,P)=>{const I=ln(g,P).getOr([]);g[P]=I.concat([f(_,T)])})}),g},Yc=r=>({classes:R(r.classes)?[]:r.classes,attributes:R(r.attributes)?{}:r.attributes,styles:R(r.styles)?{}:r.styles}),b0=(r,f)=>({...r,attributes:{...r.attributes,...f.attributes},styles:{...r.styles,...f.styles},classes:r.classes.concat(f.classes)}),cf=(r,f,g,v)=>{const _={...f};mt(g,ie=>{_[ie.name()]=ie.exhibit(r,v)});const T=p0(_,(ie,de)=>({name:ie,modification:de})),P=ie=>so(ie,(de,ge)=>({...ge.modification,...de}),{}),I=so(T.classes,(ie,de)=>de.modification.concat(ie),[]),W=P(T.attributes),J=P(T.styles);return Yc({classes:I,attributes:W,styles:J})},cp=(r,f,g,v)=>{try{const _=ps(g,(T,P)=>{const I=T[f],W=P[f],J=v.indexOf(I),ie=v.indexOf(W);if(J===-1)throw new Error("The ordering for "+r+" does not have an entry for "+I+`.
|
|
Order specified: `+JSON.stringify(v,null,2));if(ie===-1)throw new Error("The ordering for "+r+" does not have an entry for "+W+`.
|
|
Order specified: `+JSON.stringify(v,null,2));return J<ie?-1:ie<J?1:0});return wn.value(_)}catch(_){return wn.error([_])}},cm=(r,f)=>({handler:r,purpose:f}),Zv=(r,f)=>({cHandler:r,purpose:f}),s_=(r,f)=>Zv(Re.apply(void 0,[r.handler].concat(f)),r.purpose),Gp=r=>r.cHandler,By=(r,f)=>({name:r,handler:f}),up=(r,f)=>{const g={};return mt(r,v=>{g[v.name()]=v.handlers(f)}),g},v0=(r,f,g)=>{const v={...g,...up(f,r)};return p0(v,By)},sb=(r,f,g,v)=>{const _=v0(r,g,v);return jC(_,f)},Ly=r=>{const f=Gm(r);return(g,v,..._)=>{const T=[g,v].concat(_);f.abort.apply(void 0,T)?v.stop():f.can.apply(void 0,T)&&f.run.apply(void 0,T)}},Fy=(r,f)=>wn.error(["The event ("+r+`) 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(je(f,g=>g.name),null,2)]),r_=(r,f,g)=>{const v=f[g];return v?cp("Event: "+g,"name",r,v).map(_=>{const T=je(_,P=>P.handler);return Km(T)}):Fy(g,r)},jC=(r,f)=>{const g=aa(r,(v,_)=>(v.length===1?wn.value(v[0].handler):r_(v,f,_)).map(P=>{const I=Ly(P),W=v.length>1?Kn(f[_],J=>rn(v,ie=>ie.name===J)).join(" > "):v[0].name;return In(_,cm(I,W))}));return sr(g,{})},Qr="alloy.base.behaviour",Hv=fo([Wa("dom","dom",wr(),fo([nn("tag"),xt("styles",{}),xt("classes",[]),xt("attributes",{}),Er("value"),Er("innerHtml")])),nn("components"),nn("uid"),xt("events",{}),xt("apis",{}),Wa("eventOrder","eventOrder",Mf({[af()]:["disabling",Qr,"toggling","typeaheadevents"],[$d()]:[Qr,"focusing","keying"],[og()]:[Qr,"disabling","toggling","representing"],[om()]:[Qr,"representing","streaming","invalidating"],[Nd()]:[Qr,"representing","item-events","tooltipping"],[Fr()]:["focusing",Qr,"item-type-events"],[uu()]:["focusing",Qr,"item-type-events"],[Tl()]:["item-type-events","tooltipping"],[im()]:["receiving","reflecting","tooltipping"]}),Vc()),Er("domModification")]),Qy=r=>Ui("custom.definition",Hv,r),Zy=r=>({...r.dom,uid:r.uid,domChildren:je(r.components,f=>f.element)}),O0=r=>r.domModification.fold(()=>Yc({}),Yc),qC=r=>r.events,um=(r,f)=>{const g=zi(r,f);return g===void 0||g===""?[]:g.split(" ")},Ga=(r,f,g)=>{const _=um(r,f).concat([g]);return qn(r,f,_.join(" ")),!0},y0=(r,f,g)=>{const v=Kn(um(r,f),_=>_!==g);return v.length>0?qn(r,f,v.join(" ")):Ue(r,f),!1},rb=r=>r.dom.classList!==void 0,i_=r=>um(r,"class"),w0=(r,f)=>Ga(r,"class",f),Hy=(r,f)=>y0(r,"class",f),Na=(r,f)=>{rb(r)?r.dom.classList.add(f):w0(r,f)},_h=r=>{(rb(r)?r.dom.classList:i_(r)).length===0&&Ue(r,"class")},va=(r,f)=>{rb(r)?r.dom.classList.remove(f):Hy(r,f),_h(r)},uf=(r,f)=>rb(r)&&r.dom.classList.contains(f),cg=(r,f)=>{mt(f,g=>{Na(r,g)})},Xc=(r,f)=>{mt(f,g=>{va(r,g)})},GC=(r,f)=>Gt(f,g=>uf(r,g)),zy=r=>{const f=r.dom.classList,g=new Array(f.length);for(let v=0;v<f.length;v++){const _=f.item(v);_!==null&&(g[v]=_)}return g},id=r=>rb(r)?zy(r):i_(r),Ia=r=>r.dom.value,Ta=(r,f)=>{if(f===void 0)throw new Error("Value.set was undefined");r.dom.value=f},KC=(r,f,g)=>Hc(r,f).map(_=>{if(g.exists(P=>!xr(P,_))){const P=g.map(gl).getOr("span"),I=lt.fromTag(P);return Sa(_,I),I}else return _}),Sh=(r,f,g)=>{g.fold(()=>il(r,f),v=>{xr(v,f)||(Sa(v,f),Mu(v))})},_0=(r,f,g)=>{const v=je(f,g),_=Xl(r);return mt(_.slice(v.length),Mu),v},zv=(r,f,g,v)=>{const _=Hc(r,f),T=v(g,_),P=KC(r,f,_);return Sh(r,T.element,P),T},ad=(r,f,g)=>_0(r,f,(v,_)=>zv(r,_,v,g)),ff=(r,f)=>_0(r,f,(g,v)=>{const _=Hc(r,v);return Sh(r,g,_),g}),Kp=(r,f)=>{const g=Xs(r),v=Xs(f),_=At(v,g),T=Rr(r,(P,I)=>!vs(f,I)||P!==f[I]).t;return{toRemove:_,toSet:T}},ib=(r,f)=>{const{class:g,style:v,..._}=It(f),{toSet:T,toRemove:P}=Kp(r.attributes,_),I=()=>{mt(P,Yt=>Ue(f,Yt)),Zm(f,T)},W=ri(f),{toSet:J,toRemove:ie}=Kp(r.styles,W),de=()=>{mt(ie,Yt=>ks(f,Yt)),yi(f,J)},ge=id(f),_e=At(ge,r.classes),Ie=At(r.classes,ge),it=()=>{cg(f,Ie),Xc(f,_e)},Qt=Yt=>{vh(f,Yt)},dt=()=>{const Yt=r.domChildren;ff(f,Yt)},ft=()=>{const Yt=f,Dt=r.value.getOrUndefined();Dt!==Ia(Yt)&&Ta(Yt,Dt!=null?Dt:"")};return I(),it(),de(),r.innerHtml.fold(dt,Qt),ft(),f},S0=r=>{const f=lt.fromTag(r.tag);Zm(f,r.attributes),cg(f,r.classes),yi(f,r.styles),r.innerHtml.each(v=>vh(f,v));const g=r.domChildren;return tf(f,g),r.value.each(v=>{Ta(f,v)}),f},C0=(r,f)=>{try{const g=ib(r,f);return V.some(g)}catch{return V.none()}},a_=r=>r.innerHtml.isSome()&&r.domChildren.length>0,Vy=(r,f)=>{const g=_=>gl(_)===r.tag&&!a_(r)&&!n_(_),v=f.filter(g).bind(_=>C0(r,_)).getOrThunk(()=>S0(r));return Oh(v,r.uid),v},JC=r=>{const f=ln(r,"behaviours").getOr({});return Ne(Xs(f),g=>{const v=f[g];return Q(v)?[v.me]:[]})},l_=(r,f)=>lp(r,f),c_=r=>{const f=JC(r);return l_(r,f)},Wy=(r,f,g)=>{const v=Zy(r),_=O0(r),T={"alloy.base.modification":_},P=f.length>0?cf(g,T,f,v):_;return b0(v,P)},u_=(r,f,g)=>{const v={"alloy.base.behaviour":qC(r)};return sb(g,r.eventOrder,f,v).getOrDie()},EE=(r,f)=>{const g=()=>Yt,v=Ho(ip),_=ba(Qy(r)),T=c_(r),P=Iy(T),I=o_(T),W=Wy(_,P,I),J=Vy(W,f),ie=u_(_,P,I),de=Ho(_.components),ge=Dt=>{v.set(Dt)},_e=()=>{v.set(Lf(g))},Ie=()=>{const Dt=Xl(J),kn=Ne(Dt,pn=>v.get().getByDom(pn).fold(()=>[],zn));de.set(kn)},it=Dt=>{const kn=I;return(F(kn[Dt.name()])?kn[Dt.name()]:()=>{throw new Error("Could not find "+Dt.name()+" in "+JSON.stringify(r,null,2))})()},Qt=Dt=>F(I[Dt.name()]),dt=()=>_.apis,ft=Dt=>I[Dt]().map(kn=>kn.state.readState()).getOr("not enabled"),Yt={uid:r.uid,getSystem:v.get,config:it,hasConfigured:Qt,spec:r,readState:ft,getApis:dt,connect:ge,disconnect:_e,element:J,syncComponents:Ie,components:de.get,events:ie};return Yt},Vv=(r,f)=>{const g=ln(r,"components").getOr([]);return f.fold(()=>je(g,pc),v=>je(g,(_,T)=>ug(_,Hc(v,T))))},f_=(r,f)=>{const{events:g,...v}=g0(r),_=Vv(v,f),T={...v,events:{...Al,...g},components:_};return wn.value(EE(T,f))},Li=r=>{const f=lt.fromText(r);return Wv({element:f})},Wv=r=>{const f=Es("external.component",_i([nn("element"),Er("uid")]),r),g=Ho(Lf()),v=I=>{g.set(I)},_=()=>{g.set(Lf(()=>P))},T=f.uid.getOrThunk(()=>yh("external"));Oh(f.element,T);const P={uid:T,getSystem:g.get,config:V.none,hasConfigured:tt,connect:v,disconnect:_,getApis:()=>({}),element:f.element,spec:r,readState:G("No state"),syncComponents:L,components:G([]),events:{}};return Qv(P)},Uy=yh,d_=r=>vs(r,"uid"),ug=(r,f)=>Ny(r).getOrThunk(()=>{const g=d_(r)?r:{uid:Uy(""),...r};return f_(g,f).getOrDie()}),pc=r=>ug(r,V.none()),gu=Qv;var h_=(r,f,g,v,_)=>r(g,v)?V.some(g):F(_)&&_(g)?V.none():f(g,v,_);const Yy=(r,f,g)=>{let v=r.dom;const _=F(g)?g:tt;for(;v.parentNode;){v=v.parentNode;const T=lt.fromDom(v);if(f(T))return V.some(T);if(_(T))break}return V.none()},fp=(r,f,g)=>h_((_,T)=>T(_),Yy,r,f,g),dp=(r,f)=>{const g=_=>f(lt.fromDom(_));return kt(r.dom.childNodes,g).map(lt.fromDom)},Jp=(r,f)=>{const g=v=>{for(let _=0;_<v.childNodes.length;_++){const T=lt.fromDom(v.childNodes[_]);if(f(T))return V.some(T);const P=g(v.childNodes[_]);if(P.isSome())return P}return V.none()};return g(r.dom)},e1=(r,f,g)=>fp(r,f,g).isSome(),fg=(r,f,g)=>Yy(r,v=>Aa(v,f),g),Uv=(r,f)=>dp(r,g=>Aa(g,f)),sa=(r,f)=>xf(f,r),df=(r,f,g)=>h_((_,T)=>Aa(_,T),fg,r,f,g),ab="aria-controls",ek=r=>fp(r,g=>{if(!yr(g))return!1;const v=zi(g,"id");return v!==void 0&&v.indexOf(ab)>-1}).bind(g=>{const v=zi(g,"id"),_=$t(g);return sa(_,`[${ab}="${v}"]`)}),Xy=()=>{const r=io(ab);return{id:r,link:v=>{qn(v,ab,r)},unlink:v=>{Ue(v,ab)}}},tk=(r,f)=>ek(f).exists(g=>t1(r,g)),t1=(r,f)=>e1(f,g=>xr(g,r.element),tt)||tk(r,f),lb="unknown";var ld;(function(r){r[r.STOP=0]="STOP",r[r.NORMAL=1]="NORMAL",r[r.LOGGING=2]="LOGGING"})(ld||(ld={}));const jy=Ho({}),m_=(r,f)=>{const g=[],v=new Date().getTime();return{logEventCut:(_,T,P)=>{g.push({outcome:"cut",target:T,purpose:P})},logEventStopped:(_,T,P)=>{g.push({outcome:"stopped",target:T,purpose:P})},logNoParent:(_,T,P)=>{g.push({outcome:"no-parent",target:T,purpose:P})},logEventNoHandlers:(_,T)=>{g.push({outcome:"no-handlers-left",target:T})},logEventResponse:(_,T,P)=>{g.push({outcome:"response",purpose:P,target:T})},write:()=>{const _=new Date().getTime();st(["mousemove","mouseover","mouseout",og()],r)||console.log(r,{event:r,time:_-v,target:f.dom,sequence:je(g,T=>st(["cut","stopped","response"],T.outcome)?"{"+T.purpose+"} "+T.outcome+" at ("+El(T.target)+")":T.outcome)})}}},g_=(r,f,g)=>{switch(ln(jy.get(),r).orThunk(()=>{const _=Xs(jy.get());return tr(_,T=>r.indexOf(T)>-1?V.some(jy.get()[T]):V.none())}).getOr(ld.NORMAL)){case ld.NORMAL:return g(b_());case ld.LOGGING:{const _=m_(r,f),T=g(_);return _.write(),T}case ld.STOP:return!0}},nk=["alloy/data/Fields","alloy/debugging/Debugging"],p_=()=>{const r=new Error;if(r.stack!==void 0){const f=r.stack.split(`
|
|
`);return kt(f,g=>g.indexOf("alloy")>0&&!rn(nk,v=>g.indexOf(v)>-1)).getOr(lb)}else return lb},k0={logEventCut:L,logEventStopped:L,logNoParent:L,logEventNoHandlers:L,logEventResponse:L,write:L},x0=(r,f,g)=>g_(r,f,g),b_=G(k0),qy=G([nn("menu"),nn("selectedMenu")]),n1=G([nn("item"),nn("selectedItem")]);G(fo(n1().concat(qy())));const v_=G(fo(n1())),o1=sd("initSize",[nn("numColumns"),nn("numRows")]),dg=()=>Kr("markers",v_()),Yv=()=>sd("markers",[nn("backgroundMenu")].concat(qy()).concat(n1())),hf=r=>sd("markers",je(r,nn)),cb=(r,f,g)=>(p_(),Wa(f,f,g,of(v=>wn.value((..._)=>v.apply(void 0,_))))),qs=r=>cb("onHandler",r,ed(L)),pu=r=>cb("onKeyboardHandler",r,ed(V.none)),hg=r=>cb("onHandler",r,wr()),Gy=r=>cb("onKeyboardHandler",r,wr()),Yi=(r,f)=>ka(r,G(f)),Ky=r=>ka(r,we),mg=G(o1),Oa=(r,f,g,v,_,T,P,I=!1)=>({x:r,y:f,bubble:g,direction:v,placement:_,restriction:T,label:`${P}-${_}`,alwaysFit:I}),fm=j.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Vt=(r,f,g,v,_,T,P,I,W)=>r.fold(f,g,v,_,T,P,I,W),T0=(r,f,g,v)=>r.fold(f,f,v,v,f,v,g,g),Jy=(r,f,g,v)=>r.fold(f,v,f,v,g,g,f,v),E0=fm.southeast,Ch=fm.southwest,mf=fm.northeast,ub=fm.northwest,Xv=fm.south,e2=fm.north,jv=fm.east,A0=fm.west,kh=(r,f,g,v)=>{const _=r+f;return _>v?g:_<g?v:_},cd=(r,f,g)=>Math.min(Math.max(r,f),g),Fu=(r,f)=>{switch(f){case 1:return r.x;case 0:return r.x+r.width;case 2:return r.y;case 3:return r.y+r.height}},zl=(r,f)=>An(["left","right","top","bottom"],g=>ln(f,g).map(v=>Fu(r,v))),t2=(r,f,g)=>{const v=(W,J)=>f[W].map(ie=>{const de=W==="top"||W==="bottom",ge=de?g.top:g.left,Ie=(W==="left"||W==="top"?Math.max:Math.min)(ie,J)+ge;return de?cd(Ie,r.y,r.bottom):cd(Ie,r.x,r.right)}).getOr(J),_=v("left",r.x),T=v("top",r.y),P=v("right",r.right),I=v("bottom",r.bottom);return ai(_,T,P-_,I-T)},hp="layout",O_=r=>r.x,D0=(r,f)=>r.x+r.width/2-f.width/2,s1=(r,f)=>r.x+r.width-f.width,n2=(r,f)=>r.y-f.height,qv=r=>r.y+r.height,y_=(r,f)=>r.y+r.height/2-f.height/2,Gv=r=>r.x+r.width,o2=(r,f)=>r.x-f.width,vl=(r,f,g)=>Oa(O_(r),qv(r),g.southeast(),E0(),"southeast",zl(r,{left:1,top:3}),hp),ec=(r,f,g)=>Oa(s1(r,f),qv(r),g.southwest(),Ch(),"southwest",zl(r,{right:0,top:3}),hp),Qu=(r,f,g)=>Oa(O_(r),n2(r,f),g.northeast(),mf(),"northeast",zl(r,{left:1,bottom:2}),hp),Zr=(r,f,g)=>Oa(s1(r,f),n2(r,f),g.northwest(),ub(),"northwest",zl(r,{right:0,bottom:2}),hp),tc=(r,f,g)=>Oa(D0(r,f),n2(r,f),g.north(),e2(),"north",zl(r,{bottom:2}),hp),Vl=(r,f,g)=>Oa(D0(r,f),qv(r),g.south(),Xv(),"south",zl(r,{top:3}),hp),dm=(r,f,g)=>Oa(Gv(r),y_(r,f),g.east(),jv(),"east",zl(r,{left:0}),hp),Sr=(r,f,g)=>Oa(o2(r,f),y_(r,f),g.west(),A0(),"west",zl(r,{right:1}),hp),w_=()=>[vl,ec,Qu,Zr,Vl,tc,dm,Sr],bu=()=>[ec,vl,Zr,Qu,Vl,tc,dm,Sr],Dl=()=>[Qu,Zr,vl,ec,tc,Vl],s2=()=>[Zr,Qu,ec,vl,tc,Vl],gg=()=>[vl,ec,Qu,Zr,Vl,tc],bc=()=>[ec,vl,Zr,Qu,Vl,tc],AE=(r,f)=>f.universal?r:Kn(r,g=>st(f.channels,g));var ok=Object.freeze({__proto__:null,events:r=>li([on(im(),(f,g)=>{const v=r.channels,_=Xs(v),T=g,P=AE(_,T);mt(P,I=>{const W=v[I],J=W.schema,ie=Es("channel["+I+`] data
|
|
Receiver: `+El(f.element),J,T.data);W.onReceive(f,ie)})})])}),sk=[Kr("channels",K1(wn.value,_i([hg("onReceive"),xt("schema",Vc())])))];const r2=(r,f,g)=>hu(v=>{g(v,r,f)}),i2=(r,f,g)=>Fd((v,_)=>{g(v,r,f)}),hm=(r,f,g,v,_,T)=>{const P=_i(r),I=Xa(f,[hc("config",r)]);return Pl(P,I,f,g,v,_,T)},a2=(r,f,g,v,_,T)=>{const P=r,I=Xa(f,[Ya("config",r)]);return Pl(P,I,f,g,v,_,T)},r1=(r,f,g)=>Ry((_,...T)=>{const P=[_].concat(T);return _.config({name:G(r)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+g)},I=>{const W=Array.prototype.slice.call(P,1);return f.apply(void 0,[_,I.config,I.state].concat(W))})},g,f),Ol=r=>({key:r,value:void 0}),Pl=(r,f,g,v,_,T,P)=>{const I=de=>Qi(de,g)?de[g]():V.none(),W=Ns(_,(de,ge)=>r1(g,de,ge)),ie={...Ns(T,(de,ge)=>rd(de,ge)),...W,revoke:Re(Ol,g),config:de=>{const ge=Es(g+"-config",r,de);return{key:g,value:{config:ge,me:ie,configAsRaw:Mi(()=>Es(g+"-config",r,de)),initialConfig:de,state:P}}},schema:G(f),exhibit:(de,ge)=>Yn(I(de),ln(v,"exhibit"),(_e,Ie)=>Ie(ge,_e.config,_e.state)).getOrThunk(()=>Yc({})),name:G(g),handlers:de=>I(de).map(ge=>ln(v,"events").getOr(()=>({}))(ge.config,ge.state)).getOr({})};return ie},Tn=r=>Uo(r),rk=_i([nn("fields"),nn("name"),xt("active",{}),xt("apis",{}),xt("state",Ff),xt("extra",{})]),nc=r=>{const f=Es("Creating behaviour: "+r.name,rk,r);return hm(f.fields,f.name,f.active,f.apis,f.extra,f.state)},ik=_i([nn("branchKey"),nn("branches"),nn("name"),xt("active",{}),xt("apis",{}),xt("state",Ff),xt("extra",{})]),l2=r=>{const f=Es("Creating behaviour: "+r.name,ik,r);return a2(xl(f.branchKey,f.branches),f.name,f.active,f.apis,f.extra,f.state)},no=G(void 0),Pc=nc({fields:sk,name:"receiving",active:ok});var fb=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({classes:[],styles:f.useFixed()?{}:{position:"relative"}})});const gf=r=>r.dom.focus(),Kv=r=>r.dom.blur(),i1=r=>{const f=$t(r).dom;return r.dom===f.activeElement},Qf=(r=rh())=>V.from(r.dom.activeElement).map(lt.fromDom),al=r=>Qf($t(r)).filter(f=>r.dom.contains(f.dom)),Qd=(r,f)=>{const g=$t(f),v=Qf(g).bind(T=>{const P=I=>xr(T,I);return P(f)?V.some(f):Jp(f,P)}),_=r(f);return v.each(T=>{Qf(g).filter(P=>xr(P,T)).fold(()=>{gf(T)},L)}),_},Zd=(r,f,g,v,_)=>{const T=P=>P+"px";return{position:r,left:f.map(T),top:g.map(T),right:v.map(T),bottom:_.map(T)}},jc=r=>({...r,position:V.some(r.position)}),db=(r,f)=>{gn(r,jc(f))},u2=j.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),__=(r,f,g,v,_,T)=>{const P=f.rect,I=P.x-g,W=P.y-v,J=P.width,ie=P.height,de=_-(I+J),ge=T-(W+ie),_e=V.some(I),Ie=V.some(W),it=V.some(de),Qt=V.some(ge),dt=V.none();return Vt(f.direction,()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,dt,Ie,it,dt),()=>Zd(r,_e,dt,dt,Qt),()=>Zd(r,dt,dt,it,Qt),()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,_e,dt,dt,Qt),()=>Zd(r,_e,Ie,dt,dt),()=>Zd(r,dt,Ie,it,dt))},f2=(r,f)=>r.fold(()=>{const g=f.rect;return Zd("absolute",V.some(g.x),V.some(g.y),V.none(),V.none())},(g,v,_,T)=>__("absolute",f,g,v,_,T),(g,v,_,T)=>__("fixed",f,g,v,_,T)),xh=(r,f)=>{const g=Re(tm,f),v=r.fold(g,g,()=>{const P=dc();return tm(f).translate(-P.left,-P.top)}),_=za(f),T=Xf(f);return ai(v.left,v.top,_,T)},jr=(r,f)=>f.fold(()=>r.fold(ue,ue,ai),g=>r.fold(G(g),G(g),()=>{const v=Jv(r,g.x,g.y);return ai(v.left,v.top,g.width,g.height)})),Jv=(r,f,g)=>{const v=pr(f,g),_=()=>{const T=dc();return v.translate(-T.left,-T.top)};return r.fold(G(v),G(v),_)},ud=(r,f,g,v)=>r.fold(f,g,v);u2.none;const S_=u2.relative,C_=u2.fixed,fa=(r,f)=>({anchorBox:r,origin:f}),ak=(r,f)=>fa(r,f),eO="data-alloy-placement",tO=(r,f)=>{qn(r,eO,f)},k_=r=>me(r,eO),lk=r=>Ue(r,eO),hb=j.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),x_=(r,f)=>{const{x:g,y:v,right:_,bottom:T}=f,{x:P,y:I,right:W,bottom:J,width:ie,height:de}=r,ge=P>=g&&P<=_,_e=I>=v&&I<=T,Ie=ge&&_e,it=W<=_&&W>=g,Qt=J<=T&&J>=v,dt=it&&Qt,ft=Math.min(ie,P>=g?_-P:W-g),Yt=Math.min(de,I>=v?T-I:J-v);return{originInBounds:Ie,sizeInBounds:dt,visibleW:ft,visibleH:Yt}},ck=(r,f)=>{const{x:g,y:v,right:_,bottom:T}=f,{x:P,y:I,width:W,height:J}=r,ie=Math.max(g,_-W),de=Math.max(v,T-J),ge=cd(P,g,ie),_e=cd(I,v,de),Ie=Math.min(ge+W,_)-ge,it=Math.min(_e+J,T)-_e;return ai(ge,_e,Ie,it)},T_=(r,f,g)=>{const v=G(f.bottom-g.y),_=G(g.bottom-f.y),T=T0(r,_,_,v),P=G(f.right-g.x),I=G(g.right-f.x);return{maxWidth:Jy(r,I,I,P),maxHeight:T}},uk=(r,f,g,v)=>{const _=r.bubble,T=_.offset,P=t2(v,r.restriction,T),I=r.x+T.left,W=r.y+T.top,J=ai(I,W,f,g),{originInBounds:ie,sizeInBounds:de,visibleW:ge,visibleH:_e}=x_(J,P),Ie=ie&&de,it=Ie?J:ck(J,P),Qt=it.width>0&&it.height>0,{maxWidth:dt,maxHeight:ft}=T_(r.direction,it,v),Yt={rect:it,maxHeight:ft,maxWidth:dt,direction:r.direction,placement:r.placement,classes:{on:_.classesOn,off:_.classesOff},layout:r.label,testY:W};return Ie||r.alwaysFit?hb.fit(Yt):hb.nofit(Yt,ge,_e,Qt)},E_=(r,f,g,v,_,T)=>{const P=v.width,I=v.height,W=(ie,de,ge,_e,Ie)=>{const it=ie(g,v,_,r,T),Qt=uk(it,P,I,T);return Qt.fold(G(Qt),(dt,ft,Yt,Dt)=>(Ie===Dt?Yt>_e||ft>ge:!Ie&&Dt)?Qt:hb.nofit(de,ge,_e,Ie))};return Yo(f,(ie,de)=>{const ge=Re(W,de);return ie.fold(G(ie),ge)},hb.nofit({rect:g,maxHeight:v.height,maxWidth:v.width,direction:E0(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:g.y},-1,-1,!1)).fold(we,we)},nO=r=>{const f=Ho(V.none()),g=()=>f.get().each(r);return{clear:()=>{g(),f.set(V.none())},isSet:()=>f.get().isSome(),get:()=>f.get(),set:I=>{g(),f.set(V.some(I))}}},mp=()=>nO(r=>r.destroy()),mb=()=>nO(r=>r.unbind()),Xi=()=>{const r=nO(L);return{...r,on:g=>r.get().each(g)}},d2=ot,Mc=(r,f,g)=>wi(r,f,d2,g),gb=(r,f,g)=>oh(r,f,d2,g),ll=or,A_=["top","bottom","right","left"],mm="data-alloy-transition-timer",fk=(r,f)=>GC(r,f.classes),oc=(r,f,g)=>g.exists(v=>{const _=r.mode;return _==="all"?!0:v[_]!==f[_]}),pf=(r,f)=>{const g=v=>parseFloat(v).toFixed(3);return bs(f,(v,_)=>{const T=r[_].map(g),P=v.map(g);return!et(T,P)}).isSome()},P0=r=>{const f=T=>{const I=Gr(r,T).split(/\s*,\s*/);return Kn(I,Ge)},g=T=>{if(d(T)&&/^[\d.]+/.test(T)){const P=parseFloat(T);return Zi(T,"ms")?P:P*1e3}else return 0},v=f("transition-delay"),_=f("transition-duration");return Yo(_,(T,P,I)=>{const W=g(v[I])+g(P);return Math.max(T,W)},0)},dk=(r,f)=>{const g=mb(),v=mb();let _;const T=J=>{var ie;const de=(ie=J.raw.pseudoElement)!==null&&ie!==void 0?ie:"";return xr(J.target,r)&&qe(de)&&st(A_,J.raw.propertyName)},P=J=>{if($(J)||T(J)){g.clear(),v.clear();const ie=J==null?void 0:J.raw.type;($(ie)||ie===Jg())&&(clearTimeout(_),Ue(r,mm),Xc(r,f.classes))}},I=Mc(r,u0(),J=>{T(J)&&(I.unbind(),g.set(Mc(r,Jg(),P)),v.set(Mc(r,eg(),P)))}),W=P0(r);requestAnimationFrame(()=>{_=setTimeout(P,W+17),qn(r,mm,_)})},hk=(r,f)=>{cg(r,f.classes),me(r,mm).each(g=>{clearTimeout(parseInt(g,10)),Ue(r,mm)}),dk(r,f)},D_=(r,f,g,v,_,T)=>{const P=oc(v,_,T);if(P||fk(r,v)){ro(r,"position",g.position);const I=xh(f,r),W=f2(f,{..._,rect:I}),J=An(A_,ie=>W[ie]);pf(g,J)&&(gn(r,J),P&&hk(r,v),ru(r))}else Xc(r,v.classes)},M0=r=>({width:za(r),height:Xf(r)}),P_=(r,f,g,v)=>{ks(f,"max-height"),ks(f,"max-width");const _=M0(f);return E_(f,v.preference,r,_,g,v.bounds)},M_=(r,f)=>{const g=f.classes;Xc(r,g.off),cg(r,g.on)},gp=(r,f,g)=>{const v=g.maxHeightFunction;v(r,f.maxHeight)},mk=(r,f,g)=>{const v=g.maxWidthFunction;v(r,f.maxWidth)},gk=(r,f,g)=>{const v=f2(g.origin,f);g.transition.each(_=>{D_(r,g.origin,v,_,f,g.lastPlacement)}),db(r,v)},pk=(r,f)=>{tO(r,f.placement)},h2=(r,f)=>{pa(r,Math.floor(f))},oO=G((r,f)=>{h2(r,f),yi(r,{"overflow-x":"hidden","overflow-y":"auto"})}),bg=G((r,f)=>{h2(r,f)}),R_=(r,f,g)=>r[f]===void 0?g:r[f],$_=(r,f,g,v,_,T,P,I)=>{const W=R_(P,"maxHeightFunction",oO()),J=R_(P,"maxWidthFunction",L),ie=r.anchorBox,de=r.origin,ge={bounds:jr(de,T),origin:de,preference:v,maxHeightFunction:W,maxWidthFunction:J,lastPlacement:_,transition:I};return sO(ie,f,g,ge)},sO=(r,f,g,v)=>{const _=P_(r,f,g,v);return gk(f,_,v),pk(f,_),M_(f,_),gp(f,_,v),mk(f,_,v),{layout:_.layout,placement:_.placement}},pb=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],vg=(r,f,g,v=1)=>{const _=r*v,T=f*v,P=W=>ln(g,W).getOr([]),I=(W,J,ie)=>{const de=At(pb,ie);return{offset:pr(W,J),classesOn:Ne(ie,P),classesOff:Ne(de,P)}};return{southeast:()=>I(-r,f,["top","alignLeft"]),southwest:()=>I(r,f,["top","alignRight"]),south:()=>I(-r/2,f,["top","alignCentre"]),northeast:()=>I(-r,-f,["bottom","alignLeft"]),northwest:()=>I(r,-f,["bottom","alignRight"]),north:()=>I(-r/2,-f,["bottom","alignCentre"]),east:()=>I(r,-f/2,["valignCentre","left"]),west:()=>I(-r,-f/2,["valignCentre","right"]),insetNortheast:()=>I(_,T,["top","alignLeft","inset"]),insetNorthwest:()=>I(-_,T,["top","alignRight","inset"]),insetNorth:()=>I(-_/2,T,["top","alignCentre","inset"]),insetSoutheast:()=>I(_,-T,["bottom","alignLeft","inset"]),insetSouthwest:()=>I(-_,-T,["bottom","alignRight","inset"]),insetSouth:()=>I(-_/2,-T,["bottom","alignCentre","inset"]),insetEast:()=>I(-_,-T/2,["valignCentre","right","inset"]),insetWest:()=>I(_,-T/2,["valignCentre","left","inset"])}},rO=()=>vg(0,0,{}),iO=we,R0=(r,f)=>g=>N_(g)==="rtl"?f:r,N_=r=>Gr(r,"direction")==="rtl"?"rtl":"ltr";var Th;(function(r){r.TopToBottom="toptobottom",r.BottomToTop="bottomtotop"})(Th||(Th={}));const $0="data-alloy-vertical-dir",I_=r=>e1(r,f=>yr(f)&&zi(f,"data-alloy-vertical-dir")===Th.BottomToTop),Eh=()=>Xa("layouts",[nn("onLtr"),nn("onRtl"),Er("onBottomLtr"),Er("onBottomRtl")]),pp=(r,f,g,v,_,T,P)=>{const I=P.map(I_).getOr(!1),W=f.layouts.map(_e=>_e.onLtr(r)),J=f.layouts.map(_e=>_e.onRtl(r)),ie=I?f.layouts.bind(_e=>_e.onBottomLtr.map(Ie=>Ie(r))).or(W).getOr(_):W.getOr(g),de=I?f.layouts.bind(_e=>_e.onBottomRtl.map(Ie=>Ie(r))).or(J).getOr(T):J.getOr(v);return R0(ie,de)(r)},m2=(r,f,g)=>{const v=f.hotspot,_=xh(g,v.element),T=pp(r.element,f,gg(),bc(),Dl(),s2(),V.some(f.hotspot.element));return V.some(iO({anchorBox:_,bubble:f.bubble.getOr(rO()),overrides:f.overrides,layouts:T}))};var B_=[nn("hotspot"),Er("bubble"),xt("overrides",{}),Eh(),Yi("placement",m2)];const aO=(r,f,g)=>{const v=Jv(g,f.x,f.y),_=ai(v.left,v.top,f.width,f.height),T=pp(r.element,f,w_(),bu(),w_(),bu(),V.none());return V.some(iO({anchorBox:_,bubble:f.bubble,overrides:f.overrides,layouts:T}))};var bk=[nn("x"),nn("y"),xt("height",0),xt("width",0),xt("bubble",rO()),xt("overrides",{}),Eh(),Yi("placement",aO)];const L_=j.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),vk=r=>r.fold(we,(f,g,v)=>f.translate(-g,-v)),Ok=r=>r.fold(we,we),F_=r=>Yo(r,(f,g)=>f.translate(g.left,g.top),pr(0,0)),Q_=r=>{const f=je(r,vk);return F_(f)},Z_=r=>{const f=je(r,Ok);return F_(f)},yk=L_.screen,wk=L_.absolute,_k=(r,f,g)=>{const v=Qc(g.root).dom,_=T=>{const P=ca(T),I=ca(r.element);return xr(P,I)};return V.from(v.frameElement).map(lt.fromDom).filter(_).map(Tc)},H_=(r,f,g)=>{const v=ca(r.element),_=dc(v),T=_k(r,f,g).getOr(_);return wk(T,_.left,_.top)},g2=(r,f,g,v)=>{const _=yk(pr(r,f));return V.some(ih(_,g,v))},p2=(r,f,g,v,_)=>r.map(T=>{const P=[f,T.point],I=ud(v,()=>Z_(P),()=>Z_(P),()=>Q_(P)),W=Ed(I.left,I.top,T.width,T.height),J=g.showAbove?Dl():gg(),ie=g.showAbove?s2():bc(),de=pp(_,g,J,ie,J,ie,V.none());return iO({anchorBox:W,bubble:g.bubble.getOr(rO()),overrides:g.overrides,layouts:de})}),Sk=(r,f,g)=>{const v=H_(r,g,f);return f.node.filter(js).bind(_=>{const T=_.dom.getBoundingClientRect(),P=g2(T.left,T.top,T.width,T.height),I=f.node.getOr(r.element);return p2(P,v,f,g,I)})};var Ck=[nn("node"),nn("root"),Er("bubble"),Eh(),xt("overrides",{}),xt("showAbove",!1),Yi("placement",Sk)];const lO="\uFEFF",z_="\xA0",N0={create:(r,f,g,v)=>({start:r,soffset:f,finish:g,foffset:v})},bb=j.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),uO=(r,f,g,v)=>r.fold(f,g,v),b2=r=>r.fold(we,we,we),V_=bb.before,v2=bb.on,kk=bb.after,fO={before:V_,on:v2,after:kk,cata:uO,getStart:b2},I0=j.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xk=r=>I0.exact(r.start,r.soffset,r.finish,r.foffset),dO=r=>r.match({domRange:f=>lt.fromDom(f.startContainer),relative:(f,g)=>fO.getStart(f),exact:(f,g,v,_)=>f}),bf=I0.domRange,hO=I0.relative,W_=I0.exact,mO=r=>{const f=dO(r);return Qc(f)},Tk=N0.create,B0={domRange:bf,relative:hO,exact:W_,exactFromRange:xk,getWin:mO,range:Tk},O2=(r,f)=>{f.fold(g=>{r.setStartBefore(g.dom)},(g,v)=>{r.setStart(g.dom,v)},g=>{r.setStartAfter(g.dom)})},Ek=(r,f)=>{f.fold(g=>{r.setEndBefore(g.dom)},(g,v)=>{r.setEnd(g.dom,v)},g=>{r.setEndAfter(g.dom)})},gO=(r,f,g)=>{const v=r.document.createRange();return O2(v,f),Ek(v,g),v},yl=(r,f,g,v,_)=>{const T=r.document.createRange();return T.setStart(f.dom,g),T.setEnd(v.dom,_),T},Ak=r=>({left:r.left,top:r.top,right:r.right,bottom:r.bottom,width:r.width,height:r.height}),vb=r=>{const f=r.getClientRects(),g=f.length>0?f[0]:r.getBoundingClientRect();return g.width>0||g.height>0?V.some(g).map(Ak):V.none()},Dk=r=>{const f=r.getBoundingClientRect();return f.width>0||f.height>0?V.some(f).map(Ak):V.none()},Ob=j.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),y2=(r,f,g)=>f(lt.fromDom(g.startContainer),g.startOffset,lt.fromDom(g.endContainer),g.endOffset),Pk=(r,f)=>f.match({domRange:g=>({ltr:G(g),rtl:V.none}),relative:(g,v)=>({ltr:Mi(()=>gO(r,g,v)),rtl:Mi(()=>V.some(gO(r,v,g)))}),exact:(g,v,_,T)=>({ltr:Mi(()=>yl(r,g,v,_,T)),rtl:Mi(()=>V.some(yl(r,_,T,g,v)))})}),Mk=(r,f)=>{const g=f.ltr();return g.collapsed?f.rtl().filter(_=>_.collapsed===!1).map(_=>Ob.rtl(lt.fromDom(_.endContainer),_.endOffset,lt.fromDom(_.startContainer),_.startOffset)).getOrThunk(()=>y2(r,Ob.ltr,g)):y2(r,Ob.ltr,g)},L0=(r,f)=>{const g=Pk(r,f);return Mk(r,g)},gm=(r,f)=>L0(r,f).match({ltr:(v,_,T,P)=>{const I=r.document.createRange();return I.setStart(v.dom,_),I.setEnd(T.dom,P),I},rtl:(v,_,T,P)=>{const I=r.document.createRange();return I.setStart(T.dom,P),I.setEnd(v.dom,_),I}});Ob.ltr,Ob.rtl;const yb=(r,f,g)=>Kn(Cd(r,g),f),vu=(r,f)=>Qm(f,r),a1=(r,f,g,v)=>{const T=ca(r).dom.createRange();return T.setStart(r.dom,f),T.setEnd(g.dom,v),T},U_=(r,f,g,v)=>{const _=a1(r,f,g,v),T=xr(r,g)&&f===v;return _.collapsed&&!T},Y_=r=>V.from(r.getSelection()),w2=r=>{if(r.rangeCount>0){const f=r.getRangeAt(0),g=r.getRangeAt(r.rangeCount-1);return V.some(N0.create(lt.fromDom(f.startContainer),f.startOffset,lt.fromDom(g.endContainer),g.endOffset))}else return V.none()},_2=r=>{if(r.anchorNode===null||r.focusNode===null)return w2(r);{const f=lt.fromDom(r.anchorNode),g=lt.fromDom(r.focusNode);return U_(f,r.anchorOffset,g,r.focusOffset)?V.some(N0.create(f,r.anchorOffset,g,r.focusOffset)):w2(r)}},S2=r=>Y_(r).filter(f=>f.rangeCount>0).bind(_2),Rk=(r,f)=>{const g=gm(r,f);return vb(g)},F0=(r,f)=>{const g=gm(r,f);return Dk(g)},bp=((r,f)=>{const g=T=>{if(!r(T))throw new Error("Can only get "+f+" value of a "+f+" node");return v(T).getOr("")},v=T=>r(T)?V.from(T.dom.nodeValue):V.none();return{get:g,getOption:v,set:(T,P)=>{if(!r(T))throw new Error("Can only set raw "+f+" value of a "+f+" node");T.dom.nodeValue=P}}})(ol,"text"),Q0=r=>bp.get(r),Ah=(r,f)=>({element:r,offset:f}),$k=(r,f)=>{const g=Xl(r);if(g.length===0)return Ah(r,f);if(f<g.length)return Ah(g[f],0);{const v=g[g.length-1],_=ol(v)?Q0(v).length:Xl(v).length;return Ah(v,_)}},pm=(r,f)=>ol(r)?Ah(r,f):$k(r,f),Hd=r=>r.foffset!==void 0,wb=(r,f)=>f.getSelection.getOrThunk(()=>()=>S2(r))().map(v=>{if(Hd(v)){const _=pm(v.start,v.soffset),T=pm(v.finish,v.foffset);return B0.range(_.element,_.offset,T.element,T.offset)}else return v}),C2=(r,f,g)=>{const v=Qc(f.root).dom,_=H_(r,g,f),T=wb(v,f).bind(W=>{if(Hd(W))return F0(v,B0.exactFromRange(W)).orThunk(()=>{const ie=lt.fromText(lO);Sa(W.start,ie);const de=Rk(v,B0.exact(ie,0,ie,1));return Mu(ie),de}).bind(ie=>g2(ie.left,ie.top,ie.width,ie.height));{const J=Ns(W,de=>de.dom.getBoundingClientRect()),ie={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 g2(ie.left,ie.top,ie.right-ie.left,ie.bottom-ie.top)}}),I=wb(v,f).bind(W=>Hd(W)?yr(W.start)?V.some(W.start):xc(W.start):V.some(W.firstCell)).getOr(r.element);return p2(T,_,f,g,I)};var _b=[Er("getSelection"),nn("root"),Er("bubble"),Eh(),xt("overrides",{}),xt("showAbove",!1),Yi("placement",C2)];const Og="link-layout",S=r=>r.x+r.width,A=(r,f)=>r.x-f.width,H=(r,f)=>r.y-f.height+r.height,le=r=>r.y,Ce=(r,f,g)=>Oa(S(r),le(r),g.southeast(),E0(),"southeast",zl(r,{left:0,top:2}),Og),We=(r,f,g)=>Oa(A(r,f),le(r),g.southwest(),Ch(),"southwest",zl(r,{right:1,top:2}),Og),ht=(r,f,g)=>Oa(S(r),H(r,f),g.northeast(),mf(),"northeast",zl(r,{left:0,bottom:3}),Og),St=(r,f,g)=>Oa(A(r,f),H(r,f),g.northwest(),ub(),"northwest",zl(r,{right:1,bottom:3}),Og),zt=()=>[Ce,We,ht,St],vn=()=>[We,Ce,St,ht],Zn=(r,f,g)=>{const v=xh(g,f.item.element),_=pp(r.element,f,zt(),vn(),zt(),vn(),V.none());return V.some(iO({anchorBox:v,bubble:rO(),overrides:f.overrides,layouts:_}))};var Vn=[nn("item"),Eh(),xt("overrides",{}),Yi("placement",Zn)],Fo=xl("type",{selection:_b,node:Ck,hotspot:B_,submenu:Vn,makeshift:bk});const ms=[Hl("classes",bl),Bu("mode","all",["all","layout","placement"])],Is=[xt("useFixed",tt),Er("getBounds")],Hr=[Kr("anchor",Fo),Xa("transition",ms)],Zs=()=>{const r=document.documentElement;return C_(0,0,r.clientWidth,r.clientHeight)},gi=r=>{const f=Tc(r.element),g=r.element.dom.getBoundingClientRect();return S_(f.left,f.top,g.width,g.height)},ki=(r,f,g,v,_,T)=>{const P=ak(f.anchorBox,r);return $_(P,v.element,f.bubble,f.layouts,_,g,f.overrides,T)},Ou=(r,f,g,v,_)=>{const T=V.none();Zu(r,f,g,v,_,T)},Zu=(r,f,g,v,_,T)=>{const P=Es("placement.info",fo(Hr),_),I=P.anchor,W=v.element,J=g.get(v.uid);Qd(()=>{ro(W,"position","fixed");const ie=ea(W,"visibility");ro(W,"visibility","hidden");const de=f.useFixed()?Zs():gi(r);I.placement(r,I,de).each(ge=>{const _e=T.orThunk(()=>f.getBounds.map(Xe)),Ie=ki(de,ge,_e,v,J,P.transition);g.set(v.uid,Ie)}),ie.fold(()=>{ks(W,"visibility")},ge=>{ro(W,"visibility",ge)}),ea(W,"left").isNone()&&ea(W,"top").isNone()&&ea(W,"right").isNone()&&ea(W,"bottom").isNone()&&ze(ea(W,"position"),"fixed")&&ks(W,"position")},W)};var bm=Object.freeze({__proto__:null,position:Ou,positionWithinBounds:Zu,getMode:(r,f,g)=>f.useFixed()?"fixed":"absolute",reset:(r,f,g,v)=>{const _=v.element;mt(["position","left","right","top","bottom"],T=>ks(_,T)),lk(_),g.clear(v.uid)}}),k2=Object.freeze({__proto__:null,init:()=>{let r={};return mu({readState:()=>r,clear:_=>{Q(_)?delete r[_]:r={}},set:(_,T)=>{r[_]=T},get:_=>ln(r,_)})}});const yu=nc({fields:Is,name:"positioning",active:fb,apis:bm,state:k2}),X_=r=>r.getSystem().isConnected(),Z0=r=>{rr(r,Nd());const f=r.components();mt(f,Z0)},H0=r=>{const f=r.components();mt(f,H0),rr(r,Lu())},zd=(r,f)=>{r.getSystem().addToWorld(f),js(r.element)&&H0(f)},Sb=r=>{Z0(r),r.getSystem().removeFromWorld(r)},Nk=(r,f)=>{il(r.element,f.element)},bO=r=>{mt(r.components(),f=>Mu(f.element)),ii(r.element),r.syncComponents()},Hf=(r,f,g)=>{const v=r.components();bO(r);const _=g(f),T=At(v,_);mt(T,P=>{Z0(P),r.getSystem().removeFromWorld(P)}),mt(_,P=>{X_(P)?Nk(r,P):(r.getSystem().addToWorld(P),Nk(r,P),js(r.element)&&H0(P))}),r.syncComponents()},Hu=(r,f,g)=>{const v=r.components(),_=Ne(f,I=>Ny(I).toArray());mt(v,I=>{st(_,I)||Sb(I)});const T=g(f),P=At(v,T);mt(P,I=>{X_(I)&&Sb(I)}),mt(T,I=>{X_(I)||zd(r,I)}),r.syncComponents()},cl=(r,f)=>{Vd(r,f,il)},Vd=(r,f,g)=>{r.getSystem().addToWorld(f),g(r.element,f.element),js(r.element)&&H0(f),r.syncComponents()},j_=r=>{Z0(r),Mu(r.element),r.getSystem().removeFromWorld(r)},qc=r=>{const f=Ha(r.element).bind(g=>r.getSystem().getByDom(g).toOptional());j_(r),f.each(g=>{g.syncComponents()})},Cb=r=>{const f=r.components();mt(f,j_),ii(r.element),r.syncComponents()},vO=(r,f)=>{Ik(r,f,il)},x2=(r,f)=>{Ik(r,f,Td)},Ik=(r,f,g)=>{g(r,f.element);const v=Xl(f.element);mt(v,_=>{f.getByDom(_).each(H0)})},Bk=r=>{const f=Xl(r.element);mt(f,g=>{r.getByDom(g).each(Z0)}),Mu(r.element)},l1=(r,f,g,v)=>{g.get().each(P=>{Cb(r)});const _=f.getAttachPoint(r);cl(_,r);const T=r.getSystem().build(v);return cl(r,T),g.set(T),T},T2=(r,f,g,v)=>{const _=l1(r,f,g,v);return f.onOpen(r,_),_},yg=(r,f,g,v)=>g.get().map(()=>l1(r,f,g,v)),rP=(r,f,g,v,_)=>{Qk(r,f),T2(r,f,g,v),_(),RE(r,f)},Lk=(r,f,g)=>{g.get().each(v=>{Cb(r),qc(r),f.onClose(r,v),g.clear()})},DE=(r,f,g)=>g.isOpen(),bI=(r,f,g,v)=>DE(r,f,g)&&g.get().exists(_=>f.isPartOf(r,_,v)),PE=(r,f,g)=>g.get(),ME=(r,f,g,v)=>{ea(r.element,f).fold(()=>{Ue(r.element,g)},_=>{qn(r.element,g,_)}),ro(r.element,f,v)},Fk=(r,f,g)=>{me(r.element,g).fold(()=>ks(r.element,f),v=>ro(r.element,f,v))},Qk=(r,f,g)=>{const v=f.getAttachPoint(r);ro(r.element,"position",yu.getMode(v)),ME(r,"visibility",f.cloakVisibilityAttr,"hidden")},Zk=r=>rn(["top","left","right","bottom"],f=>ea(r,f).isSome()),RE=(r,f,g)=>{Zk(r.element)||ks(r.element,"position"),Fk(r,"visibility",f.cloakVisibilityAttr)};var $E=Object.freeze({__proto__:null,cloak:Qk,decloak:RE,open:T2,openWhileCloaked:rP,close:Lk,isOpen:DE,isPartOf:bI,getState:PE,setContent:yg}),iP=Object.freeze({__proto__:null,events:(r,f)=>li([on($a(),(g,v)=>{Lk(g,r,f)})])}),aP=[qs("onOpen"),qs("onClose"),nn("isPartOf"),nn("getAttachPoint"),xt("cloakVisibilityAttr","data-precloak-visibility")],lP=Object.freeze({__proto__:null,init:()=>{const r=Xi(),f=G("not-implemented");return mu({readState:f,isOpen:r.isSet,clear:r.clear,set:r.set,get:r.get})}});const Gs=nc({fields:aP,name:"sandboxing",active:iP,apis:$E,state:lP}),Dh=G("dismiss.popups"),kb=G("reposition.popups"),Hk=G("mouse.released"),IE=_i([xt("isExtraPart",tt),Xa("fireEventInstead",[xt("event",rg())])]),OO=r=>{const f=Es("Dismissal",IE,r);return{[Dh()]:{schema:_i([nn("target")]),onReceive:(g,v)=>{Gs.isOpen(g)&&(Gs.isPartOf(g,v.target)||f.isExtraPart(g,v.target)||f.fireEventInstead.fold(()=>Gs.close(g),T=>rr(g,T.event)))}}}},cP=_i([Xa("fireEventInstead",[xt("event",d0())]),Wc("doReposition")]),zk=r=>{const f=Es("Reposition",cP,r);return{[kb()]:{onReceive:g=>{Gs.isOpen(g)&&f.fireEventInstead.fold(()=>f.doReposition(g),v=>rr(g,v.event))}}}},q_=(r,f,g)=>{f.store.manager.onLoad(r,f,g)},E2=(r,f,g)=>{f.store.manager.onUnload(r,f,g)};var Wk=Object.freeze({__proto__:null,onLoad:q_,onUnload:E2,setValue:(r,f,g,v)=>{f.store.manager.setValue(r,f,g,v)},getValue:(r,f,g)=>f.store.manager.getValue(r,f,g),getState:(r,f,g)=>g}),BE=Object.freeze({__proto__:null,events:(r,f)=>{const g=r.resetOnDom?[Ci((v,_)=>{q_(v,r,f)}),Ld((v,_)=>{E2(v,r,f)})]:[i2(r,f,q_)];return li(g)}});const Uk=()=>{const r=Ho(null),f=()=>({mode:"memory",value:r.get()}),g=()=>r.get()===null,v=()=>{r.set(null)};return mu({set:r.set,get:r.get,isNotSet:g,clear:v,readState:f})},yO=()=>mu({readState:L}),A2=()=>{const r=Ho({}),f=Ho({});return mu({readState:()=>({mode:"dataset",dataByValue:r.get(),dataByText:f.get()}),lookup:P=>ln(r.get(),P).orThunk(()=>ln(f.get(),P)),update:P=>{const I=r.get(),W=f.get(),J={},ie={};mt(P,de=>{J[de.value]=de,ln(de,"meta").each(ge=>{ln(ge,"text").each(_e=>{ie[_e]=de})})}),r.set({...I,...J}),f.set({...W,...ie})},clear:()=>{r.set({}),f.set({})}})};var vp=Object.freeze({__proto__:null,memory:Uk,dataset:A2,manual:yO,init:r=>r.store.manager.state(r)});const LE=(r,f,g,v)=>{const _=f.store;g.update([v]),_.setValue(r,v),f.onSetValue(r,v)},fP=(r,f,g)=>{const v=f.store,_=v.getDataKey(r);return g.lookup(_).getOrThunk(()=>v.getFallbackEntry(_))},FE=(r,f,g)=>{f.store.initialValue.each(_=>{LE(r,f,g,_)})},Yk=(r,f,g)=>{g.clear()};var wO=[Er("initialValue"),nn("getFallbackEntry"),nn("getDataKey"),nn("setValue"),Yi("manager",{setValue:LE,getValue:fP,onLoad:FE,onUnload:Yk,state:A2})];const Xk=(r,f,g)=>f.store.getValue(r),K_=(r,f,g,v)=>{f.store.setValue(r,v),f.onSetValue(r,v)},jk=(r,f,g)=>{f.store.initialValue.each(v=>{f.store.setValue(r,v)})};var QE=[nn("getValue"),xt("setValue",L),Er("initialValue"),Yi("manager",{setValue:K_,getValue:Xk,onLoad:jk,onUnload:L,state:Ff.init})];const D2=(r,f,g,v)=>{g.set(v),f.onSetValue(r,v)},qk=(r,f,g)=>g.get(),dP=(r,f,g)=>{f.store.initialValue.each(v=>{g.isNotSet()&&g.set(v)})},vm=(r,f,g)=>{g.clear()};var ZE=[Er("initialValue"),Yi("manager",{setValue:D2,getValue:qk,onLoad:dP,onUnload:vm,state:Uk})],hP=[Dc("store",{mode:"memory"},xl("mode",{memory:ZE,manual:QE,dataset:wO})),qs("onSetValue"),xt("resetOnDom",!1)];const Gn=nc({fields:hP,name:"representing",active:BE,apis:Wk,extra:{setValueFrom:(r,f)=>{const g=Gn.getValue(f);Gn.setValue(r,g)}},state:vp}),Wl=(r,f)=>c0(r,{},je(f,g=>od(g.name(),"Cannot configure "+g.name()+" for "+r)).concat([ka("dump",we)])),Om=r=>r.dump,sc=(r,f)=>({...Tn(f),...r.dump}),ym={field:Wl,augment:sc,get:Om},HE="placeholder",P2=j.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ph=r=>vs(r,"uiType"),J_=(r,f,g,v)=>r.exists(_=>_!==g.owner)?P2.single(!0,G(g)):ln(v,g.name).fold(()=>{throw new Error("Unknown placeholder component: "+g.name+`
|
|
Known: [`+Xs(v)+`]
|
|
Namespace: `+r.getOr("none")+`
|
|
Spec: `+JSON.stringify(g,null,2))},_=>_.replace()),M2=(r,f,g,v)=>Ph(g)&&g.uiType===HE?J_(r,f,g,v):P2.single(!1,G(g)),R2=(r,f,g,v)=>M2(r,f,g,v).fold((T,P)=>{const I=Ph(g)?P(f,g.config,g.validated):P(f),W=ln(I,"components").getOr([]),J=Ne(W,ie=>R2(r,f,ie,v));return[{...I,components:J}]},(T,P)=>{if(Ph(g)){const I=P(f,g.config,g.validated);return g.validated.preprocess.getOr(we)(I)}else return P(f)}),Gk=(r,f,g,v)=>Ne(g,_=>R2(r,f,_,v)),$2=(r,f)=>{let g=!1;const v=()=>g,_=()=>{if(g)throw new Error("Trying to use the same placeholder more than once: "+r);return g=!0,f},T=()=>f.fold((P,I)=>P,(P,I)=>P);return{name:G(r),required:T,used:v,replace:_}},eS=(r,f,g,v)=>{const _=Ns(v,(P,I)=>$2(I,P)),T=Gk(r,f,g,_);return dr(_,P=>{if(P.used()===!1&&P.required())throw new Error("Placeholder: "+P.name()+` was not found in components list
|
|
Namespace: `+r.getOr("none")+`
|
|
Components: `+JSON.stringify(f.components,null,2))}),T},Kk=P2.single,mP=P2.multiple,wm=G(HE),tS=j.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),N2=xt("factory",{sketch:we}),dd=xt("schema",[]),Ml=nn("name"),Jk=Wa("pname","pname",Kl(r=>"<alloy."+io(r.name)+">"),Vc()),I2=ka("schema",()=>[Er("preprocess")]),Ud=xt("defaults",G({})),B2=xt("overrides",G({})),ex=fo([N2,dd,Ml,Jk,Ud,B2]),tx=fo([N2,dd,Ml,Ud,B2]),gP=fo([N2,dd,Ml,Jk,Ud,B2]),zE=fo([N2,I2,Ml,nn("unit"),Jk,Ud,B2]),L2=r=>r.fold(V.some,V.none,V.some,V.some),VE=r=>{const f=g=>g.name;return r.fold(f,f,f,f)},pP=r=>r.fold(we,we,we,we),Tb=(r,f)=>g=>{const v=Es("Converting part type",f,g);return r(v)},Gc=Tb(tS.required,ex),Mh=Tb(tS.external,tx),Yd=Tb(tS.optional,gP),hd=Tb(tS.group,zE),nS=G("entirety");var z0=Object.freeze({__proto__:null,required:Gc,external:Mh,optional:Yd,group:hd,asNamedPart:L2,name:VE,asCommon:pP,original:nS});const c1=(r,f,g,v)=>ni(f.defaults(r,g,v),g,{uid:r.partUids[f.name]},f.overrides(r,g,v)),bP=(r,f,g)=>{const v={},_={};return mt(g,T=>{T.fold(P=>{v[P.pname]=Kk(!0,(I,W,J)=>P.factory.sketch(c1(I,P,W,J)))},P=>{const I=f.parts[P.name];_[P.name]=G(P.factory.sketch(c1(f,P,I[nS()]),I))},P=>{v[P.pname]=Kk(!1,(I,W,J)=>P.factory.sketch(c1(I,P,W,J)))},P=>{v[P.pname]=mP(!0,(I,W,J)=>{const ie=I[P.name];return je(ie,de=>P.factory.sketch(ni(P.defaults(I,de,J),de,P.overrides(I,de))))})})}),{internals:G(v),externals:G(_)}},nx=(r,f)=>{const g={};return mt(f,v=>{L2(v).each(_=>{const T=vP(r,_.pname);g[_.name]=P=>{const I=Es("Part: "+_.name+" in "+r,fo(_.schema),P);return{...T,config:P,validated:I}}})}),g},vP=(r,f)=>({uiType:wm(),owner:r,name:f}),WE=(r,f,g)=>({uiType:wm(),owner:r,name:f,config:g,validated:{}}),UE=r=>Ne(r,f=>f.fold(V.none,V.some,V.none,V.none).map(g=>sd(g.name,g.schema.concat([Ky(nS())]))).toArray()),YE=r=>je(r,VE),oS=(r,f,g)=>bP(r,f,g),ox=(r,f,g)=>eS(V.some(r),f,f.components,g),Ri=(r,f,g)=>{const v=f.partUids[g];return r.getSystem().getByUid(v).toOptional()},u1=(r,f,g)=>Ri(r,f,g).getOrDie("Could not find part: "+g),_O=(r,f,g)=>{const v={},_=f.partUids,T=r.getSystem();return mt(g,P=>{v[P]=G(T.getByUid(_[P]))}),v},sx=(r,f)=>{const g=r.getSystem();return Ns(f.partUids,(v,_)=>G(g.getByUid(v)))},XE=r=>Xs(r.partUids),rx=(r,f,g)=>{const v={},_=f.partUids,T=r.getSystem();return mt(g,P=>{v[P]=G(T.getByUid(_[P]).getOrDie())}),v},jE=(r,f)=>{const g=YE(f);return Uo(je(g,v=>({key:v,value:r+"-"+v})))},sS=r=>Wa("partUids","partUids",Ae(f=>jE(f.uid,r)),Vc());var OP=Object.freeze({__proto__:null,generate:nx,generateOne:WE,schemas:UE,names:YE,substitutes:oS,components:ox,defaultUids:jE,defaultUidsSchema:sS,getAllParts:sx,getAllPartNames:XE,getPart:Ri,getPartOrDie:u1,getParts:_O,getPartsOrDie:rx});const yP=(r,f)=>(r.length>0?[sd("parts",r)]:[]).concat([nn("uid"),xt("dom",{}),xt("components",[]),Ky("originalSpec"),xt("debug.sketcher",{})]).concat(f),qE=(r,f,g,v,_)=>{const T=yP(v,_);return Es(r+" [SpecSchema]",_i(T.concat(f)),g)},wP=(r,f,g,v)=>{const _=CO(v),T=qE(r,f,_,[],[]);return g(T,_)},ix=(r,f,g,v,_)=>{const T=CO(_),P=UE(g),I=sS(g),W=qE(r,f,T,P,[I]),J=oS(r,W,g),ie=ox(r,W,J.internals());return v(W,ie,T,J.externals())},SO=r=>vs(r,"uid"),CO=r=>SO(r)?r:{...r,uid:yh("uid")},rS=r=>r.uid!==void 0,GE=_i([nn("name"),nn("factory"),nn("configFields"),xt("apis",{}),xt("extraApis",{})]),Rh=_i([nn("name"),nn("factory"),nn("configFields"),nn("partFields"),xt("apis",{}),xt("extraApis",{})]),Kc=r=>{const f=Es("Sketcher for "+r.name,GE,r),g=T=>wP(f.name,f.configFields,f.factory,T),v=Ns(f.apis,ap),_=Ns(f.extraApis,(T,P)=>rd(T,P));return{name:f.name,configFields:f.configFields,sketch:g,...v,..._}},wu=r=>{const f=Es("Sketcher for "+r.name,Rh,r),g=P=>ix(f.name,f.configFields,f.partFields,f.factory,P),v=nx(f.name,f.partFields),_=Ns(f.apis,ap),T=Ns(f.extraApis,(P,I)=>rd(P,I));return{name:f.name,partFields:f.partFields,configFields:f.configFields,sketch:g,parts:v,..._,...T}},Op=r=>Yl("input")(r)&&zi(r,"type")!=="radio"||Yl("textarea")(r);var SP=Object.freeze({__proto__:null,getCurrent:(r,f,g)=>f.find(r)});const CP=[nn("find")],cr=nc({fields:CP,name:"composing",apis:SP}),kP=["input","button","textarea","select"],KE=(r,f,g)=>{(f.disabled()?F2:ax)(r,f)},iS=(r,f)=>f.useNative===!0&&st(kP,gl(r.element)),xP=r=>$e(r.element,"disabled"),to=r=>{qn(r.element,"disabled","disabled")},V0=r=>{Ue(r.element,"disabled")},TP=r=>zi(r.element,"aria-disabled")==="true",JE=r=>{qn(r.element,"aria-disabled","true")},aS=r=>{qn(r.element,"aria-disabled","false")},F2=(r,f,g)=>{f.disableClass.each(_=>{Na(r.element,_)}),(iS(r,f)?to:JE)(r),f.onDisabled(r)},ax=(r,f,g)=>{f.disableClass.each(_=>{va(r.element,_)}),(iS(r,f)?V0:aS)(r),f.onEnabled(r)},lx=(r,f)=>iS(r,f)?xP(r):TP(r);var OI=Object.freeze({__proto__:null,enable:ax,disable:F2,isDisabled:lx,onLoad:KE,set:(r,f,g,v)=>{(v?F2:ax)(r,f)}}),lS=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({classes:f.disabled()?f.disableClass.toArray():[]}),events:(r,f)=>li([Lv(af(),(g,v)=>lx(g,r)),i2(r,f,KE)])}),AP=[qa("disabled",tt),xt("useNative",!0),Er("disableClass"),qs("onDisabled"),qs("onEnabled")];const Jo=nc({fields:AP,name:"disabling",active:lS,apis:OI}),DP=(r,f,g,v)=>{const _=vu(r.element,"."+f.highlightClass);mt(_,T=>{rn(v,I=>xr(I.element,T))||(va(T,f.highlightClass),r.getSystem().getByDom(T).each(I=>{f.onDehighlight(r,I),rr(I,Iv())}))})},PP=(r,f,g)=>DP(r,f,g,[]),yI=(r,f,g,v)=>{Z2(r,f,g,v)&&(va(v.element,f.highlightClass),f.onDehighlight(r,v),rr(v,Iv()))},Q2=(r,f,g,v)=>{DP(r,f,g,[v]),Z2(r,f,g,v)||(Na(v.element,f.highlightClass),f.onHighlight(r,v),rr(v,ig()))},cS=(r,f,g)=>{ux(r,f).each(v=>{Q2(r,f,g,v)})},MP=(r,f,g)=>{fx(r,f).each(v=>{Q2(r,f,g,v)})},RP=(r,f,g,v)=>{n3(r,f,g,v).fold(_=>{throw _},_=>{Q2(r,f,g,_)})},$P=(r,f,g,v)=>{const _=dx(r,f);kt(_,v).each(P=>{Q2(r,f,g,P)})},Z2=(r,f,g,v)=>uf(v.element,f.highlightClass),cx=(r,f,g)=>sa(r.element,"."+f.highlightClass).bind(v=>r.getSystem().getByDom(v).toOptional()),n3=(r,f,g,v)=>{const _=vu(r.element,"."+f.itemClass);return V.from(_[v]).fold(()=>wn.error(new Error("No element found with index "+v)),r.getSystem().getByDom)},ux=(r,f,g)=>sa(r.element,"."+f.itemClass).bind(v=>r.getSystem().getByDom(v).toOptional()),fx=(r,f,g)=>{const v=vu(r.element,"."+f.itemClass);return(v.length>0?V.some(v[v.length-1]):V.none()).bind(T=>r.getSystem().getByDom(T).toOptional())},o3=(r,f,g,v)=>{const _=vu(r.element,"."+f.itemClass);return jt(_,P=>uf(P,f.highlightClass)).bind(P=>{const I=kh(P,v,0,_.length-1);return r.getSystem().getByDom(_[I]).toOptional()})},f1=(r,f,g)=>o3(r,f,g,-1),kO=(r,f,g)=>o3(r,f,g,1),dx=(r,f,g)=>{const v=vu(r.element,"."+f.itemClass);return Tt(je(v,_=>r.getSystem().getByDom(_).toOptional()))};var NP=Object.freeze({__proto__:null,dehighlightAll:PP,dehighlight:yI,highlight:Q2,highlightFirst:cS,highlightLast:MP,highlightAt:RP,highlightBy:$P,isHighlighted:Z2,getHighlighted:cx,getFirst:ux,getLast:fx,getPrevious:f1,getNext:kO,getCandidates:dx}),IP=[nn("highlightClass"),nn("itemClass"),qs("onHighlight"),qs("onDehighlight")];const Nr=nc({fields:IP,name:"highlighting",apis:NP}),hx=[8],yp=[9],wp=[13],d1=[27],zu=[32],uS=[37],xO=[38],fS=[39],W0=[40],BP=(r,f,g)=>{const v=bn(r.slice(0,f)),_=bn(r.slice(f+1));return kt(v.concat(_),g)},wI=(r,f,g)=>{const v=bn(r.slice(0,f));return kt(v,g)},LP=(r,f,g)=>{const v=r.slice(0,f),_=r.slice(f+1);return kt(_.concat(v),g)},s3=(r,f,g)=>{const v=r.slice(f+1);return kt(v,g)},ur=r=>f=>{const g=f.raw;return st(r,g.which)},_m=r=>f=>Gt(r,g=>g(f)),TO=r=>r.raw.shiftKey===!0,FP=r=>r.raw.ctrlKey===!0,U0=Oe(TO),mr=(r,f)=>({matches:r,classification:f}),QP=(r,f)=>kt(r,v=>v.matches(f)).map(v=>v.classification),dS=(r,f,g)=>{f.exists(_=>g.exists(T=>xr(T,_)))||Ao(r,Rv(),{prevFocus:f,newFocus:g})},hS=()=>{const r=g=>al(g.element);return{get:r,set:(g,v)=>{const _=r(g);g.getSystem().triggerFocus(v,g.element);const T=r(g);dS(g,_,T)}}},mS=()=>{const r=g=>Nr.getHighlighted(g).map(v=>v.element);return{get:r,set:(g,v)=>{const _=r(g);g.getSystem().getByDom(v).fold(L,P=>{Nr.highlight(g,P)});const T=r(g);dS(g,_,T)}}};var h1;(function(r){r.OnFocusMode="onFocus",r.OnEnterOrSpaceMode="onEnterOrSpace",r.OnApiMode="onApi"})(h1||(h1={}));const _p=(r,f,g,v,_)=>{const T=()=>r.concat([xt("focusManager",hS()),Dc("focusInside","onFocus",of(J=>st(["onFocus","onEnterOrSpace","onApi"],J)?wn.value(J):wn.error("Invalid value for focusInside"))),Yi("handler",W),Yi("state",f),Yi("sendFocusIn",_)]),P=(J,ie,de,ge,_e)=>{const Ie=de(J,ie,ge,_e);return QP(Ie,ie.event).bind(it=>it(J,ie,ge,_e))},W={schema:T,processKey:P,toEvents:(J,ie)=>{const de=J.focusInside!==h1.OnFocusMode?V.none():_(J).map(Ie=>on($d(),(it,Qt)=>{Ie(it,J,ie),Qt.stop()})),ge=(Ie,it)=>{const Qt=ur(zu.concat(wp))(it.event);J.focusInside===h1.OnEnterOrSpaceMode&&Qt&&rf(Ie,it)&&_(J).each(dt=>{dt(Ie,J,ie),it.stop()})},_e=[on(If(),(Ie,it)=>{P(Ie,it,g,J,ie).fold(()=>{ge(Ie,it)},Qt=>{it.stop()})}),on(Jw(),(Ie,it)=>{P(Ie,it,v,J,ie).each(Qt=>{it.stop()})})];return li(de.toArray().concat(_e))}};return W},O=r=>{const f=[Er("onEscape"),Er("onEnter"),xt("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),xt("firstTabstop",0),xt("useTabstopAt",ot),Er("visibilitySelector")].concat([r]),g=(dt,ft)=>{const Yt=dt.visibilitySelector.bind(Dt=>df(ft,Dt)).getOr(ft);return Ii(Yt)>0},v=(dt,ft)=>{const Yt=vu(dt.element,ft.selector),Dt=Kn(Yt,kn=>g(ft,kn));return V.from(Dt[ft.firstTabstop])},_=(dt,ft)=>ft.focusManager.get(dt).bind(Yt=>df(Yt,ft.selector)),T=(dt,ft)=>g(dt,ft)&&dt.useTabstopAt(ft),P=(dt,ft,Yt)=>{v(dt,ft).each(Dt=>{ft.focusManager.set(dt,Dt)})},I=(dt,ft,Yt,Dt,kn)=>kn(ft,Yt,pn=>T(Dt,pn)).fold(()=>Dt.cyclic?V.some(!0):V.none(),pn=>(Dt.focusManager.set(dt,pn),V.some(!0))),W=(dt,ft,Yt,Dt)=>{const kn=vu(dt.element,Yt.selector);return _(dt,Yt).bind(pn=>jt(kn,Re(xr,pn)).bind(jn=>I(dt,kn,jn,Yt,Dt)))},J=(dt,ft,Yt)=>{const Dt=Yt.cyclic?BP:wI;return W(dt,ft,Yt,Dt)},ie=(dt,ft,Yt)=>{const Dt=Yt.cyclic?LP:s3;return W(dt,ft,Yt,Dt)},de=dt=>Zc(dt).bind(Tf).exists(ft=>xr(ft,dt)),ge=(dt,ft,Yt)=>_(dt,Yt).filter(Dt=>!Yt.useTabstopAt(Dt)).bind(Dt=>(de(Dt)?J:ie)(dt,ft,Yt)),_e=(dt,ft,Yt)=>Yt.onEnter.bind(Dt=>Dt(dt,ft)),Ie=(dt,ft,Yt)=>Yt.onEscape.bind(Dt=>Dt(dt,ft)),it=G([mr(_m([TO,ur(yp)]),J),mr(ur(yp),ie),mr(_m([U0,ur(wp)]),_e)]),Qt=G([mr(ur(d1),Ie),mr(ur(yp),ge)]);return _p(f,Ff.init,it,Qt,()=>V.some(P))};var k=O(ka("cyclic",tt)),D=O(ka("cyclic",ot));const N=(r,f,g)=>(nb(r,g,af()),V.some(!0)),Y=(r,f,g)=>Op(g)&&ur(zu)(f.event)?V.none():N(r,f,g),se=(r,f)=>V.some(!0),pe=[xt("execute",Y),xt("useSpace",!1),xt("useEnter",!0),xt("useControlEnter",!1),xt("useDown",!1)],Ee=(r,f,g)=>g.execute(r,f,r.element),Fe=(r,f,g,v)=>{const _=g.useSpace&&!Op(r.element)?zu:[],T=g.useEnter?wp:[],P=g.useDown?W0:[],I=_.concat(T).concat(P);return[mr(ur(I),Ee)].concat(g.useControlEnter?[mr(_m([FP,ur(wp)]),Ee)]:[])},rt=(r,f,g,v)=>g.useSpace&&!Op(r.element)?[mr(ur(zu),se)]:[];var _t=_p(pe,Ff.init,Fe,rt,()=>V.none());const dn=()=>{const r=Xi();return mu({readState:()=>r.get().map(_=>({numRows:String(_.numRows),numColumns:String(_.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(_,T)=>{r.set({numRows:_,numColumns:T})},getNumRows:()=>r.get().map(_=>_.numRows),getNumColumns:()=>r.get().map(_=>_.numColumns)})};var Wn=Object.freeze({__proto__:null,flatgrid:dn,init:r=>r.state(r)});const sn=r=>(f,g,v,_)=>{const T=r(f.element);return cs(T,f,g,v,_)},Un=(r,f)=>{const g=R0(r,f);return sn(g)},tn=(r,f)=>{const g=R0(f,r);return sn(g)},Oo=r=>(f,g,v,_)=>cs(r,f,g,v,_),cs=(r,f,g,v,_)=>v.focusManager.get(f).bind(P=>r(f.element,P,v,_)).map(P=>(v.focusManager.set(f,P),!0)),Ds=Oo,da=Oo,Rl=Oo,wl=r=>r.offsetWidth<=0&&r.offsetHeight<=0,Vu=r=>!wl(r.dom),Y0=(r,f)=>jt(r,f).map(g=>({index:g,candidates:r})),H2=(r,f,g)=>{const v=P=>xr(P,f),_=vu(r,g),T=Kn(_,Vu);return Y0(T,v)},gS=(r,f)=>jt(r,g=>xr(f,g)),pS=(r,f,g,v)=>{const _=Math.floor(f/g),T=f%g;return v(_,T).bind(P=>{const I=P.row*g+P.column;return I>=0&&I<r.length?V.some(r[I]):V.none()})},xi=(r,f,g,v,_)=>pS(r,f,v,(T,P)=>{const W=T===g-1?r.length-T*v:v,J=kh(P,_,0,W-1);return V.some({row:T,column:J})}),Wu=(r,f,g,v,_)=>pS(r,f,v,(T,P)=>{const I=kh(T,_,0,g-1),J=I===g-1?r.length-I*v:v,ie=cd(P,0,J-1);return V.some({row:I,column:ie})}),vf=(r,f,g,v)=>xi(r,f,g,v,1),Sm=(r,f,g,v)=>xi(r,f,g,v,-1),Of=(r,f,g,v)=>Wu(r,f,g,v,-1),X0=(r,f,g,v)=>Wu(r,f,g,v,1),Uu=[nn("selector"),xt("execute",Y),pu("onEscape"),xt("captureTab",!1),mg()],z2=(r,f,g)=>{sa(r.element,f.selector).each(v=>{f.focusManager.set(r,v)})},V2=(r,f)=>f.focusManager.get(r).bind(g=>df(g,f.selector)),wg=(r,f,g,v)=>V2(r,g).bind(_=>g.execute(r,f,_)),vc=r=>(f,g,v,_)=>H2(f,g,v.selector).bind(T=>r(T.candidates,T.index,_.getNumRows().getOr(v.initSize.numRows),_.getNumColumns().getOr(v.initSize.numColumns))),mx=(r,f,g)=>g.captureTab?V.some(!0):V.none(),r3=(r,f,g)=>g.onEscape(r,f),i3=vc(Sm),a3=vc(vf),ZP=vc(Of),gx=vc(X0),HP=G([mr(ur(uS),Un(i3,a3)),mr(ur(fS),tn(i3,a3)),mr(ur(xO),Ds(ZP)),mr(ur(W0),da(gx)),mr(_m([TO,ur(yp)]),mx),mr(_m([U0,ur(yp)]),mx),mr(ur(zu.concat(wp)),wg)]),W2=G([mr(ur(d1),r3),mr(ur(zu),se)]);var zP=_p(Uu,dn,HP,W2,()=>V.some(z2));const l3=(r,f,g,v,_)=>{const T=I=>gl(I)==="button"&&zi(I,"disabled")==="disabled",P=(I,W,J)=>_(I,W,v,0,J.length-1,J[W],ie=>T(J[ie])?P(I,ie,J):V.from(J[ie]));return H2(r,g,f).bind(I=>{const W=I.index,J=I.candidates;return P(W,W,J)})},_I=(r,f,g,v)=>l3(r,f,g,v,(_,T,P,I,W,J,ie)=>{const de=cd(T+P,I,W);return de===_?V.from(J):ie(de)}),VP=(r,f,g,v)=>l3(r,f,g,v,(_,T,P,I,W,J,ie)=>{const de=kh(T,P,I,W);return de===_?V.none():ie(de)}),SI=[nn("selector"),xt("getInitial",V.none),xt("execute",Y),pu("onEscape"),xt("executeOnMove",!1),xt("allowVertical",!0),xt("allowHorizontal",!0),xt("cycles",!0)],xV=(r,f)=>f.focusManager.get(r).bind(g=>df(g,f.selector)),WP=(r,f,g)=>xV(r,g).bind(v=>g.execute(r,f,v)),_g=(r,f,g)=>{f.getInitial(r).orThunk(()=>sa(r.element,f.selector)).each(v=>{f.focusManager.set(r,v)})},CI=(r,f,g)=>(g.cycles?VP:_I)(r,g.selector,f,-1),kI=(r,f,g)=>(g.cycles?VP:_I)(r,g.selector,f,1),xI=r=>(f,g,v,_)=>r(f,g,v,_).bind(()=>v.executeOnMove?WP(f,g,v):V.some(!0)),TV=(r,f,g)=>g.onEscape(r,f),EV=(r,f,g,v)=>{const _=[...g.allowHorizontal?uS:[]].concat(g.allowVertical?xO:[]),T=[...g.allowHorizontal?fS:[]].concat(g.allowVertical?W0:[]);return[mr(ur(_),xI(Un(CI,kI))),mr(ur(T),xI(tn(CI,kI))),mr(ur(wp),WP),mr(ur(zu),WP)]},bS=G([mr(ur(zu),se),mr(ur(d1),TV)]);var UP=_p(SI,Ff.init,EV,bS,()=>V.some(_g));const c3=(r,f,g)=>V.from(r[f]).bind(v=>V.from(v[g]).map(_=>({rowIndex:f,columnIndex:g,cell:_}))),u3=(r,f,g,v)=>{const T=r[f].length,P=kh(g,v,0,T-1);return c3(r,f,P)},px=(r,f,g,v)=>{const _=kh(g,v,0,r.length-1),T=r[_].length,P=cd(f,0,T-1);return c3(r,_,P)},f3=(r,f,g,v)=>{const T=r[f].length,P=cd(g+v,0,T-1);return c3(r,f,P)},TI=(r,f,g,v)=>{const _=cd(g+v,0,r.length-1),T=r[_].length,P=cd(f,0,T-1);return c3(r,_,P)},AV=(r,f,g)=>u3(r,f,g,1),DV=(r,f,g)=>u3(r,f,g,-1),PV=(r,f,g)=>px(r,g,f,-1),MV=(r,f,g)=>px(r,g,f,1),RV=(r,f,g)=>f3(r,f,g,-1),EI=(r,f,g)=>f3(r,f,g,1),YP=(r,f,g)=>TI(r,g,f,-1),$V=(r,f,g)=>TI(r,g,f,1),NV=[sd("selectors",[nn("row"),nn("cell")]),xt("cycles",!0),xt("previousSelector",V.none),xt("execute",Y)],IV=(r,f,g)=>{f.previousSelector(r).orThunk(()=>{const _=f.selectors;return sa(r.element,_.cell)}).each(_=>{f.focusManager.set(r,_)})},BV=(r,f,g)=>al(r.element).bind(v=>g.execute(r,f,v)),U2=(r,f)=>je(r,g=>vu(g,f.selectors.cell)),d3=(r,f)=>(g,v,_)=>{const T=_.cycles?r:f;return df(v,_.selectors.row).bind(P=>{const I=vu(P,_.selectors.cell);return gS(I,v).bind(W=>{const J=vu(g,_.selectors.row);return gS(J,P).bind(ie=>{const de=U2(J,_);return T(de,ie,W).map(ge=>ge.cell)})})})},AI=d3(DV,RV),h3=d3(AV,EI),LV=d3(PV,YP),DI=d3(MV,$V),PI=G([mr(ur(uS),Un(AI,h3)),mr(ur(fS),tn(AI,h3)),mr(ur(xO),Ds(LV)),mr(ur(W0),da(DI)),mr(ur(zu.concat(wp)),BV)]),MI=G([mr(ur(zu),se)]);var RI=_p(NV,Ff.init,PI,MI,()=>V.some(IV));const FV=[nn("selector"),xt("execute",Y),xt("moveOnTab",!1)],$I=(r,f,g)=>g.focusManager.get(r).bind(v=>g.execute(r,f,v)),QV=(r,f,g)=>{sa(r.element,f.selector).each(v=>{f.focusManager.set(r,v)})},m3=(r,f,g)=>VP(r,g.selector,f,-1),NI=(r,f,g)=>VP(r,g.selector,f,1),ZV=(r,f,g,v)=>g.moveOnTab?Rl(m3)(r,f,g,v):V.none(),HV=(r,f,g,v)=>g.moveOnTab?Rl(NI)(r,f,g,v):V.none(),zV=G([mr(ur(xO),Rl(m3)),mr(ur(W0),Rl(NI)),mr(_m([TO,ur(yp)]),ZV),mr(_m([U0,ur(yp)]),HV),mr(ur(wp),$I),mr(ur(zu),$I)]),II=G([mr(ur(zu),se)]);var VV=_p(FV,Ff.init,zV,II,()=>V.some(QV));const WV=[pu("onSpace"),pu("onEnter"),pu("onShiftEnter"),pu("onLeft"),pu("onRight"),pu("onTab"),pu("onShiftTab"),pu("onUp"),pu("onDown"),pu("onEscape"),xt("stopSpaceKeyup",!1),Er("focusIn")],UV=(r,f,g)=>[mr(ur(zu),g.onSpace),mr(_m([U0,ur(wp)]),g.onEnter),mr(_m([TO,ur(wp)]),g.onShiftEnter),mr(_m([TO,ur(yp)]),g.onShiftTab),mr(_m([U0,ur(yp)]),g.onTab),mr(ur(xO),g.onUp),mr(ur(W0),g.onDown),mr(ur(uS),g.onLeft),mr(ur(fS),g.onRight),mr(ur(zu),g.onSpace)],BI=(r,f,g)=>[...g.stopSpaceKeyup?[mr(ur(zu),se)]:[],mr(ur(d1),g.onEscape)];var YV=_p(WV,Ff.init,UV,BI,r=>r.focusIn);const XV=k.schema(),LI=D.schema(),jV=UP.schema(),qV=zP.schema(),g3=RI.schema(),GV=_t.schema(),FI=VV.schema(),Xd=YV.schema();var KV=Object.freeze({__proto__:null,acyclic:XV,cyclic:LI,flow:jV,flatgrid:qV,matrix:g3,execution:GV,menu:FI,special:Xd});const QI=r=>Qi(r,"setGridSize"),No=l2({branchKey:"mode",branches:KV,name:"keying",active:{events:(r,f)=>r.handler.toEvents(r,f)},apis:{focusIn:(r,f,g)=>{f.sendFocusIn(f).fold(()=>{r.getSystem().triggerFocus(r.element,r.element)},v=>{v(r,f,g)})},setGridSize:(r,f,g,v,_)=>{QI(g)?g.setGridSize(v,_):console.error("Layout does not support setGridSize")}},state:Wn}),ZI=(r,f)=>{Qd(()=>{Hf(r,f,()=>je(f,r.getSystem().build))},r.element)},XP=(r,f)=>{Qd(()=>{Hu(r,f,()=>ad(r.element,f,r.getSystem().buildOrPatch))},r.element)},JV=(r,f,g,v)=>{Sb(f);const _=zv(r.element,g,v,r.getSystem().buildOrPatch);zd(r,_),r.syncComponents()},p3=(r,f,g)=>{const v=r.getSystem().build(g);Vd(r,v,f)},HI=(r,f,g,v)=>{qc(f),p3(r,(_,T)=>Da(_,T,g),v)},eW=(r,f,g,v)=>(f.reuseDom?XP:ZI)(r,v),tW=(r,f,g,v)=>{p3(r,il,v)},nW=(r,f,g,v)=>{p3(r,Wg,v)},oW=(r,f,g,v)=>{const _=bx(r);kt(_,P=>xr(v.element,P.element)).each(qc)},bx=(r,f)=>r.components(),jP=(r,f,g,v,_)=>{const T=bx(r);return V.from(T[v]).map(P=>(_.fold(()=>qc(P),I=>{(f.reuseDom?JV:HI)(r,P,v,I)}),P))};var zI=Object.freeze({__proto__:null,append:tW,prepend:nW,remove:oW,replaceAt:jP,replaceBy:(r,f,g,v,_)=>{const T=bx(r);return jt(T,v).bind(P=>jP(r,f,g,P,_))},set:eW,contents:bx});const gs=nc({fields:[ja("reuseDom",!0)],name:"replacing",apis:zI}),qP=(r,f)=>{const g=li(f);return nc({fields:[nn("enabled")],name:r,active:{events:G(g)}})},xs=(r,f)=>{const g=qP(r,f);return{key:r,value:{config:{},me:g,configAsRaw:G({}),initialConfig:{},state:Ff}}},VI=(r,f)=>{f.ignore||(gf(r.element),f.onFocus(r))};var WI=Object.freeze({__proto__:null,focus:VI,blur:(r,f)=>{f.ignore||Kv(r.element)},isFocused:r=>i1(r.element)}),sW=Object.freeze({__proto__:null,exhibit:(r,f)=>{const g=f.ignore?{}:{attributes:{tabindex:"-1"}};return Yc(g)},events:r=>li([on($d(),(f,g)=>{VI(f,r),g.stop()})].concat(r.stopMousedown?[on(Fr(),(f,g)=>{g.event.prevent()})]:[]))}),EO=[qs("onFocus"),xt("stopMousedown",!1),xt("ignore",!1)];const ns=nc({fields:EO,name:"focusing",active:sW,apis:WI}),XI=r=>({init:()=>{const g=Ho(r);return{get:()=>g.get(),set:I=>g.set(I),clear:()=>g.set(r),readState:()=>g.get()}}}),rW=(r,f,g)=>{const v=f.aria;v.update(r,v,g.get())},iW=(r,f,g)=>{f.toggleClass.each(v=>{g.get()?Na(r.element,v):va(r.element,v)})},j0=(r,f,g,v)=>{const _=g.get();g.set(v),iW(r,f,g),rW(r,f,g),_!==v&&f.onToggled(r,v)},vS=(r,f,g)=>{j0(r,f,g,!g.get())},jI=(r,f,g)=>{j0(r,f,g,!0)},qI=(r,f,g)=>{j0(r,f,g,!1)},AO=(r,f,g)=>g.get(),q0=(r,f,g)=>{j0(r,f,g,f.selected)};var aW=Object.freeze({__proto__:null,onLoad:q0,toggle:vS,isOn:AO,on:jI,off:qI,set:j0}),G0=Object.freeze({__proto__:null,exhibit:()=>Yc({}),events:(r,f)=>{const g=r2(r,f,vS),v=i2(r,f,q0);return li(pt([r.toggleOnExecute?[g]:[],[v]]))}});const GP=(r,f,g)=>{qn(r.element,"aria-pressed",g),f.syncWithExpanded&&KP(r,f,g)},GI=(r,f,g)=>{qn(r.element,"aria-selected",g)},KI=(r,f,g)=>{qn(r.element,"aria-checked",g)},KP=(r,f,g)=>{qn(r.element,"aria-expanded",g)};var JP=[xt("selected",!1),Er("toggleClass"),xt("toggleOnExecute",!0),qs("onToggled"),Dc("aria",{mode:"none"},xl("mode",{pressed:[xt("syncWithExpanded",!1),Yi("update",GP)],checked:[Yi("update",KI)],expanded:[Yi("update",KP)],selected:[Yi("update",GI)],none:[Yi("update",L)]}))];const Ms=nc({fields:JP,name:"toggling",active:G0,apis:aW,state:XI(!1)}),JI=()=>{const r=(f,g)=>{g.stop(),bh(f)};return[on(sm(),r),on(tb(),r),am(uu()),am(Fr())]},b3=r=>{const f=g=>hu((v,_)=>{g(v),_.stop()});return li(pt([r.map(f).toArray(),JI()]))},eB="alloy.item-hover",vx="alloy.item-focus",v3="alloy.item-toggled",O3=r=>{(al(r.element).isNone()||ns.isFocused(r))&&(ns.isFocused(r)||ns.focus(r),Ao(r,eB,{item:r}))},tB=r=>{Ao(r,vx,{item:r})},cW=(r,f)=>{Ao(r,v3,{item:r,state:f})},e5=G(eB),nB=G(vx),oB=G(v3),sB=r=>r.toggling.map(f=>f.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),uW=r=>({aria:{mode:"checked"},...Ls(r,(f,g)=>g!=="exclusive"),onToggled:(f,g)=>{F(r.onToggled)&&r.onToggled(f,g),cW(f,g)}}),t5=r=>({dom:r.dom,domModification:{...r.domModification,attributes:{role:sB(r),...r.domModification.attributes,"aria-haspopup":r.hasSubmenu,...r.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:ym.augment(r.itemBehaviours,[r.toggling.fold(Ms.revoke,f=>Ms.config(uW(f))),ns.config({ignore:r.ignoreFocus,stopMousedown:r.ignoreFocus,onFocus:f=>{tB(f)}}),No.config({mode:"execution"}),Gn.config({store:{mode:"memory",initialValue:r.data}}),xs("item-type-events",[...JI(),on(Tl(),O3),on(f0(),ns.focus)])]),components:r.components,eventOrder:r.eventOrder}),fW=[nn("data"),nn("components"),nn("dom"),xt("hasSubmenu",!1),Er("toggling"),ym.field("itemBehaviours",[Ms,ns,No,Gn]),xt("ignoreFocus",!1),xt("domModification",{}),Yi("builder",t5),xt("eventOrder",{})],dW=r=>({dom:r.dom,components:r.components,events:li([Bd(f0())])}),hW=[nn("dom"),nn("components"),Yi("builder",dW)],n5=G("item-widget"),y3=G([Gc({name:"widget",overrides:r=>({behaviours:Tn([Gn.config({store:{mode:"manual",getValue:f=>r.data,setValue:L}})])})})]),mW=r=>{const f=oS(n5(),r,y3()),g=ox(n5(),r,f.internals()),v=T=>Ri(T,r,"widget").map(P=>(No.focusIn(P),P)),_=(T,P)=>Op(P.event.target)?V.none():(()=>(r.autofocus&&P.setSource(T.element),V.none()))();return{dom:r.dom,components:g,domModification:r.domModification,events:li([hu((T,P)=>{v(T).each(I=>{P.stop()})}),on(Tl(),O3),on(f0(),(T,P)=>{r.autofocus?v(T):ns.focus(T)})]),behaviours:ym.augment(r.widgetBehaviours,[Gn.config({store:{mode:"memory",initialValue:r.data}}),ns.config({ignore:r.ignoreFocus,onFocus:T=>{tB(T)}}),No.config({mode:"special",focusIn:r.autofocus?T=>{v(T)}:no(),onLeft:_,onRight:_,onEscape:(T,P)=>!ns.isFocused(T)&&!r.autofocus?(ns.focus(T),V.some(!0)):(r.autofocus&&P.setSource(T.element),V.none())})])}},gW=[nn("uid"),nn("data"),nn("components"),nn("dom"),xt("autofocus",!1),xt("ignoreFocus",!1),ym.field("widgetBehaviours",[Gn,ns,No]),xt("domModification",{}),sS(y3()),Yi("builder",mW)],rB=xl("type",{widget:gW,item:fW,separator:hW}),Ox=(r,f)=>({mode:"flatgrid",selector:"."+r.markers.item,initSize:{numColumns:f.initSize.numColumns,numRows:f.initSize.numRows},focusManager:r.focusManager}),pW=(r,f)=>({mode:"matrix",selectors:{row:f.rowSelector,cell:"."+r.markers.item},previousSelector:f.previousSelector,focusManager:r.focusManager}),yx=(r,f)=>({mode:"menu",selector:"."+r.markers.item,moveOnTab:f.moveOnTab,focusManager:r.focusManager}),o5=G([hd({factory:{sketch:r=>{const f=Es("menu.spec item",rB,r);return f.builder(f)}},name:"items",unit:"item",defaults:(r,f)=>vs(f,"uid")?f:{...f,uid:yh("item")},overrides:(r,f)=>({type:f.type,ignoreFocus:r.fakeFocus,domModification:{classes:[r.markers.item]}})})]),iB=G([nn("value"),nn("items"),nn("dom"),nn("components"),xt("eventOrder",{}),Wl("menuBehaviours",[Nr,Gn,cr,No]),Dc("movement",{mode:"menu",moveOnTab:!0},xl("mode",{grid:[mg(),Yi("config",Ox)],matrix:[Yi("config",pW),nn("rowSelector"),xt("previousSelector",V.none)],menu:[xt("moveOnTab",!0),Yi("config",yx)]})),dg(),xt("fakeFocus",!1),xt("focusManager",hS()),qs("onHighlight"),qs("onDehighlight")]),s5=G("alloy.menu-focus"),bW=(r,f)=>{const g=vu(r.element,'[role="menuitemradio"][aria-checked="true"]');mt(g,v=>{xr(v,f.element)||r.getSystem().getByDom(v).each(_=>{Ms.off(_)})})},vW=(r,f,g,v)=>({uid:r.uid,dom:r.dom,markers:r.markers,behaviours:sc(r.menuBehaviours,[Nr.config({highlightClass:r.markers.selectedItem,itemClass:r.markers.item,onHighlight:r.onHighlight,onDehighlight:r.onDehighlight}),Gn.config({store:{mode:"memory",initialValue:r.value}}),cr.config({find:V.some}),No.config(r.movement.config(r,r.movement))]),events:li([on(nB(),(_,T)=>{const P=T.event;_.getSystem().getByDom(P.target).each(I=>{Nr.highlight(_,I),T.stop(),Ao(_,s5(),{menu:_,item:I})})}),on(e5(),(_,T)=>{const P=T.event.item;Nr.highlight(_,P)}),on(oB(),(_,T)=>{const{item:P,state:I}=T.event;I&&zi(P.element,"role")==="menuitemradio"&&bW(_,P)})]),components:f,eventOrder:r.eventOrder,domModification:{attributes:{role:"menu"}}}),DO=wu({name:"Menu",configFields:iB(),partFields:o5(),factory:vW}),OW=r=>qr(r,(f,g)=>({k:f,v:g})),r5=(r,f,g,v)=>ln(g,v).bind(_=>ln(r,_).bind(T=>{const P=r5(r,f,g,T);return V.some([T].concat(P))})).getOr([]),yW=(r,f)=>{const g={};dr(r,(P,I)=>{mt(P,W=>{g[W]=I})});const v=f,_=OW(f),T=Ns(_,(P,I)=>[I].concat(r5(g,v,_,I)));return Ns(g,P=>ln(T,P).getOr([P]))},wW=()=>{const r=Ho({}),f=Ho({}),g=Ho({}),v=Xi(),_=Ho({}),T=()=>{r.set({}),f.set({}),g.set({}),v.clear()},P=()=>v.get().isNone(),I=(kn,pn)=>{f.set({...f.get(),[kn]:{type:"prepared",menu:pn}})},W=(kn,pn,Nn,jn)=>{v.set(kn),r.set(Nn),f.set(pn),_.set(jn);const Ys=yW(jn,Nn);g.set(Ys)},J=kn=>bs(r.get(),(pn,Nn)=>pn===kn),ie=(kn,pn,Nn)=>it(kn).bind(jn=>J(kn).bind(Ys=>pn(Ys).map(ko=>({triggeredMenu:jn,triggeringItem:ko,triggeringPath:Nn})))),de=(kn,pn)=>{const Nn=Kn(dt(kn).toArray(),jn=>it(jn).isSome());return ln(g.get(),kn).bind(jn=>{const Ys=bn(Nn.concat(jn)),ko=Ne(Ys,(_s,hs)=>ie(_s,pn,Ys.slice(0,hs+1)).fold(()=>ze(v.get(),_s)?[]:[V.none()],vr=>[V.some(vr)]));return Wt(ko)})},ge=kn=>ln(r.get(),kn).map(pn=>{const Nn=ln(g.get(),kn).getOr([]);return[pn].concat(Nn)}),_e=kn=>ln(g.get(),kn).bind(pn=>pn.length>1?V.some(pn.slice(1)):V.none()),Ie=kn=>ln(g.get(),kn),it=kn=>Qt(kn).bind(i5),Qt=kn=>ln(f.get(),kn),dt=kn=>ln(r.get(),kn);return{setMenuBuilt:I,setContents:W,expand:ge,refresh:Ie,collapse:_e,lookupMenu:Qt,lookupItem:dt,otherMenus:kn=>{const pn=_.get();return At(Xs(pn),kn)},getPrimary:()=>v.get().bind(it),getMenus:()=>f.get(),clear:T,isClear:P,getTriggeringPath:de}},i5=r=>r.type==="prepared"?V.some(r.menu):V.none(),wx={init:wW,extractPreparedMenu:i5},w3=io("tiered-menu-item-highlight"),_3=io("tiered-menu-item-dehighlight");var md;(function(r){r[r.HighlightMenuAndItem=0]="HighlightMenuAndItem",r[r.HighlightJustMenu=1]="HighlightJustMenu",r[r.HighlightNone=2]="HighlightNone"})(md||(md={}));const _W=(r,f)=>{const g=Xi(),v=(Qn,_o,us)=>Ns(us,(Js,Wo)=>{const Os=()=>DO.sketch({...Js,value:Wo,markers:r.markers,fakeFocus:r.fakeFocus,onHighlight:($i,zr)=>{Ao($i,w3,{menuComp:$i,itemComp:zr})},onDehighlight:($i,zr)=>{Ao($i,_3,{menuComp:$i,itemComp:zr})},focusManager:r.fakeFocus?mS():hS()});return Wo===_o?{type:"prepared",menu:Qn.getSystem().build(Os())}:{type:"notbuilt",nbMenu:Os}}),_=wx.init(),T=Qn=>{const _o=v(Qn,r.data.primary,r.data.menus),us=W();return _.setContents(r.data.primary,_o,r.data.expansions,us),_.getPrimary()},P=Qn=>Gn.getValue(Qn).value,I=(Qn,_o,us)=>tr(_o,Js=>{if(!Js.getSystem().isConnected())return V.none();const Wo=Nr.getCandidates(Js);return kt(Wo,Os=>P(Os)===us)}),W=Qn=>Ns(r.data.menus,(_o,us)=>Ne(_o.items,Js=>Js.type==="separator"?[]:[Js.data.value])),J=Nr.highlight,ie=(Qn,_o)=>{J(Qn,_o),Nr.getHighlighted(_o).orThunk(()=>Nr.getFirst(_o)).each(us=>{r.fakeFocus?Nr.highlight(_o,us):nb(Qn,us.element,f0())})},de=(Qn,_o)=>Tt(je(_o,us=>Qn.lookupMenu(us).bind(Js=>Js.type==="prepared"?V.some(Js.menu):V.none()))),ge=(Qn,_o,us)=>{const Js=de(_o,_o.otherMenus(us));mt(Js,Wo=>{Xc(Wo.element,[r.markers.backgroundMenu]),r.stayInDom||gs.remove(Qn,Wo)})},_e=Qn=>g.get().getOrThunk(()=>{const _o={},us=vu(Qn.element,`.${r.markers.item}`),Js=Kn(us,Wo=>zi(Wo,"aria-haspopup")==="true");return mt(Js,Wo=>{Qn.getSystem().getByDom(Wo).each(Os=>{const $i=P(Os);_o[$i]=Os})}),g.set(_o),_o}),Ie=(Qn,_o)=>{const us=_e(Qn);dr(us,(Js,Wo)=>{const Os=st(_o,Wo);qn(Js.element,"aria-expanded",Os)})},it=(Qn,_o,us)=>V.from(us[0]).bind(Js=>_o.lookupMenu(Js).bind(Wo=>{if(Wo.type==="notbuilt")return V.none();{const Os=Wo.menu,$i=de(_o,us.slice(1));return mt($i,zr=>{Na(zr.element,r.markers.backgroundMenu)}),js(Os.element)||gs.append(Qn,gu(Os)),Xc(Os.element,[r.markers.backgroundMenu]),ie(Qn,Os),ge(Qn,_o,us),V.some(Os)}}));let Qt;(function(Qn){Qn[Qn.HighlightSubmenu=0]="HighlightSubmenu",Qn[Qn.HighlightParent=1]="HighlightParent"})(Qt||(Qt={}));const dt=(Qn,_o,us)=>{if(us.type==="notbuilt"){const Js=Qn.getSystem().build(us.nbMenu());return _.setMenuBuilt(_o,Js),Js}else return us.menu},ft=(Qn,_o,us=Qt.HighlightSubmenu)=>{if(_o.hasConfigured(Jo)&&Jo.isDisabled(_o))return V.some(_o);{const Js=P(_o);return _.expand(Js).bind(Wo=>(Ie(Qn,Wo),V.from(Wo[0]).bind(Os=>_.lookupMenu(Os).bind($i=>{const zr=dt(Qn,Os,$i);return js(zr.element)||gs.append(Qn,gu(zr)),r.onOpenSubmenu(Qn,_o,zr,bn(Wo)),us===Qt.HighlightSubmenu?(Nr.highlightFirst(zr),it(Qn,_,Wo)):(Nr.dehighlightAll(zr),V.some(_o))}))))}},Yt=(Qn,_o)=>{const us=P(_o);return _.collapse(us).bind(Js=>(Ie(Qn,Js),it(Qn,_,Js).map(Wo=>(r.onCollapseMenu(Qn,_o,Wo),Wo))))},Dt=(Qn,_o)=>{const us=P(_o);return _.refresh(us).bind(Js=>(Ie(Qn,Js),it(Qn,_,Js)))},kn=(Qn,_o)=>Op(_o.element)?V.none():ft(Qn,_o,Qt.HighlightSubmenu),pn=(Qn,_o)=>Op(_o.element)?V.none():Yt(Qn,_o),Nn=(Qn,_o)=>Yt(Qn,_o).orThunk(()=>r.onEscape(Qn,_o).map(()=>Qn)),jn=Qn=>(_o,us)=>df(us.getSource(),`.${r.markers.item}`).bind(Js=>_o.getSystem().getByDom(Js).toOptional().bind(Wo=>Qn(_o,Wo).map(ot))),Ys=li([on(s5(),(Qn,_o)=>{const us=_o.event.item;_.lookupItem(P(us)).each(()=>{const Js=_o.event.menu;Nr.highlight(Qn,Js);const Wo=P(_o.event.item);_.refresh(Wo).each(Os=>ge(Qn,_,Os))})}),hu((Qn,_o)=>{const us=_o.event.target;Qn.getSystem().getByDom(us).each(Js=>{P(Js).indexOf("collapse-item")===0&&Yt(Qn,Js),ft(Qn,Js,Qt.HighlightSubmenu).fold(()=>{r.onExecute(Qn,Js)},L)})}),Ci((Qn,_o)=>{T(Qn).each(us=>{gs.append(Qn,gu(us)),r.onOpenMenu(Qn,us),r.highlightOnOpen===md.HighlightMenuAndItem?ie(Qn,us):r.highlightOnOpen===md.HighlightJustMenu&&J(Qn,us)})}),on(w3,(Qn,_o)=>{r.onHighlightItem(Qn,_o.event.menuComp,_o.event.itemComp)}),on(_3,(Qn,_o)=>{r.onDehighlightItem(Qn,_o.event.menuComp,_o.event.itemComp)}),...r.navigateOnHover?[on(e5(),(Qn,_o)=>{const us=_o.event.item;Dt(Qn,us),ft(Qn,us,Qt.HighlightParent),r.onHover(Qn,us)})]:[]]),ko=Qn=>Nr.getHighlighted(Qn).bind(Nr.getHighlighted),_s=Qn=>{ko(Qn).each(_o=>{Yt(Qn,_o)})},hs=Qn=>{_.getPrimary().each(_o=>{ie(Qn,_o)})},vr=Qn=>V.from(Qn.components()[0]).filter(_o=>zi(_o.element,"role")==="menu"),fr={collapseMenu:_s,highlightPrimary:hs,repositionMenus:Qn=>{_.getPrimary().bind(us=>ko(Qn).bind(Js=>{const Wo=P(Js),Os=_a(_.getMenus()),$i=Tt(je(Os,wx.extractPreparedMenu));return _.getTriggeringPath(Wo,zr=>I(Qn,$i,zr))}).map(Js=>({primary:us,triggeringPath:Js}))).fold(()=>{vr(Qn).each(us=>{r.onRepositionMenu(Qn,us,[])})},({primary:us,triggeringPath:Js})=>{r.onRepositionMenu(Qn,us,Js)})}};return{uid:r.uid,dom:r.dom,markers:r.markers,behaviours:sc(r.tmenuBehaviours,[No.config({mode:"special",onRight:jn(kn),onLeft:jn(pn),onEscape:jn(Nn),focusIn:(Qn,_o)=>{_.getPrimary().each(us=>{nb(Qn,us.element,f0())})}}),Nr.config({highlightClass:r.markers.selectedMenu,itemClass:r.markers.menu}),cr.config({find:Qn=>Nr.getHighlighted(Qn)}),gs.config({})]),eventOrder:r.eventOrder,apis:fr,events:Ys}},SW=G("collapse-item"),CW=(r,f,g)=>({primary:r,menus:f,expansions:g}),aB=(r,f)=>({primary:r,menus:In(r,f),expansions:{}}),lB=r=>({value:io(SW()),meta:{text:r}}),X2=Kc({name:"TieredMenu",configFields:[Gy("onExecute"),Gy("onEscape"),hg("onOpenMenu"),hg("onOpenSubmenu"),qs("onRepositionMenu"),qs("onCollapseMenu"),xt("highlightOnOpen",md.HighlightMenuAndItem),sd("data",[nn("primary"),nn("menus"),nn("expansions")]),xt("fakeFocus",!1),qs("onHighlightItem"),qs("onDehighlightItem"),qs("onHover"),Yv(),nn("dom"),xt("navigateOnHover",!0),xt("stayInDom",!1),Wl("tmenuBehaviours",[No,Nr,cr,gs]),xt("eventOrder",{})],apis:{collapseMenu:(r,f)=>{r.collapseMenu(f)},highlightPrimary:(r,f)=>{r.highlightPrimary(f)},repositionMenus:(r,f)=>{r.repositionMenus(f)}},factory:_W,extraApis:{tieredData:CW,singleData:aB,collapseItem:lB}}),kW=(r,f,g,v,_)=>{const T=()=>r.lazySink(f),P=v.type==="horizontal"?{layouts:{onLtr:()=>gg(),onRtl:()=>bc()}}:{},I=J=>J.length===2,W=J=>I(J)?P:{};return X2.sketch({dom:{tag:"div"},data:v.data,markers:v.menu.markers,highlightOnOpen:v.menu.highlightOnOpen,fakeFocus:v.menu.fakeFocus,onEscape:()=>(Gs.close(f),r.onEscape.map(J=>J(f)),V.some(!0)),onExecute:()=>V.some(!0),onOpenMenu:(J,ie)=>{yu.positionWithinBounds(T().getOrDie(),ie,g,_())},onOpenSubmenu:(J,ie,de,ge)=>{const _e=T().getOrDie();yu.position(_e,de,{anchor:{type:"submenu",item:ie,...W(ge)}})},onRepositionMenu:(J,ie,de)=>{const ge=T().getOrDie();yu.positionWithinBounds(ge,ie,g,_()),mt(de,_e=>{const Ie=W(_e.triggeringPath);yu.position(ge,_e.triggeredMenu,{anchor:{type:"submenu",item:_e.triggeringItem,...Ie}})})}})},xW=(r,f)=>{const g=(ge,_e)=>r.getRelated(ge).exists(it=>t1(it,_e)),v=(ge,_e)=>{Gs.setContent(ge,_e)},_=(ge,_e,Ie)=>{const it=V.none;T(ge,_e,Ie,it)},T=(ge,_e,Ie,it)=>{const Qt=r.lazySink(ge).getOrDie();Gs.openWhileCloaked(ge,_e,()=>yu.positionWithinBounds(Qt,ge,Ie,it())),Gn.setValue(ge,V.some({mode:"position",config:Ie,getBounds:it}))},P=(ge,_e,Ie)=>{I(ge,_e,Ie,V.none)},I=(ge,_e,Ie,it)=>{const Qt=kW(r,ge,_e,Ie,it);Gs.open(ge,Qt),Gn.setValue(ge,V.some({mode:"menu",menu:Qt}))},W=ge=>{Gs.isOpen(ge)&&(Gn.setValue(ge,V.none()),Gs.close(ge))},J=ge=>Gs.getState(ge),ie=ge=>{Gs.isOpen(ge)&&Gn.getValue(ge).each(_e=>{switch(_e.mode){case"menu":Gs.getState(ge).each(X2.repositionMenus);break;case"position":const Ie=r.lazySink(ge).getOrDie();yu.positionWithinBounds(Ie,ge,_e.config,_e.getBounds());break}})},de={setContent:v,showAt:_,showWithinBounds:T,showMenuAt:P,showMenuWithinBounds:I,hide:W,getContent:J,reposition:ie,isOpen:Gs.isOpen};return{uid:r.uid,dom:r.dom,behaviours:sc(r.inlineBehaviours,[Gs.config({isPartOf:(ge,_e,Ie)=>t1(_e,Ie)||g(ge,Ie),getAttachPoint:ge=>r.lazySink(ge).getOrDie(),onOpen:ge=>{r.onShow(ge)},onClose:ge=>{r.onHide(ge)}}),Gn.config({store:{mode:"memory",initialValue:V.none()}}),Pc.config({channels:{...OO({isExtraPart:f.isExtraPart,...r.fireDismissalEventInstead.map(ge=>({fireEventInstead:{event:ge.event}})).getOr({})}),...zk({...r.fireRepositionEventInstead.map(ge=>({fireEventInstead:{event:ge.event}})).getOr({}),doReposition:ie})}})]),eventOrder:r.eventOrder,apis:de}},Ba=Kc({name:"InlineView",configFields:[nn("lazySink"),qs("onShow"),qs("onHide"),jm("onEscape"),Wl("inlineBehaviours",[Gs,Gn,Pc]),Xa("fireDismissalEventInstead",[xt("event",rg())]),Xa("fireRepositionEventInstead",[xt("event",d0())]),xt("getRelated",V.none),xt("isExtraPart",tt),xt("eventOrder",V.none)],factory:xW,apis:{showAt:(r,f,g,v)=>{r.showAt(f,g,v)},showWithinBounds:(r,f,g,v,_)=>{r.showWithinBounds(f,g,v,_)},showMenuAt:(r,f,g,v)=>{r.showMenuAt(f,g,v)},showMenuWithinBounds:(r,f,g,v,_)=>{r.showMenuWithinBounds(f,g,v,_)},hide:(r,f)=>{r.hide(f)},isOpen:(r,f)=>r.isOpen(f),getContent:(r,f)=>r.getContent(f),setContent:(r,f,g)=>{r.setContent(f,g)},reposition:(r,f)=>{r.reposition(f)}}});var S3=tinymce.util.Tools.resolve("tinymce.util.Delay");const Jc=Kc({name:"Button",factory:r=>{const f=b3(r.action),g=r.dom.tag,v=T=>ln(r.dom,"attributes").bind(P=>ln(P,T)),_=()=>{if(g==="button"){const T=v("type").getOr("button"),P=v("role").map(I=>({role:I})).getOr({});return{type:T,...P}}else return{role:r.role.getOr(v("role").getOr("button"))}};return{uid:r.uid,dom:r.dom,components:r.components,events:f,behaviours:ym.augment(r.buttonBehaviours,[ns.config({}),No.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:_()},eventOrder:r.eventOrder}},configFields:[xt("uid",void 0),nn("dom"),xt("components",[]),ym.field("buttonBehaviours",[ns,No]),Er("action"),Er("role"),xt("eventOrder",{})]}),oi=r=>{const f=rS(r)&&Qi(r,"uid")?r.uid:yh("memento");return{get:T=>T.getSystem().getByUid(f).getOrDie(),getOpt:T=>T.getSystem().getByUid(f).toOptional(),asSpec:()=>({...r,uid:f})}};var Cm=tinymce.util.Tools.resolve("tinymce.util.I18n");const TW={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},cB="temporary-placeholder",a5=r=>()=>ln(r,cB).getOr("!not found!"),K0=(r,f)=>{const g=r.toLowerCase();if(Cm.isRtl()){const v=Lr(g,"-rtl");return vs(f,v)?v:g}else return g},uB=(r,f)=>ln(f,K0(r,f)),fB=(r,f)=>{const g=f();return uB(r,g).getOrThunk(a5(g))},j2=(r,f,g)=>{const v=f();return uB(r,v).or(g).getOrThunk(a5(v))},dB=r=>Cm.isRtl()?vs(TW,r):!1,l5=()=>xs("add-focusable",[Ci(r=>{Uv(r.element,"svg").each(f=>qn(f,"focusable","false"))})]),J0=(r,f,g,v)=>{var _,T;const P=dB(f)?["tox-icon--flip"]:[],I=ln(g,K0(f,g)).or(v).getOrThunk(a5(g));return{dom:{tag:r.tag,attributes:(_=r.attributes)!==null&&_!==void 0?_:{},classes:r.classes.concat(P),innerHtml:I},behaviours:Tn([...(T=r.behaviours)!==null&&T!==void 0?T:[],l5()])}},Sp=(r,f,g,v=V.none())=>J0(f,r,g(),v),EW=(r,f,g)=>{const v=g(),_=kt(r,T=>vs(v,K0(T,v)));return J0(f,_.getOr(cB),v,V.none())},Sg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},C3=Kc({name:"Notification",factory:r=>{const f=oi({dom:{tag:"p",innerHtml:r.translationProvider(r.text)},behaviours:Tn([gs.config({})])}),g=_e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${_e}%`}}}),v=_e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${_e}%`}}),_=oi({dom:{tag:"div",classes:r.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[g(0)]},v(0)],behaviours:Tn([gs.config({})])}),I={updateProgress:(_e,Ie)=>{_e.getSystem().isConnected()&&_.getOpt(_e).each(it=>{gs.set(it,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[g(Ie)]},v(Ie)])})},updateText:(_e,Ie)=>{if(_e.getSystem().isConnected()){const it=f.get(_e);gs.set(it,[Li(Ie)])}}},W=pt([r.icon.toArray(),r.level.toArray(),r.level.bind(_e=>V.from(Sg[_e])).toArray()]),J=oi(Jc.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Sp("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":r.translationProvider("Close")}},r.iconProvider)],action:_e=>{r.onAction(_e)}})),ie=EW(W,{tag:"div",classes:["tox-notification__icon"]},r.iconProvider),de={dom:{tag:"div",classes:["tox-notification__body"]},components:[f.asSpec()],behaviours:Tn([gs.config({})])},ge=[ie,de];return{uid:r.uid,dom:{tag:"div",attributes:{role:"alert"},classes:r.level.map(_e=>["tox-notification","tox-notification--in",`tox-notification--${_e}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:Tn([ns.config({}),xs("notification-events",[on(Gi(),_e=>{J.getOpt(_e).each(ns.focus)})])]),components:ge.concat(r.progress?[_.asSpec()]:[]).concat(r.closeButton?[J.asSpec()]:[]),apis:I}},configFields:[Er("level"),nn("progress"),Er("icon"),nn("onAction"),nn("text"),nn("iconProvider"),nn("translationProvider"),ja("closeButton",!0)],apis:{updateProgress:(r,f,g)=>{r.updateProgress(f,g)},updateText:(r,f,g)=>{r.updateText(f,g)}}});var hB=(r,f,g)=>{const v=f.backstage.shared,_=()=>{const W=di(lt.fromDom(r.getContentAreaContainer())),J=ue(),ie=cd(J.x,W.x,W.right),de=cd(J.y,W.y,W.bottom),ge=Math.max(W.right,J.right),_e=Math.max(W.bottom,J.bottom);return V.some(ai(ie,de,ge-ie,_e-de))};return{open:(W,J)=>{const ie=()=>{J(),Ba.hide(ge)},de=pc(C3.sketch({text:W.text,level:st(["success","error","warning","warn","info"],W.type)?W.type:void 0,progress:W.progressBar===!0,icon:W.icon,closeButton:W.closeButton,onAction:ie,iconProvider:v.providers.icons,translationProvider:v.providers.translate})),ge=pc(Ba.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:v.getSink,fireDismissalEventInstead:{},...v.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));g.add(ge),U(W.timeout)&&W.timeout>0&&S3.setEditorTimeout(r,()=>{ie()},W.timeout);const Ie={close:ie,reposition:()=>{const it=gu(de),Qt={maxHeightFunction:bg()},dt=r.notificationManager.getNotifications();if(dt[0]===Ie){const ft={...v.anchors.banner(),overrides:Qt};Ba.showWithinBounds(ge,it,{anchor:ft},_)}else He(dt,Ie).each(ft=>{const Yt=dt[ft-1].getEl(),Dt={type:"node",root:Hi(),node:V.some(lt.fromDom(Yt)),overrides:Qt,layouts:{onRtl:()=>[Vl],onLtr:()=>[Vl]}};Ba.showWithinBounds(ge,it,{anchor:Dt},_)})},text:it=>{C3.updateText(de,it)},settings:W,getEl:()=>de.element.dom,progressBar:{value:it=>{C3.updateProgress(de,it)}}};return Ie},close:W=>{W.close()},getArgs:W=>W.settings}},_x=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c5=tinymce.util.Tools.resolve("tinymce.EditorManager"),OS=tinymce.util.Tools.resolve("tinymce.Env"),Cg;(function(r){r.default="wrap",r.floating="floating",r.sliding="sliding",r.scrolling="scrolling"})(Cg||(Cg={}));var Sx;(function(r){r.auto="auto",r.top="top",r.bottom="bottom"})(Sx||(Sx={}));const Ti=r=>f=>f.options.get(r),q2=r=>f=>V.from(r(f)),u5=r=>{const f=OS.deviceType.isPhone(),g=OS.deviceType.isTablet()||f,v=r.options.register,_=P=>d(P)||P===!1,T=P=>d(P)||U(P);v("skin",{processor:P=>d(P)||P===!1,default:"oxide"}),v("skin_url",{processor:"string"}),v("height",{processor:T,default:Math.max(r.getElement().offsetHeight,400)}),v("width",{processor:T,default:_x.DOM.getStyle(r.getElement(),"width")}),v("min_height",{processor:"number",default:100}),v("min_width",{processor:"number"}),v("max_height",{processor:"number"}),v("max_width",{processor:"number"}),v("style_formats",{processor:"object[]"}),v("style_formats_merge",{processor:"boolean",default:!1}),v("style_formats_autohide",{processor:"boolean",default:!1}),v("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),v("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"}),v("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),v("font_size_input_default_unit",{processor:"string",default:"pt"}),v("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"}),v("content_langs",{processor:"object[]"}),v("removed_menuitems",{processor:"string",default:""}),v("menubar",{processor:P=>d(P)||E(P),default:!f}),v("menu",{processor:"object",default:{}}),v("toolbar",{processor:P=>E(P)||d(P)||y(P)?{value:P,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),Et(9,P=>{v("toolbar"+(P+1),{processor:"string"})}),v("toolbar_mode",{processor:"string",default:g?"scrolling":"floating"}),v("toolbar_groups",{processor:"object",default:{}}),v("toolbar_location",{processor:"string",default:Sx.auto}),v("toolbar_persist",{processor:"boolean",default:!1}),v("toolbar_sticky",{processor:"boolean",default:r.inline}),v("toolbar_sticky_offset",{processor:"number",default:0}),v("fixed_toolbar_container",{processor:"string",default:""}),v("fixed_toolbar_container_target",{processor:"object"}),v("ui_mode",{processor:"string",default:"combined"}),v("file_picker_callback",{processor:"function"}),v("file_picker_validator_handler",{processor:"function"}),v("file_picker_types",{processor:"string"}),v("typeahead_urls",{processor:"boolean",default:!0}),v("anchor_top",{processor:_,default:"#top"}),v("anchor_bottom",{processor:_,default:"#bottom"}),v("draggable_modal",{processor:"boolean",default:!1}),v("statusbar",{processor:"boolean",default:!0}),v("elementpath",{processor:"boolean",default:!0}),v("branding",{processor:"boolean",default:!0}),v("promotion",{processor:"boolean",default:!0}),v("resize",{processor:P=>P==="both"||E(P),default:!OS.deviceType.isTouch()}),v("sidebar_show",{processor:"string"}),v("help_accessibility",{processor:"boolean",default:r.hasPlugin("help")})},f5=Ti("readonly"),k3=Ti("height"),d5=Ti("width"),Cx=q2(Ti("min_width")),h5=q2(Ti("min_height")),yS=q2(Ti("max_width")),m5=q2(Ti("max_height")),wS=q2(Ti("style_formats")),kx=Ti("style_formats_merge"),g5=Ti("style_formats_autohide"),p5=Ti("content_langs"),mB=Ti("removed_menuitems"),_S=Ti("toolbar_mode"),gB=Ti("toolbar_groups"),b5=Ti("toolbar_location"),v5=Ti("fixed_toolbar_container"),pB=Ti("fixed_toolbar_container_target"),O5=Ti("toolbar_persist"),x3=Ti("toolbar_sticky_offset"),bB=Ti("menubar"),xx=Ti("toolbar"),vB=Ti("file_picker_callback"),OB=Ti("file_picker_validator_handler"),yB=Ti("font_size_input_default_unit"),y5=Ti("file_picker_types"),wB=Ti("typeahead_urls"),_B=Ti("anchor_top"),T3=Ti("anchor_bottom"),w5=Ti("draggable_modal"),_5=Ti("statusbar"),SB=Ti("elementpath"),Tx=Ti("branding"),CB=Ti("resize"),kB=Ti("paste_as_text"),xB=Ti("sidebar_show"),TB=Ti("promotion"),EB=Ti("help_accessibility"),E3=r=>r.options.get("skin")===!1,SS=r=>r.options.get("menubar")!==!1,AB=r=>{const f=r.options.get("skin_url");if(E3(r))return f;if(f)return r.documentBaseURI.toAbsolute(f);{const g=r.options.get("skin");return c5.baseURL+"/skins/ui/"+g}},Ex=r=>r.options.get("line_height_formats").split(" "),A3=r=>{const f=xx(r),g=d(f),v=y(f)&&f.length>0;return!Ax(r)&&(v||g||f===!0)},S5=r=>{const f=Et(9,v=>r.options.get("toolbar"+(v+1))),g=Kn(f,d);return fn(g.length>0,g)},Ax=r=>S5(r).fold(()=>{const f=xx(r);return K(f,d)&&f.length>0},ot),C5=r=>b5(r)===Sx.bottom,DB=r=>{var f;if(!r.inline)return V.none();const g=(f=v5(r))!==null&&f!==void 0?f:"";if(g.length>0)return sa(Hi(),g);const v=pB(r);return Q(v)?V.some(lt.fromDom(v)):V.none()},CS=r=>r.inline&&DB(r).isSome(),D3=r=>DB(r).getOrThunk(()=>On($t(lt.fromDom(r.getElement())))),k5=r=>r.inline&&!SS(r)&&!A3(r)&&!Ax(r),Dx=r=>(r.options.get("toolbar_sticky")||r.inline)&&!CS(r)&&!k5(r),Eb=r=>!CS(r)&&r.options.get("ui_mode")==="split",PO=r=>{const f=r.options.get("menu");return Ns(f,g=>({...g,items:g.items}))};var DW=Object.freeze({__proto__:null,get ToolbarMode(){return Cg},get ToolbarLocation(){return Sx},register:u5,getSkinUrl:AB,isReadOnly:f5,isSkinDisabled:E3,getHeightOption:k3,getWidthOption:d5,getMinWidthOption:Cx,getMinHeightOption:h5,getMaxWidthOption:yS,getMaxHeightOption:m5,getUserStyleFormats:wS,shouldMergeStyleFormats:kx,shouldAutoHideStyleFormats:g5,getLineHeightFormats:Ex,getContentLanguages:p5,getRemovedMenuItems:mB,isMenubarEnabled:SS,isMultipleToolbars:Ax,isToolbarEnabled:A3,isToolbarPersist:O5,getMultipleToolbarsOption:S5,getUiContainer:D3,useFixedContainer:CS,isSplitUiMode:Eb,getToolbarMode:_S,isDraggableModal:w5,isDistractionFree:k5,isStickyToolbar:Dx,getStickyToolbarOffset:x3,getToolbarLocation:b5,isToolbarLocationBottom:C5,getToolbarGroups:gB,getMenus:PO,getMenubar:bB,getToolbar:xx,getFilePickerCallback:vB,getFilePickerTypes:y5,useTypeaheadUrls:wB,getAnchorTop:_B,getAnchorBottom:T3,getFilePickerValidatorHandler:OB,getFontSizeInputDefaultUnit:yB,useStatusBar:_5,useElementPath:SB,promotionEnabled:TB,useBranding:Tx,getResize:CB,getPasteAsText:kB,getSidebarShow:xB,useHelpAccessibility:EB});const PB="[data-mce-autocompleter]",P3=r=>df(r,PB),PW=r=>sa(r,PB),RW={setup:(r,f)=>{const g=(_,T)=>{Ao(_,If(),{raw:T})},v=()=>r.getMenu().bind(Nr.getHighlighted);f.on("keydown",_=>{const T=_.which;!r.isActive()||(r.isMenuOpen()?T===13?(v().each(bh),_.preventDefault()):T===40?(v().fold(()=>{r.getMenu().each(Nr.highlightFirst)},P=>{g(P,_)}),_.preventDefault(),_.stopImmediatePropagation()):(T===37||T===38||T===39)&&v().each(P=>{g(P,_),_.preventDefault(),_.stopImmediatePropagation()}):(T===13||T===38||T===40)&&r.cancelIfNecessary())}),f.on("NodeChange",_=>{r.isActive()&&!r.isProcessingAction()&&P3(lt.fromDom(_.element)).isNone()&&r.cancelIfNecessary()})}};var M3;(function(r){r[r.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",r[r.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"})(M3||(M3={}));var Cp=M3;const Px="tox-menu-nav__js",R3="tox-collection__item",$3="tox-swatch",$W={normal:Px,color:$3},kS="tox-collection__item--enabled",NW="tox-collection__group-heading",MB="tox-collection__item-icon",Mx="tox-collection__item-label",x5="tox-collection__item-accessory",RB="tox-collection__item-caret",$B="tox-collection__item-checkmark",Rx="tox-collection__item--active",NB="tox-collection__item-container",T5="tox-collection__item-container--column",IB="tox-collection__item-container--row",IW="tox-collection__item-container--align-right",BW="tox-collection__item-container--align-left",LW="tox-collection__item-container--valign-top",FW="tox-collection__item-container--valign-middle",QW="tox-collection__item-container--valign-bottom",BB=r=>ln($W,r).getOr(Px),ZW=r=>r==="color"?"tox-swatches":"tox-menu",E5=r=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:ZW(r),tieredMenu:"tox-tiered-menu"}),G2=r=>{const f=E5(r);return{backgroundMenu:f.backgroundMenu,selectedMenu:f.selectedMenu,menu:f.menu,selectedItem:f.selectedItem,item:BB(r)}},HW=(r,f,g)=>{const v=E5(g);return{tag:"div",classes:pt([[v.menu,`tox-menu-${f}-column`],r?[v.hasIcons]:[]])}},zW=[DO.parts.items({})],xS=(r,f,g)=>{const v=E5(g);return{dom:{tag:"div",classes:pt([[v.tieredMenu]])},markers:G2(g)}},LB=G([Er("data"),xt("inputAttributes",{}),xt("inputStyles",{}),xt("tag","input"),xt("inputClasses",[]),qs("onSetValue"),xt("styles",{}),xt("eventOrder",{}),Wl("inputBehaviours",[Gn,ns]),xt("selectOnFocus",!0)]),FB=r=>Tn([ns.config({onFocus:r.selectOnFocus?f=>{const g=f.element,v=Ia(g);g.dom.setSelectionRange(0,v.length)}:L})]),VW=r=>({...FB(r),...sc(r.inputBehaviours,[Gn.config({store:{mode:"manual",...r.data.map(f=>({initialValue:f})).getOr({}),getValue:f=>Ia(f.element),setValue:(f,g)=>{Ia(f.element)!==g&&Ta(f.element,g)}},onSetValue:r.onSetValue})])}),A5=r=>({tag:r.tag,attributes:{type:"text",...r.inputAttributes},styles:r.inputStyles,classes:r.inputClasses}),WW=(r,f)=>({uid:r.uid,dom:A5(r),components:[],behaviours:VW(r),eventOrder:r.eventOrder}),K2=Kc({name:"Input",configFields:LB(),factory:WW}),QB=io("refetch-trigger-event"),ZB=io("redirect-menu-item-interaction"),HB="tox-menu__searcher",N3=r=>sa(r.element,`.${HB}`).bind(f=>r.getSystem().getByDom(f).toOptional()),I3=N3,UW=(r,f)=>{Gn.setValue(r,f.fetchPattern),r.element.dom.selectionStart=f.selectionStart,r.element.dom.selectionEnd=f.selectionEnd},zB=r=>{const f=Gn.getValue(r),g=r.element.dom.selectionStart,v=r.element.dom.selectionEnd;return{fetchPattern:f,selectionStart:g,selectionEnd:v}},YW=(r,f)=>{me(f.element,"id").each(g=>qn(r.element,"aria-activedescendant",g))},XW=r=>{const f=(_,T)=>(T.cut(),V.none()),g=(_,T)=>{const P={interactionEvent:T.event,eventType:T.event.raw.type};return Ao(_,ZB,P),V.some(!0)},v="searcher-events";return{dom:{tag:"div",classes:[R3]},components:[K2.sketch({inputClasses:[HB,"tox-textfield"],inputAttributes:{...r.placeholder.map(_=>({placeholder:r.i18n(_)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Tn([xs(v,[on(om(),_=>{rr(_,QB)}),on(If(),(_,T)=>{T.event.raw.key==="Escape"&&T.stop()})]),No.config({mode:"special",onLeft:f,onRight:f,onSpace:f,onEnter:g,onEscape:g,onUp:g,onDown:g})]),eventOrder:{keydown:[v,No.name()]}})]}},B3="tox-collection--results__js",VB=r=>{var f;return r.dom?{...r,dom:{...r.dom,attributes:{...(f=r.dom.attributes)!==null&&f!==void 0?f:{},id:io("aria-item-search-result-id"),"aria-selected":"false"}}}:r},D5=(r,f)=>g=>{const v=Cn(g,f);return je(v,_=>({dom:r,components:_}))},jW=r=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[DO.parts.items({preprocess:r!=="auto"?D5({tag:"div",classes:["tox-swatches__row"]},r):we})]}]}),qW=r=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[DO.parts.items({preprocess:D5({tag:"div",classes:["tox-collection__group"]},r)})]}),WB=(r,f)=>{const g=[];let v=[];return mt(r,(_,T)=>{f(_,T)?(v.length>0&&g.push(v),v=[],(vs(_.dom,"innerHtml")||_.components&&_.components.length>0)&&v.push(_)):v.push(_)}),v.length>0&&g.push(v),je(g,_=>({dom:{tag:"div",classes:["tox-collection__group"]},components:_}))},P5=(r,f,g)=>DO.parts.items({preprocess:v=>{const _=je(v,g);return r!=="auto"&&r>1?D5({tag:"div",classes:["tox-collection__group"]},r)(_):WB(_,(T,P)=>f[P].type==="separator")}}),UB=(r,f,g=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(r===1?["tox-collection--list"]:["tox-collection--grid"])},components:[P5(r,f,we)]}),L3=(r,f,g=!0)=>{const v=io("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",B3].concat(r===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:v}},components:[P5(r,f,VB)]}},GW=(r,f,g)=>{const v=io("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(r===1?["tox-collection--list"]:["tox-collection--grid"])},components:[XW({i18n:Cm.translate,placeholder:g.placeholder}),{dom:{tag:"div",classes:[...r===1?["tox-collection--list"]:["tox-collection--grid"],B3],attributes:{id:v}},components:[P5(r,f,VB)]}]}},M5=(r,f=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[DO.parts.items({preprocess:g=>WB(g,(v,_)=>r[_].type==="separator")})]}),F3=r=>rn(r,f=>"icon"in f&&f.icon!==void 0),ev=r=>(console.error(Rd(r)),console.log(r),V.none()),KW=(r,f,g,v,_)=>{const T=M5(g);return{value:r,dom:T.dom,components:T.components,items:g}},R5=(r,f,g,v,_)=>{const T=()=>_.menuType!=="searchable"?UB(v,g):_.searchMode.searchMode==="search-with-field"?GW(v,g,_.searchMode):L3(v,g);if(_.menuType==="color"){const P=jW(v);return{value:r,dom:P.dom,components:P.components,items:g}}else if(_.menuType==="normal"&&v==="auto"){const P=UB(v,g);return{value:r,dom:P.dom,components:P.components,items:g}}else if(_.menuType==="normal"||_.menuType==="searchable"){const P=T();return{value:r,dom:P.dom,components:P.components,items:g}}else if(_.menuType==="listpreview"&&v!=="auto"){const P=qW(v);return{value:r,dom:P.dom,components:P.components,items:g}}else return{value:r,dom:HW(f,v,_.menuType),components:zW,items:g}},$l=xa("type"),Q3=xa("name"),$5=xa("label"),m1=xa("text"),Z3=xa("title"),N5=xa("icon"),J2=xa("value"),H3=Wc("fetch"),YB=Wc("getSubmenuItems"),$h=Wc("onAction"),I5=Wc("onItemAction"),ew=qa("onSetup",()=>L),JW=Jl("name"),MO=Jl("text"),kg=Jl("icon"),tv=Jl("tooltip"),B5=Jl("label"),eU=Jl("shortcut"),XB=jm("select"),$x=ja("active",!1),L5=ja("borderless",!1),kp=ja("enabled",!0),TS=ja("primary",!1),z3=r=>xt("columns",r),F5=xt("meta",{}),V3=qa("onAction",L),RO=r=>mc("type",r),Q5=r=>Wa("name","name",Kl(()=>io(`${r}-name`)),bl),tU=r=>Wa("value","value",Kl(()=>io(`${r}-value`)),Vc()),jB=fo([$l,MO]),nU=r=>Ui("separatormenuitem",jB,r),oU=fo([RO("autocompleteitem"),$x,kp,F5,J2,MO,kg]),sU=r=>Ui("Autocompleter.Separator",jB,r),qB=r=>Ui("Autocompleter.Item",oU,r),ES=[kp,tv,kg,MO,ew],rU=fo([$l,$h].concat(ES)),Z5=r=>Ui("toolbarbutton",rU,r),W3=[$x].concat(ES),Nx=fo(W3.concat([$l,$h])),H5=r=>Ui("ToggleButton",Nx,r),GB=[qa("predicate",tt),Bu("scope","node",["node","editor"]),Bu("position","selection",["node","selection","line"])],iU=ES.concat([RO("contextformbutton"),TS,$h,ka("original",we)]),KB=W3.concat([RO("contextformbutton"),TS,$h,ka("original",we)]),aU=ES.concat([RO("contextformbutton")]),lU=W3.concat([RO("contextformtogglebutton")]),JB=xl("type",{contextformbutton:iU,contextformtogglebutton:KB}),e8=fo([RO("contextform"),qa("initValue",G("")),B5,Hl("commands",JB),Ya("launch",xl("type",{contextformbutton:aU,contextformtogglebutton:lU}))].concat(GB)),t8=r=>Ui("ContextForm",e8,r),n8=fo([RO("contexttoolbar"),xa("items")].concat(GB)),cU=r=>Ui("ContextToolbar",n8,r),uU=[$l,xa("src"),Jl("alt"),lu("classes",[],bl)],o8=fo(uU),z5=[$l,m1,JW,lu("classes",["tox-collection__item-label"],bl)],V5=fo(z5),W5=pl(()=>Md("type",{cardimage:o8,cardtext:V5,cardcontainer:s8})),s8=fo([$l,mc("direction","horizontal"),mc("align","left"),mc("valign","middle"),Hl("items",W5)]),tw=[kp,MO,eU,tU("menuitem"),F5],fU=fo([$l,B5,Hl("items",W5),ew,V3].concat(tw)),U5=r=>Ui("cardmenuitem",fU,r),dU=fo([$l,$x,kg].concat(tw)),r8=r=>Ui("choicemenuitem",dU,r),Y5=[$l,xa("fancytype"),V3],nw=[xt("initData",{})].concat(Y5),hU=[jm("select"),c0("initData",{},[ja("allowCustomColors",!0),mc("storageKey","default"),J1("colors",Vc())])].concat(Y5),X5=xl("fancytype",{inserttable:nw,colorswatch:hU}),U3=r=>Ui("fancymenuitem",X5,r),mU=fo([$l,ew,V3,kg].concat(tw)),i8=r=>Ui("menuitem",mU,r),a8=fo([$l,YB,ew,kg].concat(tw)),l8=r=>Ui("nestedmenuitem",a8,r),j5=fo([$l,kg,$x,ew,$h].concat(tw)),c8=r=>Ui("togglemenuitem",j5,r),q5=(r,f,g)=>{const v=vu(r.element,"."+g);if(v.length>0){const _=jt(v,T=>{const P=T.dom.getBoundingClientRect().top,I=v[0].dom.getBoundingClientRect().top;return Math.abs(P-I)>f}).getOr(v.length);return V.some({numColumns:_,numRows:Math.ceil(v.length/_)})}else return V.none()},G5=(r,f)=>Tn([xs(r,f)]),AS={namedEvents:G5,unnamedEvents:r=>G5(io("unnamed-events"),r)},K5=io("tooltip.exclusive"),Ix=io("tooltip.show"),DS=io("tooltip.hide"),u8=(r,f,g)=>{r.getSystem().broadcastOn([K5],{})};var pU=Object.freeze({__proto__:null,hideAllExclusive:u8,setComponents:(r,f,g,v)=>{g.getTooltip().each(_=>{_.getSystem().isConnected()&&gs.set(_,v)})}}),f8=Object.freeze({__proto__:null,events:(r,f)=>{const g=_=>{f.getTooltip().each(T=>{qc(T),r.onHide(_,T),f.clearTooltip()}),f.clearTimer()},v=_=>{if(!f.isShowing()){u8(_);const T=r.lazySink(_).getOrDie(),P=_.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:li(r.mode==="normal"?[on(Tl(),I=>{rr(_,Ix)}),on(gc(),I=>{rr(_,DS)})]:[]),behaviours:Tn([gs.config({})])});f.setTooltip(P),cl(T,P),r.onShow(_,P),yu.position(T,P,{anchor:r.anchor(_)})}};return li(pt([[on(Ix,_=>{f.resetTimer(()=>{v(_)},r.delay)}),on(DS,_=>{f.resetTimer(()=>{g(_)},r.delay)}),on(im(),(_,T)=>{const P=T;P.universal||st(P.channels,K5)&&g(_)}),Ld(_=>{g(_)})],r.mode==="normal"?[on(Gi(),_=>{rr(_,Ix)}),on(tg(),_=>{rr(_,DS)}),on(Tl(),_=>{rr(_,Ix)}),on(gc(),_=>{rr(_,DS)})]:[on(ig(),(_,T)=>{rr(_,Ix)}),on(Iv(),_=>{rr(_,DS)})]]))}}),Bx=[nn("lazySink"),nn("tooltipDom"),xt("exclusive",!0),xt("tooltipComponents",[]),xt("delay",300),Bu("mode","normal",["normal","follow-highlight"]),xt("anchor",r=>({type:"hotspot",hotspot:r,layouts:{onLtr:G([Vl,tc,vl,Qu,ec,Zr]),onRtl:G([Vl,tc,vl,Qu,ec,Zr])}})),qs("onHide"),qs("onShow")],vU=Object.freeze({__proto__:null,init:()=>{const r=Xi(),f=Xi(),g=()=>{r.on(clearTimeout)},v=(T,P)=>{g(),r.set(setTimeout(T,P))},_=G("not-implemented");return mu({getTooltip:f.get,isShowing:f.isSet,setTooltip:f.set,clearTooltip:f.clear,clearTimer:g,resetTimer:v,readState:_})}});const d8=nc({fields:Bx,name:"tooltipping",active:f8,state:vU,apis:pU}),OU=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h8="silver.readonly",yU=fo([Gg("readonly")]),ow=(r,f)=>{const v=r.mainUi.outerContainer.element,_=[r.mainUi.mothership,...r.uiMotherships];f&&mt(_,T=>{T.broadcastOn([Dh()],{target:v})}),mt(_,T=>{T.broadcastOn([h8],{readonly:f})})},m8=(r,f)=>{r.on("init",()=>{r.mode.isReadOnly()&&ow(f,!0)}),r.on("SwitchMode",()=>ow(f,r.mode.isReadOnly())),f5(r)&&r.mode.set("readonly")},rc=()=>Pc.config({channels:{[h8]:{schema:yU,onReceive:(r,f)=>{Jo.set(r,f.readonly)}}}}),xg={item:r=>Jo.config({disabled:r,disableClass:"tox-collection__item--state-disabled"}),button:r=>Jo.config({disabled:r}),splitButton:r=>Jo.config({disabled:r,disableClass:"tox-tbtn--disabled"}),toolbarButton:r=>Jo.config({disabled:r,disableClass:"tox-tbtn--disabled",useNative:!1})},Lx=(r,f)=>{const g=r.getApi(f);return v=>{v(g)}},nv=(r,f)=>Ci(g=>{Lx(r,g)(_=>{const T=r.onSetup(_);F(T)&&f.set(T)})}),ov=(r,f)=>Ld(g=>Lx(r,g)(f.get())),SU=(r,f)=>hu((g,v)=>{Lx(r,g)(r.onAction),!r.triggersSubmenu&&f===Cp.CLOSE_ON_EXECUTE&&(g.getSystem().isConnected()&&rr(g,$a()),v.stop())}),CU={[af()]:["disabling","alloy.base.behaviour","toggling","item-events"]},PS=Tt,MS=(r,f,g,v)=>{const _=Ho(L);return{type:"item",dom:f.dom,components:PS(f.optComponents),data:r.data,eventOrder:CU,hasSubmenu:r.triggersSubmenu,itemBehaviours:Tn([xs("item-events",[SU(r,g),nv(r,_),ov(r,_)]),xg.item(()=>!r.enabled||v.isDisabled()),rc(),gs.config({})].concat(r.itemBehaviours))}},sw=r=>({value:r.value,meta:{text:r.text.getOr(""),...r.meta}}),J5=r=>{const f=OS.os.isMacOS()||OS.os.isiOS(),_=f?{alt:"\u2325",ctrl:"\u2303",shift:"\u21E7",meta:"\u2318",access:"\u2303\u2325"}:{meta:"Ctrl",access:"Shift+Alt"},T=r.split("+"),P=je(T,I=>{const W=I.toLowerCase().trim();return vs(_,W)?_[W]:I});return f?P.join(""):P.join("+")},eM=(r,f,g=[MB])=>Sp(r,{tag:"div",classes:g},f),g8=r=>({dom:{tag:"div",classes:[Mx]},components:[Li(Cm.translate(r))]}),p8=(r,f)=>({dom:{tag:"div",classes:f,innerHtml:r}}),kU=(r,f)=>({dom:{tag:"div",classes:[Mx]},components:[{dom:{tag:r.tag,styles:r.styles},components:[Li(Cm.translate(f))]}]}),xU=r=>({dom:{tag:"div",classes:[x5]},components:[Li(J5(r))]}),tM=r=>eM("checkmark",r,[$B]),TU=r=>eM("chevron-right",r,[RB]),EU=r=>eM("chevron-down",r,[RB]),nM=(r,f)=>{const g=r.direction==="vertical"?T5:IB,v=r.align==="left"?BW:IW;return{dom:{tag:"div",classes:[NB,g,v,(()=>{switch(r.valign){case"top":return LW;case"middle":return FW;case"bottom":return QW}})()]},components:f}},b8=(r,f,g)=>({dom:{tag:"img",classes:f,attributes:{src:r,alt:g.getOr("")}}}),AU=(r,f,g)=>{const v="custom",_="remove",T=r.ariaLabel,P=r.value,I=r.iconContent.map(J=>j2(J,f.icons,g));return{dom:(()=>{const J=$3,ie=I.getOr(""),ge={tag:"div",attributes:T.map(_e=>({title:f.translate(_e)})).getOr({}),classes:[J]};return P===v?{...ge,tag:"button",classes:[...ge.classes,"tox-swatches__picker-btn"],innerHtml:ie}:P===_?{...ge,classes:[...ge.classes,"tox-swatch--remove"],innerHtml:ie}:Q(P)?{...ge,attributes:{...ge.attributes,"data-mce-color":P},styles:{"background-color":P},innerHtml:ie}:ge})(),optComponents:[]}},v8=r=>{const f=r.map(g=>({attributes:{title:Cm.translate(g),id:io("menu-item")}})).getOr({});return{tag:"div",classes:[Px,R3],...f}},O8=(r,f,g,v)=>{const _={tag:"div",classes:[MB]},T=ge=>Sp(ge,_,f.icons,v),P=()=>V.some({dom:_}),I=g?r.iconContent.map(T).orThunk(P):V.none(),W=r.checkMark,J=V.from(r.meta).fold(()=>g8,ge=>vs(ge,"style")?Re(kU,ge.style):g8),ie=r.htmlContent.fold(()=>r.textContent.map(J),ge=>V.some(p8(ge,[Mx])));return{dom:v8(r.ariaLabel),optComponents:[I,ie,r.shortcutContent.map(xU),W,r.caret]}},Fx=(r,f,g,v=V.none())=>r.presets==="color"?AU(r,f,v):O8(r,f,g,v),y8=(r,f)=>ln(r,"tooltipWorker").map(g=>[d8.config({lazySink:f.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:v=>({type:"submenu",item:v,overrides:{maxHeightFunction:bg}}),mode:"follow-highlight",onShow:(v,_)=>{g(T=>{d8.setComponents(v,[Wv({element:lt.fromDom(T)})])})}})]).getOr([]),w8=r=>_x.DOM.encode(r),oM=(r,f)=>{const g=Cm.translate(r),v=w8(g);if(f.length>0){const _=new RegExp(OU(f),"gi");return v.replace(_,T=>`<span class="tox-autocompleter-highlight">${T}</span>`)}else return v},_8=(r,f,g,v,_,T,P,I=!0)=>{const W=Fx({presets:v,textContent:V.none(),htmlContent:g?r.text.map(J=>oM(J,f)):V.none(),ariaLabel:r.text,iconContent:r.icon,shortcutContent:V.none(),checkMark:V.none(),caret:V.none(),value:r.value},P.providers,I,r.icon);return MS({data:sw(r),enabled:r.enabled,getApi:G({}),onAction:J=>_(r.value,r.meta),onSetup:G(L),triggersSubmenu:!1,itemBehaviours:y8(r.meta,P)},W,T,P.providers)},S8=(r,f)=>je(r,g=>{switch(g.type){case"cardcontainer":return nM(g,S8(g.items,f));case"cardimage":return b8(g.src,g.classes,g.alt);case"cardtext":const _=g.name.exists(T=>st(f.cardText.highlightOn,T))?V.from(f.cardText.matchText).getOr(""):"";return p8(oM(g.text,_),g.classes)}}),DU=(r,f,g,v)=>{const _=P=>({isEnabled:()=>!Jo.isDisabled(P),setEnabled:I=>{Jo.set(P,!I),mt(vu(P.element,"*"),W=>{P.getSystem().getByDom(W).each(J=>{J.hasConfigured(Jo)&&Jo.set(J,!I)})})}}),T={dom:v8(r.label),optComponents:[V.some({dom:{tag:"div",classes:[NB,IB]},components:S8(r.items,v)})]};return MS({data:sw({text:V.none(),...r}),enabled:r.enabled,getApi:_,onAction:r.onAction,onSetup:r.onSetup,triggersSubmenu:!1,itemBehaviours:V.from(v.itemBehaviours).getOr([])},T,f,g.providers)},PU=(r,f,g,v,_,T,P,I=!0)=>{const W=ie=>({setActive:de=>{Ms.set(ie,de)},isActive:()=>Ms.isOn(ie),isEnabled:()=>!Jo.isDisabled(ie),setEnabled:de=>Jo.set(ie,!de)}),J=Fx({presets:g,textContent:f?r.text:V.none(),htmlContent:V.none(),ariaLabel:r.text,iconContent:r.icon,shortcutContent:f?r.shortcut:V.none(),checkMark:f?V.some(tM(P.icons)):V.none(),caret:V.none(),value:r.value},P,I);return ni(MS({data:sw(r),enabled:r.enabled,getApi:W,onAction:ie=>v(r.value),onSetup:ie=>(ie.setActive(_),L),triggersSubmenu:!1,itemBehaviours:[]},J,T,P),{toggling:{toggleClass:kS,toggleOnExecute:!1,selected:r.active,exclusive:!0}})},C8=nx(n5(),y3()),k8=r=>({value:Qx(r)}),$O=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Y3=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,x8=r=>$O.test(r)||Y3.test(r),Qx=r=>kr(r,"#").toUpperCase(),g1=r=>x8(r)?V.some({value:Qx(r)}):V.none(),MU=r=>({value:r.value.replace($O,(g,v,_,T)=>v+v+_+_+T+T)}),RU=r=>{const f=MU(r),g=Y3.exec(f.value);return g===null?["FFFFFF","FF","FF","FF"]:g},sM=r=>{const f=r.toString(16);return(f.length===1?"0"+f:f).toUpperCase()},rw=r=>{const f=sM(r.red)+sM(r.green)+sM(r.blue);return k8(f)},T8=Math.min,E8=Math.max,Zx=Math.round,$U=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,NU=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,NO=(r,f,g,v)=>({red:r,green:f,blue:g,alpha:v}),gd=r=>{const f=parseInt(r,10);return f.toString()===r&&f>=0&&f<=255},p1=r=>{let f,g,v;const _=(r.hue||0)%360;let T=r.saturation/100,P=r.value/100;if(T=E8(0,T8(T,1)),P=E8(0,T8(P,1)),T===0)return f=g=v=Zx(255*P),NO(f,g,v,1);const I=_/60,W=P*T,J=W*(1-Math.abs(I%2-1)),ie=P-W;switch(Math.floor(I)){case 0:f=W,g=J,v=0;break;case 1:f=J,g=W,v=0;break;case 2:f=0,g=W,v=J;break;case 3:f=0,g=J,v=W;break;case 4:f=J,g=0,v=W;break;case 5:f=W,g=0,v=J;break;default:f=g=v=0}return f=Zx(255*(f+ie)),g=Zx(255*(g+ie)),v=Zx(255*(v+ie)),NO(f,g,v,1)},Hx=r=>{const f=RU(r),g=parseInt(f[1],16),v=parseInt(f[2],16),_=parseInt(f[3],16);return NO(g,v,_,1)},rM=(r,f,g,v)=>{const _=parseInt(r,10),T=parseInt(f,10),P=parseInt(g,10),I=parseFloat(v);return NO(_,T,P,I)},RS=r=>{if(r==="transparent")return V.some(NO(0,0,0,0));const f=$U.exec(r);if(f!==null)return V.some(rM(f[1],f[2],f[3],"1"));const g=NU.exec(r);return g!==null?V.some(rM(g[1],g[2],g[3],g[4])):V.none()},X3=r=>`rgba(${r.red},${r.green},${r.blue},${r.alpha})`,A8=NO(255,0,0,1),IU=r=>{r.dispatch("SkinLoaded")},zx=(r,f)=>{r.dispatch("SkinLoadError",f)},j3=r=>{r.dispatch("ResizeEditor")},iM=(r,f)=>{r.dispatch("ResizeContent",f)},IO=(r,f)=>{r.dispatch("ScrollContent",f)},D8=(r,f)=>{r.dispatch("TextColorChange",f)},BU=(r,f)=>{r.dispatch("AfterProgressState",{state:f})},Nh=(r,f)=>r.dispatch("ResolveName",{name:f.nodeName.toLowerCase(),target:f}),aM=(r,f)=>{r.dispatch("ToggleToolbarDrawer",{state:f})},Tg=(r,f)=>()=>{r(),f()},zf=r=>Db(r,"NodeChange",f=>{f.setEnabled(r.selection.isEditable())}),Fi=(r,f)=>g=>{const v=mb(),_=()=>{g.setActive(r.formatter.match(f));const T=r.formatter.formatChanged(f,g.setActive);v.set(T)};return r.initialized?_():r.once("init",_),()=>{r.off("init",_),v.clear()}},Ab=(r,f)=>g=>{const v=zf(r)(g),_=Fi(r,f)(g);return()=>{v(),_()}},Db=(r,f,g)=>v=>{const _=()=>g(v),T=()=>{g(v),r.on(f,_)};return r.initialized?T():r.once("init",T),()=>{r.off("init",T),r.off(f,_)}},lM=r=>f=>()=>{r.undoManager.transact(()=>{r.focus(),r.execCommand("mceToggleFormat",!1,f.format)})},pd=(r,f)=>()=>r.execCommand(f);var sv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const P8={},cM=(r,f=10)=>{const g=sv.getItem(r),v=d(g)?JSON.parse(g):[],T=(J=>f-J.length<0?J.slice(0,f):J)(v),P=J=>{He(T,J).each(I),T.unshift(J),T.length>f&&T.pop(),sv.setItem(r,JSON.stringify(T))},I=J=>{T.splice(J,1)};return{add:P,state:()=>T.slice(0)}},M8=r=>ln(P8,r).getOrThunk(()=>{const f=`tinymce-custom-colors-${r}`,g=sv.getItem(f);if($(g)){const _=sv.getItem("tinymce-custom-colors");sv.setItem(f,Q(_)?_:"[]")}const v=cM(f,10);return P8[r]=v,v}),R8=r=>je(M8(r).state(),f=>({type:"choiceitem",text:f,icon:"checkmark",value:f})),uM=(r,f)=>{M8(r).add(f)},iw=(r,f,g)=>({hue:r,saturation:f,value:g}),q3=r=>{let f=0,g=0,v=0;const _=r.red/255,T=r.green/255,P=r.blue/255,I=Math.min(_,Math.min(T,P)),W=Math.max(_,Math.max(T,P));if(I===W)return v=I,iw(0,0,v*100);const J=_===I?T-P:P===I?_-T:P-_;return f=_===I?3:P===I?1:5,f=60*(f-J/(W-I)),g=(W-I)/W,v=W,iw(Math.round(f),Math.round(g*100),Math.round(v*100))},G3=r=>q3(Hx(r)),$8=r=>rw(p1(r)),LU=r=>g1(r).orThunk(()=>RS(r).map(rw)).getOrThunk(()=>{const f=document.createElement("canvas");f.height=1,f.width=1;const g=f.getContext("2d");g.clearRect(0,0,f.width,f.height),g.fillStyle="#FFFFFF",g.fillStyle=r,g.fillRect(0,0,1,1);const v=g.getImageData(0,0,1,1).data,_=v[0],T=v[1],P=v[2],I=v[3];return rw(NO(_,T,P,I))}),fM="forecolor",dM="hilitecolor",FU=5,QU=r=>{const f=[];for(let g=0;g<r.length;g+=2)f.push({text:r[g+1],value:"#"+LU(r[g]).value,icon:"checkmark",type:"choiceitem"});return f},Pb=r=>f=>f.options.get(r),hM="#000000",ZU=r=>{const f=r.options.register,g=_=>K(_,d)?{value:QU(_),valid:!0}:{valid:!1,message:"Must be an array of strings."},v=_=>U(_)&&_>0?{value:_,valid:!0}:{valid:!1,message:"Must be a positive number."};f("color_map",{processor:g,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"]}),f("color_map_background",{processor:g}),f("color_map_foreground",{processor:g}),f("color_cols",{processor:v,default:K3(r)}),f("color_cols_foreground",{processor:v,default:N8(r,fM)}),f("color_cols_background",{processor:v,default:N8(r,dM)}),f("custom_colors",{processor:"boolean",default:!0}),f("color_default_foreground",{processor:"string",default:hM}),f("color_default_background",{processor:"string",default:hM})},mM=(r,f)=>f===fM&&r.options.isSet("color_map_foreground")?Pb("color_map_foreground")(r):f===dM&&r.options.isSet("color_map_background")?Pb("color_map_background")(r):Pb("color_map")(r),K3=(r,f="default")=>Math.max(FU,Math.ceil(Math.sqrt(mM(r,f).length))),N8=(r,f)=>{const g=Pb("color_cols")(r),v=K3(r,f);return g===K3(r)?v:g},gM=(r,f="default")=>Math.round((()=>f===fM?Pb("color_cols_foreground")(r):f===dM?Pb("color_cols_background")(r):Pb("color_cols")(r))()),I8=Pb("custom_colors"),HU=Pb("color_default_foreground"),zU=Pb("color_default_background"),VU="rgba(0, 0, 0, 0)",WU=r=>RS(r).exists(f=>f.alpha!==0),UU=r=>cu(r,f=>{if(yr(f)){const g=Gr(f,"background-color");return fn(WU(g),g)}else return V.none()}).getOr(VU),pM=(r,f)=>{const g=lt.fromDom(r.selection.getStart()),v=f==="hilitecolor"?UU(g):Gr(g,"color");return RS(v).map(_=>"#"+rw(_).value)},b1=(r,f,g)=>{r.undoManager.transact(()=>{r.focus(),r.formatter.apply(f,{value:g}),r.nodeChanged()})},YU=(r,f)=>{r.undoManager.transact(()=>{r.focus(),r.formatter.remove(f,{value:null},void 0,!0),r.nodeChanged()})},bM=r=>{r.addCommand("mceApplyTextcolor",(f,g)=>{b1(r,f,g)}),r.addCommand("mceRemoveTextcolor",f=>{YU(r,f)})},vM=r=>{const f="choiceitem",g={type:f,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return r?[g,{type:f,text:"Custom color",icon:"color-picker",value:"custom"}]:[g]},J3=(r,f,g,v)=>{g==="custom"?Q8(r)(T=>{T.each(P=>{uM(f,P),r.execCommand("mceApplyTextcolor",f,P),v(P)})},pM(r,f).getOr(hM)):g==="remove"?(v(""),r.execCommand("mceRemoveTextcolor",f)):(v(g),r.execCommand("mceApplyTextcolor",f,g))},OM=(r,f,g)=>r.concat(R8(f).concat(vM(g))),yM=(r,f,g)=>v=>{v(OM(r,f,g))},eA=(r,f,g)=>{const v=f==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";r.setIconFill(v,g)},B8=(r,f)=>g=>{const v=pM(r,f);return ze(v,g.toUpperCase())},L8=(r,f,g,v,_)=>{r.ui.registry.addSplitButton(f,{tooltip:v,presets:"color",icon:f==="forecolor"?"text-color":"highlight-bg-color",select:B8(r,g),columns:gM(r,g),fetch:yM(mM(r,g),g,I8(r)),onAction:T=>{J3(r,g,_.get(),L)},onItemAction:(T,P)=>{J3(r,g,P,I=>{_.set(I),D8(r,{name:f,color:I})})},onSetup:T=>{eA(T,f,_.get());const P=I=>{I.name===f&&eA(T,I.name,I.color)};return r.on("TextColorChange",P),Tg(zf(r)(T),()=>{r.off("TextColorChange",P)})}})},F8=(r,f,g,v,_)=>{r.ui.registry.addNestedMenuItem(f,{text:v,icon:f==="forecolor"?"text-color":"highlight-bg-color",onSetup:T=>(eA(T,f,_.get()),zf(r)(T)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:B8(r,g),initData:{storageKey:g},onAction:T=>{J3(r,g,T.value,P=>{_.set(P),D8(r,{name:f,color:P})})}}]})},Q8=r=>(f,g)=>{let v=!1;const _=I=>{const J=I.getData().colorpicker;v?(f(V.from(J)),I.close()):r.windowManager.alert(r.translate(["Invalid hex color code: {0}",J]))},T=(I,W)=>{W.name==="hex-valid"&&(v=W.value)},P={colorpicker:g};r.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:P,onAction:T,onSubmit:_,onClose:L,onCancel:()=>{f(V.none())}})},Z8=r=>{bM(r);const f=HU(r),g=zU(r),v=Ho(f),_=Ho(g);L8(r,"forecolor","forecolor","Text color",v),L8(r,"backcolor","hilitecolor","Background color",_),F8(r,"forecolor","forecolor","Text color",v),F8(r,"backcolor","hilitecolor","Background color",_)},tA=(r,f,g,v,_,T,P,I)=>{const W=F3(f),ie=H8(f,g,v,_!=="color"?"normal":"color",T,P,I);return R5(r,W,ie,v,{menuType:_})},H8=(r,f,g,v,_,T,P)=>Tt(je(r,I=>I.type==="choiceitem"?r8(I).fold(ev,W=>V.some(PU(W,g===1,v,f,T(W.value),_,P,F3(r)))):V.none())),nA=(r,f)=>{const g=G2(f);return r===1?{mode:"menu",moveOnTab:!0}:r==="auto"?{mode:"grid",selector:"."+g.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+(f==="color"?"tox-swatches__row":"tox-collection__group"),previousSelector:_=>f==="color"?sa(_.element,"[aria-checked=true]"):V.none()}},XU=(r,f)=>r===1?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:r==="auto"?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:f==="color"?".tox-swatches__row":".tox-collection__group",cell:f==="color"?`.${$3}`:`.${R3}`}},jU=(r,f)=>{const g=$S(r,f),v=f.colorinput.getColorCols(r.initData.storageKey),_="color",P={...tA(io("menu-value"),g,I=>{r.onAction({value:I})},v,_,Cp.CLOSE_ON_EXECUTE,r.select.getOr(tt),f.shared.providers),markers:G2(_),movement:nA(v,_)};return{type:"widget",data:{value:io("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[C8.widget(DO.sketch(P))]}},$S=(r,f)=>{const g=r.initData.allowCustomColors&&f.colorinput.hasCustomColors();return r.initData.colors.fold(()=>OM(f.colorinput.getColors(r.initData.storageKey),r.initData.storageKey,g),v=>v.concat(vM(g)))},z8=io("cell-over"),wM=io("cell-execute"),V8=r=>(f,g)=>r.shared.providers.translate(`${g} columns, ${f} rows`),W8=(r,f,g)=>{const v=P=>Ao(P,z8,{row:r,col:f}),_=P=>Ao(P,wM,{row:r,col:f}),T=(P,I)=>{I.stop(),_(P)};return pc({dom:{tag:"div",attributes:{role:"button",["aria-label"]:g}},behaviours:Tn([xs("insert-table-picker-cell",[on(Tl(),ns.focus),on(af(),_),on(sm(),T),on(tb(),T)]),Ms.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),ns.config({onFocus:v})])})},_M=(r,f,g)=>{const v=[];for(let _=0;_<f;_++){const T=[];for(let P=0;P<g;P++){const I=r(_+1,P+1);T.push(W8(_,P,I))}v.push(T)}return v},SM=(r,f,g,v,_)=>{for(let T=0;T<v;T++)for(let P=0;P<_;P++)Ms.set(r[T][P],T<=f&&P<=g)},CM=r=>Ne(r,f=>je(f,gu)),kM=(r,f)=>Li(`${f}x${r}`),U8={inserttable:(r,f)=>{const _=V8(f),T=_M(_,10,10),P=kM(0,0),I=oi({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[P],behaviours:Tn([gs.config({})])});return{type:"widget",data:{value:io("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[C8.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:CM(T).concat(I.asSpec()),behaviours:Tn([xs("insert-table-picker",[Ci(W=>{gs.set(I.get(W),[P])}),Ay(z8,(W,J,ie)=>{const{row:de,col:ge}=ie.event;SM(T,de,ge,10,10),gs.set(I.get(W),[kM(de+1,ge+1)])}),Ay(wM,(W,J,ie)=>{const{row:de,col:ge}=ie.event;r.onAction({numRows:de+1,numColumns:ge+1}),rr(W,$a())})]),No.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:jU},qU=(r,f)=>ln(U8,r.fancytype).map(g=>g(r,f)),GU=(r,f,g,v=!0,_=!1)=>{const T=_?EU(g.icons):TU(g.icons),P=W=>({isEnabled:()=>!Jo.isDisabled(W),setEnabled:J=>Jo.set(W,!J),setIconFill:(J,ie)=>{sa(W.element,`svg path[class="${J}"], rect[class="${J}"]`).each(de=>{qn(de,"fill",ie)})}}),I=Fx({presets:"normal",iconContent:r.icon,textContent:r.text,htmlContent:V.none(),ariaLabel:r.text,caret:V.some(T),checkMark:V.none(),shortcutContent:r.shortcut},g,v);return MS({data:sw(r),getApi:P,enabled:r.enabled,onAction:L,onSetup:r.onSetup,triggersSubmenu:!0,itemBehaviours:[]},I,f,g)},KU=(r,f,g,v=!0)=>{const _=P=>({isEnabled:()=>!Jo.isDisabled(P),setEnabled:I=>Jo.set(P,!I)}),T=Fx({presets:"normal",iconContent:r.icon,textContent:r.text,htmlContent:V.none(),ariaLabel:r.text,caret:V.none(),checkMark:V.none(),shortcutContent:r.shortcut},g,v);return MS({data:sw(r),getApi:_,enabled:r.enabled,onAction:r.onAction,onSetup:r.onSetup,triggersSubmenu:!1,itemBehaviours:[]},T,f,g)},Y8=r=>({type:"separator",dom:{tag:"div",classes:[R3,NW]},components:r.text.map(Li).toArray()}),X8=(r,f,g,v=!0)=>{const _=P=>({setActive:I=>{Ms.set(P,I)},isActive:()=>Ms.isOn(P),isEnabled:()=>!Jo.isDisabled(P),setEnabled:I=>Jo.set(P,!I)}),T=Fx({iconContent:r.icon,textContent:r.text,htmlContent:V.none(),ariaLabel:r.text,checkMark:V.some(tM(g.icons)),caret:V.none(),shortcutContent:r.shortcut,presets:"normal",meta:r.meta},g,v);return ni(MS({data:sw(r),enabled:r.enabled,getApi:_,onAction:r.onAction,onSetup:r.onSetup,triggersSubmenu:!1,itemBehaviours:[]},T,f,g),{toggling:{toggleClass:kS,toggleOnExecute:!1,selected:r.active}})},j8=_8,q8=Y8,JU=KU,eY=GU,tY=X8,nY=qU,oY=DU;var sY=Object.freeze({__proto__:null,getCoupled:(r,f,g,v)=>g.getOrCreate(r,f,v),getExistingCoupled:(r,f,g,v)=>g.getExisting(r,f,v)}),rY=[Kr("others",K1(wn.value,Vc()))],G8=Object.freeze({__proto__:null,init:()=>{const r={},f=(T,P)=>{if(Xs(T.others).length===0)throw new Error("Cannot find any known coupled components");return ln(r,P)},g=(T,P,I)=>f(P,I).getOrThunk(()=>{const J=ln(P.others,I).getOrDie("No information found for coupled component: "+I)(T),ie=T.getSystem().build(J);return r[I]=ie,ie}),v=(T,P,I)=>f(P,I).orThunk(()=>(ln(P.others,I).getOrDie("No information found for coupled component: "+I),V.none())),_=G({});return mu({readState:_,getExisting:v,getOrCreate:g})}});const ul=nc({fields:rY,name:"coupling",apis:sY,state:G8}),xM=r=>{let f=V.none(),g=[];const v=J=>xM(ie=>{_(de=>{ie(J(de))})}),_=J=>{P()?W(J):g.push(J)},T=J=>{P()||(f=V.some(J),I(g),g=[])},P=()=>f.isSome(),I=J=>{mt(J,W)},W=J=>{f.each(ie=>{setTimeout(()=>{J(ie)},0)})};return r(T),{get:_,map:v,isReady:P}},iY={nu:xM,pure:r=>xM(f=>{f(r)})},aY=r=>{setTimeout(()=>{throw r},0)},rv=r=>{const f=W=>{r().then(W,aY)};return{map:W=>rv(()=>r().then(W)),bind:W=>rv(()=>r().then(J=>W(J).toPromise())),anonBind:W=>rv(()=>r().then(()=>W.toPromise())),toLazy:()=>iY.nu(f),toCached:()=>{let W=null;return rv(()=>(W===null&&(W=r()),W))},toPromise:r,get:f}},Yu={nu:r=>rv(()=>new Promise(r)),pure:r=>rv(()=>Promise.resolve(r))},K8=G("sink"),J8=G(Yd({name:K8(),overrides:G({dom:{tag:"div"},behaviours:Tn([yu.config({useFixed:ot})]),events:li([am(If()),am(Fr()),am(sm())])})})),eL=(r,f)=>{const g=r.getHotspot(f).getOr(f),v="hotspot",_=r.getAnchorOverrides();return r.layouts.fold(()=>({type:v,hotspot:g,overrides:_}),T=>({type:v,hotspot:g,overrides:_,layouts:T}))},cY=(r,f,g)=>{const v=r.fetch;return v(g).map(f)},TM=(r,f,g,v,_,T,P)=>{const I=cY(r,f,v),W=oL(v,r);return I.map(J=>J.bind(ie=>V.from(X2.sketch({...T.menu(),uid:yh(""),data:ie,highlightOnOpen:P,onOpenMenu:(de,ge)=>{const _e=W().getOrDie();yu.position(_e,ge,{anchor:g}),Gs.decloak(_)},onOpenSubmenu:(de,ge,_e)=>{const Ie=W().getOrDie();yu.position(Ie,_e,{anchor:{type:"submenu",item:ge}}),Gs.decloak(_)},onRepositionMenu:(de,ge,_e)=>{const Ie=W().getOrDie();yu.position(Ie,ge,{anchor:g}),mt(_e,it=>{yu.position(Ie,it.triggeredMenu,{anchor:{type:"submenu",item:it.triggeringItem}})})},onEscape:()=>(ns.focus(v),Gs.close(_),V.some(!0))}))))},Vx=(r,f,g,v,_,T,P)=>{const I=eL(r,g);return TM(r,f,I,g,v,_,P).map(J=>(J.fold(()=>{Gs.isOpen(v)&&Gs.close(v)},ie=>{Gs.cloak(v),Gs.open(v,ie),T(v)}),v))},tL=(r,f,g,v,_,T,P)=>(Gs.close(v),Yu.pure(v)),EM=(r,f,g,v,_,T)=>{const P=ul.getCoupled(g,"sandbox");return(Gs.isOpen(P)?tL:Vx)(r,f,g,P,v,_,T)},nL=(r,f,g)=>{const v=cr.getCurrent(f).getOr(f),_=ta(r.element);g?ro(v.element,"min-width",_+"px"):ti(v.element,_)},oL=(r,f)=>r.getSystem().getByUid(f.uid+"-"+K8()).map(g=>()=>wn.value(g)).getOrThunk(()=>f.lazySink.fold(()=>()=>wn.error(new Error("No internal sink is specified, nor could an external sink be found")),g=>()=>g(r))),sL=r=>{Gs.getState(r).each(f=>{X2.repositionMenus(f)})},AM=(r,f,g)=>{const v=Xy(),_=(I,W)=>{const J=eL(r,f);v.link(f.element),r.matchWidth&&nL(J.hotspot,W,r.useMinWidth),r.onOpen(J,I,W),g!==void 0&&g.onOpen!==void 0&&g.onOpen(I,W)},T=(I,W)=>{v.unlink(f.element),g!==void 0&&g.onClose!==void 0&&g.onClose(I,W)},P=oL(f,r);return{dom:{tag:"div",classes:r.sandboxClasses,attributes:{id:v.id,role:"listbox"}},behaviours:ym.augment(r.sandboxBehaviours,[Gn.config({store:{mode:"memory",initialValue:f}}),Gs.config({onOpen:_,onClose:T,isPartOf:(I,W,J)=>t1(W,J)||t1(f,J),getAttachPoint:()=>P().getOrDie()}),cr.config({find:I=>Gs.getState(I).bind(W=>cr.getCurrent(W))}),Pc.config({channels:{...OO({isExtraPart:tt}),...zk({doReposition:sL})}})])}},rL=r=>{const f=ul.getCoupled(r,"sandbox");sL(f)},DM=()=>[xt("sandboxClasses",[]),ym.field("sandboxBehaviours",[cr,Pc,Gs,Gn])],uY=G([nn("dom"),nn("fetch"),qs("onOpen"),pu("onExecute"),xt("getHotspot",V.some),xt("getAnchorOverrides",G({})),Eh(),Wl("dropdownBehaviours",[Ms,ul,No,ns]),nn("toggleClass"),xt("eventOrder",{}),Er("lazySink"),xt("matchWidth",!1),xt("useMinWidth",!1),Er("role")].concat(DM())),fY=G([Mh({schema:[Yv(),xt("fakeFocus",!1)],name:"menu",defaults:r=>({onExecute:r.onExecute})}),J8()]),dY=(r,f,g,v)=>{const _=ie=>ln(r.dom,"attributes").bind(de=>ln(de,ie)),T=ie=>{Gs.getState(ie).each(de=>{X2.highlightPrimary(de)})},P=(ie,de,ge)=>EM(r,we,ie,v,de,ge),I=ie=>{P(ie,T,md.HighlightMenuAndItem).get(L)},W={expand:ie=>{Ms.isOn(ie)||P(ie,L,md.HighlightNone).get(L)},open:ie=>{Ms.isOn(ie)||P(ie,L,md.HighlightMenuAndItem).get(L)},refetch:ie=>ul.getExistingCoupled(ie,"sandbox").fold(()=>P(ie,L,md.HighlightMenuAndItem).map(L),ge=>Vx(r,we,ie,ge,v,L,md.HighlightMenuAndItem).map(L)),isOpen:Ms.isOn,close:ie=>{Ms.isOn(ie)&&P(ie,L,md.HighlightMenuAndItem).get(L)},repositionMenus:ie=>{Ms.isOn(ie)&&rL(ie)}},J=(ie,de)=>(bh(ie),V.some(!0));return{uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.dropdownBehaviours,[Ms.config({toggleClass:r.toggleClass,aria:{mode:"expanded"}}),ul.config({others:{sandbox:ie=>AM(r,ie,{onOpen:()=>Ms.on(ie),onClose:()=>Ms.off(ie)})}}),No.config({mode:"special",onSpace:J,onEnter:J,onDown:(ie,de)=>{if(Eg.isOpen(ie)){const ge=ul.getCoupled(ie,"sandbox");T(ge)}else Eg.open(ie);return V.some(!0)},onEscape:(ie,de)=>Eg.isOpen(ie)?(Eg.close(ie),V.some(!0)):V.none()}),ns.config({})]),events:b3(V.some(I)),eventOrder:{...r.eventOrder,[af()]:["disabling","toggling","alloy.base.behaviour"]},apis:W,domModification:{attributes:{"aria-haspopup":"true",...r.role.fold(()=>({}),ie=>({role:ie})),...r.dom.tag==="button"?{type:_("type").getOr("button")}:{}}}}},Eg=wu({name:"Dropdown",configFields:uY(),partFields:fY(),factory:dY,apis:{open:(r,f)=>r.open(f),refetch:(r,f)=>r.refetch(f),expand:(r,f)=>r.expand(f),close:(r,f)=>r.close(f),isOpen:(r,f)=>r.isOpen(f),repositionMenus:(r,f)=>r.repositionMenus(f)}}),hY=r=>{switch(r.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:r}}},oA=r=>{const f=Gn.getValue(r),g=N3(r).map(zB);Eg.refetch(f).get(()=>{const v=ul.getCoupled(f,"sandbox");g.each(_=>N3(v).each(T=>UW(T,_)))})},PM=(r,f)=>{MM(r).each(g=>{WC(r,g.element,f.event.eventType,f.event.interactionEvent)})},MM=r=>Gs.getState(r).bind(Nr.getHighlighted).bind(Nr.getHighlighted),iL=r=>uf(r.element,B3)?V.some(r.element):sa(r.element,"."+B3),aL=(r,f,g)=>{I3(r).each(v=>{YW(v,g),iL(f).each(T=>{me(T,"id").each(P=>qn(v.element,"aria-controls",P))})}),qn(g.element,"aria-selected","true")},mY=(r,f,g)=>{qn(g.element,"aria-selected","false")},RM=r=>{I3(r).each(f=>ns.focus(f))},$M=r=>ul.getExistingCoupled(r,"sandbox").bind(N3).map(zB).map(g=>g.fetchPattern).getOr("");var aw;(function(r){r[r.ContentFocus=0]="ContentFocus",r[r.UiFocus=1]="UiFocus"})(aw||(aw={}));const lL=(r,f,g,v,_)=>{const T=g.shared.providers,P=I=>_?{...I,shortcut:V.none(),icon:I.text.isSome()?V.none():I.icon}:I;switch(r.type){case"menuitem":return i8(r).fold(ev,I=>V.some(JU(P(I),f,T,v)));case"nestedmenuitem":return l8(r).fold(ev,I=>V.some(eY(P(I),f,T,v,_)));case"togglemenuitem":return c8(r).fold(ev,I=>V.some(tY(P(I),f,T,v)));case"separator":return nU(r).fold(ev,I=>V.some(q8(I)));case"fancymenuitem":return U3(r).fold(ev,I=>nY(I,g));default:return console.error("Unknown item in general menu",r),V.none()}},gY=(r,f,g,v,_,T,P)=>{const I=v===1,W=!I||F3(r);return Tt(je(r,J=>{switch(J.type){case"separator":return sU(J).fold(ev,ie=>V.some(q8(ie)));case"cardmenuitem":return U5(J).fold(ev,ie=>V.some(oY({...ie,onAction:de=>{ie.onAction(de),g(ie.value,ie.meta)}},_,T,{itemBehaviours:y8(ie.meta,T),cardText:{matchText:f,highlightOn:P}})));case"autocompleteitem":default:return qB(J).fold(ev,ie=>V.some(j8(ie,f,I,"normal",g,_,T,W)))}}))},cL=(r,f,g,v,_,T)=>{const P=F3(f),I=Tt(je(f,ie=>{const de=_e=>_?!vs(_e,"text"):P,ge=_e=>lL(_e,g,v,de(_e),_);return ie.type==="nestedmenuitem"&&ie.getSubmenuItems().length<=0?ge({...ie,enabled:!1}):ge(ie)})),W=hY(T);return(_?KW:R5)(r,P,I,1,W)},NM=r=>X2.singleData(r.value,r),pY=(r,f,g,v)=>{const _=nA(f,v),T=G2(v);return{data:NM({...r,movement:_,menuBehaviours:AS.unnamedEvents(f!=="auto"?[]:[Ci((P,I)=>{q5(P,4,T.item).each(({numColumns:W,numRows:J})=>{No.setGridSize(P,J,W)})})])}),menu:{markers:G2(v),fakeFocus:g===aw.ContentFocus}}},bY=(r,f)=>P3(lt.fromDom(f.startContainer)).map(g=>{const v=r.createRng();return v.selectNode(g.dom),v}),vY={register:(r,f)=>{const g=Ho(!1),v=Ho(!1),_=pc(Ba.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Tn([xs("dismissAutocompleter",[on(rg(),()=>J())])]),lazySink:f.getSink})),T=()=>Ba.isOpen(_),P=v.get,I=()=>{T()&&Ba.hide(_)},W=()=>Ba.getContent(_).bind(Ie=>oo(Ie.components(),0)),J=()=>r.execCommand("mceAutocompleterClose"),ie=Ie=>{const it=tr(Ie,Qt=>V.from(Qt.columns)).getOr(1);return Ne(Ie,Qt=>{const dt=Qt.items;return gY(dt,Qt.matchText,(ft,Yt)=>{const Dt=r.selection.getRng();bY(r.dom,Dt).each(kn=>{const pn={hide:()=>J(),reload:Nn=>{I(),r.execCommand("mceAutocompleterReload",!1,{fetchOptions:Nn})}};g.set(!0),Qt.onAction(pn,kn,ft,Yt),g.set(!1)})},it,Cp.BUBBLE_TO_SANDBOX,f,Qt.highlightOn)})},de=(Ie,it)=>{PW(lt.fromDom(r.getBody())).each(Qt=>{const dt=tr(Ie,ft=>V.from(ft.columns)).getOr(1);Ba.showMenuAt(_,{anchor:{type:"node",root:lt.fromDom(r.getBody()),node:V.from(Qt)}},pY(R5("autocompleter-value",!0,it,dt,{menuType:"normal"}),dt,aw.ContentFocus,"normal"))}),W().each(Nr.highlightFirst)},ge=Ie=>{const it=ie(Ie);it.length>0?de(Ie,it):I()};r.on("AutocompleterStart",({lookupData:Ie})=>{v.set(!0),g.set(!1),ge(Ie)}),r.on("AutocompleterUpdate",({lookupData:Ie})=>ge(Ie)),r.on("AutocompleterEnd",()=>{I(),v.set(!1),g.set(!1)});const _e={cancelIfNecessary:J,isMenuOpen:T,isActive:P,isProcessingAction:g.get,getMenu:W};RW.setup(_e,r)}},OY=["visible","hidden","clip"],uL=r=>Oi(r).length>0&&!st(OY,r),fL=r=>{if(xu(r)){const f=Gr(r,"overflow-x"),g=Gr(r,"overflow-y");return uL(f)||uL(g)}else return!1},yY=r=>{const f=yb(r,fL),g=f.length===0?$r(r).map(ys).map(v=>yb(v,fL)).getOr([]):f;return Ss(g).map(v=>({element:v,others:g.slice(1)}))},lw=(r,f)=>Eb(r)?yY(f):V.none(),NS=r=>{const f=[...je(r.others,di),ue()];return ee(di(r.element),f)},IS=(r,f,g)=>df(r,f,g).isSome(),dL=(r,f)=>{let g=null;return{cancel:()=>{g!==null&&(clearTimeout(g),g=null)},schedule:(...T)=>{g=setTimeout(()=>{r.apply(null,T),g=null},f)}}},hL=5,Mb=400,mL=r=>{const f=r.raw;return f.touches===void 0||f.touches.length!==1?V.none():V.some(f.touches[0])},wY=(r,f)=>{const g=Math.abs(r.clientX-f.x),v=Math.abs(r.clientY-f.y);return g>hL||v>hL},IM=r=>{const f=Xi(),g=Ho(!1),v=dL(J=>{r.triggerEvent(e_(),J),g.set(!0)},Mb),_=J=>(mL(J).each(ie=>{v.cancel();const de={x:ie.clientX,y:ie.clientY,target:J.target};v.schedule(J),g.set(!1),f.set(de)}),V.none()),T=J=>(v.cancel(),mL(J).each(ie=>{f.on(de=>{wY(ie,de)&&f.clear()})}),V.none()),P=J=>{v.cancel();const ie=de=>xr(de.target,J.target);return f.get().filter(ie).map(de=>g.get()?(J.prevent(),!1):r.triggerEvent(tb(),J))},I=Uo([{key:uu(),value:_},{key:Xp(),value:T},{key:Jm(),value:P}]);return{fireIfReady:(J,ie)=>ln(I,ie).bind(de=>de(J))}},ic=r=>r.raw.which===hx[0]&&!st(["input","textarea"],gl(r.target))&&!IS(r.target,'[contenteditable="true"]'),_Y=(r,f)=>{const g={stopBackspace:!0,...f},v=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],_=IM(g),T=je(v.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),_e=>Mc(r,_e,Ie=>{_.fireIfReady(Ie,_e).each(Qt=>{Qt&&Ie.kill()}),g.triggerEvent(_e,Ie)&&Ie.kill()})),P=Xi(),I=Mc(r,"paste",_e=>{_.fireIfReady(_e,"paste").each(it=>{it&&_e.kill()}),g.triggerEvent("paste",_e)&&_e.kill(),P.set(setTimeout(()=>{g.triggerEvent(ng(),_e)},0))}),W=Mc(r,"keydown",_e=>{g.triggerEvent("keydown",_e)?_e.kill():g.stopBackspace&&ic(_e)&&_e.prevent()}),J=Mc(r,"focusin",_e=>{g.triggerEvent("focusin",_e)&&_e.kill()}),ie=Xi(),de=Mc(r,"focusout",_e=>{g.triggerEvent("focusout",_e)&&_e.kill(),ie.set(setTimeout(()=>{g.triggerEvent(tg(),_e)},0))});return{unbind:()=>{mt(T,_e=>{_e.unbind()}),W.unbind(),J.unbind(),de.unbind(),I.unbind(),P.on(clearTimeout),ie.on(clearTimeout)}}},gL=(r,f)=>{const g=ln(r,"target").getOr(f);return Ho(g)},SY=(r,f)=>{const g=Ho(!1),v=Ho(!1);return{stop:()=>{g.set(!0)},cut:()=>{v.set(!0)},isStopped:g.get,isCut:v.get,event:r,setSource:f.set,getSource:f.get}},CY=r=>{const f=Ho(!1);return{stop:()=>{f.set(!0)},cut:L,isStopped:f.get,isCut:tt,event:r,setSource:ce("Cannot set source of a broadcasted event"),getSource:ce("Cannot get source of a broadcasted event")}},Wx=j.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),pL=(r,f,g,v,_,T)=>{const P=r(f,v),I=SY(g,_);return P.fold(()=>(T.logEventNoHandlers(f,v),Wx.complete()),W=>{const J=W.descHandler;return Gp(J)(I),I.isStopped()?(T.logEventStopped(f,W.element,J.purpose),Wx.stopped()):I.isCut()?(T.logEventCut(f,W.element,J.purpose),Wx.complete()):Ha(W.element).fold(()=>(T.logNoParent(f,W.element,J.purpose),Wx.complete()),de=>(T.logEventResponse(f,W.element,J.purpose),Wx.resume(de)))})},bL=(r,f,g,v,_,T)=>pL(r,f,g,v,_,T).fold(ot,P=>bL(r,f,g,P,_,T),tt),kY=(r,f,g,v,_)=>{const T=gL(g,v);return pL(r,f,g,v,T,_)},xY=(r,f,g)=>{const v=CY(f);return mt(r,_=>{const T=_.descHandler;Gp(T)(v)}),v.isStopped()},TY=(r,f,g,v)=>vL(r,f,g,g.target,v),vL=(r,f,g,v,_)=>{const T=gL(g,v);return bL(r,f,g,v,T,_)},EY=(r,f)=>({element:r,descHandler:f}),AY=(r,f)=>({id:r,descHandler:f}),DY=()=>{const r={},f=(P,I,W)=>{dr(W,(J,ie)=>{const de=r[ie]!==void 0?r[ie]:{};de[I]=s_(J,P),r[ie]=de})},g=(P,I)=>rp(I).bind(W=>ln(P,W)).map(W=>EY(I,W));return{registerId:f,unregisterId:P=>{dr(r,(I,W)=>{vs(I,P)&&delete I[P]})},filterByType:P=>ln(r,P).map(I=>aa(I,(W,J)=>AY(J,W))).getOr([]),find:(P,I,W)=>ln(r,I).bind(J=>cu(W,ie=>g(J,ie),P))}},PY=()=>{const r=DY(),f={},g=J=>{const ie=J.element;return rp(ie).getOrThunk(()=>lf("uid-",J.element))},v=(J,ie)=>{const de=f[ie];if(de===J)T(J);else throw new Error('The tagId "'+ie+'" is already used by: '+El(de.element)+`
|
|
Cannot use it for: `+El(J.element)+`
|
|
The conflicting element is`+(js(de.element)?" ":" not ")+"already in the DOM")},_=J=>{const ie=g(J);Qi(f,ie)&&v(J,ie);const de=[J];r.registerId(de,ie,J.events),f[ie]=J},T=J=>{rp(J.element).each(ie=>{delete f[ie],r.unregisterId(ie)})};return{find:(J,ie,de)=>r.find(J,ie,de),filter:J=>r.filterByType(J),register:_,unregister:T,getById:J=>ln(f,J)}},v1=Kc({name:"Container",factory:r=>{const{attributes:f,...g}=r.dom;return{uid:r.uid,dom:{tag:"div",attributes:{role:"presentation",...f},...g},components:r.components,behaviours:Om(r.containerBehaviours),events:r.events,domModification:r.domModification,eventOrder:r.eventOrder}},configFields:[xt("components",[]),Wl("containerBehaviours",[]),xt("events",{}),xt("domModification",{}),xt("eventOrder",{})]}),BM=r=>{const f=dt=>Ha(r.element).fold(ot,ft=>xr(dt,ft)),g=PY(),v=(dt,ft)=>g.find(f,dt,ft),_=_Y(r.element,{triggerEvent:(dt,ft)=>x0(dt,ft.target,Yt=>TY(v,dt,ft,Yt))}),T={debugInfo:G("real"),triggerEvent:(dt,ft,Yt)=>{x0(dt,ft,Dt=>vL(v,dt,Yt,ft,Dt))},triggerFocus:(dt,ft)=>{rp(dt).fold(()=>{gf(dt)},Yt=>{x0($d(),dt,Dt=>(kY(v,$d(),{originator:ft,kill:L,prevent:L,target:dt},dt,Dt),!1))})},triggerEscape:(dt,ft)=>{T.triggerEvent("keydown",dt.element,ft.event)},getByUid:dt=>it(dt),getByDom:dt=>Qt(dt),build:pc,buildOrPatch:ug,addToGui:dt=>{W(dt)},removeFromGui:dt=>{J(dt)},addToWorld:dt=>{P(dt)},removeFromWorld:dt=>{I(dt)},broadcast:dt=>{ge(dt)},broadcastOn:(dt,ft)=>{_e(dt,ft)},broadcastEvent:(dt,ft)=>{Ie(dt,ft)},isConnected:ot},P=dt=>{dt.connect(T),ol(dt.element)||(g.register(dt),mt(dt.components(),P),T.triggerEvent(og(),dt.element,{target:dt.element}))},I=dt=>{ol(dt.element)||(mt(dt.components(),I),g.unregister(dt)),dt.disconnect()},W=dt=>{cl(r,dt)},J=dt=>{qc(dt)},ie=()=>{_.unbind(),Mu(r.element)},de=dt=>{const ft=g.filter(im());mt(ft,Yt=>{const Dt=Yt.descHandler;Gp(Dt)(dt)})},ge=dt=>{de({universal:!0,data:dt})},_e=(dt,ft)=>{de({universal:!1,channels:dt,data:ft})},Ie=(dt,ft)=>{const Yt=g.filter(dt);return xY(Yt,ft)},it=dt=>g.getById(dt).fold(()=>wn.error(new Error('Could not find component with uid: "'+dt+'" in system.')),wn.value),Qt=dt=>{const ft=rp(dt).getOr("not found");return it(ft)};return P(r),{root:r,element:r.element,destroy:ie,add:W,remove:J,getByUid:it,getByDom:Qt,addToWorld:P,removeFromWorld:I,broadcast:ge,broadcastOn:_e,broadcastEvent:Ie}},MY=(r,f)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:je(r.items,f.interpreter)}),RY=G([xt("prefix","form-field"),Wl("fieldBehaviours",[cr,Gn])]),$Y=G([Yd({schema:[nn("dom")],name:"label"}),Yd({factory:{sketch:r=>({uid:r.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:r.text}})},schema:[nn("text")],name:"aria-descriptor"}),Gc({factory:{sketch:r=>{const f=Sn(r,["factory"]);return r.factory.sketch(f)}},schema:[nn("factory")],name:"field"})]),NY=(r,f,g,v)=>{const _=sc(r.fieldBehaviours,[cr.config({find:I=>Ri(I,r,"field")}),Gn.config({store:{mode:"manual",getValue:I=>cr.getCurrent(I).bind(Gn.getValue),setValue:(I,W)=>{cr.getCurrent(I).each(J=>{Gn.setValue(J,W)})}}})]),T=li([Ci((I,W)=>{const J=_O(I,r,["label","field","aria-descriptor"]);J.field().each(ie=>{const de=io(r.prefix);J.label().each(ge=>{qn(ge.element,"for",de),qn(ie.element,"id",de)}),J["aria-descriptor"]().each(ge=>{const _e=io(r.prefix);qn(ge.element,"id",_e),qn(ie.element,"aria-describedby",_e)})})})]),P={getField:I=>Ri(I,r,"field"),getLabel:I=>Ri(I,r,"label")};return{uid:r.uid,dom:r.dom,components:f,behaviours:_,events:T,apis:P}},si=wu({name:"FormField",configFields:RY(),partFields:$Y(),factory:NY,apis:{getField:(r,f)=>r.getField(f),getLabel:(r,f)=>r.getLabel(f)}});var IY=Object.freeze({__proto__:null,exhibit:(r,f)=>Yc({attributes:Uo([{key:f.tabAttr,value:"true"}])})}),OL=[xt("tabAttr","data-alloy-tabstop")];const Ka=nc({fields:OL,name:"tabstopping",active:IY});var BY=tinymce.util.Tools.resolve("tinymce.html.Entities");const Ux=(r,f,g,v)=>{const _=LY(r,f,g,v);return si.sketch(_)},yL=(r,f)=>Ux(r,f,[],[]),LY=(r,f,g,v)=>({dom:wL(g),components:r.toArray().concat([f]),fieldBehaviours:Tn(v)}),FY=()=>wL([]),wL=r=>({tag:"div",classes:["tox-form__group"].concat(r)}),iv=(r,f)=>si.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Li(f.translate(r))]}),Ih=io("form-component-change"),Yx=io("form-close"),BO=io("form-cancel"),Rb=io("form-action"),BS=io("form-submit"),LM=io("form-block"),sA=io("form-unblock"),_L=io("form-tabchange"),FM=io("form-resize"),QY=(r,f,g)=>{const v=r.label.map(de=>iv(de,f)),_=de=>(ge,_e)=>{df(_e.event.target,"[data-collection-item-value]").each(Ie=>{de(ge,_e,Ie,zi(Ie,"data-collection-item-value"))})},T=(de,ge)=>{const _e=je(ge,Qt=>{const dt=Cm.translate(Qt.text),ft=r.columns===1?`<div class="tox-collection__item-label">${dt}</div>`:"",Yt=`<div class="tox-collection__item-icon">${Qt.icon}</div>`,Dt={_:" "," - ":" ","-":" "},kn=dt.replace(/\_| \- |\-/g,Nn=>Dt[Nn]);return`<div class="tox-collection__item${f.isDisabled()?" tox-collection__item--state-disabled":""}" tabindex="-1" data-collection-item-value="${BY.encodeAllRaw(Qt.value)}" title="${kn}" aria-label="${kn}">${Yt}${ft}</div>`}),Ie=r.columns!=="auto"&&r.columns>1?Cn(_e,r.columns):[_e],it=je(Ie,Qt=>`<div class="tox-collection__group">${Qt.join("")}</div>`);vh(de.element,it.join(""))},P=_((de,ge,_e,Ie)=>{ge.stop(),f.isDisabled()||Ao(de,Rb,{name:r.name,value:Ie})}),I=[on(Tl(),_((de,ge,_e)=>{gf(_e)})),on(sm(),P),on(tb(),P),on(Gi(),_((de,ge,_e)=>{sa(de.element,"."+Rx).each(Ie=>{va(Ie,Rx)}),Na(_e,Rx)})),on(fu(),_(de=>{sa(de.element,"."+Rx).each(ge=>{va(ge,Rx)})})),hu(_((de,ge,_e,Ie)=>{Ao(de,Rb,{name:r.name,value:Ie})}))],W=(de,ge)=>je(vu(de.element,".tox-collection__item"),ge),J=si.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(r.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:we},behaviours:Tn([Jo.config({disabled:f.isDisabled,onDisabled:de=>{W(de,ge=>{Na(ge,"tox-collection__item--state-disabled"),qn(ge,"aria-disabled",!0)})},onEnabled:de=>{W(de,ge=>{va(ge,"tox-collection__item--state-disabled"),Ue(ge,"aria-disabled")})}}),rc(),gs.config({}),Gn.config({store:{mode:"memory",initialValue:g.getOr([])},onSetValue:(de,ge)=>{T(de,ge),r.columns==="auto"&&q5(de,5,"tox-collection__item").each(({numRows:_e,numColumns:Ie})=>{No.setGridSize(de,_e,Ie)}),rr(de,FM)}}),Ka.config({}),No.config(XU(r.columns,"normal")),xs("collection-events",I)]),eventOrder:{[af()]:["disabling","alloy.base.behaviour","collection-events"]}});return Ux(v,J,["tox-form__group--collection"],[])},ZY=["input","textarea"],SL=r=>{const f=gl(r);return st(ZY,f)},CL=(r,f)=>{const g=f.getRoot(r).getOr(r.element);va(g,f.invalidClass),f.notify.each(v=>{SL(r.element)&&qn(r.element,"aria-invalid",!1),v.getContainer(r).each(_=>{vh(_,v.validHtml)}),v.onValid(r)})},kL=(r,f,g,v)=>{const _=f.getRoot(r).getOr(r.element);Na(_,f.invalidClass),f.notify.each(T=>{SL(r.element)&&qn(r.element,"aria-invalid",!0),T.getContainer(r).each(P=>{vh(P,v)}),T.onInvalid(r,v)})},xL=(r,f,g)=>f.validator.fold(()=>Yu.pure(wn.value(!0)),v=>v.validate(r)),QM=(r,f,g)=>(f.notify.each(v=>{v.onValidate(r)}),xL(r,f).map(v=>r.getSystem().isConnected()?v.fold(_=>(kL(r,f,g,_),wn.error(_)),_=>(CL(r,f),wn.value(_))):wn.error("No longer in system")));var HY=Object.freeze({__proto__:null,markValid:CL,markInvalid:kL,query:xL,run:QM,isInvalid:(r,f)=>{const g=f.getRoot(r).getOr(r.element);return uf(g,f.invalidClass)}}),zY=Object.freeze({__proto__:null,events:(r,f)=>r.validator.map(g=>li([on(g.onEvent,v=>{QM(v,r,f).get(we)})].concat(g.validateOnLoad?[Ci(v=>{QM(v,r,f).get(L)})]:[]))).getOr({})}),VY=[nn("invalidClass"),xt("getRoot",V.none),Xa("notify",[xt("aria","alert"),xt("getContainer",V.none),xt("validHtml",""),qs("onValid"),qs("onInvalid"),qs("onValidate")]),Xa("validator",[nn("validate"),xt("onEvent","input"),xt("validateOnLoad",!0)])];const O1=nc({fields:VY,name:"invalidating",active:zY,apis:HY,extra:{validation:r=>f=>{const g=Gn.getValue(f);return Yu.pure(r(g))}}});var WY=Object.freeze({__proto__:null,events:()=>li([Lv(rm(),ot)]),exhibit:()=>Yc({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})});const Xx=nc({fields:[],name:"unselecting",active:WY}),UY=(r,f)=>Eg.sketch({dom:r.dom,components:r.components,toggleClass:"mce-active",dropdownBehaviours:Tn([xg.button(f.providers.isDisabled),rc(),Xx.config({}),Ka.config({})]),layouts:r.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:f.getSink,fetch:g=>Yu.nu(v=>r.fetch(v)).map(v=>V.from(NM(ni(tA(io("menu-value"),v,_=>{r.onItemAction(g,_)},r.columns,r.presets,Cp.CLOSE_ON_EXECUTE,tt,f.providers),{movement:nA(r.columns,r.presets)})))),parts:{menu:xS(!1,1,r.presets)}}),rA=io("color-input-change"),TL=io("color-swatch-change"),EL=io("color-picker-cancel"),YY=(r,f,g,v)=>{const _=si.parts.field({factory:K2,inputClasses:["tox-textfield"],data:v,onSetValue:J=>O1.run(J).get(L),inputBehaviours:Tn([Jo.config({disabled:f.providers.isDisabled}),rc(),Ka.config({}),O1.config({invalidClass:"tox-textbox-field-invalid",getRoot:J=>xc(J.element),notify:{onValid:J=>{const ie=Gn.getValue(J);Ao(J,rA,{color:ie})}},validator:{validateOnLoad:!1,validate:J=>{const ie=Gn.getValue(J);if(ie.length===0)return Yu.pure(wn.value(!0));{const de=lt.fromTag("span");ro(de,"background-color",ie);const ge=ea(de,"background-color").fold(()=>wn.error("blah"),_e=>wn.value(ie));return Yu.pure(ge)}}}})]),selectOnFocus:!1}),T=r.label.map(J=>iv(J,f.providers)),P=(J,ie)=>{Ao(J,TL,{value:ie})},I=(J,ie)=>{W.getOpt(J).each(de=>{ie==="custom"?g.colorPicker(ge=>{ge.fold(()=>rr(de,EL),_e=>{P(de,_e),uM(r.storageKey,_e)})},"#ffffff"):ie==="remove"?P(de,""):P(de,ie)})},W=oi(UY({dom:{tag:"span",attributes:{"aria-label":f.providers.translate("Color swatch")}},layouts:{onRtl:()=>[ec,vl,Vl],onLtr:()=>[vl,ec,Vl]},components:[],fetch:yM(g.getColors(r.storageKey),r.storageKey,g.hasCustomColors()),columns:g.getColorCols(r.storageKey),presets:"color",onItemAction:I},f));return si.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:T.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[_,W.asSpec()]}]),fieldBehaviours:Tn([xs("form-field-events",[on(rA,(J,ie)=>{W.getOpt(J).each(de=>{ro(de.element,"background-color",ie.event.color)}),Ao(J,Ih,{name:r.name})}),on(TL,(J,ie)=>{si.getField(J).each(de=>{Gn.setValue(de,ie.event.value),cr.getCurrent(J).each(ns.focus)})}),on(EL,(J,ie)=>{si.getField(J).each(de=>{cr.getCurrent(J).each(ns.focus)})})])])})},AL=Yd({schema:[nn("dom")],name:"label"}),av=r=>Yd({name:""+r+"-edge",overrides:f=>f.model.manager.edgeActions[r].fold(()=>({}),v=>({events:li([Id(uu(),(_,T,P)=>v(_,P),[f]),Id(Fr(),(_,T,P)=>v(_,P),[f]),Id(Ma(),(_,T,P)=>{P.mouseIsDown.get()&&v(_,P)},[f])])}))}),XY=av("top-left"),jY=av("top"),DL=av("top-right"),qY=av("right"),GY=av("bottom-right"),KY=av("bottom"),JY=av("bottom-left"),eX=av("left"),tX=Gc({name:"thumb",defaults:G({dom:{styles:{position:"absolute"}}}),overrides:r=>({events:li([ag(uu(),r,"spectrum"),ag(Xp(),r,"spectrum"),ag(Jm(),r,"spectrum"),ag(Fr(),r,"spectrum"),ag(Ma(),r,"spectrum"),ag(eb(),r,"spectrum")])})}),iA=Gc({schema:[ka("mouseIsDown",()=>Ho(!1))],name:"spectrum",overrides:r=>{const g=r.model.manager,v=(_,T)=>g.getValueFromEvent(T).map(P=>g.setValueFrom(_,r,P));return{behaviours:Tn([No.config({mode:"special",onLeft:_=>g.onLeft(_,r),onRight:_=>g.onRight(_,r),onUp:_=>g.onUp(_,r),onDown:_=>g.onDown(_,r)}),ns.config({})]),events:li([on(uu(),v),on(Xp(),v),on(Fr(),v),on(Ma(),(_,T)=>{r.mouseIsDown.get()&&v(_,T)})])}}});var nX=[AL,eX,qY,jY,KY,XY,DL,JY,GY,tX,iA];const jx=G("slider.change.value"),oX=r=>r.type.indexOf("touch")!==-1,HM=r=>{const f=r.event.raw;if(oX(f)){const g=f;return g.touches!==void 0&&g.touches.length===1?V.some(g.touches[0]).map(v=>pr(v.clientX,v.clientY)):V.none()}else{const g=f;return g.clientX!==void 0?V.some(g).map(v=>pr(v.clientX,v.clientY)):V.none()}},sX="top",Zie="right",aA="bottom",LS="left",LO=r=>r.model.minX,FO=r=>r.model.minY,lA=r=>r.model.minX-1,cA=r=>r.model.minY-1,cw=r=>r.model.maxX,uw=r=>r.model.maxY,uA=r=>r.model.maxX+1,fA=r=>r.model.maxY+1,PL=(r,f,g)=>f(r)-g(r),zM=r=>PL(r,cw,LO),VM=r=>PL(r,uw,FO),ML=r=>zM(r)/2,RL=r=>VM(r)/2,fw=r=>r.stepSize,dw=r=>r.snapToGrid,QO=r=>r.snapStart,$L=r=>r.rounded,qx=(r,f)=>r[f+"-edge"]!==void 0,WM=r=>qx(r,LS),Gx=r=>qx(r,Zie),NL=r=>qx(r,sX),FS=r=>qx(r,aA),Ag=r=>r.model.value.get(),ZO=(r,f)=>({x:r,y:f}),xp=(r,f)=>{Ao(r,jx(),{value:f})},rX=(r,f)=>{xp(r,ZO(lA(f),cA(f)))},iX=(r,f)=>{xp(r,cA(f))},aX=(r,f)=>{xp(r,ZO(ML(f),cA(f)))},lX=(r,f)=>{xp(r,ZO(uA(f),cA(f)))},dA=(r,f)=>{xp(r,uA(f))},cX=(r,f)=>{xp(r,ZO(uA(f),RL(f)))},uX=(r,f)=>{xp(r,ZO(uA(f),fA(f)))},fX=(r,f)=>{xp(r,fA(f))},IL=(r,f)=>{xp(r,ZO(ML(f),fA(f)))},dX=(r,f)=>{xp(r,ZO(lA(f),fA(f)))},hX=(r,f)=>{xp(r,lA(f))},mX=(r,f)=>{xp(r,ZO(lA(f),RL(f)))},hA=(r,f,g,v)=>r<f?r:r>g?g:r===f?f-1:Math.max(f,r-v),UM=(r,f,g,v)=>r>g?r:r<f?f:r===g?g+1:Math.min(g,r+v),BL=(r,f,g)=>Math.max(f,Math.min(g,r)),gX=(r,f,g,v,_)=>_.fold(()=>{const T=r-f,P=Math.round(T/v)*v;return BL(f+P,f-1,g+1)},T=>{const P=(r-T)%v,I=Math.round(P/v),W=Math.floor((r-T)/v),J=Math.floor((g-T)/v),ie=Math.min(J,W+I),de=T+ie*v;return Math.max(T,de)}),pX=(r,f,g)=>Math.min(g,Math.max(r,f))-f,LL=r=>{const{min:f,max:g,range:v,value:_,step:T,snap:P,snapStart:I,rounded:W,hasMinEdge:J,hasMaxEdge:ie,minBound:de,maxBound:ge,screenRange:_e}=r,Ie=J?f-1:f,it=ie?g+1:g;if(_<de)return Ie;if(_>ge)return it;{const Qt=pX(_,de,ge),dt=BL(Qt/_e*v+f,Ie,it);return P&&dt>=f&&dt<=g?gX(dt,f,g,T,I):W?Math.round(dt):dt}},YM=r=>{const{min:f,max:g,range:v,value:_,hasMinEdge:T,hasMaxEdge:P,maxBound:I,maxOffset:W,centerMinEdge:J,centerMaxEdge:ie}=r;return _<f?T?0:J:_>g?P?I:ie:(_-f)/v*W},mA="top",FL="right",QL="bottom",XM="left",bX="width",vX="height",y1=r=>r.element.dom.getBoundingClientRect(),bd=(r,f)=>r[f],gA=r=>{const f=y1(r);return bd(f,XM)},ZL=r=>{const f=y1(r);return bd(f,FL)},pA=r=>{const f=y1(r);return bd(f,mA)},Kx=r=>{const f=y1(r);return bd(f,QL)},km=r=>{const f=y1(r);return bd(f,bX)},bA=r=>{const f=y1(r);return bd(f,vX)},jM=(r,f,g)=>(r+f)/2-g,HL=(r,f)=>{const g=y1(r),v=y1(f),_=bd(g,XM),T=bd(g,FL),P=bd(v,XM);return jM(_,T,P)},zL=(r,f)=>{const g=y1(r),v=y1(f),_=bd(g,mA),T=bd(g,QL),P=bd(v,mA);return jM(_,T,P)},vA=(r,f)=>{Ao(r,jx(),{value:f})},qM=(r,f,g)=>{const v={min:LO(f),max:cw(f),range:zM(f),value:g,step:fw(f),snap:dw(f),snapStart:QO(f),rounded:$L(f),hasMinEdge:WM(f),hasMaxEdge:Gx(f),minBound:gA(r),maxBound:ZL(r),screenRange:km(r)};return LL(v)},VL=(r,f,g)=>{const v=qM(r,f,g);return vA(r,v),v},WL=(r,f)=>{const g=LO(f);vA(r,g)},OX=(r,f)=>{const g=cw(f);vA(r,g)},yX=(r,f,g)=>{const _=(r>0?UM:hA)(Ag(g),LO(g),cw(g),fw(g));return vA(f,_),V.some(_)},GM=r=>(f,g)=>yX(r,f,g).map(ot),wX=r=>HM(r).map(g=>g.left),UL=(r,f,g,v,_)=>{const P=km(r),I=v.bind(ie=>V.some(HL(ie,r))).getOr(0),W=_.bind(ie=>V.some(HL(ie,r))).getOr(P),J={min:LO(f),max:cw(f),range:zM(f),value:g,hasMinEdge:WM(f),hasMaxEdge:Gx(f),minBound:gA(r),minOffset:0,maxBound:ZL(r),maxOffset:P,centerMinEdge:I,centerMaxEdge:W};return YM(J)},OA=(r,f,g,v,_,T)=>{const P=UL(f,T,g,v,_);return gA(f)-gA(r)+P},YL=(r,f,g,v)=>{const _=Ag(g),T=OA(r,v.getSpectrum(r),_,v.getLeftEdge(r),v.getRightEdge(r),g),P=ta(f.element)/2;ro(f.element,"left",T-P+"px")},_X=GM(-1),SX=GM(1),CX=V.none,kX=V.none,xX={"top-left":V.none(),top:V.none(),"top-right":V.none(),right:V.some(dA),"bottom-right":V.none(),bottom:V.none(),"bottom-left":V.none(),left:V.some(hX)};var TX=Object.freeze({__proto__:null,setValueFrom:VL,setToMin:WL,setToMax:OX,findValueOfOffset:qM,getValueFromEvent:wX,findPositionOfValue:OA,setPositionFromValue:YL,onLeft:_X,onRight:SX,onUp:CX,onDown:kX,edgeActions:xX});const QS=(r,f)=>{Ao(r,jx(),{value:f})},KM=(r,f,g)=>{const v={min:FO(f),max:uw(f),range:VM(f),value:g,step:fw(f),snap:dw(f),snapStart:QO(f),rounded:$L(f),hasMinEdge:NL(f),hasMaxEdge:FS(f),minBound:pA(r),maxBound:Kx(r),screenRange:bA(r)};return LL(v)},XL=(r,f,g)=>{const v=KM(r,f,g);return QS(r,v),v},EX=(r,f)=>{const g=FO(f);QS(r,g)},AX=(r,f)=>{const g=uw(f);QS(r,g)},DX=(r,f,g)=>{const _=(r>0?UM:hA)(Ag(g),FO(g),uw(g),fw(g));return QS(f,_),V.some(_)},jL=r=>(f,g)=>DX(r,f,g).map(ot),PX=r=>HM(r).map(g=>g.top),MX=(r,f,g,v,_)=>{const P=bA(r),I=v.bind(ie=>V.some(zL(ie,r))).getOr(0),W=_.bind(ie=>V.some(zL(ie,r))).getOr(P),J={min:FO(f),max:uw(f),range:VM(f),value:g,hasMinEdge:NL(f),hasMaxEdge:FS(f),minBound:pA(r),minOffset:0,maxBound:Kx(r),maxOffset:P,centerMinEdge:I,centerMaxEdge:W};return YM(J)},JM=(r,f,g,v,_,T)=>{const P=MX(f,T,g,v,_);return pA(f)-pA(r)+P},qL=(r,f,g,v)=>{const _=Ag(g),T=JM(r,v.getSpectrum(r),_,v.getTopEdge(r),v.getBottomEdge(r),g),P=Ii(f.element)/2;ro(f.element,"top",T-P+"px")},GL=V.none,RX=V.none,$X=jL(-1),NX=jL(1),IX={"top-left":V.none(),top:V.some(iX),"top-right":V.none(),right:V.none(),"bottom-right":V.none(),bottom:V.some(fX),"bottom-left":V.none(),left:V.none()};var BX=Object.freeze({__proto__:null,setValueFrom:XL,setToMin:EX,setToMax:AX,findValueOfOffset:KM,getValueFromEvent:PX,findPositionOfValue:JM,setPositionFromValue:qL,onLeft:GL,onRight:RX,onUp:$X,onDown:NX,edgeActions:IX});const Jx=(r,f)=>{Ao(r,jx(),{value:f})},eT=(r,f)=>({x:r,y:f}),KL=(r,f,g)=>{const v=qM(r,f,g.left),_=KM(r,f,g.top),T=eT(v,_);return Jx(r,T),T},eR=(r,f,g,v)=>{const _=r>0?UM:hA,T=f?Ag(v).x:_(Ag(v).x,LO(v),cw(v),fw(v)),P=f?_(Ag(v).y,FO(v),uw(v),fw(v)):Ag(v).y;return Jx(g,eT(T,P)),V.some(T)},yA=(r,f)=>(g,v)=>eR(r,f,g,v).map(ot),JL=(r,f)=>{const g=LO(f),v=FO(f);Jx(r,eT(g,v))},LX=(r,f)=>{const g=cw(f),v=uw(f);Jx(r,eT(g,v))},FX=r=>HM(r),QX=(r,f,g,v)=>{const _=Ag(g),T=OA(r,v.getSpectrum(r),_.x,v.getLeftEdge(r),v.getRightEdge(r),g),P=JM(r,v.getSpectrum(r),_.y,v.getTopEdge(r),v.getBottomEdge(r),g),I=ta(f.element)/2,W=Ii(f.element)/2;ro(f.element,"left",T-I+"px"),ro(f.element,"top",P-W+"px")},ZX=yA(-1,!1),tR=yA(1,!1),lv=yA(-1,!0),HX=yA(1,!0),tT={"top-left":V.some(rX),top:V.some(aX),"top-right":V.some(lX),right:V.some(cX),"bottom-right":V.some(uX),bottom:V.some(IL),"bottom-left":V.some(dX),left:V.some(mX)};var zX=Object.freeze({__proto__:null,setValueFrom:KL,setToMin:JL,setToMax:LX,getValueFromEvent:FX,setPositionFromValue:QX,onLeft:ZX,onRight:tR,onUp:lv,onDown:HX,edgeActions:tT});const nR=[xt("stepSize",1),xt("onChange",L),xt("onChoose",L),xt("onInit",L),xt("onDragStart",L),xt("onDragEnd",L),xt("snapToGrid",!1),xt("rounded",!0),Er("snapStart"),Kr("model",xl("mode",{x:[xt("minX",0),xt("maxX",100),ka("value",r=>Ho(r.mode.minX)),nn("getInitialValue"),Yi("manager",TX)],y:[xt("minY",0),xt("maxY",100),ka("value",r=>Ho(r.mode.minY)),nn("getInitialValue"),Yi("manager",BX)],xy:[xt("minX",0),xt("maxX",100),xt("minY",0),xt("maxY",100),ka("value",r=>Ho({x:r.mode.minX,y:r.mode.minY})),nn("getInitialValue"),Yi("manager",zX)]})),Wl("sliderBehaviours",[No,Gn]),ka("mouseIsDown",()=>Ho(!1))],Tp=wu({name:"Slider",configFields:nR,partFields:nX,factory:(r,f,g,v)=>{const _=Dt=>u1(Dt,r,"thumb"),T=Dt=>u1(Dt,r,"spectrum"),P=Dt=>Ri(Dt,r,"left-edge"),I=Dt=>Ri(Dt,r,"right-edge"),W=Dt=>Ri(Dt,r,"top-edge"),J=Dt=>Ri(Dt,r,"bottom-edge"),ie=r.model,de=ie.manager,ge=(Dt,kn)=>{de.setPositionFromValue(Dt,kn,r,{getLeftEdge:P,getRightEdge:I,getTopEdge:W,getBottomEdge:J,getSpectrum:T})},_e=(Dt,kn)=>{ie.value.set(kn);const pn=_(Dt);ge(Dt,pn)},Ie=(Dt,kn)=>{_e(Dt,kn);const pn=_(Dt);return r.onChange(Dt,pn,kn),V.some(!0)},it=Dt=>{de.setToMin(Dt,r)},Qt=Dt=>{de.setToMax(Dt,r)},dt=Dt=>{const kn=()=>{Ri(Dt,r,"thumb").each(Nn=>{const jn=ie.value.get();r.onChoose(Dt,Nn,jn)})},pn=r.mouseIsDown.get();r.mouseIsDown.set(!1),pn&&kn()},ft=(Dt,kn)=>{kn.stop(),r.mouseIsDown.set(!0),r.onDragStart(Dt,_(Dt))},Yt=(Dt,kn)=>{kn.stop(),r.onDragEnd(Dt,_(Dt)),dt(Dt)};return{uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.sliderBehaviours,[No.config({mode:"special",focusIn:Dt=>Ri(Dt,r,"spectrum").map(No.focusIn).map(ot)}),Gn.config({store:{mode:"manual",getValue:Dt=>ie.value.get(),setValue:_e}}),Pc.config({channels:{[Hk()]:{onReceive:dt}}})]),events:li([on(jx(),(Dt,kn)=>{Ie(Dt,kn.event.value)}),Ci((Dt,kn)=>{const pn=ie.getInitialValue();ie.value.set(pn);const Nn=_(Dt);ge(Dt,Nn);const jn=T(Dt);r.onInit(Dt,Nn,jn,ie.value.get())}),on(uu(),ft),on(Jm(),Yt),on(Fr(),ft),on(eb(),Yt)]),apis:{resetToMin:it,resetToMax:Qt,setValue:_e,refresh:ge},domModification:{styles:{position:"relative"}}}},apis:{setValue:(r,f,g)=>{r.setValue(f,g)},resetToMin:(r,f)=>{r.resetToMin(f)},resetToMax:(r,f)=>{r.resetToMax(f)},refresh:(r,f)=>{r.refresh(f)}}}),oR=io("rgb-hex-update"),sR=io("slider-update"),e7=io("palette-update"),rR=(r,f)=>{const g=Tp.parts.spectrum({dom:{tag:"div",classes:[f("hue-slider-spectrum")],attributes:{role:"presentation"}}}),v=Tp.parts.thumb({dom:{tag:"div",classes:[f("hue-slider-thumb")],attributes:{role:"presentation"}}});return Tp.sketch({dom:{tag:"div",classes:[f("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:G(0)},components:[g,v],sliderBehaviours:Tn([ns.config({})]),onChange:(_,T,P)=>{Ao(_,sR,{value:P})}})},wA="form",iR=[Wl("formBehaviours",[Gn])],t7=r=>"<alloy.field."+r+">",xm=r=>{const f=(()=>{const T=[];return{field:(I,W)=>(T.push(I),WE(wA,t7(I),W)),record:G(T)}})(),g=r(f),v=f.record(),_=je(v,T=>Gc({name:T,pname:t7(T)}));return ix(wA,iR,_,WX,g)},VX=(r,f)=>r.fold(()=>wn.error(f),wn.value),WX=(r,f)=>({uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.formBehaviours,[Gn.config({store:{mode:"manual",getValue:g=>{const v=sx(g,r);return Ns(v,(_,T)=>_().bind(P=>{const I=cr.getCurrent(P);return VX(I,new Error(`Cannot find a current component to extract the value from for form part '${T}': `+El(P.element)))}).map(Gn.getValue))},setValue:(g,v)=>{dr(v,(_,T)=>{Ri(g,r,T).each(P=>{cr.getCurrent(P).each(I=>{Gn.setValue(I,_)})})})}}})]),apis:{getField:(g,v)=>Ri(g,r,v).bind(cr.getCurrent)}}),hw={getField:ap((r,f,g)=>r.getField(f,g)),sketch:xm},aR=io("valid-input"),n7=io("invalid-input"),o7=io("validating-input"),lR="colorcustom.rgb.",UX=(r,f,g,v)=>{const _=(ge,_e)=>O1.config({invalidClass:f("invalid"),notify:{onValidate:Ie=>{Ao(Ie,o7,{type:ge})},onValid:Ie=>{Ao(Ie,aR,{type:ge,value:Gn.getValue(Ie)})},onInvalid:Ie=>{Ao(Ie,n7,{type:ge,value:Gn.getValue(Ie)})}},validator:{validate:Ie=>{const it=Gn.getValue(Ie),Qt=_e(it)?wn.value(!0):wn.error(r("aria.input.invalid"));return Yu.pure(Qt)},validateOnLoad:!1}}),T=(ge,_e,Ie,it,Qt)=>{const dt=r(lR+"range"),ft=si.parts.label({dom:{tag:"label",attributes:{"aria-label":it}},components:[Li(Ie)]}),Yt=si.parts.field({data:Qt,factory:K2,inputAttributes:{type:"text",..._e==="hex"?{"aria-live":"polite"}:{}},inputClasses:[f("textfield")],inputBehaviours:Tn([_(_e,ge),Ka.config({})]),onSetValue:Nn=>{O1.isInvalid(Nn)&&O1.run(Nn).get(L)}}),Dt=[ft,Yt],kn=_e!=="hex"?[si.parts["aria-descriptor"]({text:dt})]:[],pn=Dt.concat(kn);return{dom:{tag:"div",attributes:{role:"presentation"}},components:pn}},P=(ge,_e)=>{const Ie=rw(_e);return hw.getField(ge,"hex").each(it=>{ns.isFocused(it)||Gn.setValue(ge,{hex:Ie.value})}),Ie},I=(ge,_e)=>{const Ie=_e.red,it=_e.green,Qt=_e.blue;Gn.setValue(ge,{red:Ie,green:it,blue:Qt})},W=oi({dom:{tag:"div",classes:[f("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),J=(ge,_e)=>{W.getOpt(ge).each(Ie=>{ro(Ie.element,"background-color","#"+_e.value)})};return Kc({factory:()=>{const ge={red:Ho(V.some(255)),green:Ho(V.some(255)),blue:Ho(V.some(255)),hex:Ho(V.some("ffffff"))},_e=(hs,vr)=>{const Qo=Hx(vr);I(hs,Qo),dt(Qo)},Ie=hs=>ge[hs].get(),it=(hs,vr)=>{ge[hs].set(vr)},Qt=()=>Ie("red").bind(hs=>Ie("green").bind(vr=>Ie("blue").map(Qo=>NO(hs,vr,Qo,1)))),dt=hs=>{const vr=hs.red,Qo=hs.green,fr=hs.blue;it("red",V.some(vr)),it("green",V.some(Qo)),it("blue",V.some(fr))},ft=(hs,vr)=>{const Qo=vr.event;Qo.type!=="hex"?it(Qo.type,V.none()):v(hs)},Yt=(hs,vr)=>{g(hs);const Qo=k8(vr);it("hex",V.some(Qo.value));const fr=Hx(Qo);I(hs,fr),dt(fr),Ao(hs,oR,{hex:Qo}),J(hs,Qo)},Dt=(hs,vr,Qo)=>{const fr=parseInt(Qo,10);it(vr,V.some(fr)),Qt().each(Qn=>{const _o=P(hs,Qn);Ao(hs,oR,{hex:_o}),J(hs,_o)})},kn=hs=>hs.type==="hex",pn=(hs,vr)=>{const Qo=vr.event;kn(Qo)?Yt(hs,Qo.value):Dt(hs,Qo.type,Qo.value)},Nn=hs=>({label:r(lR+hs+".label"),description:r(lR+hs+".description")}),jn=Nn("red"),Ys=Nn("green"),ko=Nn("blue"),_s=Nn("hex");return ni(hw.sketch(hs=>({dom:{tag:"form",classes:[f("rgb-form")],attributes:{"aria-label":r("aria.color.picker")}},components:[hs.field("red",si.sketch(T(gd,"red",jn.label,jn.description,255))),hs.field("green",si.sketch(T(gd,"green",Ys.label,Ys.description,255))),hs.field("blue",si.sketch(T(gd,"blue",ko.label,ko.description,255))),hs.field("hex",si.sketch(T(x8,"hex",_s.label,_s.description,"ffffff"))),W.asSpec()],formBehaviours:Tn([O1.config({invalidClass:f("form-invalid")}),xs("rgb-form-events",[on(aR,pn),on(n7,ft),on(o7,ft)])])})),{apis:{updateHex:(hs,vr)=>{Gn.setValue(hs,{hex:vr.value}),_e(hs,vr),J(hs,vr)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(ge,_e,Ie)=>{ge.updateHex(_e,Ie)}},extraApis:{}})},YX=(r,f)=>{const g=Tp.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[f("sv-palette-spectrum")]}}),v=Tp.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[f("sv-palette-thumb")],innerHtml:`<div class=${f("sv-palette-inner-thumb")} role="presentation"></div>`}}),_=(J,ie)=>{const{width:de,height:ge}=J,_e=J.getContext("2d");if(_e===null)return;_e.fillStyle=ie,_e.fillRect(0,0,de,ge);const Ie=_e.createLinearGradient(0,0,de,0);Ie.addColorStop(0,"rgba(255,255,255,1)"),Ie.addColorStop(1,"rgba(255,255,255,0)"),_e.fillStyle=Ie,_e.fillRect(0,0,de,ge);const it=_e.createLinearGradient(0,0,0,ge);it.addColorStop(0,"rgba(0,0,0,0)"),it.addColorStop(1,"rgba(0,0,0,1)"),_e.fillStyle=it,_e.fillRect(0,0,de,ge)},T=(J,ie)=>{const de=J.components()[0].element.dom,ge=iw(ie,100,100),_e=p1(ge);_(de,X3(_e))},P=(J,ie)=>{const de=q3(Hx(ie));Tp.setValue(J,{x:de.saturation,y:100-de.value})};return Kc({factory:J=>{const ie=G({x:0,y:0}),de=(Ie,it,Qt)=>{Ao(Ie,e7,{value:Qt})},ge=(Ie,it,Qt,dt)=>{_(Qt.element.dom,X3(A8))},_e=Tn([cr.config({find:V.some}),ns.config({})]);return Tp.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[f("sv-palette")]},model:{mode:"xy",getInitialValue:ie},rounded:!1,components:[g,v],onChange:de,onInit:ge,sliderBehaviours:_e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(J,ie,de)=>{T(ie,de)},setThumb:(J,ie,de)=>{P(ie,de)}},extraApis:{}})},XX=(r,f)=>{const g=_=>{const T=UX(r,f,_.onValidHex,_.onInvalidHex),P=YX(r,f),I=pn=>(100-pn)/100*360,W=pn=>100-pn/360*100,J={paletteRgba:Ho(A8),paletteHue:Ho(0)},ie=oi(rR(r,f)),de=oi(P.sketch({})),ge=oi(T.sketch({})),_e=(pn,Nn,jn)=>{de.getOpt(pn).each(Ys=>{P.setHue(Ys,jn)})},Ie=(pn,Nn)=>{ge.getOpt(pn).each(jn=>{T.updateHex(jn,Nn)})},it=(pn,Nn,jn)=>{ie.getOpt(pn).each(Ys=>{Tp.setValue(Ys,W(jn))})},Qt=(pn,Nn)=>{de.getOpt(pn).each(jn=>{P.setThumb(jn,Nn)})},dt=(pn,Nn)=>{const jn=Hx(pn);J.paletteRgba.set(jn),J.paletteHue.set(Nn)},ft=(pn,Nn,jn,Ys)=>{dt(Nn,jn),mt(Ys,ko=>{ko(pn,Nn,jn)})},Yt=()=>{const pn=[Ie];return(Nn,jn)=>{const Ys=jn.event.value,ko=J.paletteHue.get(),_s=iw(ko,Ys.x,100-Ys.y),hs=$8(_s);ft(Nn,hs,ko,pn)}},Dt=()=>{const pn=[_e,Ie];return(Nn,jn)=>{const Ys=I(jn.event.value),ko=J.paletteRgba.get(),_s=q3(ko),hs=iw(Ys,_s.saturation,_s.value),vr=$8(hs);ft(Nn,vr,Ys,pn)}},kn=()=>{const pn=[_e,it,Qt];return(Nn,jn)=>{const Ys=jn.event.hex,ko=G3(Ys);ft(Nn,Ys,ko.hue,pn)}};return{uid:_.uid,dom:_.dom,components:[de.asSpec(),ie.asSpec(),ge.asSpec()],behaviours:Tn([xs("colour-picker-events",[on(oR,kn()),on(e7,Yt()),on(sR,Dt())]),cr.config({find:pn=>ge.getOpt(pn)}),No.config({mode:"acyclic"})])}};return Kc({name:"ColourPicker",configFields:[nn("dom"),xt("onValidHex",L),xt("onInvalidHex",L)],factory:g})},Ep={self:()=>cr.config({find:V.some}),memento:r=>cr.config({find:r.getOpt}),childAt:r=>cr.config({find:f=>Hc(f.element,r).bind(g=>f.getSystem().getByDom(g).toOptional())})},qX=fo([xt("preprocess",we),xt("postprocess",we)]),s7=(r,f)=>{const g=Es("RepresentingConfigs.memento processors",qX,f);return Gn.config({store:{mode:"manual",getValue:v=>{const _=r.get(v),T=Gn.getValue(_);return g.postprocess(T)},setValue:(v,_)=>{const T=g.preprocess(_),P=r.get(v);Gn.setValue(P,T)}}})},cv=(r,f,g)=>Gn.config({store:{mode:"manual",...r.map(v=>({initialValue:v})).getOr({}),getValue:f,setValue:g}}),r7=(r,f,g)=>cv(r,v=>f(v.element),(v,_)=>g(v.element,_)),cR=r=>r7(r,jp,vh),uv=r=>Gn.config({store:{mode:"memory",initialValue:r}}),i7={"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"},a7=r=>f=>r.translate(i7[f]),l7=(r,f,g)=>{const v=W=>"tox-"+W,_=XX(a7(f),v),T=W=>{Ao(W,Rb,{name:"hex-valid",value:!0})},P=W=>{Ao(W,Rb,{name:"hex-valid",value:!1})},I=oi(_.sketch({dom:{tag:"div",classes:[v("color-picker-container")],attributes:{role:"presentation"}},onValidHex:T,onInvalidHex:P}));return{dom:{tag:"div"},components:[I.asSpec()],behaviours:Tn([cv(g,W=>{const J=I.get(W);return cr.getCurrent(J).bind(ge=>Gn.getValue(ge).hex).map(ge=>"#"+kr(ge,"#")).getOr("")},(W,J)=>{const ie=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,de=V.from(ie.exec(J)).bind(Ie=>oo(Ie,1)),ge=I.get(W);cr.getCurrent(ge).fold(()=>{console.log("Can not find form")},Ie=>{Gn.setValue(Ie,{hex:de.getOr("")}),hw.getField(Ie,"hex").each(it=>{rr(it,om())})})}),Ep.self()])}};var GX=tinymce.util.Tools.resolve("tinymce.Resource");const KX=r=>vs(r,"init"),_A=r=>{const f=Xi(),g=oi({dom:{tag:r.tag}}),v=Xi();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Tn([xs("custom-editor-events",[Ci(_=>{g.getOpt(_).each(T=>{(KX(r)?r.init(T.element.dom):GX.load(r.scriptId,r.scriptUrl).then(P=>P(T.element.dom,r.settings))).then(P=>{v.on(I=>{P.setValue(I)}),v.clear(),f.set(P)})})})]),cv(V.none(),()=>f.get().fold(()=>v.get().getOr(""),_=>_.getValue()),(_,T)=>{f.get().fold(()=>v.set(T),P=>P.setValue(T))}),Ep.self()]),components:[g.asSpec()]}};var fv=tinymce.util.Tools.resolve("tinymce.util.Tools");const JX=(r,f)=>{const g=fv.explode(f.getOption("images_file_types")),v=_=>rn(g,T=>Zi(_.name.toLowerCase(),`.${T.toLowerCase()}`));return Kn($s(r),v)},c7=(r,f,g)=>{const v=(ge,_e)=>{_e.stop()},_=ge=>(_e,Ie)=>{mt(ge,it=>{it(_e,Ie)})},T=(ge,_e)=>{var Ie;if(!Jo.isDisabled(ge)){const it=_e.event.raw;I(ge,(Ie=it.dataTransfer)===null||Ie===void 0?void 0:Ie.files)}},P=(ge,_e)=>{const Ie=_e.event.raw.target;I(ge,Ie.files)},I=(ge,_e)=>{_e&&(Gn.setValue(ge,JX(_e,f)),Ao(ge,Ih,{name:r.name}))},W=oi({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Tn([xs("input-file-events",[am(sm()),am(tb())])])}),J=ge=>({uid:ge.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Tn([uv(g.getOr([])),Ep.self(),Jo.config({}),Ms.config({toggleClass:"dragenter",toggleOnExecute:!1}),xs("dropzone-events",[on("dragenter",_([v,Ms.toggle])),on("dragleave",_([v,Ms.toggle])),on("dragover",v),on("drop",_([v,T])),on(Kg(),P)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Li(f.translate("Drop an image here"))]},Jc.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Li(f.translate("Browse for an image")),W.asSpec()],action:_e=>{W.get(_e).element.dom.click()},buttonBehaviours:Tn([Ka.config({}),xg.button(f.isDisabled),rc()])})]}]}),ie=r.label.map(ge=>iv(ge,f)),de=si.parts.field({factory:{sketch:J}});return Ux(ie,de,["tox-form__group--stretched"],[])},u7=(r,f)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${r.columns}col`]},components:je(r.items,f.interpreter)}),uR=(r,f)=>{let g=null,v=null;return{cancel:()=>{C(g)||(clearTimeout(g),g=null,v=null)},throttle:(...P)=>{v=P,C(g)&&(g=setTimeout(()=>{const I=v;g=null,v=null,r.apply(null,I)},f))}}},f7=(r,f)=>{let g=null;return{cancel:()=>{C(g)||(clearTimeout(g),g=null)},throttle:(...T)=>{C(g)&&(g=setTimeout(()=>{g=null,r.apply(null,T)},f))}}},yf=(r,f)=>{let g=null;const v=()=>{C(g)||(clearTimeout(g),g=null)};return{cancel:v,throttle:(...T)=>{v(),g=setTimeout(()=>{g=null,r.apply(null,T)},f)}}},SA=io("alloy-fake-before-tabstop"),fR=io("alloy-fake-after-tabstop"),d7=r=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:r},behaviours:Tn([ns.config({ignore:!0}),Ka.config({})])}),dR=(r,f)=>({dom:{tag:"div",classes:["tox-navobj",...r.getOr([])]},components:[d7([SA]),f,d7([fR])],behaviours:Tn([Ep.childAt(1)])}),h7=(r,f)=>{Ao(r,If(),{raw:{which:9,shiftKey:f}})},ej=(r,f)=>{const g=f.element;uf(g,SA)?h7(r,!0):uf(g,fR)&&h7(r,!1)},nT=r=>IS(r,["."+SA,"."+fR].join(","),tt),CA=io("update-dialog"),w1=io("update-title"),kA=io("update-body"),hR=io("update-footer"),oT=io("body-send-message"),ZS=io("dialog-focus-shifted"),mR=an().browser,sT=mR.isSafari(),tj=mR.isFirefox(),m7=sT||tj,nj=mR.isChromium(),oj=({scrollTop:r,scrollHeight:f,clientHeight:g})=>Math.ceil(r)+g>=f,g7=(r,f)=>r.scrollTo(0,f==="bottom"?99999999:f),p7=(r,f)=>{const g=r.body;return V.from(!/^<!DOCTYPE (html|HTML)/.test(f)&&(!nj&&!sT||Q(g)&&(g.scrollTop!==0||Math.abs(g.scrollHeight-g.clientHeight)>1))?g:r.documentElement)},b7=(r,f,g)=>{const v=r.dom;V.from(v.contentDocument).fold(g,_=>{let T=0;const P=p7(_,f).map(W=>(T=W.scrollTop,W)).forall(oj),I=()=>{const W=v.contentWindow;Q(W)&&(P?g7(W,"bottom"):!P&&m7&&T!==0&&g7(W,T))};sT&&v.addEventListener("load",I,{once:!0}),_.open(),_.write(f),_.close(),sT||I()})},xA=fn(m7,sT?500:200).map(r=>uR(b7,r)),sj=(r,f)=>{const g=Ho(r.getOr(""));return{getValue:v=>g.get(),setValue:(v,_)=>{if(g.get()!==_){const T=v.element,P=()=>qn(T,"srcdoc",_);f?xA.fold(G(b7),I=>I.throttle)(T,_,P):P()}g.set(_)}}},rj=(r,f,g)=>{const v="tox-dialog__iframe",_=r.transparent?[]:[`${v}--opaque`],T=r.border?["tox-navobj-bordered"]:[],P={...r.label.map(de=>({title:de})).getOr({}),...g.map(de=>({srcdoc:de})).getOr({}),...r.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},I=sj(g,r.streamContent),W=r.label.map(de=>iv(de,f)),J=de=>dR(V.from(T),{uid:de.uid,dom:{tag:"iframe",attributes:P,classes:[v,..._]},behaviours:Tn([Ka.config({}),ns.config({}),cv(g,I.getValue,I.setValue),Pc.config({channels:{[ZS]:{onReceive:(ge,_e)=>{_e.newFocus.each(Ie=>{xc(ge.element).each(it=>{(xr(ge.element,Ie)?Na:va)(it,"tox-navobj-bordered-focus")})})}}}})])}),ie=si.parts.field({factory:{sketch:J}});return Ux(W,ie,["tox-form__group--stretched"],[])},v7=r=>new Promise((f,g)=>{const v=()=>{T(),f(r)},_=[Mc(r,"load",v),Mc(r,"error",()=>{T(),g("Unable to load data from image: "+r.dom.src)})],T=()=>mt(_,P=>P.unbind());r.dom.complete&&v()}),O7=(r,f,g,v,_)=>{const T=g*_,P=v*_,I=Math.max(0,r/2-T/2),W=Math.max(0,f/2-P/2);return{left:I.toString()+"px",top:W.toString()+"px",width:T.toString()+"px",height:P.toString()+"px"}},gR=(r,f,g)=>{const v=ta(r),_=Ii(r);return Math.min(v/f,_/g,1)},TA=(r,f)=>{const g=Ho(f.getOr({url:""})),v=oi({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:f.map(W=>({src:W.url})).getOr({})}}),_=oi({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[v.asSpec()]}),T=(W,J)=>{const ie={url:J.url};J.zoom.each(ge=>ie.zoom=ge),J.cachedWidth.each(ge=>ie.cachedWidth=ge),J.cachedHeight.each(ge=>ie.cachedHeight=ge),g.set(ie);const de=()=>{const{cachedWidth:ge,cachedHeight:_e,zoom:Ie}=ie;if(!R(ge)&&!R(_e)){if(R(Ie)){const Qt=gR(W.element,ge,_e);ie.zoom=Qt}const it=O7(ta(W.element),Ii(W.element),ge,_e,ie.zoom);_.getOpt(W).each(Qt=>{yi(Qt.element,it)})}};v.getOpt(W).each(ge=>{const _e=ge.element;J.url!==zi(_e,"src")&&(qn(_e,"src",J.url),va(W.element,"tox-imagepreview__loaded")),de(),v7(_e).then(Ie=>{W.getSystem().isConnected()&&(Na(W.element,"tox-imagepreview__loaded"),ie.cachedWidth=Ie.dom.naturalWidth,ie.cachedHeight=Ie.dom.naturalHeight,de())})})},P={};r.height.each(W=>P.height=W);const I=f.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:P,attributes:{role:"presentation"}},components:[_.asSpec()],behaviours:Tn([Ep.self(),cv(I,()=>g.get(),T)])}},rT=(r,f)=>{const g="tox-label",v=r.align==="center"?[`${g}--center`]:[],_=r.align==="end"?[`${g}--end`]:[],T={dom:{tag:"label",classes:[g,...v,..._]},components:[Li(f.providers.translate(r.label))]},P=je(r.items,f.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[T,...P],behaviours:Tn([Ep.self(),gs.config({}),cR(V.none()),No.config({mode:"acyclic"})])}},HS=io("toolbar.button.execute"),y7=r=>hu((f,g)=>{Lx(r,f)(v=>{Ao(f,HS,{buttonApi:v}),r.onAction(v)})}),HO=io("common-button-display-events"),pR={[af()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],[Lu()]:["toolbar-button-events",HO],[Fr()]:["focusing","alloy.base.behaviour",HO]},EA=r=>ro(r.element,"width",Gr(r.element,"width")),w7=(r,f,g)=>Sp(r,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:g},f),bR=(r,f)=>w7(r,f,[]),zO=(r,f)=>w7(r,f,[gs.config({})]),_7=(r,f,g)=>({dom:{tag:"span",classes:[`${f}__select-label`]},components:[Li(g.translate(r))],behaviours:Tn([gs.config({})])}),Dg=io("update-menu-text"),VO=io("update-menu-icon"),AA=(r,f,g)=>{const v=Ho(L),_=r.text.map(ge=>oi(_7(ge,f,g.providers))),T=r.icon.map(ge=>oi(zO(ge,g.providers.icons))),P=(ge,_e)=>{const Ie=Gn.getValue(ge);return ns.focus(Ie),Ao(Ie,"keydown",{raw:_e.event.raw}),Eg.close(Ie),V.some(!0)},I=r.role.fold(()=>({}),ge=>({role:ge})),W=r.tooltip.fold(()=>({}),ge=>{const _e=g.providers.translate(ge);return{title:_e,"aria-label":_e}}),J=Sp("chevron-down",{tag:"div",classes:[`${f}__select-chevron`]},g.providers.icons),ie=io("common-button-display-events");return oi(Eg.sketch({...r.uid?{uid:r.uid}:{},...I,dom:{tag:"button",classes:[f,`${f}--select`].concat(je(r.classes,ge=>`${f}--${ge}`)),attributes:{...W}},components:PS([T.map(ge=>ge.asSpec()),_.map(ge=>ge.asSpec()),V.some(J)]),matchWidth:!0,useMinWidth:!0,onOpen:(ge,_e,Ie)=>{r.searchable&&RM(Ie)},dropdownBehaviours:Tn([...r.dropdownBehaviours,xg.button(()=>r.disabled||g.providers.isDisabled()),rc(),Xx.config({}),gs.config({}),xs("dropdown-events",[nv(r,v),ov(r,v)]),xs(ie,[Ci((ge,_e)=>EA(ge))]),xs("menubutton-update-display-text",[on(Dg,(ge,_e)=>{_.bind(Ie=>Ie.getOpt(ge)).each(Ie=>{gs.set(Ie,[Li(g.providers.translate(_e.event.text))])})}),on(VO,(ge,_e)=>{T.bind(Ie=>Ie.getOpt(ge)).each(Ie=>{gs.set(Ie,[zO(_e.event.icon,g.providers.icons)])})})])]),eventOrder:ni(pR,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Lu()]:["toolbar-button-events","dropdown-events",ie]}),sandboxBehaviours:Tn([No.config({mode:"special",onLeft:P,onRight:P}),xs("dropdown-sandbox-events",[on(QB,(ge,_e)=>{oA(ge),_e.stop()}),on(ZB,(ge,_e)=>{PM(ge,_e),_e.stop()})])]),lazySink:g.getSink,toggleClass:`${f}--active`,parts:{menu:{...xS(!1,r.columns,r.presets),fakeFocus:r.searchable,onHighlightItem:aL,onCollapseMenu:(ge,_e,Ie)=>{Nr.getHighlighted(Ie).each(it=>{aL(ge,Ie,it)})},onDehighlightItem:mY}},getAnchorOverrides:()=>({maxHeightFunction:(ge,_e)=>{oO()(ge,_e-10)}}),fetch:ge=>Yu.nu(Re(r.fetch,ge))})).asSpec()},ij=r=>d(r),vR=r=>r.type==="separator",aj=r=>vs(r,"getSubmenuItems"),S7={type:"separator"},iT=(r,f)=>{const g=Yo(r,(v,_)=>ij(_)?_===""?v:_==="|"?v.length>0&&!vR(v[v.length-1])?v.concat([S7]):v:vs(f,_.toLowerCase())?v.concat([f[_.toLowerCase()]]):v:v.concat([_]),[]);return g.length>0&&vR(g[g.length-1])&&g.pop(),g},lj=(r,f)=>{const g=r.getSubmenuItems(),v=k7(g,f),_=ni(v.menus,{[r.value]:v.items}),T=ni(v.expansions,{[r.value]:r.value});return{item:r,menus:_,expansions:T}},C7=r=>{const f=ln(r,"value").getOrThunk(()=>io("generated-menu-item"));return ni({value:f},r)},k7=(r,f)=>{const g=iT(d(r)?r.split(" "):r,f);return so(g,(v,_)=>{if(aj(_)){const T=C7(_),P=lj(T,f);return{menus:ni(v.menus,P.menus),items:[P.item,...v.items],expansions:ni(v.expansions,P.expansions)}}else return{...v,items:[_,...v.items]}},{menus:{},expansions:{},items:[]})},cj=r=>r.search.fold(()=>({searchMode:"no-search"}),f=>({searchMode:"search-with-field",placeholder:f.placeholder})),uj=r=>r.search.fold(()=>({searchMode:"no-search"}),f=>({searchMode:"search-with-results"})),zS=(r,f,g,v)=>{const _=io("primary-menu"),T=k7(r,g.shared.providers.menuItems());if(T.items.length===0)return V.none();const P=cj(v),I=cL(_,T.items,f,g,v.isHorizontalMenu,P),W=uj(v),J=Ns(T.menus,(de,ge)=>cL(ge,de,f,g,!1,W)),ie=ni(J,In(_,I));return V.from(X2.tieredData(_,ie,T.expansions))},DA=r=>!vs(r,"items"),x7="data-value",OR=(r,f,g,v)=>je(g,_=>DA(_)?{type:"togglemenuitem",text:_.text,value:_.value,active:_.value===v,onAction:()=>{Gn.setValue(r,_.value),Ao(r,Ih,{name:f}),ns.focus(r)}}:{type:"nestedmenuitem",text:_.text,getSubmenuItems:()=>OR(r,f,_.items,v)}),aT=(r,f)=>tr(r,g=>DA(g)?fn(g.value===f,g):aT(g.items,f)),hv=(r,f,g)=>{const v=f.shared.providers,_=g.bind(W=>aT(r.items,W)).orThunk(()=>Ss(r.items).filter(DA)),T=r.label.map(W=>iv(W,v)),P=si.parts.field({dom:{},factory:{sketch:W=>AA({uid:W.uid,text:_.map(J=>J.text),icon:V.none(),tooltip:r.label,role:V.none(),fetch:(J,ie)=>{const de=OR(J,r.name,r.items,Gn.getValue(J));ie(zS(de,Cp.CLOSE_ON_EXECUTE,f,{isHorizontalMenu:!1,search:V.none()}))},onSetup:G(L),getApi:G({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Ka.config({}),cv(_.map(J=>J.value),J=>zi(J.element,x7),(J,ie)=>{aT(r.items,ie).each(de=>{qn(J.element,x7,de.value),Ao(J,Dg,{text:de.text})})})]},"tox-listbox",f.shared)}}),I={dom:{tag:"div",classes:["tox-listboxfield"]},components:[P]};return si.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:pt([T.toArray(),[I]]),fieldBehaviours:Tn([Jo.config({disabled:G(!r.enabled),onDisabled:W=>{si.getField(W).each(Jo.disable)},onEnabled:W=>{si.getField(W).each(Jo.enable)}})])})},yR=(r,f)=>({dom:{tag:"div",classes:r.classes},components:je(r.items,f.shared.interpreter)}),T7=(r,f)=>{const g=je(r.options,_=>({dom:{tag:"option",value:_.value,innerHtml:_.text}})),v=r.data.map(_=>In("initialValue",_)).getOr({});return{uid:r.uid,dom:{tag:"select",classes:r.selectClasses,attributes:r.selectAttributes},components:g,behaviours:sc(r.selectBehaviours,[ns.config({}),Gn.config({store:{mode:"manual",getValue:_=>Ia(_.element),setValue:(_,T)=>{const P=Ss(r.options);kt(r.options,W=>W.value===T).isSome()?Ta(_.element,T):_.element.dom.selectedIndex===-1&&T===""&&P.each(W=>Ta(_.element,W.value))},...v}})])}},E7=Kc({name:"HtmlSelect",configFields:[nn("options"),Wl("selectBehaviours",[ns,Gn]),xt("selectClasses",[]),xt("selectAttributes",{}),Er("data")],factory:T7}),wR=(r,f,g)=>{const v=je(r.items,W=>({text:f.translate(W.text),value:W.value})),_=r.label.map(W=>iv(W,f)),T=si.parts.field({dom:{},...g.map(W=>({data:W})).getOr({}),selectAttributes:{size:r.size},options:v,factory:E7,selectBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled()}),Ka.config({}),xs("selectbox-change",[on(Kg(),(W,J)=>{Ao(W,Ih,{name:r.name})})])])}),P=r.size>1?V.none():V.some(Sp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},f.icons)),I={dom:{tag:"div",classes:["tox-selectfield"]},components:pt([[T],P.toArray()])};return si.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:pt([_.toArray(),[I]]),fieldBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled(),onDisabled:W=>{si.getField(W).each(Jo.disable)},onEnabled:W=>{si.getField(W).each(Jo.enable)}}),rc()])})},A7=G([xt("field1Name","field1"),xt("field2Name","field2"),hg("onLockedChange"),hf(["lockClass"]),xt("locked",!1),ym.field("coupledFieldBehaviours",[cr,Gn])]),PA=(r,f,g)=>Ri(r,f,g).bind(cr.getCurrent),_R=(r,f)=>Gc({factory:si,name:r,overrides:g=>({fieldBehaviours:Tn([xs("coupled-input-behaviour",[on(om(),v=>{PA(v,g,f).each(_=>{Ri(v,g,"lock").each(T=>{Ms.isOn(T)&&g.onLockedChange(v,_,T)})})})])])})}),D7=G([_R("field1","field2"),_R("field2","field1"),Gc({factory:Jc,schema:[nn("dom")],name:"lock",overrides:r=>({buttonBehaviours:Tn([Ms.config({selected:r.locked,toggleClass:r.markers.lockClass,aria:{mode:"pressed"}})])})})]),fj=(r,f,g,v)=>({uid:r.uid,dom:r.dom,components:f,behaviours:ym.augment(r.coupledFieldBehaviours,[cr.config({find:V.some}),Gn.config({store:{mode:"manual",getValue:_=>{const T=rx(_,r,["field1","field2"]);return{[r.field1Name]:Gn.getValue(T.field1()),[r.field2Name]:Gn.getValue(T.field2())}},setValue:(_,T)=>{const P=rx(_,r,["field1","field2"]);Qi(T,r.field1Name)&&Gn.setValue(P.field1(),T[r.field1Name]),Qi(T,r.field2Name)&&Gn.setValue(P.field2(),T[r.field2Name])}}})]),apis:{getField1:_=>Ri(_,r,"field1"),getField2:_=>Ri(_,r,"field2"),getLock:_=>Ri(_,r,"lock")}}),Tm=wu({name:"FormCoupledInputs",configFields:A7(),partFields:D7(),factory:fj,apis:{getField1:(r,f)=>r.getField1(f),getField2:(r,f)=>r.getField2(f),getLock:(r,f)=>r.getLock(f)}}),dj=r=>{const f={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},g=_=>_ in f?f[_]:1;let v=r.value.toFixed(g(r.unit));return v.indexOf(".")!==-1&&(v=v.replace(/\.?0*$/,"")),v+r.unit},SR=r=>{const g=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(r);if(g!==null){const v=parseFloat(g[1]),_=g[2];return wn.value({value:v,unit:_})}else return wn.error(r)},P7=(r,f)=>{const g={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},v=_=>vs(g,_);return r.unit===f?V.some(r.value):v(r.unit)&&v(f)?g[r.unit]===g[f]?V.some(r.value):V.some(r.value/g[r.unit]*g[f]):V.none()},MA=r=>V.none(),M7=(r,f)=>g=>P7(g,f).map(v=>({value:v*r,unit:f})),hj=(r,f)=>{const g=SR(r).toOptional(),v=SR(f).toOptional();return Yn(g,v,(_,T)=>P7(_,T.unit).map(P=>T.value/P).map(P=>M7(P,T.unit)).getOr(MA)).getOr(MA)},mj=(r,f)=>{let g=MA;const v=io("ratio-event"),_=de=>Sp(de,{tag:"span",classes:["tox-icon","tox-lock-icon__"+de]},f.icons),T=Tm.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:f.translate(r.label.getOr("Constrain proportions"))}},components:[_("lock"),_("unlock")],buttonBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled()}),rc(),Ka.config({})])}),P=de=>({dom:{tag:"div",classes:["tox-form__group"]},components:de}),I=de=>si.parts.field({factory:K2,inputClasses:["tox-textfield"],inputBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled()}),rc(),Ka.config({}),xs("size-input-events",[on(Gi(),(ge,_e)=>{Ao(ge,v,{isField1:de})}),on(Kg(),(ge,_e)=>{Ao(ge,Ih,{name:r.name})})])]),selectOnFocus:!1}),W=de=>({dom:{tag:"label",classes:["tox-label"]},components:[Li(f.translate(de))]}),J=Tm.parts.field1(P([si.parts.label(W("Width")),I(!0)])),ie=Tm.parts.field2(P([si.parts.label(W("Height")),I(!1)]));return Tm.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[J,ie,P([W(z_),T])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(de,ge,_e)=>{SR(Gn.getValue(de)).each(Ie=>{g(Ie).each(it=>{Gn.setValue(ge,dj(it))})})},coupledFieldBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled(),onDisabled:de=>{Tm.getField1(de).bind(si.getField).each(Jo.disable),Tm.getField2(de).bind(si.getField).each(Jo.disable),Tm.getLock(de).each(Jo.disable)},onEnabled:de=>{Tm.getField1(de).bind(si.getField).each(Jo.enable),Tm.getField2(de).bind(si.getField).each(Jo.enable),Tm.getLock(de).each(Jo.enable)}}),rc(),xs("size-input-events2",[on(v,(de,ge)=>{const _e=ge.event.isField1,Ie=_e?Tm.getField1(de):Tm.getField2(de),it=_e?Tm.getField2(de):Tm.getField1(de),Qt=Ie.map(Gn.getValue).getOr(""),dt=it.map(Gn.getValue).getOr("");g=hj(Qt,dt)})])])})},gj=(r,f,g)=>{const v=Tp.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Li(f.translate(r.label))]}),_=Tp.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),T=Tp.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Tp.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r.min,maxX:r.max,getInitialValue:G(g.getOrThunk(()=>(Math.abs(r.max)-Math.abs(r.min))/2))},components:[v,_,T],sliderBehaviours:Tn([Ep.self(),ns.config({})]),onChoose:(P,I,W)=>{Ao(P,Ih,{name:r.name,value:W})}})},RA=(r,f)=>{const g=I=>({dom:{tag:"th",innerHtml:f.translate(I)}}),v=I=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:je(I,g)}]}),_=I=>({dom:{tag:"td",innerHtml:f.translate(I)}}),T=I=>({dom:{tag:"tr"},components:je(I,_)}),P=I=>({dom:{tag:"tbody"},components:je(I,T)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[v(r.header),P(r.cells)],behaviours:Tn([Ka.config({}),ns.config({})])}},R7=(r,f)=>{const g=r.label.map(_e=>iv(_e,f)),v=[Jo.config({disabled:()=>r.disabled||f.isDisabled()}),rc(),No.config({mode:"execution",useEnter:r.multiline!==!0,useControlEnter:r.multiline===!0,execute:_e=>(rr(_e,BS),V.some(!0))}),xs("textfield-change",[on(om(),(_e,Ie)=>{Ao(_e,Ih,{name:r.name})}),on(ng(),(_e,Ie)=>{Ao(_e,Ih,{name:r.name})})]),Ka.config({})],_=r.validation.map(_e=>O1.config({getRoot:Ie=>xc(Ie.element),invalidClass:"tox-invalid",validator:{validate:Ie=>{const it=Gn.getValue(Ie),Qt=_e.validator(it);return Yu.pure(Qt===!0?wn.value(it):wn.error(Qt))},validateOnLoad:_e.validateOnLoad}})).toArray(),T=r.placeholder.fold(G({}),_e=>({placeholder:f.translate(_e)})),P=r.inputMode.fold(G({}),_e=>({inputmode:_e})),I={...T,...P},W=si.parts.field({tag:r.multiline===!0?"textarea":"input",...r.data.map(_e=>({data:_e})).getOr({}),inputAttributes:I,inputClasses:[r.classname],inputBehaviours:Tn(pt([v,_])),selectOnFocus:!1,factory:K2}),J=r.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[W]}:W,de=(r.flex?["tox-form__group--stretched"]:[]).concat(r.maximized?["tox-form-group--maximize"]:[]),ge=[Jo.config({disabled:()=>r.disabled||f.isDisabled(),onDisabled:_e=>{si.getField(_e).each(Jo.disable)},onEnabled:_e=>{si.getField(_e).each(Jo.enable)}}),rc()];return Ux(g,J,de,ge)},pj=(r,f,g)=>R7({name:r.name,multiline:!1,label:r.label,inputMode:r.inputMode,placeholder:r.placeholder,flex:!1,disabled:!r.enabled,classname:"tox-textfield",validation:V.none(),maximized:r.maximized,data:g},f),$7=(r,f,g)=>R7({name:r.name,multiline:!0,label:r.label,inputMode:V.none(),placeholder:r.placeholder,flex:!0,disabled:!r.enabled,classname:"tox-textarea",validation:V.none(),maximized:r.maximized,data:g},f),VS=(r,f)=>f.getAnimationRoot.fold(()=>r.element,g=>g(r)),mv=r=>r.dimension.property,mw=(r,f)=>r.dimension.getDimension(f),WS=(r,f)=>{const g=VS(r,f);Xc(g,[f.shrinkingClass,f.growingClass])},CR=(r,f)=>{va(r.element,f.openClass),Na(r.element,f.closedClass),ro(r.element,mv(f),"0px"),ru(r.element)},$A=(r,f)=>{va(r.element,f.closedClass),Na(r.element,f.openClass),ks(r.element,mv(f))},N7=(r,f,g,v)=>{g.setCollapsed(),ro(r.element,mv(f),mw(f,r.element)),WS(r,f),CR(r,f),f.onStartShrink(r),f.onShrunk(r)},bj=(r,f,g,v)=>{const _=v.getOrThunk(()=>mw(f,r.element));g.setCollapsed(),ro(r.element,mv(f),_),ru(r.element);const T=VS(r,f);va(T,f.growingClass),Na(T,f.shrinkingClass),CR(r,f),f.onStartShrink(r)},I7=(r,f,g)=>{const v=mw(f,r.element);(v==="0px"?N7:bj)(r,f,g,V.some(v))},kR=(r,f,g)=>{const v=VS(r,f),_=uf(v,f.shrinkingClass),T=mw(f,r.element);$A(r,f);const P=mw(f,r.element);(_?()=>{ro(r.element,mv(f),T),ru(r.element)}:()=>{CR(r,f)})(),va(v,f.shrinkingClass),Na(v,f.growingClass),$A(r,f),ro(r.element,mv(f),P),g.setExpanded(),f.onStartGrow(r)},B7=(r,f,g)=>{if(g.isExpanded()){ks(r.element,mv(f));const v=mw(f,r.element);ro(r.element,mv(f),v)}},vj=(r,f,g)=>{g.isExpanded()||kR(r,f,g)},Oj=(r,f,g)=>{g.isExpanded()&&I7(r,f,g)},yj=(r,f,g)=>{g.isExpanded()&&N7(r,f,g)},wj=(r,f,g)=>g.isExpanded(),L7=(r,f,g)=>g.isCollapsed(),F7=(r,f,g)=>{const v=VS(r,f);return uf(v,f.growingClass)===!0},xR=(r,f,g)=>{const v=VS(r,f);return uf(v,f.shrinkingClass)===!0};var _j=Object.freeze({__proto__:null,refresh:B7,grow:vj,shrink:Oj,immediateShrink:yj,hasGrown:wj,hasShrunk:L7,isGrowing:F7,isShrinking:xR,isTransitioning:(r,f,g)=>F7(r,f)||xR(r,f),toggleGrow:(r,f,g)=>{(g.isExpanded()?I7:kR)(r,f,g)},disableTransitions:WS,immediateGrow:(r,f,g)=>{g.isExpanded()||($A(r,f),ro(r.element,mv(f),mw(f,r.element)),WS(r,f),g.setExpanded(),f.onStartGrow(r),f.onGrown(r))}}),Sj=Object.freeze({__proto__:null,exhibit:(r,f,g)=>{const v=f.expanded;return Yc(v?{classes:[f.openClass],styles:{}}:{classes:[f.closedClass],styles:In(f.dimension.property,"0px")})},events:(r,f)=>li([lg(Jg(),(g,v)=>{v.event.raw.propertyName===r.dimension.property&&(WS(g,r),f.isExpanded()&&ks(g.element,r.dimension.property),(f.isExpanded()?r.onGrown:r.onShrunk)(g))})])}),Cj=[nn("closedClass"),nn("openClass"),nn("shrinkingClass"),nn("growingClass"),Er("getAnimationRoot"),qs("onShrunk"),qs("onStartShrink"),qs("onGrown"),qs("onStartGrow"),xt("expanded",!1),Kr("dimension",xl("property",{width:[Yi("property","width"),Yi("getDimension",r=>ta(r)+"px")],height:[Yi("property","height"),Yi("getDimension",r=>Ii(r)+"px")]}))],TR=Object.freeze({__proto__:null,init:r=>{const f=Ho(r.expanded),g=()=>"expanded: "+f.get();return mu({isExpanded:()=>f.get()===!0,isCollapsed:()=>f.get()===!1,setCollapsed:Re(f.set,!1),setExpanded:Re(f.set,!0),readState:g})}});const Bh=nc({fields:Cj,name:"sliding",active:Sj,apis:_j,state:TR}),Q7=r=>({isEnabled:()=>!Jo.isDisabled(r),setEnabled:f=>Jo.set(r,!f),setActive:f=>{const g=r.element;f?(Na(g,"tox-tbtn--enabled"),qn(g,"aria-pressed",!0)):(va(g,"tox-tbtn--enabled"),Ue(g,"aria-pressed"))},isActive:()=>uf(r.element,"tox-tbtn--enabled"),setText:f=>{Ao(r,Dg,{text:f})},setIcon:f=>Ao(r,VO,{icon:f})}),lT=(r,f,g,v,_=!0)=>AA({text:r.text,icon:r.icon,tooltip:r.tooltip,searchable:r.search.isSome(),role:v,fetch:(T,P)=>{const I={pattern:r.search.isSome()?$M(T):""};r.fetch(W=>{P(zS(W,Cp.CLOSE_ON_EXECUTE,g,{isHorizontalMenu:!1,search:r.search}))},I,Q7(T))},onSetup:r.onSetup,getApi:Q7,columns:1,presets:"normal",classes:[],dropdownBehaviours:[..._?[Ka.config({})]:[]]},f,g.shared),cT=(r,f,g)=>{const v=T=>P=>{const I=!P.isActive();P.setActive(I),T.storage.set(I),g.shared.getSink().each(W=>{f().getOpt(W).each(J=>{gf(J.element),Ao(J,Rb,{name:T.name,value:T.storage.get()})})})},_=T=>P=>{P.setActive(T.storage.get())};return T=>{T(je(r,P=>{const I=P.text.fold(()=>({}),W=>({text:W}));return{type:P.type,active:!1,...I,onAction:v(P),onSetup:_(P)}}))}},NA=r=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{title:r,"aria-label":r}},components:[Li(r)]}),Z7=io("leaf-label-event-id"),ER=({leaf:r,onLeafAction:f,visible:g,treeId:v,selectedId:_,backstage:T})=>{const P=r.menu.map(W=>lT(W,"tox-mbtn",T,V.none(),g)),I=[NA(r.title)];return P.each(W=>I.push(W)),Jc.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(g?["tox-tree--leaf__label--visible"]:[])},components:I,role:"treeitem",action:W=>{f(r.id),W.getSystem().broadcastOn([`update-active-item-${v}`],{value:r.id})},eventOrder:{[If()]:[Z7,"keying"]},buttonBehaviours:Tn([...g?[Ka.config({})]:[],Ms.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Pc.config({channels:{[`update-active-item-${v}`]:{onReceive:(W,J)=>{(J.value===r.id?Ms.on:Ms.off)(W)}}}}),xs(Z7,[Ci((W,J)=>{_.each(ie=>{(ie===r.id?Ms.on:Ms.off)(W)})}),on(If(),(W,J)=>{const ie=J.event.raw.code==="ArrowLeft",de=J.event.raw.code==="ArrowRight";ie?(fg(W.element,".tox-tree--directory").each(ge=>{W.getSystem().getByDom(ge).each(_e=>{Uv(ge,".tox-tree--directory__label").each(Ie=>{_e.getSystem().getByDom(Ie).each(ns.focus)})})}),J.stop()):de&&J.stop()})])])})},AR=(r,f,g)=>Sp(r,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:g},f),kj=(r,f)=>AR(r,f,[]),IA=io("directory-label-event-id"),H7=({directory:r,visible:f,noChildren:g,backstage:v})=>{const _=r.menu.map(I=>lT(I,"tox-mbtn",v,V.none())),T=[{dom:{tag:"div",classes:["tox-chevron"]},components:[kj("chevron-right",v.shared.providers.icons)]},NA(r.title)];_.each(I=>{T.push(I)});const P=I=>{fg(I.element,".tox-tree--directory").each(W=>{I.getSystem().getByDom(W).each(J=>{const ie=!Ms.isOn(J);Ms.toggle(J),Ao(I,"expand-tree-node",{expanded:ie,node:r.id})})})};return Jc.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(f?["tox-tree--directory__label--visible"]:[])},components:T,action:P,eventOrder:{[If()]:[IA,"keying"]},buttonBehaviours:Tn([...f?[Ka.config({})]:[],xs(IA,[on(If(),(I,W)=>{const J=W.event.raw.code==="ArrowRight",ie=W.event.raw.code==="ArrowLeft";J&&g&&W.stop(),(J||ie)&&fg(I.element,".tox-tree--directory").each(de=>{I.getSystem().getByDom(de).each(ge=>{!Ms.isOn(ge)&&J||Ms.isOn(ge)&&ie?(P(I),W.stop()):ie&&!Ms.isOn(ge)&&(fg(ge.element,".tox-tree--directory").each(_e=>{Uv(_e,".tox-tree--directory__label").each(Ie=>{ge.getSystem().getByDom(Ie).each(ns.focus)})}),W.stop())})})})])])})},xj=({children:r,onLeafAction:f,visible:g,treeId:v,expandedIds:_,selectedId:T,backstage:P})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:r.map(I=>I.type==="leaf"?ER({leaf:I,selectedId:T,onLeafAction:f,visible:g,treeId:v,backstage:P}):BA({directory:I,expandedIds:_,selectedId:T,onLeafAction:f,labelTabstopping:g,treeId:v,backstage:P})),behaviours:Tn([Bh.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:g}),gs.config({})])}),Tj=io("directory-event-id"),BA=({directory:r,onLeafAction:f,labelTabstopping:g,treeId:v,backstage:_,expandedIds:T,selectedId:P})=>{const{children:I}=r,W=Ho(T),J=de=>I.map(ge=>ge.type==="leaf"?ER({leaf:ge,selectedId:P,onLeafAction:f,visible:de,treeId:v,backstage:_}):BA({directory:ge,expandedIds:W.get(),selectedId:P,onLeafAction:f,labelTabstopping:de,treeId:v,backstage:_})),ie=T.includes(r.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[H7({directory:r,visible:g,noChildren:r.children.length===0,backstage:_}),xj({children:I,expandedIds:T,selectedId:P,onLeafAction:f,visible:ie,treeId:v,backstage:_})],behaviours:Tn([xs(Tj,[Ci((de,ge)=>{Ms.set(de,ie)}),on("expand-tree-node",(de,ge)=>{const{expanded:_e,node:Ie}=ge.event;W.set(_e?[...W.get(),Ie]:W.get().filter(it=>it!==Ie))})]),Ms.config({...r.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(de,ge)=>{const _e=de.components()[1],Ie=J(ge);ge?Bh.grow(_e):Bh.shrink(_e),gs.set(_e,Ie)}})])}},z7=io("tree-event-id"),Ej=(r,f)=>{const g=r.onLeafAction.getOr(L),v=r.onToggleExpand.getOr(L),_=r.defaultExpandedIds,T=Ho(_),P=Ho(r.defaultSelectedId),I=io("tree-id"),W=(J,ie)=>r.items.map(de=>de.type==="leaf"?ER({leaf:de,selectedId:J,onLeafAction:g,visible:!0,treeId:I,backstage:f}):BA({directory:de,selectedId:J,onLeafAction:g,expandedIds:ie,labelTabstopping:!0,treeId:I,backstage:f}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:W(P.get(),T.get()),behaviours:Tn([No.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),xs(z7,[on("expand-tree-node",(J,ie)=>{const{expanded:de,node:ge}=ie.event;T.set(de?[...T.get(),ge]:T.get().filter(_e=>_e!==ge)),v(T.get(),{expanded:de,node:ge})})]),Pc.config({channels:{[`update-active-item-${I}`]:{onReceive:(J,ie)=>{P.set(V.some(ie.value)),gs.set(J,W(V.some(ie.value),T.get()))}}}}),gs.config({})])}};var V7=Object.freeze({__proto__:null,events:(r,f)=>{const v=r.stream.streams.setup(r,f);return li([on(r.event,v),Ld(()=>f.cancel())].concat(r.cancelEvent.map(_=>[on(_,()=>f.cancel())]).getOr([])))}});const W7=r=>{const f=Ho(null);return mu({readState:()=>({timer:f.get()!==null?"set":"unset"}),setTimer:T=>{f.set(T)},cancel:()=>{const T=f.get();T!==null&&T.cancel()}})};var U7=Object.freeze({__proto__:null,throttle:W7,init:r=>r.stream.streams.state(r)});const Y7=(r,f)=>{const g=r.stream,v=yf(r.onStream,g.delay);return f.setTimer(v),(_,T)=>{v.throttle(_,T),g.stopEvent&&T.stop()}};var Pj=[Kr("stream",xl("mode",{throttle:[nn("delay"),xt("stopEvent",!0),Yi("streams",{setup:Y7,state:W7})]})),xt("event","input"),Er("cancelEvent"),hg("onStream")];const DR=nc({fields:Pj,name:"streaming",active:V7,state:U7}),LA=(r,f,g)=>{const v=Gn.getValue(g);Gn.setValue(f,v),X7(f)},PR=(r,f)=>{const g=r.element,v=Ia(g),_=g.dom;zi(g,"type")!=="number"&&f(_,v)},X7=r=>{PR(r,(f,g)=>f.setSelectionRange(g.length,g.length))},j7=(r,f)=>{PR(r,(g,v)=>g.setSelectionRange(f,v.length))},Mj=(r,f,g)=>{if(r.selectsOver){const v=Gn.getValue(f),_=r.getDisplayText(v),T=Gn.getValue(g);return r.getDisplayText(T).indexOf(_)===0?V.some(()=>{LA(r,f,g),j7(f,_.length)}):V.none()}else return V.none()},MR=G("alloy.typeahead.itemexecute"),RR=(r,f,g,v)=>{const _=(de,ge,_e)=>{r.previewing.set(!1);const Ie=ul.getCoupled(de,"sandbox");if(Gs.isOpen(Ie))cr.getCurrent(Ie).each(it=>{Nr.getHighlighted(it).fold(()=>{_e(it)},()=>{Bv(Ie,it.element,"keydown",ge)})});else{const it=Qt=>{cr.getCurrent(Qt).each(_e)};Vx(r,P(de),de,Ie,v,it,md.HighlightMenuAndItem).get(L)}},T=FB(r),P=de=>ge=>ge.map(_e=>{const Ie=_a(_e.menus),it=Ne(Ie,dt=>Kn(dt.items,ft=>ft.type==="item"));return Gn.getState(de).update(je(it,dt=>dt.data)),_e}),I=de=>cr.getCurrent(de),W="typeaheadevents",J=[ns.config({}),Gn.config({onSetValue:r.onSetValue,store:{mode:"dataset",getDataKey:de=>Ia(de.element),getFallbackEntry:de=>({value:de,meta:{}}),setValue:(de,ge)=>{Ta(de.element,r.model.getDisplayText(ge))},...r.initialData.map(de=>In("initialValue",de)).getOr({})}}),DR.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:(de,ge)=>{const _e=ul.getCoupled(de,"sandbox");if(ns.isFocused(de)&&Ia(de.element).length>=r.minChars){const it=I(_e).bind(dt=>Nr.getHighlighted(dt).map(Gn.getValue));r.previewing.set(!0);const Qt=dt=>{I(_e).each(ft=>{it.fold(()=>{r.model.selectsOver&&Nr.highlightFirst(ft)},Yt=>{Nr.highlightBy(ft,Dt=>Gn.getValue(Dt).value===Yt.value),Nr.getHighlighted(ft).orThunk(()=>(Nr.highlightFirst(ft),V.none()))})})};Vx(r,P(de),de,_e,v,Qt,md.HighlightJustMenu).get(L)}},cancelEvent:ep()}),No.config({mode:"special",onDown:(de,ge)=>(_(de,ge,Nr.highlightFirst),V.some(!0)),onEscape:de=>{const ge=ul.getCoupled(de,"sandbox");return Gs.isOpen(ge)?(Gs.close(ge),V.some(!0)):V.none()},onUp:(de,ge)=>(_(de,ge,Nr.highlightLast),V.some(!0)),onEnter:de=>{const ge=ul.getCoupled(de,"sandbox"),_e=Gs.isOpen(ge);if(_e&&!r.previewing.get())return I(ge).bind(Ie=>Nr.getHighlighted(Ie)).map(Ie=>(Ao(de,MR(),{item:Ie}),!0));{const Ie=Gn.getValue(de);return rr(de,ep()),r.onExecute(ge,de,Ie),_e&&Gs.close(ge),V.some(!0)}}}),Ms.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),ul.config({others:{sandbox:de=>AM(r,de,{onOpen:()=>Ms.on(de),onClose:()=>{r.lazyTypeaheadComp.get().each(ge=>Ue(ge.element,"aria-activedescendant")),Ms.off(de)}})}}),xs(W,[Ci(de=>{r.lazyTypeaheadComp.set(V.some(de))}),Ld(de=>{r.lazyTypeaheadComp.set(V.none())}),hu(de=>{const ge=L;EM(r,P(de),de,v,ge,md.HighlightMenuAndItem).get(L)}),on(MR(),(de,ge)=>{const _e=ul.getCoupled(de,"sandbox");LA(r.model,de,ge.event.item),rr(de,ep()),r.onItemExecute(de,_e,ge.event.item,Gn.getValue(de)),Gs.close(_e),X7(de)})].concat(r.dismissOnBlur?[on(tg(),de=>{const ge=ul.getCoupled(de,"sandbox");al(ge.element).isNone()&&Gs.close(ge)})]:[]))],ie={[Nd()]:[Gn.name(),DR.name(),W],...r.eventOrder};return{uid:r.uid,dom:A5(ni(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...T,...sc(r.typeaheadBehaviours,J)},eventOrder:ie}},Rj=G([Er("lazySink"),nn("fetch"),xt("minChars",5),xt("responseTime",1e3),qs("onOpen"),xt("getHotspot",V.some),xt("getAnchorOverrides",G({})),xt("layouts",V.none()),xt("eventOrder",{}),c0("model",{},[xt("getDisplayText",r=>r.meta!==void 0&&r.meta.text!==void 0?r.meta.text:r.value),xt("selectsOver",!0),xt("populateFromBrowse",!0)]),qs("onSetValue"),pu("onExecute"),qs("onItemExecute"),xt("inputClasses",[]),xt("inputAttributes",{}),xt("inputStyles",{}),xt("matchWidth",!0),xt("useMinWidth",!1),xt("dismissOnBlur",!0),hf(["openClass"]),Er("initialData"),Wl("typeaheadBehaviours",[ns,Gn,DR,No,Ms,ul]),ka("lazyTypeaheadComp",()=>Ho(V.none)),ka("previewing",()=>Ho(!0))].concat(LB()).concat(DM())),$j=G([Mh({schema:[Yv()],name:"menu",overrides:r=>({fakeFocus:!0,onHighlightItem:(f,g,v)=>{r.previewing.get()?r.lazyTypeaheadComp.get().each(_=>{Mj(r.model,_,v).fold(()=>{r.model.selectsOver?(Nr.dehighlight(g,v),r.previewing.set(!0)):r.previewing.set(!1)},T=>{T(),r.previewing.set(!1)})}):r.lazyTypeaheadComp.get().each(_=>{r.model.populateFromBrowse&&LA(r.model,_,v),me(v.element,"id").each(T=>qn(_.element,"aria-activedescendant",T))})},onExecute:(f,g)=>r.lazyTypeaheadComp.get().map(v=>(Ao(v,MR(),{item:g}),!0)),onHover:(f,g)=>{r.previewing.set(!1),r.lazyTypeaheadComp.get().each(v=>{r.model.populateFromBrowse&&LA(r.model,v,g)})}})})]),Nj=wu({name:"Typeahead",configFields:Rj(),partFields:$j(),factory:RR}),Pg=r=>({...r,toCached:()=>Pg(r.toCached()),bindFuture:W=>Pg(r.bind(J=>J.fold(ie=>Yu.pure(wn.error(ie)),ie=>W(ie)))),bindResult:W=>Pg(r.map(J=>J.bind(W))),mapResult:W=>Pg(r.map(J=>J.map(W))),mapError:W=>Pg(r.map(J=>J.mapError(W))),foldResult:(W,J)=>r.map(ie=>ie.fold(W,J)),withTimeout:(W,J)=>Pg(Yu.nu(ie=>{let de=!1;const ge=setTimeout(()=>{de=!0,ie(wn.error(J()))},W);r.get(_e=>{de||(clearTimeout(ge),ie(_e))})}))}),q7=r=>Pg(Yu.nu(r)),$R=r=>Pg(Yu.pure(wn.value(r))),Bj={nu:q7,wrap:Pg,pure:$R,value:$R,error:r=>Pg(Yu.pure(wn.error(r))),fromResult:r=>Pg(Yu.pure(r)),fromFuture:r=>Pg(r.map(wn.value)),fromPromise:r=>q7(f=>{r.then(g=>{f(wn.value(g))},g=>{f(wn.error(g))})})},FA=(r,f,g=[],v,_,T)=>{const P=f.fold(()=>({}),J=>({action:J})),I={buttonBehaviours:Tn([xg.button(()=>!r.enabled||T.isDisabled()),rc(),Ka.config({}),xs("button press",[Ey("click"),Ey("mousedown")])].concat(g)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...P},W=ni(I,{dom:v});return ni(W,{components:_})},G7=(r,f,g,v=[])=>{const _=r.tooltip.map(W=>({"aria-label":g.translate(W),title:g.translate(W)})).getOr({}),T={tag:"button",classes:["tox-tbtn"],attributes:_},P=r.icon.map(W=>bR(W,g.icons)),I=PS([P]);return FA(r,f,v,T,I,g)},NR=r=>{switch(r){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},K7=(r,f,g,v=[],_=[])=>{const T=g.translate(r.text),P=r.icon.map(ge=>bR(ge,g.icons)),I=[P.getOrThunk(()=>Li(T))],W=r.buttonType.getOr(!r.primary&&!r.borderless?"secondary":"primary"),de={tag:"button",classes:[...NR(W),...P.isSome()?["tox-button--icon"]:[],...r.borderless?["tox-button--naked"]:[],..._],attributes:{title:T}};return FA(r,f,v,de,I,g)},IR=(r,f,g,v=[],_=[])=>{const T=K7(r,V.some(f),g,v,_);return Jc.sketch(T)},J7=(r,f)=>g=>{f==="custom"?Ao(g,Rb,{name:r,value:{}}):f==="submit"?rr(g,BS):f==="cancel"?rr(g,BO):console.error("Unknown button type: ",f)},Lj=(r,f)=>f==="menu",Fj=(r,f)=>f==="custom"||f==="cancel"||f==="submit",eF=(r,f)=>f==="togglebutton",Qj=(r,f)=>{var g,v;const _=r.icon.map(ft=>zO(ft,f.icons)).map(oi),T=ft=>{Ao(ft,Rb,{name:r.name,value:{setIcon:Yt=>{_.map(Dt=>Dt.getOpt(ft).each(kn=>{gs.set(kn,[zO(Yt,f.icons)])}))}}})},P=r.buttonType.getOr(r.primary?"primary":"secondary"),I={...r,name:(g=r.name)!==null&&g!==void 0?g:"",primary:P==="primary",tooltip:V.from(r.tooltip),enabled:(v=r.enabled)!==null&&v!==void 0?v:!1,borderless:!1},W=I.tooltip.map(ft=>({"aria-label":f.translate(ft),title:f.translate(ft)})).getOr({}),J=NR(P!=null?P:"secondary"),ie=r.icon.isSome()&&r.text.isSome(),de={tag:"button",classes:[...J.concat(r.icon.isSome()?["tox-button--icon"]:[]),...r.active?["tox-button--enabled"]:[],...ie?["tox-button--icon-and-text"]:[]],attributes:W},ge=[],_e=f.translate(r.text.getOr("")),Ie=Li(_e),Qt=[...PS([_.map(ft=>ft.asSpec())]),...r.text.isSome()?[Ie]:[]],dt=FA(I,V.some(T),ge,de,Qt,f);return Jc.sketch(dt)},QA=(r,f,g)=>{if(Lj(r,f)){const v=()=>P,_=r,T={...r,type:"menubutton",search:V.none(),onSetup:I=>(I.setEnabled(r.enabled),L),fetch:cT(_.items,v,g)},P=oi(lT(T,"tox-tbtn",g,V.none()));return P.asSpec()}else if(Fj(r,f)){const v=J7(r.name,f),_={...r,borderless:!1};return IR(_,v,g.shared.providers,[])}else{if(eF(r,f))return Qj(r,g.shared.providers);throw console.error("Unknown footer button type: ",f),new Error("Unknown footer button type")}},Zj=(r,f)=>{const g=J7(r.name,"custom");return yL(V.none(),si.parts.field({factory:Jc,...K7(r,V.some(g),f,[uv(""),Ep.self()])}))},tF={type:"separator"},nF=r=>({type:"menuitem",value:r.url,text:r.title,meta:{attach:r.attach},onAction:L}),ZA=(r,f)=>({type:"menuitem",value:f,text:r,meta:{attach:void 0},onAction:L}),HA=r=>je(r,nF),Hj=(r,f)=>Kn(f,g=>g.type===r),oF=(r,f)=>HA(Hj(r,f)),zj=r=>oF("header",r.targets),Vj=r=>oF("anchor",r.targets),sF=r=>V.from(r.anchorTop).map(f=>ZA("<top>",f)).toArray(),Wj=r=>V.from(r.anchorBottom).map(f=>ZA("<bottom>",f)).toArray(),Uj=r=>je(r,f=>ZA(f,f)),Yj=r=>Yo(r,(f,g)=>f.length===0||g.length===0?f.concat(g):f.concat(tF,g),[]),zA=(r,f)=>{const g=r.toLowerCase();return Kn(f,v=>{var _;const T=v.meta!==void 0&&v.meta.text!==void 0?v.meta.text:v.text,P=(_=v.value)!==null&&_!==void 0?_:"";return Vs(T.toLowerCase(),g)||Vs(P.toLowerCase(),g)})},rF=(r,f,g)=>{var v,_;const T=Gn.getValue(f),P=(_=(v=T==null?void 0:T.meta)===null||v===void 0?void 0:v.text)!==null&&_!==void 0?_:T.value;return g.getLinkInformation().fold(()=>[],W=>{const J=zA(P,Uj(g.getHistory(r)));return r==="file"?Yj([J,zA(P,zj(W)),zA(P,pt([sF(W),Vj(W),Wj(W)]))]):J})},iF=io("aria-invalid"),Xj=(r,f,g,v)=>{const _=f.shared.providers,T=ft=>{const Yt=Gn.getValue(ft);g.addToHistory(Yt.value,r.filetype)},P={...v.map(ft=>({initialData:ft})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":iF,type:"url"},minChars:0,responseTime:0,fetch:ft=>{const Yt=rF(r.filetype,ft,g),Dt=zS(Yt,Cp.BUBBLE_TO_SANDBOX,f,{isHorizontalMenu:!1,search:V.none()});return Yu.pure(Dt)},getHotspot:ft=>Ie.getOpt(ft),onSetValue:(ft,Yt)=>{ft.hasConfigured(O1)&&O1.run(ft).get(L)},typeaheadBehaviours:Tn([...g.getValidationHandler().map(ft=>O1.config({getRoot:Yt=>xc(Yt.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(Yt,Dt)=>{ie.getOpt(Yt).each(kn=>{qn(kn.element,"title",_.translate(Dt))})}},validator:{validate:Yt=>{const Dt=Gn.getValue(Yt);return Bj.nu(kn=>{ft({type:r.filetype,url:Dt.value},pn=>{if(pn.status==="invalid"){const Nn=wn.error(pn.message);kn(Nn)}else{const Nn=wn.value(pn.message);kn(Nn)}})})},validateOnLoad:!1}})).toArray(),Jo.config({disabled:()=>!r.enabled||_.isDisabled()}),Ka.config({}),xs("urlinput-events",[on(om(),ft=>{const Yt=Ia(ft.element),Dt=Yt.trim();Dt!==Yt&&Ta(ft.element,Dt),r.filetype==="file"&&Ao(ft,Ih,{name:r.name})}),on(Kg(),ft=>{Ao(ft,Ih,{name:r.name}),T(ft)}),on(ng(),ft=>{Ao(ft,Ih,{name:r.name}),T(ft)})])]),eventOrder:{[om()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:ft=>ft.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:f.shared.getSink,parts:{menu:xS(!1,1,"normal")},onExecute:(ft,Yt,Dt)=>{Ao(Yt,BS,{})},onItemExecute:(ft,Yt,Dt,kn)=>{T(ft),Ao(ft,Ih,{name:r.name})}},I=si.parts.field({...P,factory:Nj}),W=r.label.map(ft=>iv(ft,_)),ie=oi(((ft,Yt,Dt=ft,kn=ft)=>Sp(Dt,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+ft],attributes:{title:_.translate(kn),"aria-live":"polite",...Yt.fold(()=>({}),pn=>({id:pn}))}},_.icons))("invalid",V.some(iF),"warning")),de=oi({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[ie.asSpec()]}),ge=g.getUrlPicker(r.filetype),_e=io("browser.url.event"),Ie=oi({dom:{tag:"div",classes:["tox-control-wrap"]},components:[I,de.asSpec()],behaviours:Tn([Jo.config({disabled:()=>!r.enabled||_.isDisabled()})])}),it=oi(IR({name:r.name,icon:V.some("browse"),text:r.label.getOr(""),enabled:r.enabled,primary:!1,buttonType:V.none(),borderless:!0},ft=>rr(ft,_e),_,[],["tox-browse-url"])),Qt=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:pt([[Ie.asSpec()],ge.map(()=>it.asSpec()).toArray()])}),dt=ft=>{cr.getCurrent(ft).each(Yt=>{const Dt=Gn.getValue(Yt),kn={fieldname:r.name,...Dt};ge.each(pn=>{pn(kn).get(Nn=>{Gn.setValue(Yt,Nn),Ao(ft,Ih,{name:r.name})})})})};return si.sketch({dom:FY(),components:W.toArray().concat([Qt()]),fieldBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||_.isDisabled(),onDisabled:ft=>{si.getField(ft).each(Jo.disable),it.getOpt(ft).each(Jo.disable)},onEnabled:ft=>{si.getField(ft).each(Jo.enable),it.getOpt(ft).each(Jo.enable)}}),rc(),xs("url-input-events",[on(_e,dt)])])})},aF=(r,f)=>{const g=fB(r.icon,f.icons);return v1.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${r.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:r.url?void 0:g},components:r.url?[Jc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:g,attributes:{title:f.translate(r.iconTooltip)}},action:v=>Ao(v,Rb,{name:"alert-banner",value:r.url}),buttonBehaviours:Tn([l5()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:f.translate(r.text)}}]})},jj=(r,f)=>{r.dom.checked=f},qj=r=>r.dom.checked,ds=(r,f,g)=>{const v=W=>(W.element.dom.click(),V.some(!0)),_=si.parts.field({factory:{sketch:we},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Tn([Ep.self(),Jo.config({disabled:()=>!r.enabled||f.isDisabled(),onDisabled:W=>{xc(W.element).each(J=>Na(J,"tox-checkbox--disabled"))},onEnabled:W=>{xc(W.element).each(J=>va(J,"tox-checkbox--disabled"))}}),Ka.config({}),ns.config({}),r7(g,qj,jj),No.config({mode:"special",onEnter:v,onSpace:v,stopSpaceKeyup:!0}),xs("checkbox-events",[on(Kg(),(W,J)=>{Ao(W,Ih,{name:r.name})})])])}),T=si.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Li(f.translate(r.label))],behaviours:Tn([Xx.config({})])}),P=W=>Sp(W==="checked"?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+W]},f.icons),I=oi({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[P("checked"),P("unchecked")]});return si.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[_,I.asSpec(),T],fieldBehaviours:Tn([Jo.config({disabled:()=>!r.enabled||f.isDisabled()}),rc()])})},uT=r=>r.presets==="presentation"?v1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:r.html}}):v1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:r.html,attributes:{role:"document"}},containerBehaviours:Tn([Ka.config({}),ns.config({})])}),ac=r=>(f,g,v,_)=>ln(g,"name").fold(()=>r(g,_,V.none()),T=>f.field(T,r(g,_,ln(v,T)))),lF=r=>(f,g,v,_)=>{const T=ni(g,{source:"dynamic"});return ac(r)(f,T,v,_)},cF={bar:ac((r,f)=>MY(r,f.shared)),collection:ac((r,f,g)=>QY(r,f.shared.providers,g)),alertbanner:ac((r,f)=>aF(r,f.shared.providers)),input:ac((r,f,g)=>pj(r,f.shared.providers,g)),textarea:ac((r,f,g)=>$7(r,f.shared.providers,g)),label:ac((r,f)=>rT(r,f.shared)),iframe:lF((r,f,g)=>rj(r,f.shared.providers,g)),button:ac((r,f)=>Zj(r,f.shared.providers)),checkbox:ac((r,f,g)=>ds(r,f.shared.providers,g)),colorinput:ac((r,f,g)=>YY(r,f.shared,f.colorinput,g)),colorpicker:ac((r,f,g)=>l7(r,f.shared.providers,g)),dropzone:ac((r,f,g)=>c7(r,f.shared.providers,g)),grid:ac((r,f)=>u7(r,f.shared)),listbox:ac((r,f,g)=>hv(r,f,g)),selectbox:ac((r,f,g)=>wR(r,f.shared.providers,g)),sizeinput:ac((r,f)=>mj(r,f.shared.providers)),slider:ac((r,f,g)=>gj(r,f.shared.providers,g)),urlinput:ac((r,f,g)=>Xj(r,f,f.urlinput,g)),customeditor:ac(_A),htmlpanel:ac(uT),imagepreview:ac((r,f,g)=>TA(r,g)),table:ac((r,f)=>RA(r,f.shared.providers)),tree:ac((r,f)=>Ej(r,f)),panel:ac((r,f)=>yR(r,f))},uF={field:(r,f)=>f,record:G([])},BR=(r,f,g,v)=>{const _=ni(v,{shared:{interpreter:T=>fF(r,T,g,_)}});return fF(r,f,g,_)},fF=(r,f,g,v)=>ln(cF,f.type).fold(()=>(console.error(`Unknown factory type "${f.type}", defaulting to container: `,f),f),_=>_(r,f,g,v)),US=(r,f,g)=>fF(uF,r,f,g),WO="layout-inset",VA=r=>r.x,dF=(r,f)=>r.x+r.width/2-f.width/2,LR=(r,f)=>r.x+r.width-f.width,FR=r=>r.y,WA=(r,f)=>r.y+r.height-f.height,UA=(r,f)=>r.y+r.height/2-f.height/2,fT=(r,f,g)=>Oa(LR(r,f),WA(r,f),g.insetSouthwest(),ub(),"southwest",zl(r,{right:0,bottom:3}),WO),YA=(r,f,g)=>Oa(VA(r),WA(r,f),g.insetSoutheast(),mf(),"southeast",zl(r,{left:1,bottom:3}),WO),dT=(r,f,g)=>Oa(LR(r,f),FR(r),g.insetNorthwest(),Ch(),"northwest",zl(r,{right:0,top:2}),WO),hT=(r,f,g)=>Oa(VA(r),FR(r),g.insetNortheast(),E0(),"northeast",zl(r,{left:1,top:2}),WO),Ap=(r,f,g)=>Oa(dF(r,f),FR(r),g.insetNorth(),Xv(),"north",zl(r,{top:2}),WO),mT=(r,f,g)=>Oa(dF(r,f),WA(r,f),g.insetSouth(),e2(),"south",zl(r,{bottom:3}),WO),QR=(r,f,g)=>Oa(LR(r,f),UA(r,f),g.insetEast(),A0(),"east",zl(r,{right:0}),WO),hF=(r,f,g)=>Oa(VA(r),UA(r,f),g.insetWest(),jv(),"west",zl(r,{left:1}),WO),Gj=r=>{switch(r){case"north":return Ap;case"northeast":return hT;case"northwest":return dT;case"south":return mT;case"southeast":return YA;case"southwest":return fT;case"east":return QR;case"west":return hF}},mF=(r,f,g,v,_)=>k_(v).map(Gj).getOr(Ap)(r,f,g,v,_),Kj=r=>{switch(r){case"north":return mT;case"northeast":return YA;case"northwest":return fT;case"south":return Ap;case"southeast":return hT;case"southwest":return dT;case"east":return hF;case"west":return QR}},Jj=(r,f,g,v,_)=>k_(v).map(Kj).getOr(Ap)(r,f,g,v,_),gT={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},eq=(r,f,g)=>{const _={maxHeightFunction:bg()},T=()=>({type:"node",root:On($t(r())),node:V.from(r()),bubble:vg(12,12,gT),layouts:{onRtl:()=>[hT],onLtr:()=>[dT]},overrides:_}),P=()=>({type:"hotspot",hotspot:f(),bubble:vg(-12,12,gT),layouts:{onRtl:()=>[vl,ec,Vl],onLtr:()=>[ec,vl,Vl]},overrides:_});return()=>g()?T():P()},tq=(r,f,g,v)=>{const T={maxHeightFunction:bg()},P=()=>({type:"node",root:On($t(f())),node:V.from(f()),bubble:vg(12,12,gT),layouts:{onRtl:()=>[Ap],onLtr:()=>[Ap]},overrides:T}),I=()=>r?{type:"node",root:On($t(f())),node:V.from(f()),bubble:vg(0,-Xf(f()),gT),layouts:{onRtl:()=>[tc],onLtr:()=>[tc]},overrides:T}:{type:"hotspot",hotspot:g(),bubble:vg(0,0,gT),layouts:{onRtl:()=>[tc],onLtr:()=>[tc]},overrides:T};return()=>v()?P():I()},nq=(r,f,g)=>{const v=()=>({type:"node",root:On($t(r())),node:V.from(r()),layouts:{onRtl:()=>[Ap],onLtr:()=>[Ap]}}),_=()=>({type:"hotspot",hotspot:f(),layouts:{onRtl:()=>[Vl],onLtr:()=>[Vl]}});return()=>g()?v():_()},oq=(r,f)=>()=>({type:"selection",root:f(),getSelection:()=>{const g=r.selection.getRng(),v=r.model.table.getSelectedCells();if(v.length>1){const _=v[0],T=v[v.length-1],P={firstCell:lt.fromDom(_),lastCell:lt.fromDom(T)};return V.some(P)}return V.some(B0.range(lt.fromDom(g.startContainer),g.startOffset,lt.fromDom(g.endContainer),g.endOffset))}}),sq=r=>f=>({type:"node",root:r(),node:f}),gF=(r,f,g,v)=>{const _=CS(r),T=()=>lt.fromDom(r.getBody()),P=()=>lt.fromDom(r.getContentAreaContainer()),I=()=>_||!v();return{inlineDialog:eq(P,f,I),inlineBottomDialog:tq(r.inline,P,g,I),banner:nq(P,f,I),cursor:oq(r,T),node:sq(T)}},rq=r=>(f,g)=>{Q8(r)(f,g)},iq=r=>()=>I8(r),aq=r=>f=>mM(r,f),lq=r=>f=>gM(r,f),cq=r=>({colorPicker:rq(r),hasCustomColors:iq(r),getColors:aq(r),getColorCols:lq(r)}),uq=r=>()=>w5(r),pF=r=>({isDraggableModal:uq(r)}),fq=r=>{const f=Ho(C5(r)?"bottom":"top");return{isPositionedAtTop:()=>f.get()==="top",getDockingMode:f.get,setDockingMode:f.set}},ZR=r=>Qi(r,"items"),bF=r=>Qi(r,"format"),HR=[{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"}]}],vF=r=>vs(r,"items"),zR=r=>vs(r,"block"),dq=r=>vs(r,"inline"),OF=r=>vs(r,"selector"),VR=r=>Yo(r,(f,g)=>{if(vF(g)){const v=VR(g.items);return{customFormats:f.customFormats.concat(v.customFormats),formats:f.formats.concat([{title:g.title,items:v.formats}])}}else if(dq(g)||zR(g)||OF(g)){const _=`custom-${d(g.name)?g.name:g.title.toLowerCase()}`;return{customFormats:f.customFormats.concat([{name:_,format:g}]),formats:f.formats.concat([{title:g.title,format:_,icon:g.icon}])}}else return{...f,formats:f.formats.concat(g)}},{customFormats:[],formats:[]}),hq=(r,f)=>{const g=VR(f),v=_=>{mt(_,T=>{r.formatter.has(T.name)||r.formatter.register(T.name,T.format)})};return r.formatter?v(g.customFormats):r.on("init",()=>{v(g.customFormats)}),g.formats},WR=r=>wS(r).map(f=>{const g=hq(r,f);return kx(r)?HR.concat(g):g}).getOr(HR),mq=r=>{const f=Xs(r);return f.length===1&&st(f,"title")},yF=(r,f,g)=>({...r,type:"formatter",isSelected:f(r.format),getStylePreview:g(r.format)}),Dp=(r,f,g,v)=>{const _=W=>yF(W,g,v),T=W=>{const J=I(W.items);return{...W,type:"submenu",getStyleItems:G(J)}},P=W=>{const J=d(W.name)?W.name:io(W.title),ie=`custom-${J}`,de={...W,type:"formatter",format:ie,isSelected:g(ie),getStylePreview:v(ie)};return r.formatter.register(J,de),de},I=W=>je(W,J=>ZR(J)?T(J):bF(J)?_(J):mq(J)?{...J,type:"separator"}:P(J));return I(f)},XA=r=>{const f=I=>()=>r.formatter.match(I),g=I=>()=>{const W=r.formatter.get(I);return W!==void 0?V.some({tag:W.length>0&&(W[0].inline||W[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(I))}):V.none()},v=Ho([]),_=Ho([]),T=Ho(!1);return r.on("PreInit",I=>{const W=WR(r),J=Dp(r,W,f,g);v.set(J)}),r.on("addStyleModifications",I=>{const W=Dp(r,I.items,f,g);_.set(W),T.set(I.replace)}),{getData:()=>{const I=T.get()?[]:v.get(),W=_.get();return I.concat(W)}}},jA=r=>Q(r)&&r.nodeType===1,gq=fv.trim,qA=r=>f=>!!(jA(f)&&(f.contentEditable===r||f.getAttribute("data-mce-contenteditable")===r)),pq=qA("true"),UR=qA("false"),YR=(r,f,g,v,_)=>({type:r,title:f,url:g,level:v,attach:_}),XR=r=>{let f=r;for(;f=f.parentNode;){const g=f.contentEditable;if(g&&g!=="inherit")return pq(f)}return!1},bq=(r,f)=>je(vu(lt.fromDom(f),r),g=>g.dom),jR=r=>r.innerText||r.textContent,wF=r=>r.id?r.id:io("h"),qR=r=>r&&r.nodeName==="A"&&(r.id||r.name)!==void 0,vq=r=>qR(r)&&GR(r),_F=r=>r&&/^(H[1-6])$/.test(r.nodeName),GR=r=>XR(r)&&!UR(r),Oq=r=>_F(r)&&GR(r),yq=r=>_F(r)?parseInt(r.nodeName.substr(1),10):0,SF=r=>{var f;const g=wF(r),v=()=>{r.id=g};return YR("header",(f=jR(r))!==null&&f!==void 0?f:"","#"+g,yq(r),v)},CF=r=>{const f=r.id||r.name,g=jR(r);return YR("anchor",g||"#"+f,"#"+f,0,L)},wq=r=>je(Kn(r,Oq),SF),_q=r=>je(Kn(r,vq),CF),Sq=r=>bq("h1,h2,h3,h4,h5,h6,a:not([href])",r),Cq=r=>gq(r.title).length>0,_1={find:r=>{const f=Sq(r);return Kn(wq(f).concat(_q(f)),Cq)}},YS="tinymce-url-history",kF=5,xF=r=>d(r)&&/^https?/.test(r),xq=r=>y(r)&&r.length<=kF&&Gt(r,xF),TF=r=>h(r)&&bs(r,f=>!xq(f)).isNone(),EF=()=>{const r=sv.getItem(YS);if(r===null)return{};let f;try{f=JSON.parse(r)}catch(g){if(g instanceof SyntaxError)return console.log("Local storage "+YS+" was not valid JSON",g),{};throw g}return TF(f)?f:(console.log("Local storage "+YS+" was not valid format",f),{})},AF=r=>{if(!TF(r))throw new Error(`Bad format for history:
|
|
`+JSON.stringify(r));sv.setItem(YS,JSON.stringify(r))},DF=r=>{const f=EF();return ln(f,r).getOr([])},eae=(r,f)=>{if(!xF(r))return;const g=EF(),v=ln(g,f).getOr([]),_=Kn(v,T=>T!==r);g[f]=[r].concat(_).slice(0,kF),AF(g)},Tq=r=>!!r,Xu=r=>Ns(fv.makeMap(r,/[, ]/),Tq),pT=r=>V.from(vB(r)),Eq=r=>{const f=V.from(y5(r)).filter(Tq).map(Xu);return pT(r).fold(tt,g=>f.fold(ot,v=>Xs(v).length>0?v:!1))},GA=(r,f)=>{const g=Eq(r);return E(g)?g?pT(r):V.none():g[f]?pT(r):V.none()},Aq=(r,f)=>GA(r,f).map(g=>v=>Yu.nu(_=>{const T=(I,W)=>{if(!d(I))throw new Error("Expected value to be string");if(W!==void 0&&!h(W))throw new Error("Expected meta to be a object");_({value:I,meta:W})},P={filetype:f,fieldname:v.fieldname,...V.from(v.meta).getOr({})};g.call(r,T,v.value,P)})),PF=r=>V.from(r).filter(d).getOrUndefined(),Dq=r=>wB(r)?V.some({targets:_1.find(r.getBody()),anchorTop:PF(_B(r)),anchorBottom:PF(T3(r))}):V.none(),Pq=r=>V.from(OB(r)),Mq=r=>({getHistory:DF,addToHistory:eae,getLinkInformation:()=>Dq(r),getValidationHandler:()=>Pq(r),getUrlPicker:f=>Aq(r,f)}),Rq=(r,f,g,v)=>{const _=Ho(!1),T=fq(f),P={icons:()=>f.ui.registry.getAll().icons,menuItems:()=>f.ui.registry.getAll().menuItems,translate:Cm.translate,isDisabled:()=>f.mode.isReadOnly()||!f.ui.isEnabled(),getOption:f.options.get},I=Mq(f),W=XA(f),J=cq(f),ie=pF(f),de=()=>_.get(),ge=Qt=>_.set(Qt),_e={shared:{providers:P,anchors:gF(f,g,v,T.isPositionedAtTop),header:T},urlinput:I,styles:W,colorinput:J,dialog:ie,isContextMenuOpen:de,setContextMenuState:ge},Ie={..._e,shared:{..._e.shared,interpreter:Qt=>US(Qt,{},Ie),getSink:r.popup}},it={..._e,shared:{..._e.shared,interpreter:Qt=>US(Qt,{},it),getSink:r.dialog}};return{popup:Ie,dialog:it}},$q=(r,f,g)=>{const v=(pn,Nn)=>{mt([f,...g],jn=>{jn.broadcastEvent(pn,Nn)})},_=(pn,Nn)=>{mt([f,...g],jn=>{jn.broadcastOn([pn],Nn)})},T=pn=>_(Dh(),{target:pn.target}),P=rh(),I=Mc(P,"touchstart",T),W=Mc(P,"touchmove",pn=>v(du(),pn)),J=Mc(P,"touchend",pn=>v(Bf(),pn)),ie=Mc(P,"mousedown",T),de=Mc(P,"mouseup",pn=>{pn.raw.button===0&&_(Hk(),{target:pn.target})}),ge=pn=>_(Dh(),{target:lt.fromDom(pn.target)}),_e=pn=>{pn.button===0&&_(Hk(),{target:lt.fromDom(pn.target)})},Ie=()=>{mt(r.editorManager.get(),pn=>{r!==pn&&pn.dispatch("DismissPopups",{relatedTarget:r})})},it=pn=>v(sg(),ll(pn)),Qt=pn=>{_(kb(),{}),v(gh(),ll(pn))},dt=$t(lt.fromDom(r.getElement())),ft=gb(dt,"scroll",pn=>{requestAnimationFrame(()=>{const Nn=r.getContainer();if(Nn!=null){const Ys=lw(r,f.element).map(ko=>[ko.element,...ko.others]).getOr([]);rn(Ys,ko=>xr(ko,pn.target))&&(r.dispatch("ElementScroll",{target:pn.target.dom}),v(ph(),pn))}})}),Yt=()=>_(kb(),{}),Dt=pn=>{pn.state&&_(Dh(),{target:lt.fromDom(r.getContainer())})},kn=pn=>{_(Dh(),{target:lt.fromDom(pn.relatedTarget.getContainer())})};r.on("PostRender",()=>{r.on("click",ge),r.on("tap",ge),r.on("mouseup",_e),r.on("mousedown",Ie),r.on("ScrollWindow",it),r.on("ResizeWindow",Qt),r.on("ResizeEditor",Yt),r.on("AfterProgressState",Dt),r.on("DismissPopups",kn)}),r.on("remove",()=>{r.off("click",ge),r.off("tap",ge),r.off("mouseup",_e),r.off("mousedown",Ie),r.off("ScrollWindow",it),r.off("ResizeWindow",Qt),r.off("ResizeEditor",Yt),r.off("AfterProgressState",Dt),r.off("DismissPopups",kn),ie.unbind(),I.unbind(),W.unbind(),J.unbind(),de.unbind(),ft.unbind()}),r.on("detach",()=>{mt([f,...g],Bk),mt([f,...g],pn=>pn.destroy())})},Rc=OP,S1=z0,KA=G([xt("shell",!1),nn("makeItem"),xt("setupItem",L),ym.field("listBehaviours",[gs])]),MF=Yd({name:"items",overrides:()=>({behaviours:Tn([gs.config({})])})}),Nq=G([MF]),RF=G("CustomList"),Iq=(r,f,g,v)=>{const _=(I,W)=>{P(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 ie=gs.contents(J),de=W.length,ge=de-ie.length,_e=ge>0?Et(ge,()=>r.makeItem()):[],Ie=ie.slice(de);mt(Ie,Qt=>gs.remove(J,Qt)),mt(_e,Qt=>gs.append(J,Qt));const it=gs.contents(J);mt(it,(Qt,dt)=>{r.setupItem(I,Qt,W[dt],dt)})})},T=r.shell?{behaviours:[gs.config({})],components:[]}:{behaviours:[],components:f},P=I=>r.shell?V.some(I):Ri(I,r,"items");return{uid:r.uid,dom:r.dom,components:T.components,behaviours:sc(r.listBehaviours,T.behaviours),apis:{setItems:_}}},$F=wu({name:RF(),configFields:KA(),partFields:Nq(),factory:Iq,apis:{setItems:(r,f,g)=>{r.setItems(f,g)}}}),gw=G([nn("dom"),xt("shell",!0),Wl("toolbarBehaviours",[gs])]),nae=G([Yd({name:"groups",overrides:()=>({behaviours:Tn([gs.config({})])})})]),Bq=(r,f,g,v)=>{const _=(I,W)=>{T(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=>{gs.set(J,W)})},T=I=>r.shell?V.some(I):Ri(I,r,"groups"),P=r.shell?{behaviours:[gs.config({})],components:[]}:{behaviours:[],components:f};return{uid:r.uid,dom:r.dom,components:P.components,behaviours:sc(r.toolbarBehaviours,P.behaviours),apis:{setGroups:_,refresh:L},domModification:{attributes:{role:"group"}}}},C1=wu({name:"Toolbar",configFields:gw(),partFields:nae(),factory:Bq,apis:{setGroups:(r,f,g)=>{r.setGroups(f,g)}}}),Lq=L,NF=tt,JA=G([]);var Fq=Object.freeze({__proto__:null,setup:Lq,isDocked:NF,getBehaviours:JA});const KR=r=>(ze(ea(r,"position"),"fixed")?V.none():Yf(r)).orThunk(()=>{const v=lt.fromTag("span");return Ha(r).bind(_=>{il(_,v);const T=Yf(v);return Mu(v),T})}),JR=r=>KR(r).map(Tc).getOrThunk(()=>pr(0,0)),Qq=(r,f)=>{const g=r.element;Na(g,f.transitionClass),va(g,f.fadeOutClass),Na(g,f.fadeInClass),f.onShow(r)},Zq=(r,f)=>{const g=r.element;Na(g,f.transitionClass),va(g,f.fadeInClass),Na(g,f.fadeOutClass),f.onHide(r)},Hq=(r,f)=>r.y<f.bottom&&r.bottom>f.y,IF=(r,f)=>r.y>=f.y,e4=(r,f)=>r.bottom<=f.bottom,t4=(r,f,g)=>({location:"top",leftX:f,topY:g.bounds.y-r.y}),e$=(r,f,g)=>({location:"bottom",leftX:f,bottomY:r.bottom-g.bounds.bottom}),t$=r=>r.box.x-r.win.x,zq=(r,f,g)=>{const v=f.win,_=f.box,T=t$(f);return tr(r,P=>{switch(P){case"bottom":return e4(_,g.bounds)?V.none():V.some(e$(v,T,g));case"top":return IF(_,g.bounds)?V.none():V.some(t4(v,T,g));default:return V.none()}}).getOr({location:"no-dock"})},Vq=(r,f,g)=>Gt(r,v=>{switch(v){case"bottom":return e4(f,g.bounds);case"top":return IF(f,g.bounds)}}),BF=(r,f)=>{const g=f.optScrollEnv.fold(G(r.bounds.y),v=>v.scrollElmTop+(r.bounds.y-v.currentScrollTop));return pr(r.bounds.x,g)},Wq=(r,f)=>{const g=f.optScrollEnv.fold(G(r.y),v=>r.y+v.currentScrollTop-v.scrollElmTop);return pr(r.x,g)},XS=(r,f,g)=>g.getInitialPos().map(v=>{const _=BF(v,f);return{box:ai(_.left,_.top,ta(r),Ii(r)),location:v.location}}),LF=(r,f,g,v,_)=>{const T=Wq(f,g),P=ai(T.left,T.top,f.width,f.height);v.setInitialPos({style:ri(r),position:Gr(r,"position")||"static",bounds:P,location:_.location})},n4=(r,f,g,v,_)=>{v.getInitialPos().fold(()=>LF(r,f,g,v,_),()=>L)},FF=(r,f,g)=>g.getInitialPos().bind(v=>{var _;switch(g.clearInitialPos(),v.position){case"static":return V.some({morph:"static"});case"absolute":const T=KR(r).getOr(Hi()),P=di(T),I=(_=T.dom.scrollTop)!==null&&_!==void 0?_:0;return V.some({morph:"absolute",positionCss:Zd("absolute",ln(v.style,"left").map(W=>f.x-P.x),ln(v.style,"top").map(W=>f.y-P.y+I),ln(v.style,"right").map(W=>P.right-f.right),ln(v.style,"bottom").map(W=>P.bottom-f.bottom))});default:return V.none()}}),n$=(r,f,g)=>XS(r,f,g).filter(({box:v})=>Vq(g.getModes(),v,f)).bind(({box:v})=>FF(r,v,g)),pw=r=>{switch(r.location){case"top":return V.some({morph:"fixed",positionCss:Zd("fixed",V.some(r.leftX),V.some(r.topY),V.none(),V.none())});case"bottom":return V.some({morph:"fixed",positionCss:Zd("fixed",V.some(r.leftX),V.none(),V.none(),V.some(r.bottomY))});default:return V.none()}},QF=(r,f,g)=>{const v=di(r),_=ue(),T=zq(g.getModes(),{win:_,box:v},f);return T.location==="top"||T.location==="bottom"?(LF(r,v,f,g,T),pw(T)):V.none()},Uq=(r,f,g)=>n$(r,f,g).orThunk(()=>f.optScrollEnv.bind(v=>XS(r,f,g)).bind(({box:v,location:_})=>{const T=ue(),P=t$({win:T,box:v}),I=_==="top"?t4(T,P,f):e$(T,P,f);return pw(I)})),ZF=(r,f,g)=>{const v=r.element;return ze(ea(v,"position"),"fixed")?Uq(v,f,g):QF(v,f,g)},HF=(r,f,g)=>{const v=r.element;return XS(v,f,g).bind(({box:_})=>FF(v,_,g))},zF=(r,f,g,v)=>{const _=di(r),T=ue(),P=t$({win:T,box:_}),I=v(T,P,f);return I.location==="bottom"||I.location==="top"?(n4(r,_,f,g,I),pw(I)):V.none()},VF=(r,f,g)=>{g.setDocked(!1),mt(["left","right","top","bottom","position"],v=>ks(r.element,v)),f.onUndocked(r)},bT=(r,f,g,v)=>{const _=v.position==="fixed";g.setDocked(_),db(r.element,v),(_?f.onDocked:f.onUndocked)(r)},vT=(r,f,g,v,_=!1)=>{f.contextual.each(T=>{T.lazyContext(r).each(P=>{const I=Hq(P,v.bounds);I!==g.isVisible()&&(g.setVisible(I),_&&!I?(cg(r.element,[T.fadeOutClass]),T.onHide(r)):(I?Qq:Zq)(r,T))})})},WF=(r,f,g,v,_)=>{vT(r,f,g,v,!0),bT(r,f,g,_.positionCss)},Yq=(r,f,g,v,_)=>{switch(_.morph){case"static":return VF(r,f,g);case"absolute":return bT(r,f,g,_.positionCss);case"fixed":return WF(r,f,g,v,_)}},jS=(r,f,g)=>{const v=f.lazyViewport(r);vT(r,f,g,v),ZF(r,v,g).each(_=>{Yq(r,f,g,v,_)})},UF=(r,f,g)=>{const v=r.element;g.setDocked(!1);const _=f.lazyViewport(r);HF(r,_,g).each(T=>{switch(T.morph){case"static":{VF(r,f,g);break}case"absolute":{bT(r,f,g,T.positionCss);break}}}),g.setVisible(!0),f.contextual.each(T=>{Xc(v,[T.fadeInClass,T.fadeOutClass,T.transitionClass]),T.onShow(r)}),o4(r,f,g)},o4=(r,f,g)=>{r.getSystem().isConnected()&&jS(r,f,g)},o$=(r,f,g)=>{g.isDocked()&&UF(r,f,g)},s4=r=>(f,g,v)=>{const _=g.lazyViewport(f);zF(f.element,_,v,r).each(P=>{WF(f,g,v,_,P)})},s$=s4(t4),Xq=s4(e$);var jq=Object.freeze({__proto__:null,refresh:o4,reset:o$,isDocked:(r,f,g)=>g.isDocked(),getModes:(r,f,g)=>g.getModes(),setModes:(r,f,g,v)=>g.setModes(v),forceDockToTop:s$,forceDockToBottom:Xq}),qq=Object.freeze({__proto__:null,events:(r,f)=>li([lg(Jg(),(g,v)=>{r.contextual.each(_=>{uf(g.element,_.transitionClass)&&(Xc(g.element,[_.transitionClass,_.fadeInClass]),(f.isVisible()?_.onShown:_.onHidden)(g)),v.stop()})}),on(sg(),(g,v)=>{o4(g,r,f)}),on(ph(),(g,v)=>{o4(g,r,f)}),on(gh(),(g,v)=>{o$(g,r,f)})])}),Gq=[Xa("contextual",[xa("fadeInClass"),xa("fadeOutClass"),xa("transitionClass"),Wc("lazyContext"),qs("onShow"),qs("onShown"),qs("onHide"),qs("onHidden")]),qa("lazyViewport",()=>({bounds:ue(),optScrollEnv:V.none()})),lu("modes",["top","bottom"],bl),qs("onDocked"),qs("onUndocked")],Kq=Object.freeze({__proto__:null,init:r=>{const f=Ho(!1),g=Ho(!0),v=Xi(),_=Ho(r.modes),T=()=>`docked: ${f.get()}, visible: ${g.get()}, modes: ${_.get().join(",")}`;return mu({isDocked:f.get,setDocked:f.set,getInitialPos:v.get,setInitialPos:v.set,clearInitialPos:v.clear,isVisible:g.get,setVisible:g.set,getModes:_.get,setModes:_.set,readState:T})}});const _l=nc({fields:Gq,name:"docking",active:qq,apis:jq,state:Kq}),r4=G(io("toolbar-height-change")),$b={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},qS="tox-tinymce--toolbar-sticky-on",XF="tox-tinymce--toolbar-sticky-off",Jq=(r,f)=>{const g=ca(f),_=Qc(f).dom.innerHeight,T=dc(g),P=lt.fromDom(r.elm),I=Zl(P),W=Ii(P),J=I.y,ie=J+W,de=Tc(f),ge=Ii(f),_e=de.top,Ie=_e+ge,it=Math.abs(_e-T.top)<2,Qt=Math.abs(Ie-(T.top+_))<2;if(it&&J<Ie)Jh(T.left,J-ge,g);else if(Qt&&ie>_e){const dt=J-_+W+ge;Jh(T.left,dt,g)}},GS=(r,f)=>st(_l.getModes(r),f),i4=r=>{const f=v=>Xf(v)+(parseInt(Gr(v,"margin-top"),10)||0)+(parseInt(Gr(v,"margin-bottom"),10)||0),g=r.element;xc(g).each(v=>{const _="padding-"+_l.getModes(r)[0];if(_l.isDocked(r)){const T=ta(v);ro(g,"width",T+"px"),ro(v,_,f(g)+"px")}else ks(g,"width"),ks(v,_)})},jF=(r,f)=>{f?(va(r,$b.fadeOutClass),cg(r,[$b.transitionClass,$b.fadeInClass])):(va(r,$b.fadeInClass),cg(r,[$b.fadeOutClass,$b.transitionClass]))},qF=(r,f)=>{const g=lt.fromDom(r.getContainer());f?(Na(g,qS),va(g,XF)):(Na(g,XF),va(g,qS))},eG=(r,f)=>{const g=ca(f);Qf(g).filter(v=>!xr(f,v)).filter(v=>xr(v,lt.fromDom(g.dom.body))||Za(r,v)).each(()=>gf(f))},tG=(r,f)=>al(r).orThunk(()=>f().toOptional().bind(g=>al(g.element))),nG=(r,f,g)=>{r.inline||(f.header.isPositionedAtTop()||r.on("ResizeEditor",()=>{g().each(_l.reset)}),r.on("ResizeWindow ResizeEditor",()=>{g().each(i4)}),r.on("SkinLoaded",()=>{g().each(v=>{_l.isDocked(v)?_l.reset(v):_l.refresh(v)})}),r.on("FullscreenStateChanged",()=>{g().each(_l.reset)})),r.on("AfterScrollIntoView",v=>{g().each(_=>{_l.refresh(_);const T=_.element;Vu(T)&&Jq(v,T)})}),r.on("PostRender",()=>{qF(r,!1)})},oG=r=>r().map(_l.isDocked).getOr(!1),sG=()=>[Pc.config({channels:{[r4()]:{onReceive:i4}}})],GF=(r,f)=>{const g=Xi(),v=f.getSink,_=I=>{v().each(W=>I(W.element))},T=I=>{r.inline||i4(I),qF(r,_l.isDocked(I)),I.getSystem().broadcastOn([kb()],{}),v().each(W=>W.getSystem().broadcastOn([kb()],{}))},P=r.inline?[]:sG();return[ns.config({}),_l.config({contextual:{lazyContext:I=>{const W=Xf(I.element),J=r.inline?r.getContentAreaContainer():r.getContainer();return V.from(J).map(ie=>{const de=di(lt.fromDom(ie));return lw(r,I.element).fold(()=>{const _e=de.height-W,Ie=de.y+(GS(I,"top")?0:W);return ai(de.x,Ie,de.width,_e)},_e=>{const Ie=Vp(de,NS(_e)),it=GS(I,"top")?Ie.y:Ie.y+W;return ai(Ie.x,it,Ie.width,Ie.height-W)})})},onShow:()=>{_(I=>jF(I,!0))},onShown:I=>{_(W=>Xc(W,[$b.transitionClass,$b.fadeInClass])),g.get().each(W=>{eG(I.element,W),g.clear()})},onHide:I=>{tG(I.element,v).fold(g.clear,g.set),_(W=>jF(W,!1))},onHidden:()=>{_(I=>Xc(I,[$b.transitionClass]))},...$b},lazyViewport:I=>lw(r,I.element).fold(()=>{const J=ue(),ie=x3(r),de=J.y+(GS(I,"top")?ie:0),ge=J.height-(GS(I,"bottom")?ie:0);return{bounds:ai(J.x,de,J.width,ge),optScrollEnv:V.none()}},J=>({bounds:NS(J),optScrollEnv:V.some({currentScrollTop:J.element.dom.scrollTop,scrollElmTop:Tc(J.element).top})})),modes:[f.header.getDockingMode()],onDocked:T,onUndocked:T}),...P]};var rG=Object.freeze({__proto__:null,setup:nG,isDocked:oG,getBehaviours:GF});const aae=r=>{const f=r.editor,g=r.sticky?GF:JA;return{uid:r.uid,dom:r.dom,components:r.components,behaviours:Tn(g(f,r.sharedBackstage))}},iG=fo([$l,Kr("items",Jn([ch([Q3,Hl("items",bl)]),bl]))].concat(ES)),KF=r=>Ui("GroupToolbarButton",iG,r),JF=[Jl("text"),Jl("tooltip"),Jl("icon"),Dc("search",!1,Jn([Iu,fo([Jl("placeholder")])],r=>E(r)?r?V.some({placeholder:V.none()}):V.none():V.some(r))),Wc("fetch"),qa("onSetup",()=>L)],OT=fo([$l,...JF]),r$=r=>Ui("menubutton",OT,r),aG=fo([$l,tv,kg,MO,XB,H3,ew,Bu("presets","normal",["normal","color","listpreview"]),z3(1),$h,I5]),lG=r=>Ui("SplitButton",aG,r);var i$=Kc({factory:(r,f)=>{const g=(_,T)=>{const P=je(T,I=>{const W={type:"menubutton",text:I.text,fetch:ie=>{ie(I.getItems())}},J=r$(W).mapError(ie=>Rd(ie)).getOrDie();return lT(J,"tox-mbtn",f.backstage,V.some("menuitem"))});gs.set(_,P)},v={focus:No.focusIn,setMenus:g};return{uid:r.uid,dom:r.dom,components:[],behaviours:Tn([gs.config({}),xs("menubar-events",[Ci(_=>{r.onSetup(_)}),on(Tl(),(_,T)=>{sa(_.element,".tox-mbtn--active").each(P=>{df(T.event.target,".tox-mbtn").each(I=>{xr(P,I)||_.getSystem().getByDom(P).each(W=>{_.getSystem().getByDom(I).each(J=>{Eg.expand(J),Eg.close(W),ns.focus(J)})})})})}),on(Rv(),(_,T)=>{T.event.prevFocus.bind(P=>_.getSystem().getByDom(P).toOptional()).each(P=>{T.event.newFocus.bind(I=>_.getSystem().getByDom(I).toOptional()).each(I=>{Eg.isOpen(P)&&(Eg.expand(I),Eg.close(P))})})})]),No.config({mode:"flow",selector:".tox-mbtn",onEscape:_=>(r.onEscape(_),V.some(!0))}),Ka.config({})]),apis:v,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[nn("dom"),nn("uid"),nn("onEscape"),nn("backstage"),xt("onSetup",L)],apis:{focus:(r,f)=>{r.focus(f)},setMenus:(r,f,g)=>{r.setMenus(f,g)}}});const cG="\u26A1\uFE0FUpgrade",uG="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_source=TinyMCE&utm_medium=SPAP&utm_campaign=SPAP&utm_id=editorreferral",fG=r=>({uid:r.uid,dom:r.dom,components:[{dom:{tag:"a",attributes:{href:uG,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:cG}}]}),a$="container",e9=[Wl("slotBehaviours",[])],t9=r=>"<alloy.field."+r+">",n9=r=>{const f=(()=>{const T=[];return{slot:(I,W)=>(T.push(I),WE(a$,t9(I),W)),record:G(T)}})(),g=r(f),v=f.record(),_=je(v,T=>Gc({name:T,pname:t9(T)}));return ix(a$,e9,_,dG,g)},dG=(r,f)=>{const g=it=>XE(r),v=(it,Qt)=>Ri(it,r,Qt),_=(it,Qt)=>(dt,ft)=>Ri(dt,r,ft).map(Yt=>it(Yt,ft)).getOr(Qt),T=it=>(Qt,dt)=>{mt(dt,ft=>it(Qt,ft))},P=(it,Qt)=>zi(it.element,"aria-hidden")!=="true",I=(it,Qt)=>{if(!P(it)){const dt=it.element;ks(dt,"display"),Ue(dt,"aria-hidden"),Ao(it,$v(),{name:Qt,visible:!0})}},W=(it,Qt)=>{if(P(it)){const dt=it.element;ro(dt,"display","none"),qn(dt,"aria-hidden","true"),Ao(it,$v(),{name:Qt,visible:!1})}},J=_(P,!1),ie=_(W),de=T(ie),ge=it=>de(it,g()),_e=_(I),Ie={getSlotNames:g,getSlot:v,isShowing:J,hideSlot:ie,hideAllSlots:ge,showSlot:_e};return{uid:r.uid,dom:r.dom,components:f,behaviours:Om(r.slotBehaviours),apis:Ie}},wf={...Ns({getSlotNames:(r,f)=>r.getSlotNames(f),getSlot:(r,f,g)=>r.getSlot(f,g),isShowing:(r,f,g)=>r.isShowing(f,g),hideSlot:(r,f,g)=>r.hideSlot(f,g),hideAllSlots:(r,f)=>r.hideAllSlots(f),showSlot:(r,f,g)=>r.showSlot(f,g)},r=>ap(r)),sketch:n9},bw=fo([kg,tv,qa("onShow",L),qa("onHide",L),ew]),o9=r=>Ui("sidebar",bw,r),yT=r=>{const{sidebars:f}=r.ui.registry.getAll();mt(Xs(f),g=>{const v=f[g],_=()=>ze(V.from(r.queryCommandValue("ToggleSidebar")),g);r.ui.registry.addToggleButton(g,{icon:v.icon,tooltip:v.tooltip,onAction:T=>{r.execCommand("ToggleSidebar",!1,g),T.setActive(_())},onSetup:T=>{T.setActive(_());const P=()=>T.setActive(_());return r.on("ToggleSidebar",P),()=>{r.off("ToggleSidebar",P)}}})})},a4=r=>({element:()=>r.element.dom}),s9=(r,f)=>{const g=je(Xs(f),v=>{const _=f[v],T=ba(o9(_));return{name:v,getApi:a4,onSetup:T.onSetup,onShow:T.onShow,onHide:T.onHide}});return je(g,v=>{const _=Ho(L);return r.slot(v.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:AS.unnamedEvents([nv(v,_),ov(v,_),on($v(),(T,P)=>{const I=P.event;kt(g,J=>J.name===I.name).each(J=>{(I.visible?J.onShow:J.onHide)(J.getApi(T))})})])})})},r9=r=>wf.sketch(f=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:s9(f,r),slotBehaviours:AS.unnamedEvents([Ci(g=>wf.hideAllSlots(g))])})),i9=(r,f,g)=>{cr.getCurrent(r).each(_=>{gs.set(_,[r9(f)]);const T=g==null?void 0:g.toLowerCase();d(T)&&vs(f,T)&&cr.getCurrent(_).each(P=>{wf.showSlot(P,T),Bh.immediateGrow(_),ks(_.element,"width"),l$(r.element,"region")})})},l$=(r,f)=>{qn(r,"role",f)},hG=(r,f)=>{cr.getCurrent(r).each(v=>{cr.getCurrent(v).each(T=>{Bh.hasGrown(v)?wf.isShowing(T,f)?(Bh.shrink(v),l$(r.element,"presentation")):(wf.hideAllSlots(T),wf.showSlot(T,f),l$(r.element,"region")):(wf.hideAllSlots(T),wf.showSlot(T,f),Bh.grow(v),l$(r.element,"region"))})})},mG=r=>cr.getCurrent(r).bind(g=>Bh.isGrowing(g)||Bh.hasGrown(g)?cr.getCurrent(g).bind(T=>kt(wf.getSlotNames(T),P=>wf.isShowing(T,P))):V.none()),c$=io("FixSizeEvent"),u$=io("AutoSizeEvent"),gG=r=>({uid:r.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Tn([Ka.config({}),ns.config({}),Bh.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:f=>{cr.getCurrent(f).each(wf.hideAllSlots),rr(f,u$)},onGrown:f=>{rr(f,u$)},onStartGrow:f=>{Ao(f,c$,{width:ea(f.element,"width").getOr("")})},onStartShrink:f=>{Ao(f,c$,{width:ta(f.element)+"px"})}}),gs.config({}),cr.config({find:f=>{const g=gs.contents(f);return Ss(g)}})])}],behaviours:Tn([Ep.childAt(0),xs("sidebar-sliding-events",[on(c$,(f,g)=>{ro(f.element,"width",g.event.width)}),on(u$,(f,g)=>{ks(f.element,"width")})])])});var pG=Object.freeze({__proto__:null,block:(r,f,g,v)=>{qn(r.element,"aria-busy",!0);const _=f.getRoot(r).getOr(r),T=Tn([No.config({mode:"special",onTab:()=>V.some(!0),onShiftTab:()=>V.some(!0)}),ns.config({})]),P=v(_,T),I=_.getSystem().build(P);gs.append(_,gu(I)),I.hasConfigured(No)&&f.focus&&No.focusIn(I),g.isBlocked()||f.onBlock(r),g.blockWith(()=>gs.remove(_,I))},unblock:(r,f,g)=>{Ue(r.element,"aria-busy"),g.isBlocked()&&f.onUnblock(r),g.clear()},isBlocked:(r,f,g)=>g.isBlocked()}),bG=[qa("getRoot",V.none),ja("focus",!0),qs("onBlock"),qs("onUnblock")],vG=Object.freeze({__proto__:null,init:()=>{const r=mp(),f=g=>{r.set({destroy:g})};return mu({readState:r.isSet,blockWith:f,clear:r.clear,isBlocked:r.isSet})}});const Lh=nc({fields:bG,name:"blocking",apis:pG,state:vG}),c9=r=>{const f=r.dom.attributes!==void 0?r.dom.attributes:[];return Yo(f,(g,v)=>v.name==="class"?g:{...g,[v.name]:v.value},{})},OG=r=>Array.prototype.slice.call(r.dom.classList,0),UO=r=>{const f=lt.fromHtml(r),g=Xl(f),v=c9(f),_=OG(f),T=g.length===0?{}:{innerHtml:jp(f)};return{tag:gl(f),classes:_,attributes:v,...T}},yG=r=>(f,g)=>({dom:{tag:"div",attributes:{"aria-label":r.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:UO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),u9=r=>cr.getCurrent(r).each(f=>gf(f.element)),wG=(r,f)=>{const g="tabindex",v=`data-mce-${g}`;V.from(r.iframeElement).map(lt.fromDom).each(_=>{f?(me(_,g).each(T=>qn(_,v,T)),qn(_,g,-1)):(Ue(_,g),me(_,v).each(T=>{qn(_,g,T),Ue(_,v)}))})},_G=(r,f,g,v)=>{const _=f.element;if(wG(r,g),g)Lh.block(f,yG(v)),ks(_,"display"),Ue(_,"aria-hidden"),r.hasFocus()&&u9(f);else{const T=cr.getCurrent(f).exists(P=>i1(P.element));Lh.unblock(f),ro(_,"display","none"),qn(_,"aria-hidden","true"),T&&r.focus()}},f9=r=>({uid:r.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Tn([gs.config({}),Lh.config({focus:!1}),cr.config({find:f=>Ss(f.components())})]),components:[]}),d9=r=>r.type==="focusin",SG=r=>d9(r)?(r.composed?Ss(r.composedPath()):V.from(r.target)).map(lt.fromDom).filter(yr).exists(g=>uf(g,"mce-pastebin")):!1,CG=(r,f,g)=>{const v=Ho(!1),_=Xi(),T=I=>{v.get()&&!SG(I)&&(I.preventDefault(),u9(f()),r.editorManager.setActive(r))};r.inline||r.on("PreInit",()=>{r.dom.bind(r.getWin(),"focusin",T),r.on("BeforeExecCommand",I=>{I.command.toLowerCase()==="mcefocus"&&I.value!==!0&&T(I)})});const P=I=>{I!==v.get()&&(v.set(I),_G(r,f(),I,g.providers),BU(r,I))};r.on("ProgressState",I=>{if(_.on(clearTimeout),U(I.time)){const W=S3.setEditorTimeout(r,()=>P(I.state),I.time);_.set(W)}else P(I.state),_.clear()})},c4=(r,f)=>Yo(r,(_,T)=>f(T,_.len).fold(G(_),I=>({len:I.finish,list:_.list.concat([I])})),{len:0,list:[]}).list,KS=(r,f,g)=>({within:r,extra:f,withinWidth:g}),h9=(r,f,g)=>{const v=c4(r,(I,W)=>{const J=g(I);return V.some({element:I,start:W,finish:W+J,width:J})}),_=Kn(v,I=>I.finish<=f),T=so(_,(I,W)=>I+W.width,0),P=v.slice(_.length);return{within:_,extra:P,withinWidth:T}},u4=r=>je(r,f=>f.element),kG=(r,f,g)=>{const v=u4(r.concat(f));return KS(v,[],g)},xG=(r,f,g,v)=>{const _=u4(r).concat([g]);return KS(_,u4(f),v)},f$=(r,f,g)=>KS(u4(r),[],g),d$=(r,f,g)=>{const v=h9(f,r,g);return v.extra.length===0?V.some(v):V.none()},TG=(r,f,g,v)=>{const _=d$(r,f,g).getOrThunk(()=>h9(f,r-g(v),g)),T=_.within,P=_.extra,I=_.withinWidth;return P.length===1&&P[0].width<=g(v)?kG(T,P,I):P.length>=1?xG(T,P,v,I):f$(T,P,I)},f4=(r,f)=>{const g=je(f,v=>gu(v));C1.setGroups(r,g)},EG=r=>tr(r,f=>al(f.element).bind(g=>f.getSystem().getByDom(g).toOptional())),m9=(r,f,g)=>{const v=f.builtGroups.get();if(v.length===0)return;const _=u1(r,f,"primary"),T=ul.getCoupled(r,"overflowGroup");ro(_.element,"visibility","hidden");const P=v.concat([T]),I=EG(P);g([]),f4(_,P);const W=ta(_.element),J=TG(W,f.builtGroups.get(),ie=>ta(ie.element),T);J.extra.length===0?(gs.remove(_,T),g([])):(f4(_,J.within),g(J.extra)),ks(_.element,"visibility"),ru(_.element),I.each(ns.focus)},g9=G([Wl("splitToolbarBehaviours",[ul]),ka("builtGroups",()=>Ho([]))]),AG=G([hf(["overflowToggledClass"]),jm("getOverflowBounds"),nn("lazySink"),ka("overflowGroups",()=>Ho([])),qs("onOpened"),qs("onClosed")].concat(g9())),DG=G([Gc({factory:C1,schema:gw(),name:"primary"}),Mh({schema:gw(),name:"overflow"}),Mh({name:"overflow-button"}),Mh({name:"overflow-group"})]),p9=G((r,f)=>{Kb(r,Math.floor(f))}),uae=G([hf(["toggledClass"]),nn("lazySink"),Wc("fetch"),jm("getBounds"),Xa("fireDismissalEventInstead",[xt("event",rg())]),Eh(),qs("onToggled")]),b9=G([Mh({name:"button",overrides:r=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Tn([Ms.config({toggleClass:r.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:r.onToggled})])})}),Mh({factory:C1,schema:gw(),name:"toolbar",overrides:r=>({toolbarBehaviours:Tn([No.config({mode:"cyclic",onEscape:f=>(Ri(f,r,"button").each(ns.focus),V.none())})])})})]),d4=Xi(),v9=(r,f)=>{d4.set(!0),h$(r,f),d4.clear()},h$=(r,f)=>{const g=ul.getCoupled(r,"toolbarSandbox");Gs.isOpen(g)?Gs.close(g):Gs.open(g,f.toolbar())},m$=(r,f,g,v)=>{const _=g.getBounds.map(P=>P()),T=g.lazySink(r).getOrDie();yu.positionWithinBounds(T,f,{anchor:{type:"hotspot",hotspot:r,layouts:v,overrides:{maxWidthFunction:p9()}}},_)},O9=(r,f,g,v,_)=>{C1.setGroups(f,_),m$(r,f,g,v),Ms.on(r)},PG=(r,f,g)=>{const v=Xy(),_=(P,I)=>{const W=d4.get().getOr(!1);g.fetch().get(J=>{O9(r,I,g,f.layouts,J),v.link(r.element),W||No.focusIn(I)})},T=()=>{Ms.off(r),d4.get().getOr(!1)||ns.focus(r),v.unlink(r.element)};return{dom:{tag:"div",attributes:{id:v.id}},behaviours:Tn([No.config({mode:"special",onEscape:P=>(Gs.close(P),V.some(!0))}),Gs.config({onOpen:_,onClose:T,isPartOf:(P,I,W)=>t1(I,W)||t1(r,W),getAttachPoint:()=>g.lazySink(r).getOrDie()}),Pc.config({channels:{...OO({isExtraPart:tt,...g.fireDismissalEventInstead.map(P=>({fireEventInstead:{event:P.event}})).getOr({})}),...zk({doReposition:()=>{Gs.getState(ul.getCoupled(r,"toolbarSandbox")).each(P=>{m$(r,P,g,f.layouts)})}})}})])}},gv=wu({name:"FloatingToolbarButton",factory:(r,f,g,v)=>({...Jc.sketch({...v.button(),action:_=>{h$(_,v)},buttonBehaviours:ym.augment({dump:v.button().buttonBehaviours},[ul.config({others:{toolbarSandbox:_=>PG(_,g,r)}})])}),apis:{setGroups:(_,T)=>{Gs.getState(ul.getCoupled(_,"toolbarSandbox")).each(P=>{O9(_,P,r,g.layouts,T)})},reposition:_=>{Gs.getState(ul.getCoupled(_,"toolbarSandbox")).each(T=>{m$(_,T,r,g.layouts)})},toggle:_=>{h$(_,v)},toggleWithoutFocusing:_=>{v9(_,v)},getToolbar:_=>Gs.getState(ul.getCoupled(_,"toolbarSandbox")),isOpen:_=>Gs.isOpen(ul.getCoupled(_,"toolbarSandbox"))}}),configFields:uae(),partFields:b9(),apis:{setGroups:(r,f,g)=>{r.setGroups(f,g)},reposition:(r,f)=>{r.reposition(f)},toggle:(r,f)=>{r.toggle(f)},toggleWithoutFocusing:(r,f)=>{r.toggleWithoutFocusing(f)},getToolbar:(r,f)=>r.getToolbar(f),isOpen:(r,f)=>r.isOpen(f)}}),MG=G([nn("items"),hf(["itemSelector"]),Wl("tgroupBehaviours",[No])]),RG=G([hd({name:"items",unit:"item"})]),$G=(r,f,g,v)=>({uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.tgroupBehaviours,[No.config({mode:"flow",selector:r.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),g$=wu({name:"ToolbarGroup",configFields:MG(),partFields:RG(),factory:$G}),NG=r=>je(r,f=>gu(f)),p$=(r,f,g)=>{m9(r,g,v=>{g.overflowGroups.set(v),f.getOpt(r).each(_=>{gv.setGroups(_,NG(v))})})},y9=(r,f,g,v)=>{const _=oi(gv.sketch({fetch:()=>Yu.nu(T=>{T(NG(r.overflowGroups.get()))}),layouts:{onLtr:()=>[ec,vl],onRtl:()=>[vl,ec],onBottomLtr:()=>[Zr,Qu],onBottomRtl:()=>[Qu,Zr]},getBounds:g.getOverflowBounds,lazySink:r.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:r.markers.overflowToggledClass},parts:{button:v["overflow-button"](),toolbar:v.overflow()},onToggled:(T,P)=>r[P?"onOpened":"onClosed"](T)}));return{uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.splitToolbarBehaviours,[ul.config({others:{overflowGroup:()=>g$.sketch({...v["overflow-group"](),items:[_.asSpec()]})}})]),apis:{setGroups:(T,P)=>{r.builtGroups.set(je(P,T.getSystem().build)),p$(T,_,r)},refresh:T=>p$(T,_,r),toggle:T=>{_.getOpt(T).each(P=>{gv.toggle(P)})},toggleWithoutFocusing:T=>{_.getOpt(T).each(gv.toggleWithoutFocusing)},isOpen:T=>_.getOpt(T).map(gv.isOpen).getOr(!1),reposition:T=>{_.getOpt(T).each(P=>{gv.reposition(P)})},getOverflow:T=>_.getOpt(T).bind(gv.getToolbar)},domModification:{attributes:{role:"group"}}}},w9=wu({name:"SplitFloatingToolbar",configFields:AG(),partFields:DG(),factory:y9,apis:{setGroups:(r,f,g)=>{r.setGroups(f,g)},refresh:(r,f)=>{r.refresh(f)},reposition:(r,f)=>{r.reposition(f)},toggle:(r,f)=>{r.toggle(f)},toggleWithoutFocusing:(r,f)=>{r.toggle(f)},isOpen:(r,f)=>r.isOpen(f),getOverflow:(r,f)=>r.getOverflow(f)}}),IG=G([hf(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),qs("onOpened"),qs("onClosed")].concat(g9())),Em=G([Gc({factory:C1,schema:gw(),name:"primary"}),Gc({factory:C1,schema:gw(),name:"overflow",overrides:r=>({toolbarBehaviours:Tn([Bh.config({dimension:{property:"height"},closedClass:r.markers.closedClass,openClass:r.markers.openClass,shrinkingClass:r.markers.shrinkingClass,growingClass:r.markers.growingClass,onShrunk:f=>{Ri(f,r,"overflow-button").each(g=>{Ms.off(g),ns.focus(g)}),r.onClosed(f)},onGrown:f=>{No.focusIn(f),r.onOpened(f)},onStartGrow:f=>{Ri(f,r,"overflow-button").each(Ms.on)}}),No.config({mode:"acyclic",onEscape:f=>(Ri(f,r,"overflow-button").each(ns.focus),V.some(!0))})])})}),Mh({name:"overflow-button",overrides:r=>({buttonBehaviours:Tn([Ms.config({toggleClass:r.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),Mh({name:"overflow-group"})]),BG=(r,f)=>Ri(r,f,"overflow").map(Bh.hasGrown).getOr(!1),b$=(r,f)=>{Ri(r,f,"overflow-button").bind(()=>Ri(r,f,"overflow")).each(g=>{h4(r,f),Bh.toggleGrow(g)})},h4=(r,f)=>{Ri(r,f,"overflow").each(g=>{m9(r,f,v=>{const _=je(v,T=>gu(T));C1.setGroups(g,_)}),Ri(r,f,"overflow-button").each(v=>{Bh.hasGrown(g)&&Ms.on(v)}),Bh.refresh(g)})},LG=(r,f,g,v)=>{const _="alloy.toolbar.toggle",T=(P,I)=>{const W=je(I,P.getSystem().build);r.builtGroups.set(W)};return{uid:r.uid,dom:r.dom,components:f,behaviours:sc(r.splitToolbarBehaviours,[ul.config({others:{overflowGroup:P=>g$.sketch({...v["overflow-group"](),items:[Jc.sketch({...v["overflow-button"](),action:I=>{rr(P,_)}})]})}}),xs("toolbar-toggle-events",[on(_,P=>{b$(P,r)})])]),apis:{setGroups:(P,I)=>{T(P,I),h4(P,r)},refresh:P=>h4(P,r),toggle:P=>b$(P,r),isOpen:P=>BG(P,r)},domModification:{attributes:{role:"group"}}}},vw=wu({name:"SplitSlidingToolbar",configFields:IG(),partFields:Em(),factory:LG,apis:{setGroups:(r,f,g)=>{r.setGroups(f,g)},refresh:(r,f)=>{r.refresh(f)},toggle:(r,f)=>{r.toggle(f)},isOpen:(r,f)=>r.isOpen(f)}}),_9=r=>{const f=r.title.fold(()=>({}),g=>({attributes:{title:g}}));return{dom:{tag:"div",classes:["tox-toolbar__group"],...f},components:[g$.parts.items({})],items:r.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({}),ns.config({})])}},Ow=r=>g$.sketch(_9(r)),S9=(r,f)=>{const g=Ci(v=>{const _=je(r.initGroups,Ow);C1.setGroups(v,_)});return Tn([xg.toolbarButton(r.providers.isDisabled),rc(),No.config({mode:f,onEscape:r.onEscape,selector:".tox-toolbar__group"}),xs("toolbar-events",[g])])},_T=r=>{const f=r.cyclicKeying?"cyclic":"acyclic";return{uid:r.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":_9({title:V.none(),items:[]}),"overflow-button":G7({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(),r.providers)},splitToolbarBehaviours:S9(r,f)}},FG=r=>{const f=_T(r),g=4,v=w9.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return w9.sketch({...f,lazySink:r.getSink,getOverflowBounds:()=>{const _=r.moreDrawerData.lazyHeader().element,T=Zl(_),P=Eu(_),I=Zl(P),W=Math.max(P.dom.scrollHeight,I.height);return ai(T.x+g,I.y,T.width-g*2,W)},parts:{...f.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r.attributes}}},components:[v],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:_=>r.onToggled(_,!0),onClosed:_=>r.onToggled(_,!1)})},QG=r=>{const f=vw.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),g=vw.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),v=_T(r);return vw.sketch({...v,components:[f,g],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:_=>{_.getSystem().broadcastOn([r4()],{type:"opened"}),r.onToggled(_,!0)},onClosed:_=>{_.getSystem().broadcastOn([r4()],{type:"closed"}),r.onToggled(_,!1)}})},jd=r=>{const f=r.cyclicKeying?"cyclic":"acyclic";return C1.sketch({uid:r.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(r.type===Cg.scrolling?["tox-toolbar--scrolling"]:[])},components:[C1.parts.groups({})],toolbarBehaviours:S9(r,f)})},C9=[MO,kg,Jl("tooltip"),Bu("buttonType","secondary",["primary","secondary"]),ja("borderless",!1),Wc("onAction")],m4=[...C9,m1,Ua("type",["button"])],k9=[...C9,ja("active",!1),Ua("type",["togglebutton"])],v$={button:m4,togglebutton:k9},ZG=[Ua("type",["group"]),lu("buttons",[],xl("type",v$))],x9=xl("type",{...v$,group:ZG}),HG=fo([lu("buttons",[],x9),Wc("onShow"),Wc("onHide")]),zG=r=>Ui("view",HG,r),VG=(r,f)=>{var g,v;const _=r.type==="togglebutton",T=r.icon.map(Yt=>zO(Yt,f.icons)).map(oi),I=(()=>Yt=>{const Dt=Nn=>{T.map(jn=>jn.getOpt(Yt).each(Ys=>{gs.set(Ys,[zO(Nn,f.icons)])}))},kn=Nn=>{const jn=Yt.element;Nn?(Na(jn,"tox-button--enabled"),qn(jn,"aria-pressed",!0)):(va(jn,"tox-button--enabled"),Ue(jn,"aria-pressed"))},pn=()=>uf(Yt.element,"tox-button--enabled");if(_)return r.onAction({setIcon:Dt,setActive:kn,isActive:pn});if(r.type==="button")return r.onAction({setIcon:Dt})})(),W={...r,name:_?r.text.getOr(r.icon.getOr("")):(g=r.text)!==null&&g!==void 0?g:r.icon.getOr(""),primary:r.buttonType==="primary",buttonType:V.from(r.buttonType),tooltip:r.tooltip,icon:r.icon,enabled:!0,borderless:r.borderless},J=NR((v=r.buttonType)!==null&&v!==void 0?v:"secondary"),ie=_?r.text.map(f.translate):V.some(f.translate(r.text)),de=ie.map(Li),ge=W.tooltip.or(ie).map(Yt=>({"aria-label":f.translate(Yt),title:f.translate(Yt)})).getOr({}),_e=T.map(Yt=>Yt.asSpec()),Ie=PS([_e,de]),it=r.icon.isSome()&&de.isSome(),Qt={tag:"button",classes:J.concat(...r.icon.isSome()&&!it?["tox-button--icon"]:[]).concat(...it?["tox-button--icon-and-text"]:[]).concat(...r.borderless?["tox-button--naked"]:[]).concat(...r.type==="togglebutton"&&r.active?["tox-button--enabled"]:[]),attributes:ge},dt=[],ft=FA(W,V.some(I),dt,Qt,Ie,f);return Jc.sketch(ft)},T9=(r,f)=>VG(r,f),WG=(r,f)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:je(r.buttons,g=>T9(g,f))}),E9=an().deviceType,UG=E9.isPhone(),A9=E9.isTablet(),D9=r=>{let f=!1;const g=je(r.buttons,v=>v.type==="group"?(f=!0,WG(v,r.providers)):T9(v,r.providers));return{uid:r.uid,dom:{tag:"div",classes:[f?"tox-view__toolbar":"tox-view__header",...UG||A9?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:Tn([ns.config({}),No.config({mode:"flow",selector:"button, .tox-button",focusInside:h1.OnEnterOrSpaceMode})]),components:f?g:[v1.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),v1.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:g})]}},P9=r=>({uid:r.uid,dom:{tag:"div",classes:["tox-view__pane"]}}),YG=(r,f,g,v)=>{const _={getPane:T=>Rc.getPart(T,r,"pane"),getOnShow:T=>r.viewConfig.onShow,getOnHide:T=>r.viewConfig.onHide};return{uid:r.uid,dom:r.dom,components:f,apis:_}};var yw=wu({name:"silver.View",configFields:[nn("viewConfig")],partFields:[Yd({factory:{sketch:D9},schema:[nn("buttons"),nn("providers")],name:"header"}),Yd({factory:{sketch:P9},schema:[],name:"pane"})],factory:YG,apis:{getPane:(r,f)=>r.getPane(f),getOnShow:(r,f)=>r.getOnShow(f),getOnHide:(r,f)=>r.getOnHide(f)}});const M9=(r,f,g)=>aa(f,(v,_)=>{const T=ba(zG(v));return r.slot(_,yw.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:T,components:[...T.buttons.length>0?[yw.parts.header({buttons:T.buttons,providers:g})]:[],yw.parts.pane({})]}))}),R9=(r,f)=>wf.sketch(g=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:M9(g,r,f),slotBehaviours:AS.unnamedEvents([Ci(v=>wf.hideAllSlots(v))])})),$9=r=>kt(wf.getSlotNames(r),f=>wf.isShowing(r,f)),XG=r=>{const f=r.element;ro(f,"display","none"),qn(f,"aria-hidden","true")},jG=r=>{const f=r.element;ks(f,"display"),Ue(f,"aria-hidden")},N9=r=>({getContainer:G(r)}),I9=(r,f,g)=>{wf.getSlot(r,f).each(v=>{yw.getPane(v).each(_=>{g(v)(N9(_.element.dom))})})},qG=(r,f)=>I9(r,f,yw.getOnShow),GG=(r,f)=>I9(r,f,yw.getOnHide);var g4=Kc({factory:(r,f)=>{const T={setViews:(P,I)=>{gs.set(P,[R9(I,f.backstage.shared.providers)])},whichView:P=>cr.getCurrent(P).bind($9),toggleView:(P,I,W,J)=>cr.getCurrent(P).exists(ie=>{const de=$9(ie),ge=de.exists(Ie=>J===Ie),_e=wf.getSlot(ie,J).isSome();return _e&&(wf.hideAllSlots(ie),ge?(XG(P),I()):(W(),jG(P),wf.showSlot(ie,J),qG(ie,J)),de.each(Ie=>GG(ie,Ie))),_e})};return{uid:r.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Tn([gs.config({}),cr.config({find:P=>{const I=gs.contents(P);return Ss(I)}})]),apis:T}},name:"silver.ViewWrapper",configFields:[nn("backstage")],apis:{setViews:(r,f,g)=>r.setViews(f,g),toggleView:(r,f,g,v,_)=>r.toggleView(f,g,v,_),whichView:(r,f)=>r.whichView(f)}});const KG=(r,f,g)=>{let v=!1;const _={getSocket:T=>Rc.getPart(T,r,"socket"),setSidebar:(T,P,I)=>{Rc.getPart(T,r,"sidebar").each(W=>i9(W,P,I))},toggleSidebar:(T,P)=>{Rc.getPart(T,r,"sidebar").each(I=>hG(I,P))},whichSidebar:T=>Rc.getPart(T,r,"sidebar").bind(mG).getOrNull(),getHeader:T=>Rc.getPart(T,r,"header"),getToolbar:T=>Rc.getPart(T,r,"toolbar"),setToolbar:(T,P)=>{Rc.getPart(T,r,"toolbar").each(I=>{const W=je(P,Ow);I.getApis().setGroups(I,W)})},setToolbars:(T,P)=>{Rc.getPart(T,r,"multiple-toolbar").each(I=>{const W=je(P,J=>je(J,Ow));$F.setItems(I,W)})},refreshToolbar:T=>{Rc.getPart(T,r,"toolbar").each(I=>I.getApis().refresh(I))},toggleToolbarDrawer:T=>{Rc.getPart(T,r,"toolbar").each(P=>{wo(P.getApis().toggle,I=>I(P))})},toggleToolbarDrawerWithoutFocusing:T=>{Rc.getPart(T,r,"toolbar").each(P=>{wo(P.getApis().toggleWithoutFocusing,I=>I(P))})},isToolbarDrawerToggled:T=>Rc.getPart(T,r,"toolbar").bind(P=>V.from(P.getApis().isOpen).map(I=>I(P))).getOr(!1),getThrobber:T=>Rc.getPart(T,r,"throbber"),focusToolbar:T=>{Rc.getPart(T,r,"toolbar").orThunk(()=>Rc.getPart(T,r,"multiple-toolbar")).each(I=>{No.focusIn(I)})},setMenubar:(T,P)=>{Rc.getPart(T,r,"menubar").each(I=>{i$.setMenus(I,P)})},focusMenubar:T=>{Rc.getPart(T,r,"menubar").each(P=>{i$.focus(P)})},setViews:(T,P)=>{Rc.getPart(T,r,"viewWrapper").each(I=>{g4.setViews(I,P)})},toggleView:(T,P)=>Rc.getPart(T,r,"viewWrapper").exists(I=>g4.toggleView(I,()=>_.showMainView(T),()=>_.hideMainView(T),P)),whichView:T=>Rc.getPart(T,r,"viewWrapper").bind(g4.whichView).getOrNull(),hideMainView:T=>{v=_.isToolbarDrawerToggled(T),v&&_.toggleToolbarDrawer(T),Rc.getPart(T,r,"editorContainer").each(P=>{const I=P.element;ro(I,"display","none"),qn(I,"aria-hidden","true")})},showMainView:T=>{v&&_.toggleToolbarDrawer(T),Rc.getPart(T,r,"editorContainer").each(P=>{const I=P.element;ks(I,"display"),Ue(I,"aria-hidden")})}};return{uid:r.uid,dom:r.dom,components:f,apis:_,behaviours:r.behaviours}},JG=S1.optional({factory:i$,name:"menubar",schema:[nn("backstage")]}),eK=r=>r.type===Cg.sliding?QG:r.type===Cg.floating?FG:jd,tK=S1.optional({factory:{sketch:r=>$F.sketch({uid:r.uid,dom:r.dom,listBehaviours:Tn([No.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>jd({type:r.type,uid:io("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:r.providers,onEscape:()=>(r.onEscape(),V.some(!0))}),setupItem:(f,g,v,_)=>{C1.setGroups(g,v)},shell:!0})},name:"multiple-toolbar",schema:[nn("dom"),nn("onEscape")]}),nK=S1.optional({factory:{sketch:r=>{const f=eK(r),g={type:r.type,uid:r.uid,onEscape:()=>(r.onEscape(),V.some(!0)),onToggled:(v,_)=>r.onToolbarToggled(_),cyclicKeying:!1,initGroups:[],getSink:r.getSink,providers:r.providers,moreDrawerData:{lazyToolbar:r.lazyToolbar,lazyMoreButton:r.lazyMoreButton,lazyHeader:r.lazyHeader},attributes:r.attributes};return f(g)}},name:"toolbar",schema:[nn("dom"),nn("onEscape"),nn("getSink")]}),B9=S1.optional({factory:{sketch:aae},name:"header",schema:[nn("dom")]}),oK=S1.optional({factory:{sketch:fG},name:"promotion",schema:[nn("dom")]}),sK=S1.optional({name:"socket",schema:[nn("dom")]}),O$=S1.optional({factory:{sketch:gG},name:"sidebar",schema:[nn("dom")]}),rK=S1.optional({factory:{sketch:f9},name:"throbber",schema:[nn("dom")]}),p4=S1.optional({factory:g4,name:"viewWrapper",schema:[nn("backstage")]}),iK=r=>({uid:r.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:r.components}),L9=S1.optional({factory:{sketch:iK},name:"editorContainer",schema:[]});var ji=wu({name:"OuterContainer",factory:KG,configFields:[nn("dom"),nn("behaviours")],partFields:[B9,JG,nK,tK,sK,O$,oK,rK,p4,L9],apis:{getSocket:(r,f)=>r.getSocket(f),setSidebar:(r,f,g,v)=>{r.setSidebar(f,g,v)},toggleSidebar:(r,f,g)=>{r.toggleSidebar(f,g)},whichSidebar:(r,f)=>r.whichSidebar(f),getHeader:(r,f)=>r.getHeader(f),getToolbar:(r,f)=>r.getToolbar(f),setToolbar:(r,f,g)=>{r.setToolbar(f,g)},setToolbars:(r,f,g)=>{r.setToolbars(f,g)},refreshToolbar:(r,f)=>r.refreshToolbar(f),toggleToolbarDrawer:(r,f)=>{r.toggleToolbarDrawer(f)},toggleToolbarDrawerWithoutFocusing:(r,f)=>{r.toggleToolbarDrawerWithoutFocusing(f)},isToolbarDrawerToggled:(r,f)=>r.isToolbarDrawerToggled(f),getThrobber:(r,f)=>r.getThrobber(f),setMenubar:(r,f,g)=>{r.setMenubar(f,g)},focusMenubar:(r,f)=>{r.focusMenubar(f)},focusToolbar:(r,f)=>{r.focusToolbar(f)},setViews:(r,f,g)=>{r.setViews(f,g)},toggleView:(r,f,g)=>r.toggleView(f,g),whichView:(r,f)=>r.whichView(f)}});const aK="file edit view insert format tools table help",lK={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"}},cK=(r,f,g)=>{const v=mB(g).split(/[ ,]/);return{text:r.title,getItems:()=>Ne(r.items,_=>{const T=_.toLowerCase();return T.trim().length===0?[]:rn(v,P=>P===T)?[]:T==="separator"||T==="|"?[{type:"separator"}]:f.menuItems[T]?[f.menuItems[T]]:[]})}},y$=r=>r.split(" "),b4=(r,f)=>{const g={...lK,...f.menus},v=Xs(f.menus).length>0,_=f.menubar===void 0||f.menubar===!0?y$(aK):y$(f.menubar===!1?"":f.menubar),T=Kn(_,I=>{const W=vs(lK,I);return v?W||ln(f.menus,I).exists(J=>vs(J,"items")):W}),P=je(T,I=>{const W=g[I];return cK({title:W.title,items:y$(W.items)},f,r)});return Kn(P,I=>{const W=J=>d(J)||J.type!=="separator";return I.getItems().length>0&&rn(I.getItems(),W)})},F9=r=>{const f=()=>{r._skinLoaded=!0,IU(r)};return()=>{r.initialized?f():r.on("init",f)}},v4=(r,f)=>()=>zx(r,{message:f}),w$=(r,f,g)=>(r.on("remove",()=>g.unload(f)),g.load(f)),Q9=(r,f)=>{const g=f+"/skin.min.css";return w$(r,g,r.ui.styleSheetLoader)},_$=(r,f)=>{if(Mo(lt.fromDom(r.getElement()))){const v=f+"/skin.shadowdom.min.css";return w$(r,v,_x.DOM.styleSheetLoader)}else return Promise.resolve()},Z9=(r,f)=>{const g=AB(f);return g&&f.contentCSS.push(g+(r?"/content.inline":"/content")+".min.css"),!E3(f)&&d(g)?Promise.all([Q9(f,g),_$(f,g)]).then(F9(f),v4(f,"Skin could not be loaded")):Promise.resolve(F9(f)())},H9=Re(Z9,!1),JS=Re(Z9,!0),z9=(r,f,g)=>{const v=(I,W,J,ie)=>{const de=f.shared.providers.translate(I.title);if(I.type==="separator")return V.some({type:"separator",text:de});if(I.type==="submenu"){const ge=Ne(I.getStyleItems(),_e=>_(_e,W,ie));return W===0&&ge.length<=0?V.none():V.some({type:"nestedmenuitem",text:de,enabled:ge.length>0,getSubmenuItems:()=>Ne(I.getStyleItems(),_e=>_(_e,W,ie))})}else return V.some({type:"togglemenuitem",text:de,icon:I.icon,active:I.isSelected(ie),enabled:!J,onAction:g.onAction(I),...I.getStylePreview().fold(()=>({}),ge=>({meta:{style:ge}}))})},_=(I,W,J)=>{const ie=I.type==="formatter"&&g.isInvalid(I);return W===0?ie?[]:v(I,W,!1,J).toArray():v(I,W,ie,J).toArray()},T=I=>{const W=g.getCurrentValue(),J=g.shouldHide?0:1;return Ne(I,ie=>_(ie,J,W))};return{validateItems:T,getFetch:(I,W)=>(J,ie)=>{const de=W(),ge=T(de),_e=zS(ge,Cp.CLOSE_ON_EXECUTE,I,{isHorizontalMenu:!1,search:V.none()});ie(_e)}}},eC=(r,f,g)=>{const v=g.dataset,_=v.type==="basic"?()=>je(v.data,T=>yF(T,g.isSelectedFor,g.getPreviewFor)):v.getData;return{items:z9(r,f,g),getStyleItems:_}},ST=(r,f,g)=>{const{items:v,getStyleItems:_}=eC(r,f,g),T=I=>({getComponent:G(I)}),P=Db(r,"NodeChange",I=>{const W=I.getComponent();g.updateText(W),Jo.set(I.getComponent(),!r.selection.isEditable())});return AA({text:g.icon.isSome()?V.none():g.text,icon:g.icon,tooltip:V.from(g.tooltip),role:V.none(),fetch:v.getFetch(f,_),onSetup:P,getApi:T,columns:1,presets:"normal",classes:g.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",f.shared)},uK=r=>je(r,f=>{let g=f,v=f;const _=f.split("=");return _.length>1&&(g=_[0],v=_[1]),{title:g,format:v}}),S$=r=>({type:"basic",data:r});var tC;(function(r){r[r.SemiColon=0]="SemiColon",r[r.Space=1]="Space"})(tC||(tC={}));const fK=(r,f)=>f===tC.SemiColon?r.replace(/;$/,"").split(";"):r.split(" "),O4=(r,f,g)=>{const v=r.options.get(f);return{type:"basic",data:uK(fK(v,g))}},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"}],CT=r=>{const f=()=>kt(y4,I=>r.formatter.match(I.format)),g=I=>()=>r.formatter.match(I),v=I=>V.none,_=I=>{const J=f().fold(G("left"),ie=>ie.title.toLowerCase());Ao(I,VO,{icon:`align-${J}`})},T=S$(y4),P=I=>()=>kt(y4,W=>W.format===I.format).each(W=>r.execCommand(W.command));return{tooltip:"Align",text:V.none(),icon:V.some("align-left"),isSelectedFor:g,getCurrentValue:V.none,getPreviewFor:v,onAction:P,updateText:_,dataset:T,shouldHide:!1,isInvalid:I=>!r.formatter.canApply(I.format)}},C$=(r,f)=>ST(r,f,CT(r)),dK=(r,f)=>{const g=eC(r,f,CT(r));r.ui.registry.addNestedMenuItem("align",{text:f.shared.providers.translate("Align"),onSetup:zf(r),getSubmenuItems:()=>g.items.validateItems(g.getStyleItems())})},V9=(r,f)=>{const g=f(),v=je(g,_=>_.format);return V.from(r.formatter.closest(v)).bind(_=>kt(g,T=>T.format===_)).orThunk(()=>fn(r.formatter.match("p"),{title:"Paragraph",format:"p"}))},k$=r=>{const f="Paragraph",g=P=>()=>r.formatter.match(P),v=P=>()=>{const I=r.formatter.get(P);return I?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(P))}):V.none()},_=P=>{const W=V9(r,()=>T.data).fold(G(f),J=>J.title);Ao(P,Dg,{text:W})},T=O4(r,"block_formats",tC.SemiColon);return{tooltip:"Blocks",text:V.some(f),icon:V.none(),isSelectedFor:g,getCurrentValue:V.none,getPreviewFor:v,onAction:lM(r),updateText:_,dataset:T,shouldHide:!1,isInvalid:P=>!r.formatter.canApply(P.format)}},hK=(r,f)=>ST(r,f,k$(r)),mK=(r,f)=>{const g=eC(r,f,k$(r));r.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:zf(r),getSubmenuItems:()=>g.items.validateItems(g.getStyleItems())})},gK=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],x$=r=>{const f=r.split(/\s*,\s*/);return je(f,g=>g.replace(/^['"]+|['"]+$/g,""))},pK=r=>{const f=()=>{const g=x$(r.toLowerCase());return Gt(gK,v=>g.indexOf(v.toLowerCase())>-1)};return r.indexOf("-apple-system")===0&&f()},W9=r=>{const f="System Font",g=()=>{const J=Ie=>Ie?x$(Ie)[0]:"",ie=r.queryCommandValue("FontName"),de=W.data,ge=ie?ie.toLowerCase():"";return{matchOpt:kt(de,Ie=>{const it=Ie.format;return it.toLowerCase()===ge||J(it).toLowerCase()===J(ge).toLowerCase()}).orThunk(()=>fn(pK(ge),{title:f,format:ge})),font:ie}},v=J=>ie=>ie.exists(de=>de.format===J),_=()=>{const{matchOpt:J}=g();return J},T=J=>()=>V.some({tag:"div",styles:J.indexOf("dings")===-1?{"font-family":J}:{}}),P=J=>()=>{r.undoManager.transact(()=>{r.focus(),r.execCommand("FontName",!1,J.format)})},I=J=>{const{matchOpt:ie,font:de}=g(),ge=ie.fold(G(de),_e=>_e.title);Ao(J,Dg,{text:ge})},W=O4(r,"font_family_formats",tC.SemiColon);return{tooltip:"Fonts",text:V.some(f),icon:V.none(),isSelectedFor:v,getCurrentValue:_,getPreviewFor:T,onAction:P,updateText:I,dataset:W,shouldHide:!1,isInvalid:tt}},T$=(r,f)=>ST(r,f,W9(r)),bK=(r,f)=>{const g=eC(r,f,W9(r));r.ui.registry.addNestedMenuItem("fontfamily",{text:f.shared.providers.translate("Fonts"),onSetup:zf(r),getSubmenuItems:()=>g.items.validateItems(g.getStyleItems())})},vK={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:[""]},U9=(()=>{const r="[0-9]+",g="[eE]"+("[+-]?"+r),v="\\.",_=I=>`(?:${I})?`,P=`[+-]?(?:${["Infinity",r+v+_(r)+_(g),v+r+_(g),r+_(g)].join("|")})`;return new RegExp(`^(${P})(.*)$`)})(),OK=(r,f)=>rn(f,g=>rn(vK[g],v=>r===v)),kT=(r,f)=>V.from(U9.exec(r)).bind(v=>{const _=Number(v[1]),T=v[2];return OK(T,f)?V.some({value:_,unit:T}):V.none()}),yK=(r,f)=>kT(r,f).map(({value:g,unit:v})=>g+v),E$={tab:G(9),escape:G(27),enter:G(13),backspace:G(8),delete:G(46),left:G(37),up:G(38),right:G(39),down:G(40),space:G(32),home:G(36),end:G(35),pageUp:G(33),pageDown:G(34)},wK=(r,f,g)=>{let v=V.none();const _=ft=>ft.map(Yt=>Gn.getValue(Yt)).getOr(""),T=Db(r,"NodeChange SwitchMode",ft=>{const Yt=ft.getComponent();v=V.some(Yt),g.updateInputValue(Yt),Jo.set(Yt,!r.selection.isEditable())}),P=ft=>({getComponent:G(ft)}),I=Ho(L),W=io("custom-number-input-events"),J=(ft,Yt,Dt)=>{const kn=_(v),pn=g.getNewValue(kn,ft),Nn=kn.length-`${pn}`.length,jn=v.map(ko=>ko.element.dom.selectionStart-Nn),Ys=v.map(ko=>ko.element.dom.selectionEnd-Nn);g.onAction(pn,Dt),v.each(ko=>{Gn.setValue(ko,pn),Yt&&(jn.each(_s=>ko.element.dom.selectionStart=_s),Ys.each(_s=>ko.element.dom.selectionEnd=_s))})},ie=(ft,Yt)=>J((Dt,kn)=>Dt-kn,ft,Yt),de=(ft,Yt)=>J((Dt,kn)=>Dt+kn,ft,Yt),ge=ft=>xc(ft.element).fold(V.none,Yt=>(gf(Yt),V.some(!0))),_e=ft=>i1(ft.element)?(Tf(ft.element).each(Yt=>gf(Yt)),V.some(!0)):V.none(),Ie=(ft,Yt,Dt,kn)=>{const pn=f.shared.providers.translate(Dt),Nn=io("altExecuting"),jn=Db(r,"NodeChange SwitchMode",ko=>{Jo.set(ko.getComponent(),!r.selection.isEditable())}),Ys=ko=>{Jo.isDisabled(ko)||ft(!0)};return Jc.sketch({dom:{tag:"button",attributes:{title:pn,"aria-label":pn},classes:kn.concat(Yt)},components:[bR(Yt,f.shared.providers.icons)],buttonBehaviours:Tn([Jo.config({}),xs(Nn,[nv({onSetup:jn,getApi:P},I),ov({getApi:P},I),on(If(),(ko,_s)=>{(_s.event.raw.keyCode===E$.space()||_s.event.raw.keyCode===E$.enter())&&(Jo.isDisabled(ko)||ft(!1))}),on(sm(),Ys),on(Jm(),Ys)])]),eventOrder:{[If()]:[Nn,"keying"],[sm()]:[Nn,"alloy.base.behaviour"],[Jm()]:[Nn,"alloy.base.behaviour"]}})},it=oi(Ie(ft=>ie(!1,ft),"minus","Decrease font size",["highlight-on-focus"])),Qt=oi(Ie(ft=>de(!1,ft),"plus","Increase font size",["highlight-on-focus"])),dt=oi({dom:{tag:"div",classes:["tox-input-wrapper","highlight-on-focus"]},components:[K2.sketch({inputBehaviours:Tn([Jo.config({}),xs(W,[nv({onSetup:T,getApi:P},I),ov({getApi:P},I)]),xs("input-update-display-text",[on(Dg,(ft,Yt)=>{Gn.setValue(ft,Yt.event.text)}),on(fu(),ft=>{g.onAction(Gn.getValue(ft))}),on(Kg(),ft=>{g.onAction(Gn.getValue(ft))})]),No.config({mode:"special",onEnter:ft=>(J(we,!0,!0),V.some(!0)),onEscape:ge,onUp:ft=>(de(!0,!1),V.some(!0)),onDown:ft=>(ie(!0,!1),V.some(!0)),onLeft:(ft,Yt)=>(Yt.cut(),V.none()),onRight:(ft,Yt)=>(Yt.cut(),V.none())})])})],behaviours:Tn([ns.config({}),No.config({mode:"special",onEnter:_e,onSpace:_e,onEscape:ge}),xs("input-wrapper-events",[on(Tl(),ft=>{mt([it,Qt],Yt=>{const Dt=lt.fromDom(Yt.get(ft).element.dom);i1(Dt)&&Kv(Dt)})})])])});return{dom:{tag:"div",classes:["tox-number-input"]},components:[it.asSpec(),dt.asSpec(),Qt.asSpec()],behaviours:Tn([ns.config({}),No.config({mode:"flow",focusInside:h1.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:ft=>i1(ft.element)?V.none():(gf(ft.element),V.some(!0))})])}},_K={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},SK={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},Y9=(r,f)=>{const g=Math.pow(10,f);return Math.round(r*g)/g},CK=(r,f)=>/[0-9.]+px$/.test(r)?Y9(parseInt(r,10)*72/96,f||0)+"pt":ln(SK,r).getOr(r),kK=r=>ln(_K,r).getOr(""),X9=r=>{const f=()=>{let W=V.none();const J=I.data,ie=r.queryCommandValue("FontSize");if(ie)for(let de=3;W.isNone()&&de>=0;de--){const ge=CK(ie,de),_e=kK(ge);W=kt(J,Ie=>Ie.format===ie||Ie.format===ge||Ie.format===_e)}return{matchOpt:W,size:ie}},g=W=>J=>J.exists(ie=>ie.format===W),v=()=>{const{matchOpt:W}=f();return W},_=G(V.none),T=W=>()=>{r.undoManager.transact(()=>{r.focus(),r.execCommand("FontSize",!1,W.format)})},P=W=>{const{matchOpt:J,size:ie}=f(),de=J.fold(G(ie),ge=>ge.title);Ao(W,Dg,{text:de})},I=O4(r,"font_size_formats",tC.Space);return{tooltip:"Font sizes",text:V.some("12pt"),icon:V.none(),isSelectedFor:g,getPreviewFor:_,getCurrentValue:v,onAction:T,updateText:P,dataset:I,shouldHide:!1,isInvalid:tt}},A$=(r,f)=>ST(r,f,X9(r)),D$=r=>{var f;const g={step:1};return(f={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[r])!==null&&f!==void 0?f:g},xK=16,TK=r=>r>=0,EK=r=>{const f=()=>r.queryCommandValue("FontSize");return{updateInputValue:v=>Ao(v,Dg,{text:f()}),onAction:(v,_)=>r.execCommand("FontSize",!1,v,{skip_focus:!_}),getNewValue:(v,_)=>{kT(v,["unsupportedLength","empty"]);const T=kT(v,["unsupportedLength","empty"]).or(kT(f(),["unsupportedLength","empty"])),P=T.map(ie=>ie.value).getOr(xK),I=yB(r),W=T.map(ie=>ie.unit).filter(ie=>ie!=="").getOr(I),J=_(P,D$(W).step);return`${TK(J)?J:P}${W}`}}},AK=(r,f)=>wK(r,f,EK(r)),DK=(r,f)=>{const g=eC(r,f,X9(r));r.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:zf(r),getSubmenuItems:()=>g.items.validateItems(g.getStyleItems())})},j9=(r,f)=>{const g="Paragraph",v=P=>()=>r.formatter.match(P),_=P=>()=>{const I=r.formatter.get(P);return I!==void 0?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(P))}):V.none()},T=P=>{const I=de=>ZR(de)?Ne(de.items,I):bF(de)?[{title:de.title,format:de.format}]:[],W=Ne(WR(r),I),ie=V9(r,G(W)).fold(G(g),de=>de.title);Ao(P,Dg,{text:ie})};return{tooltip:"Formats",text:V.some(g),icon:V.none(),isSelectedFor:v,getCurrentValue:V.none,getPreviewFor:_,onAction:lM(r),updateText:T,shouldHide:g5(r),isInvalid:P=>!r.formatter.canApply(P.format),dataset:f}},PK=(r,f)=>{const g={type:"advanced",...f.styles};return ST(r,f,j9(r,g))},MK=(r,f)=>{const g={type:"advanced",...f.styles},v=eC(r,f,j9(r,g));r.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:zf(r),getSubmenuItems:()=>v.items.validateItems(v.getStyleItems())})},RK=G([nn("toggleClass"),nn("fetch"),hg("onExecute"),xt("getHotspot",V.some),xt("getAnchorOverrides",G({})),Eh(),hg("onItemExecute"),Er("lazySink"),nn("dom"),qs("onOpen"),Wl("splitDropdownBehaviours",[ul,No,ns]),xt("matchWidth",!1),xt("useMinWidth",!1),xt("eventOrder",{}),Er("role")].concat(DM())),q9=Gc({factory:Jc,schema:[nn("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Tn([ns.revoke()])}),overrides:r=>({dom:{tag:"span",attributes:{role:"presentation"}},action:f=>{f.getSystem().getByUid(r.uid).each(bh)},buttonBehaviours:Tn([Ms.config({toggleOnExecute:!1,toggleClass:r.toggleClass})])})}),w4=Gc({factory:Jc,schema:[nn("dom")],name:"button",defaults:()=>({buttonBehaviours:Tn([ns.revoke()])}),overrides:r=>({dom:{tag:"span",attributes:{role:"presentation"}},action:f=>{f.getSystem().getByUid(r.uid).each(g=>{r.onExecute(g,f)})}})}),P$=G([q9,w4,Yd({factory:{sketch:r=>({uid:r.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:r.text}})},schema:[nn("text")],name:"aria-descriptor"}),Mh({schema:[Yv()],name:"menu",defaults:r=>({onExecute:(f,g)=>{f.getSystem().getByUid(r.uid).each(v=>{r.onItemExecute(v,f,g)})}})}),J8()]),G9=(r,f,g,v)=>{const _=ie=>{cr.getCurrent(ie).each(de=>{Nr.highlightFirst(de),No.focusIn(de)})},T=ie=>{EM(r,we,ie,v,_,md.HighlightMenuAndItem).get(L)},P=ie=>(T(ie),V.some(!0)),I=ie=>{const de=u1(ie,r,"button");return bh(de),V.some(!0)},W={...li([Ci((ie,de)=>{Ri(ie,r,"aria-descriptor").each(_e=>{const Ie=io("aria");qn(_e.element,"id",Ie),qn(ie.element,"aria-describedby",Ie)})})]),...b3(V.some(T))},J={repositionMenus:ie=>{Ms.isOn(ie)&&rL(ie)}};return{uid:r.uid,dom:r.dom,components:f,apis:J,eventOrder:{...r.eventOrder,[af()]:["disabling","toggling","alloy.base.behaviour"]},events:W,behaviours:sc(r.splitDropdownBehaviours,[ul.config({others:{sandbox:ie=>{const de=u1(ie,r,"arrow");return AM(r,ie,{onOpen:()=>{Ms.on(de),Ms.on(ie)},onClose:()=>{Ms.off(de),Ms.off(ie)}})}}}),No.config({mode:"special",onSpace:I,onEnter:I,onDown:P}),ns.config({}),Ms.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:r.role.getOr("button"),"aria-haspopup":!0}}}},k1=wu({name:"SplitDropdown",configFields:RK(),partFields:P$(),factory:G9,apis:{repositionMenus:(r,f)=>r.repositionMenus(f)}}),M$=r=>({isEnabled:()=>!Jo.isDisabled(r),setEnabled:f=>Jo.set(r,!f),setText:f=>Ao(r,Dg,{text:f}),setIcon:f=>Ao(r,VO,{icon:f})}),$K=r=>({setActive:f=>{Ms.set(r,f)},isActive:()=>Ms.isOn(r),isEnabled:()=>!Jo.isDisabled(r),setEnabled:f=>Jo.set(r,!f),setText:f=>Ao(r,Dg,{text:f}),setIcon:f=>Ao(r,VO,{icon:f})}),K9=(r,f)=>r.map(g=>({"aria-label":f.translate(g),title:f.translate(g)})).getOr({}),J9=io("focus-button"),R$=(r,f,g,v,_)=>{const T=f.map(I=>oi(_7(I,"tox-tbtn",_))),P=r.map(I=>oi(zO(I,_.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(f.isSome()?["tox-tbtn--select"]:[]),attributes:K9(g,_)},components:PS([P.map(I=>I.asSpec()),T.map(I=>I.asSpec())]),eventOrder:{[Fr()]:["focusing","alloy.base.behaviour",HO],[Lu()]:[HO,"toolbar-group-button-events"]},buttonBehaviours:Tn([xg.toolbarButton(_.isDisabled),rc(),xs(HO,[Ci((I,W)=>EA(I)),on(Dg,(I,W)=>{T.bind(J=>J.getOpt(I)).each(J=>{gs.set(J,[Li(_.translate(W.event.text))])})}),on(VO,(I,W)=>{P.bind(J=>J.getOpt(I)).each(J=>{gs.set(J,[zO(W.event.icon,_.icons)])})}),on(Fr(),(I,W)=>{W.event.prevent(),rr(I,J9)})])].concat(v.getOr([])))}},NK=(r,f,g,v)=>{const _=f.shared,T=Ho(L),P={toolbarButtonBehaviours:[],getApi:M$,onSetup:r.onSetup},I=[xs("toolbar-group-button-events",[nv(P,T),ov(P,T)])];return gv.sketch({lazySink:_.getSink,fetch:()=>Yu.nu(W=>{W(je(g(r.items),Ow))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:R$(r.icon,r.text,r.tooltip,V.some(I),_.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:v}}}})},eQ=(r,f,g)=>{var v;const _=Ho(L),T=R$(r.icon,r.text,r.tooltip,V.none(),g);return Jc.sketch({dom:T.dom,components:T.components,eventOrder:pR,buttonBehaviours:{...Tn([xs("toolbar-button-events",[y7({onAction:r.onAction,getApi:f.getApi}),nv(f,_),ov(f,_)]),xg.toolbarButton(()=>!r.enabled||g.isDisabled()),rc()].concat(f.toolbarButtonBehaviours)),[HO]:(v=T.buttonBehaviours)===null||v===void 0?void 0:v[HO]}})},IK=(r,f)=>$$(r,f,[]),$$=(r,f,g)=>eQ(r,{toolbarButtonBehaviours:g.length>0?[xs("toolbarButtonWith",g)]:[],getApi:M$,onSetup:r.onSetup},f),BK=(r,f)=>tQ(r,f,[]),tQ=(r,f,g)=>eQ(r,{toolbarButtonBehaviours:[gs.config({}),Ms.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(g.length>0?[xs("toolbarToggleButtonWith",g)]:[]),getApi:$K,onSetup:r.onSetup},f),N$=(r,f,g)=>v=>Yu.nu(_=>f.fetch(_)).map(_=>V.from(NM(ni(tA(io("menu-value"),_,T=>{f.onItemAction(r(v),T)},f.columns,f.presets,Cp.CLOSE_ON_EXECUTE,f.select.getOr(tt),g),{movement:nA(f.columns,f.presets),menuBehaviours:AS.unnamedEvents(f.columns!=="auto"?[]:[Ci((T,P)=>{q5(T,4,BB(f.presets)).each(({numRows:I,numColumns:W})=>{No.setGridSize(T,I,W)})})])})))),LK=(r,f)=>{const g=T=>({isEnabled:()=>!Jo.isDisabled(T),setEnabled:P=>Jo.set(T,!P),setIconFill:(P,I)=>{sa(T.element,`svg path[class="${P}"], rect[class="${P}"]`).each(W=>{qn(W,"fill",I)})},setActive:P=>{qn(T.element,"aria-pressed",P),sa(T.element,"span").each(I=>{T.getSystem().getByDom(I).each(W=>Ms.set(W,P))})},isActive:()=>sa(T.element,"span").exists(P=>T.getSystem().getByDom(P).exists(Ms.isOn)),setText:P=>sa(T.element,"span").each(I=>T.getSystem().getByDom(I).each(W=>Ao(W,Dg,{text:P}))),setIcon:P=>sa(T.element,"span").each(I=>T.getSystem().getByDom(I).each(W=>Ao(W,VO,{icon:P})))}),v=Ho(L),_={getApi:g,onSetup:r.onSetup};return k1.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...K9(r.tooltip,f.providers)}},onExecute:T=>{const P=g(T);P.isEnabled()&&r.onAction(P)},onItemExecute:(T,P,I)=>{},splitDropdownBehaviours:Tn([xg.splitButton(f.providers.isDisabled),rc(),xs("split-dropdown-events",[Ci((T,P)=>EA(T)),on(J9,ns.focus),nv(_,v),ov(_,v)]),Xx.config({})]),eventOrder:{[Lu()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:f.getSink,fetch:N$(g,r,f.providers),parts:{menu:xS(!1,r.columns,r.presets)},components:[k1.parts.button(R$(r.icon,r.text,V.none(),V.some([Ms.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),f.providers)),k1.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:fB("chevron-down",f.providers.icons)},buttonBehaviours:Tn([xg.splitButton(f.providers.isDisabled),rc(),l5()])}),k1.parts["aria-descriptor"]({text:f.providers.translate("To open the popup, press Shift+Enter")})]})},FK=[{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"]}],xT=(r,f)=>(g,v,_)=>{const T=r(g).mapError(P=>Rd(P)).getOrDie();return f(T,v,_)},QK={button:xT(Z5,(r,f)=>IK(r,f.shared.providers)),togglebutton:xT(H5,(r,f)=>BK(r,f.shared.providers)),menubutton:xT(r$,(r,f)=>lT(r,"tox-tbtn",f,V.none(),!1)),splitbutton:xT(lG,(r,f)=>LK(r,f.shared)),grouptoolbarbutton:xT(KF,(r,f,g)=>{const v=g.ui.registry.getAll().buttons,_=P=>_4(g,{buttons:v,toolbar:P,allowToolbarGroups:!1},f,V.none()),T={[$0]:f.shared.header.isPositionedAtTop()?Th.TopToBottom:Th.BottomToTop};switch(_S(g)){case Cg.floating:return NK(r,f,_,T);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})},ZK=(r,f,g)=>ln(QK,r.type).fold(()=>(console.error("skipping button defined by",r),V.none()),v=>V.some(v(r,f,g))),nQ={styles:PK,fontsize:A$,fontsizeinput:AK,fontfamily:T$,blocks:hK,align:C$},oQ=r=>{const f=je(FK,g=>{const v=Kn(g.items,_=>vs(r,_)||vs(nQ,_));return{name:g.name,items:v}});return Kn(f,g=>g.items.length>0)},sQ=r=>{const f=r.split("|");return je(f,g=>({items:g.trim().split(" ")}))},rQ=r=>K(r,f=>vs(f,"name")&&vs(f,"items")),HK=r=>{const f=r.toolbar,g=r.buttons;return f===!1?[]:f===void 0||f===!0?oQ(g):d(f)?sQ(f):rQ(f)?f:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},iQ=(r,f,g,v,_,T)=>ln(f,g.toLowerCase()).orThunk(()=>T.bind(P=>tr(P,I=>ln(f,I+g.toLowerCase())))).fold(()=>ln(nQ,g.toLowerCase()).map(P=>P(r,_)),P=>P.type==="grouptoolbarbutton"&&!v?(console.warn(`Ignoring the '${g}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),V.none()):ZK(P,_,r)),_4=(r,f,g,v)=>{const _=HK(f),T=je(_,P=>{const I=Ne(P.items,W=>W.trim().length===0?[]:iQ(r,f.buttons,W,f.allowToolbarGroups,g,v).toArray());return{title:V.from(r.translate(P.name)),items:I}});return Kn(T,P=>P.items.length>0)},aQ=(r,f,g,v)=>{const _=f.mainUi.outerContainer,T=g.toolbar,P=g.buttons;if(K(T,d)){const I=T.map(W=>{const J={toolbar:W,buttons:P,allowToolbarGroups:g.allowToolbarGroups};return _4(r,J,v,V.none())});ji.setToolbars(_,I)}else ji.setToolbar(_,_4(r,g,v,V.none()))},lQ=an(),cQ=lQ.os.isiOS()&&lQ.os.version.major<=12,zK=(r,f)=>{const{uiMotherships:g}=f,v=r.dom;let _=r.getWin();const T=r.getDoc().documentElement,P=Ho(pr(_.innerWidth,_.innerHeight)),I=Ho(pr(T.offsetWidth,T.offsetHeight)),W=()=>{const ge=P.get();(ge.left!==_.innerWidth||ge.top!==_.innerHeight)&&(P.set(pr(_.innerWidth,_.innerHeight)),iM(r))},J=()=>{const ge=r.getDoc().documentElement,_e=I.get();(_e.left!==ge.offsetWidth||_e.top!==ge.offsetHeight)&&(I.set(pr(ge.offsetWidth,ge.offsetHeight)),iM(r))},ie=ge=>{IO(r,ge)};v.bind(_,"resize",W),v.bind(_,"scroll",ie);const de=gb(lt.fromDom(r.getBody()),"load",J);r.on("hide",()=>{mt(g,ge=>{ro(ge.element,"display","none")})}),r.on("show",()=>{mt(g,ge=>{ks(ge.element,"display")})}),r.on("NodeChange",J),r.on("remove",()=>{de.unbind(),v.unbind(_,"resize",W),v.unbind(_,"scroll",ie),_=null})},uQ=(r,f,g)=>{Eb(r)&&x2(g.mainUi.mothership.element,g.popupUi.mothership),vO(f,g.dialogUi.mothership)};var VK=Object.freeze({__proto__:null,render:async(r,f,g,v,_)=>{const{mainUi:T,uiMotherships:P}=f,I=Ho(0),W=T.outerContainer;await H9(r);const J=lt.fromDom(_.targetNode),ie=On($t(J));x2(J,T.mothership),uQ(r,ie,f),r.on("PostRender",()=>{ji.setSidebar(W,g.sidebar,xB(r)),aQ(r,f,g,v),I.set(r.getWin().innerWidth),ji.setMenubar(W,b4(r,g)),ji.setViews(W,g.views),zK(r,f)});const de=ji.getSocket(W).getOrDie("Could not find expected socket element");if(cQ){yi(de.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const it=f7(()=>{r.dispatch("ScrollContent")},20),Qt=Mc(de.element,"scroll",it.throttle);r.on("remove",Qt.unbind)}m8(r,f),r.addCommand("ToggleSidebar",(it,Qt)=>{ji.toggleSidebar(W,Qt),r.dispatch("ToggleSidebar")}),r.addQueryValueHandler("ToggleSidebar",()=>{var it;return(it=ji.whichSidebar(W))!==null&&it!==void 0?it:""}),r.addCommand("ToggleView",(it,Qt)=>{if(ji.toggleView(W,Qt)){const dt=W.element;T.mothership.broadcastOn([Dh()],{target:dt}),mt(P,ft=>{ft.broadcastOn([Dh()],{target:dt})}),C(ji.whichView(W))&&(r.focus(),r.nodeChanged(),ji.refreshToolbar(W))}}),r.addQueryValueHandler("ToggleView",()=>{var it;return(it=ji.whichView(W))!==null&&it!==void 0?it:""});const ge=_S(r),_e=()=>{ji.refreshToolbar(f.mainUi.outerContainer)};(ge===Cg.sliding||ge===Cg.floating)&&r.on("ResizeWindow ResizeEditor ResizeContent",()=>{const it=r.getWin().innerWidth;it!==I.get()&&(_e(),I.set(it))});const Ie={setEnabled:it=>{ow(f,!it)},isEnabled:()=>!Jo.isDisabled(W)};return{iframeContainer:de.element.dom,editorContainer:W.element.dom,api:Ie}}});const I$=r=>/^[0-9\.]+(|px)$/i.test(""+r)?V.some(parseInt(""+r,10)):V.none(),B$=r=>U(r)?r+"px":r,S4=(r,f,g)=>{const v=f.filter(T=>r<T),_=g.filter(T=>r>T);return v.or(_).getOr(r)},WK=r=>{const f=k3(r),g=h5(r),v=m5(r);return I$(f).map(_=>S4(_,g,v))},UK=r=>WK(r).getOr(k3(r)),L$=r=>{const f=d5(r),g=Cx(r),v=yS(r);return I$(f).map(_=>S4(_,g,v))},YK=r=>L$(r).getOr(d5(r)),{ToolbarLocation:F$,ToolbarMode:fQ}=DW,XK=40,jK=(r,f,g,v,_)=>{const{mainUi:T,uiMotherships:P}=g,I=_x.DOM,W=CS(r),J=Dx(r),ie=yS(r).or(L$(r)),de=v.shared.header,ge=de.isPositionedAtTop,_e=_S(r),Ie=_e===fQ.sliding||_e===fQ.floating,it=Ho(!1),Qt=()=>it.get()&&!r.removed,dt=Qo=>Ie?Qo.fold(G(0),fr=>fr.components().length>1?Ii(fr.components()[1].element):0):0,ft=Qo=>{switch(b5(r)){case F$.auto:const fr=ji.getToolbar(T.outerContainer),Qn=dt(fr),_o=Ii(Qo.element)-Qn,us=di(f);if(us.y>_o)return"top";{const Wo=Eu(f),Os=Math.max(Wo.dom.scrollHeight,Ii(Wo));return us.bottom<Os-_o||ue().bottom<us.bottom-_o?"bottom":"top"}case F$.bottom:return"bottom";case F$.top:default:return"top"}},Yt=Qo=>{_.on(fr=>{_l.setModes(fr,[Qo]),de.setDockingMode(Qo);const Qn=ge()?Th.TopToBottom:Th.BottomToTop;qn(fr.element,$0,Qn)})},Dt=()=>{_.on(Qo=>{const fr=ie.getOrThunk(()=>{const Qn=I$(Gr(Hi(),"margin-left")).getOr(0);return ta(Hi())-Tc(f).left+Qn});ro(Qo.element,"max-width",fr+"px")})},kn=Qo=>{_.on(fr=>{const Qn=ji.getToolbar(T.outerContainer),_o=dt(Qn),us=di(f),{top:Js,left:Wo}=pn(r,T.outerContainer.element).fold(()=>({top:ge()?Math.max(us.y-Ii(fr.element)+_o,0):us.bottom,left:us.x}),zr=>{var _f;const ya=di(zr),Kd=(_f=zr.dom.scrollTop)!==null&&_f!==void 0?_f:0,Pp=xr(zr,Hi()),JO=Pp?Math.max(us.y-Ii(fr.element)+_o,0):us.y-ya.y+Kd-Ii(fr.element)+_o;return{top:ge()?JO:us.bottom,left:Pp?us.x:us.x-ya.x}}),Os={position:"absolute",left:Math.round(Wo)+"px",top:Math.round(Js)+"px"},$i=Qo.map(zr=>{const _f=dc(),ya=150,Kd=window.innerWidth-(Wo-_f.left);return{width:Math.max(Math.min(zr,Kd),ya)+"px"}}).getOr({});yi(T.outerContainer.element,{...Os,...$i})})},pn=(Qo,fr)=>Eb(Qo)?KR(fr):V.none(),Nn=()=>{mt(P,Qo=>{Qo.broadcastOn([kb()],{})})},jn=()=>{if(W)return V.none();if(Tc(T.outerContainer.element).left+za(T.outerContainer.element)>=window.innerWidth-XK||ea(T.outerContainer.element,"width").isSome()){ro(T.outerContainer.element,"position","absolute"),ro(T.outerContainer.element,"left","0px"),ks(T.outerContainer.element,"width");const fr=za(T.outerContainer.element);return V.some(fr)}else return V.none()},Ys=Qo=>{if(!Qt())return;W||Dt();const fr=W?V.none():jn();Ie&&ji.refreshToolbar(T.outerContainer),W||kn(fr),J&&_.on(Qo),Nn()},ko=()=>W||!J||!Qt()?!1:_.get().exists(Qo=>{const fr=de.getDockingMode(),Qn=ft(Qo);return Qn!==fr?(Yt(Qn),!0):!1});return{isVisible:Qt,isPositionedAtTop:ge,show:()=>{it.set(!0),ro(T.outerContainer.element,"display","flex"),I.addClass(r.getBody(),"mce-edit-focus"),mt(P,Qo=>{ks(Qo.element,"display")}),ko(),Eb(r)?Ys(Qo=>_l.isDocked(Qo)?_l.reset(Qo):_l.refresh(Qo)):Ys(_l.refresh)},hide:()=>{it.set(!1),ro(T.outerContainer.element,"display","none"),I.removeClass(r.getBody(),"mce-edit-focus"),mt(P,Qo=>{ro(Qo.element,"display","none")})},update:Ys,updateMode:()=>{ko()&&Ys(_l.reset)},repositionPopups:Nn}},dQ=(r,f)=>{const g=di(r);return{pos:f?g.y:g.bottom,bounds:g}},qK=(r,f,g,v)=>{const _=Ho(dQ(f,g.isPositionedAtTop())),T=J=>{const{pos:ie,bounds:de}=dQ(f,g.isPositionedAtTop()),{pos:ge,bounds:_e}=_.get(),Ie=de.height!==_e.height||de.width!==_e.width;_.set({pos:ie,bounds:de}),Ie&&iM(r,J),g.isVisible()&&(ge!==ie?g.update(_l.reset):Ie&&(g.updateMode(),g.repositionPopups()))};v||(r.on("activate",g.show),r.on("deactivate",g.hide)),r.on("SkinLoaded ResizeWindow",()=>g.update(_l.reset)),r.on("NodeChange keydown",J=>{requestAnimationFrame(()=>T(J))});let P=0;const I=yf(()=>g.update(_l.refresh),33);r.on("ScrollWindow",()=>{const J=dc().left;J!==P&&(P=J,I.throttle()),g.updateMode()}),Eb(r)&&r.on("ElementScroll",J=>{g.update(_l.refresh)});const W=mb();W.set(gb(lt.fromDom(r.getBody()),"load",J=>T(J.raw))),r.on("remove",()=>{W.clear()})};var KK=Object.freeze({__proto__:null,render:async(r,f,g,v,_)=>{const{mainUi:T}=f,P=Xi(),I=lt.fromDom(_.targetNode),W=jK(r,I,f,v,P),J=O5(r);await JS(r);const ie=()=>{if(P.isSet()){W.show();return}P.set(ji.getHeader(T.outerContainer).getOrDie());const ge=D3(r);Eb(r)?(x2(I,T.mothership),x2(I,f.popupUi.mothership)):vO(ge,T.mothership),vO(ge,f.dialogUi.mothership),aQ(r,f,g,v),ji.setMenubar(T.outerContainer,b4(r,g)),W.show(),qK(r,I,W,J),r.nodeChanged()};r.on("show",ie),r.on("hide",W.hide),J||(r.on("focus",ie),r.on("blur",W.hide)),r.on("init",()=>{(r.hasFocus()||J)&&ie()}),m8(r,f);const de={show:ie,hide:W.hide,setEnabled:ge=>{ow(f,!ge)},isEnabled:()=>!Jo.isDisabled(T.outerContainer)};return{editorContainer:T.outerContainer.element.dom,api:de}}});const JK=()=>{const r=Xi(),f=Xi(),g=Xi();return{dialogUi:r,popupUi:f,mainUi:g,getUiMotherships:()=>{const T=r.get().map(I=>I.mothership),P=f.get().map(I=>I.mothership);return T.fold(()=>P.toArray(),I=>P.fold(()=>[I],W=>xr(I.element,W.element)?[I]:[I,W]))},lazyGetInOuterOrDie:(T,P)=>()=>g.get().bind(I=>P(I.outerContainer)).getOrDie(`Could not find ${T} element in OuterContainer`)}},hQ="contexttoolbar-show",mQ="contexttoolbar-hide",gQ=r=>({hide:()=>rr(r,$a()),getValue:()=>Gn.getValue(r)}),Q$=(r,f)=>on(HS,(g,v)=>{const _=r.get(g),T=gQ(_);f.onAction(T,v.event.buttonApi)}),eJ=(r,f,g)=>{const{primary:v,..._}=f.original,T=ba(Z5({..._,type:"button",onAction:L}));return $$(T,g,[Q$(r,f)])},tJ=(r,f,g)=>{const{primary:v,..._}=f.original,T=ba(H5({..._,type:"togglebutton",onAction:L}));return tQ(T,g,[Q$(r,f)])},nJ=r=>r.type==="contextformtogglebutton",nC=(r,f,g)=>nJ(f)?tJ(r,f,g):eJ(r,f,g),oJ=(r,f,g)=>{const v=je(f,P=>oi(nC(r,P,g)));return{asSpecs:()=>je(v,P=>P.asSpec()),findPrimary:P=>tr(f,(I,W)=>I.primary?V.from(v[W]).bind(J=>J.getOpt(P)).filter(Oe(Jo.isDisabled)):V.none())}},pQ=(r,f)=>{const g=r.label.fold(()=>({}),T=>({"aria-label":T})),v=oi(K2.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:r.initValue(),inputAttributes:g,selectOnFocus:!0,inputBehaviours:Tn([No.config({mode:"special",onEnter:T=>_.findPrimary(T).map(P=>(bh(P),!0)),onLeft:(T,P)=>(P.cut(),V.none()),onRight:(T,P)=>(P.cut(),V.none())})])})),_=oJ(v,r.commands,f);return[{title:V.none(),items:[v.asSpec()]},{title:V.none(),items:_.asSpecs()}]},sJ={renderContextForm:(r,f,g)=>jd({type:r,uid:io("context-toolbar"),initGroups:pQ(f,g),onEscape:V.none,cyclicKeying:!0,providers:g}),buildInitGroups:pQ},bQ=(r,f,g)=>f.bottom-r.y>=g&&r.bottom-f.y>=g,rJ=r=>{const f=r.getBoundingClientRect();if(f.height<=0&&f.width<=0){const g=kd(lt.fromDom(r.startContainer),r.startOffset).element;return(ol(g)?Ha(g):V.some(g)).filter(yr).map(_=>_.dom.getBoundingClientRect()).getOr(f)}else return f},Z$=r=>{const f=r.selection.getRng(),g=rJ(f);if(r.inline){const v=dc();return ai(v.left+g.left,v.top+g.top,g.width,g.height)}else{const v=Zl(lt.fromDom(r.getBody()));return ai(v.x+g.left,v.y+g.top,g.width,g.height)}},iJ=(r,f)=>f.filter(g=>js(g)&&xu(g)).map(Zl).getOrThunk(()=>Z$(r)),H$=(r,f,g)=>{const v=Math.max(r.x+g,f.x),_=Math.min(r.right-g,f.right);return{x:v,width:_-v}},aJ=(r,f,g,v,_,T)=>{const P=lt.fromDom(r.getContainer()),I=sa(P,".tox-editor-header").getOr(P),W=di(I),J=W.y>=f.bottom,ie=v&&!J;if(r.inline&&ie)return{y:Math.max(W.bottom+T,g.y),bottom:g.bottom};if(r.inline&&!ie)return{y:g.y,bottom:Math.min(W.y-T,g.bottom)};const de=_==="line"?di(P):f;return ie?{y:Math.max(W.bottom+T,g.y),bottom:Math.min(de.bottom-T,g.bottom)}:{y:Math.max(de.y+T,g.y),bottom:Math.min(W.y-T,g.bottom)}},vQ=(r,f,g,v=0)=>{const _=Ug(window),T=di(lt.fromDom(r.getContentAreaContainer())),P=SS(r)||A3(r)||Ax(r),{x:I,width:W}=H$(T,_,v);if(r.inline&&!P)return ai(I,_.y,W,_.height);{const J=f.header.isPositionedAtTop(),{y:ie,bottom:de}=aJ(r,T,_,J,g,v);return ai(I,ie,W,de-ie)}},TT=12,z$={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"]},OQ={maxHeightFunction:bg(),maxWidthFunction:p9()},lJ=(r,f)=>{const g=r.selection.getRng(),v=kd(lt.fromDom(g.startContainer),g.startOffset);return g.startContainer===g.endContainer&&g.startOffset===g.endOffset-1&&xr(v.element,f)},cJ=(r,f,g)=>{const v=ea(r,"position");ro(r,"position",f);const _=g(r);return v.each(T=>ro(r,"position",T)),_},yQ=r=>r==="node",uJ=(r,f,g,v,_)=>{const T=Z$(r),P=v.lastElement().exists(I=>xr(g,I));if(lJ(r,g))return P?mF:Ap;if(P)return cJ(f,v.getMode(),()=>bQ(T,di(f),-20)&&!v.isReposition()?Jj:mF);{const I=v.getMode()==="fixed"?_.y+dc().top:_.y,W=Ii(f)+TT;return I+W<=T.y?Ap:mT}},fJ=(r,f,g,v)=>{const _=W=>(J,ie,de,ge,_e)=>{const Ie=uJ(r,ge,W,g,_e),it={...J,y:_e.y,height:_e.height};return{...Ie(it,ie,de,ge,_e),alwaysFit:!0}},T=W=>yQ(v)?[_(W)]:[];return f?{onLtr:W=>[Vl,vl,ec,Qu,Zr,tc].concat(T(W)),onRtl:W=>[Vl,ec,vl,Zr,Qu,tc].concat(T(W))}:{onLtr:W=>[tc,Vl,Qu,vl,Zr,ec].concat(T(W)),onRtl:W=>[tc,Vl,Zr,ec,Qu,vl].concat(T(W))}},wQ=(r,f,g,v)=>f==="line"?{bubble:vg(TT,0,z$),layouts:{onLtr:()=>[dm],onRtl:()=>[Sr]},overrides:OQ}:{bubble:vg(0,TT,z$,1/TT),layouts:fJ(r,g,v,f),overrides:OQ},V$=(r,f)=>{const g=Kn(f,T=>T.predicate(r.dom)),{pass:v,fail:_}=Zo(g,T=>T.type==="contexttoolbar");return{contextToolbars:v,contextForms:_}},dJ=r=>{if(r.length<=1)return r;{const f=T=>rn(r,P=>P.position===T),g=T=>Kn(r,P=>P.position===T),v=f("selection"),_=f("node");if(v||_)if(_&&v){const T=g("node"),P=je(g("selection"),I=>({...I,position:"node"}));return T.concat(P)}else return g(v?"selection":"node");else return g("line")}},hJ=r=>{if(r.length<=1)return r;{const f=v=>kt(r,_=>_.position===v);return f("selection").orThunk(()=>f("node")).orThunk(()=>f("line")).map(v=>v.position).fold(()=>[],v=>Kn(r,_=>_.position===v))}},mJ=(r,f,g)=>{const v=V$(r,f);if(v.contextForms.length>0)return V.some({elem:r,toolbars:[v.contextForms[0]]});{const _=V$(r,g);if(_.contextForms.length>0)return V.some({elem:r,toolbars:[_.contextForms[0]]});if(v.contextToolbars.length>0||_.contextToolbars.length>0){const T=dJ(v.contextToolbars.concat(_.contextToolbars));return V.some({elem:r,toolbars:T})}else return V.none()}},C4=(r,f,g)=>r(f)?V.none():Uc(f,v=>{if(yr(v)){const{contextToolbars:_,contextForms:T}=V$(v,g.inNodeScope),P=T.length>0?T:hJ(_);return P.length>0?V.some({elem:v,toolbars:P}):V.none()}else return V.none()},r),gJ=(r,f)=>{const g=lt.fromDom(f.getBody()),v=P=>xr(P,g),_=P=>!v(P)&&!Za(g,P),T=lt.fromDom(f.selection.getNode());return _(T)?V.none():mJ(T,r.inNodeScope,r.inEditorScope).orThunk(()=>C4(v,T,r))},k4=(r,f)=>{const g={},v=[],_=[],T={},P={},I=(ie,de)=>{const ge=ba(t8(de));g[ie]=ge,ge.launch.map(_e=>{T["form:"+ie]={...de.launch,type:_e.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{f(ge)}}}),ge.scope==="editor"?_.push(ge):v.push(ge),P[ie]=ge},W=(ie,de)=>{cU(de).each(ge=>{de.scope==="editor"?_.push(ge):v.push(ge),P[ie]=ge})},J=Xs(r);return mt(J,ie=>{const de=r[ie];de.type==="contextform"?I(ie,de):de.type==="contexttoolbar"&&W(ie,de)}),{forms:g,inNodeScope:v,inEditorScope:_,lookupTable:P,formNavigators:T}},ET=io("forward-slide"),W$=io("backward-slide"),U$=io("change-slide-event"),Y$="tox-pop--resizing",pJ=r=>{const f=Ho([]);return Ba.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:g=>{f.set([]),Ba.getContent(g).each(v=>{ks(v.element,"visibility")}),va(g.element,Y$),ks(g.element,"width")},inlineBehaviours:Tn([xs("context-toolbar-events",[lg(Jg(),(g,v)=>{v.event.raw.propertyName==="width"&&(va(g.element,Y$),ks(g.element,"width"))}),on(U$,(g,v)=>{const _=g.element;ks(_,"width");const T=ta(_);Ba.setContent(g,v.event.contents),Na(_,Y$);const P=ta(_);ro(_,"width",T+"px"),Ba.getContent(g).each(I=>{v.event.focus.bind(W=>(gf(W),al(_))).orThunk(()=>(No.focusIn(I),Qf($t(_))))}),setTimeout(()=>{ro(g.element,"width",P+"px")},0)}),on(ET,(g,v)=>{Ba.getContent(g).each(_=>{f.set(f.get().concat([{bar:_,focus:Qf($t(g.element))}]))}),Ao(g,U$,{contents:v.event.forwardContents,focus:V.none()})}),on(W$,(g,v)=>{Mr(f.get()).each(_=>{f.set(f.get().slice(0,f.get().length-1)),Ao(g,U$,{contents:gu(_.bar),focus:_.focus})})})]),No.config({mode:"special",onEscape:g=>Mr(f.get()).fold(()=>r.onEscape(),v=>(rr(g,W$),V.some(!0)))})]),lazySink:()=>wn.value(r.sink)})},X$="tox-pop--transition",bJ=(r,f,g,v)=>{const _=v.backstage,T=_.shared,P=an().deviceType.isTouch,I=Xi(),W=Xi(),J=Xi(),ie=pc(pJ({sink:g,onEscape:()=>(r.focus(),V.some(!0))})),de=()=>{const ko=J.get().getOr("node"),_s=yQ(ko)?1:0;return vQ(r,T,ko,_s)},ge=()=>!r.removed&&!(P()&&_.isContextMenuOpen()),_e=ko=>ze(Yn(ko,I.get(),xr),!0),Ie=()=>{if(ge()){const ko=de(),_s=ze(J.get(),"node")?iJ(r,I.get()):Z$(r);return ko.height<=0||!bQ(_s,ko,.01)}else return!0},it=()=>{I.clear(),W.clear(),J.clear(),Ba.hide(ie)},Qt=()=>{if(Ba.isOpen(ie)){const ko=ie.element;ks(ko,"display"),Ie()?ro(ko,"display","none"):(W.set(0),Ba.reposition(ie))}},dt=ko=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[ko],behaviours:Tn([No.config({mode:"acyclic"}),xs("pop-dialog-wrap-events",[Ci(_s=>{r.shortcuts.add("ctrl+F9","focus statusbar",()=>No.focusIn(_s))}),Ld(_s=>{r.shortcuts.remove("ctrl+F9")})])])}),ft=Mi(()=>k4(f,ko=>{const _s=kn([ko]);Ao(ie,ET,{forwardContents:dt(_s)})})),Yt=(ko,_s)=>_4(r,{buttons:ko,toolbar:_s.items,allowToolbarGroups:!1},v.backstage,V.some(["form:"])),Dt=(ko,_s)=>sJ.buildInitGroups(ko,_s),kn=ko=>{const{buttons:_s}=r.ui.registry.getAll(),hs=ft(),vr={..._s,...hs.formNavigators},Qo=_S(r)===Cg.scrolling?Cg.scrolling:Cg.default,fr=pt(je(ko,Qn=>Qn.type==="contexttoolbar"?Yt(vr,Qn):Dt(Qn,T.providers)));return jd({type:Qo,uid:io("context-toolbar"),initGroups:fr,onEscape:V.none,cyclicKeying:!0,providers:T.providers})},pn=(ko,_s)=>{const hs=ko==="node"?T.anchors.node(_s):T.anchors.cursor(),vr=wQ(r,ko,P(),{lastElement:I.get,isReposition:()=>ze(W.get(),0),getMode:()=>yu.getMode(g)});return ni(hs,vr)},Nn=(ko,_s)=>{if(Ys.cancel(),!ge())return;const hs=kn(ko),vr=ko[0].position,Qo=pn(vr,_s);J.set(vr),W.set(1);const fr=ie.element;ks(fr,"display"),_e(_s)||(va(fr,X$),yu.reset(g,ie)),Ba.showWithinBounds(ie,dt(hs),{anchor:Qo,transition:{classes:[X$],mode:"placement"}},()=>V.some(de())),_s.fold(I.clear,I.set),Ie()&&ro(fr,"display","none")};let jn=!1;const Ys=yf(()=>{if(!(!r.hasFocus()||r.removed||jn))if(uf(ie.element,X$))Ys.throttle();else{const ko=ft();gJ(ko,r).fold(it,_s=>{Nn(_s.toolbars,V.some(_s.elem))})}},17);r.on("init",()=>{r.on("remove",it),r.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",Qt),r.on("click keyup focus SetContent",Ys.throttle),r.on(mQ,it),r.on(hQ,ko=>{const _s=ft();ln(_s.lookupTable,ko.toolbarKey).each(hs=>{Nn([hs],fn(ko.target!==r,ko.target)),Ba.getContent(ie).each(No.focusIn)})}),r.on("focusout",ko=>{S3.setEditorTimeout(r,()=>{al(g.element).isNone()&&al(ie.element).isNone()&&it()},0)}),r.on("SwitchMode",()=>{r.mode.isReadOnly()&&it()}),r.on("AfterProgressState",ko=>{ko.state?it():r.hasFocus()&&Ys.throttle()}),r.on("dragstart",()=>{jn=!0}),r.on("dragend drop",()=>{jn=!1}),r.on("NodeChange",ko=>{al(ie.element).fold(Ys.throttle,L)})})},x4=r=>{mt([{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"}],g=>{r.ui.registry.addToggleButton(g.name,{tooltip:g.text,icon:g.icon,onAction:pd(r,g.cmd),onSetup:Ab(r,g.name)})}),r.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:zf(r),onAction:pd(r,"JustifyNone")})},j$=(r,f)=>{const g=()=>{const v=f.getOptions(r),_=f.getCurrent(r).map(f.hash),T=Xi();return je(v,P=>({type:"togglemenuitem",text:f.display(P),onSetup:I=>{const W=ie=>{ie&&(T.on(de=>de.setActive(!1)),T.set(I)),I.setActive(ie)};W(ze(_,f.hash(P)));const J=f.watcher(r,P,W);return()=>{T.clear(),J()}},onAction:()=>f.setCurrent(r,P)}))};r.ui.registry.addMenuButton(f.name,{tooltip:f.text,icon:f.icon,fetch:v=>v(g()),onSetup:f.onToolbarSetup}),r.ui.registry.addNestedMenuItem(f.name,{type:"nestedmenuitem",text:f.text,getSubmenuItems:g,onSetup:f.onMenuSetup})},_Q=r=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:Ex,hash:f=>yK(f,["fixed","relative","empty"]).getOr(f),display:we,watcher:(f,g,v)=>f.formatter.formatChanged("lineheight",v,!1,{value:g}).unbind,getCurrent:f=>V.from(f.queryCommandValue("LineHeight")),setCurrent:(f,g)=>f.execCommand("LineHeight",!1,g),onToolbarSetup:zf(r),onMenuSetup:zf(r)}),SQ=r=>V.from(p5(r)).map(g=>({name:"language",text:"Language",icon:"language",getOptions:G(g),hash:v=>R(v.customCode)?v.code:`${v.code}/${v.customCode}`,display:v=>v.title,watcher:(v,_,T)=>{var P;return v.formatter.formatChanged("lang",T,!1,{value:_.code,customValue:(P=_.customCode)!==null&&P!==void 0?P:null}).unbind},getCurrent:v=>{const _=lt.fromDom(v.selection.getNode());return cu(_,T=>V.some(T).filter(yr).bind(P=>me(P,"lang").map(W=>{const J=me(P,"data-mce-lang").getOrUndefined();return{code:W,customCode:J,title:""}})))},setCurrent:(v,_)=>v.execCommand("Lang",!1,_),onToolbarSetup:v=>{const _=mb();return v.setActive(r.formatter.match("lang",{},void 0,!0)),_.set(r.formatter.formatChanged("lang",v.setActive,!0)),Tg(_.clear,zf(r)(v))},onMenuSetup:zf(r)})),CQ=r=>{j$(r,_Q(r)),SQ(r).each(f=>j$(r,f))},vJ=(r,f)=>{dK(r,f),bK(r,f),MK(r,f),mK(r,f),DK(r,f)},kQ=r=>Db(r,"NodeChange",f=>{f.setEnabled(r.queryCommandState("outdent")&&r.selection.isEditable())}),OJ=r=>{r.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:kQ(r),onAction:pd(r,"outdent")}),r.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:zf(r),onAction:pd(r,"indent")})},yJ=r=>{OJ(r)},xQ=(r,f)=>g=>{g.setActive(f.get());const v=_=>{f.set(_.state),g.setActive(_.state)};return r.on("PastePlainTextToggle",v),Tg(()=>r.off("PastePlainTextToggle",v),zf(r)(g))},wJ=r=>{const f=Ho(kB(r)),g=()=>r.execCommand("mceTogglePlainTextPaste");r.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:g,onSetup:xQ(r,f)}),r.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:g,onSetup:xQ(r,f)})},q$=(r,f)=>()=>{r.execCommand("mceToggleFormat",!1,f)},AT=r=>{fv.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"}],(f,g)=>{r.ui.registry.addToggleButton(f.name,{tooltip:f.text,icon:f.icon,onSetup:Ab(r,f.name),onAction:q$(r,f.name)})});for(let f=1;f<=6;f++){const g="h"+f;r.ui.registry.addToggleButton(g,{text:g.toUpperCase(),tooltip:"Heading "+f,onSetup:Ab(r,g),onAction:q$(r,g)})}},_J=r=>{fv.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"}],f=>{r.ui.registry.addButton(f.name,{tooltip:f.text,icon:f.icon,onAction:pd(r,f.action)})}),fv.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"}],f=>{r.ui.registry.addButton(f.name,{tooltip:f.text,icon:f.icon,onSetup:zf(r),onAction:pd(r,f.action)})})},SJ=r=>{fv.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],f=>{r.ui.registry.addToggleButton(f.name,{tooltip:f.text,icon:f.icon,onAction:pd(r,f.action),onSetup:Ab(r,f.name)})})},CJ=r=>{AT(r),_J(r),SJ(r)},TQ=r=>{fv.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"}],f=>{r.ui.registry.addMenuItem(f.name,{text:f.text,icon:f.icon,shortcut:f.shortcut,onAction:pd(r,f.action)})}),fv.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"}],f=>{r.ui.registry.addMenuItem(f.name,{text:f.text,icon:f.icon,shortcut:f.shortcut,onSetup:zf(r),onAction:pd(r,f.action)})}),r.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:zf(r),onAction:q$(r,"code")})},kJ=r=>{CJ(r),TQ(r)},DT=(r,f)=>Db(r,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",g=>{g.setEnabled(!r.mode.isReadOnly()&&r.undoManager[f]())}),xJ=r=>{r.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:DT(r,"hasUndo"),onAction:pd(r,"undo")}),r.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:DT(r,"hasRedo"),onAction:pd(r,"redo")})},TJ=r=>{r.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:DT(r,"hasUndo"),onAction:pd(r,"undo")}),r.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:DT(r,"hasRedo"),onAction:pd(r,"redo")})},EJ=r=>{xJ(r),TJ(r)},AJ=r=>Db(r,"VisualAid",f=>{f.setActive(r.hasVisual)}),DJ=r=>{r.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:AJ(r),onAction:pd(r,"mceToggleVisualAid")})},PT=r=>{r.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:pd(r,"mceToggleVisualAid")})},EQ=r=>{PT(r),DJ(r)},PJ=(r,f)=>{x4(r),kJ(r),vJ(r,f),EJ(r),Z8(r),EQ(r),yJ(r),CQ(r),wJ(r)},MJ=r=>d(r)?r.split(/[ ,]/):r,G$=r=>f=>f.options.get(r),K$=r=>{const f=r.options.register;f("contextmenu_avoid_overlap",{processor:"string",default:""}),f("contextmenu_never_use_native",{processor:"boolean",default:!1}),f("contextmenu",{processor:g=>g===!1?{value:[],valid:!0}:d(g)||K(g,d)?{value:MJ(g),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},J$=G$("contextmenu_never_use_native"),AQ=G$("contextmenu_avoid_overlap"),RJ=r=>ww(r).length===0,ww=r=>{const f=r.ui.registry.getAll().contextMenus,g=r.options.get("contextmenu");return r.options.isSet("contextmenu")?g:Kn(g,v=>vs(f,v))},YO=(r,f)=>({type:"makeshift",x:r,y:f}),eN=(r,f,g)=>YO(r.x+f,r.y+g),tN=r=>r.type==="longpress"||r.type.indexOf("touch")===0,DQ=r=>{if(tN(r)){const f=r.touches[0];return YO(f.pageX,f.pageY)}else return YO(r.pageX,r.pageY)},$J=r=>{if(tN(r)){const f=r.touches[0];return YO(f.clientX,f.clientY)}else return YO(r.clientX,r.clientY)},PQ=(r,f)=>{const g=_x.DOM.getPos(r);return eN(f,g.x,g.y)},NJ=(r,f)=>f.type==="contextmenu"||f.type==="longpress"?r.inline?DQ(f):PQ(r.getContentAreaContainer(),$J(f)):MQ(r),MQ=r=>({type:"selection",root:lt.fromDom(r.selection.getNode())}),IJ=r=>({type:"node",node:V.some(lt.fromDom(r.selection.getNode())),root:lt.fromDom(r.getBody())}),RQ=(r,f,g)=>{switch(g){case"node":return IJ(r);case"point":return NJ(r,f);case"selection":return MQ(r)}},BJ=(r,f,g,v,_,T)=>{const P=g(),I=RQ(r,f,T);zS(P,Cp.CLOSE_ON_EXECUTE,v,{isHorizontalMenu:!1,search:V.none()}).map(W=>{f.preventDefault(),Ba.showMenuAt(_,{anchor:I},{menu:{markers:G2("normal")},data:W})})},$Q={onLtr:()=>[Vl,vl,ec,Qu,Zr,tc,Ap,mT,hT,YA,dT,fT],onRtl:()=>[Vl,ec,vl,Zr,Qu,tc,Ap,mT,dT,fT,hT,YA]},T4=12,NQ={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"]},IQ=(r,f)=>{const g=r.selection;if(g.isCollapsed()||f.touches.length<1)return!1;{const v=f.touches[0],_=g.getRng();return Rk(r.getWin(),B0.domRange(_)).exists(P=>P.left<=v.clientX&&P.right>=v.clientX&&P.top<=v.clientY&&P.bottom>=v.clientY)}},nN=r=>{const f=r.selection.getRng(),g=()=>{S3.setEditorTimeout(r,()=>{r.selection.setRng(f)},10),T()};r.once("touchend",g);const v=P=>{P.preventDefault(),P.stopImmediatePropagation()};r.on("mousedown",v,!0);const _=()=>T();r.once("longpresscancel",_);const T=()=>{r.off("touchend",g),r.off("longpresscancel",_),r.off("mousedown",v)}},LJ=(r,f,g)=>{const v=RQ(r,f,g);return{bubble:vg(0,g==="point"?T4:0,NQ),layouts:$Q,overrides:{maxWidthFunction:p9(),maxHeightFunction:bg()},...v}},BQ=(r,f,g,v,_,T,P)=>{const I=LJ(r,f,T);zS(g,Cp.CLOSE_ON_EXECUTE,v,{isHorizontalMenu:!0,search:V.none()}).map(W=>{f.preventDefault();const J=P?md.HighlightMenuAndItem:md.HighlightNone;Ba.showMenuWithinBounds(_,{anchor:I},{menu:{markers:G2("normal"),highlightOnOpen:J},data:W,type:"horizontal"},()=>V.some(vQ(r,v.shared,T==="node"?"node":"selection"))),r.dispatch(mQ)})},FJ=(r,f,g,v,_,T)=>{const P=an(),I=P.os.isiOS(),W=P.os.isMacOS(),J=P.os.isAndroid(),ie=P.deviceType.isTouch(),de=()=>!(J||I||W&&ie),ge=()=>{const _e=g();BQ(r,f,_e,v,_,T,de())};if((W||I)&&T!=="node"){const _e=()=>{nN(r),ge()};IQ(r,f)?_e():(r.once("selectionchange",_e),r.once("touchend",()=>r.off("selectionchange",_e)))}else ge()},LQ=r=>d(r)?r==="|":r.type==="separator",oC={type:"separator"},oN=r=>{const f=g=>({text:g.text,icon:g.icon,enabled:g.enabled,shortcut:g.shortcut});if(d(r))return r;switch(r.type){case"separator":return oC;case"submenu":return{type:"nestedmenuitem",...f(r),getSubmenuItems:()=>{const v=r.getSubmenuItems();return d(v)?v:je(v,oN)}};default:const g=r;return{type:"menuitem",...f(g),onAction:te(g.onAction)}}},FQ=(r,f)=>{if(f.length===0)return r;const v=Mr(r).filter(_=>!LQ(_)).fold(()=>[],_=>[oC]);return r.concat(v).concat(f).concat([oC])},QJ=(r,f,g)=>{const v=Yo(f,(_,T)=>ln(r,T.toLowerCase()).map(P=>{const I=P.update(g);if(d(I)&&Ge(Oi(I)))return FQ(_,I.split(" "));if(y(I)&&I.length>0){const W=je(I,oN);return FQ(_,W)}else return _}).getOrThunk(()=>_.concat([T])),[]);return v.length>0&&LQ(v[v.length-1])&&v.pop(),v},ZJ=(r,f)=>f.ctrlKey&&!J$(r),HJ=r=>r.type==="longpress"||vs(r,"touches"),QQ=(r,f)=>!HJ(f)&&(f.button!==2||f.target===r.getBody()&&f.pointerType===""),sN=(r,f)=>QQ(r,f)?r.selection.getStart(!0):f.target,ZQ=(r,f)=>{const g=AQ(r),v=QQ(r,f)?"selection":"point";if(Ge(g)){const _=sN(r,f);return IS(lt.fromDom(_),g)?"node":v}else return v},zJ=(r,f,g)=>{const _=an().deviceType.isTouch,T=pc(Ba.sketch({dom:{tag:"div"},lazySink:f,onEscape:()=>r.focus(),onShow:()=>g.setContextMenuState(!0),onHide:()=>g.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Tn([xs("dismissContextMenu",[on(rg(),(W,J)=>{Gs.close(W),r.focus()})])])})),P=()=>Ba.hide(T),I=W=>{if(J$(r)&&W.preventDefault(),ZJ(r,W)||RJ(r))return;const J=ZQ(r,W),ie=()=>{const ge=sN(r,W),_e=r.ui.registry.getAll(),Ie=ww(r);return QJ(_e.contextMenus,Ie,ge)};(_()?FJ:BJ)(r,W,ie,g,T,J)};r.on("init",()=>{const W="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(_()?"":" ResizeWindow");r.on(W,P),r.on("longpress contextmenu",I)})},rN=j.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),MT=r=>f=>f.translate(-r.left,-r.top),E4=r=>f=>f.translate(r.left,r.top),pv=r=>(f,g)=>Yo(r,(v,_)=>_(v),pr(f,g)),A4=(r,f,g)=>r.fold(pv([E4(g),MT(f)]),pv([MT(f)]),pv([])),sC=(r,f,g)=>r.fold(pv([E4(g)]),pv([]),pv([E4(f)])),HQ=(r,f,g)=>r.fold(pv([]),pv([MT(g)]),pv([E4(f),MT(g)])),iN=(r,f,g,v,_,T)=>{const P=sC(r,_,T),I=sC(f,_,T);return Math.abs(P.left-I.left)<=g&&Math.abs(P.top-I.top)<=v},VJ=(r,f,g,v,_,T)=>{const P=sC(r,_,T),I=sC(f,_,T),W=Math.abs(P.left-I.left),J=Math.abs(P.top-I.top);return pr(W,J)},zQ=(r,f,g)=>{const v=r.fold((_,T)=>({position:V.some("absolute"),left:V.some(_+"px"),top:V.some(T+"px")}),(_,T)=>({position:V.some("absolute"),left:V.some(_-g.left+"px"),top:V.some(T-g.top+"px")}),(_,T)=>({position:V.some("fixed"),left:V.some(_+"px"),top:V.some(T+"px")}));return{right:V.none(),bottom:V.none(),...v}},aN=(r,f,g)=>r.fold((v,_)=>RT(v+f,_+g),(v,_)=>XO(v+f,_+g),(v,_)=>_w(v+f,_+g)),D4=(r,f,g,v)=>{const _=(T,P)=>(I,W)=>{const J=T(f,g,v);return P(I.getOr(J.left),W.getOr(J.top))};return r.fold(_(HQ,RT),_(sC,XO),_(A4,_w))},RT=rN.offset,XO=rN.absolute,_w=rN.fixed,VQ=(r,f)=>{const g=zi(r,f);return R(g)?NaN:parseInt(g,10)},WJ=(r,f)=>{const g=r.element,v=VQ(g,f.leftAttr),_=VQ(g,f.topAttr);return isNaN(v)||isNaN(_)?V.none():V.some(pr(v,_))},UJ=(r,f,g)=>{const v=r.element;qn(v,f.leftAttr,g.left+"px"),qn(v,f.topAttr,g.top+"px")},WQ=(r,f)=>{const g=r.element;Ue(g,f.leftAttr),Ue(g,f.topAttr)},YJ=(r,f,g,v)=>WJ(r,f).fold(()=>g,_=>_w(_.left+v.left,_.top+v.top)),UQ=(r,f,g,v,_,T)=>{const P=YJ(r,f,g,v),I=f.mustSnap?lN(r,f,P,_,T):jJ(r,f,P,_,T),W=A4(P,_,T);return UJ(r,f,W),I.fold(()=>({coord:_w(W.left,W.top),extra:V.none()}),J=>({coord:J.output,extra:J.extra}))},XJ=(r,f)=>{WQ(r,f)},YQ=(r,f,g,v)=>tr(r,_=>{const T=_.sensor;return iN(f,T,_.range.left,_.range.top,g,v)?V.some({output:D4(_.output,f,g,v),extra:_.extra}):V.none()}),lN=(r,f,g,v,_)=>{const T=f.getSnapPoints(r);return YQ(T,g,v,_).orThunk(()=>Yo(T,(W,J)=>{const ie=J.sensor,de=VJ(g,ie,J.range.left,J.range.top,v,_);return W.deltas.fold(()=>({deltas:V.some(de),snap:V.some(J)}),ge=>{const _e=(de.left+de.top)/2,Ie=(ge.left+ge.top)/2;return _e<=Ie?{deltas:V.some(de),snap:V.some(J)}:W})},{deltas:V.none(),snap:V.none()}).snap.map(W=>({output:D4(W.output,g,v,_),extra:W.extra})))},jJ=(r,f,g,v,_)=>{const T=f.getSnapPoints(r);return YQ(T,g,v,_)},XQ=(r,f,g)=>({coord:D4(r.output,r.output,f,g),extra:r.extra});var qJ=Object.freeze({__proto__:null,snapTo:(r,f,g,v)=>{const _=f.getTarget(r.element);if(f.repositionTarget){const T=ca(r.element),P=dc(T),I=JR(_),W=XQ(v,P,I),J=zQ(W.coord,P,I);gn(_,J)}}});const $T="data-initial-z-index",GJ=r=>{Ha(r.element).filter(yr).each(f=>{me(f,$T).fold(()=>ks(f,"z-index"),g=>ro(f,"z-index",g)),Ue(f,$T)})},KJ=r=>{Ha(r.element).filter(yr).each(f=>{ea(f,"z-index").each(g=>{qn(f,$T,g)}),ro(f,"z-index",Gr(r.element,"z-index"))})},jQ=(r,f)=>{r.getSystem().addToGui(f),KJ(f)},JJ=r=>{GJ(r),r.getSystem().removeFromGui(r)},qQ=(r,f,g)=>r.getSystem().build(v1.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[f]},events:g}));var GQ=Xa("snaps",[nn("getSnapPoints"),qs("onSensor"),nn("leftAttr"),nn("topAttr"),xt("lazyViewport",ue),xt("mustSnap",!1)]);const cN=[xt("useFixed",tt),nn("blockerClass"),xt("getTarget",we),xt("onDrag",L),xt("repositionTarget",!0),xt("onDrop",L),qa("getBounds",ue),GQ],eee=r=>po(ea(r,"left"),ea(r,"top"),ea(r,"position"),(f,g,v)=>(v==="fixed"?_w:RT)(parseInt(f,10),parseInt(g,10))).getOrThunk(()=>{const f=Tc(r);return XO(f.left,f.top)}),tee=(r,f,g,v,_)=>{const T=_.bounds,P=sC(f,g,v),I=cd(P.left,T.x,T.x+T.width-_.width),W=cd(P.top,T.y,T.y+T.height-_.height),J=XO(I,W);return f.fold(()=>{const ie=HQ(J,g,v);return RT(ie.left,ie.top)},G(J),()=>{const ie=A4(J,g,v);return _w(ie.left,ie.top)})},nee=(r,f,g,v,_,T,P)=>{const I=f.fold(()=>{const W=aN(g,T.left,T.top),J=A4(W,v,_);return _w(J.left,J.top)},W=>{const J=UQ(r,W,g,T,v,_);return J.extra.each(ie=>{W.onSensor(r,ie)}),J.coord});return tee(r,I,v,_,P)},oee=(r,f,g,v)=>{const _=f.getTarget(r.element);if(f.repositionTarget){const T=ca(r.element),P=dc(T),I=JR(_),W=eee(_),J=nee(r,f.snaps,W,P,I,v,g),ie=zQ(J,P,I);gn(_,ie)}f.onDrag(r,_,v)},KQ=(r,f)=>({bounds:r.getBounds(),height:Xf(f.element),width:za(f.element)}),uN=(r,f,g,v,_)=>{const T=g.update(v,_),P=g.getStartData().getOrThunk(()=>KQ(f,r));T.each(I=>{oee(r,f,P,I)})},JQ=(r,f,g,v)=>{f.each(JJ),g.snaps.each(T=>{XJ(r,T)});const _=g.getTarget(r.element);v.reset(),g.onDrop(r,_)},P4=r=>(f,g)=>{const v=_=>{g.setStartData(KQ(f,_))};return li([on(sg(),_=>{g.getStartData().each(()=>v(_))}),...r(f,g,v)])},see=r=>li([on(Fr(),r.forceDrop),on(eb(),r.drop),on(Ma(),(f,g)=>{r.move(g.event)}),on(gc(),r.delayDrop)]);var iee=Object.freeze({__proto__:null,getData:r=>V.from(pr(r.x,r.y)),getDelta:(r,f)=>pr(f.left-r.left,f.top-r.top)});const eZ=(r,f,g)=>[on(Fr(),(v,_)=>{if(_.event.raw.button!==0)return;_.stop();const P=()=>JQ(v,V.some(J),r,f),I=dL(P,200),W={drop:P,delayDrop:I.schedule,forceDrop:P,move:de=>{I.cancel(),uN(v,r,f,iee,de)}},J=qQ(v,r.blockerClass,see(W));(()=>{g(v),jQ(v,J)})()})],Sw=[...cN,Yi("dragger",{handlers:P4(eZ)})],tZ=r=>li([on(uu(),r.forceDrop),on(Jm(),r.drop),on(Ps(),r.drop),on(Xp(),(f,g)=>{r.move(g.event)})]),aee=r=>{const f=r[0];return V.some(pr(f.clientX,f.clientY))};var nZ=Object.freeze({__proto__:null,getData:r=>{const g=r.raw.touches;return g.length===1?aee(g):V.none()},getDelta:(r,f)=>pr(f.left-r.left,f.top-r.top)});const fN=(r,f,g)=>{const v=Xi(),_=T=>{JQ(T,v.get(),r,f),v.clear()};return[on(uu(),(T,P)=>{P.stop();const I=()=>_(T),W={drop:I,delayDrop:L,forceDrop:I,move:de=>{uN(T,r,f,nZ,de)}},J=qQ(T,r.blockerClass,tZ(W));v.set(J),(()=>{g(T),jQ(T,J)})()}),on(Xp(),(T,P)=>{P.stop(),uN(T,r,f,nZ,P.event)}),on(Jm(),(T,P)=>{P.stop(),_(T)}),on(Ps(),_)]},lee=[...cN,Yi("dragger",{handlers:P4(fN)})],cee=(r,f,g)=>[...eZ(r,f,g),...fN(r,f,g)],uee=[...cN,Yi("dragger",{handlers:P4(cee)})];var fee=Object.freeze({__proto__:null,mouse:Sw,touch:lee,mouseOrTouch:uee}),dee=Object.freeze({__proto__:null,init:()=>{let r=V.none(),f=V.none();const g=()=>{r=V.none(),f=V.none()},v=(W,J)=>{const ie=r.map(de=>W.getDelta(de,J));return r=V.some(J),ie},_=(W,J)=>W.getData(J).bind(ie=>v(W,ie)),T=W=>{f=V.some(W)},P=()=>f,I=G({});return mu({readState:I,reset:g,update:_,getStartData:P,setStartData:T})}});const Cw=l2({branchKey:"mode",branches:fee,name:"dragging",active:{events:(r,f)=>r.dragger.handlers(r,f)},extra:{snap:r=>({sensor:r.sensor,range:r.range,output:r.output,extra:V.from(r.extra)})},state:dee,apis:qJ}),M4=40,NT=M4/2,oZ=(r,f,g,v,_,T)=>r.fold(()=>Cw.snap({sensor:XO(g-NT,v-NT),range:pr(_,T),output:XO(V.some(g),V.some(v)),extra:{td:f}}),P=>{const I=g-NT,W=v-NT,J=M4,ie=M4,de=P.element.dom.getBoundingClientRect();return Cw.snap({sensor:XO(I,W),range:pr(J,ie),output:XO(V.some(g-de.width/2),V.some(v-de.height/2)),extra:{td:f}})}),rC=(r,f,g)=>{const v=(_,T)=>_.exists(P=>xr(P,T));return{getSnapPoints:r,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(_,T)=>{const P=T.td;v(f.get(),P)||(f.set(P),g(P))},mustSnap:!0}},sZ=r=>oi(Jc.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Tn([Cw.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:r}),Xx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),hee=(r,f)=>{const g=Ho([]),v=Ho([]),_=Ho(!1),T=Xi(),P=Xi(),I=Nn=>{const jn=Zl(Nn);return oZ(_e.getOpt(f),Nn,jn.x,jn.y,jn.width,jn.height)},W=()=>je(g.get(),Nn=>I(Nn)),J=Nn=>{const jn=Zl(Nn);return oZ(Ie.getOpt(f),Nn,jn.right,jn.bottom,jn.width,jn.height)},ie=()=>je(v.get(),Nn=>J(Nn)),de=rC(W,T,Nn=>{P.get().each(jn=>{r.dispatch("TableSelectorChange",{start:Nn,finish:jn})})}),ge=rC(ie,P,Nn=>{T.get().each(jn=>{r.dispatch("TableSelectorChange",{start:jn,finish:Nn})})}),_e=sZ(de),Ie=sZ(ge),it=pc(_e.asSpec()),Qt=pc(Ie.asSpec()),dt=(Nn,jn,Ys,ko)=>{const _s=jn.dom.getBoundingClientRect();ks(Nn.element,"display");const hs=Qc(lt.fromDom(r.getBody())).dom.innerHeight,vr=Ys(_s),Qo=ko(_s,hs);(vr||Qo)&&ro(Nn.element,"display","none")},ft=(Nn,jn,Ys,ko)=>{const _s=Ys(jn);Cw.snapTo(Nn,_s),dt(Nn,jn,Qo=>Qo[ko]<0,(Qo,fr)=>Qo[ko]>fr)},Yt=Nn=>ft(it,Nn,I,"top"),Dt=()=>T.get().each(Yt),kn=Nn=>ft(Qt,Nn,J,"bottom"),pn=()=>P.get().each(kn);an().deviceType.isTouch()&&(r.on("TableSelectionChange",Nn=>{_.get()||(cl(f,it),cl(f,Qt),_.set(!0)),T.set(Nn.start),P.set(Nn.finish),Nn.otherCells.each(jn=>{g.set(jn.upOrLeftCells),v.set(jn.downOrRightCells),Yt(Nn.start),kn(Nn.finish)})}),r.on("ResizeEditor ResizeWindow ScrollContent",()=>{Dt(),pn()}),r.on("TableSelectionClear",()=>{_.get()&&(qc(it),qc(Qt),_.set(!1)),T.clear(),P.clear()}))};var dN=`<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 mee=r=>r.nodeName==="BR"||!!r.getAttribute("data-mce-bogus")||r.getAttribute("data-mce-type")==="bookmark",gee=(r,f,g)=>{var v;const _=(v=f.delimiter)!==null&&v!==void 0?v:"\u203A",T=(J,ie,de)=>Jc.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":de,"aria-level":de+1}},components:[Li(J)],action:ge=>{r.focus(),r.selection.select(ie),r.nodeChanged()},buttonBehaviours:Tn([xg.button(g.isDisabled),rc()])}),P=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Li(` ${_} `)]}),I=J=>Yo(J,(ie,de,ge)=>{const _e=T(de.name,de.element,ge);return ge===0?ie.concat([_e]):ie.concat([P(),_e])},[]),W=J=>{const ie=[];let de=J.length;for(;de-- >0;){const ge=J[de];if(ge.nodeType===1&&!mee(ge)){const _e=Nh(r,ge);if(_e.isDefaultPrevented()||ie.push({name:_e.name,element:ge}),_e.isPropagationStopped())break}}return ie};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Tn([No.config({mode:"flow",selector:"div[role=button]"}),Jo.config({disabled:g.isDisabled}),rc(),Ka.config({}),gs.config({}),xs("elementPathEvents",[Ci((J,ie)=>{r.shortcuts.add("alt+F11","focus statusbar elementpath",()=>No.focusIn(J)),r.on("NodeChange",de=>{const ge=W(de.parents),_e=ge.length>0?I(ge):[];gs.set(J,_e)})})])]),components:[]}};var jO;(function(r){r[r.None=0]="None",r[r.Both=1]="Both",r[r.Vertical=2]="Vertical"})(jO||(jO={}));const pee=(r,f,g,v,_)=>{const T={height:S4(v+f.top,h5(r),m5(r))};return g===jO.Both&&(T.width=S4(_+f.left,Cx(r),yS(r))),T},rZ=(r,f,g)=>{const v=lt.fromDom(r.getContainer()),_=pee(r,f,g,Ii(v),ta(v));dr(_,(T,P)=>{U(T)&&ro(v,P,B$(T))}),j3(r)},bee=r=>{const f=CB(r);return f===!1?jO.None:f==="both"?jO.Both:jO.Vertical},R4=(r,f,g,v)=>{const T=pr(g*20,v*20);return rZ(r,T,f),V.some(!0)},vee=(r,f)=>{const g=bee(r);if(g===jO.None)return V.none();const v=g===jO.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return V.some(Sp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:f.translate("Resize"),"aria-label":f.translate(v)},behaviours:[Cw.config({mode:"mouse",repositionTarget:!1,onDrag:(_,T,P)=>rZ(r,P,g),blockerClass:"tox-blocker"}),No.config({mode:"special",onLeft:()=>R4(r,g,-1,0),onRight:()=>R4(r,g,1,0),onUp:()=>R4(r,g,0,-1),onDown:()=>R4(r,g,0,1)}),Ka.config({}),ns.config({})]},f.icons))},Oee=(r,f)=>{const g=(v,_,T)=>gs.set(v,[Li(f.translate(["{0} "+T,_[T]]))]);return Jc.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Tn([xg.button(f.isDisabled),rc(),Ka.config({}),gs.config({}),Gn.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),xs("wordcount-events",[hu(v=>{const _=Gn.getValue(v),T=_.mode==="words"?"characters":"words";Gn.setValue(v,{mode:T,count:_.count}),g(v,_.count,T)}),Ci(v=>{r.on("wordCountUpdate",_=>{const{mode:T}=Gn.getValue(v);Gn.setValue(v,{mode:T,count:_.wordCount}),g(v,_.wordCount,T)})})])]),eventOrder:{[af()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},yee=(r,f)=>{const g=()=>({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":Cm.translate(["Powered by {0}","Tiny"])},innerHtml:dN.trim()},behaviours:Tn([ns.config({})])}]}),v=()=>{const I=J5("Alt+0"),W="Press {0} for help";return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Li(Cm.translate([W,I]))]}},_=()=>{const I=[];return r.hasPlugin("wordcount")&&I.push(Oee(r,f)),Tx(r)&&I.push(g()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:I}},T=()=>{const I=[],W=EB(r),J=SB(r),ie=Tx(r)||r.hasPlugin("wordcount"),de=()=>{const ge="tox-statusbar__text-container--flex-start",_e="tox-statusbar__text-container--flex-end",Ie="tox-statusbar__text-container--space-around";if(W){const it="tox-statusbar__text-container-3-cols";return!ie&&!J?[it,Ie]:ie&&!J?[it,_e]:[it,ge]}return[ie&&!J?_e:ge]};return J&&I.push(gee(r,{},f)),W&&I.push(v()),ie&&I.push(_()),I.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...de()]},components:I}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const I=T(),W=vee(r,f);return I.concat(W.toArray())})()}},iZ=(r,f)=>f.get().getOrDie(`UI for ${r} has not been rendered`),wee=(r,f)=>{const g=r.inline,v=g?KK:VK,_=Dx(r)?rG:Fq,T=JK(),P=Xi(),I=Xi(),W=Xi(),ge=an().deviceType.isTouch()?["tox-platform-touch"]:[],_e=C5(r),Ie=_S(r),it=oi({dom:{tag:"div",classes:["tox-anchorbar"]}}),Qt=oi({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),dt=()=>T.mainUi.get().map(Wo=>Wo.outerContainer).bind(ji.getHeader),ft=()=>wn.fromOption(T.dialogUi.get().map(Wo=>Wo.sink),"UI has not been rendered"),Yt=()=>wn.fromOption(T.popupUi.get().map(Wo=>Wo.sink),"(popup) UI has not been rendered"),Dt=T.lazyGetInOuterOrDie("anchor bar",it.getOpt),kn=T.lazyGetInOuterOrDie("bottom anchor bar",Qt.getOpt),pn=T.lazyGetInOuterOrDie("toolbar",ji.getToolbar),Nn=T.lazyGetInOuterOrDie("throbber",ji.getThrobber),jn=Rq({popup:Yt,dialog:ft},r,Dt,kn),Ys=()=>{const Wo={attributes:{[$0]:_e?Th.BottomToTop:Th.TopToBottom}},Os=ji.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:jn.popup,onEscape:()=>{r.focus()}}),$i=ji.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:jn.popup.shared.getSink,providers:jn.popup.shared.providers,onEscape:()=>{r.focus()},onToolbarToggled:yv=>{aM(r,yv)},type:Ie,lazyToolbar:pn,lazyHeader:()=>dt().getOrDie("Could not find header element"),...Wo}),zr=ji.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:jn.popup.shared.providers,onEscape:()=>{r.focus()},type:Ie}),_f=Ax(r),ya=A3(r),Kd=SS(r),Pp=TB(r),JO=ko(),ey=_f||ya||Kd,$w=()=>_f?[zr]:ya?[$i]:[],ty=Pp?[JO,Os]:[Os];return ji.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(ey?[]:["tox-editor-header--empty"]),...Wo},components:pt([Kd?ty:[],$w(),CS(r)?[]:[it.asSpec()]]),sticky:Dx(r),editor:r,sharedBackstage:jn.popup.shared})},ko=()=>ji.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),_s=()=>{const Wo=ji.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),Os=ji.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[Wo,Os]}},hs=()=>{const Wo=D3(r),Os=xr(Hi(),Wo)&&Gr(Wo,"display")==="grid",$i={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(ge),attributes:{...Cm.isRtl()?{dir:"rtl"}:{}}},behaviours:Tn([yu.config({useFixed:()=>_.isDocked(dt)})])},zr={dom:{styles:{width:document.body.clientWidth+"px"}},events:li([on(gh(),Kd=>{ro(Kd.element,"width",document.body.clientWidth+"px")})])},_f=pc(ni($i,Os?zr:{})),ya=BM(_f);return I.set(ya),{sink:_f,mothership:ya}},vr=()=>{const Wo={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(ge),attributes:{...Cm.isRtl()?{dir:"rtl"}:{}}},behaviours:Tn([yu.config({useFixed:()=>_.isDocked(dt),getBounds:()=>f.getPopupSinkBounds()})])},Os=pc(Wo),$i=BM(Os);return W.set($i),{sink:Os,mothership:$i}},Qo=()=>{const Wo=Ys(),Os=_s(),$i=ji.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:jn.popup}),zr=ji.parts.viewWrapper({backstage:jn.popup}),_f=_5(r)&&!g?V.some(yee(r,jn.popup.shared.providers)):V.none(),ya=pt([_e?[]:[Wo],g?[]:[Os],_e?[Wo]:[]]),Kd=ji.parts.editorContainer({components:pt([ya,g?[]:[Qt.asSpec(),..._f.toArray()]])}),Pp=k5(r),JO={role:"application",...Cm.isRtl()?{dir:"rtl"}:{},...Pp?{"aria-hidden":"true"}:{}},ey=pc(ji.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(g?["tox-tinymce-inline"]:[]).concat(_e?["tox-tinymce--toolbar-bottom"]:[]).concat(ge),styles:{visibility:"hidden",...Pp?{opacity:"0",border:"0"}:{}},attributes:JO},components:[Kd,...g?[]:[zr],$i],behaviours:Tn([rc(),Jo.config({disableClass:"tox-tinymce--disabled"}),No.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"})])})),$w=BM(ey);return P.set($w),{mothership:$w,outerContainer:ey}},fr=Wo=>{const Os=B$(UK(r)),$i=B$(YK(r));return r.inline||(Ef("div","width",$i)&&ro(Wo.element,"width",$i),Ef("div","height",Os)?ro(Wo.element,"height",Os):ro(Wo.element,"height","400px")),Os},Qn=Wo=>{r.addShortcut("alt+F9","focus menubar",()=>{ji.focusMenubar(Wo)}),r.addShortcut("alt+F10","focus toolbar",()=>{ji.focusToolbar(Wo)}),r.addCommand("ToggleToolbarDrawer",(Os,$i)=>{$i!=null&&$i.skipFocus?ji.toggleToolbarDrawerWithoutFocusing(Wo):ji.toggleToolbarDrawer(Wo)}),r.addQueryStateHandler("ToggleToolbarDrawer",()=>ji.isToolbarDrawerToggled(Wo))},_o=Wo=>{const{mainUi:Os,popupUi:$i,uiMotherships:zr}=Wo;Ns(gB(r),(MN,dC)=>{r.ui.registry.addGroupToolbarButton(dC,MN)});const{buttons:_f,menuItems:ya,contextToolbars:Kd,sidebars:Pp,views:JO}=r.ui.registry.getAll(),ey=S5(r),$w={menuItems:ya,menus:PO(r),menubar:bB(r),toolbar:ey.getOrThunk(()=>xx(r)),allowToolbarGroups:Ie===Cg.floating,buttons:_f,sidebar:Pp,views:JO};Qn(Os.outerContainer),$q(r,Os.mothership,zr),_.setup(r,jn.popup.shared,dt),PJ(r,jn.popup),zJ(r,jn.popup.shared.getSink,jn.popup),yT(r),CG(r,Nn,jn.popup.shared),bJ(r,Kd,$i.sink,{backstage:jn.popup}),hee(r,$i.sink);const ty=r.getElement(),yv=fr(Os.outerContainer),PN={targetNode:ty,height:yv};return v.render(r,Wo,$w,jn.popup,PN)},us=Wo=>(W.set(Wo.mothership),Wo),Js=()=>{const Wo=Qo(),Os=hs(),$i=Eb(r)?vr():us(Os);T.dialogUi.set(Os),T.popupUi.set($i),T.mainUi.set(Wo);const zr={popupUi:$i,dialogUi:Os,mainUi:Wo,uiMotherships:T.getUiMotherships()};return _o(zr)};return{popups:{backstage:jn.popup,getMothership:()=>iZ("popups",W)},dialogs:{backstage:jn.dialog,getMothership:()=>iZ("dialogs",I)},renderUI:Js}},_ee=(r,f)=>{const g=me(r,"id").fold(()=>{const v=io("dialog-label");return qn(f,"id",v),v},we);qn(r,"aria-labelledby",g)},See=G([nn("lazySink"),Er("dragBlockClass"),qa("getBounds",ue),xt("useTabstopAt",ot),xt("firstTabstop",0),xt("eventOrder",{}),Wl("modalBehaviours",[No]),pu("onExecute"),Gy("onEscape")]),hN={sketch:we},Cee=G([Yd({name:"draghandle",overrides:(r,f)=>({behaviours:Tn([Cw.config({mode:"mouse",getTarget:g=>fg(g,'[role="dialog"]').getOr(g),blockerClass:r.dragBlockClass.getOrDie(new Error(`The drag blocker class was not specified for a dialog with a drag handle:
|
|
`+JSON.stringify(f,null,2)).message),getBounds:r.getDragBounds})])})}),Gc({schema:[nn("dom")],name:"title"}),Gc({factory:hN,schema:[nn("dom")],name:"close"}),Gc({factory:hN,schema:[nn("dom")],name:"body"}),Yd({factory:hN,schema:[nn("dom")],name:"footer"}),Mh({factory:{sketch:(r,f)=>({...r,dom:f.dom,components:f.components})},schema:[xt("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),xt("components",[])],name:"blocker"})]),kee=(r,f,g,v)=>{const _=Xi(),T=_e=>{_.set(_e);const Ie=r.lazySink(_e).getOrDie(),it=v.blocker(),Qt=Ie.getSystem().build({...it,components:it.components.concat([gu(_e)]),behaviours:Tn([ns.config({}),xs("dialog-blocker-events",[lg(Gi(),()=>{Lh.isBlocked(_e)?L():No.focusIn(_e)})])])});cl(Ie,Qt),No.focusIn(_e)},P=_e=>{_.clear(),Ha(_e.element).each(Ie=>{_e.getSystem().getByDom(Ie).each(it=>{qc(it)})})},I=_e=>u1(_e,r,"body"),W=_e=>Ri(_e,r,"footer"),J=(_e,Ie)=>{Lh.block(_e,Ie)},ie=_e=>{Lh.unblock(_e)},de=io("modal-events"),ge={...r.eventOrder,[Lu()]:[de].concat(r.eventOrder["alloy.system.attached"]||[])};return{uid:r.uid,dom:r.dom,components:f,apis:{show:T,hide:P,getBody:I,getFooter:W,setIdle:ie,setBusy:J},eventOrder:ge,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:sc(r.modalBehaviours,[gs.config({}),No.config({mode:"cyclic",onEnter:r.onExecute,onEscape:r.onEscape,useTabstopAt:r.useTabstopAt,firstTabstop:r.firstTabstop}),Lh.config({getRoot:_.get}),xs(de,[Ci(_e=>{_ee(_e.element,u1(_e,r,"title").element)})])])}},Nl=wu({name:"ModalDialog",configFields:See(),partFields:Cee(),factory:kee,apis:{show:(r,f)=>{r.show(f)},hide:(r,f)=>{r.hide(f)},getBody:(r,f)=>r.getBody(f),getFooter:(r,f)=>r.getFooter(f),setBusy:(r,f,g)=>{r.setBusy(f,g)},setIdle:(r,f)=>{r.setIdle(f)}}}),xee=fo([$l,Q3].concat(tw)),Tee=Iu,mN=[Q5("button"),kg,Bu("align","end",["start","end"]),TS,kp,l0("buttonType",["primary","secondary"])],aZ=[...mN,m1],gN=[Ua("type",["submit","cancel","custom"]),...aZ],Eee=[Ua("type",["menu"]),MO,tv,kg,Hl("items",xee),...mN],lZ=[...mN,Ua("type",["togglebutton"]),xa("tooltip"),kg,MO,ja("active",!1)],Aee=xl("type",{submit:gN,cancel:gN,custom:gN,menu:Eee,togglebutton:lZ}),Dee=[$l,m1,Ua("level",["info","warn","error","success"]),N5,xt("url","")],Pee=fo(Dee),Mee=r=>[$l,r],Ree=[$l,m1,kp,Q5("button"),kg,L5,l0("buttonType",["primary","secondary","toolbar"]),TS],pN=fo(Ree),kw=[$l,Q3],x1=kw.concat([B5]),$ee=kw.concat([$5,kp]),Nee=fo($ee),Iee=Iu,Bee=x1.concat([z3("auto")]),Lee=fo(Bee),Fee=ch([J2,m1,N5]),Qee=x1.concat([mc("storageKey","default")]),Zee=fo(Qee),Hee=bl,zee=fo(x1),Vee=bl,Wee=kw.concat([mc("tag","textarea"),xa("scriptId"),xa("scriptUrl"),qm("settings",void 0)]),Uee=kw.concat([mc("tag","textarea"),Wc("init")]),Yee=of(r=>Ui("customeditor.old",_i(Uee),r).orThunk(()=>Ui("customeditor.new",_i(Wee),r))),Xee=bl,qee=fo(x1),Gee=uh(),Kee=r=>[$l,a0("columns"),r],Jee=[$l,xa("html"),Bu("presets","presentation",["presentation","document"])],ete=fo(Jee),tte=x1.concat([ja("border",!1),ja("sandboxed",!0),ja("streamContent",!1),ja("transparent",!0)]),nte=fo(tte),ote=bl,cZ=fo(kw.concat([Jl("height")])),uZ=fo([xa("url"),fh("zoom"),fh("cachedWidth"),fh("cachedHeight")]),xw=x1.concat([Jl("inputMode"),Jl("placeholder"),ja("maximized",!1),kp]),ste=fo(xw),bN=bl,$4=r=>[$l,$5,r,Bu("align","start",["start","center","end"])],rte=[m1,J2],ite=[m1,Hl("items",sf("items",()=>fZ))],fZ=Jn([fo(rte),fo(ite)]),ate=x1.concat([Hl("items",fZ),kp]),lte=fo(ate),Tw=bl,dZ=x1.concat([Yp("items",[m1,J2]),au("size",1),kp]),cte=fo(dZ),ute=bl,fte=x1.concat([ja("constrain",!0),kp]),dte=fo(fte),hZ=fo([xa("width"),xa("height")]),hte=kw.concat([$5,au("min",0),au("max",0)]),mte=fo(hte),gte=Pd,vN=[$l,Hl("header",bl),Hl("cells",Dd(bl))],IT=fo(vN),ON=x1.concat([Jl("placeholder"),ja("maximized",!1),kp]),N4=fo(ON),Ew=bl,BT=[Ua("type",["directory","leaf"]),Z3,xa("id"),Ya("menu",OT)],yN=fo(BT),mZ=BT.concat([Hl("children",sf("children",()=>Md("type",{directory:wN,leaf:yN})))]),wN=fo(mZ),pte=Md("type",{directory:wN,leaf:yN}),bte=[$l,Hl("items",pte),jm("onLeafAction"),jm("onToggleExpand"),lu("defaultExpandedIds",[],bl),Jl("defaultSelectedId")],vte=fo(bte),gZ=x1.concat([Bu("filetype","file",["image","media","file"]),kp]),pZ=fo(gZ),_N=fo([J2,F5]),SN=r=>Wa("items","items",wr(),Dd(of(f=>Ui(`Checking item of ${r}`,CN,f).fold(g=>wn.error(Rd(g)),g=>wn.value(g))))),CN=pl(()=>Md("type",{alertbanner:Pee,bar:fo(Mee(SN("bar"))),button:pN,checkbox:Nee,colorinput:Zee,colorpicker:zee,dropzone:qee,grid:fo(Kee(SN("grid"))),iframe:nte,input:ste,listbox:lte,selectbox:cte,sizeinput:dte,slider:mte,textarea:N4,urlinput:pZ,customeditor:Yee,htmlpanel:ete,imagepreview:cZ,collection:Lee,label:fo($4(SN("label"))),table:IT,tree:vte,panel:kN})),Ote=[$l,xt("classes",[]),Hl("items",CN)],kN=fo(Ote),yte=[Q5("tab"),Z3,Hl("items",CN)],wte=[$l,Yp("tabs",yte)],_te=fo(wte),xN=aZ,TN=Aee,Ste=fo([xa("title"),Kr("body",Md("type",{panel:kN,tabpanel:_te})),mc("size","normal"),lu("buttons",[],TN),xt("initialData",{}),qa("onAction",L),qa("onChange",L),qa("onSubmit",L),qa("onClose",L),qa("onCancel",L),qa("onTabChange",L)]),bZ=r=>Ui("dialog",Ste,r),Cte=fo([Ua("type",["cancel","custom"]),...xN]),kte=fo([xa("title"),xa("url"),fh("height"),fh("width"),J1("buttons",Cte),qa("onAction",L),qa("onCancel",L),qa("onClose",L),qa("onMessage",L)]),vZ=r=>Ui("dialog",kte,r),EN=r=>h(r)?[r].concat(Ne(_a(r),EN)):y(r)?Ne(r,EN):[],xte=r=>d(r.type)&&d(r.name),Aw={checkbox:Iee,colorinput:Hee,colorpicker:Vee,dropzone:Gee,input:bN,iframe:ote,imagepreview:uZ,selectbox:ute,sizeinput:hZ,slider:gte,listbox:Tw,size:hZ,textarea:Ew,urlinput:_N,customeditor:Xee,collection:Fee,togglemenuitem:Tee},OZ=r=>V.from(Aw[r.type]),Tte=r=>Kn(EN(r),xte),I4=r=>{const f=Tte(r),g=Ne(f,v=>OZ(v).fold(()=>[],_=>[Kr(v.name,_)]));return fo(g)},Dw=r=>{var f;const g=ba(bZ(r)),v=I4(r),_=(f=r.initialData)!==null&&f!==void 0?f:{};return{internalDialog:g,dataValidator:v,initialData:_}},Nb={open:(r,f)=>{const g=Dw(f);return r(g.internalDialog,g.initialData,g.dataValidator)},openUrl:(r,f)=>{const g=ba(vZ(f));return r(g)},redial:r=>Dw(r)};var B4=Object.freeze({__proto__:null,events:(r,f)=>{const g=(v,_)=>{r.updateState.each(T=>{const P=T(v,_);f.set(P)}),r.renderComponents.each(T=>{const P=T(_,f.get());(r.reuseDom?XP:ZI)(v,P)})};return li([on(im(),(v,_)=>{const T=_;if(!T.universal){const P=r.channel;st(T.channels,P)&&g(v,T.data)}}),Ci((v,_)=>{r.initialData.each(T=>{g(v,T)})})])}}),L4=Object.freeze({__proto__:null,getState:(r,f,g)=>g}),yZ=[nn("channel"),Er("renderComponents"),Er("updateState"),Er("initialData"),ja("reuseDom",!0)],Dte=Object.freeze({__proto__:null,init:()=>{const r=Ho(V.none()),f=()=>r.set(V.none());return{readState:()=>r.get().getOr("none"),get:r.get,set:r.set,clear:f}}});const Am=nc({fields:yZ,name:"reflecting",active:B4,apis:L4,state:Dte}),bv=r=>{const f=[],g={};return dr(r,(v,_)=>{v.fold(()=>{f.push(_)},T=>{g[_]=T})}),f.length>0?wn.error(f):wn.value(g)},kae=(r,f,g)=>{const v=oi(hw.sketch(_=>({dom:{tag:"div",classes:["tox-form"].concat(r.classes)},components:je(r.items,T=>BR(_,T,f,g))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[v.asSpec()]}],behaviours:Tn([No.config({mode:"acyclic",useTabstopAt:Oe(nT)}),Ep.memento(v),s7(v,{postprocess:_=>bv(_).fold(T=>(console.error(T),{}),we)}),xs("dialog-body-panel",[on(Gi(),(_,T)=>{_.getSystem().broadcastOn([ZS],{newFocus:V.some(T.event.target)})})])])}},Pte=(r,f)=>({uid:r.uid,dom:r.dom,components:r.components,events:b3(r.action),behaviours:sc(r.tabButtonBehaviours,[ns.config({}),No.config({mode:"execution",useSpace:!0,useEnter:!0}),Gn.config({store:{mode:"memory",initialValue:r.value}})]),domModification:r.domModification}),wZ=Kc({name:"TabButton",configFields:[xt("uid",void 0),nn("value"),Wa("dom","dom",Ae(()=>({attributes:{role:"tab",id:io("aria"),"aria-selected":"false"}})),Vc()),Er("action"),xt("domModification",{}),Wl("tabButtonBehaviours",[ns,No,Gn]),nn("view")],factory:Pte}),iC=G([nn("tabs"),nn("dom"),xt("clickToDismiss",!1),Wl("tabbarBehaviours",[Nr,No]),hf(["tabClass","selectedClass"])]),F4=hd({factory:wZ,name:"tabs",unit:"tab",overrides:r=>{const f=(v,_)=>{Nr.dehighlight(v,_),Ao(v,Nv(),{tabbar:v,button:_})},g=(v,_)=>{Nr.highlight(v,_),Ao(v,tp(),{tabbar:v,button:_})};return{action:v=>{const _=v.getSystem().getByUid(r.uid).getOrDie(),T=Nr.isHighlighted(_,v);(()=>T&&r.clickToDismiss?f:T?L:g)()(_,v)},domModification:{classes:[r.markers.tabClass]}}}}),_Z=G([F4]),Mte=(r,f,g,v)=>({uid:r.uid,dom:r.dom,components:f,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:sc(r.tabbarBehaviours,[Nr.config({highlightClass:r.markers.selectedClass,itemClass:r.markers.tabClass,onHighlight:(_,T)=>{qn(T.element,"aria-selected","true")},onDehighlight:(_,T)=>{qn(T.element,"aria-selected","false")}}),No.config({mode:"flow",getInitial:_=>Nr.getHighlighted(_).map(T=>T.element),selector:"."+r.markers.tabClass,executeOnMove:!0})])}),SZ=wu({name:"Tabbar",configFields:iC(),partFields:_Z(),factory:Mte}),Rte=(r,f)=>({uid:r.uid,dom:r.dom,behaviours:sc(r.tabviewBehaviours,[gs.config({})]),domModification:{attributes:{role:"tabpanel"}}}),$te=Kc({name:"Tabview",configFields:[Wl("tabviewBehaviours",[gs])],factory:Rte}),aC=G([xt("selectFirst",!0),qs("onChangeTab"),qs("onDismissTab"),xt("tabs",[]),Wl("tabSectionBehaviours",[])]),xae=Gc({factory:SZ,schema:[nn("dom"),sd("markers",[nn("tabClass"),nn("selectedClass")])],name:"tabbar",defaults:r=>({tabs:r.tabs})}),Nte=Gc({factory:$te,name:"tabview"}),Ite=G([xae,Nte]),Tae=(r,f,g,v)=>{const _=P=>{const I=Gn.getValue(P);Ri(P,r,"tabview").each(W=>{kt(r.tabs,ie=>ie.value===I).each(ie=>{const de=ie.view();me(P.element,"id").each(ge=>{qn(W.element,"aria-labelledby",ge)}),gs.set(W,de),r.onChangeTab(W,P,de)})})},T=(P,I)=>{Ri(P,r,"tabbar").each(W=>{I(W).each(bh)})};return{uid:r.uid,dom:r.dom,components:f,behaviours:Om(r.tabSectionBehaviours),events:li(pt([r.selectFirst?[Ci((P,I)=>{T(P,Nr.getFirst)})]:[],[on(tp(),(P,I)=>{const W=I.event.button;_(W)}),on(Nv(),(P,I)=>{const W=I.event.button;r.onDismissTab(P,W)})]])),apis:{getViewItems:P=>Ri(P,r,"tabview").map(I=>gs.contents(I)).getOr([]),showTab:(P,I)=>{T(P,J=>{const ie=Nr.getCandidates(J);return kt(ie,ge=>Gn.getValue(ge)===I).filter(ge=>!Nr.isHighlighted(J,ge))})}}}},lC=wu({name:"TabSection",configFields:aC(),partFields:Ite(),factory:Tae,apis:{getViewItems:(r,f)=>r.getViewItems(f),showTab:(r,f,g)=>{r.showTab(f,g)}}}),Bte=(r,f,g)=>je(r,(v,_)=>{gs.set(g,r[_].view());const T=f.dom.getBoundingClientRect();return gs.set(g,[]),T.height}),LT=r=>Ss(ps(r,(f,g)=>f>g?-1:f<g?1:0)),Lte=(r,f,g)=>{const v=Eu(r).dom,_=fg(r,".tox-dialog-wrap").getOr(r),T=Gr(_,"position")==="fixed";let P;T?P=Math.max(v.clientHeight,window.innerHeight):P=Math.max(v.offsetHeight,v.scrollHeight);const I=Ii(f),J=f.dom.offsetLeft>=g.dom.offsetLeft+ta(g)?Math.max(Ii(g),I):I,ie=parseInt(Gr(r,"margin-top"),10)||0,de=parseInt(Gr(r,"margin-bottom"),10)||0,_e=Ii(r)+ie+de-J;return P-_e},Fte=(r,f)=>{Ss(r).each(g=>lC.showTab(f,g.value))},AN=(r,f)=>{ro(r,"height",f+"px"),ro(r,"flex-basis",f+"px")},Q4=(r,f,g)=>{fg(r,'[role="dialog"]').each(v=>{sa(v,'[role="tablist"]').each(_=>{g.get().map(T=>(ro(f,"height","0"),ro(f,"flex-basis","0"),Math.min(T,Lte(v,f,_)))).each(T=>{AN(f,T)})})})},CZ=r=>sa(r,'[role="tabpanel"]'),n=r=>{const f=Xi();return{extraEvents:[Ci(_=>{const T=_.element;CZ(T).each(P=>{ro(P,"visibility","hidden"),_.getSystem().getByDom(P).toOptional().each(I=>{const W=Bte(r,P,I);LT(W).fold(f.clear,f.set)}),Q4(T,P,f),ks(P,"visibility"),Fte(r,_),requestAnimationFrame(()=>{Q4(T,P,f)})})}),on(gh(),_=>{const T=_.element;CZ(T).each(P=>{Q4(T,P,f)})}),on(FM,(_,T)=>{const P=_.element;CZ(P).each(I=>{const W=Qf($t(I));ro(I,"visibility","hidden");const J=ea(I,"height").map(ge=>parseInt(ge,10));ks(I,"height"),ks(I,"flex-basis");const ie=I.dom.getBoundingClientRect().height;J.forall(ge=>ie>ge)?(f.set(ie),Q4(P,I,f)):J.each(ge=>{AN(I,ge)}),ks(I,"visibility"),W.each(gf)})})],selectFirst:!1}},i="send-data-to-section",c="send-data-to-view",m=(r,f,g)=>{const v=Ho({}),_=J=>{const ie=Gn.getValue(J),de=bv(ie).getOr({}),ge=v.get(),_e=ni(ge,de);v.set(_e)},T=J=>{const ie=v.get();Gn.setValue(J,ie)},P=Ho(null),I=je(r.tabs,J=>({value:J.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Li(g.shared.providers.translate(J.title))],view:()=>[hw.sketch(ie=>({dom:{tag:"div",classes:["tox-form"]},components:je(J.items,de=>BR(ie,de,f,g)),formBehaviours:Tn([No.config({mode:"acyclic",useTabstopAt:Oe(nT)}),xs("TabView.form.events",[Ci(T),Ld(_)]),Pc.config({channels:Uo([{key:i,value:{onReceive:_}},{key:c,value:{onReceive:T}}])})])}))]})),W=n(I);return lC.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(J,ie,de)=>{const ge=Gn.getValue(ie);Ao(J,_L,{name:ge,oldName:P.get()}),P.set(ge)},tabs:I,components:[lC.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[SZ.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Tn([Ka.config({})])}),lC.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:W.selectFirst,tabSectionBehaviours:Tn([xs("tabpanel",W.extraEvents),No.config({mode:"acyclic"}),cr.config({find:J=>Ss(lC.getViewItems(J))}),cv(V.none(),J=>(J.getSystem().broadcastOn([i],{}),v.get()),(J,ie)=>{v.set(ie),J.getSystem().broadcastOn([c],{})})])})},p=(r,f,g,v,_)=>{const T=W=>{const J=W.body;switch(J.type){case"tabpanel":return[m(J,W.initialData,v)];default:return[kae(J,W.initialData,v)]}},P=(W,J)=>V.some({isTabPanel:()=>J.body.type==="tabpanel"}),I={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...g.map(W=>({id:W})).getOr({}),..._?I:{}}},components:[],behaviours:Tn([Ep.childAt(0),Am.config({channel:`${kA}-${f}`,updateState:P,renderComponents:T,initialData:r})])}},w=(r,f,g,v,_)=>p(r,f,V.some(g),v,_),x=(r,f,g)=>{const v=p(r,f,V.none(),g,!1);return Nl.parts.body(v)},M=r=>{const f={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[dR(V.none(),{dom:{tag:"iframe",attributes:{src:r.url}},behaviours:Tn([Ka.config({}),ns.config({})])})]}],behaviours:Tn([No.config({mode:"acyclic",useTabstopAt:Oe(nT)})])};return Nl.parts.body(f)};function B(r){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},B(r)}function q(r,f){return q=Object.setPrototypeOf||function(v,_){return v.__proto__=_,v},q(r,f)}function ae(){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 fe(r,f,g){return ae()?fe=Reflect.construct:fe=function(_,T,P){var I=[null];I.push.apply(I,T);var W=Function.bind.apply(_,I),J=new W;return P&&q(J,P.prototype),J},fe.apply(null,arguments)}function be(r){return Le(r)||Ye(r)||Me(r)||gt()}function Le(r){if(Array.isArray(r))return Ve(r)}function Ye(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Me(r,f){if(!!r){if(typeof r=="string")return Ve(r,f);var g=Object.prototype.toString.call(r).slice(8,-1);if(g==="Object"&&r.constructor&&(g=r.constructor.name),g==="Map"||g==="Set")return Array.from(r);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Ve(r,f)}}function Ve(r,f){(f==null||f>r.length)&&(f=r.length);for(var g=0,v=new Array(f);g<f;g++)v[g]=r[g];return v}function gt(){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 Ot=Object.hasOwnProperty,wt=Object.setPrototypeOf,Pt=Object.isFrozen,hn=Object.getPrototypeOf,Hn=Object.getOwnPropertyDescriptor,$n=Object.freeze,Lt=Object.seal,Zt=Object.create,yn=typeof Reflect<"u"&&Reflect,yo=yn.apply,Do=yn.construct;yo||(yo=function(f,g,v){return f.apply(g,v)}),$n||($n=function(f){return f}),Lt||(Lt=function(f){return f}),Do||(Do=function(f,g){return fe(f,be(g))});var Cs=Bs(Array.prototype.forEach),Ws=Bs(Array.prototype.pop),Ir=Bs(Array.prototype.push),pi=Bs(String.prototype.toLowerCase),fl=Bs(String.prototype.match),Il=Bs(String.prototype.replace),Oc=Bs(String.prototype.indexOf),Pn=Bs(String.prototype.trim),eo=Bs(RegExp.prototype.test),Cr=Co(TypeError);function Bs(r){return function(f){for(var g=arguments.length,v=new Array(g>1?g-1:0),_=1;_<g;_++)v[_-1]=arguments[_];return yo(r,f,v)}}function Co(r){return function(){for(var f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return Do(r,g)}}function Mn(r,f){wt&&wt(r,null);for(var g=f.length;g--;){var v=f[g];if(typeof v=="string"){var _=pi(v);_!==v&&(Pt(f)||(f[g]=_),v=_)}r[v]=!0}return r}function En(r){var f=Zt(null),g;for(g in r)yo(Ot,r,[g])&&(f[g]=r[g]);return f}function jo(r,f){for(;r!==null;){var g=Hn(r,f);if(g){if(g.get)return Bs(g.get);if(typeof g.value=="function")return Bs(g.value)}r=hn(r)}function v(_){return console.warn("fallback value for",_),null}return v}var Ks=$n(["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"]),Jr=$n(["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"]),ho=$n(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Us=$n(["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"]),ci=$n(["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"]),Ja=$n(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ei=$n(["#text"]),$c=$n(["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"]),Qh=$n(["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"]),qd=$n(["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"]),Dm=$n(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qO=Lt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Pw=Lt(/<%[\w\W]*|[\w\W]*%>/gm),GO=Lt(/^data-[\-\w.\u00B7-\uFFFF]/),KO=Lt(/^aria-[\-\w]+$/),Z4=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H4=Lt(/^(?:\w+script|data):/i),z4=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FT=Lt(/^html$/i),QT=function(){return typeof window>"u"?null:window},ZT=function(f,g){if(B(f)!=="object"||typeof f.createPolicy!="function")return null;var v=null,_="data-tt-policy-suffix";g.currentScript&&g.currentScript.hasAttribute(_)&&(v=g.currentScript.getAttribute(_));var T="dompurify"+(v?"#"+v:"");try{return f.createPolicy(T,{createHTML:function(I){return I}})}catch{return console.warn("TrustedTypes policy "+T+" could not be created."),null}};function cC(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QT(),f=function(qt){return cC(qt)};if(f.version="2.3.8",f.removed=[],!r||!r.document||r.document.nodeType!==9)return f.isSupported=!1,f;var g=r.document,v=r.document,_=r.DocumentFragment,T=r.HTMLTemplateElement,P=r.Node,I=r.Element,W=r.NodeFilter,J=r.NamedNodeMap,ie=J===void 0?r.NamedNodeMap||r.MozNamedAttrMap:J,de=r.HTMLFormElement,ge=r.DOMParser,_e=r.trustedTypes,Ie=I.prototype,it=jo(Ie,"cloneNode"),Qt=jo(Ie,"nextSibling"),dt=jo(Ie,"childNodes"),ft=jo(Ie,"parentNode");if(typeof T=="function"){var Yt=v.createElement("template");Yt.content&&Yt.content.ownerDocument&&(v=Yt.content.ownerDocument)}var Dt=ZT(_e,g),kn=Dt?Dt.createHTML(""):"",pn=v,Nn=pn.implementation,jn=pn.createNodeIterator,Ys=pn.createDocumentFragment,ko=pn.getElementsByTagName,_s=g.importNode,hs={};try{hs=En(v).documentMode?v.documentMode:{}}catch{}var vr={};f.isSupported=typeof ft=="function"&&Nn&&typeof Nn.createHTMLDocument<"u"&&hs!==9;var Qo=qO,fr=Pw,Qn=GO,_o=KO,us=H4,Js=z4,Wo=Z4,Os=null,$i=Mn({},[].concat(be(Ks),be(Jr),be(ho),be(ci),be(Ei))),zr=null,_f=Mn({},[].concat(be($c),be(Qh),be(qd),be(Dm))),ya=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}})),Kd=null,Pp=null,JO=!0,ey=!0,$w=!1,ty=!1,yv=!1,PN=!1,MN=!1,dC=!1,EZ=!1,AZ=!1,Pae=!0,Hte=!0,RN=!1,U4={},Y4=null,Mae=Mn({},["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"]),Rae=null,$ae=Mn({},["audio","video","img","source","image","track"]),zte=null,Nae=Mn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vte="http://www.w3.org/1998/Math/MathML",Wte="http://www.w3.org/2000/svg",hC="http://www.w3.org/1999/xhtml",DZ=hC,Ute=!1,X4,Xye=["application/xhtml+xml","text/html"],jye="text/html",jT,j4=null,qye=v.createElement("form"),Iae=function(qt){return qt instanceof RegExp||qt instanceof Function},Yte=function(qt){j4&&j4===qt||((!qt||B(qt)!=="object")&&(qt={}),qt=En(qt),Os="ALLOWED_TAGS"in qt?Mn({},qt.ALLOWED_TAGS):$i,zr="ALLOWED_ATTR"in qt?Mn({},qt.ALLOWED_ATTR):_f,zte="ADD_URI_SAFE_ATTR"in qt?Mn(En(Nae),qt.ADD_URI_SAFE_ATTR):Nae,Rae="ADD_DATA_URI_TAGS"in qt?Mn(En($ae),qt.ADD_DATA_URI_TAGS):$ae,Y4="FORBID_CONTENTS"in qt?Mn({},qt.FORBID_CONTENTS):Mae,Kd="FORBID_TAGS"in qt?Mn({},qt.FORBID_TAGS):{},Pp="FORBID_ATTR"in qt?Mn({},qt.FORBID_ATTR):{},U4="USE_PROFILES"in qt?qt.USE_PROFILES:!1,JO=qt.ALLOW_ARIA_ATTR!==!1,ey=qt.ALLOW_DATA_ATTR!==!1,$w=qt.ALLOW_UNKNOWN_PROTOCOLS||!1,ty=qt.SAFE_FOR_TEMPLATES||!1,yv=qt.WHOLE_DOCUMENT||!1,dC=qt.RETURN_DOM||!1,EZ=qt.RETURN_DOM_FRAGMENT||!1,AZ=qt.RETURN_TRUSTED_TYPE||!1,MN=qt.FORCE_BODY||!1,Pae=qt.SANITIZE_DOM!==!1,Hte=qt.KEEP_CONTENT!==!1,RN=qt.IN_PLACE||!1,Wo=qt.ALLOWED_URI_REGEXP||Wo,DZ=qt.NAMESPACE||hC,qt.CUSTOM_ELEMENT_HANDLING&&Iae(qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ya.tagNameCheck=qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&Iae(qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ya.attributeNameCheck=qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&typeof qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ya.allowCustomizedBuiltInElements=qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X4=Xye.indexOf(qt.PARSER_MEDIA_TYPE)===-1?X4=jye:X4=qt.PARSER_MEDIA_TYPE,jT=X4==="application/xhtml+xml"?function(To){return To}:pi,ty&&(ey=!1),EZ&&(dC=!0),U4&&(Os=Mn({},be(Ei)),zr=[],U4.html===!0&&(Mn(Os,Ks),Mn(zr,$c)),U4.svg===!0&&(Mn(Os,Jr),Mn(zr,Qh),Mn(zr,Dm)),U4.svgFilters===!0&&(Mn(Os,ho),Mn(zr,Qh),Mn(zr,Dm)),U4.mathMl===!0&&(Mn(Os,ci),Mn(zr,qd),Mn(zr,Dm))),qt.ADD_TAGS&&(Os===$i&&(Os=En(Os)),Mn(Os,qt.ADD_TAGS)),qt.ADD_ATTR&&(zr===_f&&(zr=En(zr)),Mn(zr,qt.ADD_ATTR)),qt.ADD_URI_SAFE_ATTR&&Mn(zte,qt.ADD_URI_SAFE_ATTR),qt.FORBID_CONTENTS&&(Y4===Mae&&(Y4=En(Y4)),Mn(Y4,qt.FORBID_CONTENTS)),Hte&&(Os["#text"]=!0),yv&&Mn(Os,["html","head","body"]),Os.table&&(Mn(Os,["tbody"]),delete Kd.tbody),$n&&$n(qt),j4=qt)},Bae=Mn({},["mi","mo","mn","ms","mtext"]),Lae=Mn({},["foreignobject","desc","title","annotation-xml"]),Gye=Mn({},["title","style","font","a","script"]),PZ=Mn({},Jr);Mn(PZ,ho),Mn(PZ,Us);var Xte=Mn({},ci);Mn(Xte,Ja);var Kye=function(qt){var To=ft(qt);(!To||!To.tagName)&&(To={namespaceURI:hC,tagName:"template"});var Ts=pi(qt.tagName),Ul=pi(To.tagName);return qt.namespaceURI===Wte?To.namespaceURI===hC?Ts==="svg":To.namespaceURI===Vte?Ts==="svg"&&(Ul==="annotation-xml"||Bae[Ul]):Boolean(PZ[Ts]):qt.namespaceURI===Vte?To.namespaceURI===hC?Ts==="math":To.namespaceURI===Wte?Ts==="math"&&Lae[Ul]:Boolean(Xte[Ts]):qt.namespaceURI===hC?To.namespaceURI===Wte&&!Lae[Ul]||To.namespaceURI===Vte&&!Bae[Ul]?!1:!Xte[Ts]&&(Gye[Ts]||!PZ[Ts]):!1},Nw=function(qt){Ir(f.removed,{element:qt});try{qt.parentNode.removeChild(qt)}catch{try{qt.outerHTML=kn}catch{qt.remove()}}},MZ=function(qt,To){try{Ir(f.removed,{attribute:To.getAttributeNode(qt),from:To})}catch{Ir(f.removed,{attribute:null,from:To})}if(To.removeAttribute(qt),qt==="is"&&!zr[qt])if(dC||EZ)try{Nw(To)}catch{}else try{To.setAttribute(qt,"")}catch{}},Fae=function(qt){var To,Ts;if(MN)qt="<remove></remove>"+qt;else{var Ul=fl(qt,/^[\r\n\t ]+/);Ts=Ul&&Ul[0]}X4==="application/xhtml+xml"&&(qt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+qt+"</body></html>");var Mp=Dt?Dt.createHTML(qt):qt;if(DZ===hC)try{To=new ge().parseFromString(Mp,X4)}catch{}if(!To||!To.documentElement){To=Nn.createDocument(DZ,"template",null);try{To.documentElement.innerHTML=Ute?"":Mp}catch{}}var Mm=To.body||To.documentElement;return qt&&Ts&&Mm.insertBefore(v.createTextNode(Ts),Mm.childNodes[0]||null),DZ===hC?ko.call(To,yv?"html":"body")[0]:yv?To.documentElement:Mm},Qae=function(qt){return jn.call(qt.ownerDocument||qt,qt,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT,null,!1)},Jye=function(qt){return qt instanceof de&&(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")},$N=function(qt){return B(P)==="object"?qt instanceof P:qt&&B(qt)==="object"&&typeof qt.nodeType=="number"&&typeof qt.nodeName=="string"},Iw=function(qt,To,Ts){!vr[qt]||Cs(vr[qt],function(Ul){Ul.call(f,To,Ts,j4)})},Zae=function(qt){var To;if(Iw("beforeSanitizeElements",qt,null),Jye(qt)||eo(/[\u0080-\uFFFF]/,qt.nodeName))return Nw(qt),!0;var Ts=jT(qt.nodeName);if(Iw("uponSanitizeElement",qt,{tagName:Ts,allowedTags:Os}),qt.hasChildNodes()&&!$N(qt.firstElementChild)&&(!$N(qt.content)||!$N(qt.content.firstElementChild))&&eo(/<[/\w]/g,qt.innerHTML)&&eo(/<[/\w]/g,qt.textContent)||Ts==="select"&&eo(/<template/i,qt.innerHTML))return Nw(qt),!0;if(!Os[Ts]||Kd[Ts]){if(!Kd[Ts]&&zae(Ts)&&(ya.tagNameCheck instanceof RegExp&&eo(ya.tagNameCheck,Ts)||ya.tagNameCheck instanceof Function&&ya.tagNameCheck(Ts)))return!1;if(Hte&&!Y4[Ts]){var Ul=ft(qt)||qt.parentNode,Mp=dt(qt)||qt.childNodes;if(Mp&&Ul)for(var Mm=Mp.length,Zh=Mm-1;Zh>=0;--Zh)Ul.insertBefore(it(Mp[Zh],!0),Qt(qt))}return Nw(qt),!0}return qt instanceof I&&!Kye(qt)||(Ts==="noscript"||Ts==="noembed")&&eo(/<\/no(script|embed)/i,qt.innerHTML)?(Nw(qt),!0):(ty&&qt.nodeType===3&&(To=qt.textContent,To=Il(To,Qo," "),To=Il(To,fr," "),qt.textContent!==To&&(Ir(f.removed,{element:qt.cloneNode()}),qt.textContent=To)),Iw("afterSanitizeElements",qt,null),!1)},Hae=function(qt,To,Ts){if(Pae&&(To==="id"||To==="name")&&(Ts in v||Ts in qye))return!1;if(!(ey&&!Pp[To]&&eo(Qn,To))){if(!(JO&&eo(_o,To))){if(!zr[To]||Pp[To]){if(!(zae(qt)&&(ya.tagNameCheck instanceof RegExp&&eo(ya.tagNameCheck,qt)||ya.tagNameCheck instanceof Function&&ya.tagNameCheck(qt))&&(ya.attributeNameCheck instanceof RegExp&&eo(ya.attributeNameCheck,To)||ya.attributeNameCheck instanceof Function&&ya.attributeNameCheck(To))||To==="is"&&ya.allowCustomizedBuiltInElements&&(ya.tagNameCheck instanceof RegExp&&eo(ya.tagNameCheck,Ts)||ya.tagNameCheck instanceof Function&&ya.tagNameCheck(Ts))))return!1}else if(!zte[To]){if(!eo(Wo,Il(Ts,Js,""))){if(!((To==="src"||To==="xlink:href"||To==="href")&&qt!=="script"&&Oc(Ts,"data:")===0&&Rae[qt])){if(!($w&&!eo(us,Il(Ts,Js,"")))){if(Ts)return!1}}}}}}return!0},zae=function(qt){return qt.indexOf("-")>0},Vae=function(qt){var To,Ts,Ul,Mp;Iw("beforeSanitizeAttributes",qt,null);var Mm=qt.attributes;if(!!Mm){var Zh={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:zr};for(Mp=Mm.length;Mp--;){To=Mm[Mp];var RZ=To,Hh=RZ.name,Wae=RZ.namespaceURI;Ts=Hh==="value"?To.value:Pn(To.value),Ul=jT(Hh);var t2e=Ts;if(Zh.attrName=Ul,Zh.attrValue=Ts,Zh.keepAttr=!0,Zh.forceKeepAttr=void 0,Iw("uponSanitizeAttribute",qt,Zh),Ts=Zh.attrValue,!Zh.forceKeepAttr){if(!Zh.keepAttr){MZ(Hh,qt);continue}if(eo(/\/>/i,Ts)){MZ(Hh,qt);continue}ty&&(Ts=Il(Ts,Qo," "),Ts=Il(Ts,fr," "));var n2e=jT(qt.nodeName);if(!Hae(n2e,Ul,Ts)){MZ(Hh,qt);continue}if(Ts!==t2e)try{Wae?qt.setAttributeNS(Wae,Hh,Ts):qt.setAttribute(Hh,Ts)}catch{MZ(Hh,qt)}}}Iw("afterSanitizeAttributes",qt,null)}},e2e=function ir(qt){var To,Ts=Qae(qt);for(Iw("beforeSanitizeShadowDOM",qt,null);To=Ts.nextNode();)Iw("uponSanitizeShadowNode",To,null),!Zae(To)&&(To.content instanceof _&&ir(To.content),Vae(To));Iw("afterSanitizeShadowDOM",qt,null)};return f.sanitize=function(ir,qt){var To,Ts,Ul,Mp,Mm;if(Ute=!ir,Ute&&(ir="<!-->"),typeof ir!="string"&&!$N(ir)){if(typeof ir.toString!="function")throw Cr("toString is not a function");if(ir=ir.toString(),typeof ir!="string")throw Cr("dirty is not a string, aborting")}if(!f.isSupported){if(B(r.toStaticHTML)==="object"||typeof r.toStaticHTML=="function"){if(typeof ir=="string")return r.toStaticHTML(ir);if($N(ir))return r.toStaticHTML(ir.outerHTML)}return ir}if(PN||Yte(qt),f.removed=[],typeof ir=="string"&&(RN=!1),RN){if(ir.nodeName){var Zh=jT(ir.nodeName);if(!Os[Zh]||Kd[Zh])throw Cr("root node is forbidden and cannot be sanitized in-place")}}else if(ir instanceof P)To=Fae("<!---->"),Ts=To.ownerDocument.importNode(ir,!0),Ts.nodeType===1&&Ts.nodeName==="BODY"||Ts.nodeName==="HTML"?To=Ts:To.appendChild(Ts);else{if(!dC&&!ty&&!yv&&ir.indexOf("<")===-1)return Dt&&AZ?Dt.createHTML(ir):ir;if(To=Fae(ir),!To)return dC?null:AZ?kn:""}To&&MN&&Nw(To.firstChild);for(var RZ=Qae(RN?ir:To);Ul=RZ.nextNode();)Ul.nodeType===3&&Ul===Mp||Zae(Ul)||(Ul.content instanceof _&&e2e(Ul.content),Vae(Ul),Mp=Ul);if(Mp=null,RN)return ir;if(dC){if(EZ)for(Mm=Ys.call(To.ownerDocument);To.firstChild;)Mm.appendChild(To.firstChild);else Mm=To;return zr.shadowroot&&(Mm=_s.call(g,Mm,!0)),Mm}var Hh=yv?To.outerHTML:To.innerHTML;return yv&&Os["!doctype"]&&To.ownerDocument&&To.ownerDocument.doctype&&To.ownerDocument.doctype.name&&eo(FT,To.ownerDocument.doctype.name)&&(Hh="<!DOCTYPE "+To.ownerDocument.doctype.name+`>
|
|
`+Hh),ty&&(Hh=Il(Hh,Qo," "),Hh=Il(Hh,fr," ")),Dt&&AZ?Dt.createHTML(Hh):Hh},f.setConfig=function(ir){Yte(ir),PN=!0},f.clearConfig=function(){j4=null,PN=!1},f.isValidAttribute=function(ir,qt,To){j4||Yte({});var Ts=jT(ir),Ul=jT(qt);return Hae(Ts,Ul,To)},f.addHook=function(ir,qt){typeof qt=="function"&&(vr[ir]=vr[ir]||[],Ir(vr[ir],qt))},f.removeHook=function(ir){if(vr[ir])return Ws(vr[ir])},f.removeHooks=function(ir){vr[ir]&&(vr[ir]=[])},f.removeAllHooks=function(){vr={}},f}var T1=cC();const uC=r=>T1().sanitize(r),Mw=OS.deviceType.isTouch(),vv=(r,f)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[r,f]}),HT=(r,f)=>Nl.parts.close(Jc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":f.translate("Close")}},action:r,buttonBehaviours:Tn([Ka.config({})])})),zT=()=>Nl.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),Ib=(r,f)=>Nl.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:UO(`<p>${uC(f.translate(r))}</p>`)}]}]}),Ov=r=>Nl.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:r}),VT=(r,f)=>[v1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:r}),v1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:f})],WT=r=>{const f="tox-dialog",g=f+"-wrap",v=g+"__backdrop",_=f+"__disable-scroll";return Nl.sketch({lazySink:r.lazySink,onEscape:T=>(r.onEscape(T),V.some(!0)),useTabstopAt:T=>!nT(T),firstTabstop:r.firstTabstop,dom:{tag:"div",classes:[f].concat(r.extraClasses),styles:{position:"relative",...r.extraStyles}},components:[r.header,r.body,...r.footer.toArray()],parts:{blocker:{dom:UO(`<div class="${g}"></div>`),components:[{dom:{tag:"div",classes:Mw?[v,v+"--opaque"]:[v]}}]}},dragBlockClass:g,modalBehaviours:Tn([ns.config({}),xs("dialog-events",r.dialogEvents.concat([lg(Gi(),(T,P)=>{Lh.isBlocked(T)?L():No.focusIn(T)}),on(Rv(),(T,P)=>{T.getSystem().broadcastOn([ZS],{newFocus:P.event.newFocus})})])),xs("scroll-lock",[Ci(()=>{Na(Hi(),_)}),Ld(()=>{va(Hi(),_)})]),...r.extraBehaviours]),eventOrder:{[af()]:["dialog-events"],[Lu()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Nd()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...r.eventOrder}})},UT=r=>Jc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":r.translate("Close"),title:r.translate("Close")}},buttonBehaviours:Tn([Ka.config({})]),components:[Sp("close",{tag:"span",classes:["tox-icon"]},r.icons)],action:f=>{rr(f,BO)}}),V4=(r,f,g,v)=>{const _=T=>[Li(v.translate(T.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...g.map(T=>({id:T})).getOr({})}},components:[],behaviours:Tn([Am.config({channel:`${w1}-${f}`,initialData:r,renderComponents:_})])}},W4=()=>({dom:UO('<div class="tox-dialog__draghandle"></div>')}),kZ=(r,f,g,v)=>v1.sketch({dom:UO('<div class="tox-dialog__header"></div>'),components:[V4(r,f,V.some(g),v),W4(),UT(v)],containerBehaviours:Tn([Cw.config({mode:"mouse",blockerClass:"blocker",getTarget:_=>df(_,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),E1=(r,f,g)=>{const v=Nl.parts.title(V4(r,f,V.none(),g)),_=Nl.parts.draghandle(W4()),T=Nl.parts.close(UT(g)),P=[v].concat(r.draggable?[_]:[]).concat([T]);return v1.sketch({dom:UO('<div class="tox-dialog__header"></div>'),components:P})},Rw=(r,f,g)=>E1({title:g.shared.providers.translate(r),draggable:g.dialog.isDraggableModal()},f,g.shared.providers),Mt=(r,f,g,v)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":g.translate(r)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${v.getOr(0)}px`,position:"absolute"}},behaviours:f,components:[{dom:UO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),Rt=(r,f,g)=>({onClose:()=>g.closeWindow(),onBlock:v=>{const _=sa(r().element,".tox-dialog__header").map(T=>Ii(T));Nl.setBusy(r(),(T,P)=>Mt(v.message,P,f,_))},onUnblock:()=>{Nl.setIdle(r())}}),Rn=(r,f,g,v)=>{const _=(T,P)=>V.some(P);return pc(WT({...r,firstTabstop:1,lazySink:v.shared.getSink,extraBehaviours:[Am.config({channel:`${CA}-${r.id}`,updateState:_,initialData:f}),uv({}),...r.extraBehaviours],onEscape:T=>{rr(T,BO)},dialogEvents:g,eventOrder:{[im()]:[Am.name(),Pc.name()],[Lu()]:["scroll-lock",Am.name(),"messages","dialog-events","alloy.base.behaviour"],[Nd()]:["alloy.base.behaviour","dialog-events","messages",Am.name(),"scroll-lock"]}}))},xn=(r,f={})=>{const g=v=>{const _=je(v.items,T=>{const P=ln(f,T.name).getOr(Ho(!1));return{...T,storage:P}});return{...v,items:_}};return je(r,v=>v.type==="menu"?g(v):v)},Io=r=>Yo(r,(f,g)=>g.type==="menu"?Yo(g.items,(_,T)=>(_[T.name]=T.storage,_),f):f,{}),br=(r,f)=>[Ay(Gi(),ej),r(Yx,(g,v,_,T)=>{Qf($t(T.element)).fold(L,Kv),f.onClose(),v.onClose()}),r(BO,(g,v,_,T)=>{v.onCancel(g),rr(T,Yx)}),on(sA,(g,v)=>f.onUnblock()),on(LM,(g,v)=>f.onBlock(v.event))],ha=(r,f)=>{const g=(_,T)=>on(_,(P,I)=>{v(P,(W,J)=>{T(r(),W,I.event,P)})}),v=(_,T)=>{Am.getState(_).get().each(P=>{T(P,_)})};return[...br(g,f),g(Rb,(_,T,P)=>{T.onAction(_,{name:P.name})})]},Nc=(r,f,g)=>{const v=(T,P)=>on(T,(I,W)=>{_(I,(J,ie)=>{P(r(),J,W.event,I)})}),_=(T,P)=>{Am.getState(T).get().each(I=>{P(I.internalDialog,T)})};return[...br(v,f),v(BS,(T,P)=>P.onSubmit(T)),v(Ih,(T,P,I)=>{P.onChange(T,{name:I.name})}),v(Rb,(T,P,I,W)=>{const J=()=>W.getSystem().isConnected()?No.focusIn(W):void 0,ie=_e=>$e(_e,"disabled")||me(_e,"aria-disabled").exists(Ie=>Ie==="true"),de=$t(W.element),ge=Qf(de);P.onAction(T,{name:I.name,value:I.value}),Qf(de).fold(J,_e=>{ie(_e)||ge.exists(Ie=>Za(_e,Ie)&&ie(Ie))?J():g().toOptional().filter(Ie=>!Za(Ie.element,_e)).each(J)})}),v(_L,(T,P,I)=>{P.onTabChange(T,{newTabName:I.name,oldTabName:I.oldName})}),Ld(T=>{const P=r();Gn.setValue(T,P.getData())})]},_u=(r,f)=>QA(r,r.type,f),YT=(r,f,g)=>kt(f,v=>v.name===g).bind(v=>v.memento.getOpt(r)),XT=(r,f)=>{const g=f.map(I=>I.footerButtons).getOr([]),v=Zo(g,I=>I.align==="start"),_=(I,W)=>v1.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${I}`]},components:je(W,J=>J.memento.asSpec())}),T=_("start",v.pass),P=_("end",v.fail);return[T,P]},DN=(r,f,g)=>{const v=(_,T)=>{const P=je(T.buttons,W=>{const J=oi(_u(W,g));return{name:W.name,align:W.align,memento:J}}),I=W=>YT(_,P,W);return V.some({lookupByName:I,footerButtons:P})};return{dom:UO('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Tn([Am.config({channel:`${hR}-${f}`,initialData:r,updateState:v,renderComponents:XT})])}},Qte=(r,f,g)=>DN(r,f,g),Hs=(r,f,g)=>Nl.parts.footer(DN(r,f,g)),Xt=(r,f)=>{if(r.getRoot().getSystem().isConnected()){const v=cr.getCurrent(r.getFormWrapper()).getOr(r.getFormWrapper());return hw.getField(v,f).orThunk(()=>r.getFooter().bind(P=>Am.getState(P).get()).bind(P=>P.lookupByName(f)))}else return V.none()},So=(r,f)=>{const g=r.getRoot();return Am.getState(g).get().map(v=>ba(Ui("data",v.dataValidator,f))).getOr(f)},ws=(r,f,g)=>{const v=Ie=>{const it=r.getRoot();it.getSystem().isConnected()&&Ie(it)},_e={getData:()=>{const Ie=r.getRoot(),it=Ie.getSystem().isConnected()?r.getFormWrapper():Ie,Qt=Gn.getValue(it),dt=Ns(g,ft=>ft.get());return{...Qt,...dt}},setData:Ie=>{v(it=>{const Qt=_e.getData(),dt=ni(Qt,Ie),ft=So(r,dt),Yt=r.getFormWrapper();Gn.setValue(Yt,ft),dr(g,(Dt,kn)=>{vs(dt,kn)&&Dt.set(dt[kn])})})},setEnabled:(Ie,it)=>{Xt(r,Ie).each(it?Jo.enable:Jo.disable)},focus:Ie=>{Xt(r,Ie).each(ns.focus)},block:Ie=>{if(!d(Ie))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");v(it=>{Ao(it,LM,{message:Ie})})},unblock:()=>{v(Ie=>{rr(Ie,sA)})},showTab:Ie=>{v(it=>{const Qt=r.getBody();Am.getState(Qt).get().exists(ft=>ft.isTabPanel())&&cr.getCurrent(Qt).each(ft=>{lC.showTab(ft,Ie)})})},redial:Ie=>{v(it=>{const Qt=r.getId(),dt=f(Ie),ft=xn(dt.internalDialog.buttons,g);it.getSystem().broadcastOn([`${CA}-${Qt}`],dt),it.getSystem().broadcastOn([`${w1}-${Qt}`],dt.internalDialog),it.getSystem().broadcastOn([`${kA}-${Qt}`],dt.internalDialog),it.getSystem().broadcastOn([`${hR}-${Qt}`],{...dt.internalDialog,buttons:ft}),_e.setData(dt.initialData)})},close:()=>{v(Ie=>{rr(Ie,Yx)})},toggleFullscreen:r.toggleFullscreen};return _e},Sl=r=>{switch(r){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},Pm=(r,f,g)=>{const v=io("dialog"),_=r.internalDialog,T=Rw(_.title,v,g),P=x({body:_.body,initialData:_.initialData},v,g),I=xn(_.buttons),W=Io(I),J=fn(I.length!==0,Hs({buttons:I},v,g)),ie=Nc(()=>it,Rt(()=>_e,g.shared.providers,f),g.shared.getSink),de=Sl(_.size),_e=Rn({id:v,header:T,body:P,footer:J,extraClasses:de,extraBehaviours:[],extraStyles:{}},r,ie,g),Ie=(()=>{const Qt=()=>{const ft=Nl.getBody(_e);return cr.getCurrent(ft).getOr(ft)},dt=()=>{const ft="tox-dialog--fullscreen",Yt=lt.fromDom(_e.element.dom);uf(Yt,ft)?(va(Yt,ft),cg(Yt,de)):(Xc(Yt,de),Na(Yt,ft))};return{getId:G(v),getRoot:G(_e),getBody:()=>Nl.getBody(_e),getFooter:()=>Nl.getFooter(_e),getFormWrapper:Qt,toggleFullscreen:dt}})(),it=ws(Ie,f.redial,W);return{dialog:_e,instanceApi:it}},Gd=r=>{switch(r){case"medium":return V.some("tox-dialog--width-md");default:return V.none()}},Vf=(r,f,g,v=!1)=>{const _=io("dialog"),T=io("dialog-label"),P=io("dialog-content"),I=r.internalDialog,W=Gd(I.size),J=(Dt,kn)=>V.some(kn),ie=oi(kZ({title:I.title,draggable:!0},_,T,g.shared.providers)),de=oi(w({body:I.body,initialData:I.initialData},_,P,g,v)),ge=xn(I.buttons),_e=Io(ge),Ie=fn(ge.length!==0,oi(Qte({buttons:ge},_,g))),it=Nc(()=>Yt,{onBlock:Dt=>{Lh.block(dt,(kn,pn)=>{const Nn=ie.getOpt(dt).map(jn=>Ii(jn.element));return Mt(Dt.message,pn,g.shared.providers,Nn)})},onUnblock:()=>{Lh.unblock(dt)},onClose:()=>f.closeWindow()},g.shared.getSink),Qt="tox-dialog-inline",dt=pc({dom:{tag:"div",classes:["tox-dialog",Qt,...W.toArray()],attributes:{role:"dialog",["aria-labelledby"]:T}},eventOrder:{[im()]:[Am.name(),Pc.name()],[af()]:["execute-on-form"],[Lu()]:["reflecting","execute-on-form"]},behaviours:Tn([No.config({mode:"cyclic",onEscape:Dt=>(rr(Dt,Yx),V.some(!0)),useTabstopAt:Dt=>!nT(Dt)&&(gl(Dt)!=="button"||zi(Dt,"disabled")!=="disabled"),firstTabstop:1}),Am.config({channel:`${CA}-${_}`,updateState:J,initialData:r}),ns.config({}),xs("execute-on-form",it.concat([lg(Gi(),(Dt,kn)=>{No.focusIn(Dt)}),on(Rv(),(Dt,kn)=>{Dt.getSystem().broadcastOn([ZS],{newFocus:kn.event.newFocus})})])),Lh.config({getRoot:()=>V.some(dt)}),gs.config({}),uv({})]),components:[ie.asSpec(),de.asSpec(),...Ie.map(Dt=>Dt.asSpec()).toArray()]}),ft=()=>{const Dt="tox-dialog--fullscreen",kn=lt.fromDom(dt.element.dom);GC(kn,[Dt])?(Xc(kn,[Dt]),cg(kn,[Qt])):(Xc(kn,[Qt]),cg(kn,[Dt]))},Yt=ws({getId:G(_),getRoot:G(dt),getFooter:()=>Ie.map(Dt=>Dt.get(dt)),getBody:()=>de.get(dt),getFormWrapper:()=>{const Dt=de.get(dt);return cr.getCurrent(Dt).getOr(Dt)},toggleFullscreen:ft},f.redial,_e);return{dialog:dt,instanceApi:Yt}};var fC=tinymce.util.Tools.resolve("tinymce.util.URI");const vd=r=>{const f=P=>{r.getSystem().isConnected()&&P(r)};return{block:P=>{if(!d(P))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");f(I=>{Ao(I,LM,{message:P})})},unblock:()=>{f(P=>{rr(P,sA)})},close:()=>{f(P=>{rr(P,Yx)})},sendMessage:P=>{f(I=>{I.getSystem().broadcastOn([oT],P)})}}},xZ=["insertContent","setContent","execCommand","close","block","unblock"],TZ=r=>h(r)&&xZ.indexOf(r.mceAction)!==-1,Zte=r=>!TZ(r)&&h(r)&&vs(r,"mceAction"),Eae=(r,f,g)=>{switch(g.mceAction){case"insertContent":r.insertContent(g.content);break;case"setContent":r.setContent(g.content);break;case"execCommand":const v=E(g.ui)?g.ui:!1;r.execCommand(g.cmd,v,g.value);break;case"close":f.close();break;case"block":f.block(g.message);break;case"unblock":f.unblock();break}},Zye=(r,f,g,v)=>{const _=io("dialog"),T=Rw(r.title,_,v),P=M(r),I=r.buttons.bind(ft=>ft.length===0?V.none():V.some(Hs({buttons:ft},_,v))),W=ha(()=>dt,Rt(()=>Qt,v.shared.providers,f)),J={...r.height.fold(()=>({}),ft=>({height:ft+"px","max-height":ft+"px"})),...r.width.fold(()=>({}),ft=>({width:ft+"px","max-width":ft+"px"}))},ie=r.width.isNone()&&r.height.isNone()?["tox-dialog--width-lg"]:[],de=new fC(r.url,{base_uri:new fC(window.location.href)}),ge=`${de.protocol}://${de.host}${de.port?":"+de.port:""}`,_e=mb(),Ie=[xs("messages",[Ci(()=>{const ft=Mc(lt.fromDom(window),"message",Yt=>{if(de.isSameOrigin(new fC(Yt.raw.origin))){const Dt=Yt.raw.data;TZ(Dt)?Eae(g,dt,Dt):Zte(Dt)&&r.onMessage(dt,Dt)}});_e.set(ft)}),Ld(_e.clear)]),Pc.config({channels:{[oT]:{onReceive:(ft,Yt)=>{sa(ft.element,"iframe").each(Dt=>{const kn=Dt.dom.contentWindow;Q(kn)&&kn.postMessage(Yt,ge)})}}}})],Qt=Rn({id:_,header:T,body:P,footer:I,extraClasses:ie,extraBehaviours:Ie,extraStyles:J},r,W,v),dt=vd(Qt);return{dialog:Qt,instanceApi:dt}},Hye=r=>{const f=r.shared;return{open:(v,_)=>{const T=()=>{Nl.hide(J),_()},P=oi(QA({name:"close-alert",text:"OK",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"cancel",r)),I=zT(),W=HT(T,f.providers),J=pc(WT({lazySink:()=>f.getSink(),header:vv(I,W),body:Ib(v,f.providers),footer:V.some(Ov(VT([],[P.asSpec()]))),onEscape:T,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[on(BO,T)],eventOrder:{}}));Nl.show(J);const ie=P.get(J);ns.focus(ie)}}},zye=r=>{const f=r.shared;return{open:(v,_)=>{const T=ge=>{Nl.hide(ie),_(ge)},P=oi(QA({name:"yes",text:"Yes",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"submit",r)),I=QA({name:"no",text:"No",primary:!1,buttonType:V.some("secondary"),align:"end",enabled:!0,icon:V.none()},"cancel",r),W=zT(),J=HT(()=>T(!1),f.providers),ie=pc(WT({lazySink:()=>f.getSink(),header:vv(W,J),body:Ib(v,f.providers),footer:V.some(Ov(VT([],[I,P.asSpec()]))),onEscape:()=>T(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[on(BO,()=>T(!1)),on(BS,()=>T(!0))],eventOrder:{}}));Nl.show(ie);const de=P.get(ie);ns.focus(de)}}},Aae=(r,f)=>ba(Ui("data",f,r)),Dae=r=>IS(r,".tox-alert-dialog")||IS(r,".tox-confirm-dialog"),Vye=(r,f,g)=>f&&g?[]:[_l.config({contextual:{lazyContext:()=>V.some(di(lt.fromDom(r.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:v=>lw(r,v.element).map(T=>({bounds:NS(T),optScrollEnv:V.some({currentScrollTop:T.element.dom.scrollTop,scrollElmTop:Tc(T.element).top})})).getOrThunk(()=>({bounds:ue(),optScrollEnv:V.none()}))})],Wye=r=>{const f=r.editor,g=Dx(f),v=Hye(r.backstages.dialog),_=zye(r.backstages.dialog),T=(Ie,it,Qt)=>{if(!R(it)){if(it.inline==="toolbar")return J(Ie,r.backstages.popup.shared.anchors.inlineDialog(),Qt,it);if(it.inline==="bottom")return ie(Ie,r.backstages.popup.shared.anchors.inlineBottomDialog(),Qt,it);if(it.inline==="cursor")return J(Ie,r.backstages.popup.shared.anchors.cursor(),Qt,it)}return W(Ie,Qt)},P=(Ie,it)=>I(Ie,it),I=(Ie,it)=>{const Qt=dt=>{const ft=Zye(dt,{closeWindow:()=>{Nl.hide(ft.dialog),it(ft.instanceApi)}},f,r.backstages.dialog);return Nl.show(ft.dialog),ft.instanceApi};return Nb.openUrl(Qt,Ie)},W=(Ie,it)=>{const Qt=(dt,ft,Yt)=>{const Dt=ft,pn=Pm({dataValidator:Yt,initialData:Dt,internalDialog:dt},{redial:Nb.redial,closeWindow:()=>{Nl.hide(pn.dialog),it(pn.instanceApi)}},r.backstages.dialog);return Nl.show(pn.dialog),pn.instanceApi.setData(Dt),pn.instanceApi};return Nb.open(Qt,Ie)},J=(Ie,it,Qt,dt)=>{const ft=(Yt,Dt,kn)=>{const pn=Aae(Dt,kn),Nn=Xi(),jn=r.backstages.popup.shared.header.isPositionedAtTop(),Ys={dataValidator:kn,initialData:pn,internalDialog:Yt},ko=()=>Nn.on(Qo=>{Ba.reposition(Qo),_l.refresh(Qo)}),_s=Vf(Ys,{redial:Nb.redial,closeWindow:()=>{Nn.on(Ba.hide),f.off("ResizeEditor",ko),Nn.clear(),Qt(_s.instanceApi)}},r.backstages.popup,dt.ariaAttrs),hs=pc(Ba.sketch({lazySink:r.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:dt.persistent?{event:"doNotDismissYet"}:{},...jn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Tn([xs("window-manager-inline-events",[on(rg(),(Qo,fr)=>{rr(_s.dialog,BO)})]),...Vye(f,g,jn)]),isExtraPart:(Qo,fr)=>Dae(fr)}));Nn.set(hs);const vr=()=>{const Qo=f.inline?Hi():lt.fromDom(f.getContainer()),fr=di(Qo);return V.some(fr)};return Ba.showWithinBounds(hs,gu(_s.dialog),{anchor:it},vr),(!g||!jn)&&(_l.refresh(hs),f.on("ResizeEditor",ko)),_s.instanceApi.setData(pn),No.focusIn(_s.dialog),_s.instanceApi};return Nb.open(ft,Ie)},ie=(Ie,it,Qt,dt)=>{const ft=(Yt,Dt,kn)=>{const pn=Aae(Dt,kn),Nn=Xi(),jn=r.backstages.popup.shared.header.isPositionedAtTop(),Ys={dataValidator:kn,initialData:pn,internalDialog:Yt},ko=()=>Nn.on(Qo=>{Ba.reposition(Qo),_l.refresh(Qo)}),_s=Vf(Ys,{redial:Nb.redial,closeWindow:()=>{Nn.on(Ba.hide),f.off("ResizeEditor ScrollWindow ElementScroll",ko),Nn.clear(),Qt(_s.instanceApi)}},r.backstages.popup,dt.ariaAttrs),hs=pc(Ba.sketch({lazySink:r.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:dt.persistent?{event:"doNotDismissYet"}:{},...jn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Tn([xs("window-manager-inline-events",[on(rg(),(Qo,fr)=>{rr(_s.dialog,BO)})]),_l.config({contextual:{lazyContext:()=>V.some(di(lt.fromDom(f.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:Qo=>lw(f,Qo.element).map(Qn=>({bounds:NS(Qn),optScrollEnv:V.some({currentScrollTop:Qn.element.dom.scrollTop,scrollElmTop:Tc(Qn.element).top})})).getOrThunk(()=>({bounds:ue(),optScrollEnv:V.none()}))})]),isExtraPart:(Qo,fr)=>Dae(fr)}));Nn.set(hs);const vr=()=>r.backstages.popup.shared.getSink().toOptional().bind(Qo=>{const fr=lw(f,Qo.element),Qn=15,_o=fr.map(Wo=>NS(Wo)).getOr(ue()),us=di(lt.fromDom(f.getContentAreaContainer())),Js=Vp(us,_o);return V.some(ai(Js.x,Js.y,Js.width,Js.height-Qn))});return Ba.showWithinBounds(hs,gu(_s.dialog),{anchor:it},vr),_l.refresh(hs),f.on("ResizeEditor ScrollWindow ElementScroll",ko),_s.instanceApi.setData(pn),No.focusIn(_s.dialog),_s.instanceApi};return Nb.open(ft,Ie)};return{open:T,openUrl:P,alert:(Ie,it)=>{v.open(Ie,it)},close:Ie=>{Ie.close()},confirm:(Ie,it)=>{_.open(Ie,it)}}},Uye=r=>{u5(r),ZU(r),K$(r)};var Yye=()=>{Se.add("silver",r=>{Uye(r);let f=()=>ue();const{dialogs:g,popups:v,renderUI:_}=wee(r,{getPopupSinkBounds:()=>f()}),T=async()=>{const W=await _();return lw(r,v.getMothership().element).each(ie=>{f=()=>NS(ie)}),W};vY.register(r,v.backstage.shared);const P=Wye({editor:r,backstages:{popup:v.backstage,dialog:g.backstage}}),I=()=>hB(r,{backstage:v.backstage},v.getMothership());return{renderUI:T,getWindowManagerImpl:G(P),getNotificationManagerImpl:I}})};Yye()})();const BTe=`.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 o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(De,nt,bt)=>{var $t;return bt(De,nt.prototype)?!0:(($t=De.constructor)===null||$t===void 0?void 0:$t.name)===nt.name},t=De=>{const nt=typeof De;return De===null?"null":nt==="object"&&Array.isArray(De)?"array":nt==="object"&&e(De,String,(bt,$t)=>$t.isPrototypeOf(bt))?"string":nt},s=De=>nt=>t(nt)===De,a=De=>nt=>typeof nt===De,l=De=>nt=>De===nt,u=s("string"),d=s("object"),h=s("array"),b=l(null),y=a("boolean"),C=De=>De==null,E=De=>!C(De),R=a("function"),$=(De,nt)=>{if(h(De)){for(let bt=0,$t=De.length;bt<$t;++bt)if(!nt(De[bt]))return!1;return!0}return!1},Q=()=>{},F=De=>()=>De,U=(De,nt)=>De===nt;class K{constructor(nt,bt){this.tag=nt,this.value=bt}static some(nt){return new K(!0,nt)}static none(){return K.singletonNone}fold(nt,bt){return this.tag?bt(this.value):nt()}isSome(){return this.tag}isNone(){return!this.tag}map(nt){return this.tag?K.some(nt(this.value)):K.none()}bind(nt){return this.tag?nt(this.value):K.none()}exists(nt){return this.tag&&nt(this.value)}forall(nt){return!this.tag||nt(this.value)}filter(nt){return!this.tag||nt(this.value)?this:K.none()}getOr(nt){return this.tag?this.value:nt}or(nt){return this.tag?this:nt}getOrThunk(nt){return this.tag?this.value:nt()}orThunk(nt){return this.tag?this:nt()}getOrDie(nt){if(this.tag)return this.value;throw new Error(nt!=null?nt:"Called getOrDie on None")}static from(nt){return E(nt)?K.some(nt):K.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(nt){this.tag&&nt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}K.singletonNone=new K(!1);const L=Array.prototype.indexOf,te=Array.prototype.push,ne=(De,nt)=>L.call(De,nt),oe=(De,nt)=>ne(De,nt)>-1,G=(De,nt)=>{const bt=De.length,$t=new Array(bt);for(let On=0;On<bt;On++){const Mo=De[On];$t[On]=nt(Mo,On)}return $t},we=(De,nt)=>{for(let bt=0,$t=De.length;bt<$t;bt++){const On=De[bt];nt(On,bt)}},ve=(De,nt,bt)=>(we(De,($t,On)=>{bt=nt(bt,$t,On)}),bt),Re=De=>{const nt=[];for(let bt=0,$t=De.length;bt<$t;++bt){if(!h(De[bt]))throw new Error("Arr.flatten item "+bt+" was not an array, input: "+De);te.apply(nt,De[bt])}return nt},Oe=(De,nt)=>Re(G(De,nt)),ce=(De,nt)=>{for(let bt=0;bt<De.length;bt++){const $t=nt(De[bt],bt);if($t.isSome())return $t}return K.none()},Xe=(De,nt,bt=U)=>De.exists($t=>bt($t,nt)),tt=De=>{const nt=[],bt=$t=>{nt.push($t)};for(let $t=0;$t<De.length;$t++)De[$t].each(bt);return nt},ot=(De,nt)=>De?K.some(nt):K.none(),V=De=>nt=>nt.options.get(De),ut=De=>{const nt=De.options.register;nt("link_assume_external_targets",{processor:bt=>{const $t=u(bt)||y(bt);return $t?bt===!0?{value:1,valid:$t}:bt==="http"||bt==="https"?{value:bt,valid:$t}:{value:0,valid:$t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),nt("link_context_toolbar",{processor:"boolean",default:!1}),nt("link_list",{processor:bt=>u(bt)||R(bt)||$(bt,d)}),nt("link_default_target",{processor:"string"}),nt("link_default_protocol",{processor:"string",default:"https"}),nt("link_target_list",{processor:bt=>y(bt)||$(bt,d),default:!0}),nt("link_rel_list",{processor:"object[]",default:[]}),nt("link_class_list",{processor:"object[]",default:[]}),nt("link_title",{processor:"boolean",default:!0}),nt("allow_unsafe_link_target",{processor:"boolean",default:!1}),nt("link_quicklink",{processor:"boolean",default:!1})},Qe=V("link_assume_external_targets"),Bt=V("link_context_toolbar"),Ct=V("link_list"),He=V("link_default_target"),st=V("link_default_protocol"),rn=V("link_target_list"),Et=V("link_rel_list"),Cn=V("link_class_list"),je=V("link_title"),mt=V("allow_unsafe_link_target"),he=V("link_quicklink");var Zo=tinymce.util.Tools.resolve("tinymce.util.Tools");const Kn=De=>u(De.value)?De.value:"",so=De=>u(De.text)?De.text:u(De.title)?De.title:"",Yo=(De,nt)=>{const bt=[];return Zo.each(De,$t=>{const On=so($t);if($t.menu!==void 0){const Mo=Yo($t.menu,nt);bt.push({text:On,items:Mo})}else{const Mo=nt($t);bt.push({text:On,value:Mo})}}),bt},as=(De=Kn)=>nt=>K.from(nt).map(bt=>Yo(bt,De)),pt={sanitize:De=>as(Kn)(De),sanitizeWith:as,createUi:(De,nt)=>bt=>({name:De,type:"listbox",label:nt,items:bt}),getValue:Kn},Ne=Object.keys,Gt=Object.hasOwnProperty,bn=(De,nt)=>{const bt=Ne(De);for(let $t=0,On=bt.length;$t<On;$t++){const Mo=bt[$t],$r=De[Mo];nt($r,Mo)}},At=De=>(nt,bt)=>{De[bt]=nt},An=(De,nt,bt,$t)=>{bn(De,(On,Mo)=>{(nt(On,Mo)?bt:$t)(On,Mo)})},zn=(De,nt)=>{const bt={};return An(De,nt,At(bt),Q),bt},ps=(De,nt)=>Gt.call(De,nt),oo=(De,nt)=>ps(De,nt)&&De[nt]!==void 0&&De[nt]!==null;var Ss=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Mr=tinymce.util.Tools.resolve("tinymce.util.URI");const $s=De=>E(De)&&De.nodeName.toLowerCase()==="a",tr=De=>$s(De)&&!!dr(De),Xs=(De,nt)=>{if(De.collapsed)return[];{const bt=De.cloneContents(),$t=bt.firstChild,On=new Ss($t,bt),Mo=[];let $r=$t;do nt($r)&&Mo.push($r);while($r=On.next());return Mo}},wa=De=>/^\w+:/i.test(De),dr=De=>{var nt,bt;return(bt=(nt=De.getAttribute("data-mce-href"))!==null&&nt!==void 0?nt:De.getAttribute("href"))!==null&&bt!==void 0?bt:""},Ns=(De,nt)=>{const bt=["noopener"],$t=De?De.split(/\s+/):[],On=ls=>Zo.trim(ls.sort().join(" ")),Mo=ls=>(ls=$r(ls),ls.length>0?ls.concat(bt):bt),$r=ls=>ls.filter(Di=>Zo.inArray(bt,Di)===-1),ys=nt?Mo($t):$r($t);return ys.length>0?On(ys):""},qr=De=>De.replace(/\uFEFF/g,""),$o=(De,nt)=>(nt=nt||Ls(De.selection.getRng())[0]||De.selection.getNode(),vs(nt)?K.from(De.dom.select("a[href]",nt)[0]):K.from(De.dom.getParent(nt,"a[href]"))),Po=(De,nt)=>$o(De,nt).isSome(),Rr=(De,nt)=>{const bt=nt.fold(()=>De.getContent({format:"text"}),$t=>$t.innerText||$t.textContent||"");return qr(bt)},Ls=De=>Xs(De,tr),aa=De=>Zo.grep(De,tr),bs=De=>aa(De).length>0,_a=De=>Ls(De).length>0,ln=De=>{const nt=De.schema.getTextInlineElements(),bt=Mo=>Mo.nodeType===1&&!$s(Mo)&&!ps(nt,Mo.nodeName.toLowerCase());if($o(De).exists(Mo=>Mo.hasAttribute("data-mce-block")))return!1;const On=De.selection.getRng();return On.collapsed?!0:Xs(On,bt).length===0},vs=De=>E(De)&&De.nodeName==="FIGURE"&&/\bimage\b/i.test(De.className),Qi=De=>ve(["title","rel","class","target"],(bt,$t)=>(De[$t].each(On=>{bt[$t]=On.length>0?On:null}),bt),{href:De.href}),ze=(De,nt)=>(nt==="http"||nt==="https")&&!wa(De)?nt+"://"+De:De,et=(De,nt)=>{const bt={...nt};if(Et(De).length===0&&!mt(De)){const $t=Ns(bt.rel,bt.target==="_blank");bt.rel=$t||null}return K.from(bt.target).isNone()&&rn(De)===!1&&(bt.target=He(De)),bt.href=ze(bt.href,Qe(De)),bt},Tt=(De,nt,bt,$t)=>{bt.each(On=>{ps(nt,"innerText")?nt.innerText=On:nt.textContent=On}),De.dom.setAttribs(nt,$t),De.selection.select(nt)},Wt=(De,nt,bt,$t)=>{const On=De.dom;vs(nt)?Lr(On,nt,$t):bt.fold(()=>{De.execCommand("mceInsertLink",!1,$t)},Mo=>{De.insertContent(On.createHTML("a",$t,On.encode(Mo)))})},Yn=(De,nt,bt)=>{const $t=De.selection.getNode(),On=$o(De,$t),Mo=et(De,Qi(bt));De.undoManager.transact(()=>{bt.href===nt.href&&nt.attach(),On.fold(()=>{Wt(De,$t,bt.text,Mo)},$r=>{De.focus(),Tt(De,$r,bt.text,Mo)})})},po=De=>{const nt=De.dom,bt=De.selection,$t=bt.getBookmark(),On=bt.getRng().cloneRange(),Mo=nt.getParent(On.startContainer,"a[href]",De.getBody()),$r=nt.getParent(On.endContainer,"a[href]",De.getBody());Mo&&On.setStartBefore(Mo),$r&&On.setEndAfter($r),bt.setRng(On),De.execCommand("unlink"),bt.moveToBookmark($t)},wo=De=>{De.undoManager.transact(()=>{const nt=De.selection.getNode();vs(nt)?kr(De,nt):po(De),De.focus()})},fn=De=>{const{class:nt,href:bt,rel:$t,target:On,text:Mo,title:$r}=De;return zn({class:nt.getOrNull(),href:bt,rel:$t.getOrNull(),target:On.getOrNull(),text:Mo.getOrNull(),title:$r.getOrNull()},(ys,ls)=>b(ys)===!1)},os=(De,nt)=>{const bt=De.options.get,$t={allow_html_data_urls:bt("allow_html_data_urls"),allow_script_urls:bt("allow_script_urls"),allow_svg_data_urls:bt("allow_svg_data_urls")},On=nt.href;return{...nt,href:Mr.isDomSafe(On,"a",$t)?On:""}},xo=(De,nt,bt)=>{const $t=os(De,bt);De.hasPlugin("rtc",!0)?De.execCommand("createlink",!1,fn($t)):Yn(De,nt,$t)},fs=De=>{De.hasPlugin("rtc",!0)?De.execCommand("unlink"):wo(De)},kr=(De,nt)=>{var bt;const $t=De.dom.select("img",nt)[0];if($t){const On=De.dom.getParents($t,"a[href]",nt)[0];On&&((bt=On.parentNode)===null||bt===void 0||bt.insertBefore($t,On),De.dom.remove(On))}},Lr=(De,nt,bt)=>{var $t;const On=De.select("img",nt)[0];if(On){const Mo=De.create("a",bt);($t=On.parentNode)===null||$t===void 0||$t.insertBefore(Mo,On),Mo.appendChild(On)}},Vs=De=>oo(De,"items"),Yr=(De,nt)=>ce(nt,bt=>Vs(bt)?Yr(De,bt.items):ot(bt.value===De,bt)),Zi=(De,nt,bt,$t)=>{const On=$t[nt],Mo=De.length>0;return On!==void 0?Yr(On,bt).map($r=>({url:{value:$r.value,meta:{text:Mo?De:$r.text,attach:Q}},text:Mo?De:$r.text})):K.none()},Qa=(De,nt)=>nt==="link"?De.link:nt==="anchor"?De.anchor:K.none(),Ge={init:(De,nt)=>{const bt={text:De.text,title:De.title},$t=ls=>{var Di;return ot(bt.title.length<=0,K.from((Di=ls.meta)===null||Di===void 0?void 0:Di.title).getOr(""))},On=ls=>{var Di;return ot(bt.text.length<=0,K.from((Di=ls.meta)===null||Di===void 0?void 0:Di.text).getOr(ls.value))},Mo=ls=>{const Di=On(ls.url),js=$t(ls.url);return Di.isSome()||js.isSome()?K.some({...Di.map(Hi=>({text:Hi})).getOr({}),...js.map(Hi=>({title:Hi})).getOr({})}):K.none()},$r=(ls,Di)=>{const js=Qa(nt,Di).getOr([]);return Zi(bt.text,Di,js,ls)};return{onChange:(ls,Di)=>{const js=Di.name;return js==="url"?Mo(ls()):oe(["anchor","link"],js)?$r(ls(),js):((js==="text"||js==="title")&&(bt[js]=ls()[js]),K.none())}}},getDelta:Zi};var qe=tinymce.util.Tools.resolve("tinymce.util.Delay");const Nt=(De,nt,bt)=>{const $t=De.selection.getRng();qe.setEditorTimeout(De,()=>{De.windowManager.confirm(nt,On=>{De.selection.setRng($t),bt(On)})})},Ut=De=>{const nt=De.href;return nt.indexOf("@")>0&&nt.indexOf("/")===-1&&nt.indexOf("mailto:")===-1?K.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:$t=>({...$t,href:"mailto:"+nt})}):K.none()},bo=(De,nt)=>bt=>{const $t=bt.href;return De===1&&!wa($t)||De===0&&/^\s*www(\.|\d\.)/i.test($t)?K.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${nt}:// prefix?`,preprocess:Mo=>({...Mo,href:nt+"://"+$t})}):K.none()},Go={preprocess:(De,nt)=>ce([Ut,bo(Qe(De),st(De))],bt=>bt(nt)).fold(()=>Promise.resolve(nt),bt=>new Promise($t=>{Nt(De,bt.message,On=>{$t(On?bt.preprocess(nt):nt)})}))},lt={getAnchors:De=>{const nt=De.dom.select("a:not([href])"),bt=Oe(nt,$t=>{const On=$t.name||$t.id;return On?[{text:On,value:"#"+On}]:[]});return bt.length>0?K.some([{text:"None",value:""}].concat(bt)):K.none()}},Ni={getClasses:De=>{const nt=Cn(De);return nt.length>0?pt.sanitize(nt):K.none()}},la=De=>{try{return K.some(JSON.parse(De))}catch{return K.none()}},gr={getLinks:De=>{const nt=$t=>De.convertURL($t.value||$t.url||"","href"),bt=Ct(De);return new Promise($t=>{u(bt)?fetch(bt).then(On=>On.ok?On.text().then(la):Promise.reject()).then($t,()=>$t(K.none())):R(bt)?bt(On=>$t(K.some(On))):$t(K.from(bt))}).then($t=>$t.bind(pt.sanitizeWith(nt)).map(On=>On.length>0?[{text:"None",value:""}].concat(On):On))}},Cc={getRels:(De,nt)=>{const bt=Et(De);if(bt.length>0){const $t=Xe(nt,"_blank"),On=mt(De)===!1,Mo=ys=>Ns(pt.getValue(ys),$t);return(On?pt.sanitizeWith(Mo):pt.sanitize)(bt)}return K.none()}},nl=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],nr={getTargets:De=>{const nt=rn(De);return h(nt)?pt.sanitize(nt).orThunk(()=>K.some(nl)):nt===!1?K.none():K.some(nl)}},Ar=(De,nt,bt)=>{const $t=De.getAttrib(nt,bt);return $t!==null&&$t.length>0?K.some($t):K.none()},Ki=(De,nt)=>{const bt=De.dom,On=ln(De)?K.some(Rr(De.selection,nt)):K.none(),Mo=nt.bind(js=>K.from(bt.getAttrib(js,"href"))),$r=nt.bind(js=>K.from(bt.getAttrib(js,"target"))),ys=nt.bind(js=>Ar(bt,js,"rel")),ls=nt.bind(js=>Ar(bt,js,"class")),Di=nt.bind(js=>Ar(bt,js,"title"));return{url:Mo,text:On,title:Di,target:$r,rel:ys,linkClass:ls}},kc={collect:(De,nt)=>gr.getLinks(De).then(bt=>{const $t=Ki(De,nt);return{anchor:$t,catalogs:{targets:nr.getTargets(De),rels:Cc.getRels(De,$t.target),classes:Ni.getClasses(De),anchor:lt.getAnchors(De),link:bt},optNode:nt,flags:{titleEnabled:je(De)}}})},nu=(De,nt)=>bt=>{const $t=bt.getData();if(!$t.url.value){fs(De),bt.close();return}const On=ys=>K.from($t[ys]).filter(ls=>!Xe(nt.anchor[ys],ls)),Mo={href:$t.url.value,text:On("text"),target:On("target"),rel:On("rel"),class:On("linkClass"),title:On("title")},$r={href:$t.url.value,attach:$t.url.meta!==void 0&&$t.url.meta.attach?$t.url.meta.attach:Q};Go.preprocess(De,Mo).then(ys=>{xo(De,$r,ys)}),bt.close()},xu=De=>{const nt=$o(De);return kc.collect(De,nt)},yr=(De,nt)=>{const bt=De.anchor,$t=bt.url.getOr("");return{url:{value:$t,meta:{original:{value:$t}}},text:bt.text.getOr(""),title:bt.title.getOr(""),anchor:$t,link:$t,rel:bt.rel.getOr(""),target:bt.target.or(nt).getOr(""),linkClass:bt.linkClass.getOr("")}},ol=(De,nt,bt)=>{const $t=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],On=De.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),Mo=De.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],$r=K.from(He(bt)),ys=yr(De,$r),ls=De.catalogs,Di=Ge.init(ys,ls);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:Re([$t,On,Mo,tt([ls.anchor.map(pt.createUi("anchor","Anchors")),ls.rels.map(pt.createUi("rel","Rel")),ls.targets.map(pt.createUi("target","Open link in...")),ls.link.map(pt.createUi("link","Link list")),ls.classes.map(pt.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ys,onChange:(Hi,{name:Du})=>{Di.onChange(Hi.getData,{name:Du}).each(xd=>{Hi.setData(xd)})},onSubmit:nt}},Tu=De=>{xu(De).then(bt=>{const $t=nu(De,bt);return ol(bt,$t,De)}).then(bt=>{De.windowManager.open(bt)})},ou=De=>{De.addCommand("mceLink",(nt,bt)=>{(bt==null?void 0:bt.dialog)===!0||!he(De)?Tu(De):De.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"})})};var Yl=tinymce.util.Tools.resolve("tinymce.util.VK");const Aa=(De,nt)=>{document.body.appendChild(De),De.dispatchEvent(nt),document.body.removeChild(De)},Dr=De=>{const nt=document.createElement("a");nt.target="_blank",nt.href=De,nt.rel="noreferrer noopener";const bt=document.createEvent("MouseEvents");bt.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Aa(nt,bt)},Qm=(De,nt)=>De.dom.getParent(nt,"a[href]"),xf=De=>Qm(De,De.selection.getStart()),xr=De=>De.altKey===!0&&De.shiftKey===!1&&De.ctrlKey===!1&&De.metaKey===!1,Za=(De,nt)=>{if(nt){const bt=dr(nt);if(/^#/.test(bt)){const $t=De.dom.select(bt);$t.length&&De.selection.scrollIntoView($t[0],!0)}else Dr(nt.href)}},ca=De=>()=>{De.execCommand("mceLink",!1,{dialog:!0})},Ji=De=>()=>{Za(De,xf(De))},Eu=De=>{De.on("click",nt=>{const bt=Qm(De,nt.target);bt&&Yl.metaKeyPressed(nt)&&(nt.preventDefault(),Za(De,bt))}),De.on("keydown",nt=>{if(!nt.isDefaultPrevented()&&nt.keyCode===13&&xr(nt)){const bt=xf(De);bt&&(nt.preventDefault(),Za(De,bt))}})},Qc=(De,nt)=>(De.on("NodeChange",nt),()=>De.off("NodeChange",nt)),Ha=De=>nt=>{const bt=()=>{nt.setActive(!De.mode.isReadOnly()&&Po(De,De.selection.getNode())),nt.setEnabled(De.selection.isEditable())};return bt(),Qc(De,bt)},Zc=De=>nt=>{const bt=()=>{nt.setEnabled(De.selection.isEditable())};return bt(),Qc(De,bt)},xc=De=>(De.selection.isCollapsed()?aa(De.dom.getParents(De.selection.getStart())):Ls(De.selection.getRng())).length===1,Cd=De=>nt=>{const bt=()=>nt.setEnabled(xc(De));return bt(),Qc(De,bt)},Yf=De=>nt=>{const bt=Mo=>bs(Mo)||_a(De.selection.getRng()),$t=De.dom.getParents(De.selection.getStart()),On=Mo=>{nt.setEnabled(bt(Mo)&&De.selection.isEditable())};return On($t),Qc(De,Mo=>On(Mo.parents))},Au=De=>{De.addShortcut("Meta+K","",()=>{De.execCommand("mceLink")})},Xl=De=>{De.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:ca(De),onSetup:Ha(De)}),De.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Ji(De),onSetup:Cd(De)}),De.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>fs(De),onSetup:Yf(De)})},Hc=De=>{De.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Ji(De),onSetup:Cd(De)}),De.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:Zc(De),onAction:ca(De)}),De.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>fs(De),onSetup:Yf(De)})},Tf=De=>{const nt="link unlink openlink",bt="link";De.ui.registry.addContextMenu("link",{update:$t=>De.dom.isEditable($t)?bs(De.dom.getParents($t,"a"))?nt:bt:""})},su=De=>{const nt=On=>{On.selection.collapse(!1)},bt=On=>{const Mo=De.selection.getNode();return On.setEnabled(Po(De,Mo)),Q},$t=On=>{const Mo=$o(De),$r=ln(De);if(Mo.isNone()&&$r){const ys=Rr(De.selection,Mo);return ot(ys.length===0,On)}else return K.none()};De.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ha(De)},label:"Link",predicate:On=>Bt(De)&&Po(De,On),initValue:()=>$o(De).fold(F(""),dr),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:On=>{const Mo=De.selection.getNode();return On.setActive(Po(De,Mo)),Ha(De)(On)},onAction:On=>{const Mo=On.getValue(),$r=$t(Mo);xo(De,{href:Mo,attach:Q},{href:Mo,text:$r,title:K.none(),rel:K.none(),target:K.none(),class:K.none()}),nt(De),On.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:bt,onAction:On=>{fs(De),On.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:bt,onAction:On=>{Ji(De)(),On.hide()}}]})};var kd=()=>{o.add("link",De=>{ut(De),Xl(De),Hc(De),Tf(De),su(De),Eu(De),ou(De),Au(De)})};kd()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(d,h)=>{d.focus(),d.undoManager.transact(()=>{d.setContent(h)}),d.selection.setCursorLocation(),d.nodeChanged()},t=d=>d.getContent({source_view:!0}),s=d=>{const h=t(d);d.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:h},onSubmit:b=>{e(d,b.getData().code),b.close()}})},a=d=>{d.addCommand("mceCodeEditor",()=>{s(d)})},l=d=>{const h=()=>d.execCommand("mceCodeEditor");d.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:h}),d.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:h})};var u=()=>{o.add("code",d=>(a(d),l(d),{}))};u()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=Object.getPrototypeOf,t=(me,$e,Ue)=>{var It;return Ue(me,$e.prototype)?!0:((It=me.constructor)===null||It===void 0?void 0:It.name)===$e.name},s=me=>{const $e=typeof me;return me===null?"null":$e==="object"&&Array.isArray(me)?"array":$e==="object"&&t(me,String,(Ue,It)=>It.isPrototypeOf(Ue))?"string":$e},a=me=>$e=>s($e)===me,l=me=>$e=>typeof $e===me,u=me=>$e=>me===$e,d=(me,$e)=>b(me)&&t(me,$e,(Ue,It)=>e(Ue)===It),h=a("string"),b=a("object"),y=me=>d(me,Object),C=a("array"),E=u(null),R=l("boolean"),$=me=>me==null,Q=me=>!$(me),F=l("function"),U=l("number"),K=(me,$e)=>{if(C(me)){for(let Ue=0,It=me.length;Ue<It;++Ue)if(!$e(me[Ue]))return!1;return!0}return!1},L=()=>{};class te{constructor($e,Ue){this.tag=$e,this.value=Ue}static some($e){return new te(!0,$e)}static none(){return te.singletonNone}fold($e,Ue){return this.tag?Ue(this.value):$e()}isSome(){return this.tag}isNone(){return!this.tag}map($e){return this.tag?te.some($e(this.value)):te.none()}bind($e){return this.tag?$e(this.value):te.none()}exists($e){return this.tag&&$e(this.value)}forall($e){return!this.tag||$e(this.value)}filter($e){return!this.tag||$e(this.value)?this:te.none()}getOr($e){return this.tag?this.value:$e}or($e){return this.tag?this:$e}getOrThunk($e){return this.tag?this.value:$e()}orThunk($e){return this.tag?this:$e()}getOrDie($e){if(this.tag)return this.value;throw new Error($e!=null?$e:"Called getOrDie on None")}static from($e){return Q($e)?te.some($e):te.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each($e){this.tag&&$e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}te.singletonNone=new te(!1);const ne=Object.keys,oe=Object.hasOwnProperty,G=(me,$e)=>{const Ue=ne(me);for(let It=0,Bn=Ue.length;It<Bn;It++){const es=Ue[It],ro=me[es];$e(ro,es)}},we=me=>($e,Ue)=>{me[Ue]=$e},ve=(me,$e,Ue,It)=>{G(me,(Bn,es)=>{($e(Bn,es)?Ue:It)(Bn,es)})},Re=(me,$e)=>{const Ue={};return ve(me,$e,we(Ue),L),Ue},Oe=(me,$e)=>oe.call(me,$e),ce=(me,$e)=>Oe(me,$e)&&me[$e]!==void 0&&me[$e]!==null,Xe=Array.prototype.push,tt=me=>{const $e=[];for(let Ue=0,It=me.length;Ue<It;++Ue){if(!C(me[Ue]))throw new Error("Arr.flatten item "+Ue+" was not an array, input: "+me);Xe.apply($e,me[Ue])}return $e},ot=(me,$e)=>$e>=0&&$e<me.length?te.some(me[$e]):te.none(),V=me=>ot(me,0),ut=(me,$e)=>{for(let Ue=0;Ue<me.length;Ue++){const It=$e(me[Ue],Ue);if(It.isSome())return It}return te.none()};typeof window<"u"||Function("return this;")();const Qe=(me,$e,Ue)=>{if(h(Ue)||R(Ue)||U(Ue))me.setAttribute($e,Ue+"");else throw console.error("Invalid call to Attribute.set. Key ",$e,":: Value ",Ue,":: Element ",me),new Error("Attribute value was not simple")},Bt=(me,$e,Ue)=>{Qe(me.dom,$e,Ue)},Ct=(me,$e)=>{me.dom.removeAttribute($e)},He=(me,$e)=>{const It=($e||document).createElement("div");if(It.innerHTML=me,!It.hasChildNodes()||It.childNodes.length>1){const Bn="HTML does not have a single root node";throw console.error(Bn,me),new Error(Bn)}return Et(It.childNodes[0])},st=(me,$e)=>{const It=($e||document).createElement(me);return Et(It)},rn=(me,$e)=>{const It=($e||document).createTextNode(me);return Et(It)},Et=me=>{if(me==null)throw new Error("Node cannot be null or undefined");return{dom:me}},je={fromHtml:He,fromTag:st,fromText:rn,fromDom:Et,fromPoint:(me,$e,Ue)=>te.from(me.dom.elementFromPoint($e,Ue)).map(Et)};var mt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),he=tinymce.util.Tools.resolve("tinymce.util.URI");const Zo=me=>me.length>0,Kn=me=>$e=>$e.options.get(me),so=me=>{const $e=me.options.register;$e("image_dimensions",{processor:"boolean",default:!0}),$e("image_advtab",{processor:"boolean",default:!1}),$e("image_uploadtab",{processor:"boolean",default:!0}),$e("image_prepend_url",{processor:"string",default:""}),$e("image_class_list",{processor:"object[]"}),$e("image_description",{processor:"boolean",default:!0}),$e("image_title",{processor:"boolean",default:!1}),$e("image_caption",{processor:"boolean",default:!1}),$e("image_list",{processor:Ue=>{const It=Ue===!1||h(Ue)||K(Ue,b)||F(Ue);return It?{value:Ue,valid:It}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},Yo=Kn("image_dimensions"),as=Kn("image_advtab"),kt=Kn("image_uploadtab"),jt=Kn("image_prepend_url"),pt=Kn("image_class_list"),Ne=Kn("image_description"),Gt=Kn("image_title"),bn=Kn("image_caption"),At=Kn("image_list"),An=Kn("a11y_advanced_options"),zn=Kn("automatic_uploads"),ps=me=>Zo(me.options.get("images_upload_url")),oo=me=>Q(me.options.get("images_upload_handler")),Ss=(me,$e)=>Math.max(parseInt(me,10),parseInt($e,10)),Mr=me=>new Promise($e=>{const Ue=document.createElement("img"),It=es=>{Ue.onload=Ue.onerror=null,Ue.parentNode&&Ue.parentNode.removeChild(Ue),$e(es)};Ue.onload=()=>{const es=Ss(Ue.width,Ue.clientWidth),ro=Ss(Ue.height,Ue.clientHeight),yi={width:es,height:ro};It(Promise.resolve(yi))},Ue.onerror=()=>{It(Promise.reject(`Failed to get image dimensions for: ${me}`))};const Bn=Ue.style;Bn.visibility="hidden",Bn.position="fixed",Bn.bottom=Bn.left="0px",Bn.width=Bn.height="auto",document.body.appendChild(Ue),Ue.src=me}),$s=me=>(me&&(me=me.replace(/px$/,"")),me),tr=me=>(me.length>0&&/^[0-9]+$/.test(me)&&(me+="px"),me),Xs=me=>{if(me.margin){const $e=String(me.margin).split(" ");switch($e.length){case 1:me["margin-top"]=me["margin-top"]||$e[0],me["margin-right"]=me["margin-right"]||$e[0],me["margin-bottom"]=me["margin-bottom"]||$e[0],me["margin-left"]=me["margin-left"]||$e[0];break;case 2:me["margin-top"]=me["margin-top"]||$e[0],me["margin-right"]=me["margin-right"]||$e[1],me["margin-bottom"]=me["margin-bottom"]||$e[0],me["margin-left"]=me["margin-left"]||$e[1];break;case 3:me["margin-top"]=me["margin-top"]||$e[0],me["margin-right"]=me["margin-right"]||$e[1],me["margin-bottom"]=me["margin-bottom"]||$e[2],me["margin-left"]=me["margin-left"]||$e[1];break;case 4:me["margin-top"]=me["margin-top"]||$e[0],me["margin-right"]=me["margin-right"]||$e[1],me["margin-bottom"]=me["margin-bottom"]||$e[2],me["margin-left"]=me["margin-left"]||$e[3]}delete me.margin}return me},wa=(me,$e)=>{const Ue=At(me);h(Ue)?fetch(Ue).then(It=>{It.ok&&It.json().then($e)}):F(Ue)?Ue($e):$e(Ue)},dr=(me,$e,Ue)=>{const It=()=>{Ue.onload=Ue.onerror=null,me.selection&&(me.selection.select(Ue),me.nodeChanged())};Ue.onload=()=>{!$e.width&&!$e.height&&Yo(me)&&me.dom.setAttribs(Ue,{width:String(Ue.clientWidth),height:String(Ue.clientHeight)}),It()},Ue.onerror=It},Ns=me=>new Promise(($e,Ue)=>{const It=new FileReader;It.onload=()=>{$e(It.result)},It.onerror=()=>{var Bn;Ue((Bn=It.error)===null||Bn===void 0?void 0:Bn.message)},It.readAsDataURL(me)}),qr=me=>me.nodeName==="IMG"&&(me.hasAttribute("data-mce-object")||me.hasAttribute("data-mce-placeholder")),$o=(me,$e)=>{const Ue=me.options.get;return he.isDomSafe($e,"img",{allow_html_data_urls:Ue("allow_html_data_urls"),allow_script_urls:Ue("allow_script_urls"),allow_svg_data_urls:Ue("allow_svg_data_urls")})},Po=mt.DOM,Rr=me=>me.style.marginLeft&&me.style.marginRight&&me.style.marginLeft===me.style.marginRight?$s(me.style.marginLeft):"",Ls=me=>me.style.marginTop&&me.style.marginBottom&&me.style.marginTop===me.style.marginBottom?$s(me.style.marginTop):"",aa=me=>me.style.borderWidth?$s(me.style.borderWidth):"",bs=(me,$e)=>{var Ue;return me.hasAttribute($e)&&(Ue=me.getAttribute($e))!==null&&Ue!==void 0?Ue:""},_a=me=>me.parentNode!==null&&me.parentNode.nodeName==="FIGURE",ln=(me,$e,Ue)=>{Ue===""||Ue===null?me.removeAttribute($e):me.setAttribute($e,Ue)},vs=me=>{const $e=Po.create("figure",{class:"image"});Po.insertAfter($e,me),$e.appendChild(me),$e.appendChild(Po.create("figcaption",{contentEditable:"true"},"Caption")),$e.contentEditable="false"},Qi=me=>{const $e=me.parentNode;Q($e)&&(Po.insertAfter(me,$e),Po.remove($e))},ze=me=>{_a(me)?Qi(me):vs(me)},et=(me,$e)=>{const Ue=me.getAttribute("style"),It=$e(Ue!==null?Ue:"");It.length>0?(me.setAttribute("style",It),me.setAttribute("data-mce-style",It)):me.removeAttribute("style")},Tt=(me,$e)=>(Ue,It,Bn)=>{const es=Ue.style;es[It]?(es[It]=tr(Bn),et(Ue,$e)):ln(Ue,It,Bn)},Wt=(me,$e)=>me.style[$e]?$s(me.style[$e]):bs(me,$e),Yn=(me,$e)=>{const Ue=tr($e);me.style.marginLeft=Ue,me.style.marginRight=Ue},po=(me,$e)=>{const Ue=tr($e);me.style.marginTop=Ue,me.style.marginBottom=Ue},wo=(me,$e)=>{const Ue=tr($e);me.style.borderWidth=Ue},fn=(me,$e)=>{me.style.borderStyle=$e},os=me=>{var $e;return($e=me.style.borderStyle)!==null&&$e!==void 0?$e:""},xo=me=>Q(me)&&me.nodeName==="FIGURE",fs=me=>me.nodeName==="IMG",kr=me=>Po.getAttrib(me,"alt").length===0&&Po.getAttrib(me,"role")==="presentation",Lr=me=>kr(me)?"":bs(me,"alt"),Vs=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),Yr=(me,$e)=>{var Ue;const It=document.createElement("img");return ln(It,"style",$e.style),(Rr(It)||$e.hspace!=="")&&Yn(It,$e.hspace),(Ls(It)||$e.vspace!=="")&&po(It,$e.vspace),(aa(It)||$e.border!=="")&&wo(It,$e.border),(os(It)||$e.borderStyle!=="")&&fn(It,$e.borderStyle),me((Ue=It.getAttribute("style"))!==null&&Ue!==void 0?Ue:"")},Zi=(me,$e)=>{const Ue=document.createElement("img");if(Ut(me,{...$e,caption:!1},Ue),Ge(Ue,$e.alt,$e.isDecorative),$e.caption){const It=Po.create("figure",{class:"image"});return It.appendChild(Ue),It.appendChild(Po.create("figcaption",{contentEditable:"true"},"Caption")),It.contentEditable="false",It}else return Ue},Qa=(me,$e)=>({src:bs($e,"src"),alt:Lr($e),title:bs($e,"title"),width:Wt($e,"width"),height:Wt($e,"height"),class:bs($e,"class"),style:me(bs($e,"style")),caption:_a($e),hspace:Rr($e),vspace:Ls($e),border:aa($e),borderStyle:os($e),isDecorative:kr($e)}),Oi=(me,$e,Ue,It,Bn)=>{Ue[It]!==$e[It]&&Bn(me,It,String(Ue[It]))},Ge=(me,$e,Ue)=>{if(Ue){Po.setAttrib(me,"role","presentation");const It=je.fromDom(me);Bt(It,"alt","")}else{if(E($e)){const It=je.fromDom(me);Ct(It,"alt")}else{const It=je.fromDom(me);Bt(It,"alt",$e)}Po.getAttrib(me,"role")==="presentation"&&Po.setAttrib(me,"role","")}},qe=(me,$e,Ue)=>{(Ue.alt!==$e.alt||Ue.isDecorative!==$e.isDecorative)&&Ge(me,Ue.alt,Ue.isDecorative)},Nt=(me,$e)=>(Ue,It,Bn)=>{me(Ue,Bn),et(Ue,$e)},Ut=(me,$e,Ue)=>{const It=Qa(me,Ue);Oi(Ue,It,$e,"caption",(Bn,es,ro)=>ze(Bn)),Oi(Ue,It,$e,"src",ln),Oi(Ue,It,$e,"title",ln),Oi(Ue,It,$e,"width",Tt("width",me)),Oi(Ue,It,$e,"height",Tt("height",me)),Oi(Ue,It,$e,"class",ln),Oi(Ue,It,$e,"style",Nt((Bn,es)=>ln(Bn,"style",es),me)),Oi(Ue,It,$e,"hspace",Nt(Yn,me)),Oi(Ue,It,$e,"vspace",Nt(po,me)),Oi(Ue,It,$e,"border",Nt(wo,me)),Oi(Ue,It,$e,"borderStyle",Nt(fn,me)),qe(Ue,It,$e)},bo=(me,$e)=>{const Ue=me.dom.styles.parse($e),It=Xs(Ue),Bn=me.dom.styles.parse(me.dom.styles.serialize(It));return me.dom.styles.serialize(Bn)},Lo=me=>{const $e=me.selection.getNode(),Ue=me.dom.getParent($e,"figure.image");return Ue?me.dom.select("img",Ue)[0]:$e&&($e.nodeName!=="IMG"||qr($e))?null:$e},Go=(me,$e)=>{var Ue;const It=me.dom,Bn=Re(me.schema.getTextBlockElements(),(ro,yi)=>!me.schema.isValidChild(yi,"figure")),es=It.getParent($e.parentNode,ro=>ce(Bn,ro.nodeName),me.getBody());return es&&(Ue=It.split(es,$e))!==null&&Ue!==void 0?Ue:$e},ei=me=>{const $e=Lo(me);return $e?Qa(Ue=>bo(me,Ue),$e):Vs()},lt=(me,$e)=>{const Ue=Zi(Bn=>bo(me,Bn),$e);me.dom.setAttrib(Ue,"data-mce-id","__mcenew"),me.focus(),me.selection.setContent(Ue.outerHTML);const It=me.dom.select('*[data-mce-id="__mcenew"]')[0];if(me.dom.setAttrib(It,"data-mce-id",null),xo(It)){const Bn=Go(me,It);me.selection.select(Bn)}else me.selection.select(It)},Xo=(me,$e)=>{me.dom.setAttrib($e,"src",$e.getAttribute("src"))},Ni=(me,$e)=>{if($e){const Ue=me.dom.is($e.parentNode,"figure.image")?$e.parentNode:$e;me.dom.remove(Ue),me.focus(),me.nodeChanged(),me.dom.isEmpty(me.getBody())&&(me.setContent(""),me.selection.setCursorLocation())}},la=(me,$e)=>{const Ue=Lo(me);if(Ue)if(Ut(It=>bo(me,It),$e,Ue),Xo(me,Ue),xo(Ue.parentNode)){const It=Ue.parentNode;Go(me,It),me.selection.select(Ue.parentNode)}else me.selection.select(Ue),dr(me,$e,Ue)},ma=(me,$e)=>{const Ue=$e.src;return{...$e,src:$o(me,Ue)?Ue:""}},gr=(me,$e)=>{const Ue=Lo(me);if(Ue){const Bn={...Qa(ro=>bo(me,ro),Ue),...$e},es=ma(me,Bn);Bn.src?la(me,es):Ni(me,Ue)}else $e.src&<(me,{...Vs(),...$e})},nl=(me=>(...$e)=>{if($e.length===0)throw new Error("Can't merge zero objects");const Ue={};for(let It=0;It<$e.length;It++){const Bn=$e[It];for(const es in Bn)Oe(Bn,es)&&(Ue[es]=me(Ue[es],Bn[es]))}return Ue})((me,$e)=>y(me)&&y($e)?nl(me,$e):$e);var ga=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),nr=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ar=me=>h(me.value)?me.value:"",Ki=me=>h(me.text)?me.text:h(me.title)?me.title:"",gl=(me,$e)=>{const Ue=[];return nr.each(me,It=>{const Bn=Ki(It);if(It.menu!==void 0){const es=gl(It.menu,$e);Ue.push({text:Bn,items:es})}else{const es=$e(It);Ue.push({text:Bn,value:es})}}),Ue},kc=(me=Ar)=>$e=>$e?te.from($e).map(Ue=>gl(Ue,me)):te.none(),nu=me=>kc(Ar)(me),xu=me=>Oe(me,"items"),yr=(me,$e)=>ut(me,Ue=>xu(Ue)?yr(Ue.items,$e):Ue.value===$e?te.some(Ue):te.none()),Tu={sanitizer:kc,sanitize:nu,findEntry:(me,$e)=>me.bind(Ue=>yr(Ue,$e))},Yl={makeTab:me=>({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=me=>{const $e=Tu.sanitizer(Pi=>me.convertURL(Pi.value||Pi.url||"","src")),Ue=new Promise(Pi=>{wa(me,uc=>{Pi($e(uc).map(Ii=>tt([[{text:"None",value:""}],Ii])))})}),It=Tu.sanitize(pt(me)),Bn=as(me),es=kt(me),ro=ps(me),yi=oo(me),gn=ei(me),Gr=Ne(me),Ll=Gt(me),ea=Yo(me),ri=bn(me),Ef=An(me),ks=zn(me),ru=te.some(jt(me)).filter(Pi=>h(Pi)&&Pi.length>0);return Ue.then(Pi=>({image:gn,imageList:Pi,classList:It,hasAdvTab:Bn,hasUploadTab:es,hasUploadUrl:ro,hasUploadHandler:yi,hasDescription:Gr,hasImageTitle:Ll,hasDimensions:ea,hasImageCaption:ri,prependURL:ru,hasAccessibilityOptions:Ef,automaticUploads:ks}))},Dr=me=>{const $e={name:"src",type:"urlinput",filetype:"image",label:"Source"},Ue=me.imageList.map(Ll=>({name:"images",type:"listbox",label:"Image list",items:Ll})),It={name:"alt",type:"input",label:"Alternative description",enabled:!(me.hasAccessibilityOptions&&me.image.isDecorative)},Bn={name:"title",type:"input",label:"Image title"},es={name:"dimensions",type:"sizeinput"},ro={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},yi=me.classList.map(Ll=>({name:"classes",type:"listbox",label:"Class",items:Ll})),gn={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},Gr=Ll=>Ll?{type:"grid",columns:2}:{type:"panel"};return tt([[$e],Ue.toArray(),me.hasAccessibilityOptions&&me.hasDescription?[ro]:[],me.hasDescription?[It]:[],me.hasImageTitle?[Bn]:[],me.hasDimensions?[es]:[],[{...Gr(me.classList.isSome()&&me.hasImageCaption),items:tt([yi.toArray(),me.hasImageCaption?[gn]:[]])}]])},xf={makeTab:me=>({title:"General",name:"general",items:Dr(me)}),makeItems:Dr},Za={makeTab:me=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},ca=me=>({prevImage:Tu.findEntry(me.imageList,me.image.src),prevAlt:me.image.alt,open:!0}),Ji=me=>({src:{value:me.src,meta:{}},images:me.src,alt:me.alt,title:me.title,dimensions:{width:me.width,height:me.height},classes:me.class,caption:me.caption,style:me.style,vspace:me.vspace,border:me.border,hspace:me.hspace,borderstyle:me.borderStyle,fileinput:[],isDecorative:me.isDecorative}),Eu=(me,$e)=>({src:me.src.value,alt:(me.alt===null||me.alt.length===0)&&$e?null:me.alt,title:me.title,width:me.dimensions.width,height:me.dimensions.height,class:me.classes,style:me.style,caption:me.caption,hspace:me.hspace,vspace:me.vspace,border:me.border,borderStyle:me.borderstyle,isDecorative:me.isDecorative}),Qc=(me,$e)=>/^(?:[a-zA-Z]+:)?\/\//.test($e)?te.none():me.prependURL.bind(Ue=>$e.substring(0,Ue.length)!==Ue?te.some(Ue+$e):te.none()),Ha=(me,$e)=>{const Ue=$e.getData();Qc(me,Ue.src.value).each(It=>{$e.setData({src:{value:It,meta:Ue.src.meta}})})},Zc=(me,$e,Ue)=>{me.hasDescription&&h(Ue.alt)&&($e.alt=Ue.alt),me.hasAccessibilityOptions&&($e.isDecorative=Ue.isDecorative||$e.isDecorative||!1),me.hasImageTitle&&h(Ue.title)&&($e.title=Ue.title),me.hasDimensions&&(h(Ue.width)&&($e.dimensions.width=Ue.width),h(Ue.height)&&($e.dimensions.height=Ue.height)),h(Ue.class)&&Tu.findEntry(me.classList,Ue.class).each(It=>{$e.classes=It.value}),me.hasImageCaption&&R(Ue.caption)&&($e.caption=Ue.caption),me.hasAdvTab&&(h(Ue.style)&&($e.style=Ue.style),h(Ue.vspace)&&($e.vspace=Ue.vspace),h(Ue.border)&&($e.border=Ue.border),h(Ue.hspace)&&($e.hspace=Ue.hspace),h(Ue.borderstyle)&&($e.borderstyle=Ue.borderstyle))},xc=(me,$e)=>{const Ue=$e.getData(),It=Ue.src.meta;if(It!==void 0){const Bn=nl({},Ue);Zc(me,Bn,It),$e.setData(Bn)}},Cd=(me,$e,Ue,It)=>{const Bn=It.getData(),es=Bn.src.value,ro=Bn.src.meta||{};!ro.width&&!ro.height&&$e.hasDimensions&&(Zo(es)?me.imageSize(es).then(yi=>{Ue.open&&It.setData({dimensions:yi})}).catch(yi=>console.error(yi)):It.setData({dimensions:{width:"",height:""}}))},Yf=(me,$e,Ue)=>{const It=Ue.getData(),Bn=Tu.findEntry(me.imageList,It.src.value);$e.prevImage=Bn,Ue.setData({images:Bn.map(es=>es.value).getOr("")})},Au=(me,$e,Ue,It)=>{Ha($e,It),xc($e,It),Cd(me,$e,Ue,It),Yf($e,Ue,It)},Xl=(me,$e,Ue,It)=>{const Bn=It.getData(),es=Tu.findEntry($e.imageList,Bn.images);es.each(ro=>{Bn.alt===""||Ue.prevImage.map(gn=>gn.text===Bn.alt).getOr(!1)?ro.value===""?It.setData({src:ro,alt:Ue.prevAlt}):It.setData({src:ro,alt:ro.text}):It.setData({src:ro})}),Ue.prevImage=es,Au(me,$e,Ue,It)},Hc=(me,$e,Ue,It)=>{const Bn=It.getData();It.block("Uploading image"),V(Bn.fileinput).fold(()=>{It.unblock()},es=>{const ro=URL.createObjectURL(es),yi=()=>{It.unblock(),URL.revokeObjectURL(ro)},gn=Gr=>{It.setData({src:{value:Gr,meta:{}}}),It.showTab("general"),Au(me,$e,Ue,It)};Ns(es).then(Gr=>{const Ll=me.createBlobCache(es,ro,Gr);$e.automaticUploads?me.uploadImage(Ll).then(ea=>{gn(ea.url),yi()}).catch(ea=>{yi(),me.alertErr(ea)}):(me.addToBlobCache(Ll),gn(Ll.blobUri()),It.unblock())})})},Tf=(me,$e,Ue)=>(It,Bn)=>{Bn.name==="src"?Au(me,$e,Ue,It):Bn.name==="images"?Xl(me,$e,Ue,It):Bn.name==="alt"?Ue.prevAlt=It.getData().alt:Bn.name==="fileinput"?Hc(me,$e,Ue,It):Bn.name==="isDecorative"&&It.setEnabled("alt",!It.getData().isDecorative)},su=me=>()=>{me.open=!1},kd=me=>me.hasAdvTab||me.hasUploadUrl||me.hasUploadHandler?{type:"tabpanel",tabs:tt([[xf.makeTab(me)],me.hasAdvTab?[Yl.makeTab(me)]:[],me.hasUploadTab&&(me.hasUploadUrl||me.hasUploadHandler)?[Za.makeTab(me)]:[]])}:{type:"panel",items:xf.makeItems(me)},De=(me,$e,Ue)=>It=>{const Bn=nl(Ji($e.image),It.getData()),es={...Bn,style:Yr(Ue.normalizeCss,Eu(Bn,!1))};me.execCommand("mceUpdateImage",!1,Eu(es,$e.hasAccessibilityOptions)),me.editorUpload.uploadImagesAuto(),It.close()},nt=me=>$e=>$o(me,$e)?Mr(me.documentBaseURI.toAbsolute($e)).then(Ue=>({width:String(Ue.width),height:String(Ue.height)})):Promise.resolve({width:"",height:""}),bt=me=>($e,Ue,It)=>{var Bn;return me.editorUpload.blobCache.create({blob:$e,blobUri:Ue,name:(Bn=$e.name)===null||Bn===void 0?void 0:Bn.replace(/\.[^\.]+$/,""),filename:$e.name,base64:It.split(",")[1]})},$t=me=>$e=>{me.editorUpload.blobCache.add($e)},On=me=>$e=>{me.windowManager.alert($e)},Mo=me=>$e=>bo(me,$e),$r=me=>$e=>me.dom.parseStyle($e),ys=me=>($e,Ue)=>me.dom.serializeStyle($e,Ue),ls=me=>$e=>ga(me).upload([$e],!1).then(Ue=>{var It;return Ue.length===0?Promise.reject("Failed to upload image"):Ue[0].status===!1?Promise.reject((It=Ue[0].error)===null||It===void 0?void 0:It.message):Ue[0]}),Di=me=>{const $e={imageSize:nt(me),addToBlobCache:$t(me),createBlobCache:bt(me),alertErr:On(me),normalizeCss:Mo(me),parseStyle:$r(me),serializeStyle:ys(me),uploadImage:ls(me)};return{open:()=>{Aa(me).then(It=>{const Bn=ca(It);return{title:"Insert/Edit Image",size:"normal",body:kd(It),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ji(It.image),onSubmit:De(me,It,$e),onChange:Tf($e,It,Bn),onClose:su(Bn)}}).then(me.windowManager.open)}}},js=me=>{me.addCommand("mceImage",Di(me).open),me.addCommand("mceUpdateImage",($e,Ue)=>{me.undoManager.transact(()=>gr(me,Ue))})},Hi=me=>{const $e=me.attr("class");return Q($e)&&/\bimage\b/.test($e)},Du=me=>$e=>{let Ue=$e.length;const It=Bn=>{Bn.attr("contenteditable",me?"true":null)};for(;Ue--;){const Bn=$e[Ue];Hi(Bn)&&(Bn.attr("contenteditable",me?"false":null),nr.each(Bn.getAll("figcaption"),It))}},xd=me=>{me.on("PreInit",()=>{me.parser.addNodeFilter("figure",Du(!0)),me.serializer.addNodeFilter("figure",Du(!1))})},qn=me=>$e=>{const Ue=()=>{$e.setEnabled(me.selection.isEditable())};return me.on("NodeChange",Ue),Ue(),()=>{me.off("NodeChange",Ue)}},Zm=me=>{me.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Di(me).open,onSetup:$e=>{$e.setActive(Q(Lo(me)));const Ue=me.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",$e.setActive).unbind,It=qn(me)($e);return()=>{Ue(),It()}}}),me.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Di(me).open,onSetup:qn(me)}),me.ui.registry.addContextMenu("image",{update:$e=>me.selection.isEditable()&&(xo($e)||fs($e)&&!qr($e))?["image"]:[]})};var zi=()=>{o.add("image",me=>{so(me),xd(me),Zm(me),js(me)})};zi()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(z,j,ye)=>{var Pe;return ye(z,j.prototype)?!0:((Pe=z.constructor)===null||Pe===void 0?void 0:Pe.name)===j.name},t=z=>{const j=typeof z;return z===null?"null":j==="object"&&Array.isArray(z)?"array":j==="object"&&e(z,String,(ye,Pe)=>Pe.isPrototypeOf(ye))?"string":j},s=z=>j=>t(j)===z,a=z=>j=>typeof j===z,l=z=>j=>z===j,u=s("string"),d=s("array"),h=a("boolean"),b=l(void 0),y=z=>z==null,C=z=>!y(z),E=a("function"),R=a("number"),$=()=>{},Q=(z,j)=>ye=>z(j(ye)),F=z=>()=>z,U=z=>z,K=(z,j)=>z===j;function L(z,...j){return(...ye)=>{const Pe=j.concat(ye);return z.apply(null,Pe)}}const te=z=>{z()},ne=F(!1),oe=F(!0);class G{constructor(j,ye){this.tag=j,this.value=ye}static some(j){return new G(!0,j)}static none(){return G.singletonNone}fold(j,ye){return this.tag?ye(this.value):j()}isSome(){return this.tag}isNone(){return!this.tag}map(j){return this.tag?G.some(j(this.value)):G.none()}bind(j){return this.tag?j(this.value):G.none()}exists(j){return this.tag&&j(this.value)}forall(j){return!this.tag||j(this.value)}filter(j){return!this.tag||j(this.value)?this:G.none()}getOr(j){return this.tag?this.value:j}or(j){return this.tag?this:j}getOrThunk(j){return this.tag?this.value:j()}orThunk(j){return this.tag?this:j()}getOrDie(j){if(this.tag)return this.value;throw new Error(j!=null?j:"Called getOrDie on None")}static from(j){return C(j)?G.some(j):G.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(j){this.tag&&j(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}G.singletonNone=new G(!1);const we=Object.keys,ve=Object.hasOwnProperty,Re=(z,j)=>{const ye=we(z);for(let Pe=0,ct=ye.length;Pe<ct;Pe++){const Ft=ye[Pe],Sn=z[Ft];j(Sn,Ft)}},Oe=z=>(j,ye)=>{z[ye]=j},ce=(z,j,ye,Pe)=>{Re(z,(ct,Ft)=>{(j(ct,Ft)?ye:Pe)(ct,Ft)})},Xe=(z,j)=>{const ye={};return ce(z,j,Oe(ye),$),ye},tt=(z,j)=>{const ye=[];return Re(z,(Pe,ct)=>{ye.push(j(Pe,ct))}),ye},ot=z=>tt(z,U),V=z=>we(z).length,ut=(z,j)=>Qe(z,j)?G.from(z[j]):G.none(),Qe=(z,j)=>ve.call(z,j),Bt=(z,j)=>Qe(z,j)&&z[j]!==void 0&&z[j]!==null,Ct=z=>{for(const j in z)if(ve.call(z,j))return!1;return!0},He=Array.prototype.indexOf,st=Array.prototype.push,rn=(z,j)=>He.call(z,j),Et=(z,j)=>rn(z,j)>-1,Cn=(z,j)=>{for(let ye=0,Pe=z.length;ye<Pe;ye++){const ct=z[ye];if(j(ct,ye))return!0}return!1},je=(z,j)=>{const ye=[];for(let Pe=0;Pe<z;Pe++)ye.push(j(Pe));return ye},mt=(z,j)=>{const ye=z.length,Pe=new Array(ye);for(let ct=0;ct<ye;ct++){const Ft=z[ct];Pe[ct]=j(Ft,ct)}return Pe},he=(z,j)=>{for(let ye=0,Pe=z.length;ye<Pe;ye++){const ct=z[ye];j(ct,ye)}},Zo=(z,j)=>{for(let ye=z.length-1;ye>=0;ye--){const Pe=z[ye];j(Pe,ye)}},Kn=(z,j)=>{const ye=[],Pe=[];for(let ct=0,Ft=z.length;ct<Ft;ct++){const Sn=z[ct];(j(Sn,ct)?ye:Pe).push(Sn)}return{pass:ye,fail:Pe}},so=(z,j)=>{const ye=[];for(let Pe=0,ct=z.length;Pe<ct;Pe++){const Ft=z[Pe];j(Ft,Pe)&&ye.push(Ft)}return ye},Yo=(z,j,ye)=>(Zo(z,(Pe,ct)=>{ye=j(ye,Pe,ct)}),ye),as=(z,j,ye)=>(he(z,(Pe,ct)=>{ye=j(ye,Pe,ct)}),ye),kt=(z,j,ye)=>{for(let Pe=0,ct=z.length;Pe<ct;Pe++){const Ft=z[Pe];if(j(Ft,Pe))return G.some(Ft);if(ye(Ft,Pe))break}return G.none()},jt=(z,j)=>kt(z,j,ne),pt=z=>{const j=[];for(let ye=0,Pe=z.length;ye<Pe;++ye){if(!d(z[ye]))throw new Error("Arr.flatten item "+ye+" was not an array, input: "+z);st.apply(j,z[ye])}return j},Ne=(z,j)=>pt(mt(z,j)),Gt=(z,j)=>{for(let ye=0,Pe=z.length;ye<Pe;++ye){const ct=z[ye];if(j(ct,ye)!==!0)return!1}return!0},bn=(z,j)=>{const ye={};for(let Pe=0,ct=z.length;Pe<ct;Pe++){const Ft=z[Pe];ye[String(Ft)]=j(Ft,Pe)}return ye},At=(z,j)=>j>=0&&j<z.length?G.some(z[j]):G.none(),An=z=>At(z,0),zn=z=>At(z,z.length-1),ps=(z,j)=>{for(let ye=0;ye<z.length;ye++){const Pe=j(z[ye],ye);if(Pe.isSome())return Pe}return G.none()},oo=8,Ss=9,Mr=11,$s=1,tr=3,Xs=(z,j)=>{const Pe=(j||document).createElement("div");if(Pe.innerHTML=z,!Pe.hasChildNodes()||Pe.childNodes.length>1){const ct="HTML does not have a single root node";throw console.error(ct,z),new Error(ct)}return Ns(Pe.childNodes[0])},wa=(z,j)=>{const Pe=(j||document).createElement(z);return Ns(Pe)},dr=(z,j)=>{const Pe=(j||document).createTextNode(z);return Ns(Pe)},Ns=z=>{if(z==null)throw new Error("Node cannot be null or undefined");return{dom:z}},$o={fromHtml:Xs,fromTag:wa,fromText:dr,fromDom:Ns,fromPoint:(z,j,ye)=>G.from(z.dom.elementFromPoint(j,ye)).map(Ns)},Po=(z,j)=>{const ye=z.dom;if(ye.nodeType!==$s)return!1;{const Pe=ye;if(Pe.matches!==void 0)return Pe.matches(j);if(Pe.msMatchesSelector!==void 0)return Pe.msMatchesSelector(j);if(Pe.webkitMatchesSelector!==void 0)return Pe.webkitMatchesSelector(j);if(Pe.mozMatchesSelector!==void 0)return Pe.mozMatchesSelector(j);throw new Error("Browser lacks native selectors")}},Rr=z=>z.nodeType!==$s&&z.nodeType!==Ss&&z.nodeType!==Mr||z.childElementCount===0,Ls=(z,j)=>{const ye=j===void 0?document:j.dom;return Rr(ye)?[]:mt(ye.querySelectorAll(z),$o.fromDom)},aa=(z,j)=>{const ye=j===void 0?document:j.dom;return Rr(ye)?G.none():G.from(ye.querySelector(z)).map($o.fromDom)},bs=(z,j)=>z.dom===j.dom,_a=Po;typeof window<"u"||Function("return this;")();const ln=z=>z.dom.nodeName.toLowerCase(),vs=z=>z.dom.nodeType,Qi=z=>j=>vs(j)===z,ze=z=>vs(z)===oo||ln(z)==="#comment",et=Qi($s),Tt=Qi(tr),Wt=Qi(Ss),Yn=Qi(Mr),po=z=>j=>et(j)&&ln(j)===z,wo=z=>$o.fromDom(z.dom.ownerDocument),fn=z=>Wt(z)?z:wo(z),os=z=>G.from(z.dom.parentNode).map($o.fromDom),xo=(z,j)=>{const ye=E(j)?j:ne;let Pe=z.dom;const ct=[];for(;Pe.parentNode!==null&&Pe.parentNode!==void 0;){const Ft=Pe.parentNode,Sn=$o.fromDom(Ft);if(ct.push(Sn),ye(Sn)===!0)break;Pe=Ft}return ct},fs=z=>G.from(z.dom.previousSibling).map($o.fromDom),kr=z=>G.from(z.dom.nextSibling).map($o.fromDom),Lr=z=>mt(z.dom.childNodes,$o.fromDom),Vs=(z,j)=>{const ye=z.dom.childNodes;return G.from(ye[j]).map($o.fromDom)},Yr=z=>Vs(z,0),Zi=z=>Yn(z)&&C(z.dom.host),Oi=E(Element.prototype.attachShadow)&&E(Node.prototype.getRootNode)?z=>$o.fromDom(z.dom.getRootNode()):fn,Ge=z=>{const j=Oi(z);return Zi(j)?G.some(j):G.none()},qe=z=>$o.fromDom(z.dom.host),Nt=z=>{const j=Tt(z)?z.dom.parentNode:z.dom;if(j==null||j.ownerDocument===null)return!1;const ye=j.ownerDocument;return Ge($o.fromDom(j)).fold(()=>ye.body.contains(j),Q(Nt,qe))};var Ut=(z,j,ye,Pe,ct)=>z(ye,Pe)?G.some(ye):E(ct)&&ct(ye)?G.none():j(ye,Pe,ct);const bo=(z,j,ye)=>{let Pe=z.dom;const ct=E(ye)?ye:ne;for(;Pe.parentNode;){Pe=Pe.parentNode;const Ft=$o.fromDom(Pe);if(j(Ft))return G.some(Ft);if(ct(Ft))break}return G.none()},Lo=(z,j,ye)=>Ut((ct,Ft)=>Ft(ct),bo,z,j,ye),Go=(z,j)=>{const ye=ct=>j($o.fromDom(ct));return jt(z.dom.childNodes,ye).map($o.fromDom)},ei=(z,j,ye)=>bo(z,Pe=>Po(Pe,j),ye),lt=(z,j)=>Go(z,ye=>Po(ye,j)),Xo=(z,j)=>aa(j,z),Ni=(z,j,ye)=>Ut((ct,Ft)=>Po(ct,Ft),ei,z,j,ye),la=z=>Ni(z,"[contenteditable]"),ma=(z,j=!1)=>Nt(z)?z.dom.isContentEditable:la(z).fold(F(j),ye=>gr(ye)==="true"),gr=z=>z.dom.contentEditable,Fc=z=>z.nodeName.toLowerCase(),Cc=z=>$o.fromDom(z.getBody()),nl=z=>j=>bs(j,Cc(z)),ga=z=>z?z.replace(/px$/,""):"",nr=z=>/^\d+(\.\d+)?$/.test(z)?z+"px":z,Ar=z=>$o.fromDom(z.selection.getStart()),Ki=z=>$o.fromDom(z.selection.getEnd()),gl=z=>Lo(z,po("table")).forall(ma),kc=(z,j)=>so(Lr(z),j),nu=(z,j)=>{let ye=[];return he(Lr(z),Pe=>{j(Pe)&&(ye=ye.concat([Pe])),ye=ye.concat(nu(Pe,j))}),ye},xu=(z,j)=>kc(z,ye=>Po(ye,j)),yr=(z,j)=>Ls(j,z),ol=(z,j,ye)=>{if(u(ye)||h(ye)||R(ye))z.setAttribute(j,ye+"");else throw console.error("Invalid call to Attribute.set. Key ",j,":: Value ",ye,":: Element ",z),new Error("Attribute value was not simple")},Tu=(z,j,ye)=>{ol(z.dom,j,ye)},ou=(z,j)=>{const ye=z.dom;Re(j,(Pe,ct)=>{ol(ye,ct,Pe)})},Yl=(z,j)=>{const ye=z.dom.getAttribute(j);return ye===null?void 0:ye},Aa=(z,j)=>G.from(Yl(z,j)),Dr=(z,j)=>{z.dom.removeAttribute(j)},Qm=z=>as(z.dom.attributes,(j,ye)=>(j[ye.name]=ye.value,j),{}),xf=(z,j,ye=K)=>z.exists(Pe=>ye(Pe,j)),xr=z=>{const j=[],ye=Pe=>{j.push(Pe)};for(let Pe=0;Pe<z.length;Pe++)z[Pe].each(ye);return j},Za=(z,j,ye)=>z.isSome()&&j.isSome()?G.some(ye(z.getOrDie(),j.getOrDie())):G.none(),ca=z=>z.bind(U),Ji=(z,j)=>z?G.some(j):G.none(),Eu=(z,j)=>z.substring(j),Qc=(z,j,ye)=>j===""||z.length>=j.length&&z.substr(ye,ye+j.length)===j,Ha=(z,j)=>Zc(z,j)?Eu(z,j.length):z,Zc=(z,j)=>Qc(z,j,0),Cd=(z=>j=>j.replace(z,""))(/^\s+|\s+$/g),Yf=z=>z.length>0,Au=z=>!Yf(z),Xl=(z,j=10)=>{const ye=parseInt(z,j);return isNaN(ye)?G.none():G.some(ye)},Hc=z=>{const j=parseFloat(z);return isNaN(j)?G.none():G.some(j)},Tf=z=>z.style!==void 0&&E(z.style.getPropertyValue),su=(z,j,ye)=>{if(!u(ye))throw console.error("Invalid call to CSS.set. Property ",j,":: Value ",ye,":: Element ",z),new Error("CSS value must be a string: "+ye);Tf(z)&&z.style.setProperty(j,ye)},kd=(z,j)=>{Tf(z)&&z.style.removeProperty(j)},De=(z,j,ye)=>{const Pe=z.dom;su(Pe,j,ye)},nt=(z,j)=>{const ye=z.dom,ct=window.getComputedStyle(ye).getPropertyValue(j);return ct===""&&!Nt(z)?bt(ye,j):ct},bt=(z,j)=>Tf(z)?z.style.getPropertyValue(j):"",$t=(z,j)=>{const ye=z.dom,Pe=bt(ye,j);return G.from(Pe).filter(ct=>ct.length>0)},On=(z,j)=>{const ye=z.dom;kd(ye,j),xf(Aa(z,"style").map(Cd),"")&&Dr(z,"style")},Mo=(z,j,ye=0)=>Aa(z,j).map(Pe=>parseInt(Pe,10)).getOr(ye),$r=(z,j)=>ys(z,j,oe),ys=(z,j,ye)=>Ne(Lr(z),Pe=>Po(Pe,j)?ye(Pe)?[Pe]:[]:ys(Pe,j,ye)),ls=["tfoot","thead","tbody","colgroup"],Di=z=>Et(ls,z),js=(z,j)=>({rows:z,columns:j}),Hi=(z,j,ye)=>({element:z,rowspan:j,colspan:ye}),Du=(z,j,ye,Pe,ct,Ft)=>({element:z,rowspan:j,colspan:ye,row:Pe,column:ct,isLocked:Ft}),xd=(z,j,ye)=>({element:z,cells:j,section:ye}),qn=(z,j,ye,Pe)=>({startRow:z,startCol:j,finishRow:ye,finishCol:Pe}),Zm=(z,j,ye)=>({element:z,colspan:j,column:ye}),zi=(z,j)=>({element:z,columns:j}),me=(z,j,ye=ne)=>{if(ye(j))return G.none();if(Et(z,ln(j)))return G.some(j);const Pe=ct=>Po(ct,"table")||ye(ct);return ei(j,z.join(","),Pe)},$e=(z,j)=>me(["td","th"],z,j),Ue=z=>$r(z,"th,td"),It=z=>Po(z,"colgroup")?xu(z,"col"):Ne(ro(z),j=>xu(j,"col")),Bn=(z,j)=>Ni(z,"table",j),es=z=>$r(z,"tr"),ro=z=>Bn(z).fold(F([]),j=>xu(j,"colgroup")),yi=(z,j)=>mt(z,ye=>{if(ln(ye)==="colgroup"){const Pe=mt(It(ye),ct=>{const Ft=Mo(ct,"span",1);return Hi(ct,1,Ft)});return xd(ye,Pe,"colgroup")}else{const Pe=mt(Ue(ye),ct=>{const Ft=Mo(ct,"rowspan",1),Sn=Mo(ct,"colspan",1);return Hi(ct,Ft,Sn)});return xd(ye,Pe,j(ye))}}),gn=z=>os(z).map(j=>{const ye=ln(j);return Di(ye)?ye:"tbody"}).getOr("tbody"),Gr=z=>{const j=es(z),Pe=[...ro(z),...j];return yi(Pe,gn)},Ll="data-snooker-locked-cols",ea=z=>Aa(z,Ll).bind(j=>G.from(j.match(/\d+/g))).map(j=>bn(j,oe)),ri=(z,j)=>z+","+j,Ef=(z,j,ye)=>G.from(z.access[ri(j,ye)]),ks=(z,j,ye)=>{const Pe=ru(z,ct=>ye(j,ct.element));return Pe.length>0?G.some(Pe[0]):G.none()},ru=(z,j)=>{const ye=Ne(z.all,Pe=>Pe.cells);return so(ye,j)},Pi=z=>{const j={};let ye=0;return he(z.cells,Pe=>{const ct=Pe.colspan;je(ct,Ft=>{const Sn=ye+Ft;j[Sn]=Zm(Pe.element,ct,Sn)}),ye+=ct}),j},uc=z=>{const j={},ye=[],ct=An(z).map(Uc=>Uc.element).bind(Bn).bind(ea).getOr({});let Ft=0,Sn=0,In=0;const{pass:Uo,fail:ts}=Kn(z,Uc=>Uc.section==="colgroup");he(ts,Uc=>{const cu=[];he(Uc.cells,rf=>{let Nf=0;for(;j[ri(In,Nf)]!==void 0;)Nf++;const dh=Bt(ct,Nf.toString()),hh=Du(rf.element,rf.rowspan,rf.colspan,In,Nf,dh);for(let hr=0;hr<rf.colspan;hr++)for(let Gm=0;Gm<rf.rowspan;Gm++){const Km=In+Gm,oa=Nf+hr,uu=ri(Km,oa);j[uu]=hh,Sn=Math.max(Sn,oa+1)}cu.push(hh)}),Ft++,ye.push(xd(Uc.element,cu,Uc.section)),In++});const{columns:Si,colgroups:sr}=zn(Uo).map(Uc=>{const cu=Pi(Uc);return{colgroups:[zi(Uc.element,ot(cu))],columns:cu}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:js(Ft,Sn),access:j,all:ye,columns:Si,colgroups:sr}},Gu={fromTable:z=>{const j=Gr(z);return uc(j)},generate:uc,getAt:Ef,findItem:ks,filterItems:ru,justCells:z=>Ne(z.all,j=>j.cells),justColumns:z=>ot(z.columns),hasColumns:z=>we(z.columns).length>0,getColumnAt:(z,j)=>G.from(z.columns[j])};var Ku=tinymce.util.Tools.resolve("tinymce.util.Tools");const Tc=(z,j,ye)=>{const Pe=z.select("td,th",j);let ct;for(let Ft=0;Ft<Pe.length;Ft++){const Sn=z.getStyle(Pe[Ft],ye);if(b(ct)&&(ct=Sn),ct!==Sn)return""}return ct},qf=(z,j,ye)=>{Ku.each("left center right".split(" "),Pe=>{Pe!==ye&&z.formatter.remove("align"+Pe,{},j)}),ye&&z.formatter.apply("align"+ye,{},j)},eh=(z,j,ye)=>{Ku.each("top middle bottom".split(" "),Pe=>{Pe!==ye&&z.formatter.remove("valign"+Pe,{},j)}),ye&&z.formatter.apply("valign"+ye,{},j)},ti=(z,j,ye)=>{z.dispatch("TableModified",{...ye,table:j})},ta=(z,j)=>Hc(z).getOr(j),za=(z,j,ye)=>ta(nt(z,j),ye),Kb=(z,j,ye,Pe)=>{const ct=za(z,`padding-${ye}`,0),Ft=za(z,`padding-${Pe}`,0),Sn=za(z,`border-${ye}-width`,0),In=za(z,`border-${Pe}-width`,0);return j-ct-Ft-Sn-In},Mi=(z,j)=>{const ye=z.dom,Pe=ye.getBoundingClientRect().width||ye.offsetWidth;return j==="border-box"?Pe:Kb(z,Pe,"left","right")},sl=z=>Mi(z,"content-box");var Zg=tinymce.util.Tools.resolve("tinymce.Env");const Gf="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Ec=je(5,z=>{const j=`${z+1}px`;return{title:j,value:j}}),Af=mt(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],z=>({title:z,value:z.toLowerCase()})),Pr="100%",Ju=z=>{var j;const ye=z.dom,Pe=(j=ye.getParent(z.selection.getStart(),ye.isBlock))!==null&&j!==void 0?j:z.getBody();return sl($o.fromDom(Pe))+"px"},Fl=(z,j)=>Vm(z)||!Df(z)?j:zp(z)?{...j,width:Ju(z)}:{...j,width:Pr},Va=(z,j)=>Vm(z)||Df(z)?j:zp(z)?{...j,width:Ju(z)}:{...j,width:Pr},qi=z=>j=>j.options.get(z),Vi=z=>{const j=z.options.register;j("table_border_widths",{processor:"object[]",default:Ec}),j("table_border_styles",{processor:"object[]",default:Af}),j("table_cell_advtab",{processor:"boolean",default:!0}),j("table_row_advtab",{processor:"boolean",default:!0}),j("table_advtab",{processor:"boolean",default:!0}),j("table_appearance_options",{processor:"boolean",default:!0}),j("table_grid",{processor:"boolean",default:!Zg.deviceType.isTouch()}),j("table_cell_class_list",{processor:"object[]",default:[]}),j("table_row_class_list",{processor:"object[]",default:[]}),j("table_class_list",{processor:"object[]",default:[]}),j("table_toolbar",{processor:"string",default:Gf}),j("table_background_color_map",{processor:"object[]",default:[]}),j("table_border_color_map",{processor:"object[]",default:[]})},fc=qi("table_sizing_mode"),Kf=qi("table_border_widths"),th=qi("table_border_styles"),Hg=qi("table_cell_advtab"),Hm=qi("table_row_advtab"),Ql=qi("table_advtab"),zm=qi("table_appearance_options"),rl=qi("table_grid"),Df=qi("table_style_by_css"),jh=qi("table_cell_class_list"),ef=qi("table_row_class_list"),qh=qi("table_class_list"),zc=qi("table_toolbar"),Gh=qi("table_background_color_map"),Pf=qi("table_border_color_map"),zp=z=>fc(z)==="fixed",Vm=z=>fc(z)==="responsive",Jf=z=>{const j=z.options,ye=j.get("table_default_styles");return j.isSet("table_default_styles")?ye:Fl(z,ye)},jl=z=>{const j=z.options,ye=j.get("table_default_attributes");return j.isSet("table_default_attributes")?ye:Va(z,ye)},zg=(z,j)=>j.column>=z.startCol&&j.column+j.colspan-1<=z.finishCol&&j.row>=z.startRow&&j.row+j.rowspan-1<=z.finishRow,Ke=(z,j)=>{let ye=!0;const Pe=L(zg,j);for(let ct=j.startRow;ct<=j.finishRow;ct++)for(let Ft=j.startCol;Ft<=j.finishCol;Ft++)ye=ye&&Gu.getAt(z,ct,Ft).exists(Pe);return ye?G.some(j):G.none()},nh=(z,j)=>qn(Math.min(z.row,j.row),Math.min(z.column,j.column),Math.max(z.row+z.rowspan-1,j.row+j.rowspan-1),Math.max(z.column+z.colspan-1,j.column+j.colspan-1)),Pu=(z,j,ye)=>{const Pe=Gu.findItem(z,j,bs),ct=Gu.findItem(z,ye,bs);return Pe.bind(Ft=>ct.map(Sn=>nh(Ft,Sn)))},Vg=(z,j,ye)=>Pu(z,j,ye).bind(Pe=>Ke(z,Pe)),U1=(z,j,ye)=>{const Pe=Kh(z);return Vg(Pe,j,ye)},Kh=Gu.fromTable,vt=(z,j)=>{os(z).each(Pe=>{Pe.dom.insertBefore(j.dom,z.dom)})},cn=(z,j)=>{kr(z).fold(()=>{os(z).each(ct=>{Eo(ct,j)})},Pe=>{vt(Pe,j)})},an=(z,j)=>{Yr(z).fold(()=>{Eo(z,j)},Pe=>{z.dom.insertBefore(j.dom,Pe.dom)})},Eo=(z,j)=>{z.dom.appendChild(j.dom)},or=(z,j)=>{vt(z,j),Eo(j,z)},Xr=(z,j)=>{he(j,(ye,Pe)=>{const ct=Pe===0?z:j[Pe-1];cn(ct,ye)})},fi=(z,j)=>{he(j,ye=>{Eo(z,ye)})},wi=z=>{const j=z.dom;j.parentNode!==null&&j.parentNode.removeChild(j)},oh=z=>{const j=Lr(z);j.length>0&&Xr(z,j),wi(z)},Sa=((z,j)=>{const ye=Ft=>{if(!z(Ft))throw new Error("Can only get "+j+" value of a "+j+" node");return Pe(Ft).getOr("")},Pe=Ft=>z(Ft)?G.from(Ft.dom.nodeValue):G.none();return{get:ye,getOption:Pe,set:(Ft,Sn)=>{if(!z(Ft))throw new Error("Can only set raw "+j+" value of a "+j+" node");Ft.dom.nodeValue=Sn}}})(Tt,"text"),Td=z=>Sa.get(z),Wg=(z,j)=>Sa.set(z,j);var il=["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"],Da=()=>{const z=ts=>$o.fromDom(ts.dom.cloneNode(!1)),j=ts=>fn(ts).dom,ye=ts=>et(ts)?ln(ts)==="body"?!0:Et(il,ln(ts)):!1,Pe=ts=>et(ts)?Et(["br","img","hr","input"],ln(ts)):!1,ct=ts=>et(ts)&&Yl(ts,"contenteditable")==="false",Ft=(ts,Si)=>ts.dom.compareDocumentPosition(Si.dom),Sn=(ts,Si)=>{const sr=Qm(ts);ou(Si,sr)},In=ts=>{const Si=ln(ts);return Et(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],Si)},Uo=ts=>et(ts)?Aa(ts,"lang"):G.none();return{up:F({selector:ei,closest:Ni,predicate:bo,all:xo}),down:F({selector:yr,predicate:nu}),styles:F({get:nt,getRaw:$t,set:De,remove:On}),attrs:F({get:Yl,set:Tu,remove:Dr,copyTo:Sn}),insert:F({before:vt,after:cn,afterAll:Xr,append:Eo,appendAll:fi,prepend:an,wrap:or}),remove:F({unwrap:oh,remove:wi}),create:F({nu:$o.fromTag,clone:z,text:$o.fromText}),query:F({comparePosition:Ft,prevSibling:fs,nextSibling:kr}),property:F({children:Lr,name:ln,parent:os,document:j,isText:Tt,isComment:ze,isElement:et,isSpecial:In,getLanguage:Uo,getText:Td,setText:Wg,isBoundary:ye,isEmptyTag:Pe,isNonEditable:ct}),eq:bs,is:_a}};const tf=(z,j,ye,Pe)=>{const ct=ye[0],Ft=ye.slice(1);return Pe(z,j,ct,Ft)},ii=(z,j,ye)=>ye.length>0?tf(z,j,ye,Mu):G.none(),Mu=(z,j,ye,Pe)=>{const ct=j(z,ye);return Yo(Pe,(Ft,Sn)=>{const In=j(z,Sn);return dc(z,Ft,In)},ct)},dc=(z,j,ye)=>j.bind(Pe=>ye.filter(L(z.eq,Pe))),Jh=ii,Y1=Da(),sh=(z,j)=>Jh(Y1,(ye,Pe)=>z(Pe),j),Ug=z=>ei(z,"table"),rh=(z,j)=>{const ye=yr(z,j);return ye.length>0?G.some(ye):G.none()},ql=(z,j,ye)=>Xo(z,j).bind(Pe=>Xo(z,ye).bind(ct=>sh(Ug,[Pe,ct]).map(Ft=>({first:Pe,last:ct,table:Ft})))),em=(z,j)=>rh(z,j),X1=(z,j,ye)=>ql(z,j,ye).bind(Pe=>{const ct=Uo=>bs(z,Uo),Ft="thead,tfoot,tbody,table",Sn=ei(Pe.first,Ft,ct),In=ei(Pe.last,Ft,ct);return Sn.bind(Uo=>In.bind(ts=>bs(Uo,ts)?U1(Pe.table,Pe.first,Pe.last):G.none()))}),Wm=z=>mt(z,$o.fromDom),Yg="data-mce-selected",tm="td["+Yg+"],th["+Yg+"]",ih="data-mce-first-selected",Ed="td["+ih+"],th["+ih+"]",ai="data-mce-last-selected",di="td["+ai+"],th["+ai+"]",Zl={selected:Yg,selectedSelector:tm,firstSelected:ih,firstSelectedSelector:Ed,lastSelected:ai,lastSelectedSelector:di},Vp=z=>Bn(z).bind(j=>em(j,Zl.firstSelectedSelector)).fold(F(z),j=>j[0]),ee=z=>(j,ye)=>{const Pe=ln(j),ct=Pe==="col"||Pe==="colgroup"?Vp(j):j;return Ni(ct,z,ye)},ue=ee("th,td,caption"),Se=ee("th,td"),Je=z=>Wm(z.model.table.getSelectedCells()),at=(z,j)=>{const ye=Se(z),Pe=ye.bind(ct=>Bn(ct)).map(ct=>es(ct));return Za(ye,Pe,(ct,Ft)=>so(Ft,Sn=>Cn(Wm(Sn.dom.cells),In=>Yl(In,j)==="1"||bs(In,ct)))).getOr([])},Dn=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],wn=z=>({value:Tr(z)}),Ko=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ss=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,vo=z=>Ko.test(z)||ss.test(z),Tr=z=>Ha(z,"#").toUpperCase(),Gl=z=>vo(z)?G.some({value:Tr(z)}):G.none(),ua=z=>{const j=z.toString(16);return(j.length===1?"0"+j:j).toUpperCase()},Bi=z=>{const j=ua(z.red)+ua(z.green)+ua(z.blue);return wn(j)},Ru=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Pa=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,nm=(z,j,ye,Pe)=>({red:z,green:j,blue:ye,alpha:Pe}),Um=(z,j,ye,Pe)=>{const ct=parseInt(z,10),Ft=parseInt(j,10),Sn=parseInt(ye,10),In=parseFloat(Pe);return nm(ct,Ft,Sn,In)},Wi=z=>{if(z==="transparent")return G.some(nm(0,0,0,0));const j=Ru.exec(z);if(j!==null)return G.some(Um(j[1],j[2],j[3],"1"));const ye=Pa.exec(z);return ye!==null?G.some(Um(ye[1],ye[2],ye[3],ye[4])):G.none()},Ca=z=>Gl(z).orThunk(()=>Wi(z).map(Bi)).getOrThunk(()=>{const j=document.createElement("canvas");j.height=1,j.width=1;const ye=j.getContext("2d");ye.clearRect(0,0,j.width,j.height),ye.fillStyle="#FFFFFF",ye.fillStyle=z,ye.fillRect(0,0,1,1);const Pe=ye.getImageData(0,0,1,1).data,ct=Pe[0],Ft=Pe[1],Sn=Pe[2],In=Pe[3];return Bi(nm(ct,Ft,Sn,In))}),iu=z=>Wi(z).map(Bi).map(j=>"#"+j.value).getOr(z),ah=z=>{let j=z;return{get:()=>j,set:ct=>{j=ct}}},na=z=>{const j=ah(G.none()),ye=()=>j.get().each(z);return{clear:()=>{ye(),j.set(G.none())},isSet:()=>j.get().isSome(),get:()=>j.get(),set:In=>{ye(),j.set(G.some(In))}}},e0=()=>na(z=>z.unbind()),Dv=(z,j,ye)=>Pe=>{const ct=e0(),Ft=Au(ye),Sn=()=>{const In=Je(z),Uo=ts=>z.formatter.match(j,{value:ye},ts.dom,Ft);Ft?(Pe.setActive(!Cn(In,Uo)),ct.set(z.formatter.formatChanged(j,ts=>Pe.setActive(!ts),!0))):(Pe.setActive(Gt(In,Uo)),ct.set(z.formatter.formatChanged(j,Pe.setActive,!1,{value:ye})))};return z.initialized?Sn():z.on("init",Sn),ct.clear},ni=z=>Bt(z,"menu"),Ad=z=>mt(z,j=>{const ye=j.text||j.title||"";return ni(j)?{text:ye,items:Ad(j.menu)}:{text:ye,value:j.value}}),wr=(z,j,ye,Pe)=>mt(j,ct=>{const Ft=ct.text||ct.title;return ni(ct)?{type:"nestedmenuitem",text:Ft,getSubmenuItems:()=>wr(z,ct.menu,ye,Pe)}:{text:Ft,type:"togglemenuitem",onAction:()=>Pe(ct.value),onSetup:Dv(z,ye,ct.value)}}),Kl=(z,j)=>ye=>{z.execCommand("mceTableApplyCellStyle",!1,{[j]:ye})},ed=z=>Ne(z,j=>ni(j)?[{...j,menu:ed(j.menu)}]:Yf(j.value)?[j]:[]),lh=(z,j,ye,Pe)=>ct=>ct(wr(z,j,ye,Pe)),Ae=(z,j,ye)=>{const Pe=mt(j,ct=>({text:ct.title,value:"#"+Ca(ct.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Pe.length>0?Pe:void 0,allowCustomColors:!1},onAction:ct=>{const Ft=ct.value==="remove"?"":ct.value;z.execCommand("mceTableApplyCellStyle",!1,{[ye]:Ft})}}]},Mf=z=>()=>{const ye=z.queryCommandValue("mceTableRowType")==="header"?"body":"header";z.execCommand("mceTableRowType",!1,{type:ye})},Xg=z=>()=>{const ye=z.queryCommandValue("mceTableColType")==="th"?"td":"th";z.execCommand("mceTableColType",!1,{type:ye})},$u=z=>{const j=Ad(jh(z));return j.length>0?G.some({name:"class",type:"listbox",label:"Class",items:j}):G.none()},hi=[{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:Dn}],Pv=z=>hi.concat($u(z).toArray()),j1=(z,j)=>{const Pe=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Ad(th(z)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:j==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(Pe):Pe}},td={normal:(z,j)=>{const ye=z.dom;return{setAttrib:(Sn,In)=>{ye.setAttrib(j,Sn,In)},setStyle:(Sn,In)=>{ye.setStyle(j,Sn,In)},setFormat:(Sn,In)=>{In===""?z.formatter.remove(Sn,{value:null},j,!0):z.formatter.apply(Sn,{value:In},j)}}}},Ym=po("th"),jg=(z,j)=>z&&j?"sectionCells":z?"section":"cells",Mv=z=>{const j=z.section==="thead",ye=xf(Rf(z.cells),"th");return z.section==="tfoot"?{type:"footer"}:j||ye?{type:"header",subType:jg(j,ye)}:{type:"body"}},Rf=z=>{const j=so(z,ye=>Ym(ye.element));return j.length===0?G.some("td"):j.length===z.length?G.some("th"):G.none()},xy=z=>{const j=mt(z,ct=>Mv(ct).type),ye=Et(j,"header"),Pe=Et(j,"footer");if(!ye&&!Pe)return G.some("body");{const ct=Et(j,"body");return ye&&!ct&&!Pe?G.some("header"):!ye&&!ct&&Pe?G.some("footer"):G.none()}},Nu=z=>{let j=!1,ye;return(...Pe)=>(j||(j=!0,ye=z.apply(null,Pe)),ye)},nf=(z,j)=>ps(z.all,ye=>jt(ye.cells,Pe=>bs(j,Pe.element))),n0=(z,j,ye)=>{const Pe=mt(j.selection,Ft=>$e(Ft).bind(Sn=>nf(z,Sn)).filter(ye)),ct=xr(Pe);return Ji(ct.length>0,ct)},o0=(z,j)=>j.mergable,s0=(z,j)=>j.unmergable,q1=(z,j)=>n0(z,j,oe),nd=(z,j)=>nf(z,j).exists(ye=>!ye.isLocked),r0=(z,j)=>Gt(j,ye=>nd(z,ye)),i0=(z,j)=>o0(z,j).filter(ye=>r0(z,ye.cells)),pl=(z,j)=>s0(z,j).filter(ye=>r0(z,ye));({...{generate:z=>{if(!d(z))throw new Error("cases must be an array");if(z.length===0)throw new Error("there must be at least one case");const j=[],ye={};return he(z,(Pe,ct)=>{const Ft=we(Pe);if(Ft.length!==1)throw new Error("one and only one name per case");const Sn=Ft[0],In=Pe[Sn];if(ye[Sn]!==void 0)throw new Error("duplicate key detected:"+Sn);if(Sn==="cata")throw new Error("cannot have a case named cata (sorry)");if(!d(In))throw new Error("case arguments must be an array");j.push(Sn),ye[Sn]=(...Uo)=>{const ts=Uo.length;if(ts!==In.length)throw new Error("Wrong number of arguments to case "+Sn+". Expected "+In.length+" ("+In+"), got "+ts);return{fold:(...sr)=>{if(sr.length!==z.length)throw new Error("Wrong number of arguments to fold. Expected "+z.length+", got "+sr.length);return sr[ct].apply(null,Uo)},match:sr=>{const _r=we(sr);if(j.length!==_r.length)throw new Error("Wrong number of arguments to match. Expected: "+j.join(",")+`
|
|
Actual: `+_r.join(","));if(!Gt(j,cu=>Et(_r,cu)))throw new Error("Not all branches were specified when using match. Specified: "+_r.join(", ")+`
|
|
Required: `+j.join(", "));return sr[Sn].apply(null,Uo)},log:sr=>{console.log(sr,{constructors:j,constructor:Sn,params:Uo})}}}}),ye}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Jn=(z,j)=>{const ye=Gu.fromTable(z);return q1(ye,j).bind(ct=>{const Ft=ct[ct.length-1],Sn=ct[0].row,In=Ft.row+Ft.rowspan,Uo=ye.all.slice(Sn,In);return xy(Uo)}).getOr("")},Ac=z=>Zc(z,"rgb")?iu(z):z,$f=z=>{const j=$o.fromDom(z);return{borderwidth:$t(j,"border-width").getOr(""),borderstyle:$t(j,"border-style").getOr(""),bordercolor:$t(j,"border-color").map(Ac).getOr(""),backgroundcolor:$t(j,"background-color").map(Ac).getOr("")}},ch=z=>{const j=z[0],ye=z.slice(1);return he(ye,Pe=>{he(we(j),ct=>{Re(Pe,(Ft,Sn)=>{const In=j[ct];In!==""&&ct===Sn&&In!==Ft&&(j[ct]="")})})}),j},Vc=(z,j,ye,Pe)=>jt(z,ct=>!b(ye.formatter.matchNode(Pe,j+ct))).getOr(""),qg=L(Vc,["left","center","right"],"align"),Pd=L(Vc,["top","middle","bottom"],"valign"),bl=(z,j)=>{const ye=Jf(z),Pe=jl(z),ct=()=>({borderstyle:ut(ye,"border-style").getOr(""),bordercolor:Ac(ut(ye,"border-color").getOr("")),backgroundcolor:Ac(ut(ye,"background-color").getOr(""))}),Ft={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},Sn=()=>{const Si=ye["border-width"];return Df(z)&&Si?{border:Si}:ut(Pe,"border").fold(()=>({}),sr=>({border:sr}))},In=j?ct():{},Uo=()=>{const Si=ut(ye,"border-spacing").or(ut(Pe,"cellspacing")).fold(()=>({}),_r=>({cellspacing:_r})),sr=ut(ye,"border-padding").or(ut(Pe,"cellpadding")).fold(()=>({}),_r=>({cellpadding:_r}));return{...Si,...sr}};return{...Ft,...ye,...Pe,...In,...Sn(),...Uo()}},Iu=z=>Bn($o.fromDom(z)).map(j=>{const ye={selection:Wm(z.cells)};return Jn(j,ye)}).getOr(""),Wp=(z,j,ye)=>{const Pe=(In,Uo)=>{const ts=$t($o.fromDom(Uo),"border-width");return Df(z)&&ts.isSome()?ts.getOr(""):In.getAttrib(Uo,"border")||Tc(z.dom,Uo,"border-width")||Tc(z.dom,Uo,"border")||""},ct=z.dom,Ft=Df(z)?ct.getStyle(j,"border-spacing")||ct.getAttrib(j,"cellspacing"):ct.getAttrib(j,"cellspacing")||ct.getStyle(j,"border-spacing"),Sn=Df(z)?Tc(ct,j,"padding")||ct.getAttrib(j,"cellpadding"):ct.getAttrib(j,"cellpadding")||Tc(ct,j,"padding");return{width:ct.getStyle(j,"width")||ct.getAttrib(j,"width"),height:ct.getStyle(j,"height")||ct.getAttrib(j,"height"),cellspacing:Ft!=null?Ft:"",cellpadding:Sn!=null?Sn:"",border:Pe(ct,j),caption:!!ct.select("caption",j)[0],class:ct.getAttrib(j,"class",""),align:qg(z,j),...ye?$f(j):{}}},G1=(z,j,ye)=>{const Pe=z.dom;return{height:Pe.getStyle(j,"height")||Pe.getAttrib(j,"height"),class:Pe.getAttrib(j,"class",""),type:Iu(j),align:qg(z,j),...ye?$f(j):{}}},_n=(z,j,ye,Pe)=>{const ct=z.dom,Ft=Pe.getOr(j),Sn=(In,Uo)=>ct.getStyle(In,Uo)||ct.getAttrib(In,Uo);return{width:Sn(Ft,"width"),height:Sn(j,"height"),scope:ct.getAttrib(j,"scope"),celltype:Fc(j),class:ct.getAttrib(j,"class",""),halign:qg(z,j),valign:Pd(z,j),...ye?$f(j):{}}},Xm=(z,j)=>{const ye=Gu.fromTable(z),Pe=Gu.justCells(ye),ct=so(Pe,Ft=>Cn(j,Sn=>bs(Ft.element,Sn)));return mt(ct,Ft=>({element:Ft.element.dom,column:Gu.getColumnAt(ye,Ft.column).map(Sn=>Sn.element.dom)}))},Md=(z,j,ye,Pe)=>{Pe("scope")&&z.setAttrib("scope",ye.scope),Pe("class")&&z.setAttrib("class",ye.class),Pe("height")&&z.setStyle("height",nr(ye.height)),Pe("width")&&j.setStyle("width",nr(ye.width))},uh=(z,j,ye)=>{ye("backgroundcolor")&&z.setFormat("tablecellbackgroundcolor",j.backgroundcolor),ye("bordercolor")&&z.setFormat("tablecellbordercolor",j.bordercolor),ye("borderstyle")&&z.setFormat("tablecellborderstyle",j.borderstyle),ye("borderwidth")&&z.setFormat("tablecellborderwidth",nr(j.borderwidth))},of=(z,j,ye,Pe)=>{const ct=j.length===1;he(j,Ft=>{const Sn=Ft.element,In=ct?oe:Pe,Uo=td.normal(z,Sn),ts=Ft.column.map(Si=>td.normal(z,Si)).getOr(Uo);Md(Uo,ts,ye,In),Hg(z)&&uh(Uo,ye,In),Pe("halign")&&qf(z,Sn,ye.halign),Pe("valign")&&eh(z,Sn,ye.valign)})},K1=(z,j)=>{z.execCommand("mceTableCellType",!1,{type:j.celltype,no_events:!0})},mi=(z,j,ye,Pe)=>{const ct=Xe(Pe,(Ft,Sn)=>ye[Sn]!==Ft);V(ct)>0&&j.length>=1&&Bn(j[0]).each(Ft=>{const Sn=Xm(Ft,j),In=V(Xe(ct,(ts,Si)=>Si!=="scope"&&Si!=="celltype"))>0,Uo=Qe(ct,"celltype");(In||Qe(ct,"scope"))&&of(z,Sn,Pe,L(Qe,ct)),Uo&&K1(z,Pe),ti(z,Ft.dom,{structure:Uo,style:In})})},Ui=(z,j,ye,Pe)=>{const ct=Pe.getData();Pe.close(),z.undoManager.transact(()=>{mi(z,j,ye,ct),z.focus()})},ba=(z,j)=>{const ye=Bn(j[0]).map(Pe=>mt(Xm(Pe,j),ct=>_n(z,ct.element,Hg(z),ct.column)));return ch(ye.getOrDie())},Es=z=>{const j=Je(z);if(j.length===0)return;const ye=ba(z,j),Pe={type:"tabpanel",tabs:[{title:"General",name:"general",items:Pv(z)},j1(z,"cell")]},ct={type:"panel",items:[{type:"grid",columns:2,items:Pv(z)}]};z.windowManager.open({title:"Cell Properties",size:"normal",body:Hg(z)?Pe:ct,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ye,onSubmit:L(Ui,z,j,ye)})},Rd=z=>{const j=Ad(ef(z));return j.length>0?G.some({name:"class",type:"listbox",label:"Class",items:j}):G.none()},xl=[{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"}],sf=z=>xl.concat(Rd(z).toArray()),Wa=(z,j,ye)=>{ye("class")&&z.setAttrib("class",j.class),ye("height")&&z.setStyle("height",nr(j.height))},ka=(z,j,ye)=>{ye("backgroundcolor")&&z.setStyle("background-color",j.backgroundcolor),ye("bordercolor")&&z.setStyle("border-color",j.bordercolor),ye("borderstyle")&&z.setStyle("border-style",j.borderstyle)},Up=(z,j,ye,Pe)=>{const Ft=j.length===1?oe:Pe;he(j,Sn=>{const In=td.normal(z,Sn);Wa(In,ye,Ft),Hm(z)&&ka(In,ye,Ft),Pe("align")&&qf(z,Sn,ye.align)})},nn=(z,j)=>{z.execCommand("mceTableRowType",!1,{type:j.type,no_events:!0})},Kr=(z,j,ye,Pe)=>{const ct=Xe(Pe,(Ft,Sn)=>ye[Sn]!==Ft);if(V(ct)>0){const Ft=Qe(ct,"type"),Sn=Ft?V(ct)>1:!0;Sn&&Up(z,j,Pe,L(Qe,ct)),Ft&&nn(z,Pe),Bn($o.fromDom(j[0])).each(In=>ti(z,In.dom,{structure:Ft,style:Sn}))}},a0=(z,j,ye,Pe)=>{const ct=Pe.getData();Pe.close(),z.undoManager.transact(()=>{Kr(z,j,ye,ct),z.focus()})},xa=z=>{const j=at(Ar(z),Zl.selected);if(j.length===0)return;const ye=mt(j,Sn=>G1(z,Sn.dom,Hm(z))),Pe=ch(ye),ct={type:"tabpanel",tabs:[{title:"General",name:"general",items:sf(z)},j1(z,"row")]},Ft={type:"panel",items:[{type:"grid",columns:2,items:sf(z)}]};z.windowManager.open({title:"Row Properties",size:"normal",body:Hm(z)?ct:Ft,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Pe,onSubmit:L(a0,z,mt(j,Sn=>Sn.dom),Pe)})},Ua=(z,j,ye)=>{const Pe=ye?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],ct=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],Ft=zm(z)?[{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"}]}]:[],Sn=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],In=j.length>0?[{type:"listbox",name:"class",label:"Class",items:j}]:[];return Pe.concat(ct).concat(Ft).concat(Sn).concat(In)},Gg=(z,j,ye,Pe)=>{if(j.tagName==="TD"||j.tagName==="TH")u(ye)&&C(Pe)?z.setStyle(j,ye,Pe):z.setStyles(j,ye);else if(j.children)for(let ct=0;ct<j.children.length;ct++)Gg(z,j.children[ct],ye,Pe)},Wc=(z,j,ye,Pe)=>{const ct=z.dom,Ft={},Sn={},In=Df(z),Uo=Ql(z);if(b(ye.class)||(Ft.class=ye.class),Sn.height=nr(ye.height),In?Sn.width=nr(ye.width):ct.getAttrib(j,"width")&&(Ft.width=ga(ye.width)),In?(Sn["border-width"]=nr(ye.border),Sn["border-spacing"]=nr(ye.cellspacing)):(Ft.border=ye.border,Ft.cellpadding=ye.cellpadding,Ft.cellspacing=ye.cellspacing),In&&j.children){const ts={};if(Pe.border&&(ts["border-width"]=nr(ye.border)),Pe.cellpadding&&(ts.padding=nr(ye.cellpadding)),Uo&&Pe.bordercolor&&(ts["border-color"]=ye.bordercolor),!Ct(ts))for(let Si=0;Si<j.children.length;Si++)Gg(ct,j.children[Si],ts)}if(Uo){const ts=ye;Sn["background-color"]=ts.backgroundcolor,Sn["border-color"]=ts.bordercolor,Sn["border-style"]=ts.borderstyle}ct.setStyles(j,{...Jf(z),...Sn}),ct.setAttribs(j,{...jl(z),...Ft})},od=(z,j,ye,Pe)=>{const ct=z.dom,Ft=Pe.getData(),Sn=Xe(Ft,(In,Uo)=>ye[Uo]!==In);Pe.close(),Ft.class===""&&delete Ft.class,z.undoManager.transact(()=>{if(!j){const In=Xl(Ft.cols).getOr(1),Uo=Xl(Ft.rows).getOr(1);z.execCommand("mceInsertTable",!1,{rows:Uo,columns:In}),j=Se(Ar(z),nl(z)).bind(ts=>Bn(ts,nl(z))).map(ts=>ts.dom).getOrDie()}if(V(Sn)>0){const In={border:Qe(Sn,"border"),bordercolor:Qe(Sn,"bordercolor"),cellpadding:Qe(Sn,"cellpadding")};Wc(z,j,Ft,In);const Uo=ct.select("caption",j)[0];(Uo&&!Ft.caption||!Uo&&Ft.caption)&&z.execCommand("mceTableToggleCaption"),qf(z,j,Ft.align)}if(z.focus(),z.addVisual(),V(Sn)>0){const In=Qe(Sn,"caption"),Uo=In?V(Sn)>1:!0;ti(z,j,{structure:In,style:Uo})}})},sd=(z,j)=>{const ye=z.dom;let Pe,ct=bl(z,Ql(z));j?(ct.cols="1",ct.rows="1",Ql(z)&&(ct.borderstyle="",ct.bordercolor="",ct.backgroundcolor="")):(Pe=ye.getParent(z.selection.getStart(),"table",z.getBody()),Pe?ct=Wp(z,Pe,Ql(z)):Ql(z)&&(ct.borderstyle="",ct.bordercolor="",ct.backgroundcolor=""));const Ft=Ad(qh(z));Ft.length>0&&ct.class&&(ct.class=ct.class.replace(/\s*mce\-item\-table\s*/g,""));const Sn={type:"grid",columns:2,items:Ua(z,Ft,j)},In=()=>({type:"panel",items:[Sn]}),Uo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[Sn]},j1(z,"table")]}),ts=Ql(z)?Uo():In();z.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:L(od,z,Pe,ct),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ct})},Yp=z=>{const j=ye=>{gl(Ar(z))&&ye()};Re({mceTableProps:L(sd,z,!1),mceTableRowProps:L(xa,z),mceTableCellProps:L(Es,z),mceInsertTableDialog:L(sd,z,!0)},(ye,Pe)=>z.addCommand(Pe,()=>j(ye)))},Hl=(z,j)=>lt(z,j).isSome(),Er=U,Ya=z=>{const j=(Pe,ct)=>Aa(Pe,ct).exists(Ft=>parseInt(Ft,10)>1),ye=Pe=>j(Pe,"rowspan")||j(Pe,"colspan");return z.length>0&&Gt(z,ye)?G.some(z):G.none()},fh=(z,j,ye)=>j.length<=1?G.none():X1(z,ye.firstSelectedSelector,ye.lastSelectedSelector).map(Pe=>({bounds:Pe,cells:j})),Jl=z=>({element:z,mergable:G.none(),unmergable:G.none(),selection:[z]}),l0=(z,j,ye)=>({element:ye,mergable:fh(j,z,Zl),unmergable:Ya(z),selection:Er(z)}),jm=z=>{const j=ah(G.none()),ye=ah([]);let Pe=G.none();const ct=po("caption"),Ft=Ps=>Pe.forall(Fr=>!Fr[Ps]),Sn=()=>ue(Ar(z),nl(z)),In=()=>ue(Ki(z),nl(z)),Uo=()=>Sn().bind(Ps=>ca(Za(Bn(Ps),In().bind(Bn),(Fr,Ma)=>bs(Fr,Ma)?ct(Ps)?G.some(Jl(Ps)):G.some(l0(Je(z),Fr,Ps)):G.none()))),ts=Ps=>Bn(Ps.element).map(Ma=>{const gc=Gu.fromTable(Ma),eb=q1(gc,Ps).getOr([]),Tl=as(eb,(Gi,fu)=>(fu.isLocked&&(Gi.onAny=!0,fu.column===0?Gi.onFirst=!0:fu.column+fu.colspan>=gc.grid.columns&&(Gi.onLast=!0)),Gi),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:i0(gc,Ps).isSome(),unmergeable:pl(gc,Ps).isSome(),locked:Tl}}),Si=()=>{j.set(Nu(Uo)()),Pe=j.get().bind(ts),he(ye.get(),te)},sr=Ps=>(Ps(),ye.set(ye.get().concat([Ps])),()=>{ye.set(so(ye.get(),Fr=>Fr!==Ps))}),_r=(Ps,Fr)=>sr(()=>j.get().fold(()=>{Ps.setEnabled(!1)},Ma=>{Ps.setEnabled(!Fr(Ma)&&z.selection.isEditable())})),Uc=(Ps,Fr,Ma)=>sr(()=>j.get().fold(()=>{Ps.setEnabled(!1),Ps.setActive(!1)},gc=>{Ps.setEnabled(!Fr(gc)&&z.selection.isEditable()),Ps.setActive(Ma(gc))})),cu=Ps=>Pe.exists(Fr=>Fr.locked[Ps]),rf=Ps=>_r(Ps,Fr=>!1),Nf=Ps=>_r(Ps,Fr=>ct(Fr.element)),dh=Ps=>Fr=>_r(Fr,Ma=>ct(Ma.element)||cu(Ps)),hh=Ps=>Fr=>_r(Fr,Ma=>ct(Ma.element)||Ps().isNone()),hr=(Ps,Fr)=>Ma=>_r(Ma,gc=>ct(gc.element)||Ps().isNone()||cu(Fr)),Gm=Ps=>_r(Ps,Fr=>Ft("mergeable")),Km=Ps=>_r(Ps,Fr=>Ft("unmergeable")),oa=Ps=>Uc(Ps,ne,Fr=>Bn(Fr.element,nl(z)).exists(gc=>Hl(gc,"caption"))),uu=(Ps,Fr)=>Ma=>Uc(Ma,gc=>ct(gc.element),()=>z.queryCommandValue(Ps)===Fr),Xp=uu("mceTableRowType","header"),Jm=uu("mceTableColType","th");return z.on("NodeChange ExecCommand TableSelectorChange",Si),{onSetupTable:rf,onSetupCellOrRow:Nf,onSetupColumn:dh,onSetupPasteable:hh,onSetupPasteableColumn:hr,onSetupMergeable:Gm,onSetupUnmergeable:Km,resetTargets:Si,onSetupTableWithCaption:oa,onSetupTableRowHeaders:Xp,onSetupTableColumnHeaders:Jm,targets:j.get}};var J1=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Xa="x-tinymce/dom-table-",hc=Xa+"rows",xt=Xa+"columns",Dc=z=>{var j;const ye=(j=J1.read())!==null&&j!==void 0?j:[];return ps(ye,Pe=>G.from(Pe.getType(z)))},au=()=>Dc(hc),mc=()=>Dc(xt),Bu=z=>j=>{const ye=()=>{j.setEnabled(z.selection.isEditable())};return z.on("NodeChange",ye),ye(),()=>{z.off("NodeChange",ye)}},ja=(z,j)=>{z.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:Bu(z),fetch:In=>In("inserttable | cell row column | advtablesort | tableprops deletetable")});const ye=In=>()=>z.execCommand(In),Pe=(In,Uo)=>{z.queryCommandSupported(Uo.command)&&z.ui.registry.addButton(In,{...Uo,onAction:E(Uo.onAction)?Uo.onAction:ye(Uo.command)})},ct=(In,Uo)=>{z.queryCommandSupported(Uo.command)&&z.ui.registry.addToggleButton(In,{...Uo,onAction:E(Uo.onAction)?Uo.onAction:ye(Uo.command)})};Pe("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:j.onSetupTable}),Pe("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:j.onSetupTable}),Pe("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:j.onSetupCellOrRow}),Pe("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:j.onSetupMergeable}),Pe("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:j.onSetupUnmergeable}),Pe("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:j.onSetupCellOrRow}),Pe("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:j.onSetupCellOrRow}),Pe("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:j.onSetupCellOrRow}),Pe("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:j.onSetupCellOrRow}),Pe("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:j.onSetupColumn("onFirst")}),Pe("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:j.onSetupColumn("onLast")}),Pe("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:j.onSetupColumn("onAny")}),Pe("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:j.onSetupCellOrRow}),Pe("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:j.onSetupCellOrRow}),Pe("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:j.onSetupPasteable(au)}),Pe("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:j.onSetupPasteable(au)}),Pe("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:j.onSetupColumn("onAny")}),Pe("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:j.onSetupColumn("onAny")}),Pe("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:j.onSetupPasteableColumn(mc,"onFirst")}),Pe("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:j.onSetupPasteableColumn(mc,"onLast")}),Pe("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:Bu(z)});const Ft=ed(qh(z));Ft.length!==0&&z.queryCommandSupported("mceTableToggleClass")&&z.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:lh(z,Ft,"tableclass",In=>z.execCommand("mceTableToggleClass",!1,In)),onSetup:j.onSetupTable});const Sn=ed(jh(z));Sn.length!==0&&z.queryCommandSupported("mceTableCellToggleClass")&&z.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:lh(z,Sn,"tablecellclass",In=>z.execCommand("mceTableCellToggleClass",!1,In)),onSetup:j.onSetupCellOrRow}),z.queryCommandSupported("mceTableApplyCellStyle")&&(z.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:lh(z,Dn,"tablecellverticalalign",Kl(z,"vertical-align")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:lh(z,Kf(z),"tablecellborderwidth",Kl(z,"border-width")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:lh(z,th(z),"tablecellborderstyle",Kl(z,"border-style")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:In=>In(Ae(z,Gh(z),"background-color")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:In=>In(Ae(z,Pf(z),"border-color")),onSetup:j.onSetupCellOrRow})),ct("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),ct("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Mf(z),onSetup:j.onSetupTableRowHeaders}),ct("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Xg(z),onSetup:j.onSetupTableColumnHeaders})},qa=z=>{const j=Pe=>z.dom.is(Pe,"table")&&z.getBody().contains(Pe)&&z.dom.isEditable(Pe.parentNode),ye=zc(z);ye.length>0&&z.ui.registry.addContextToolbar("table",{predicate:j,items:ye,scope:"node",position:"node"})},qm=z=>j=>{const ye=()=>{j.setEnabled(z.selection.isEditable())};return z.on("NodeChange",ye),ye(),()=>{z.off("NodeChange",ye)}},lu=(z,j)=>{const ye=sr=>()=>z.execCommand(sr),Pe=(sr,_r)=>z.queryCommandSupported(_r.command)?(z.ui.registry.addMenuItem(sr,{..._r,onAction:E(_r.onAction)?_r.onAction:ye(_r.command)}),!0):!1,ct=(sr,_r)=>{z.queryCommandSupported(_r.command)&&z.ui.registry.addToggleMenuItem(sr,{..._r,onAction:E(_r.onAction)?_r.onAction:ye(_r.command)})},Ft=sr=>{z.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},Sn=[Pe("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:j.onSetupCellOrRow}),Pe("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:j.onSetupCellOrRow}),Pe("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:j.onSetupCellOrRow}),Pe("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:j.onSetupCellOrRow}),Pe("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:j.onSetupCellOrRow}),Pe("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:j.onSetupCellOrRow}),Pe("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:j.onSetupPasteable(au)}),Pe("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:j.onSetupPasteable(au)})],In=[Pe("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:j.onSetupColumn("onFirst")}),Pe("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:j.onSetupColumn("onLast")}),Pe("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:j.onSetupColumn("onAny")}),Pe("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:j.onSetupColumn("onAny")}),Pe("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:j.onSetupColumn("onAny")}),Pe("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:j.onSetupPasteableColumn(mc,"onFirst")}),Pe("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:j.onSetupPasteableColumn(mc,"onLast")})],Uo=[Pe("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:j.onSetupCellOrRow}),Pe("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:j.onSetupMergeable}),Pe("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:j.onSetupUnmergeable})];rl(z)?z.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:Ft}],onSetup:qm(z)}):z.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:ye("mceInsertTableDialog"),onSetup:qm(z)}),z.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:ye("mceInsertTableDialog"),onSetup:qm(z)}),Pe("tableprops",{text:"Table properties",onSetup:j.onSetupTable,command:"mceTableProps"}),Pe("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:j.onSetupTable,command:"mceTableDelete"}),Et(Sn,!0)&&z.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:F("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),Et(In,!0)&&z.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:F("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),Et(Uo,!0)&&z.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:F("tablecellprops tablemergecells tablesplitcells")}),z.ui.registry.addContextMenu("table",{update:()=>(j.resetTargets(),j.targets().fold(F(""),sr=>ln(sr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const ts=ed(qh(z));ts.length!==0&&z.queryCommandSupported("mceTableToggleClass")&&z.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>wr(z,ts,"tableclass",sr=>z.execCommand("mceTableToggleClass",!1,sr)),onSetup:j.onSetupTable});const Si=ed(jh(z));Si.length!==0&&z.queryCommandSupported("mceTableCellToggleClass")&&z.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>wr(z,Si,"tablecellclass",sr=>z.execCommand("mceTableCellToggleClass",!1,sr)),onSetup:j.onSetupCellOrRow}),z.queryCommandSupported("mceTableApplyCellStyle")&&(z.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>wr(z,Dn,"tablecellverticalalign",Kl(z,"vertical-align")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>wr(z,Kf(z),"tablecellborderwidth",Kl(z,"border-width")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>wr(z,th(z),"tablecellborderstyle",Kl(z,"border-style")),onSetup:j.onSetupCellOrRow}),z.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Ae(z,Gh(z),"background-color"),onSetup:j.onSetupCellOrRow}),z.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Ae(z,Pf(z),"border-color"),onSetup:j.onSetupCellOrRow})),ct("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),ct("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Mf(z),onSetup:j.onSetupTableRowHeaders}),ct("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Xg(z),onSetup:j.onSetupTableRowHeaders})},c0=z=>{const j=jm(z);Vi(z),Yp(z),lu(z,j),ja(z,j),qa(z)};var Ho=()=>{o.add("table",c0)};Ho()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=V=>V==null,t=V=>!e(V),s=()=>{},a=V=>()=>V;class l{constructor(ut,Qe){this.tag=ut,this.value=Qe}static some(ut){return new l(!0,ut)}static none(){return l.singletonNone}fold(ut,Qe){return this.tag?Qe(this.value):ut()}isSome(){return this.tag}isNone(){return!this.tag}map(ut){return this.tag?l.some(ut(this.value)):l.none()}bind(ut){return this.tag?ut(this.value):l.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:l.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)?l.some(ut):l.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()"}}l.singletonNone=new l(!1);const u=(V,ut)=>ut>=0&&ut<V.length?l.some(V[ut]):l.none(),d=V=>u(V,0);var h=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const b=typeof window<"u"?window:Function("return this;")(),y=function(V,ut,Qe){const Bt=window.Prism;window.Prism={manual:!0};var Ct=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},He=function(st){var rn=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,Et=0,Cn={},je={manual:st.Prism&&st.Prism.manual,disableWorkerMessageHandler:st.Prism&&st.Prism.disableWorkerMessageHandler,util:{encode:function Ne(Gt){return Gt instanceof mt?new mt(Gt.type,Ne(Gt.content),Gt.alias):Array.isArray(Gt)?Gt.map(Ne):Gt.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(Ne){return Object.prototype.toString.call(Ne).slice(8,-1)},objId:function(Ne){return Ne.__id||Object.defineProperty(Ne,"__id",{value:++Et}),Ne.__id},clone:function Ne(Gt,bn){bn=bn||{};var At,An;switch(je.util.type(Gt)){case"Object":if(An=je.util.objId(Gt),bn[An])return bn[An];At={},bn[An]=At;for(var zn in Gt)Gt.hasOwnProperty(zn)&&(At[zn]=Ne(Gt[zn],bn));return At;case"Array":return An=je.util.objId(Gt),bn[An]?bn[An]:(At=[],bn[An]=At,Gt.forEach(function(ps,oo){At[oo]=Ne(ps,bn)}),At);default:return Gt}},getLanguage:function(Ne){for(;Ne;){var Gt=rn.exec(Ne.className);if(Gt)return Gt[1].toLowerCase();Ne=Ne.parentElement}return"none"},setLanguage:function(Ne,Gt){Ne.className=Ne.className.replace(RegExp(rn,"gi"),""),Ne.classList.add("language-"+Gt)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(At){var Ne=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(At.stack)||[])[1];if(Ne){var Gt=document.getElementsByTagName("script");for(var bn in Gt)if(Gt[bn].src==Ne)return Gt[bn]}return null}},isActive:function(Ne,Gt,bn){for(var At="no-"+Gt;Ne;){var An=Ne.classList;if(An.contains(Gt))return!0;if(An.contains(At))return!1;Ne=Ne.parentElement}return!!bn}},languages:{plain:Cn,plaintext:Cn,text:Cn,txt:Cn,extend:function(Ne,Gt){var bn=je.util.clone(je.languages[Ne]);for(var At in Gt)bn[At]=Gt[At];return bn},insertBefore:function(Ne,Gt,bn,At){At=At||je.languages;var An=At[Ne],zn={};for(var ps in An)if(An.hasOwnProperty(ps)){if(ps==Gt)for(var oo in bn)bn.hasOwnProperty(oo)&&(zn[oo]=bn[oo]);bn.hasOwnProperty(ps)||(zn[ps]=An[ps])}var Ss=At[Ne];return At[Ne]=zn,je.languages.DFS(je.languages,function(Mr,$s){$s===Ss&&Mr!=Ne&&(this[Mr]=zn)}),zn},DFS:function Ne(Gt,bn,At,An){An=An||{};var zn=je.util.objId;for(var ps in Gt)if(Gt.hasOwnProperty(ps)){bn.call(Gt,ps,Gt[ps],At||ps);var oo=Gt[ps],Ss=je.util.type(oo);Ss==="Object"&&!An[zn(oo)]?(An[zn(oo)]=!0,Ne(oo,bn,null,An)):Ss==="Array"&&!An[zn(oo)]&&(An[zn(oo)]=!0,Ne(oo,bn,ps,An))}}},plugins:{},highlightAll:function(Ne,Gt){je.highlightAllUnder(document,Ne,Gt)},highlightAllUnder:function(Ne,Gt,bn){var At={callback:bn,container:Ne,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};je.hooks.run("before-highlightall",At),At.elements=Array.prototype.slice.apply(At.container.querySelectorAll(At.selector)),je.hooks.run("before-all-elements-highlight",At);for(var An=0,zn;zn=At.elements[An++];)je.highlightElement(zn,Gt===!0,At.callback)},highlightElement:function(Ne,Gt,bn){var At=je.util.getLanguage(Ne),An=je.languages[At];je.util.setLanguage(Ne,At);var zn=Ne.parentElement;zn&&zn.nodeName.toLowerCase()==="pre"&&je.util.setLanguage(zn,At);var ps=Ne.textContent,oo={element:Ne,language:At,grammar:An,code:ps};function Ss($s){oo.highlightedCode=$s,je.hooks.run("before-insert",oo),oo.element.innerHTML=oo.highlightedCode,je.hooks.run("after-highlight",oo),je.hooks.run("complete",oo),bn&&bn.call(oo.element)}if(je.hooks.run("before-sanity-check",oo),zn=oo.element.parentElement,zn&&zn.nodeName.toLowerCase()==="pre"&&!zn.hasAttribute("tabindex")&&zn.setAttribute("tabindex","0"),!oo.code){je.hooks.run("complete",oo),bn&&bn.call(oo.element);return}if(je.hooks.run("before-highlight",oo),!oo.grammar){Ss(je.util.encode(oo.code));return}if(Gt&&st.Worker){var Mr=new Worker(je.filename);Mr.onmessage=function($s){Ss($s.data)},Mr.postMessage(JSON.stringify({language:oo.language,code:oo.code,immediateClose:!0}))}else Ss(je.highlight(oo.code,oo.grammar,oo.language))},highlight:function(Ne,Gt,bn){var At={code:Ne,grammar:Gt,language:bn};if(je.hooks.run("before-tokenize",At),!At.grammar)throw new Error('The language "'+At.language+'" has no grammar.');return At.tokens=je.tokenize(At.code,At.grammar),je.hooks.run("after-tokenize",At),mt.stringify(je.util.encode(At.tokens),At.language)},tokenize:function(Ne,Gt){var bn=Gt.rest;if(bn){for(var At in bn)Gt[At]=bn[At];delete Gt.rest}var An=new Kn;return so(An,An.head,Ne),Zo(Ne,An,Gt,An.head,0),as(An)},hooks:{all:{},add:function(Ne,Gt){var bn=je.hooks.all;bn[Ne]=bn[Ne]||[],bn[Ne].push(Gt)},run:function(Ne,Gt){var bn=je.hooks.all[Ne];if(!(!bn||!bn.length))for(var At=0,An;An=bn[At++];)An(Gt)}},Token:mt};st.Prism=je;function mt(Ne,Gt,bn,At){this.type=Ne,this.content=Gt,this.alias=bn,this.length=(At||"").length|0}mt.stringify=function Ne(Gt,bn){if(typeof Gt=="string")return Gt;if(Array.isArray(Gt)){var At="";return Gt.forEach(function(Ss){At+=Ne(Ss,bn)}),At}var An={type:Gt.type,content:Ne(Gt.content,bn),tag:"span",classes:["token",Gt.type],attributes:{},language:bn},zn=Gt.alias;zn&&(Array.isArray(zn)?Array.prototype.push.apply(An.classes,zn):An.classes.push(zn)),je.hooks.run("wrap",An);var ps="";for(var oo in An.attributes)ps+=" "+oo+'="'+(An.attributes[oo]||"").replace(/"/g,""")+'"';return"<"+An.tag+' class="'+An.classes.join(" ")+'"'+ps+">"+An.content+"</"+An.tag+">"};function he(Ne,Gt,bn,At){Ne.lastIndex=Gt;var An=Ne.exec(bn);if(An&&At&&An[1]){var zn=An[1].length;An.index+=zn,An[0]=An[0].slice(zn)}return An}function Zo(Ne,Gt,bn,At,An,zn){for(var ps in bn)if(!(!bn.hasOwnProperty(ps)||!bn[ps])){var oo=bn[ps];oo=Array.isArray(oo)?oo:[oo];for(var Ss=0;Ss<oo.length;++Ss){if(zn&&zn.cause==ps+","+Ss)return;var Mr=oo[Ss],$s=Mr.inside,tr=!!Mr.lookbehind,Xs=!!Mr.greedy,wa=Mr.alias;if(Xs&&!Mr.pattern.global){var dr=Mr.pattern.toString().match(/[imsuy]*$/)[0];Mr.pattern=RegExp(Mr.pattern.source,dr+"g")}for(var Ns=Mr.pattern||Mr,qr=At.next,$o=An;qr!==Gt.tail&&!(zn&&$o>=zn.reach);$o+=qr.value.length,qr=qr.next){var Po=qr.value;if(Gt.length>Ne.length)return;if(!(Po instanceof mt)){var Rr=1,Ls;if(Xs){if(Ls=he(Ns,$o,Ne,tr),!Ls||Ls.index>=Ne.length)break;var ln=Ls.index,aa=Ls.index+Ls[0].length,bs=$o;for(bs+=qr.value.length;ln>=bs;)qr=qr.next,bs+=qr.value.length;if(bs-=qr.value.length,$o=bs,qr.value instanceof mt)continue;for(var _a=qr;_a!==Gt.tail&&(bs<aa||typeof _a.value=="string");_a=_a.next)Rr++,bs+=_a.value.length;Rr--,Po=Ne.slice($o,bs),Ls.index-=$o}else if(Ls=he(Ns,0,Po,tr),!Ls)continue;var ln=Ls.index,vs=Ls[0],Qi=Po.slice(0,ln),ze=Po.slice(ln+vs.length),et=$o+Po.length;zn&&et>zn.reach&&(zn.reach=et);var Tt=qr.prev;Qi&&(Tt=so(Gt,Tt,Qi),$o+=Qi.length),Yo(Gt,Tt,Rr);var Wt=new mt(ps,$s?je.tokenize(vs,$s):vs,wa,vs);if(qr=so(Gt,Tt,Wt),ze&&so(Gt,qr,ze),Rr>1){var Yn={cause:ps+","+Ss,reach:et};Zo(Ne,Gt,bn,qr.prev,$o,Yn),zn&&Yn.reach>zn.reach&&(zn.reach=Yn.reach)}}}}}}function Kn(){var Ne={value:null,prev:null,next:null},Gt={value:null,prev:Ne,next:null};Ne.next=Gt,this.head=Ne,this.tail=Gt,this.length=0}function so(Ne,Gt,bn){var At=Gt.next,An={value:bn,prev:Gt,next:At};return Gt.next=An,At.prev=An,Ne.length++,An}function Yo(Ne,Gt,bn){for(var At=Gt.next,An=0;An<bn&&At!==Ne.tail;An++)At=At.next;Gt.next=At,At.prev=Gt,Ne.length-=An}function as(Ne){for(var Gt=[],bn=Ne.head.next;bn!==Ne.tail;)Gt.push(bn.value),bn=bn.next;return Gt}if(!st.document)return st.addEventListener&&(je.disableWorkerMessageHandler||st.addEventListener("message",function(Ne){var Gt=JSON.parse(Ne.data),bn=Gt.language,At=Gt.code,An=Gt.immediateClose;st.postMessage(je.highlight(At,je.languages[bn],bn)),An&&st.close()},!1)),je;var kt=je.util.currentScript();kt&&(je.filename=kt.src,kt.hasAttribute("data-manual")&&(je.manual=!0));function jt(){je.manual||je.highlightAll()}if(!je.manual){var pt=document.readyState;pt==="loading"||pt==="interactive"&&kt&&kt.defer?document.addEventListener("DOMContentLoaded",jt):window.requestAnimationFrame?window.requestAnimationFrame(jt):window.setTimeout(jt,16)}return je}(Ct);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(st){function rn(Et,Cn){return"___"+Et.toUpperCase()+Cn+"___"}Object.defineProperties(st.languages["markup-templating"]={},{buildPlaceholders:{value:function(Et,Cn,je,mt){if(Et.language===Cn){var he=Et.tokenStack=[];Et.code=Et.code.replace(je,function(Zo){if(typeof mt=="function"&&!mt(Zo))return Zo;for(var Kn=he.length,so;Et.code.indexOf(so=rn(Cn,Kn))!==-1;)++Kn;return he[Kn]=Zo,so}),Et.grammar=st.languages.markup}}},tokenizePlaceholders:{value:function(Et,Cn){if(Et.language!==Cn||!Et.tokenStack)return;Et.grammar=st.languages[Cn];var je=0,mt=Object.keys(Et.tokenStack);function he(Zo){for(var Kn=0;Kn<Zo.length&&!(je>=mt.length);Kn++){var so=Zo[Kn];if(typeof so=="string"||so.content&&typeof so.content=="string"){var Yo=mt[je],as=Et.tokenStack[Yo],kt=typeof so=="string"?so:so.content,jt=rn(Cn,Yo),pt=kt.indexOf(jt);if(pt>-1){++je;var Ne=kt.substring(0,pt),Gt=new st.Token(Cn,st.tokenize(as,Et.grammar),"language-"+Cn,as),bn=kt.substring(pt+jt.length),At=[];Ne&&At.push.apply(At,he([Ne])),At.push(Gt),bn&&At.push.apply(At,he([bn])),typeof so=="string"?Zo.splice.apply(Zo,[Kn,1].concat(At)):so.content=At}}else so.content&&he(so.content)}return Zo}he(Et.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(st){var rn=/\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/,Et=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return rn.source});st.languages.cpp=st.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return rn.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:rn,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/}),st.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 Et})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),st.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:st.languages.cpp}}}}),st.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),st.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:st.languages.extend("cpp",{})}}),st.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},st.languages.cpp["base-clause"])}(He),function(st){function rn(Ls,aa){return Ls.replace(/<<(\d+)>>/g,function(bs,_a){return"(?:"+aa[+_a]+")"})}function Et(Ls,aa,bs){return RegExp(rn(Ls,aa),bs||"")}function Cn(Ls,aa){for(var bs=0;bs<aa;bs++)Ls=Ls.replace(/<<self>>/g,function(){return"(?:"+Ls+")"});return Ls.replace(/<<self>>/g,"[^\\s\\S]")}var je={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 mt(Ls){return"\\b(?:"+Ls.trim().replace(/ /g,"|")+")\\b"}var he=mt(je.typeDeclaration),Zo=RegExp(mt(je.type+" "+je.typeDeclaration+" "+je.contextual+" "+je.other)),Kn=mt(je.typeDeclaration+" "+je.contextual+" "+je.other),so=mt(je.type+" "+je.typeDeclaration+" "+je.other),Yo=Cn(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),as=Cn(/\((?:[^()]|<<self>>)*\)/.source,2),kt=/@?\b[A-Za-z_]\w*\b/.source,jt=rn(/<<0>>(?:\s*<<1>>)?/.source,[kt,Yo]),pt=rn(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[Kn,jt]),Ne=/\[\s*(?:,\s*)*\]/.source,Gt=rn(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[pt,Ne]),bn=rn(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[Yo,as,Ne]),At=rn(/\(<<0>>+(?:,<<0>>+)+\)/.source,[bn]),An=rn(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[At,pt,Ne]),zn={keyword:Zo,punctuation:/[<>()?,.:[\]]/},ps=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,oo=/"(?:\\.|[^\\"\r\n])*"/.source,Ss=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;st.languages.csharp=st.languages.extend("clike",{string:[{pattern:Et(/(^|[^$\\])<<0>>/.source,[Ss]),lookbehind:!0,greedy:!0},{pattern:Et(/(^|[^@$\\])<<0>>/.source,[oo]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:Et(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[pt]),lookbehind:!0,inside:zn},{pattern:Et(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[kt,An]),lookbehind:!0,inside:zn},{pattern:Et(/(\busing\s+)<<0>>(?=\s*=)/.source,[kt]),lookbehind:!0},{pattern:Et(/(\b<<0>>\s+)<<1>>/.source,[he,jt]),lookbehind:!0,inside:zn},{pattern:Et(/(\bcatch\s*\(\s*)<<0>>/.source,[pt]),lookbehind:!0,inside:zn},{pattern:Et(/(\bwhere\s+)<<0>>/.source,[kt]),lookbehind:!0},{pattern:Et(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[Gt]),lookbehind:!0,inside:zn},{pattern:Et(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[An,so,kt]),inside:zn}],keyword:Zo,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:/\?\.?|::|[{}[\];(),.:]/}),st.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),st.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:Et(/([(,]\s*)<<0>>(?=\s*:)/.source,[kt]),lookbehind:!0,alias:"punctuation"}}),st.languages.insertBefore("csharp","class-name",{namespace:{pattern:Et(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[kt]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:Et(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[as]),lookbehind:!0,alias:"class-name",inside:zn},"return-type":{pattern:Et(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[An,pt]),inside:zn,alias:"class-name"},"constructor-invocation":{pattern:Et(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[An]),lookbehind:!0,inside:zn,alias:"class-name"},"generic-method":{pattern:Et(/<<0>>\s*<<1>>(?=\s*\()/.source,[kt,Yo]),inside:{function:Et(/^<<0>>/.source,[kt]),generic:{pattern:RegExp(Yo),alias:"class-name",inside:zn}}},"type-list":{pattern:Et(/\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,[he,jt,kt,An,Zo.source,as,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:Et(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[jt,as]),lookbehind:!0,greedy:!0,inside:st.languages.csharp},keyword:Zo,"class-name":{pattern:RegExp(An),greedy:!0,inside:zn},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 Mr=oo+"|"+ps,$s=rn(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[Mr]),tr=Cn(rn(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[$s]),2),Xs=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,wa=rn(/<<0>>(?:\s*\(<<1>>*\))?/.source,[pt,tr]);st.languages.insertBefore("csharp","class-name",{attribute:{pattern:Et(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[Xs,wa]),lookbehind:!0,greedy:!0,inside:{target:{pattern:Et(/^<<0>>(?=\s*:)/.source,[Xs]),alias:"keyword"},"attribute-arguments":{pattern:Et(/\(<<0>>*\)/.source,[tr]),inside:st.languages.csharp},"class-name":{pattern:RegExp(pt),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var dr=/:[^}\r\n]+/.source,Ns=Cn(rn(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[$s]),2),qr=rn(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Ns,dr]),$o=Cn(rn(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[Mr]),2),Po=rn(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[$o,dr]);function Rr(Ls,aa){return{interpolation:{pattern:Et(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[Ls]),lookbehind:!0,inside:{"format-string":{pattern:Et(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[aa,dr]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:st.languages.csharp}}},string:/[\s\S]+/}}st.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:Et(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[qr]),lookbehind:!0,greedy:!0,inside:Rr(qr,Ns)},{pattern:Et(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Po]),lookbehind:!0,greedy:!0,inside:Rr(Po,$o)}],char:{pattern:RegExp(ps),greedy:!0}}),st.languages.dotnet=st.languages.cs=st.languages.csharp}(He),function(st){var rn=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;st.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+rn.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\\((?:"+rn.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+rn.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+rn.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:rn,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:/[(){};:,]/},st.languages.css.atrule.inside.rest=st.languages.css;var Et=st.languages.markup;Et&&(Et.tag.addInlined("style","css"),Et.tag.addAttribute("style","css"))}(He),function(st){var rn=/\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/,Et=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,Cn={pattern:RegExp(/(^|[^\w.])/.source+Et+/[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:/\./}};st.languages.java=st.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[Cn,{pattern:RegExp(/(^|[^\w.])/.source+Et+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:Cn.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+Et+/[A-Z]\w*\b/.source),lookbehind:!0,inside:Cn.inside}],keyword:rn,function:[st.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/}),st.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),st.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":Cn,keyword:rn,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+Et+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:Cn.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+Et+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:Cn.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 rn.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(st){st.type==="entity"&&(st.attributes.title=st.content.replace(/&/,"&"))}),Object.defineProperty(He.languages.markup.tag,"addInlined",{value:function(rn,Et){var Cn={};Cn["language-"+Et]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:He.languages[Et]},Cn.cdata=/^<!\[CDATA\[|\]\]>$/i;var je={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:Cn}};je["language-"+Et]={pattern:/[\s\S]+/,inside:He.languages[Et]};var mt={};mt[rn]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return rn}),"i"),lookbehind:!0,greedy:!0,inside:je},He.languages.insertBefore("markup","cdata",mt)}}),Object.defineProperty(He.languages.markup.tag,"addAttribute",{value:function(st,rn){He.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+st+")"+/\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:[rn,"language-"+rn],inside:He.languages[rn]},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(st){var rn=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,Et=[{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*\()/],Cn=/\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,je=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,mt=/[{}\[\](),:;]/;st.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:rn,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:Et,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:Cn,operator:je,punctuation:mt};var he={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:st.languages.php},Zo=[{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:he}},{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:he}}];st.languages.insertBefore("php","variable",{string:Zo,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:rn,string:Zo,"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:Et,number:Cn,operator:je,punctuation:mt}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),st.hooks.add("before-tokenize",function(Kn){if(!!/<\?/.test(Kn.code)){var so=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;st.languages["markup-templating"].buildPlaceholders(Kn,"php",so)}}),st.hooks.add("after-tokenize",function(Kn){st.languages["markup-templating"].tokenizePlaceholders(Kn,"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(st){st.languages.ruby=st.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:/[(){}[\].,;]/}),st.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var rn={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:st.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete st.languages.ruby.function;var Et="(?:"+[/([^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("|")+")",Cn=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;st.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+Et+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:rn,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:rn,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+Cn),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+Cn+/(?=:(?!:))/.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:/\./}}}),st.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+Et),greedy:!0,inside:{interpolation:rn,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:rn,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:rn,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+Et),greedy:!0,inside:{interpolation:rn,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:rn,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete st.languages.ruby.string,st.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)/}),st.languages.rb=st.languages.ruby}(He),window.Prism=Bt,He}(void 0,void 0),C=V=>ut=>ut.options.get(V),E=V=>{const ut=V.options.register;ut("codesample_languages",{processor:"object[]"}),ut("codesample_global_prismjs",{processor:"boolean",default:!1})},R=C("codesample_languages"),$=C("codesample_global_prismjs"),Q=V=>b.Prism&&$(V)?b.Prism:y,F=V=>t(V)&&V.nodeName==="PRE"&&V.className.indexOf("language-")!==-1,U=V=>{const ut=V.selection?V.selection.getNode():null;return F(ut)?l.some(ut):l.none()},K=(V,ut,Qe)=>{const Bt=V.dom;V.undoManager.transact(()=>{const Ct=U(V);return Qe=h.DOM.encode(Qe),Ct.fold(()=>{V.insertContent('<pre id="__new" class="language-'+ut+'">'+Qe+"</pre>");const He=Bt.select("#__new")[0];Bt.setAttrib(He,"id",null),V.selection.select(He)},He=>{Bt.setAttrib(He,"class","language-"+ut),He.innerHTML=Qe,Q(V).highlightElement(He),V.selection.select(He)})})},L=V=>U(V).bind(Qe=>l.from(Qe.textContent)).getOr(""),te=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"}],Qe=R(V);return Qe||ut},ne=(V,ut)=>U(V).fold(()=>ut,Bt=>{const Ct=Bt.className.match(/language-(\w+)/);return Ct?Ct[1]:ut}),oe=V=>{const ut=te(V),Qe=d(ut).fold(a(""),He=>He.value),Bt=ne(V,Qe),Ct=L(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:Bt,code:Ct},onSubmit:He=>{const st=He.getData();K(V,st.language,st.code),He.close()}})},G=V=>{V.addCommand("codesample",()=>{const ut=V.selection.getNode();V.selection.isCollapsed()||F(ut)?oe(V):V.formatter.toggle("code")})},ve=(V=>ut=>ut.replace(V,""))(/^\s+|\s+$/g);var Re=tinymce.util.Tools.resolve("tinymce.util.Tools");const Oe=V=>{V.on("PreProcess",ut=>{const Qe=V.dom,Bt=Qe.select("pre[contenteditable=false]",ut.node);Re.each(Re.grep(Bt,F),Ct=>{const He=Ct.textContent;Qe.setAttrib(Ct,"class",ve(Qe.getAttrib(Ct,"class"))),Qe.setAttrib(Ct,"contentEditable",null),Qe.setAttrib(Ct,"data-mce-highlighted",null);let st;for(;st=Ct.firstChild;)Ct.removeChild(st);const rn=Qe.add(Ct,"code");rn.textContent=He})}),V.on("SetContent",()=>{const ut=V.dom,Qe=Re.grep(ut.select("pre"),Bt=>F(Bt)&&ut.getAttrib(Bt,"data-mce-highlighted")!=="true");Qe.length&&V.undoManager.transact(()=>{Re.each(Qe,Bt=>{var Ct;Re.each(ut.select("br",Bt),He=>{ut.replace(V.getDoc().createTextNode(`
|
|
`),He)}),Bt.innerHTML=ut.encode((Ct=Bt.textContent)!==null&&Ct!==void 0?Ct:""),Q(V).highlightElement(Bt),ut.setAttrib(Bt,"data-mce-highlighted",!0),Bt.className=ve(Bt.className)})})}),V.on("PreInit",()=>{V.parser.addNodeFilter("pre",ut=>{var Qe;for(let Bt=0,Ct=ut.length;Bt<Ct;Bt++){const He=ut[Bt];((Qe=He.attr("class"))!==null&&Qe!==void 0?Qe:"").indexOf("language-")!==-1&&(He.attr("contenteditable","false"),He.attr("data-mce-highlighted","false"))}})})},ce=(V,ut=s)=>Qe=>{const Bt=()=>{Qe.setEnabled(V.selection.isEditable()),ut(Qe)};return V.on("NodeChange",Bt),Bt(),()=>{V.off("NodeChange",Bt)}},Xe=V=>{const ut=V.selection.getStart();return V.dom.is(ut,'pre[class*="language-"]')},tt=V=>{const ut=()=>V.execCommand("codesample");V.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:ut,onSetup:ce(V,Qe=>{Qe.setActive(Xe(V))})}),V.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:ut,onSetup:ce(V)})};var ot=()=>{o.add("codesample",V=>{E(V),Oe(V),tt(V),G(V),V.on("dblclick",ut=>{F(ut.target)&&oe(V)})})};ot()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ge,qe,Nt)=>{var Ut;return Nt(Ge,qe.prototype)?!0:((Ut=Ge.constructor)===null||Ut===void 0?void 0:Ut.name)===qe.name},t=Ge=>{const qe=typeof Ge;return Ge===null?"null":qe==="object"&&Array.isArray(Ge)?"array":qe==="object"&&e(Ge,String,(Nt,Ut)=>Ut.isPrototypeOf(Nt))?"string":qe},s=Ge=>qe=>t(qe)===Ge,a=s("string"),l=s("object"),u=s("array"),d=Ge=>Ge==null,h=Ge=>!d(Ge);class b{constructor(qe,Nt){this.tag=qe,this.value=Nt}static some(qe){return new b(!0,qe)}static none(){return b.singletonNone}fold(qe,Nt){return this.tag?Nt(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?b.some(qe(this.value)):b.none()}bind(qe){return this.tag?qe(this.value):b.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:b.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe!=null?qe:"Called getOrDie on None")}static from(qe){return h(qe)?b.some(qe):b.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}b.singletonNone=new b(!1);const y=Array.prototype.push,C=(Ge,qe)=>{for(let Nt=0,Ut=Ge.length;Nt<Ut;Nt++){const bo=Ge[Nt];qe(bo,Nt)}},E=Ge=>{const qe=[];for(let Nt=0,Ut=Ge.length;Nt<Ut;++Nt){if(!u(Ge[Nt]))throw new Error("Arr.flatten item "+Nt+" was not an array, input: "+Ge);y.apply(qe,Ge[Nt])}return qe},R=Ge=>{let qe=Ge;return{get:()=>qe,set:bo=>{qe=bo}}},$=Object.keys,Q=Object.hasOwnProperty,F=(Ge,qe)=>{const Nt=$(Ge);for(let Ut=0,bo=Nt.length;Ut<bo;Ut++){const Lo=Nt[Ut],Go=Ge[Lo];qe(Go,Lo)}},U=(Ge,qe)=>K(Ge,qe)?b.from(Ge[qe]):b.none(),K=(Ge,qe)=>Q.call(Ge,qe),L=Ge=>qe=>qe.options.get(Ge),te=Ge=>{const qe=Ge.options.register;qe("audio_template_callback",{processor:"function"}),qe("video_template_callback",{processor:"function"}),qe("iframe_template_callback",{processor:"function"}),qe("media_live_embeds",{processor:"boolean",default:!0}),qe("media_filter_html",{processor:"boolean",default:!0}),qe("media_url_resolver",{processor:"function"}),qe("media_alt_source",{processor:"boolean",default:!0}),qe("media_poster",{processor:"boolean",default:!0}),qe("media_dimensions",{processor:"boolean",default:!0})},ne=L("audio_template_callback"),oe=L("video_template_callback"),G=L("iframe_template_callback"),we=L("media_live_embeds"),ve=L("media_filter_html"),Re=L("media_url_resolver"),Oe=L("media_alt_source"),ce=L("media_poster"),Xe=L("media_dimensions");var tt=tinymce.util.Tools.resolve("tinymce.util.Tools"),ot=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),V=tinymce.util.Tools.resolve("tinymce.html.DomParser");const ut=ot.DOM,Qe=Ge=>Ge.replace(/px$/,""),Bt=Ge=>{const qe=Ge.attr("style"),Nt=qe?ut.parseStyle(qe):{};return{type:"ephox-embed-iri",source:Ge.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:U(Nt,"max-width").map(Qe).getOr(""),height:U(Nt,"max-height").map(Qe).getOr("")}},Ct=(Ge,qe)=>{let Nt={};const bo=V({validate:!1,forced_root_block:!1},qe).parse(Ge);for(let Lo=bo;Lo;Lo=Lo.walk())if(Lo.type===1){const Go=Lo.name;if(Lo.attr("data-ephox-embed-iri")){Nt=Bt(Lo);break}else!Nt.source&&Go==="param"&&(Nt.source=Lo.attr("movie")),(Go==="iframe"||Go==="object"||Go==="embed"||Go==="video"||Go==="audio")&&(Nt.type||(Nt.type=Go),Nt=tt.extend(Lo.attributes.map,Nt)),Go==="source"&&(Nt.source?Nt.altsource||(Nt.altsource=Lo.attr("src")):Nt.source=Lo.attr("src")),Go==="img"&&!Nt.poster&&(Nt.poster=Lo.attr("src"))}return Nt.source=Nt.source||Nt.src||"",Nt.altsource=Nt.altsource||"",Nt.poster=Nt.poster||"",Nt},He=Ge=>{var qe;const Nt={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},Ut=(qe=Ge.toLowerCase().split(".").pop())!==null&&qe!==void 0?qe:"";return U(Nt,Ut).getOr("")};var st=tinymce.util.Tools.resolve("tinymce.html.Node"),rn=tinymce.util.Tools.resolve("tinymce.html.Serializer");const Et=(Ge,qe={})=>V({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...qe},Ge),Cn=ot.DOM,je=Ge=>/^[0-9.]+$/.test(Ge)?Ge+"px":Ge,mt=(Ge,qe)=>{const Nt=qe.attr("style"),Ut=Nt?Cn.parseStyle(Nt):{};h(Ge.width)&&(Ut["max-width"]=je(Ge.width)),h(Ge.height)&&(Ut["max-height"]=je(Ge.height)),qe.attr("style",Cn.serializeStyle(Ut))},he=["source","altsource"],Zo=(Ge,qe,Nt,Ut)=>{let bo=0,Lo=0;const Go=Et(Ut);Go.addNodeFilter("source",lt=>bo=lt.length);const ei=Go.parse(Ge);for(let lt=ei;lt;lt=lt.walk())if(lt.type===1){const Xo=lt.name;if(lt.attr("data-ephox-embed-iri")){mt(qe,lt);break}else{switch(Xo){case"video":case"object":case"embed":case"img":case"iframe":qe.height!==void 0&&qe.width!==void 0&&(lt.attr("width",qe.width),lt.attr("height",qe.height));break}if(Nt)switch(Xo){case"video":lt.attr("poster",qe.poster),lt.attr("src",null);for(let la=bo;la<2;la++)if(qe[he[la]]){const ma=new st("source",1);ma.attr("src",qe[he[la]]),ma.attr("type",qe[he[la]+"mime"]||null),lt.append(ma)}break;case"iframe":lt.attr("src",qe.source);break;case"object":const Ni=lt.getAll("img").length>0;if(qe.poster&&!Ni){lt.attr("src",qe.poster);const la=new st("img",1);la.attr("src",qe.poster),la.attr("width",qe.width),la.attr("height",qe.height),lt.append(la)}break;case"source":if(Lo<2&&(lt.attr("src",qe[he[Lo]]),lt.attr("type",qe[he[Lo]+"mime"]||null),!qe[he[Lo]])){lt.remove();continue}Lo++;break;case"img":qe.poster||lt.remove();break}}}return rn({},Ut).serialize(ei)},Kn=[{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}],so=Ge=>{const qe=Ge.match(/^(https?:\/\/|www\.)(.+)$/i);return qe&&qe.length>1?qe[1]==="www."?"https://":qe[1]:"https://"},Yo=(Ge,qe)=>{const Nt=so(qe),Ut=Ge.regex.exec(qe);let bo=Nt+Ge.url;if(h(Ut))for(let Lo=0;Lo<Ut.length;Lo++)bo=bo.replace("$"+Lo,()=>Ut[Lo]?Ut[Lo]:"");return bo.replace(/\?$/,"")},as=Ge=>{const qe=Kn.filter(Nt=>Nt.regex.test(Ge));return qe.length>0?tt.extend({},qe[0],{url:Yo(qe[0],Ge)}):null},kt=(Ge,qe)=>{if(qe)return qe(Ge);{const Nt=Ge.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+Ge.source+'" width="'+Ge.width+'" height="'+Ge.height+'"'+Nt+"></iframe>"}},jt=Ge=>{let qe='<object data="'+Ge.source+'" width="'+Ge.width+'" height="'+Ge.height+'" type="application/x-shockwave-flash">';return Ge.poster&&(qe+='<img src="'+Ge.poster+'" width="'+Ge.width+'" height="'+Ge.height+'" />'),qe+="</object>",qe},pt=(Ge,qe)=>qe?qe(Ge):'<audio controls="controls" src="'+Ge.source+'">'+(Ge.altsource?`
|
|
<source src="`+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
|
|
`:"")+"</audio>",Ne=(Ge,qe)=>qe?qe(Ge):'<video width="'+Ge.width+'" height="'+Ge.height+'"'+(Ge.poster?' poster="'+Ge.poster+'"':"")+` controls="controls">
|
|
<source src="`+Ge.source+'"'+(Ge.sourcemime?' type="'+Ge.sourcemime+'"':"")+` />
|
|
`+(Ge.altsource?'<source src="'+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
|
|
`:"")+"</video>",Gt=(Ge,qe)=>{var Nt;const Ut=tt.extend({},qe);if(!Ut.source&&(tt.extend(Ut,Ct((Nt=Ut.embed)!==null&&Nt!==void 0?Nt:"",Ge.schema)),!Ut.source))return"";Ut.altsource||(Ut.altsource=""),Ut.poster||(Ut.poster=""),Ut.source=Ge.convertURL(Ut.source,"source"),Ut.altsource=Ge.convertURL(Ut.altsource,"source"),Ut.sourcemime=He(Ut.source),Ut.altsourcemime=He(Ut.altsource),Ut.poster=Ge.convertURL(Ut.poster,"poster");const bo=as(Ut.source);if(bo&&(Ut.source=bo.url,Ut.type=bo.type,Ut.allowfullscreen=bo.allowFullscreen,Ut.width=Ut.width||String(bo.w),Ut.height=Ut.height||String(bo.h)),Ut.embed)return Zo(Ut.embed,Ut,!0,Ge.schema);{const Lo=ne(Ge),Go=oe(Ge),ei=G(Ge);return Ut.width=Ut.width||"300",Ut.height=Ut.height||"150",tt.each(Ut,(lt,Xo)=>{Ut[Xo]=Ge.dom.encode(""+lt)}),Ut.type==="iframe"?kt(Ut,ei):Ut.sourcemime==="application/x-shockwave-flash"?jt(Ut):Ut.sourcemime.indexOf("audio")!==-1?pt(Ut,Lo):Ne(Ut,Go)}},bn=Ge=>Ge.hasAttribute("data-mce-object")||Ge.hasAttribute("data-ephox-embed-iri"),At=Ge=>{Ge.on("click keyup touchend",()=>{const qe=Ge.selection.getNode();qe&&Ge.dom.hasClass(qe,"mce-preview-object")&&Ge.dom.getAttrib(qe,"data-mce-selected")&&qe.setAttribute("data-mce-selected","2")}),Ge.on("ObjectResized",qe=>{const Nt=qe.target;if(Nt.getAttribute("data-mce-object")){let Ut=Nt.getAttribute("data-mce-html");Ut&&(Ut=unescape(Ut),Nt.setAttribute("data-mce-html",escape(Zo(Ut,{width:String(qe.width),height:String(qe.height)},!1,Ge.schema))))}})},An={},zn=(Ge,qe,Nt)=>new Promise((Ut,bo)=>{const Lo=Go=>(Go.html&&(An[Ge.source]=Go),Ut({url:Ge.source,html:Go.html?Go.html:qe(Ge)}));An[Ge.source]?Lo(An[Ge.source]):Nt({url:Ge.source},Lo,bo)}),ps=(Ge,qe)=>Promise.resolve({html:qe(Ge),url:Ge.source}),oo=Ge=>qe=>Gt(Ge,qe),Ss=(Ge,qe)=>{const Nt=Re(Ge);return Nt?zn(qe,oo(Ge),Nt):ps(qe,oo(Ge))},Mr=Ge=>K(An,Ge),$s=(Ge,qe)=>U(qe,Ge).bind(Nt=>U(Nt,"meta")),tr=(Ge,qe,Nt)=>Ut=>{const bo=()=>U(Ge,Ut),Lo=()=>U(qe,Ut),Go=Xo=>U(Xo,"value").bind(Ni=>Ni.length>0?b.some(Ni):b.none()),ei=()=>bo().bind(Xo=>l(Xo)?Go(Xo).orThunk(Lo):Lo().orThunk(()=>b.from(Xo))),lt=()=>Lo().orThunk(()=>bo().bind(Xo=>l(Xo)?Go(Xo):b.from(Xo)));return{[Ut]:(Ut===Nt?ei():lt()).getOr("")}},Xs=(Ge,qe)=>{const Nt={};return U(Ge,"dimensions").each(Ut=>{C(["width","height"],bo=>{U(qe,bo).orThunk(()=>U(Ut,bo)).each(Lo=>Nt[bo]=Lo)})}),Nt},wa=(Ge,qe)=>{const Nt=qe&&qe!=="dimensions"?$s(qe,Ge).getOr({}):{},Ut=tr(Ge,Nt,qe);return{...Ut("source"),...Ut("altsource"),...Ut("poster"),...Ut("embed"),...Xs(Ge,Nt)}},dr=Ge=>{const qe={...Ge,source:{value:U(Ge,"source").getOr("")},altsource:{value:U(Ge,"altsource").getOr("")},poster:{value:U(Ge,"poster").getOr("")}};return C(["width","height"],Nt=>{U(Ge,Nt).each(Ut=>{const bo=qe.dimensions||{};bo[Nt]=Ut,qe.dimensions=bo})}),qe},Ns=Ge=>qe=>{const Nt=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Ge.notificationManager.open({type:"error",text:Nt})},qr=Ge=>{const qe=Ge.selection.getNode(),Nt=bn(qe)?Ge.serializer.serialize(qe,{selection:!0}):"",Ut=Ct(Nt,Ge.schema),Lo=(()=>{if(Ls(Ut.source,Ut.type)){const Go=Ge.dom.getRect(qe);return{width:Go.w.toString().replace(/px$/,""),height:Go.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Nt,...Ut,...Lo}},$o=(Ge,qe)=>Nt=>{if(a(Nt.url)&&Nt.url.trim().length>0){const Ut=Nt.html,Lo={...Ct(Ut,qe.schema),source:Nt.url,embed:Ut};Ge.setData(dr(Lo))}},Po=(Ge,qe)=>{const Nt=Ge.dom.select("*[data-mce-object]");for(let Ut=0;Ut<qe.length;Ut++)for(let bo=Nt.length-1;bo>=0;bo--)qe[Ut]===Nt[bo]&&Nt.splice(bo,1);Ge.selection.select(Nt[0])},Rr=(Ge,qe)=>{const Nt=Ge.dom.select("*[data-mce-object]");Ge.insertContent(qe),Po(Ge,Nt),Ge.nodeChanged()},Ls=(Ge,qe)=>h(qe)&&qe==="ephox-embed-iri"&&h(as(Ge)),aa=(Ge,qe)=>((Ut,bo)=>Ut.width!==bo.width||Ut.height!==bo.height)(Ge,qe)&&Ls(qe.source,Ge.type),bs=(Ge,qe,Nt)=>{var Ut;qe.embed=aa(Ge,qe)&&Xe(Nt)?Gt(Nt,{...qe,embed:""}):Zo((Ut=qe.embed)!==null&&Ut!==void 0?Ut:"",qe,!1,Nt.schema),qe.embed&&(Ge.source===qe.source||Mr(qe.source))?Rr(Nt,qe.embed):Ss(Nt,qe).then(bo=>{Rr(Nt,bo.html)}).catch(Ns(Nt))},_a=Ge=>{const qe=qr(Ge),Nt=R(qe),Ut=dr(qe),bo=(ga,nr)=>{const Ar=wa(nr.getData(),"source");ga.source!==Ar.source&&($o(nl,Ge)({url:Ar.source,html:""}),Ss(Ge,Ar).then($o(nl,Ge)).catch(Ns(Ge)))},Lo=ga=>{var nr;const Ar=wa(ga.getData()),Ki=Ct((nr=Ar.embed)!==null&&nr!==void 0?nr:"",Ge.schema);ga.setData(dr(Ki))},Go=(ga,nr,Ar)=>{const Ki=wa(ga.getData(),nr),gl=aa(Ar,Ki)&&Xe(Ge)?{...Ki,embed:""}:Ki,kc=Gt(Ge,gl);ga.setData(dr({...gl,embed:kc}))},ei=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],lt=Xe(Ge)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Xo={title:"General",name:"general",items:E([ei,lt])},la={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ma=[];Oe(Ge)&&ma.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ce(Ge)&&ma.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const gr={title:"Advanced",name:"advanced",items:ma},Fc=[Xo,la];ma.length>0&&Fc.push(gr);const Cc={type:"tabpanel",tabs:Fc},nl=Ge.windowManager.open({title:"Insert/Edit Media",size:"normal",body:Cc,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:ga=>{const nr=wa(ga.getData());bs(Nt.get(),nr,Ge),ga.close()},onChange:(ga,nr)=>{switch(nr.name){case"source":bo(Nt.get(),ga);break;case"embed":Lo(ga);break;case"dimensions":case"altsource":case"poster":Go(ga,nr.name,Nt.get());break}Nt.set(wa(ga.getData()))},initialData:Ut})},ln=Ge=>({showDialog:()=>{_a(Ge)}}),vs=Ge=>{const qe=()=>{_a(Ge)};Ge.addCommand("mceMedia",qe)},Qi=(Ge,qe,Nt)=>qe===""||Ge.length>=qe.length&&Ge.substr(Nt,Nt+qe.length)===qe,ze=(Ge,qe)=>Qi(Ge,qe,0);var et=tinymce.util.Tools.resolve("tinymce.Env");const Tt=Ge=>{const qe=Ge.name;return qe==="iframe"||qe==="video"||qe==="audio"},Wt=(Ge,qe,Nt,Ut=null)=>{const bo=Ge.attr(Nt);return h(bo)?bo:K(qe,Nt)?null:Ut},Yn=(Ge,qe,Nt)=>{const Ut=qe.name==="img"||Ge.name==="video",bo=Ut?"300":null,Lo=Ge.name==="audio"?"30":"150",Go=Ut?Lo:null;qe.attr({width:Wt(Ge,Nt,"width",bo),height:Wt(Ge,Nt,"height",Go)})},po=(Ge,qe,Nt,Ut)=>{const bo=Et(Ge.schema).parse(Ut,{context:qe});for(;bo.firstChild;)Nt.append(bo.firstChild)},wo=(Ge,qe)=>{const Nt=qe.name,Ut=new st("img",1);return os(Ge,qe,Ut),Yn(qe,Ut,{}),Ut.attr({style:qe.attr("style"),src:et.transparentSrc,"data-mce-object":Nt,class:"mce-object mce-object-"+Nt}),Ut},fn=(Ge,qe)=>{var Nt;const Ut=qe.name,bo=new st("span",1);bo.attr({contentEditable:"false",style:qe.attr("style"),"data-mce-object":Ut,class:"mce-preview-object mce-object-"+Ut}),os(Ge,qe,bo);const Lo=Ge.dom.parseStyle((Nt=qe.attr("style"))!==null&&Nt!==void 0?Nt:""),Go=new st(Ut,1);if(Yn(qe,Go,Lo),Go.attr({src:qe.attr("src"),style:qe.attr("style"),class:qe.attr("class")}),Ut==="iframe")Go.attr({allowfullscreen:qe.attr("allowfullscreen"),frameborder:"0"});else{C(["controls","crossorigin","currentTime","loop","muted","poster","preload"],Ni=>{Go.attr(Ni,qe.attr(Ni))});const Xo=bo.attr("data-mce-html");h(Xo)&&po(Ge,Ut,Go,unescape(Xo))}const ei=new st("span",1);return ei.attr("class","mce-shim"),bo.append(Go),bo.append(ei),bo},os=(Ge,qe,Nt)=>{var Ut;const bo=(Ut=qe.attributes)!==null&&Ut!==void 0?Ut:[];let Lo=bo.length;for(;Lo--;){const Xo=bo[Lo].name;let Ni=bo[Lo].value;Xo!=="width"&&Xo!=="height"&&Xo!=="style"&&!ze(Xo,"data-mce-")&&((Xo==="data"||Xo==="src")&&(Ni=Ge.convertURL(Ni,Xo)),Nt.attr("data-mce-p-"+Xo,Ni))}const Go=rn({inner:!0},Ge.schema),ei=new st("div",1);C(qe.children(),Xo=>ei.append(Xo));const lt=Go.serialize(ei);lt&&(Nt.attr("data-mce-html",escape(lt)),Nt.empty())},xo=Ge=>{const qe=Ge.attr("class");return a(qe)&&/\btiny-pageembed\b/.test(qe)},fs=Ge=>{let qe=Ge;for(;qe=qe.parent;)if(qe.attr("data-ephox-embed-iri")||xo(qe))return!0;return!1},kr=Ge=>qe=>{let Nt=qe.length,Ut;for(;Nt--;)Ut=qe[Nt],Ut.parent&&(Ut.parent.attr("data-mce-object")||(Tt(Ut)&&we(Ge)?fs(Ut)||Ut.replace(fn(Ge,Ut)):fs(Ut)||Ut.replace(wo(Ge,Ut))))},Lr=(Ge,qe,Nt)=>{const Ut=Ge.options.get,bo=Ut("xss_sanitization"),Lo=ve(Ge);return Et(Ge.schema,{sanitize:bo,validate:Lo}).parse(Nt,{context:qe})},Vs=Ge=>{Ge.on("PreInit",()=>{const{schema:qe,serializer:Nt,parser:Ut}=Ge,bo=qe.getBoolAttrs();C("webkitallowfullscreen mozallowfullscreen".split(" "),Lo=>{bo[Lo]={}}),F({embed:["wmode"]},(Lo,Go)=>{const ei=qe.getElementRule(Go);ei&&C(Lo,lt=>{ei.attributes[lt]={},ei.attributesOrder.push(lt)})}),Ut.addNodeFilter("iframe,video,audio,object,embed",kr(Ge)),Nt.addAttributeFilter("data-mce-object",(Lo,Go)=>{var ei;let lt=Lo.length;for(;lt--;){const Xo=Lo[lt];if(!Xo.parent)continue;const Ni=Xo.attr(Go),la=new st(Ni,1);if(Ni!=="audio"){const Cc=Xo.attr("class");Cc&&Cc.indexOf("mce-preview-object")!==-1&&Xo.firstChild?la.attr({width:Xo.firstChild.attr("width"),height:Xo.firstChild.attr("height")}):la.attr({width:Xo.attr("width"),height:Xo.attr("height")})}la.attr({style:Xo.attr("style")});const ma=(ei=Xo.attributes)!==null&&ei!==void 0?ei:[];let gr=ma.length;for(;gr--;){const Cc=ma[gr].name;Cc.indexOf("data-mce-p-")===0&&la.attr(Cc.substr(11),ma[gr].value)}const Fc=Xo.attr("data-mce-html");if(Fc){const Cc=Lr(Ge,Ni,unescape(Fc));C(Cc.children(),nl=>la.append(nl))}Xo.replace(la)}})}),Ge.on("SetContent",()=>{const qe=Ge.dom;C(qe.select("span.mce-preview-object"),Nt=>{qe.select("span.mce-shim",Nt).length===0&&qe.add(Nt,"span",{class:"mce-shim"})})})},Yr=Ge=>{Ge.on("ResolveName",qe=>{let Nt;qe.target.nodeType===1&&(Nt=qe.target.getAttribute("data-mce-object"))&&(qe.name=Nt)})},Zi=Ge=>qe=>{const Nt=()=>{qe.setEnabled(Ge.selection.isEditable())};return Ge.on("NodeChange",Nt),Nt(),()=>{Ge.off("NodeChange",Nt)}},Qa=Ge=>{const qe=()=>Ge.execCommand("mceMedia");Ge.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:qe,onSetup:Nt=>{const Ut=Ge.selection;Nt.setActive(bn(Ut.getNode()));const bo=Ut.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",Nt.setActive).unbind,Lo=Zi(Ge)(Nt);return()=>{bo(),Lo()}}}),Ge.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:qe,onSetup:Zi(Ge)})};var Oi=()=>{o.add("media",Ge=>(te(Ge),vs(Ge),Qa(Ge),Yr(Ge),Vs(Ge),At(Ge),ln(Ge)))};Oi()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(ee,ue,Se)=>{var Je;return Se(ee,ue.prototype)?!0:((Je=ee.constructor)===null||Je===void 0?void 0:Je.name)===ue.name},t=ee=>{const ue=typeof ee;return ee===null?"null":ue==="object"&&Array.isArray(ee)?"array":ue==="object"&&e(ee,String,(Se,Je)=>Je.isPrototypeOf(Se))?"string":ue},s=ee=>ue=>t(ue)===ee,a=ee=>ue=>typeof ue===ee,l=s("string"),u=s("object"),d=s("array"),h=a("boolean"),b=ee=>ee==null,y=ee=>!b(ee),C=a("function"),E=a("number"),R=()=>{},$=ee=>()=>ee,Q=(ee,ue)=>ee===ue;function F(ee,...ue){return(...Se)=>{const Je=ue.concat(Se);return ee.apply(null,Je)}}const U=ee=>ue=>!ee(ue),K=$(!1);class L{constructor(ue,Se){this.tag=ue,this.value=Se}static some(ue){return new L(!0,ue)}static none(){return L.singletonNone}fold(ue,Se){return this.tag?Se(this.value):ue()}isSome(){return this.tag}isNone(){return!this.tag}map(ue){return this.tag?L.some(ue(this.value)):L.none()}bind(ue){return this.tag?ue(this.value):L.none()}exists(ue){return this.tag&&ue(this.value)}forall(ue){return!this.tag||ue(this.value)}filter(ue){return!this.tag||ue(this.value)?this:L.none()}getOr(ue){return this.tag?this.value:ue}or(ue){return this.tag?this:ue}getOrThunk(ue){return this.tag?this.value:ue()}orThunk(ue){return this.tag?this:ue()}getOrDie(ue){if(this.tag)return this.value;throw new Error(ue!=null?ue:"Called getOrDie on None")}static from(ue){return y(ue)?L.some(ue):L.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ue){this.tag&&ue(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}L.singletonNone=new L(!1);const te=Array.prototype.slice,ne=Array.prototype.indexOf,oe=Array.prototype.push,G=(ee,ue)=>ne.call(ee,ue),we=(ee,ue)=>G(ee,ue)>-1,ve=(ee,ue)=>{for(let Se=0,Je=ee.length;Se<Je;Se++){const at=ee[Se];if(ue(at,Se))return!0}return!1},Re=(ee,ue)=>{const Se=ee.length,Je=new Array(Se);for(let at=0;at<Se;at++){const Dn=ee[at];Je[at]=ue(Dn,at)}return Je},Oe=(ee,ue)=>{for(let Se=0,Je=ee.length;Se<Je;Se++){const at=ee[Se];ue(at,Se)}},ce=(ee,ue)=>{const Se=[];for(let Je=0,at=ee.length;Je<at;Je++){const Dn=ee[Je];ue(Dn,Je)&&Se.push(Dn)}return Se},Xe=(ee,ue)=>{if(ee.length===0)return[];{let Se=ue(ee[0]);const Je=[];let at=[];for(let Dn=0,wn=ee.length;Dn<wn;Dn++){const Ko=ee[Dn],ss=ue(Ko);ss!==Se&&(Je.push(at),at=[]),Se=ss,at.push(Ko)}return at.length!==0&&Je.push(at),Je}},tt=(ee,ue,Se)=>(Oe(ee,(Je,at)=>{Se=ue(Se,Je,at)}),Se),ot=(ee,ue,Se)=>{for(let Je=0,at=ee.length;Je<at;Je++){const Dn=ee[Je];if(ue(Dn,Je))return L.some(Dn);if(Se(Dn,Je))break}return L.none()},V=(ee,ue)=>ot(ee,ue,K),ut=ee=>{const ue=[];for(let Se=0,Je=ee.length;Se<Je;++Se){if(!d(ee[Se]))throw new Error("Arr.flatten item "+Se+" was not an array, input: "+ee);oe.apply(ue,ee[Se])}return ue},Qe=(ee,ue)=>ut(Re(ee,ue)),Bt=ee=>{const ue=te.call(ee,0);return ue.reverse(),ue},Ct=(ee,ue)=>ue>=0&&ue<ee.length?L.some(ee[ue]):L.none(),He=ee=>Ct(ee,0),st=ee=>Ct(ee,ee.length-1),rn=(ee,ue)=>{const Se=[],Je=C(ue)?at=>ve(Se,Dn=>ue(Dn,at)):at=>we(Se,at);for(let at=0,Dn=ee.length;at<Dn;at++){const wn=ee[at];Je(wn)||Se.push(wn)}return Se},Et=(ee,ue,Se=Q)=>ee.exists(Je=>Se(Je,ue)),Cn=(ee,ue,Se=Q)=>je(ee,ue,Se).getOr(ee.isNone()&&ue.isNone()),je=(ee,ue,Se)=>ee.isSome()&&ue.isSome()?L.some(Se(ee.getOrDie(),ue.getOrDie())):L.none(),mt=1,he=(ee,ue)=>{const Je=(ue||document).createElement("div");if(Je.innerHTML=ee,!Je.hasChildNodes()||Je.childNodes.length>1){const at="HTML does not have a single root node";throw console.error(at,ee),new Error(at)}return so(Je.childNodes[0])},Zo=(ee,ue)=>{const Je=(ue||document).createElement(ee);return so(Je)},Kn=(ee,ue)=>{const Je=(ue||document).createTextNode(ee);return so(Je)},so=ee=>{if(ee==null)throw new Error("Node cannot be null or undefined");return{dom:ee}},as={fromHtml:he,fromTag:Zo,fromText:Kn,fromDom:so,fromPoint:(ee,ue,Se)=>L.from(ee.dom.elementFromPoint(ue,Se)).map(so)},kt=(ee,ue)=>{const Se=ee.dom;if(Se.nodeType!==mt)return!1;{const Je=Se;if(Je.matches!==void 0)return Je.matches(ue);if(Je.msMatchesSelector!==void 0)return Je.msMatchesSelector(ue);if(Je.webkitMatchesSelector!==void 0)return Je.webkitMatchesSelector(ue);if(Je.mozMatchesSelector!==void 0)return Je.mozMatchesSelector(ue);throw new Error("Browser lacks native selectors")}},jt=(ee,ue)=>ee.dom===ue.dom,pt=(ee,ue)=>{const Se=ee.dom,Je=ue.dom;return Se===Je?!1:Se.contains(Je)},Ne=kt;var Gt=(ee,ue,Se,Je,at)=>ee(Se,Je)?L.some(Se):C(at)&&at(Se)?L.none():ue(Se,Je,at);typeof window<"u"||Function("return this;")();const bn=ee=>ee.dom.nodeName.toLowerCase(),At=ee=>ee.dom.nodeType,zn=(ee=>ue=>At(ue)===ee)(mt),ps=ee=>ue=>zn(ue)&&bn(ue)===ee,oo=ee=>L.from(ee.dom.parentNode).map(as.fromDom),Ss=ee=>L.from(ee.dom.parentElement).map(as.fromDom),Mr=ee=>L.from(ee.dom.nextSibling).map(as.fromDom),$s=ee=>Re(ee.dom.childNodes,as.fromDom),tr=(ee,ue)=>{const Se=ee.dom.childNodes;return L.from(Se[ue]).map(as.fromDom)},Xs=ee=>tr(ee,0),wa=ee=>tr(ee,ee.dom.childNodes.length-1),dr=(ee,ue,Se)=>{let Je=ee.dom;const at=C(Se)?Se:K;for(;Je.parentNode;){Je=Je.parentNode;const Dn=as.fromDom(Je);if(ue(Dn))return L.some(Dn);if(at(Dn))break}return L.none()},Ns=(ee,ue,Se)=>Gt((at,Dn)=>Dn(at),dr,ee,ue,Se),qr=(ee,ue)=>{oo(ee).each(Je=>{Je.dom.insertBefore(ue.dom,ee.dom)})},$o=(ee,ue)=>{Mr(ee).fold(()=>{oo(ee).each(at=>{Po(at,ue)})},Je=>{qr(Je,ue)})},Po=(ee,ue)=>{ee.dom.appendChild(ue.dom)},Rr=(ee,ue)=>{Oe(ue,Se=>{qr(ee,Se)})},Ls=(ee,ue)=>{Oe(ue,Se=>{Po(ee,Se)})},aa=ee=>{ee.dom.textContent="",Oe($s(ee),ue=>{bs(ue)})},bs=ee=>{const ue=ee.dom;ue.parentNode!==null&&ue.parentNode.removeChild(ue)};var _a=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ln=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),vs=tinymce.util.Tools.resolve("tinymce.util.VK");const Qi=ee=>Re(ee,as.fromDom),ze=Object.keys,et=(ee,ue)=>{const Se=ze(ee);for(let Je=0,at=Se.length;Je<at;Je++){const Dn=Se[Je],wn=ee[Dn];ue(wn,Dn)}},Tt=ee=>(ue,Se)=>{ee[Se]=ue},Wt=(ee,ue,Se,Je)=>{et(ee,(at,Dn)=>{(ue(at,Dn)?Se:Je)(at,Dn)})},Yn=(ee,ue)=>{const Se={};return Wt(ee,ue,Tt(Se),R),Se},po=(ee,ue,Se)=>{if(l(Se)||h(Se)||E(Se))ee.setAttribute(ue,Se+"");else throw console.error("Invalid call to Attribute.set. Key ",ue,":: Value ",Se,":: Element ",ee),new Error("Attribute value was not simple")},wo=(ee,ue)=>{const Se=ee.dom;et(ue,(Je,at)=>{po(Se,at,Je)})},fn=ee=>tt(ee.dom.attributes,(ue,Se)=>(ue[Se.name]=Se.value,ue),{}),os=(ee,ue)=>as.fromDom(ee.dom.cloneNode(ue)),xo=ee=>os(ee,!0),fs=(ee,ue)=>{const Se=as.fromTag(ue),Je=fn(ee);return wo(Se,Je),Se},kr=(ee,ue)=>{const Se=fs(ee,ue);$o(ee,Se);const Je=$s(ee);return Ls(Se,Je),bs(ee),Se};var Lr=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vs=tinymce.util.Tools.resolve("tinymce.util.Tools");const Yr=ee=>ue=>y(ue)&&ue.nodeName.toLowerCase()===ee,Zi=ee=>ue=>y(ue)&&ee.test(ue.nodeName),Qa=ee=>y(ee)&&ee.nodeType===3,Oi=ee=>y(ee)&&ee.nodeType===1,Ge=Zi(/^(OL|UL|DL)$/),qe=Zi(/^(OL|UL)$/),Nt=Yr("ol"),Ut=Zi(/^(LI|DT|DD)$/),bo=Zi(/^(DT|DD)$/),Lo=Zi(/^(TH|TD)$/),Go=Yr("br"),ei=ee=>{var ue;return((ue=ee.parentNode)===null||ue===void 0?void 0:ue.firstChild)===ee},lt=(ee,ue)=>y(ue)&&ue.nodeName in ee.schema.getTextBlockElements(),Xo=(ee,ue)=>y(ee)&&ee.nodeName in ue,Ni=(ee,ue)=>y(ue)&&ue.nodeName in ee.schema.getVoidElements(),la=(ee,ue)=>Go(ue)?ee.isBlock(ue.nextSibling)&&!Go(ue.previousSibling):!1,ma=(ee,ue,Se)=>{const Je=ee.isEmpty(ue);return Se&&ee.select("span[data-mce-type=bookmark]",ue).length>0?!1:Je},gr=(ee,ue)=>ee.isChildOf(ue,ee.getRoot()),Fc=ee=>ue=>ue.options.get(ee),Cc=ee=>{const ue=ee.options.register;ue("lists_indent_on_tab",{processor:"boolean",default:!0})},nl=Fc("lists_indent_on_tab"),ga=Fc("forced_root_block"),nr=Fc("forced_root_block_attrs"),Ar=(ee,ue)=>{const Se=ee.dom,Je=ee.schema.getBlockElements(),at=Se.createFragment(),Dn=ga(ee),wn=nr(ee);let Ko,ss,vo=!1;for(ss=Se.create(Dn,wn),Xo(ue.firstChild,Je)||at.appendChild(ss);Ko=ue.firstChild;){const Tr=Ko.nodeName;!vo&&(Tr!=="SPAN"||Ko.getAttribute("data-mce-type")!=="bookmark")&&(vo=!0),Xo(Ko,Je)?(at.appendChild(Ko),ss=null):(ss||(ss=Se.create(Dn,wn),at.appendChild(ss)),ss.appendChild(Ko))}return!vo&&ss&&ss.appendChild(Se.create("br",{"data-mce-bogus":"1"})),at},Ki=Lr.DOM,gl=(ee,ue,Se)=>{const Je=vo=>{const Tr=vo.parentNode;Tr&&Vs.each(at,Gl=>{Tr.insertBefore(Gl,Se.parentNode)}),Ki.remove(vo)},at=Ki.select('span[data-mce-type="bookmark"]',ue),Dn=Ar(ee,Se),wn=Ki.createRng();wn.setStartAfter(Se),wn.setEndAfter(ue);const Ko=wn.extractContents();for(let vo=Ko.firstChild;vo;vo=vo.firstChild)if(vo.nodeName==="LI"&&ee.dom.isEmpty(vo)){Ki.remove(vo);break}ee.dom.isEmpty(Ko)||Ki.insertAfter(Ko,ue),Ki.insertAfter(Dn,ue);const ss=Se.parentElement;ss&&ma(ee.dom,ss)&&Je(ss),Ki.remove(Se),ma(ee.dom,ue)&&Ki.remove(ue)},kc=ps("dd"),nu=ps("dt"),xu=(ee,ue)=>{kc(ue)?kr(ue,"dt"):nu(ue)&&Ss(ue).each(Se=>gl(ee,Se.dom,ue.dom))},yr=ee=>{nu(ee)&&kr(ee,"dd")},ol=(ee,ue,Se)=>{ue==="Indent"?Oe(Se,yr):Oe(Se,Je=>xu(ee,Je))},Tu=(ee,ue)=>{if(Qa(ee))return{container:ee,offset:ue};const Se=_a.getNode(ee,ue);return Qa(Se)?{container:Se,offset:ue>=ee.childNodes.length?Se.data.length:0}:Se.previousSibling&&Qa(Se.previousSibling)?{container:Se.previousSibling,offset:Se.previousSibling.data.length}:Se.nextSibling&&Qa(Se.nextSibling)?{container:Se.nextSibling,offset:0}:{container:ee,offset:ue}},ou=ee=>{const ue=ee.cloneRange(),Se=Tu(ee.startContainer,ee.startOffset);ue.setStart(Se.container,Se.offset);const Je=Tu(ee.endContainer,ee.endOffset);return ue.setEnd(Je.container,Je.offset),ue},Yl=["OL","UL","DL"],Aa=Yl.join(","),Dr=(ee,ue)=>{const Se=ue||ee.selection.getStart(!0);return ee.dom.getParent(Se,Aa,Ha(ee,Se))},Qm=(ee,ue)=>y(ee)&&ue.length===1&&ue[0]===ee,xf=ee=>ce(ee.querySelectorAll(Aa),Ge),xr=ee=>{const ue=Dr(ee),Se=ee.selection.getSelectedBlocks();return Qm(ue,Se)?xf(ue):ce(Se,Je=>Ge(Je)&&ue!==Je)},Za=(ee,ue)=>{const Se=Vs.map(ue,Je=>{const at=ee.dom.getParent(Je,"li,dd,dt",Ha(ee,Je));return at||Je});return rn(Se)},ca=ee=>{const ue=ee.selection.getSelectedBlocks();return ce(Za(ee,ue),Ut)},Ji=ee=>ce(ca(ee),bo),Eu=(ee,ue)=>{const Se=ee.dom.getParents(ue,"TD,TH");return Se.length>0?Se[0]:ee.getBody()},Qc=(ee,ue)=>!Ge(ue)&&!Ut(ue)&&ve(Yl,Se=>ee.isValidChild(ue.nodeName,Se)),Ha=(ee,ue)=>{const Se=ee.dom.getParents(ue,ee.dom.isBlock);return V(Se,at=>Qc(ee.schema,at)).getOr(ee.getBody())},Zc=(ee,ue)=>{const Se=ee.dom.getParents(ue,"ol,ul",Ha(ee,ue));return st(Se)},xc=ee=>{const ue=Zc(ee,ee.selection.getStart()),Se=ce(ee.selection.getSelectedBlocks(),qe);return ue.toArray().concat(Se)},Cd=ee=>{const ue=xc(ee);return Yf(ee,ue)},Yf=(ee,ue)=>{const Se=Re(ue,Je=>Zc(ee,Je).getOr(Je));return rn(Se)},Au=ee=>/\btox\-/.test(ee.className),Xl=(ee,ue)=>ot(ee,Ge,Lo).exists(Se=>Se.nodeName===ue&&!Au(Se)),Hc=(ee,ue)=>ue!==null&&!ee.dom.isEditable(ue),Tf=ee=>{const ue=Dr(ee);return Hc(ee,ue)},su=(ee,ue)=>{const Se=ee.dom.getParent(ue,"ol,ul,dl");return Hc(ee,Se)},kd=(ee,ue)=>{const Se=ee.selection.getNode();return ue({parents:ee.dom.getParents(Se),element:Se}),ee.on("NodeChange",ue),()=>ee.off("NodeChange",ue)},De=(ee,ue)=>{const Je=(ue||document).createDocumentFragment();return Oe(ee,at=>{Je.appendChild(at.dom)}),as.fromDom(Je)},nt=(ee,ue,Se)=>ee.dispatch("ListMutation",{action:ue,element:Se}),$t=(ee=>ue=>ue.replace(ee,""))(/^\s+|\s+$/g),On=ee=>ee.length>0,Mo=ee=>!On(ee),$r=ee=>ee.style!==void 0&&C(ee.style.getPropertyValue),ys=(ee,ue,Se)=>{if(!l(Se))throw console.error("Invalid call to CSS.set. Property ",ue,":: Value ",Se,":: Element ",ee),new Error("CSS value must be a string: "+Se);$r(ee)&&ee.style.setProperty(ue,Se)},ls=(ee,ue,Se)=>{const Je=ee.dom;ys(Je,ue,Se)},Di=(ee,ue)=>{Po(ee.item,ue.list)},js=ee=>{for(let ue=1;ue<ee.length;ue++)Di(ee[ue-1],ee[ue])},Hi=(ee,ue)=>{je(st(ee),He(ue),Di)},Du=(ee,ue)=>{const Se={list:as.fromTag(ue,ee),item:as.fromTag("li",ee)};return Po(Se.list,Se.item),Se},xd=(ee,ue,Se)=>{const Je=[];for(let at=0;at<Se;at++)Je.push(Du(ee,ue.listType));return Je},qn=(ee,ue)=>{for(let Se=0;Se<ee.length-1;Se++)ls(ee[Se].item,"list-style-type","none");st(ee).each(Se=>{wo(Se.list,ue.listAttributes),wo(Se.item,ue.itemAttributes),Ls(Se.item,ue.content)})},Zm=(ee,ue)=>{bn(ee.list)!==ue.listType&&(ee.list=kr(ee.list,ue.listType)),wo(ee.list,ue.listAttributes)},zi=(ee,ue,Se)=>{const Je=as.fromTag("li",ee);return wo(Je,ue),Ls(Je,Se),Je},me=(ee,ue)=>{Po(ee.list,ue),ee.item=ue},$e=(ee,ue,Se)=>{const Je=ue.slice(0,Se.depth);return st(Je).each(at=>{const Dn=zi(ee,Se.itemAttributes,Se.content);me(at,Dn),Zm(at,Se)}),Je},Ue=(ee,ue,Se)=>{const Je=xd(ee,Se,Se.depth-ue.length);return js(Je),qn(Je,Se),Hi(ue,Je),ue.concat(Je)},It=(ee,ue)=>{const Se=tt(ue,(Je,at)=>at.depth>Je.length?Ue(ee,Je,at):$e(ee,Je,at),[]);return He(Se).map(Je=>Je.list)},Bn=ee=>Ne(ee,"OL,UL"),es=ee=>Xs(ee).exists(Bn),ro=ee=>wa(ee).exists(Bn),yi=ee=>ee.depth>0,gn=ee=>ee.isSelected,Gr=ee=>{const ue=$s(ee),Se=ro(ee)?ue.slice(0,-1):ue;return Re(Se,xo)},Ll=(ee,ue,Se)=>oo(ee).filter(zn).map(Je=>({depth:ue,dirty:!1,isSelected:Se,content:Gr(ee),itemAttributes:fn(ee),listAttributes:fn(Je),listType:bn(Je)})),ea=(ee,ue)=>{switch(ee){case"Indent":ue.depth++;break;case"Outdent":ue.depth--;break;case"Flatten":ue.depth=0}ue.dirty=!0},ri=(ee,ue)=>{ee.listType=ue.listType,ee.listAttributes={...ue.listAttributes}},Ef=ee=>{ee.listAttributes=Yn(ee.listAttributes,(ue,Se)=>Se!=="start")},ks=(ee,ue)=>{const Se=ee[ue].depth,Je=Dn=>Dn.depth===Se&&!Dn.dirty,at=Dn=>Dn.depth<Se;return ot(Bt(ee.slice(0,ue)),Je,at).orThunk(()=>ot(ee.slice(ue+1),Je,at))},ru=ee=>(Oe(ee,(ue,Se)=>{ks(ee,Se).fold(()=>{ue.dirty&&Ef(ue)},Je=>ri(ue,Je))}),ee),Pi=ee=>{let ue=ee;return{get:()=>ue,set:at=>{ue=at}}},uc=(ee,ue,Se,Je)=>Xs(Je).filter(Bn).fold(()=>{ue.each(wn=>{jt(wn.start,Je)&&Se.set(!0)});const at=Ll(Je,ee,Se.get());ue.each(wn=>{jt(wn.end,Je)&&Se.set(!1)});const Dn=wa(Je).filter(Bn).map(wn=>Ii(ee,ue,Se,wn)).getOr([]);return at.toArray().concat(Dn)},at=>Ii(ee,ue,Se,at)),Ii=(ee,ue,Se,Je)=>Qe($s(Je),at=>{const Dn=Bn(at)?Ii:uc,wn=ee+1;return Dn(wn,ue,Se,at)}),Xf=(ee,ue)=>{const Se=Pi(!1),Je=0;return Re(ee,at=>({sourceList:at,entries:Ii(Je,ue,Se,at)}))},pa=(ee,ue)=>{const Se=ru(ue);return Re(Se,Je=>{const at=De(Je.content);return as.fromDom(Ar(ee,at.dom))})},jf=(ee,ue)=>{const Se=ru(ue);return It(ee.contentDocument,Se).toArray()},pr=(ee,ue)=>Qe(Xe(ue,yi),Se=>He(Se).exists(yi)?jf(ee,Se):pa(ee,Se)),Gu=(ee,ue)=>{Oe(ce(ee,gn),Se=>ea(ue,Se))},Ku=ee=>{const ue=Re(ca(ee),as.fromDom);return je(V(ue,U(es)),V(Bt(ue),U(es)),(Se,Je)=>({start:Se,end:Je}))},Tc=(ee,ue,Se)=>{const Je=Xf(ue,Ku(ee));Oe(Je,at=>{Gu(at.entries,Se);const Dn=pr(ee,at.entries);Oe(Dn,wn=>{nt(ee,Se==="Indent"?"IndentList":"OutdentList",wn.dom)}),Rr(at.sourceList,Dn),bs(at.sourceList)})},qf=(ee,ue)=>{const Se=Qi(Cd(ee)),Je=Qi(Ji(ee));let at=!1;if(Se.length||Je.length){const Dn=ee.selection.getBookmark();Tc(ee,Se,ue),ol(ee,ue,Je),ee.selection.moveToBookmark(Dn),ee.selection.setRng(ou(ee.selection.getRng())),ee.nodeChanged(),at=!0}return at},eh=(ee,ue)=>!Tf(ee)&&qf(ee,ue),ti=ee=>eh(ee,"Indent"),ta=ee=>eh(ee,"Outdent"),za=ee=>eh(ee,"Flatten"),Kb="\uFEFF",Mi=ee=>ee===Kb,kl=(ee,ue,Se)=>dr(ee,ue,Se).isSome(),sl=(ee,ue)=>kl(ee,F(jt,ue));var Zg=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const Gf=Lr.DOM,Ec=ee=>{const ue={},Se=Je=>{let at=ee[Je?"startContainer":"endContainer"],Dn=ee[Je?"startOffset":"endOffset"];if(Oi(at)){const wn=Gf.create("span",{"data-mce-type":"bookmark"});at.hasChildNodes()?(Dn=Math.min(Dn,at.childNodes.length-1),Je?at.insertBefore(wn,at.childNodes[Dn]):Gf.insertAfter(wn,at.childNodes[Dn])):at.appendChild(wn),at=wn,Dn=0}ue[Je?"startContainer":"endContainer"]=at,ue[Je?"startOffset":"endOffset"]=Dn};return Se(!0),ee.collapsed||Se(),ue},Af=ee=>{const ue=Je=>{const at=Ko=>{var ss;let vo=(ss=Ko.parentNode)===null||ss===void 0?void 0:ss.firstChild,Tr=0;for(;vo;){if(vo===Ko)return Tr;(!Oi(vo)||vo.getAttribute("data-mce-type")!=="bookmark")&&Tr++,vo=vo.nextSibling}return-1};let Dn=ee[Je?"startContainer":"endContainer"],wn=ee[Je?"startOffset":"endOffset"];if(!!Dn){if(Oi(Dn)&&Dn.parentNode){const Ko=Dn;wn=at(Dn),Dn=Dn.parentNode,Gf.remove(Ko),!Dn.hasChildNodes()&&Gf.isBlock(Dn)&&Dn.appendChild(Gf.create("br"))}ee[Je?"startContainer":"endContainer"]=Dn,ee[Je?"startOffset":"endOffset"]=wn}};ue(!0),ue();const Se=Gf.createRng();return Se.setStart(ee.startContainer,ee.startOffset),ee.endContainer&&Se.setEnd(ee.endContainer,ee.endOffset),ou(Se)},Pr=ee=>{switch(ee){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ju=(ee,ue,Se)=>{const Je=Se["list-style-type"]?Se["list-style-type"]:null;ee.setStyle(ue,"list-style-type",Je)},Fl=(ee,ue)=>{Vs.each(ue,(Se,Je)=>{ee.setAttribute(Je,Se)})},Va=(ee,ue,Se)=>{Fl(ue,Se["list-attributes"]),Vs.each(ee.select("li",ue),Je=>{Fl(Je,Se["list-item-attributes"])})},qi=(ee,ue,Se)=>{Ju(ee,ue,Se),Va(ee,ue,Se)},Vi=(ee,ue,Se)=>{Vs.each(Se,Je=>ee.setStyle(ue,Je,""))},fc=(ee,ue)=>y(ue)&&!Xo(ue,ee.schema.getBlockElements()),Kf=(ee,ue,Se,Je)=>{let at=ue[Se?"startContainer":"endContainer"];const Dn=ue[Se?"startOffset":"endOffset"];Oi(at)&&(at=at.childNodes[Math.min(Dn,at.childNodes.length-1)]||at),!Se&&Go(at.nextSibling)&&(at=at.nextSibling);const wn=ss=>{for(;!ee.dom.isBlock(ss)&&ss.parentNode&&Je!==ss;)ss=ss.parentNode;return ss},Ko=(ss,vo)=>{var Tr;const Gl=new ln(ss,wn(ss)),ua=vo?"next":"prev";let Bi;for(;Bi=Gl[ua]();)if(!(Ni(ee,Bi)||Mi(Bi.textContent)||((Tr=Bi.textContent)===null||Tr===void 0?void 0:Tr.length)===0))return L.some(Bi);return L.none()};if(Se&&Qa(at))if(Mi(at.textContent))at=Ko(at,!1).getOr(at);else for(at.parentNode!==null&&fc(ee,at.parentNode)&&(at=at.parentNode);at.previousSibling!==null&&(fc(ee,at.previousSibling)||Qa(at.previousSibling));)at=at.previousSibling;if(!Se&&Qa(at))if(Mi(at.textContent))at=Ko(at,!0).getOr(at);else for(at.parentNode!==null&&fc(ee,at.parentNode)&&(at=at.parentNode);at.nextSibling!==null&&(fc(ee,at.nextSibling)||Qa(at.nextSibling));)at=at.nextSibling;for(;at.parentNode!==Je;){const ss=at.parentNode;if(lt(ee,at)||/^(TD|TH)$/.test(ss.nodeName))return at;at=ss}return at},th=(ee,ue,Se)=>{const Je=[],at=ee.dom,Dn=Kf(ee,ue,!0,Se),wn=Kf(ee,ue,!1,Se);let Ko;const ss=[];for(let vo=Dn;vo&&(ss.push(vo),vo!==wn);vo=vo.nextSibling);return Vs.each(ss,vo=>{var Tr;if(lt(ee,vo)){Je.push(vo),Ko=null;return}if(at.isBlock(vo)||Go(vo)){Go(vo)&&at.remove(vo),Ko=null;return}const Gl=vo.nextSibling;if(Zg.isBookmarkNode(vo)&&(Ge(Gl)||lt(ee,Gl)||!Gl&&vo.parentNode===Se)){Ko=null;return}Ko||(Ko=at.create("p"),(Tr=vo.parentNode)===null||Tr===void 0||Tr.insertBefore(Ko,vo),Je.push(Ko)),Ko.appendChild(vo)}),Je},Hg=(ee,ue,Se)=>{const Je=ee.getStyle(ue,"list-style-type");let at=Se?Se["list-style-type"]:"";return at=at===null?"":at,Je===at},Hm=(ee,ue)=>{const Se=ee.selection.getStart(!0),Je=Kf(ee,ue,!0,ee.getBody());return sl(as.fromDom(Je),as.fromDom(ue.commonAncestorContainer))?ue.commonAncestorContainer:Se},Ql=(ee,ue,Se)=>{const Je=ee.selection.getRng();let at="LI";const Dn=Ha(ee,Hm(ee,Je)),wn=ee.dom;if(wn.getContentEditable(ee.selection.getNode())==="false")return;ue=ue.toUpperCase(),ue==="DL"&&(at="DT");const Ko=Ec(Je),ss=ce(th(ee,Je,Dn),ee.dom.isEditable);Vs.each(ss,vo=>{let Tr;const Gl=vo.previousSibling,ua=vo.parentNode;Ut(ua)||(Gl&&Ge(Gl)&&Gl.nodeName===ue&&Hg(wn,Gl,Se)?(Tr=Gl,vo=wn.rename(vo,at),Gl.appendChild(vo)):(Tr=wn.create(ue),ua.insertBefore(Tr,vo),Tr.appendChild(vo),vo=wn.rename(vo,at)),Vi(wn,vo,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),qi(wn,Tr,Se),ef(ee.dom,Tr))}),ee.selection.setRng(Af(Ko))},zm=(ee,ue)=>Ge(ee)&&ee.nodeName===(ue==null?void 0:ue.nodeName),rl=(ee,ue,Se)=>{const Je=ee.getStyle(ue,"list-style-type",!0),at=ee.getStyle(Se,"list-style-type",!0);return Je===at},Df=(ee,ue)=>ee.className===ue.className,jh=(ee,ue,Se)=>zm(ue,Se)&&rl(ee,ue,Se)&&Df(ue,Se),ef=(ee,ue)=>{let Se,Je=ue.nextSibling;if(jh(ee,ue,Je)){const at=Je;for(;Se=at.firstChild;)ue.appendChild(Se);ee.remove(at)}if(Je=ue.previousSibling,jh(ee,ue,Je)){const at=Je;for(;Se=at.lastChild;)ue.insertBefore(Se,ue.firstChild);ee.remove(at)}},qh=(ee,ue,Se,Je)=>{if(ue.nodeName!==Se){const at=ee.dom.rename(ue,Se);qi(ee.dom,at,Je),nt(ee,Pr(Se),at)}else qi(ee.dom,ue,Je),nt(ee,Pr(Se),ue)},zc=(ee,ue,Se,Je)=>{if(ue.classList.forEach((at,Dn,wn)=>{at.startsWith("tox-")&&(wn.remove(at),wn.length===0&&ue.removeAttribute("class"))}),ue.nodeName!==Se){const at=ee.dom.rename(ue,Se);qi(ee.dom,at,Je),nt(ee,Pr(Se),at)}else qi(ee.dom,ue,Je),nt(ee,Pr(Se),ue)},Gh=(ee,ue,Se,Je,at)=>{const Dn=Ge(ue);if(Dn&&ue.nodeName===Je&&!Pf(at)&&!Au(ue))za(ee);else{Ql(ee,Je,at);const wn=Ec(ee.selection.getRng()),Ko=Dn?[ue,...Se]:Se,ss=Dn&&Au(ue)?zc:qh;Vs.each(Ko,vo=>{ss(ee,vo,Je,at)}),ee.selection.setRng(Af(wn))}},Pf=ee=>"list-style-type"in ee,zp=(ee,ue,Se,Je)=>{if(ue!==ee.getBody())if(ue)if(ue.nodeName===Se&&!Pf(Je)&&!Au(ue))za(ee);else{const at=Ec(ee.selection.getRng());Au(ue)&&ue.classList.forEach((wn,Ko,ss)=>{wn.startsWith("tox-")&&(ss.remove(wn),ss.length===0&&ue.removeAttribute("class"))}),qi(ee.dom,ue,Je);const Dn=ee.dom.rename(ue,Se);ef(ee.dom,Dn),ee.selection.setRng(Af(at)),Ql(ee,Se,Je),nt(ee,Pr(Se),Dn)}else Ql(ee,Se,Je),nt(ee,Pr(Se),ue)},Vm=(ee,ue,Se)=>{const Je=Dr(ee);if(su(ee,Je))return;const at=xr(ee),Dn=u(Se)?Se:{};at.length>0?Gh(ee,Je,at,ue,Dn):zp(ee,Je,ue,Dn)},Jf=Lr.DOM,jl=(ee,ue)=>{const Se=ue.parentElement;if(Se&&Se.nodeName==="LI"&&Se.firstChild===ue){const Je=Se.previousSibling;Je&&Je.nodeName==="LI"?(Je.appendChild(ue),ma(ee,Se)&&Jf.remove(Se)):Jf.setStyle(Se,"listStyleType","none")}if(Ge(Se)){const Je=Se.previousSibling;Je&&Je.nodeName==="LI"&&Je.appendChild(ue)}},zg=(ee,ue)=>{const Se=Vs.grep(ee.select("ol,ul",ue));Vs.each(Se,Je=>{jl(ee,Je)})},Ke=(ee,ue,Se,Je)=>{let at=ue.startContainer;const Dn=ue.startOffset;if(Qa(at)&&(Se?Dn<at.data.length:Dn>0))return at;const wn=ee.schema.getNonEmptyElements();Oi(at)&&(at=_a.getNode(at,Dn));const Ko=new ln(at,Je);Se&&la(ee.dom,at)&&Ko.next();const ss=Se?Ko.next.bind(Ko):Ko.prev2.bind(Ko);for(;at=ss();)if(at.nodeName==="LI"&&!at.hasChildNodes()||wn[at.nodeName]||Qa(at)&&at.data.length>0)return at;return null},nh=(ee,ue)=>{const Se=ue.childNodes;return Se.length===1&&!Ge(Se[0])&&ee.isBlock(Se[0])},Pu=(ee,ue)=>{nh(ee,ue)&&ee.remove(ue.firstChild,!0)},Vg=(ee,ue,Se)=>{let Je;const at=nh(ee,Se)?Se.firstChild:Se;if(Pu(ee,ue),!ma(ee,ue,!0))for(;Je=ue.firstChild;)at.appendChild(Je)},U1=(ee,ue,Se)=>{let Je;const at=ue.parentNode;if(!gr(ee,ue)||!gr(ee,Se))return;Ge(Se.lastChild)&&(Je=Se.lastChild),at===Se.lastChild&&Go(at.previousSibling)&&ee.remove(at.previousSibling);const Dn=Se.lastChild;Dn&&Go(Dn)&&ue.hasChildNodes()&&ee.remove(Dn),ma(ee,Se,!0)&&aa(as.fromDom(Se)),Vg(ee,ue,Se),Je&&Se.appendChild(Je);const Ko=pt(as.fromDom(Se),as.fromDom(ue))?ee.getParents(ue,Ge,Se):[];ee.remove(ue),Oe(Ko,ss=>{ma(ee,ss)&&ss!==ee.getRoot()&&ee.remove(ss)})},Kh=(ee,ue,Se)=>{aa(as.fromDom(Se)),U1(ee.dom,ue,Se),ee.selection.setCursorLocation(Se,0)},vt=(ee,ue,Se,Je)=>{const at=ee.dom;if(at.isEmpty(Je))Kh(ee,Se,Je);else{const Dn=Ec(ue);U1(at,Se,Je),ee.selection.setRng(Af(Dn))}},cn=(ee,ue,Se,Je)=>{const at=Ec(ue);U1(ee.dom,Se,Je);const Dn=Af(at);ee.selection.setRng(Dn)},an=(ee,ue)=>{const Se=ee.dom,Je=ee.selection,at=Je.getStart(),Dn=Eu(ee,at),wn=Se.getParent(Je.getStart(),"LI",Dn);if(wn){const Ko=wn.parentElement;if(Ko===ee.getBody()&&ma(Se,Ko))return!0;const ss=ou(Je.getRng()),vo=Se.getParent(Ke(ee,ss,ue,Dn),"LI",Dn);if(vo&&vo!==wn)return ee.undoManager.transact(()=>{ue?vt(ee,ss,vo,wn):ei(wn)?ta(ee):cn(ee,ss,wn,vo)}),!0;if(!vo&&!ue&&ss.startOffset===0&&ss.endOffset===0)return ee.undoManager.transact(()=>{za(ee)}),!0}return!1},Eo=(ee,ue,Se)=>{const Je=ee.getParent(ue.parentNode,ee.isBlock,Se);ee.remove(ue),Je&&ee.isEmpty(Je)&&ee.remove(Je)},or=(ee,ue)=>{const Se=ee.dom,Je=ee.selection.getStart(),at=Eu(ee,Je),Dn=Se.getParent(Je,Se.isBlock,at);if(Dn&&Se.isEmpty(Dn)){const wn=ou(ee.selection.getRng()),Ko=Se.getParent(Ke(ee,wn,ue,at),"LI",at);if(Ko){const ss=ua=>we(["td","th","caption"],bn(ua)),vo=ua=>ua.dom===at,Tr=Ns(as.fromDom(Ko),ss,vo),Gl=Ns(as.fromDom(wn.startContainer),ss,vo);return Cn(Tr,Gl,jt)?(ee.undoManager.transact(()=>{const ua=Ko.parentNode;Eo(Se,Dn,at),ef(Se,ua),ee.selection.select(Ko,!0),ee.selection.collapse(ue)}),!0):!1}}return!1},Xr=(ee,ue)=>an(ee,ue)||or(ee,ue),fi=ee=>{const ue=ee.selection.getStart(),Se=Eu(ee,ue);return ee.dom.getParent(ue,"LI,DT,DD",Se)||ca(ee).length>0},wi=ee=>fi(ee)?(ee.undoManager.transact(()=>{ee.execCommand("Delete"),zg(ee.dom,ee.getBody())}),!0):!1,oh=(ee,ue)=>{const Se=ee.selection;return!su(ee,Se.getNode())&&(Se.isCollapsed()?Xr(ee,ue):wi(ee))},Jb=ee=>{ee.on("ExecCommand",ue=>{const Se=ue.command.toLowerCase();(Se==="delete"||Se==="forwarddelete")&&fi(ee)&&zg(ee.dom,ee.getBody())}),ee.on("keydown",ue=>{ue.keyCode===vs.BACKSPACE?oh(ee,!1)&&ue.preventDefault():ue.keyCode===vs.DELETE&&oh(ee,!0)&&ue.preventDefault()})},Sa=ee=>({backspaceDelete:ue=>{oh(ee,ue)}}),Td=(ee,ue)=>{const Se=Dr(ee);Se===null||su(ee,Se)||ee.undoManager.transact(()=>{u(ue.styles)&&ee.dom.setStyles(Se,ue.styles),u(ue.attrs)&&et(ue.attrs,(Je,at)=>ee.dom.setAttrib(Se,at,Je))})},Wg=ee=>{const ue=Bt($t(ee).split("")),Se=Re(ue,(Je,at)=>{const Dn=Je.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,at)*Dn});return tt(Se,(Je,at)=>Je+at,0)},il=ee=>{if(ee--,ee<0)return"";{const ue=ee%26,Se=Math.floor(ee/26),Je=il(Se),at=String.fromCharCode("A".charCodeAt(0)+ue);return Je+at}},Da=ee=>/^[A-Z]+$/.test(ee),tf=ee=>/^[a-z]+$/.test(ee),ii=ee=>/^[0-9]+$/.test(ee),Mu=ee=>ii(ee)?2:Da(ee)?0:tf(ee)?1:Mo(ee)?3:4,dc=ee=>{switch(Mu(ee)){case 2:return L.some({listStyleType:L.none(),start:ee});case 0:return L.some({listStyleType:L.some("upper-alpha"),start:Wg(ee).toString()});case 1:return L.some({listStyleType:L.some("lower-alpha"),start:Wg(ee).toString()});case 3:return L.some({listStyleType:L.none(),start:""});case 4:return L.none()}},Jh=ee=>{const ue=parseInt(ee.start,10);return Et(ee.listStyleType,"upper-alpha")?il(ue):Et(ee.listStyleType,"lower-alpha")?il(ue).toLowerCase():ee.start},Y1=ee=>{const ue=Dr(ee);!Nt(ue)||su(ee,ue)||ee.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Jh({start:ee.dom.getAttrib(ue,"start","1"),listStyleType:L.from(ee.dom.getStyle(ue,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Se=>{const Je=Se.getData();dc(Je.start).each(at=>{ee.execCommand("mceListUpdate",!1,{attrs:{start:at.start==="1"?"":at.start},styles:{"list-style-type":at.listStyleType.getOr("")}})}),Se.close()}})},sh=(ee,ue)=>()=>{const Se=Dr(ee);return y(Se)&&Se.nodeName===ue},Ug=ee=>{ee.addCommand("mceListProps",()=>{Y1(ee)})},rh=ee=>{ee.on("BeforeExecCommand",ue=>{const Se=ue.command.toLowerCase();Se==="indent"?ti(ee):Se==="outdent"&&ta(ee)}),ee.addCommand("InsertUnorderedList",(ue,Se)=>{Vm(ee,"UL",Se)}),ee.addCommand("InsertOrderedList",(ue,Se)=>{Vm(ee,"OL",Se)}),ee.addCommand("InsertDefinitionList",(ue,Se)=>{Vm(ee,"DL",Se)}),ee.addCommand("RemoveList",()=>{za(ee)}),Ug(ee),ee.addCommand("mceListUpdate",(ue,Se)=>{u(Se)&&Td(ee,Se)}),ee.addQueryStateHandler("InsertUnorderedList",sh(ee,"UL")),ee.addQueryStateHandler("InsertOrderedList",sh(ee,"OL")),ee.addQueryStateHandler("InsertDefinitionList",sh(ee,"DL"))};var ql=tinymce.util.Tools.resolve("tinymce.html.Node");const em=ee=>ee.type===3,X1=ee=>ee.length===0,Wm=ee=>{const ue=(at,Dn)=>{const wn=ql.create("li");Oe(at,Ko=>wn.append(Ko)),Dn?ee.insert(wn,Dn,!0):ee.append(wn)},Se=(at,Dn)=>em(Dn)?[...at,Dn]:!X1(at)&&!em(Dn)?(ue(at,Dn),[]):at,Je=tt(ee.children(),Se,[]);X1(Je)||ue(Je)},Yg=ee=>{ee.on("PreInit",()=>{const{parser:ue}=ee;ue.addNodeFilter("ul,ol",Se=>Oe(Se,Wm))})},tm=ee=>{ee.on("keydown",ue=>{ue.keyCode!==vs.TAB||vs.metaKeyPressed(ue)||ee.undoManager.transact(()=>{(ue.shiftKey?ta(ee):ti(ee))&&ue.preventDefault()})})},ih=ee=>{nl(ee)&&tm(ee),Jb(ee)},Ed=(ee,ue)=>Se=>{const Je=at=>{Se.setActive(Xl(at.parents,ue)),Se.setEnabled(!su(ee,at.element)&&ee.selection.isEditable())};return Se.setEnabled(ee.selection.isEditable()),kd(ee,Je)},ai=ee=>{const ue=Se=>()=>ee.execCommand(Se);ee.hasPlugin("advlist")||(ee.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:ue("InsertOrderedList"),onSetup:Ed(ee,"OL")}),ee.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:ue("InsertUnorderedList"),onSetup:Ed(ee,"UL")}))},di=(ee,ue)=>Se=>kd(ee,at=>Se.setEnabled(Xl(at.parents,ue)&&!su(ee,at.element))),Zl=ee=>{const ue={text:"List properties...",icon:"ordered-list",onAction:()=>ee.execCommand("mceListProps"),onSetup:di(ee,"OL")};ee.ui.registry.addMenuItem("listprops",ue),ee.ui.registry.addContextMenu("lists",{update:Se=>{const Je=Dr(ee,Se);return Nt(Je)?["listprops"]:[]}})};var Vp=()=>{o.add("lists",ee=>(Cc(ee),Yg(ee),ee.hasPlugin("rtc",!0)?Ug(ee):(ih(ee),rh(ee)),ai(ee),Zl(ee),Sa(ee)))};Vp()})();(function(){const o=L=>{let te=L;return{get:()=>te,set:G=>{te=G}}};var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=L=>()=>L;var s=tinymce.util.Tools.resolve("tinymce.Env");const a=L=>L.dispatch("ResizeEditor"),l=L=>te=>te.options.get(L),u=L=>{const te=L.options.register;te("autoresize_overflow_padding",{processor:"number",default:1}),te("autoresize_bottom_margin",{processor:"number",default:50})},d=l("min_height"),h=l("max_height"),b=l("autoresize_overflow_padding"),y=l("autoresize_bottom_margin"),C=L=>L.plugins.fullscreen&&L.plugins.fullscreen.isFullscreen(),E=(L,te)=>{const ne=L.getBody();ne&&(ne.style.overflowY=te?"":"hidden",te||(ne.scrollTop=0))},R=(L,te,ne,oe)=>{var G;const we=parseInt((G=L.getStyle(te,ne,oe))!==null&&G!==void 0?G:"",10);return isNaN(we)?0:we},$=L=>{if((L==null?void 0:L.type.toLowerCase())==="setcontent"){const te=L;return te.selection===!0||te.paste===!0}else return!1},Q=(L,te,ne,oe)=>{var G;const we=L.dom,ve=L.getDoc();if(!ve)return;if(C(L)){E(L,!0);return}const Re=ve.documentElement,Oe=oe?oe():b(L),ce=(G=d(L))!==null&&G!==void 0?G:L.getElement().offsetHeight;let Xe=ce;const tt=R(we,Re,"margin-top",!0),ot=R(we,Re,"margin-bottom",!0);let V=Re.offsetHeight+tt+ot+Oe;V<0&&(V=0);const ut=L.getContainer().offsetHeight,Qe=L.getContentAreaContainer().offsetHeight,Bt=ut-Qe;V+Bt>ce&&(Xe=V+Bt);const Ct=h(L);if(Ct&&Xe>Ct?(Xe=Ct,E(L,!0)):E(L,!1),Xe!==te.get()){const He=Xe-te.get();if(we.setStyle(L.getContainer(),"height",Xe+"px"),te.set(Xe),a(L),s.browser.isSafari()&&(s.os.isMacOS()||s.os.isiOS())){const st=L.getWin();st.scrollTo(st.pageXOffset,st.pageYOffset)}L.hasFocus()&&$(ne)&&L.selection.scrollIntoView(),(s.browser.isSafari()||s.browser.isChromium())&&He<0&&Q(L,te,ne,oe)}},F=(L,te)=>{let ne=()=>y(L),oe,G;L.on("init",we=>{oe=0;const ve=b(L),Re=L.dom;Re.setStyles(L.getDoc().documentElement,{height:"auto"}),s.browser.isEdge()||s.browser.isIE()?Re.setStyles(L.getBody(),{paddingLeft:ve,paddingRight:ve,"min-height":0}):Re.setStyles(L.getBody(),{paddingLeft:ve,paddingRight:ve}),Q(L,te,we,ne),oe+=1}),L.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",we=>{if(oe===1)G=L.getContainer().offsetHeight,Q(L,te,we,ne),oe+=1;else if(oe===2){const ve=G<L.getContainer().offsetHeight;if(ve){const Re=L.dom,Oe=L.getDoc();Re.setStyles(Oe.documentElement,{"min-height":0}),Re.setStyles(L.getBody(),{"min-height":"inherit"})}ne=ve?t(0):ne,oe+=1}else Q(L,te,we,ne)})},U=(L,te)=>{L.addCommand("mceAutoResize",()=>{Q(L,te)})};var K=()=>{e.add("autoresize",L=>{if(u(L),L.options.isSet("resize")||L.options.set("resize",!1),!L.inline){const te=o(0);U(L,te),F(L,te)}})};K()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(kt=>jt=>kt===jt)(null),s=kt=>kt,a=(kt,jt)=>{const pt=kt.length,Ne=new Array(pt);for(let Gt=0;Gt<pt;Gt++){const bn=kt[Gt];Ne[Gt]=jt(bn,Gt)}return Ne},u={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]"},d={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},h=[new RegExp(u.aletter),new RegExp(u.midnumlet),new RegExp(u.midletter),new RegExp(u.midnum),new RegExp(u.numeric),new RegExp(u.cr),new RegExp(u.lf),new RegExp(u.newline),new RegExp(u.extend),new RegExp(u.format),new RegExp(u.katakana),new RegExp(u.extendnumlet),new RegExp("@")],b="",y=new RegExp("^"+u.punctuation+"$"),C=/^\s+$/,E=h,R=d.OTHER,$=kt=>{let jt=R;const pt=E.length;for(let Ne=0;Ne<pt;++Ne){const Gt=E[Ne];if(Gt&&Gt.test(kt)){jt=Ne;break}}return jt},Q=kt=>{const jt={};return pt=>{if(jt[pt])return jt[pt];{const Ne=kt(pt);return jt[pt]=Ne,Ne}}},F=kt=>{const jt=Q($);return a(kt,jt)},U=(kt,jt)=>{const pt=kt[jt],Ne=kt[jt+1];if(jt<0||jt>kt.length-1&&jt!==0||pt===d.ALETTER&&Ne===d.ALETTER)return!1;const Gt=kt[jt+2];if(pt===d.ALETTER&&(Ne===d.MIDLETTER||Ne===d.MIDNUMLET||Ne===d.AT)&&Gt===d.ALETTER)return!1;const bn=kt[jt-1];return(pt===d.MIDLETTER||pt===d.MIDNUMLET||Ne===d.AT)&&Ne===d.ALETTER&&bn===d.ALETTER||(pt===d.NUMERIC||pt===d.ALETTER)&&(Ne===d.NUMERIC||Ne===d.ALETTER)||(pt===d.MIDNUM||pt===d.MIDNUMLET)&&Ne===d.NUMERIC&&bn===d.NUMERIC||pt===d.NUMERIC&&(Ne===d.MIDNUM||Ne===d.MIDNUMLET)&&Gt===d.NUMERIC||(pt===d.EXTEND||pt===d.FORMAT)&&(Ne===d.ALETTER||Ne===d.NUMERIC||Ne===d.KATAKANA||Ne===d.EXTEND||Ne===d.FORMAT)||(Ne===d.EXTEND||Ne===d.FORMAT&&(Gt===d.ALETTER||Gt===d.NUMERIC||Gt===d.KATAKANA||Gt===d.EXTEND||Gt===d.FORMAT))&&(pt===d.ALETTER||pt===d.NUMERIC||pt===d.KATAKANA||pt===d.EXTEND||pt===d.FORMAT)||pt===d.CR&&Ne===d.LF?!1:pt===d.NEWLINE||pt===d.CR||pt===d.LF||Ne===d.NEWLINE||Ne===d.CR||Ne===d.LF?!0:!(pt===d.KATAKANA&&Ne===d.KATAKANA||Ne===d.EXTENDNUMLET&&(pt===d.ALETTER||pt===d.NUMERIC||pt===d.KATAKANA||pt===d.EXTENDNUMLET)||pt===d.EXTENDNUMLET&&(Ne===d.ALETTER||Ne===d.NUMERIC||Ne===d.KATAKANA)||pt===d.AT)},K=b,L=C,te=y,ne=kt=>kt==="http"||kt==="https",oe=(kt,jt)=>{let pt;for(pt=jt;pt<kt.length&&!L.test(kt[pt]);pt++);return pt},G=(kt,jt)=>{const pt=oe(kt,jt+1);return kt.slice(jt+1,pt).join(K).substr(0,3)==="://"?pt:jt},we=(kt,jt,pt,Ne)=>{const Gt=[],bn=[];let At=[];for(let An=0;An<pt.length;++An)if(At.push(kt[An]),U(pt,An)){const zn=jt[An];if((Ne.includeWhitespace||!L.test(zn))&&(Ne.includePunctuation||!te.test(zn))){const ps=An-At.length+1,oo=An+1,Ss=jt.slice(ps,oo).join(K);if(ne(Ss)){const Mr=G(jt,An),$s=kt.slice(oo,Mr);Array.prototype.push.apply(At,$s),An=Mr}Gt.push(At),bn.push({start:ps,end:oo})}At=[]}return{words:Gt,indices:bn}},ve=()=>({includeWhitespace:!1,includePunctuation:!1}),Re=(kt,jt,pt)=>{pt={...ve(),...pt};const Ne=a(kt,jt),Gt=F(Ne);return we(kt,Ne,Gt,pt)},ce=(kt,jt,pt)=>Re(kt,jt,pt).words,Xe=kt=>kt.replace(/\uFEFF/g,"");var tt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const ot=(kt,jt)=>{const pt=jt.getBlockElements(),Ne=jt.getVoidElements(),Gt=ps=>pt[ps.nodeName]||Ne[ps.nodeName],bn=[];let At="";const An=new tt(kt,kt);let zn;for(;zn=An.next();)zn.nodeType===3?At+=Xe(zn.data):Gt(zn)&&At.length&&(bn.push(At),At="");return At.length&&bn.push(At),bn},V=kt=>kt.replace(/\u200B/g,""),ut=kt=>kt.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,Qe=(kt,jt)=>{const pt=V(ot(kt,jt).join(`
|
|
`));return ce(pt.split(""),s).length},Bt=(kt,jt)=>{const pt=ot(kt,jt).join("");return ut(pt)},Ct=(kt,jt)=>{const pt=ot(kt,jt).join("").replace(/\s/g,"");return ut(pt)},He=(kt,jt)=>()=>jt(kt.getBody(),kt.schema),st=(kt,jt)=>()=>jt(kt.selection.getRng().cloneContents(),kt.schema),rn=kt=>He(kt,Qe),Et=kt=>({body:{getWordCount:rn(kt),getCharacterCount:He(kt,Bt),getCharacterCountWithoutSpaces:He(kt,Ct)},selection:{getWordCount:st(kt,Qe),getCharacterCount:st(kt,Bt),getCharacterCountWithoutSpaces:st(kt,Ct)},getCount:rn(kt)}),Cn=(kt,jt)=>{kt.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(jt.body.getWordCount()),String(jt.selection.getWordCount())],["Characters (no spaces)",String(jt.body.getCharacterCountWithoutSpaces()),String(jt.selection.getCharacterCountWithoutSpaces())],["Characters",String(jt.body.getCharacterCount()),String(jt.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},je=(kt,jt)=>{kt.addCommand("mceWordCount",()=>Cn(kt,jt))},mt=(kt,jt)=>{let pt=null;return{cancel:()=>{t(pt)||(clearTimeout(pt),pt=null)},throttle:(...bn)=>{t(pt)&&(pt=setTimeout(()=>{pt=null,kt.apply(null,bn)},jt))}}};var he=tinymce.util.Tools.resolve("tinymce.util.Delay");const Zo=(kt,jt)=>{kt.dispatch("wordCountUpdate",{wordCount:{words:jt.body.getWordCount(),characters:jt.body.getCharacterCount(),charactersWithoutSpaces:jt.body.getCharacterCountWithoutSpaces()}})},Kn=(kt,jt)=>{Zo(kt,jt)},so=(kt,jt,pt)=>{const Ne=mt(()=>Kn(kt,jt),pt);kt.on("init",()=>{Kn(kt,jt),he.setEditorTimeout(kt,()=>{kt.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Ne.throttle)},0),kt.on("remove",Ne.cancel)})},Yo=kt=>{const jt=()=>kt.execCommand("mceWordCount");kt.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:jt}),kt.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:jt})};var as=(kt=300)=>{o.add("wordcount",jt=>{const pt=Et(jt);return je(jt,pt),Yo(jt),so(jt,pt,kt),pt})};as()})();function LTe(o){let e,t;return{c(){e=re("div"),t=re("div"),Z(t,"class","form-control"),Z(e,"class","tox-wrapper")},m(s,a){Te(s,e,a),X(e,t),t.innerHTML=o[0],o[4](t),o[5](e)},p(s,[a]){a&1&&(t.innerHTML=s[0])},i:un,o:un,d(s){s&&ke(e),o[4](null),o[5](null)}}}const FTe="bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";function QTe(o,e,t){let{value:s=""}=e,{additionalConfig:a={}}=e,l="",u,d,h;const b=["autoresize","code","image","table","codesample","link","lists","media","wordcount"];ore(()=>{d&&d.destroy()}),W1(()=>{const E={target:u,toolbar_mode:"sliding",toolbar_sticky:!0,skin:!1,content_css:!1,content_style:BTe.toString(),branding:!1,inline:!1,plugins:b,contextmenu:!1,menubar:!1,statusbar:!1,entity_encoding:"raw",convert_urls:!1,toolbar:FTe,image_caption:!0,relative_urls:!1,browser_spellcheck:!0,max_height:600,content_style:"img {max-width: 100%;height: auto;",setup(R){d=R,R.on("init",function($){R.setContent(s!=null?s:"")}),R.on("change input undo redo",function($){l=R.getContent(),l!==s&&t(0,s=l)})}};ITe.init({...E,...a})});function y(E){Ro[E?"unshift":"push"](()=>{u=E,t(1,u)})}function C(E){Ro[E?"unshift":"push"](()=>{h=E,t(2,h)})}return o.$$set=E=>{"value"in E&&t(0,s=E.value),"additionalConfig"in E&&t(3,a=E.additionalConfig)},[s,u,h,a,y,C]}class b1e extends uo{constructor(e){super(),co(this,e,QTe,LTe,lo,{value:0,additionalConfig:3})}}function ZTe(o){let e,t,s,a;function l(d){o[2](d)}let u={additionalConfig:o[1]};return o[0].value!==void 0&&(u.value=o[0].value),t=new b1e({props:u}),Ro.push(()=>er(t,"value",l)),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","mb-0")},m(d,h){Te(d,e,h),Kt(t,e,null),a=!0},p(d,[h]){const b={};!s&&h&1&&(s=!0,b.value=d[0].value,lr(()=>s=!1)),t.$set(b)},i(d){a||(xe(t.$$.fragment,d),a=!0)},o(d){Be(t.$$.fragment,d),a=!1},d(d){d&&ke(e),Jt(t)}}}function HTe(o,e,t){let{block:s}=e,a={};function l(u){o.$$.not_equal(s.value,u)&&(s.value=u,t(0,s))}return o.$$set=u=>{"block"in u&&t(0,s=u.block)},[s,a,l]}class zTe extends uo{constructor(e){super(),co(this,e,HTe,ZTe,lo,{block:0})}}class el{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),ay.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),ay.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 f6(this),l=new f6(e);for(let u=t,d=t;;){if(a.next(u),l.next(u),u=0,a.lineBreak!=l.lineBreak||a.done!=l.done||a.value!=l.value)return!1;if(d+=a.value.length,a.done||d>=s)return!0}}iter(e=1){return new f6(this,e)}iterRange(e,t=this.length){return new v1e(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 O1e(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]?el.empty:e.length<=32?new Sf(e):ay.from(Sf.split(e,[]))}}class Sf extends el{constructor(e,t=VTe(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 l=0;;l++){let u=this.text[l],d=a+u.length;if((t?s:d)>=e)return new WTe(a,d,s,u);a=d+1,s++}}decompose(e,t,s,a){let l=e<=0&&t>=this.length?this:new Sf(Gue(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(a&1){let u=s.pop(),d=PH(l.text,u.text.slice(),0,l.length);if(d.length<=32)s.push(new Sf(d,u.length+l.length));else{let h=d.length>>1;s.push(new Sf(d.slice(0,h)),new Sf(d.slice(h)))}}else s.push(l)}replace(e,t,s){if(!(s instanceof Sf))return super.replace(e,t,s);let a=PH(this.text,PH(s.text,Gue(this.text,0,e)),t),l=this.length+s.length-(t-e);return a.length<=32?new Sf(a,l):ay.from(Sf.split(a,[]),l)}sliceString(e,t=this.length,s=`
|
|
`){let a="";for(let l=0,u=0;l<=t&&u<this.text.length;u++){let d=this.text[u],h=l+d.length;l>e&&u&&(a+=s),e<h&&t>l&&(a+=d.slice(Math.max(0,e-l),t-l)),l=h+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 l of e)s.push(l),a+=l.length+1,s.length==32&&(t.push(new Sf(s,a)),s=[],a=-1);return a>-1&&t.push(new Sf(s,a)),t}}class ay extends el{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 l=0;;l++){let u=this.children[l],d=a+u.length,h=s+u.lines-1;if((t?h:d)>=e)return u.lineInner(e,t,s,a);a=d+1,s=h+1}}decompose(e,t,s,a){for(let l=0,u=0;u<=t&&l<this.children.length;l++){let d=this.children[l],h=u+d.length;if(e<=h&&t>=u){let b=a&((u<=e?1:0)|(h>=t?2:0));u>=e&&h<=t&&!b?s.push(d):d.decompose(e-u,t-u,s,b)}u=h+1}}replace(e,t,s){if(s.lines<this.lines)for(let a=0,l=0;a<this.children.length;a++){let u=this.children[a],d=l+u.length;if(e>=l&&t<=d){let h=u.replace(e-l,t-l,s),b=this.lines-u.lines+h.lines;if(h.lines<b>>5-1&&h.lines>b>>5+1){let y=this.children.slice();return y[a]=h,new ay(y,this.length-(t-e)+s.length)}return super.replace(l,d,h)}l=d+1}return super.replace(e,t,s)}sliceString(e,t=this.length,s=`
|
|
`){let a="";for(let l=0,u=0;l<this.children.length&&u<=t;l++){let d=this.children[l],h=u+d.length;u>e&&l&&(a+=s),e<h&&t>u&&(a+=d.sliceString(e-u,t-u,s)),u=h+1}return a}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ay))return 0;let s=0,[a,l,u,d]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;a+=t,l+=t){if(a==u||l==d)return s;let h=this.children[a],b=e.children[l];if(h!=b)return s+h.scanIdentical(b,t);s+=h.length+1}}static from(e,t=e.reduce((s,a)=>s+a.length+1,-1)){let s=0;for(let R of e)s+=R.lines;if(s<32){let R=[];for(let $ of e)$.flatten(R);return new Sf(R,t)}let a=Math.max(32,s>>5),l=a<<1,u=a>>1,d=[],h=0,b=-1,y=[];function C(R){let $;if(R.lines>l&&R instanceof ay)for(let Q of R.children)C(Q);else R.lines>u&&(h>u||!h)?(E(),d.push(R)):R instanceof Sf&&h&&($=y[y.length-1])instanceof Sf&&R.lines+$.lines<=32?(h+=R.lines,b+=R.length+1,y[y.length-1]=new Sf($.text.concat(R.text),$.length+1+R.length)):(h+R.lines>a&&E(),h+=R.lines,b+=R.length+1,y.push(R))}function E(){h!=0&&(d.push(y.length==1?y[0]:ay.from(y,b)),b=-1,h=y.length=0)}for(let R of e)C(R);return E(),d.length==1?d[0]:new ay(d,t)}}el.empty=new Sf([""],0);function VTe(o){let e=-1;for(let t of o)e+=t.length+1;return e}function PH(o,e,t=0,s=1e9){for(let a=0,l=0,u=!0;l<o.length&&a<=s;l++){let d=o[l],h=a+d.length;h>=t&&(h>s&&(d=d.slice(0,s-a)),a<t&&(d=d.slice(t-a)),u?(e[e.length-1]+=d,u=!1):e.push(d)),a=h+1}return e}function Gue(o,e,t){return PH(o,[""],e,t)}class f6{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 Sf?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],l=this.offsets[s],u=l>>1,d=a instanceof Sf?a.text.length:a.children.length;if(u==(t>0?d: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((l&1)==(t>0?0:1)){if(this.offsets[s]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
`,this;e--}else if(a instanceof Sf){let h=a.text[u+(t<0?-1:0)];if(this.offsets[s]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=a.children[u+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[s]+=t):(t<0&&this.offsets[s]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof Sf?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class v1e{constructor(e,t,s){this.value="",this.done=!1,this.cursor=new f6(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 O1e{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"&&(el.prototype[Symbol.iterator]=function(){return this.iter()},f6.prototype[Symbol.iterator]=v1e.prototype[Symbol.iterator]=O1e.prototype[Symbol.iterator]=function(){return this});class WTe{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 yD="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(o=>o?parseInt(o,36):1);for(let o=1;o<yD.length;o++)yD[o]+=yD[o-1];function UTe(o){for(let e=1;e<yD.length;e+=2)if(yD[e]>o)return yD[e-1]<=o;return!1}function Kue(o){return o>=127462&&o<=127487}const Jue=8205;function Bm(o,e,t=!0,s=!0){return(t?y1e:YTe)(o,e,s)}function y1e(o,e,t){if(e==o.length)return e;e&&w1e(o.charCodeAt(e))&&_1e(o.charCodeAt(e-1))&&e--;let s=Uh(o,e);for(e+=Fb(s);e<o.length;){let a=Uh(o,e);if(s==Jue||a==Jue||t&&UTe(a))e+=Fb(a),s=a;else if(Kue(a)){let l=0,u=e-2;for(;u>=0&&Kue(Uh(o,u));)l++,u-=2;if(l%2==0)break;e+=2}else break}return e}function YTe(o,e,t){for(;e>0;){let s=y1e(o,e-2,t);if(s<e)return s;e--}return 0}function w1e(o){return o>=56320&&o<57344}function _1e(o){return o>=55296&&o<56320}function Uh(o,e){let t=o.charCodeAt(e);if(!_1e(t)||e+1==o.length)return t;let s=o.charCodeAt(e+1);return w1e(s)?(t-55296<<10)+(s-56320)+65536:t}function fre(o){return o<=65535?String.fromCharCode(o):(o-=65536,String.fromCharCode((o>>10)+55296,(o&1023)+56320))}function Fb(o){return o<65536?1:2}const Zoe=/\r\n?|\n/;var Xh=function(o){return o[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o}(Xh||(Xh={}));class my{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 l=this.sections[t++],u=this.sections[t++];u<0?(e(s,a,l),a+=l):a+=u,s+=l}}iterChangedRanges(e,t=!1){Hoe(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 my(e)}composeDesc(e){return this.empty?e:e.empty?this:S1e(this,e)}mapDesc(e,t=!1){return e.empty?this:zoe(this,e,t)}mapPos(e,t=-1,s=Xh.Simple){let a=0,l=0;for(let u=0;u<this.sections.length;){let d=this.sections[u++],h=this.sections[u++],b=a+d;if(h<0){if(b>e)return l+(e-a);l+=d}else{if(s!=Xh.Simple&&b>=e&&(s==Xh.TrackDel&&a<e&&b>e||s==Xh.TrackBefore&&a<e||s==Xh.TrackAfter&&b>e))return null;if(b>e||b==e&&t<0&&!d)return e==a||t<0?l:l+h;l+=h}a=b}if(e>a)throw new RangeError(`Position ${e} is out of range for changeset of length ${a}`);return l}touchesRange(e,t=e){for(let s=0,a=0;s<this.sections.length&&a<=t;){let l=this.sections[s++],u=this.sections[s++],d=a+l;if(u>=0&&a<=t&&d>=e)return a<e&&d>t?"cover":!0;a=d}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 my(e)}static create(e){return new my(e)}}class wd extends my{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 Hoe(this,(t,s,a,l,u)=>e=e.replace(a,a+(s-t),u),!1),e}mapDesc(e,t=!1){return zoe(this,e,t,!0)}invert(e){let t=this.sections.slice(),s=[];for(let a=0,l=0;a<t.length;a+=2){let u=t[a],d=t[a+1];if(d>=0){t[a]=d,t[a+1]=u;let h=a>>1;for(;s.length<h;)s.push(el.empty);s.push(u?e.slice(l,l+u):el.empty)}l+=u}return new wd(t,s)}compose(e){return this.empty?e:e.empty?this:S1e(this,e,!0)}map(e,t=!1){return e.empty?this:zoe(this,e,t,!0)}iterChanges(e,t=!1){Hoe(this,e,t)}get desc(){return my.create(this.sections)}filter(e){let t=[],s=[],a=[],l=new _6(this);e:for(let u=0,d=0;;){let h=u==e.length?1e9:e[u++];for(;d<h||d==h&&l.len==0;){if(l.done)break e;let y=Math.min(l.len,h-d);Nm(a,y,-1);let C=l.ins==-1?-1:l.off==0?l.ins:0;Nm(t,y,C),C>0&&SC(s,t,l.text),l.forward(y),d+=y}let b=e[u++];for(;d<b;){if(l.done)break e;let y=Math.min(l.len,b-d);Nm(t,y,-1),Nm(a,y,l.ins==-1?-1:l.off==0?l.ins:0),l.forward(y),d+=y}}return{changes:new wd(t,s),filtered:my.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=[],l=[],u=0,d=null;function h(y=!1){if(!y&&!a.length)return;u<t&&Nm(a,t-u,-1);let C=new wd(a,l);d=d?d.compose(C.map(d)):C,a=[],l=[],u=0}function b(y){if(Array.isArray(y))for(let C of y)b(C);else if(y instanceof wd){if(y.length!=t)throw new RangeError(`Mismatched change set length (got ${y.length}, expected ${t})`);h(),d=d?d.compose(y.map(d)):y}else{let{from:C,to:E=C,insert:R}=y;if(C>E||C<0||E>t)throw new RangeError(`Invalid change range ${C} to ${E} (in doc of length ${t})`);let $=R?typeof R=="string"?el.of(R.split(s||Zoe)):R:el.empty,Q=$.length;if(C==E&&Q==0)return;C<u&&h(),C>u&&Nm(a,C-u,-1),Nm(a,E-C,Q),SC(l,a,$),u=E}}return b(e),h(!d),d}static empty(e){return new wd(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 l=e[a];if(typeof l=="number")t.push(l,-1);else{if(!Array.isArray(l)||typeof l[0]!="number"||l.some((u,d)=>d&&typeof u!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(l.length==1)t.push(l[0],0);else{for(;s.length<a;)s.push(el.empty);s[a]=el.of(l.slice(1)),t.push(l[0],s[a].length)}}}return new wd(t,s)}static createSet(e,t){return new wd(e,t)}}function Nm(o,e,t,s=!1){if(e==0&&t<=0)return;let a=o.length-2;a>=0&&t<=0&&t==o[a+1]?o[a]+=e:e==0&&o[a]==0?o[a+1]+=t:s?(o[a]+=e,o[a+1]+=t):o.push(e,t)}function SC(o,e,t){if(t.length==0)return;let s=e.length-2>>1;if(s<o.length)o[o.length-1]=o[o.length-1].append(t);else{for(;o.length<s;)o.push(el.empty);o.push(t)}}function Hoe(o,e,t){let s=o.inserted;for(let a=0,l=0,u=0;u<o.sections.length;){let d=o.sections[u++],h=o.sections[u++];if(h<0)a+=d,l+=d;else{let b=a,y=l,C=el.empty;for(;b+=d,y+=h,h&&s&&(C=C.append(s[u-2>>1])),!(t||u==o.sections.length||o.sections[u+1]<0);)d=o.sections[u++],h=o.sections[u++];e(a,b,l,y,C),a=b,l=y}}}function zoe(o,e,t,s=!1){let a=[],l=s?[]:null,u=new _6(o),d=new _6(e);for(let h=-1;;)if(u.ins==-1&&d.ins==-1){let b=Math.min(u.len,d.len);Nm(a,b,-1),u.forward(b),d.forward(b)}else if(d.ins>=0&&(u.ins<0||h==u.i||u.off==0&&(d.len<u.len||d.len==u.len&&!t))){let b=d.len;for(Nm(a,d.ins,-1);b;){let y=Math.min(u.len,b);u.ins>=0&&h<u.i&&u.len<=y&&(Nm(a,0,u.ins),l&&SC(l,a,u.text),h=u.i),u.forward(y),b-=y}d.next()}else if(u.ins>=0){let b=0,y=u.len;for(;y;)if(d.ins==-1){let C=Math.min(y,d.len);b+=C,y-=C,d.forward(C)}else if(d.ins==0&&d.len<y)y-=d.len,d.next();else break;Nm(a,b,h<u.i?u.ins:0),l&&h<u.i&&SC(l,a,u.text),h=u.i,u.forward(u.len-y)}else{if(u.done&&d.done)return l?wd.createSet(a,l):my.create(a);throw new Error("Mismatched change set lengths")}}function S1e(o,e,t=!1){let s=[],a=t?[]:null,l=new _6(o),u=new _6(e);for(let d=!1;;){if(l.done&&u.done)return a?wd.createSet(s,a):my.create(s);if(l.ins==0)Nm(s,l.len,0,d),l.next();else if(u.len==0&&!u.done)Nm(s,0,u.ins,d),a&&SC(a,s,u.text),u.next();else{if(l.done||u.done)throw new Error("Mismatched change set lengths");{let h=Math.min(l.len2,u.len),b=s.length;if(l.ins==-1){let y=u.ins==-1?-1:u.off?0:u.ins;Nm(s,h,y,d),a&&y&&SC(a,s,u.text)}else u.ins==-1?(Nm(s,l.off?0:l.len,h,d),a&&SC(a,s,l.textBit(h))):(Nm(s,l.off?0:l.len,u.off?0:u.ins,d),a&&!u.off&&SC(a,s,u.text));d=(l.ins>h||u.ins>=0&&u.len>h)&&(d||s.length>b),l.forward2(h),u.forward(h)}}}}class _6{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?el.empty:e[t]}textBit(e){let{inserted:t}=this.set,s=this.i-2>>1;return s>=t.length&&!e?el.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 rE{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 rE(s,a,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Ln.range(e,t);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Ln.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 Ln.range(e.anchor,e.head)}static create(e,t,s){return new rE(e,t,s)}}class Ln{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Ln.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 Ln([this.main],0)}addRange(e,t=!0){return Ln.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let s=this.ranges.slice();return s[t]=e,Ln.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 Ln(e.ranges.map(t=>rE.fromJSON(t)),e.main)}static single(e,t=e){return new Ln([Ln.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 l=e[a];if(l.empty?l.from<=s:l.from<s)return Ln.normalized(e.slice(),t);s=l.to}return new Ln(e,t)}static cursor(e,t=0,s,a){return rE.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 l=(s!=null?s:33554431)<<5|(a==null?3:Math.min(2,a));return t<e?rE.create(t,e,24|l):rE.create(e,t,(t>e?4:0)|l)}static normalized(e,t=0){let s=e[t];e.sort((a,l)=>a.from-l.from),t=e.indexOf(s);for(let a=1;a<e.length;a++){let l=e[a],u=e[a-1];if(l.empty?l.from<=u.to:l.from<u.to){let d=u.from,h=Math.max(l.to,u.to);a<=t&&t--,e.splice(--a,2,l.anchor>l.head?Ln.range(h,d):Ln.range(d,h))}}return new Ln(e,t)}}function C1e(o,e){for(let t of o.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let dre=0;class As{constructor(e,t,s,a,l){this.combine=e,this.compareInput=t,this.compare=s,this.isStatic=a,this.id=dre++,this.default=e([]),this.extensions=typeof l=="function"?l(this):l}static define(e={}){return new As(e.combine||(t=>t),e.compareInput||((t,s)=>t===s),e.compare||(e.combine?(t,s)=>t===s:hre),!!e.static,e.enables)}of(e){return new MH([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new MH(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new MH(e,this,2,t)}from(e,t){return t||(t=s=>s),this.compute([e],s=>t(s.field(e)))}}function hre(o,e){return o==e||o.length==e.length&&o.every((t,s)=>t===e[s])}class MH{constructor(e,t,s,a){this.dependencies=e,this.facet=t,this.type=s,this.value=a,this.id=dre++}dynamicSlot(e){var t;let s=this.value,a=this.facet.compareInput,l=this.id,u=e[l]>>1,d=this.type==2,h=!1,b=!1,y=[];for(let C of this.dependencies)C=="doc"?h=!0:C=="selection"?b=!0:(((t=e[C.id])!==null&&t!==void 0?t:1)&1)==0&&y.push(e[C.id]);return{create(C){return C.values[u]=s(C),1},update(C,E){if(h&&E.docChanged||b&&(E.docChanged||E.selection)||Voe(C,y)){let R=s(C);if(d?!efe(R,C.values[u],a):!a(R,C.values[u]))return C.values[u]=R,1}return 0},reconfigure:(C,E)=>{let R,$=E.config.address[l];if($!=null){let Q=fz(E,$);if(this.dependencies.every(F=>F instanceof As?E.facet(F)===C.facet(F):F instanceof Uf?E.field(F,!1)==C.field(F,!1):!0)||(d?efe(R=s(C),Q,a):a(R=s(C),Q)))return C.values[u]=Q,0}else R=s(C);return C.values[u]=R,1}}}}function efe(o,e,t){if(o.length!=e.length)return!1;for(let s=0;s<o.length;s++)if(!t(o[s],e[s]))return!1;return!0}function Voe(o,e){let t=!1;for(let s of e)d6(o,s)&1&&(t=!0);return t}function XTe(o,e,t){let s=t.map(h=>o[h.id]),a=t.map(h=>h.type),l=s.filter(h=>!(h&1)),u=o[e.id]>>1;function d(h){let b=[];for(let y=0;y<s.length;y++){let C=fz(h,s[y]);if(a[y]==2)for(let E of C)b.push(E);else b.push(C)}return e.combine(b)}return{create(h){for(let b of s)d6(h,b);return h.values[u]=d(h),1},update(h,b){if(!Voe(h,l))return 0;let y=d(h);return e.compare(y,h.values[u])?0:(h.values[u]=y,1)},reconfigure(h,b){let y=Voe(h,s),C=b.config.facets[e.id],E=b.facet(e);if(C&&!y&&hre(t,C))return h.values[u]=E,0;let R=d(h);return e.compare(R,E)?(h.values[u]=E,0):(h.values[u]=R,1)}}}const tfe=As.define({static:!0});class Uf{constructor(e,t,s,a,l){this.id=e,this.createF=t,this.updateF=s,this.compareF=a,this.spec=l,this.provides=void 0}static define(e){let t=new Uf(dre++,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(tfe).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 l=s.values[t],u=this.updateF(l,a);return this.compareF(l,u)?0:(s.values[t]=u,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,tfe.of({field:this,create:e})]}get extension(){return this}}const nE={lowest:4,low:3,default:2,high:1,highest:0};function FN(o){return e=>new k1e(e,o)}const QC={highest:FN(nE.highest),high:FN(nE.high),default:FN(nE.default),low:FN(nE.low),lowest:FN(nE.lowest)};class k1e{constructor(e,t){this.inner=e,this.prec=t}}class DC{of(e){return new Woe(this,e)}reconfigure(e){return DC.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Woe{constructor(e,t){this.compartment=e,this.inner=t}}class uz{constructor(e,t,s,a,l,u){for(this.base=e,this.compartments=t,this.dynamicSlots=s,this.address=a,this.staticValues=l,this.facets=u,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=[],l=Object.create(null),u=new Map;for(let E of jTe(e,t,u))E instanceof Uf?a.push(E):(l[E.facet.id]||(l[E.facet.id]=[])).push(E);let d=Object.create(null),h=[],b=[];for(let E of a)d[E.id]=b.length<<1,b.push(R=>E.slot(R));let y=s==null?void 0:s.config.facets;for(let E in l){let R=l[E],$=R[0].facet,Q=y&&y[E]||[];if(R.every(F=>F.type==0))if(d[$.id]=h.length<<1|1,hre(Q,R))h.push(s.facet($));else{let F=$.combine(R.map(U=>U.value));h.push(s&&$.compare(F,s.facet($))?s.facet($):F)}else{for(let F of R)F.type==0?(d[F.id]=h.length<<1|1,h.push(F.value)):(d[F.id]=b.length<<1,b.push(U=>F.dynamicSlot(U)));d[$.id]=b.length<<1,b.push(F=>XTe(F,$,R))}}let C=b.map(E=>E(d));return new uz(e,u,C,d,h,l)}}function jTe(o,e,t){let s=[[],[],[],[],[]],a=new Map;function l(u,d){let h=a.get(u);if(h!=null){if(h<=d)return;let b=s[h].indexOf(u);b>-1&&s[h].splice(b,1),u instanceof Woe&&t.delete(u.compartment)}if(a.set(u,d),Array.isArray(u))for(let b of u)l(b,d);else if(u instanceof Woe){if(t.has(u.compartment))throw new RangeError("Duplicate use of compartment in extensions");let b=e.get(u.compartment)||u.inner;t.set(u.compartment,b),l(b,d)}else if(u instanceof k1e)l(u.inner,u.prec);else if(u instanceof Uf)s[d].push(u),u.provides&&l(u.provides,d);else if(u instanceof MH)s[d].push(u),u.facet.extensions&&l(u.facet.extensions,nE.default);else{let b=u.extension;if(!b)throw new Error(`Unrecognized extension value in extension set (${u}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);l(b,d)}}return l(o,nE.default),s.reduce((u,d)=>u.concat(d))}function d6(o,e){if(e&1)return 2;let t=e>>1,s=o.status[t];if(s==4)throw new Error("Cyclic dependency between fields and/or facets");if(s&2)return s;o.status[t]=4;let a=o.computeSlot(o,o.config.dynamicSlots[t]);return o.status[t]=2|a}function fz(o,e){return e&1?o.config.staticValues[e>>1]:o.values[e>>1]}const x1e=As.define(),T1e=As.define({combine:o=>o.some(e=>e),static:!0}),E1e=As.define({combine:o=>o.length?o[0]:void 0,static:!0}),A1e=As.define(),D1e=As.define(),P1e=As.define(),M1e=As.define({combine:o=>o.length?o[0]:!1});class qw{constructor(e,t){this.type=e,this.value=t}static define(){return new qTe}}class qTe{of(e){return new qw(this,e)}}class GTe{constructor(e){this.map=e}of(e){return new bi(this,e)}}class bi{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 bi(this.type,t)}is(e){return this.type==e}static define(e={}){return new GTe(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let s=[];for(let a of e){let l=a.map(t);l&&s.push(l)}return s}}bi.reconfigure=bi.define();bi.appendConfig=bi.define();class _d{constructor(e,t,s,a,l,u){this.startState=e,this.changes=t,this.selection=s,this.effects=a,this.annotations=l,this.scrollIntoView=u,this._doc=null,this._state=null,s&&C1e(s,t.newLength),l.some(d=>d.type==_d.time)||(this.annotations=l.concat(_d.time.of(Date.now())))}static create(e,t,s,a,l,u){return new _d(e,t,s,a,l,u)}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(_d.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}_d.time=qw.define();_d.userEvent=qw.define();_d.addToHistory=qw.define();_d.remote=qw.define();function KTe(o,e){let t=[];for(let s=0,a=0;;){let l,u;if(s<o.length&&(a==e.length||e[a]>=o[s]))l=o[s++],u=o[s++];else if(a<e.length)l=e[a++],u=e[a++];else return t;!t.length||t[t.length-1]<l?t.push(l,u):t[t.length-1]<u&&(t[t.length-1]=u)}}function R1e(o,e,t){var s;let a,l,u;return t?(a=e.changes,l=wd.empty(e.changes.length),u=o.changes.compose(e.changes)):(a=e.changes.map(o.changes),l=o.changes.mapDesc(e.changes,!0),u=o.changes.compose(a)),{changes:u,selection:e.selection?e.selection.map(l):(s=o.selection)===null||s===void 0?void 0:s.map(a),effects:bi.mapEffects(o.effects,a).concat(bi.mapEffects(e.effects,l)),annotations:o.annotations.length?o.annotations.concat(e.annotations):e.annotations,scrollIntoView:o.scrollIntoView||e.scrollIntoView}}function Uoe(o,e,t){let s=e.selection,a=wD(e.annotations);return e.userEvent&&(a=a.concat(_d.userEvent.of(e.userEvent))),{changes:e.changes instanceof wd?e.changes:wd.of(e.changes||[],t,o.facet(E1e)),selection:s&&(s instanceof Ln?s:Ln.single(s.anchor,s.head)),effects:wD(e.effects),annotations:a,scrollIntoView:!!e.scrollIntoView}}function $1e(o,e,t){let s=Uoe(o,e.length?e[0]:{},o.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let l=1;l<e.length;l++){e[l].filter===!1&&(t=!1);let u=!!e[l].sequential;s=R1e(s,Uoe(o,e[l],u?s.changes.newLength:o.doc.length),u)}let a=_d.create(o,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return eEe(t?JTe(a):a)}function JTe(o){let e=o.startState,t=!0;for(let a of e.facet(A1e)){let l=a(o);if(l===!1){t=!1;break}Array.isArray(l)&&(t=t===!0?l:KTe(t,l))}if(t!==!0){let a,l;if(t===!1)l=o.changes.invertedDesc,a=wd.empty(e.doc.length);else{let u=o.changes.filter(t);a=u.changes,l=u.filtered.mapDesc(u.changes).invertedDesc}o=_d.create(e,a,o.selection&&o.selection.map(l),bi.mapEffects(o.effects,l),o.annotations,o.scrollIntoView)}let s=e.facet(D1e);for(let a=s.length-1;a>=0;a--){let l=s[a](o);l instanceof _d?o=l:Array.isArray(l)&&l.length==1&&l[0]instanceof _d?o=l[0]:o=$1e(e,wD(l),!1)}return o}function eEe(o){let e=o.startState,t=e.facet(P1e),s=o;for(let a=t.length-1;a>=0;a--){let l=t[a](o);l&&Object.keys(l).length&&(s=R1e(s,Uoe(e,l,o.changes.newLength),!0))}return s==o?o:_d.create(e,o.changes,o.selection,s.effects,s.annotations,s.scrollIntoView)}const tEe=[];function wD(o){return o==null?tEe:Array.isArray(o)?o:[o]}var tu=function(o){return o[o.Word=0]="Word",o[o.Space=1]="Space",o[o.Other=2]="Other",o}(tu||(tu={}));const nEe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Yoe;try{Yoe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function oEe(o){if(Yoe)return Yoe.test(o);for(let e=0;e<o.length;e++){let t=o[e];if(/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||nEe.test(t)))return!0}return!1}function sEe(o){return e=>{if(!/\S/.test(e))return tu.Space;if(oEe(e))return tu.Word;for(let t=0;t<o.length;t++)if(e.indexOf(o[t])>-1)return tu.Word;return tu.Other}}class ra{constructor(e,t,s,a,l,u){this.config=e,this.doc=t,this.selection=s,this.values=a,this.status=e.statusTemplate.slice(),this.computeSlot=l,u&&(u._state=this);for(let d=0;d<this.config.dynamicSlots.length;d++)d6(this,d<<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 d6(this,s),fz(this,s)}update(...e){return $1e(this,e,!0)}applyTransaction(e){let t=this.config,{base:s,compartments:a}=t;for(let u of e.effects)u.is(DC.reconfigure)?(t&&(a=new Map,t.compartments.forEach((d,h)=>a.set(h,d)),t=null),a.set(u.value.compartment,u.value.extension)):u.is(bi.reconfigure)?(t=null,s=u.value):u.is(bi.appendConfig)&&(t=null,s=wD(s).concat(u.value));let l;t?l=e.startState.values.slice():(t=uz.resolve(s,a,this),l=new ra(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(d,h)=>h.reconfigure(d,this),null).values),new ra(t,e.newDoc,e.newSelection,l,(u,d)=>d.update(u,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:Ln.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,s=e(t.ranges[0]),a=this.changes(s.changes),l=[s.range],u=wD(s.effects);for(let d=1;d<t.ranges.length;d++){let h=e(t.ranges[d]),b=this.changes(h.changes),y=b.map(a);for(let E=0;E<d;E++)l[E]=l[E].map(y);let C=a.mapDesc(b,!0);l.push(h.range.map(C)),a=a.compose(y),u=bi.mapEffects(u,y).concat(bi.mapEffects(wD(h.effects),C))}return{changes:a,selection:Ln.create(l,t.mainIndex),effects:u}}changes(e=[]){return e instanceof wd?e:wd.of(e,this.doc.length,this.facet(ra.lineSeparator))}toText(e){return el.of(e.split(this.facet(ra.lineSeparator)||Zoe))}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:(d6(this,t),fz(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 Uf&&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 l in s)if(Object.prototype.hasOwnProperty.call(e,l)){let u=s[l],d=e[l];a.push(u.init(h=>u.spec.fromJSON(d,h)))}}return ra.create({doc:e.doc,selection:Ln.fromJSON(e.selection),extensions:t.extensions?a.concat([t.extensions]):a})}static create(e={}){let t=uz.resolve(e.extensions||[],new Map),s=e.doc instanceof el?e.doc:el.of((e.doc||"").split(t.staticFacet(ra.lineSeparator)||Zoe)),a=e.selection?e.selection instanceof Ln?e.selection:Ln.single(e.selection.anchor,e.selection.head):Ln.single(0);return C1e(a,s.length),t.staticFacet(T1e)||(a=a.asSingle()),new ra(t,s,a,t.dynamicSlots.map(()=>null),(l,u)=>u.create(l),null)}get tabSize(){return this.facet(ra.tabSize)}get lineBreak(){return this.facet(ra.lineSeparator)||`
|
|
`}get readOnly(){return this.facet(M1e)}phrase(e,...t){for(let s of this.facet(ra.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 l=+(a||1);return!l||l>t.length?s:t[l-1]})),e}languageDataAt(e,t,s=-1){let a=[];for(let l of this.facet(x1e))for(let u of l(this,t,s))Object.prototype.hasOwnProperty.call(u,e)&&a.push(u[e]);return a}charCategorizer(e){return sEe(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:s,length:a}=this.doc.lineAt(e),l=this.charCategorizer(e),u=e-s,d=e-s;for(;u>0;){let h=Bm(t,u,!1);if(l(t.slice(h,u))!=tu.Word)break;u=h}for(;d<a;){let h=Bm(t,d);if(l(t.slice(d,h))!=tu.Word)break;d=h}return u==d?null:Ln.range(u+s,d+s)}}ra.allowMultipleSelections=T1e;ra.tabSize=As.define({combine:o=>o.length?o[0]:4});ra.lineSeparator=E1e;ra.readOnly=M1e;ra.phrases=As.define({compare(o,e){let t=Object.keys(o),s=Object.keys(e);return t.length==s.length&&t.every(a=>o[a]==e[a])}});ra.languageData=x1e;ra.changeFilter=A1e;ra.transactionFilter=D1e;ra.transactionExtender=P1e;DC.reconfigure=bi.define();function Tv(o,e,t={}){let s={};for(let a of o)for(let l of Object.keys(a)){let u=a[l],d=s[l];if(d===void 0)s[l]=u;else if(!(d===u||u===void 0))if(Object.hasOwnProperty.call(t,l))s[l]=t[l](d,u);else throw new Error("Config merge conflict for field "+l)}for(let a in e)s[a]===void 0&&(s[a]=e[a]);return s}class mE{eq(e){return this==e}range(e,t=e){return S6.create(e,t,this)}}mE.prototype.startSide=mE.prototype.endSide=0;mE.prototype.point=!1;mE.prototype.mapMode=Xh.TrackDel;class S6{constructor(e,t,s){this.from=e,this.to=t,this.value=s}static create(e,t,s){return new S6(e,t,s)}}function Xoe(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class mre{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 l=s?this.to:this.from;for(let u=a,d=l.length;;){if(u==d)return u;let h=u+d>>1,b=l[h]-e||(s?this.value[h].endSide:this.value[h].startSide)-t;if(h==u)return b>=0?u:d;b>=0?d=h:u=h+1}}between(e,t,s,a){for(let l=this.findIndex(t,-1e9,!0),u=this.findIndex(s,1e9,!1,l);l<u;l++)if(a(this.from[l]+e,this.to[l]+e,this.value[l])===!1)return!1}map(e,t){let s=[],a=[],l=[],u=-1,d=-1;for(let h=0;h<this.value.length;h++){let b=this.value[h],y=this.from[h]+e,C=this.to[h]+e,E,R;if(y==C){let $=t.mapPos(y,b.startSide,b.mapMode);if($==null||(E=R=$,b.startSide!=b.endSide&&(R=t.mapPos(y,b.endSide),R<E)))continue}else if(E=t.mapPos(y,b.startSide),R=t.mapPos(C,b.endSide),E>R||E==R&&b.startSide>0&&b.endSide<=0)continue;(R-E||b.endSide-b.startSide)<0||(u<0&&(u=E),b.point&&(d=Math.max(d,R-E)),s.push(b),a.push(E-u),l.push(R-u))}return{mapped:s.length?new mre(a,l,s,d):null,pos:u}}}class tl{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 tl(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:l=this.length}=e,u=e.filter;if(t.length==0&&!u)return this;if(s&&(t=t.slice().sort(Xoe)),this.isEmpty)return t.length?tl.of(t):this;let d=new N1e(this,null,-1).goto(0),h=0,b=[],y=new PC;for(;d.value||h<t.length;)if(h<t.length&&(d.from-t[h].from||d.startSide-t[h].value.startSide)>=0){let C=t[h++];y.addInner(C.from,C.to,C.value)||b.push(C)}else d.rangeIndex==1&&d.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(d.chunkIndex)<t[h].from)&&(!u||a>this.chunkEnd(d.chunkIndex)||l<this.chunkPos[d.chunkIndex])&&y.addChunk(this.chunkPos[d.chunkIndex],this.chunk[d.chunkIndex])?d.nextChunk():((!u||a>d.to||l<d.from||u(d.from,d.to,d.value))&&(y.addInner(d.from,d.to,d.value)||b.push(S6.create(d.from,d.to,d.value))),d.next());return y.finishInner(this.nextLayer.isEmpty&&!b.length?tl.empty:this.nextLayer.update({add:b,filter:u,filterFrom:a,filterTo:l}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],s=[],a=-1;for(let u=0;u<this.chunk.length;u++){let d=this.chunkPos[u],h=this.chunk[u],b=e.touchesRange(d,d+h.length);if(b===!1)a=Math.max(a,h.maxPoint),t.push(h),s.push(e.mapPos(d));else if(b===!0){let{mapped:y,pos:C}=h.map(d,e);y&&(a=Math.max(a,y.maxPoint),t.push(y),s.push(C))}}let l=this.nextLayer.map(e);return t.length==0?l:new tl(s,t,l||tl.empty,a)}between(e,t,s){if(!this.isEmpty){for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],u=this.chunk[a];if(t>=l&&e<=l+u.length&&u.between(l,e-l,t-l,s)===!1)return}this.nextLayer.between(e,t,s)}}iter(e=0){return C6.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return C6.from(e).goto(t)}static compare(e,t,s,a,l=-1){let u=e.filter(C=>C.maxPoint>0||!C.isEmpty&&C.maxPoint>=l),d=t.filter(C=>C.maxPoint>0||!C.isEmpty&&C.maxPoint>=l),h=nfe(u,d,s),b=new QN(u,h,l),y=new QN(d,h,l);s.iterGaps((C,E,R)=>ofe(b,C,y,E,R,a)),s.empty&&s.length==0&&ofe(b,0,y,0,0,a)}static eq(e,t,s=0,a){a==null&&(a=1e9-1);let l=e.filter(y=>!y.isEmpty&&t.indexOf(y)<0),u=t.filter(y=>!y.isEmpty&&e.indexOf(y)<0);if(l.length!=u.length)return!1;if(!l.length)return!0;let d=nfe(l,u),h=new QN(l,d,0).goto(s),b=new QN(u,d,0).goto(s);for(;;){if(h.to!=b.to||!joe(h.active,b.active)||h.point&&(!b.point||!h.point.eq(b.point)))return!1;if(h.to>a)return!0;h.next(),b.next()}}static spans(e,t,s,a,l=-1){let u=new QN(e,null,l).goto(t),d=t,h=u.openStart;for(;;){let b=Math.min(u.to,s);if(u.point){let y=u.activeForPoint(u.to),C=u.pointFrom<t?y.length+1:Math.min(y.length,h);a.point(d,b,u.point,y,C,u.pointRank),h=Math.min(u.openEnd(b),y.length)}else b>d&&(a.span(d,b,u.active,h),h=u.openEnd(b));if(u.to>s)return h+(u.point&&u.to>s?1:0);d=u.to,u.next()}}static of(e,t=!1){let s=new PC;for(let a of e instanceof S6?[e]:t?rEe(e):e)s.add(a.from,a.to,a.value);return s.finish()}}tl.empty=new tl([],[],null,-1);function rEe(o){if(o.length>1)for(let e=o[0],t=1;t<o.length;t++){let s=o[t];if(Xoe(e,s)>0)return o.slice().sort(Xoe);e=s}return o}tl.empty.nextLayer=tl.empty;class PC{finishChunk(e){this.chunks.push(new mre(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 PC)).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(tl.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=tl.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function nfe(o,e,t){let s=new Map;for(let l of o)for(let u=0;u<l.chunk.length;u++)l.chunk[u].maxPoint<=0&&s.set(l.chunk[u],l.chunkPos[u]);let a=new Set;for(let l of e)for(let u=0;u<l.chunk.length;u++){let d=s.get(l.chunk[u]);d!=null&&(t?t.mapPos(d):d)==l.chunkPos[u]&&!(t!=null&&t.touchesRange(d,d+l.chunk[u].length))&&a.add(l.chunk[u])}return a}class N1e{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 C6{constructor(e){this.heap=e}static from(e,t=null,s=-1){let a=[];for(let l=0;l<e.length;l++)for(let u=e[l];!u.isEmpty;u=u.nextLayer)u.maxPoint>=s&&a.push(new N1e(u,t,s,l));return a.length==1?a[0]:new C6(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--)Ene(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--)Ene(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(),Ene(this.heap,0)}}}function Ene(o,e){for(let t=o[e];;){let s=(e<<1)+1;if(s>=o.length)break;let a=o[s];if(s+1<o.length&&a.compare(o[s+1])>=0&&(a=o[s+1],s++),t.compare(a)<0)break;o[s]=t,o[e]=a,e=s}}class QN{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=C6.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){QZ(this.active,e),QZ(this.activeTo,e),QZ(this.activeRank,e),this.minActive=sfe(this.active,this.activeTo)}addActive(e){let t=0,{value:s,to:a,rank:l}=this.cursor;for(;t<this.activeRank.length&&this.activeRank[t]<=l;)t++;ZZ(this.active,t,s),ZZ(this.activeTo,t,a),ZZ(this.activeRank,t,l),e&&ZZ(e,t,this.cursor.from),this.minActive=sfe(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&&QZ(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 l=this.cursor.value;if(!l.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=l,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=l.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 ofe(o,e,t,s,a,l){o.goto(e),t.goto(s);let u=s+a,d=s,h=s-e;for(;;){let b=o.to+h-t.to||o.endSide-t.endSide,y=b<0?o.to+h:t.to,C=Math.min(y,u);if(o.point||t.point?o.point&&t.point&&(o.point==t.point||o.point.eq(t.point))&&joe(o.activeForPoint(o.to),t.activeForPoint(t.to))||l.comparePoint(d,C,o.point,t.point):C>d&&!joe(o.active,t.active)&&l.compareRange(d,C,o.active,t.active),y>u)break;d=y,b<=0&&o.next(),b>=0&&t.next()}}function joe(o,e){if(o.length!=e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!=e[t]&&!o[t].eq(e[t]))return!1;return!0}function QZ(o,e){for(let t=e,s=o.length-1;t<s;t++)o[t]=o[t+1];o.pop()}function ZZ(o,e,t){for(let s=o.length-1;s>=e;s--)o[s+1]=o[s];o[e]=t}function sfe(o,e){let t=-1,s=1e9;for(let a=0;a<e.length;a++)(e[a]-s||o[a].endSide-o[t].endSide)<0&&(t=a,s=e[a]);return t}function Cv(o,e,t=o.length){let s=0;for(let a=0;a<t;)o.charCodeAt(a)==9?(s+=e-s%e,a++):(s++,a=Bm(o,a));return s}function qoe(o,e,t,s){for(let a=0,l=0;;){if(l>=e)return a;if(a==o.length)break;l+=o.charCodeAt(a)==9?t-l%t:1,a=Bm(o,a)}return s===!0?-1:o.length}const Goe="\u037C",rfe=typeof Symbol>"u"?"__"+Goe:Symbol.for(Goe),Koe=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ife=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class MC{constructor(e,t){this.rules=[];let{finish:s}=t||{};function a(u){return/^@/.test(u)?[u]:u.split(/,\s*/)}function l(u,d,h,b){let y=[],C=/^@(\w+)\b/.exec(u[0]),E=C&&C[1]=="keyframes";if(C&&d==null)return h.push(u[0]+";");for(let R in d){let $=d[R];if(/&/.test(R))l(R.split(/,\s*/).map(Q=>u.map(F=>Q.replace(/&/,F))).reduce((Q,F)=>Q.concat(F)),$,h);else if($&&typeof $=="object"){if(!C)throw new RangeError("The value of a property ("+R+") should be a primitive value.");l(a(R),$,y,E)}else $!=null&&y.push(R.replace(/_.*/,"").replace(/[A-Z]/g,Q=>"-"+Q.toLowerCase())+": "+$+";")}(y.length||E)&&h.push((s&&!C&&!b?u.map(s):u).join(", ")+" {"+y.join(" ")+"}")}for(let u in e)l(a(u),e[u],this.rules)}getRules(){return this.rules.join(`
|
|
`)}static newName(){let e=ife[rfe]||1;return ife[rfe]=e+1,Goe+e.toString(36)}static mount(e,t,s){let a=e[Koe],l=s&&s.nonce;a?l&&a.setNonce(l):a=new iEe(e,l),a.mount(Array.isArray(t)?t:[t])}}let afe=new Map;class iEe{constructor(e,t){let s=e.ownerDocument||e,a=s.defaultView;if(!e.head&&e.adoptedStyleSheets&&a.CSSStyleSheet){let l=afe.get(s);if(l)return e.adoptedStyleSheets=[l.sheet,...e.adoptedStyleSheets],e[Koe]=l;this.sheet=new a.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],afe.set(s,this)}else{this.styleTag=s.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let l=e.head||e;l.insertBefore(this.styleTag,l.firstChild)}this.modules=[],e[Koe]=this}mount(e){let t=this.sheet,s=0,a=0;for(let l=0;l<e.length;l++){let u=e[l],d=this.modules.indexOf(u);if(d<a&&d>-1&&(this.modules.splice(d,1),a--,d=-1),d==-1){if(this.modules.splice(a++,0,u),t)for(let h=0;h<u.rules.length;h++)t.insertRule(u.rules[h],s++)}else{for(;a<d;)s+=this.modules[a++].rules.length;s+=u.rules.length,a++}}if(!t){let l="";for(let u=0;u<this.modules.length;u++)l+=this.modules[u].getRules()+`
|
|
`;this.styleTag.textContent=l}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var RC={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:"'"},k6={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aEe=typeof navigator<"u"&&/Mac/.test(navigator.platform),lEe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yh=0;Yh<10;Yh++)RC[48+Yh]=RC[96+Yh]=String(Yh);for(var Yh=1;Yh<=24;Yh++)RC[Yh+111]="F"+Yh;for(var Yh=65;Yh<=90;Yh++)RC[Yh]=String.fromCharCode(Yh+32),k6[Yh]=String.fromCharCode(Yh);for(var Ane in RC)k6.hasOwnProperty(Ane)||(k6[Ane]=RC[Ane]);function cEe(o){var e=aEe&&o.metaKey&&o.shiftKey&&!o.ctrlKey&&!o.altKey||lEe&&o.shiftKey&&o.key&&o.key.length==1||o.key=="Unidentified",t=!e&&o.key||(o.shiftKey?k6:RC)[o.keyCode]||o.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 dz(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function Joe(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function uEe(o){let e=o.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function RH(o,e){if(!e.anchorNode)return!1;try{return Joe(o,e.anchorNode)}catch{return!1}}function x6(o){return o.nodeType==3?gE(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function hz(o,e,t,s){return t?lfe(o,e,t,s,-1)||lfe(o,e,t,s,1):!1}function T6(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function lfe(o,e,t,s,a){for(;;){if(o==t&&e==s)return!0;if(e==(a<0?0:Vw(o))){if(o.nodeName=="DIV")return!1;let l=o.parentNode;if(!l||l.nodeType!=1)return!1;e=T6(o)+(a<0?0:1),o=l}else if(o.nodeType==1){if(o=o.childNodes[e+(a<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=a<0?Vw(o):0}else return!1}}function Vw(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}function gre(o,e){let t=e?o.left:o.right;return{left:t,right:t,top:o.top,bottom:o.bottom}}function fEe(o){return{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function dEe(o,e,t,s,a,l,u,d){let h=o.ownerDocument,b=h.defaultView||window;for(let y=o,C=!1;y&&!C;)if(y.nodeType==1){let E,R=y==h.body,$=1,Q=1;if(R)E=fEe(b);else{if(/^(fixed|sticky)$/.test(getComputedStyle(y).position)&&(C=!0),y.scrollHeight<=y.clientHeight&&y.scrollWidth<=y.clientWidth){y=y.assignedSlot||y.parentNode;continue}let K=y.getBoundingClientRect();$=K.width/y.offsetWidth,Q=K.height/y.offsetHeight,E={left:K.left,right:K.left+y.clientWidth*$,top:K.top,bottom:K.top+y.clientHeight*Q}}let F=0,U=0;if(a=="nearest")e.top<E.top?(U=-(E.top-e.top+u),t>0&&e.bottom>E.bottom+U&&(U=e.bottom-E.bottom+U+u)):e.bottom>E.bottom&&(U=e.bottom-E.bottom+u,t<0&&e.top-U<E.top&&(U=-(E.top+U-e.top+u)));else{let K=e.bottom-e.top,L=E.bottom-E.top;U=(a=="center"&&K<=L?e.top+K/2-L/2:a=="start"||a=="center"&&t<0?e.top-u:e.bottom-L+u)-E.top}if(s=="nearest"?e.left<E.left?(F=-(E.left-e.left+l),t>0&&e.right>E.right+F&&(F=e.right-E.right+F+l)):e.right>E.right&&(F=e.right-E.right+l,t<0&&e.left<E.left+F&&(F=-(E.left+F-e.left+l))):F=(s=="center"?e.left+(e.right-e.left)/2-(E.right-E.left)/2:s=="start"==d?e.left-l:e.right-(E.right-E.left)+l)-E.left,F||U)if(R)b.scrollBy(F,U);else{let K=0,L=0;if(U){let te=y.scrollTop;y.scrollTop+=U/Q,L=(y.scrollTop-te)*Q}if(F){let te=y.scrollLeft;y.scrollLeft+=F/$,K=(y.scrollLeft-te)*$}e={left:e.left-K,top:e.top-L,right:e.right-K,bottom:e.bottom-L},K&&Math.abs(K-F)<1&&(s="nearest"),L&&Math.abs(L-U)<1&&(a="nearest")}if(R)break;y=y.assignedSlot||y.parentNode}else if(y.nodeType==11)y=y.host;else break}function hEe(o){let e=o.ownerDocument;for(let t=o.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 mEe{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?Vw(t):0),s,Math.min(e.focusOffset,s?Vw(s):0))}set(e,t,s,a){this.anchorNode=e,this.anchorOffset=t,this.focusNode=s,this.focusOffset=a}}let nD=null;function I1e(o){if(o.setActive)return o.setActive();if(nD)return o.focus(nD);let e=[];for(let t=o;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(o.focus(nD==null?{get preventScroll(){return nD={preventScroll:!0},!0}}:void 0),!nD){nD=!1;for(let t=0;t<e.length;){let s=e[t++],a=e[t++],l=e[t++];s.scrollTop!=a&&(s.scrollTop=a),s.scrollLeft!=l&&(s.scrollLeft=l)}}}let cfe;function gE(o,e,t=e){let s=cfe||(cfe=document.createRange());return s.setEnd(o,t),s.setStart(o,e),s}function _D(o,e,t){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0},a=new KeyboardEvent("keydown",s);a.synthetic=!0,o.dispatchEvent(a);let l=new KeyboardEvent("keyup",s);return l.synthetic=!0,o.dispatchEvent(l),a.defaultPrevented||l.defaultPrevented}function gEe(o){for(;o;){if(o&&(o.nodeType==9||o.nodeType==11&&o.host))return o;o=o.assignedSlot||o.parentNode}return null}function B1e(o){for(;o.attributes.length;)o.removeAttributeNode(o.attributes[0])}function pEe(o,e){let t=e.focusNode,s=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=s)return!1;for(s=Math.min(s,Vw(t));;)if(s){if(t.nodeType!=1)return!1;let a=t.childNodes[s-1];a.contentEditable=="false"?s--:(t=a,s=Vw(t))}else{if(t==o)return!0;s=T6(t),t=t.parentNode}}function L1e(o){return o.scrollTop>Math.max(1,o.scrollHeight-o.clientHeight-4)}class Im{constructor(e,t,s=!0){this.node=e,this.offset=t,this.precise=s}static before(e,t){return new Im(e.parentNode,T6(e),t)}static after(e,t){return new Im(e.parentNode,T6(e)+1,t)}}const pre=[];class Bc{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,l;for(let u of this.children){if(u.flags&7){if(!u.dom&&(l=a?a.nextSibling:s.firstChild)){let d=Bc.get(l);(!d||!d.parent&&d.canReuseDOM(u))&&u.reuseDOM(l)}u.sync(e,t),u.flags&=-8}if(l=a?a.nextSibling:s.firstChild,t&&!t.written&&t.node==s&&l!=u.dom&&(t.written=!0),u.dom.parentNode==s)for(;l&&l!=u.dom;)l=ufe(l);else s.insertBefore(u.dom,l);a=u.dom}for(l=a?a.nextSibling:s.firstChild,l&&t&&t.node==s&&(t.written=!0);l;)l=ufe(l)}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=Vw(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==this.dom)break;a==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?a=-1:a=1),e=l}a<0?s=e:s=e.nextSibling}if(s==this.dom.firstChild)return 0;for(;s&&!Bc.get(s);)s=s.nextSibling;if(!s)return this.length;for(let a=0,l=0;;a++){let u=this.children[a];if(u.dom==s)return l;l+=u.length+u.breakAfter}}domBoundsAround(e,t,s=0){let a=-1,l=-1,u=-1,d=-1;for(let h=0,b=s,y=s;h<this.children.length;h++){let C=this.children[h],E=b+C.length;if(b<e&&E>t)return C.domBoundsAround(e,t,b);if(E>=e&&a==-1&&(a=h,l=b),b>t&&C.dom.parentNode==this.dom){u=h,d=y;break}y=E,b=E+C.breakAfter}return{from:l,to:d<0?s+this.length:d,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:u<this.children.length&&u>=0?this.children[u].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=pre){this.markDirty();for(let a=e;a<t;a++){let l=this.children[a];l.parent==this&&l.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 F1e(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,l,u){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}}Bc.prototype.breakAfter=0;function ufe(o){let e=o.nextSibling;return o.parentNode.removeChild(o),e}class F1e{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 Q1e(o,e,t,s,a,l,u,d,h){let{children:b}=o,y=b.length?b[e]:null,C=l.length?l[l.length-1]:null,E=C?C.breakAfter:u;if(!(e==s&&y&&!u&&!E&&l.length<2&&y.merge(t,a,l.length?C:null,t==0,d,h))){if(s<b.length){let R=b[s];R&&(a<R.length||R.breakAfter&&(C==null?void 0:C.breakAfter))?(e==s&&(R=R.split(a),a=0),!E&&C&&R.merge(0,a,C,!0,0,h)?l[l.length-1]=R:(a&&R.merge(0,a,null,!1,0,h),l.push(R))):R!=null&&R.breakAfter&&(C?C.breakAfter=1:u=1),s++}for(y&&(y.breakAfter=u,t>0&&(!u&&l.length&&y.merge(t,y.length,l[0],!1,d,0)?y.breakAfter=l.shift().breakAfter:(t<y.length||y.children.length&&y.children[y.children.length-1].length==0)&&y.merge(t,y.length,null,!1,d,0),e++));e<s&&l.length;)if(b[s-1].become(l[l.length-1]))s--,l.pop(),h=l.length?0:d;else if(b[e].become(l[0]))e++,l.shift(),d=l.length?0:h;else break;!l.length&&e&&s<b.length&&!b[e-1].breakAfter&&b[s].merge(0,0,b[e-1],!1,d,h)&&e--,(e<s||l.length)&&o.replaceChildren(e,s,l)}}function Z1e(o,e,t,s,a,l){let u=o.childCursor(),{i:d,off:h}=u.findPos(t,1),{i:b,off:y}=u.findPos(e,-1),C=e-t;for(let E of s)C+=E.length;o.length+=C,Q1e(o,b,y,d,h,s,0,a,l)}let Q1=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ese=typeof document<"u"?document:{documentElement:{style:{}}};const tse=/Edge\/(\d+)/.exec(Q1.userAgent),H1e=/MSIE \d/.test(Q1.userAgent),nse=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Q1.userAgent),nV=!!(H1e||nse||tse),ffe=!nV&&/gecko\/(\d+)/i.test(Q1.userAgent),Dne=!nV&&/Chrome\/(\d+)/.exec(Q1.userAgent),dfe="webkitFontSmoothing"in ese.documentElement.style,z1e=!nV&&/Apple Computer/.test(Q1.vendor),hfe=z1e&&(/Mobile\/\w+/.test(Q1.userAgent)||Q1.maxTouchPoints>2);var Fs={mac:hfe||/Mac/.test(Q1.platform),windows:/Win/.test(Q1.platform),linux:/Linux|X11/.test(Q1.platform),ie:nV,ie_version:H1e?ese.documentMode||6:nse?+nse[1]:tse?+tse[1]:0,gecko:ffe,gecko_version:ffe?+(/Firefox\/(\d+)/.exec(Q1.userAgent)||[0,0])[1]:0,chrome:!!Dne,chrome_version:Dne?+Dne[1]:0,ios:hfe,android:/Android\b/.test(Q1.userAgent),webkit:dfe,safari:z1e,webkit_version:dfe?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ese.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const bEe=256;class Ww extends Bc{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 Ww)||this.length-(t-e)+s.length>bEe||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 Ww(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 Im(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 vEe(this.dom,e,t)}}class Uw extends Bc{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(B1e(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,l,u){return s&&(!(s instanceof Uw&&s.mark.eq(this.mark))||e&&l<=0||t<this.length&&u<=0)?!1:(Z1e(this,e,t,s?s.children:[],l-1,u-1),this.markDirty(),!0)}split(e){let t=[],s=0,a=-1,l=0;for(let d of this.children){let h=s+d.length;h>e&&t.push(s<e?d.split(e-s):d),a<0&&s>=e&&(a=l),s=h,l++}let u=this.length-e;return this.length=e,a>-1&&(this.children.length=a,this.markDirty()),new Uw(this.mark,t,u)}domAtPos(e){return V1e(this,e)}coordsAt(e,t){return U1e(this,e,t)}}function vEe(o,e,t){let s=o.nodeValue.length;e>s&&(e=s);let a=e,l=e,u=0;e==0&&t<0||e==s&&t>=0?Fs.chrome||Fs.gecko||(e?(a--,u=1):l<s&&(l++,u=-1)):t<0?a--:l<s&&l++;let d=gE(o,a,l).getClientRects();if(!d.length)return null;let h=d[(u?u<0:t>=0)?0:d.length-1];return Fs.safari&&!u&&h.width==0&&(h=Array.prototype.find.call(d,b=>b.width)||h),u?gre(h,u<0):h||null}class CC extends Bc{static create(e,t,s){return new CC(e,t,s)}constructor(e,t,s){super(),this.widget=e,this.length=t,this.side=s,this.prevWidget=null}split(e){let t=CC.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,l,u){return s&&(!(s instanceof CC)||!this.widget.compare(s.widget)||e>0&&l<=0||t<this.length&&u<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}become(e){return e instanceof CC&&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 el.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):el.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Im.before(this.dom):Im.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(),l=null;if(!a.length)return null;let u=this.side?this.side<0:e>0;for(let d=u?a.length-1:0;l=a[d],!(e>0?d==0:d==a.length-1||l.top<l.bottom);d+=u?-1:1);return gre(l,!u)}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 MD extends Bc{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof MD&&e.side==this.side}split(){return new MD(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?Im.before(this.dom):Im.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return el.empty}get isHidden(){return!0}}Ww.prototype.children=CC.prototype.children=MD.prototype.children=pre;function V1e(o,e){let t=o.dom,{children:s}=o,a=0;for(let l=0;a<s.length;a++){let u=s[a],d=l+u.length;if(!(d==l&&u.getSide()<=0)){if(e>l&&e<d&&u.dom.parentNode==t)return u.domAtPos(e-l);if(e<=l)break;l=d}}for(let l=a;l>0;l--){let u=s[l-1];if(u.dom.parentNode==t)return u.domAtPos(u.length)}for(let l=a;l<s.length;l++){let u=s[l];if(u.dom.parentNode==t)return u.domAtPos(0)}return new Im(t,0)}function W1e(o,e,t){let s,{children:a}=o;t>0&&e instanceof Uw&&a.length&&(s=a[a.length-1])instanceof Uw&&s.mark.eq(e.mark)?W1e(s,e.children[0],t-1):(a.push(e),e.setParent(o)),o.length+=e.length}function U1e(o,e,t){let s=null,a=-1,l=null,u=-1;function d(b,y){for(let C=0,E=0;C<b.children.length&&E<=y;C++){let R=b.children[C],$=E+R.length;$>=y&&(R.children.length?d(R,y-E):(!l||l.isHidden&&t>0)&&($>y||E==$&&R.getSide()>0)?(l=R,u=y-E):(E<y||E==$&&R.getSide()<0&&!R.isHidden)&&(s=R,a=y-E)),E=$}}d(o,e);let h=(t<0?s:l)||s||l;return h?h.coordsAt(Math.max(0,h==s?a:u),t):OEe(o)}function OEe(o){let e=o.dom.lastChild;if(!e)return o.dom.getBoundingClientRect();let t=x6(e);return t[t.length-1]||null}function ose(o,e){for(let t in o)t=="class"&&e.class?e.class+=" "+o.class:t=="style"&&e.style?e.style+=";"+o.style:e[t]=o[t];return e}const mfe=Object.create(null);function bre(o,e,t){if(o==e)return!0;o||(o=mfe),e||(e=mfe);let s=Object.keys(o),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 l of s)if(l!=t&&(a.indexOf(l)==-1||o[l]!==e[l]))return!1;return!0}function sse(o,e,t){let s=!1;if(e)for(let a in e)t&&a in t||(s=!0,a=="style"?o.style.cssText="":o.removeAttribute(a));if(t)for(let a in t)e&&e[a]==t[a]||(s=!0,a=="style"?o.style.cssText=t[a]:o.setAttribute(a,t[a]));return s}function yEe(o){let e=Object.create(null);for(let t=0;t<o.attributes.length;t++){let s=o.attributes[t];e[s.name]=s.value}return e}class Od extends Bc{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,s,a,l,u){if(s){if(!(s instanceof Od))return!1;this.dom||s.transferDOM(this)}return a&&this.setDeco(s?s.attrs:null),Z1e(this,e,t,s?s.children:[],l,u),!0}split(e){let t=new Od;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 l=s;l<this.children.length;l++)t.append(this.children[l],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){bre(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){W1e(this,e,t)}addLineDeco(e){let t=e.spec.attributes,s=e.spec.class;t&&(this.attrs=ose(t,this.attrs||{})),s&&(this.attrs=ose({class:s},this.attrs||{}))}domAtPos(e){return V1e(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var s;this.dom?this.flags&4&&(B1e(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&&(sse(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&&Bc.get(a)instanceof Uw;)a=a.lastChild;if(!a||!this.length||a.nodeName!="BR"&&((s=Bc.get(a))===null||s===void 0?void 0:s.isEditable)==!1&&(!Fs.ios||!this.children.some(l=>l instanceof Ww))){let l=document.createElement("BR");l.cmIgnore=!0,this.dom.appendChild(l)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let s of this.children){if(!(s instanceof Ww)||/[^ -~]/.test(s.text))return null;let a=x6(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=U1e(this,e,t);if(!this.children.length&&s&&this.parent){let{heightOracle:a}=this.parent.view.viewState,l=s.bottom-s.top;if(Math.abs(l-a.lineHeight)<2&&a.textHeight<l){let u=(l-a.textHeight)/2;return{top:s.top+u,bottom:s.bottom-u,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 l=e.children[s],u=a+l.length;if(u>=t){if(l instanceof Od)return l;if(u>t)break}a=u+l.breakAfter}return null}}class fE extends Bc{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,l,u){return s&&(!(s instanceof fE)||!this.widget.compare(s.widget)||e>0&&l<=0||t<this.length&&u<=0)?!1:(this.length=e+(s?s.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Im.before(this.dom):Im.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let s=new fE(this.widget,t,this.deco);return s.breakAfter=this.breakAfter,s}get children(){return pre}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):el.empty}domBoundsAround(){return null}become(e){return e instanceof fE&&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 Gw{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 $g=function(o){return o[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o}($g||($g={}));class Br extends mE{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 sI(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 $C(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:l,end:u}=Y1e(e,t);s=(l?t?-3e8:-1:5e8)-1,a=(u?t?2e8:1:-6e8)+1}return new $C(e,s,a,t,e.widget||null,!0)}static line(e){return new rI(e)}static set(e,t=!1){return tl.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Br.none=tl.empty;class sI extends Br{constructor(e){let{start:t,end:s}=Y1e(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 sI&&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))&&bre(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)}}sI.prototype.point=!1;class rI extends Br{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof rI&&this.spec.class==e.spec.class&&bre(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)}}rI.prototype.mapMode=Xh.TrackBefore;rI.prototype.point=!0;class $C extends Br{constructor(e,t,s,a,l,u){super(t,s,l,e),this.block=a,this.isReplace=u,this.mapMode=a?t<=0?Xh.TrackBefore:Xh.TrackAfter:Xh.TrackDel}get type(){return this.startSide!=this.endSide?$g.WidgetRange:this.startSide<=0?$g.WidgetBefore:$g.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof $C&&wEe(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)}}$C.prototype.point=!0;function Y1e(o,e=!1){let{inclusiveStart:t,inclusiveEnd:s}=o;return t==null&&(t=o.inclusive),s==null&&(s=o.inclusive),{start:t!=null?t:e,end:s!=null?s:e}}function wEe(o,e){return o==e||!!(o&&e&&o.compare(e))}function rse(o,e,t,s=0){let a=t.length-1;a>=0&&t[a]+s>=o?t[a]=Math.max(t[a],e):t.push(o,e)}class h6{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 fE&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Od),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(HZ(new MD(-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:l,lineBreak:u,done:d}=this.cursor.next(this.skip);if(this.skip=0,d)throw new Error("Ran out of text content when drawing inline views");if(u){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=l,this.textOff=0}let a=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-s)),this.getLine().append(HZ(new Ww(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,l,u){if(this.disallowBlockEffectsFor[u]&&s instanceof $C){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 d=t-e;if(s instanceof $C)if(s.block)s.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new fE(s.widget||new gfe("div"),d,s));else{let h=CC.create(s.widget||new gfe("span"),d,d?0:s.startSide),b=this.atCursorPos&&!h.isEditable&&l<=a.length&&(e<t||s.startSide>0),y=!h.isEditable&&(e<t||l>a.length||s.startSide<=0),C=this.getLine();this.pendingBuffer==2&&!b&&!h.isEditable&&(this.pendingBuffer=0),this.flushBuffer(a),b&&(C.append(HZ(new MD(1),a),l),l=a.length+Math.max(0,l-a.length)),C.append(HZ(h,a),l),this.atCursorPos=y,this.pendingBuffer=y?e<t||l>a.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=a.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(s);d&&(this.textOff+d<=this.text.length?this.textOff+=d:(this.skip+=d-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=l)}static build(e,t,s,a,l){let u=new h6(e,t,s,l);return u.openEnd=tl.spans(a,t,s,u),u.openStart<0&&(u.openStart=u.openEnd),u.finish(u.openEnd),u}}function HZ(o,e){for(let t of e)o=new Uw(t,[o],o.length);return o}class gfe extends Gw{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 X1e=As.define(),j1e=As.define(),q1e=As.define(),G1e=As.define(),ise=As.define(),K1e=As.define(),J1e=As.define(),ebe=As.define({combine:o=>o.some(e=>e)}),tbe=As.define({combine:o=>o.some(e=>e)});class mz{constructor(e,t="nearest",s="nearest",a=5,l=5){this.range=e,this.y=t,this.x=s,this.yMargin=a,this.xMargin=l}map(e){return e.empty?this:new mz(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const pfe=bi.define({map:(o,e)=>o.map(e)});function zb(o,e,t){let s=o.facet(G1e);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 oV=As.define({combine:o=>o.length?o[0]:!0});let _Ee=0;const JN=As.define();class kf{constructor(e,t,s,a,l){this.id=e,this.create=t,this.domEventHandlers=s,this.domEventObservers=a,this.extension=l(this)}static define(e,t){const{eventHandlers:s,eventObservers:a,provide:l,decorations:u}=t||{};return new kf(_Ee++,e,s,a,d=>{let h=[JN.of(d)];return u&&h.push(E6.of(b=>{let y=b.plugin(d);return y?u(y):Br.none})),l&&h.push(l(d)),h})}static fromClass(e,t){return kf.define(s=>new e(s),t)}}class Pne{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(zb(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){zb(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){zb(e.state,s,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const nbe=As.define(),vre=As.define(),E6=As.define(),Ore=As.define(),obe=As.define();function bfe(o,e,t){let s=o.state.facet(obe);if(!s.length)return s;let a=s.map(u=>u instanceof Function?u(o):u),l=[];return tl.spans(a,e,t,{point(){},span(u,d,h,b){let y=l;for(let C=h.length-1;C>=0;C--,b--){let E=h[C].spec.bidiIsolate,R;if(E!=null)if(b>0&&y.length&&(R=y[y.length-1]).to==u&&R.direction==E)R.to=d,y=R.inner;else{let $={from:u,to:d,direction:E,inner:[]};y.push($),y=$.inner}}}}),l}const sbe=As.define();function rbe(o){let e=0,t=0,s=0,a=0;for(let l of o.state.facet(sbe)){let u=l(o);u&&(u.left!=null&&(e=Math.max(e,u.left)),u.right!=null&&(t=Math.max(t,u.right)),u.top!=null&&(s=Math.max(s,u.top)),u.bottom!=null&&(a=Math.max(a,u.bottom)))}return{left:e,right:t,top:s,bottom:a}}const e6=As.define();class Vb{constructor(e,t,s,a){this.fromA=e,this.toA=t,this.fromB=s,this.toB=a}join(e){return new Vb(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,l=0,u=0,d=0;;a++){let h=a==e.length?null:e[a],b=u-d,y=h?h.fromB:1e9;for(;l<t.length&&t[l]<y;){let C=t[l],E=t[l+1],R=Math.max(d,C),$=Math.min(y,E);if(R<=$&&new Vb(R+b,$+b,R,$).addToSet(s),E>y)break;l+=2}if(!h)return s;new Vb(h.fromA,h.toA,h.fromB,h.toB).addToSet(s),u=h.toA,d=h.toB}}}class gz{constructor(e,t,s){this.view=e,this.state=t,this.transactions=s,this.flags=0,this.startState=e.state,this.changes=wd.empty(this.startState.doc.length);for(let l of s)this.changes=this.changes.compose(l.changes);let a=[];this.changes.iterChangedRanges((l,u,d,h)=>a.push(new Vb(l,u,d,h))),this.changedRanges=a}static create(e,t,s){return new gz(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 Cu=function(o){return o[o.LTR=0]="LTR",o[o.RTL=1]="RTL",o}(Cu||(Cu={}));const A6=Cu.LTR,ibe=Cu.RTL;function abe(o){let e=[];for(let t=0;t<o.length;t++)e.push(1<<+o[t]);return e}const SEe=abe("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),CEe=abe("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ase=Object.create(null),ny=[];for(let o of["()","[]","{}"]){let e=o.charCodeAt(0),t=o.charCodeAt(1);ase[e]=t,ase[t]=-e}function kEe(o){return o<=247?SEe[o]:1424<=o&&o<=1524?2:1536<=o&&o<=1785?CEe[o-1536]:1774<=o&&o<=2220?4:8192<=o&&o<=8203?256:64336<=o&&o<=65023?4:o==8204?256:1}const xEe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class kC{get dir(){return this.level%2?ibe:A6}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 l=-1;for(let u=0;u<e.length;u++){let d=e[u];if(d.from<=t&&d.to>=t){if(d.level==s)return u;(l<0||(a!=0?a<0?d.from<t:d.to>t:e[l].level>d.level))&&(l=u)}}if(l<0)throw new RangeError("Index out of range");return l}}function lbe(o,e){if(o.length!=e.length)return!1;for(let t=0;t<o.length;t++){let s=o[t],a=e[t];if(s.from!=a.from||s.to!=a.to||s.direction!=a.direction||!lbe(s.inner,a.inner))return!1}return!0}const lc=[];function TEe(o,e,t,s,a){for(let l=0;l<=s.length;l++){let u=l?s[l-1].to:e,d=l<s.length?s[l].from:t,h=l?256:a;for(let b=u,y=h,C=h;b<d;b++){let E=kEe(o.charCodeAt(b));E==512?E=y:E==8&&C==4&&(E=16),lc[b]=E==4?2:E,E&7&&(C=E),y=E}for(let b=u,y=h,C=h;b<d;b++){let E=lc[b];if(E==128)b<d-1&&y==lc[b+1]&&y&24?E=lc[b]=y:lc[b]=256;else if(E==64){let R=b+1;for(;R<d&&lc[R]==64;)R++;let $=b&&y==8||R<t&&lc[R]==8?C==1?1:8:256;for(let Q=b;Q<R;Q++)lc[Q]=$;b=R-1}else E==8&&C==1&&(lc[b]=1);y=E,E&7&&(C=E)}}}function EEe(o,e,t,s,a){let l=a==1?2:1;for(let u=0,d=0,h=0;u<=s.length;u++){let b=u?s[u-1].to:e,y=u<s.length?s[u].from:t;for(let C=b,E,R,$;C<y;C++)if(R=ase[E=o.charCodeAt(C)])if(R<0){for(let Q=d-3;Q>=0;Q-=3)if(ny[Q+1]==-R){let F=ny[Q+2],U=F&2?a:F&4?F&1?l:a:0;U&&(lc[C]=lc[ny[Q]]=U),d=Q;break}}else{if(ny.length==189)break;ny[d++]=C,ny[d++]=E,ny[d++]=h}else if(($=lc[C])==2||$==1){let Q=$==a;h=Q?0:1;for(let F=d-3;F>=0;F-=3){let U=ny[F+2];if(U&2)break;if(Q)ny[F+2]|=2;else{if(U&4)break;ny[F+2]|=4}}}}}function AEe(o,e,t,s){for(let a=0,l=s;a<=t.length;a++){let u=a?t[a-1].to:o,d=a<t.length?t[a].from:e;for(let h=u;h<d;){let b=lc[h];if(b==256){let y=h+1;for(;;)if(y==d){if(a==t.length)break;y=t[a++].to,d=a<t.length?t[a].from:e}else if(lc[y]==256)y++;else break;let C=l==1,E=(y<e?lc[y]:s)==1,R=C==E?C?1:2:s;for(let $=y,Q=a,F=Q?t[Q-1].to:o;$>h;)$==F&&($=t[--Q].from,F=Q?t[Q-1].to:o),lc[--$]=R;h=y}else l=b,h++}}}function lse(o,e,t,s,a,l,u){let d=s%2?2:1;if(s%2==a%2)for(let h=e,b=0;h<t;){let y=!0,C=!1;if(b==l.length||h<l[b].from){let Q=lc[h];Q!=d&&(y=!1,C=Q==16)}let E=!y&&d==1?[]:null,R=y?s:s+1,$=h;e:for(;;)if(b<l.length&&$==l[b].from){if(C)break e;let Q=l[b];if(!y)for(let F=Q.to,U=b+1;;){if(F==t)break e;if(U<l.length&&l[U].from==F)F=l[U++].to;else{if(lc[F]==d)break e;break}}if(b++,E)E.push(Q);else{Q.from>h&&u.push(new kC(h,Q.from,R));let F=Q.direction==A6!=!(R%2);cse(o,F?s+1:s,a,Q.inner,Q.from,Q.to,u),h=Q.to}$=Q.to}else{if($==t||(y?lc[$]!=d:lc[$]==d))break;$++}E?lse(o,h,$,s+1,a,E,u):h<$&&u.push(new kC(h,$,R)),h=$}else for(let h=t,b=l.length;h>e;){let y=!0,C=!1;if(!b||h>l[b-1].to){let Q=lc[h-1];Q!=d&&(y=!1,C=Q==16)}let E=!y&&d==1?[]:null,R=y?s:s+1,$=h;e:for(;;)if(b&&$==l[b-1].to){if(C)break e;let Q=l[--b];if(!y)for(let F=Q.from,U=b;;){if(F==e)break e;if(U&&l[U-1].to==F)F=l[--U].from;else{if(lc[F-1]==d)break e;break}}if(E)E.push(Q);else{Q.to<h&&u.push(new kC(Q.to,h,R));let F=Q.direction==A6!=!(R%2);cse(o,F?s+1:s,a,Q.inner,Q.from,Q.to,u),h=Q.from}$=Q.from}else{if($==e||(y?lc[$-1]!=d:lc[$-1]==d))break;$--}E?lse(o,$,h,s+1,a,E,u):$<h&&u.push(new kC($,h,R)),h=$}}function cse(o,e,t,s,a,l,u){let d=e%2?2:1;TEe(o,a,l,s,d),EEe(o,a,l,s,d),AEe(a,l,s,d),lse(o,a,l,e,t,s,u)}function DEe(o,e,t){if(!o)return[new kC(0,0,e==ibe?1:0)];if(e==A6&&!t.length&&!xEe.test(o))return cbe(o.length);if(t.length)for(;o.length>lc.length;)lc[lc.length]=256;let s=[],a=e==A6?0:1;return cse(o,a,a,t,0,o.length,s),s}function cbe(o){return[new kC(0,o,0)]}let ube="";function PEe(o,e,t,s,a){var l;let u=s.head-o.from,d=-1;if(u==0){if(!a||!o.length)return null;e[0].level!=t&&(u=e[0].side(!1,t),d=0)}else if(u==o.length){if(a)return null;let E=e[e.length-1];E.level!=t&&(u=E.side(!0,t),d=e.length-1)}d<0&&(d=kC.find(e,u,(l=s.bidiLevel)!==null&&l!==void 0?l:-1,s.assoc));let h=e[d];u==h.side(a,t)&&(h=e[d+=a?1:-1],u=h.side(!a,t));let b=a==(h.dir==t),y=Bm(o.text,u,b);if(ube=o.text.slice(Math.min(u,y),Math.max(u,y)),y!=h.side(a,t))return Ln.cursor(y+o.from,b?-1:1,h.level);let C=d==(a?e.length-1:0)?null:e[d+(a?1:-1)];return!C&&h.level!=t?Ln.cursor(a?o.to:o.from,a?-1:1,t):C&&C.level<h.level?Ln.cursor(C.side(!a,t)+o.from,a?1:-1,C.level):Ln.cursor(y+o.from,a?-1:1,h.level)}class vfe extends Bc{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 Od],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Vb(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:b,toA:y})=>y<this.minWidthFrom||b>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:!LEe(e.changes,this.hasComposition)&&!e.selectionSet&&(a=e.state.selection.main.head));let l=a>-1?REe(this.view,e.changes,a):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:b,to:y}=this.hasComposition;s=new Vb(b,y,e.changes.mapPos(b,-1),e.changes.mapPos(y,1)).addToSet(s.slice())}this.hasComposition=l?{from:l.range.fromB,to:l.range.toB}:null,(Fs.ie||Fs.chrome)&&!l&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let u=this.decorations,d=this.updateDeco(),h=IEe(u,d,e.changes);return s=Vb.extendWithRanges(s,h),!(this.flags&7)&&s.length==0?!1:(this.updateInner(s,e.startState.doc.length,l),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 u=Fs.chrome||Fs.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,u),this.flags&=-8,u&&(u.written||a.selectionRange.focusNode!=u.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(u=>u.flags&=-9);let l=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let u of this.children)u instanceof fE&&u.widget instanceof Ofe&&l.push(u.dom);a.updateGaps(l)}updateChildren(e,t,s){let a=s?s.range.addToSet(e.slice()):e,l=this.childCursor(t);for(let u=a.length-1;;u--){let d=u>=0?a[u]:null;if(!d)break;let{fromA:h,toA:b,fromB:y,toB:C}=d,E,R,$,Q;if(s&&s.range.fromB<C&&s.range.toB>y){let te=h6.build(this.view.state.doc,y,s.range.fromB,this.decorations,this.dynamicDecorationMap),ne=h6.build(this.view.state.doc,s.range.toB,C,this.decorations,this.dynamicDecorationMap);R=te.breakAtStart,$=te.openStart,Q=ne.openEnd;let oe=this.compositionView(s);ne.breakAtStart?oe.breakAfter=1:ne.content.length&&oe.merge(oe.length,oe.length,ne.content[0],!1,ne.openStart,0)&&(oe.breakAfter=ne.content[0].breakAfter,ne.content.shift()),te.content.length&&oe.merge(0,0,te.content[te.content.length-1],!0,0,te.openEnd)&&te.content.pop(),E=te.content.concat(oe).concat(ne.content)}else({content:E,breakAtStart:R,openStart:$,openEnd:Q}=h6.build(this.view.state.doc,y,C,this.decorations,this.dynamicDecorationMap));let{i:F,off:U}=l.findPos(b,1),{i:K,off:L}=l.findPos(h,-1);Q1e(this,K,L,F,U,E,R,$,Q)}s&&this.fixCompositionDOM(s)}compositionView(e){let t=new Ww(e.text.nodeValue);t.flags|=8;for(let{deco:a}of e.marks)t=new Uw(a,[t],t.length);let s=new Od;return s.append(t,0),s}fixCompositionDOM(e){let t=(l,u)=>{u.flags|=8|(u.children.some(h=>h.flags&7)?1:0),this.markedForComposition.add(u);let d=Bc.get(l);d&&d!=u&&(d.dom=null),u.setDOM(l)},s=this.childPos(e.range.fromB,1),a=this.children[s.i];t(e.line,a);for(let l=e.marks.length-1;l>=-1;l--)s=a.childPos(s.off,1),a=a.children[s.i],t(l>=0?e.marks[l].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,l=!a&&RH(this.dom,this.view.observer.selectionRange)&&!(s&&this.dom.contains(s));if(!(a||t||l))return;let u=this.forceSelection;this.forceSelection=!1;let d=this.view.state.selection.main,h=this.moveToLine(this.domAtPos(d.anchor)),b=d.empty?h:this.moveToLine(this.domAtPos(d.head));if(Fs.gecko&&d.empty&&!this.hasComposition&&MEe(h)){let C=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(C,h.node.childNodes[h.offset]||null)),h=b=new Im(C,0),u=!0}let y=this.view.observer.selectionRange;(u||!y.focusNode||!hz(h.node,h.offset,y.anchorNode,y.anchorOffset)||!hz(b.node,b.offset,y.focusNode,y.focusOffset))&&(this.view.observer.ignore(()=>{Fs.android&&Fs.chrome&&this.dom.contains(y.focusNode)&&BEe(y.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let C=dz(this.view.root);if(C)if(d.empty){if(Fs.gecko){let E=$Ee(h.node,h.offset);if(E&&E!=3){let R=dbe(h.node,h.offset,E==1?1:-1);R&&(h=new Im(R.node,R.offset))}}C.collapse(h.node,h.offset),d.bidiLevel!=null&&C.caretBidiLevel!==void 0&&(C.caretBidiLevel=d.bidiLevel)}else if(C.extend){C.collapse(h.node,h.offset);try{C.extend(b.node,b.offset)}catch{}}else{let E=document.createRange();d.anchor>d.head&&([h,b]=[b,h]),E.setEnd(b.node,b.offset),E.setStart(h.node,h.offset),C.removeAllRanges(),C.addRange(E)}l&&this.view.root.activeElement==this.dom&&(this.dom.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(h,b)),this.impreciseAnchor=h.precise?null:new Im(y.anchorNode,y.anchorOffset),this.impreciseHead=b.precise?null:new Im(y.focusNode,y.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,s=dz(e.root),{anchorNode:a,anchorOffset:l}=e.observer.selectionRange;if(!s||!t.empty||!t.assoc||!s.modify)return;let u=Od.find(this,t.head);if(!u)return;let d=u.posAtStart;if(t.head==d||t.head==d+u.length)return;let h=this.coordsAt(t.head,-1),b=this.coordsAt(t.head,1);if(!h||!b||h.bottom>b.top)return;let y=this.domAtPos(t.head+t.assoc);s.collapse(y.node,y.offset),s.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let C=e.observer.selectionRange;e.docView.posFromDOM(C.anchorNode,C.anchorOffset)!=t.from&&s.collapse(a,l)}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 l=Bc.get(t.childNodes[a]);l instanceof Od&&(s=l.domAtPos(0))}for(let a=e.offset-1;!s&&a>=0;a--){let l=Bc.get(t.childNodes[a]);l instanceof Od&&(s=l.domAtPos(l.length))}return s?new Im(s.node,s.offset,!0):e}nearest(e){for(let t=e;t;){let s=Bc.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 Od)break;t++,s=0}return this.children[t].domAtPos(s)}coordsAt(e,t){let s=null,a=0;for(let l=this.length,u=this.children.length-1;u>=0;u--){let d=this.children[u],h=l-d.breakAfter,b=h-d.length;if(h<e)break;b<=e&&(b<e||d.covers(-1))&&(h>e||d.covers(1))&&(!s||d instanceof Od&&!(s instanceof Od&&t>=0))&&(s=d,a=b),l=b}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 Od))return null;for(;a.children.length;){let{i:d,off:h}=a.childPos(s,1);for(;;d++){if(d==a.children.length)return null;if((a=a.children[d]).length)break}s=h}if(!(a instanceof Ww))return null;let l=Bm(a.text,s);if(l==s)return null;let u=gE(a.dom,s,l).getClientRects();return!u.length||u[0].top>=u[0].bottom?null:u[0]}measureVisibleLineHeights(e){let t=[],{from:s,to:a}=e,l=this.view.contentDOM.clientWidth,u=l>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,d=-1,h=this.view.textDirection==Cu.LTR;for(let b=0,y=0;y<this.children.length;y++){let C=this.children[y],E=b+C.length;if(E>a)break;if(b>=s){let R=C.dom.getBoundingClientRect();if(t.push(R.height),u){let $=C.dom.lastChild,Q=$?x6($):[];if(Q.length){let F=Q[Q.length-1],U=h?F.right-R.left:R.right-F.left;U>d&&(d=U,this.minWidth=l,this.minWidthFrom=b,this.minWidthTo=E)}}}b=E+C.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Cu.RTL:Cu.LTR}measureTextSize(){for(let l of this.children)if(l instanceof Od){let u=l.measureTextSize();if(u)return u}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 l=x6(e.firstChild)[0];t=e.getBoundingClientRect().height,s=l?l.width/27:7,a=l?l.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 F1e(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let s=0,a=0;;a++){let l=a==t.viewports.length?null:t.viewports[a],u=l?l.from-1:this.length;if(u>s){let d=(t.lineBlockAt(u).bottom-t.lineBlockAt(s).top)/this.view.scaleY;e.push(Br.replace({widget:new Ofe(d),block:!0,inclusive:!0,isBlockGap:!0}).range(s,u))}if(!l)break;s=l.to+1}return Br.set(e)}updateDeco(){let e=this.view.state.facet(E6).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 l=rbe(this.view),u={left:s.left-l.left,top:s.top-l.top,right:s.right+l.right,bottom:s.bottom+l.bottom};dEe(this.view.scrollDOM,u,t.head<t.anchor?-1:1,e.x,e.y,e.xMargin,e.yMargin,this.view.textDirection==Cu.LTR)}}function MEe(o){return o.node.nodeType==1&&o.node.firstChild&&(o.offset==0||o.node.childNodes[o.offset-1].contentEditable=="false")&&(o.offset==o.node.childNodes.length||o.node.childNodes[o.offset].contentEditable=="false")}class Ofe extends Gw{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 fbe(o,e){let t=o.observer.selectionRange,s=t.focusNode&&dbe(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 REe(o,e,t){let s=fbe(o,t);if(!s)return null;let{node:a,from:l,to:u}=s,d=a.nodeValue;if(/[\n\r]/.test(d)||o.state.doc.sliceString(s.from,s.to)!=d)return null;let h=e.invertedDesc,b=new Vb(h.mapPos(l),h.mapPos(u),l,u),y=[];for(let C=a.parentNode;;C=C.parentNode){let E=Bc.get(C);if(E instanceof Uw)y.push({node:C,deco:E.mark});else{if(E instanceof Od||C.nodeName=="DIV"&&C.parentNode==o.contentDOM)return{range:b,text:a,marks:y,line:C};if(C!=o.contentDOM)y.push({node:C,deco:new sI({inclusive:!0,attributes:yEe(C),tagName:C.tagName.toLowerCase()})});else return null}}}function dbe(o,e,t){if(t<=0)for(let s=o,a=e;;){if(s.nodeType==3)return{node:s,offset:a};if(s.nodeType==1&&a>0)s=s.childNodes[a-1],a=Vw(s);else break}if(t>=0)for(let s=o,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 $Ee(o,e){return o.nodeType!=1?0:(e&&o.childNodes[e-1].contentEditable=="false"?1:0)|(e<o.childNodes.length&&o.childNodes[e].contentEditable=="false"?2:0)}let NEe=class{constructor(){this.changes=[]}compareRange(e,t){rse(e,t,this.changes)}comparePoint(e,t){rse(e,t,this.changes)}};function IEe(o,e,t){let s=new NEe;return tl.compare(o,e,t,s),s.changes}function BEe(o,e){for(let t=o;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function LEe(o,e){let t=!1;return e&&o.iterChangedRanges((s,a)=>{s<e.to&&a>e.from&&(t=!0)}),t}function FEe(o,e,t=1){let s=o.charCategorizer(e),a=o.doc.lineAt(e),l=e-a.from;if(a.length==0)return Ln.cursor(e);l==0?t=1:l==a.length&&(t=-1);let u=l,d=l;t<0?u=Bm(a.text,l,!1):d=Bm(a.text,l);let h=s(a.text.slice(u,d));for(;u>0;){let b=Bm(a.text,u,!1);if(s(a.text.slice(b,u))!=h)break;u=b}for(;d<a.length;){let b=Bm(a.text,d);if(s(a.text.slice(d,b))!=h)break;d=b}return Ln.range(u+a.from,d+a.from)}function QEe(o,e){return e.left>o?e.left-o:Math.max(0,o-e.right)}function ZEe(o,e){return e.top>o?e.top-o:Math.max(0,o-e.bottom)}function Mne(o,e){return o.top<e.bottom-1&&o.bottom>e.top+1}function yfe(o,e){return e<o.top?{top:e,left:o.left,right:o.right,bottom:o.bottom}:o}function wfe(o,e){return e>o.bottom?{top:o.top,left:o.left,right:o.right,bottom:e}:o}function use(o,e,t){let s,a,l,u,d=!1,h,b,y,C;for(let $=o.firstChild;$;$=$.nextSibling){let Q=x6($);for(let F=0;F<Q.length;F++){let U=Q[F];a&&Mne(a,U)&&(U=yfe(wfe(U,a.bottom),a.top));let K=QEe(e,U),L=ZEe(t,U);if(K==0&&L==0)return $.nodeType==3?_fe($,e,t):use($,e,t);if(!s||u>L||u==L&&l>K){s=$,a=U,l=K,u=L;let te=L?t<U.top?-1:1:K?e<U.left?-1:1:0;d=!te||(te>0?F<Q.length-1:F>0)}K==0?t>U.bottom&&(!y||y.bottom<U.bottom)?(h=$,y=U):t<U.top&&(!C||C.top>U.top)&&(b=$,C=U):y&&Mne(y,U)?y=wfe(y,U.bottom):C&&Mne(C,U)&&(C=yfe(C,U.top))}}if(y&&y.bottom>=t?(s=h,a=y):C&&C.top<=t&&(s=b,a=C),!s)return{node:o,offset:0};let E=Math.max(a.left,Math.min(a.right,e));if(s.nodeType==3)return _fe(s,E,t);if(d&&s.contentEditable!="false")return use(s,E,t);let R=Array.prototype.indexOf.call(o.childNodes,s)+(e>=(a.left+a.right)/2?1:0);return{node:o,offset:R}}function _fe(o,e,t){let s=o.nodeValue.length,a=-1,l=1e9,u=0;for(let d=0;d<s;d++){let h=gE(o,d,d+1).getClientRects();for(let b=0;b<h.length;b++){let y=h[b];if(y.top==y.bottom)continue;u||(u=e-y.left);let C=(y.top>t?y.top-t:t-y.bottom)-1;if(y.left-1<=e&&y.right+1>=e&&C<l){let E=e>=(y.left+y.right)/2,R=E;if((Fs.chrome||Fs.gecko)&&gE(o,d).getBoundingClientRect().left==y.right&&(R=!E),C<=0)return{node:o,offset:d+(R?1:0)};a=d+(R?1:0),l=C}}}return{node:o,offset:a>-1?a:u>0?o.nodeValue.length:0}}function hbe(o,e,t,s=-1){var a,l;let u=o.contentDOM.getBoundingClientRect(),d=u.top+o.viewState.paddingTop,h,{docHeight:b}=o.viewState,{x:y,y:C}=e,E=C-d;if(E<0)return 0;if(E>b)return o.state.doc.length;for(let te=o.viewState.heightOracle.textHeight/2,ne=!1;h=o.elementAtHeight(E),h.type!=$g.Text;)for(;E=s>0?h.bottom+te:h.top-te,!(E>=0&&E<=b);){if(ne)return t?null:0;ne=!0,s=-s}C=d+E;let R=h.from;if(R<o.viewport.from)return o.viewport.from==0?0:t?null:Sfe(o,u,h,y,C);if(R>o.viewport.to)return o.viewport.to==o.state.doc.length?o.state.doc.length:t?null:Sfe(o,u,h,y,C);let $=o.dom.ownerDocument,Q=o.root.elementFromPoint?o.root:$,F=Q.elementFromPoint(y,C);F&&!o.contentDOM.contains(F)&&(F=null),F||(y=Math.max(u.left+1,Math.min(u.right-1,y)),F=Q.elementFromPoint(y,C),F&&!o.contentDOM.contains(F)&&(F=null));let U,K=-1;if(F&&((a=o.docView.nearest(F))===null||a===void 0?void 0:a.isEditable)!=!1){if($.caretPositionFromPoint){let te=$.caretPositionFromPoint(y,C);te&&({offsetNode:U,offset:K}=te)}else if($.caretRangeFromPoint){let te=$.caretRangeFromPoint(y,C);te&&({startContainer:U,startOffset:K}=te,(!o.contentDOM.contains(U)||Fs.safari&&HEe(U,K,y)||Fs.chrome&&zEe(U,K,y))&&(U=void 0))}}if(!U||!o.docView.dom.contains(U)){let te=Od.find(o.docView,R);if(!te)return E>h.top+h.height/2?h.to:h.from;({node:U,offset:K}=use(te.dom,y,C))}let L=o.docView.nearest(U);if(!L)return null;if(L.isWidget&&((l=L.dom)===null||l===void 0?void 0:l.nodeType)==1){let te=L.dom.getBoundingClientRect();return e.y<te.top||e.y<=te.bottom&&e.x<=(te.left+te.right)/2?L.posAtStart:L.posAtEnd}else return L.localPosFromDOM(U,K)+L.posAtStart}function Sfe(o,e,t,s,a){let l=Math.round((s-e.left)*o.defaultCharacterWidth);if(o.lineWrapping&&t.height>o.defaultLineHeight*1.5){let d=o.viewState.heightOracle.textHeight,h=Math.floor((a-t.top-(o.defaultLineHeight-d)*.5)/d);l+=h*o.viewState.heightOracle.lineLength}let u=o.state.sliceDoc(t.from,t.to);return t.from+qoe(u,l,o.state.tabSize)}function HEe(o,e,t){let s;if(o.nodeType!=3||e!=(s=o.nodeValue.length))return!1;for(let a=o.nextSibling;a;a=a.nextSibling)if(a.nodeType!=1||a.nodeName!="BR")return!1;return gE(o,s-1,s).getBoundingClientRect().left>t}function zEe(o,e,t){if(e!=0)return!1;for(let a=o;;){let l=a.parentNode;if(!l||l.nodeType!=1||l.firstChild!=a)return!1;if(l.classList.contains("cm-line"))break;a=l}let s=o.nodeType==1?o.getBoundingClientRect():gE(o,0,Math.max(o.nodeValue.length,1)).getBoundingClientRect();return t-s.left>5}function fse(o,e){let t=o.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==$g.Text))return s}return t}function VEe(o,e,t,s){let a=fse(o,e.head),l=!s||a.type!=$g.Text||!(o.lineWrapping||a.widgetLineBreaks)?null:o.coordsAtPos(e.assoc<0&&e.head>a.from?e.head-1:e.head);if(l){let u=o.dom.getBoundingClientRect(),d=o.textDirectionAt(a.from),h=o.posAtCoords({x:t==(d==Cu.LTR)?u.right-1:u.left+1,y:(l.top+l.bottom)/2});if(h!=null)return Ln.cursor(h,t?-1:1)}return Ln.cursor(t?a.to:a.from,t?-1:1)}function Cfe(o,e,t,s){let a=o.state.doc.lineAt(e.head),l=o.bidiSpans(a),u=o.textDirectionAt(a.from);for(let d=e,h=null;;){let b=PEe(a,l,u,d,t),y=ube;if(!b){if(a.number==(t?o.state.doc.lines:1))return d;y=`
|
|
`,a=o.state.doc.line(a.number+(t?1:-1)),l=o.bidiSpans(a),b=Ln.cursor(t?a.from:a.to)}if(h){if(!h(y))return d}else{if(!s)return b;h=s(y)}d=b}}function WEe(o,e,t){let s=o.state.charCategorizer(e),a=s(t);return l=>{let u=s(l);return a==tu.Space&&(a=u),a==u}}function UEe(o,e,t,s){let a=e.head,l=t?1:-1;if(a==(t?o.state.doc.length:0))return Ln.cursor(a,e.assoc);let u=e.goalColumn,d,h=o.contentDOM.getBoundingClientRect(),b=o.coordsAtPos(a,e.assoc||-1),y=o.documentTop;if(b)u==null&&(u=b.left-h.left),d=l<0?b.top:b.bottom;else{let R=o.viewState.lineBlockAt(a);u==null&&(u=Math.min(h.right-h.left,o.defaultCharacterWidth*(a-R.from))),d=(l<0?R.top:R.bottom)+y}let C=h.left+u,E=s!=null?s:o.viewState.heightOracle.textHeight>>1;for(let R=0;;R+=10){let $=d+(E+R)*l,Q=hbe(o,{x:C,y:$},!1,l);if($<h.top||$>h.bottom||(l<0?Q<a:Q>a)){let F=o.docView.coordsForChar(Q),U=!F||$<F.top?-1:1;return Ln.cursor(Q,U,void 0,u)}}}function $H(o,e,t){for(;;){let s=0;for(let a of o)a.between(e-1,e+1,(l,u,d)=>{if(e>l&&e<u){let h=s||t||(e-l<u-e?-1:1);e=h<0?l:u,s=h}});if(!s)return e}}function Rne(o,e,t){let s=$H(o.state.facet(Ore).map(a=>a(o)),t.from,e.head>t.from?-1:1);return s==t.from?t:Ln.cursor(s,s<t.from?1:-1)}class YEe{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&&c3e(e.contentDOM.ownerDocument)}handleEvent(e){!t3e(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=XEe(e),s=this.handlers,a=this.view.contentDOM;for(let l in t)if(l!="scroll"){let u=!t[l].handlers.length,d=s[l];d&&u!=!d.handlers.length&&(a.removeEventListener(l,this.handleEvent),d=null),d||a.addEventListener(l,this.handleEvent,{passive:u})}for(let l in s)l!="scroll"&&!t[l]&&a.removeEventListener(l,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&&gbe.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=mbe.find(s=>s.keyCode==e.keyCode))&&!e.ctrlKey||jEe.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,_D(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 kfe(o,e){return(t,s)=>{try{return e.call(o,s,t)}catch(a){zb(t.state,a)}}}function XEe(o){let e=Object.create(null);function t(s){return e[s]||(e[s]={observers:[],handlers:[]})}for(let s of o){let a=s.spec;if(a&&a.domEventHandlers)for(let l in a.domEventHandlers){let u=a.domEventHandlers[l];u&&t(l).handlers.push(kfe(s.value,u))}if(a&&a.domEventObservers)for(let l in a.domEventObservers){let u=a.domEventObservers[l];u&&t(l).observers.push(kfe(s.value,u))}}for(let s in yy)t(s).handlers.push(yy[s]);for(let s in kv)t(s).observers.push(kv[s]);return e}const mbe=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jEe="dthko",gbe=[16,17,18,20,91,92,224,225],zZ=6;function VZ(o){return Math.max(0,o)*.7+8}function qEe(o,e){return Math.max(Math.abs(o.clientX-e.clientX),Math.abs(o.clientY-e.clientY))}class GEe{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=hEe(e.contentDOM),this.atoms=e.state.facet(Ore).map(u=>u(e));let l=e.contentDOM.ownerDocument;l.addEventListener("mousemove",this.move=this.move.bind(this)),l.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ra.allowMultipleSelections)&&KEe(e,t),this.dragging=e3e(e,t)&&Obe(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&&qEe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let s=0,a=0,l=((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},u=rbe(this.view);e.clientX-u.left<=l.left+zZ?s=-VZ(l.left-e.clientX):e.clientX+u.right>=l.right-zZ&&(s=VZ(e.clientX-l.right)),e.clientY-u.top<=l.top+zZ?a=-VZ(l.top-e.clientY):e.clientY+u.bottom>=l.bottom-zZ&&(a=VZ(e.clientY-l.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],l=null;if(a.empty){let u=$H(this.atoms,a.from,0);u!=a.from&&(l=Ln.cursor(u,-1))}else{let u=$H(this.atoms,a.from,-1),d=$H(this.atoms,a.to,1);(u!=a.from||d!=a.to)&&(l=Ln.range(a.from==a.anchor?u:d,a.from==a.head?u:d))}l&&(t||(t=e.ranges.slice()),t[s]=l)}return t?Ln.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 KEe(o,e){let t=o.state.facet(X1e);return t.length?t[0](e):Fs.mac?e.metaKey:e.ctrlKey}function JEe(o,e){let t=o.state.facet(j1e);return t.length?t[0](e):Fs.mac?!e.altKey:!e.ctrlKey}function e3e(o,e){let{main:t}=o.state.selection;if(t.empty)return!1;let s=dz(o.root);if(!s||s.rangeCount==0)return!0;let a=s.getRangeAt(0).getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(u.left<=e.clientX&&u.right>=e.clientX&&u.top<=e.clientY&&u.bottom>=e.clientY)return!0}return!1}function t3e(o,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,s;t!=o.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(s=Bc.get(t))&&s.ignoreEvent(e))return!1;return!0}const yy=Object.create(null),kv=Object.create(null),pbe=Fs.ie&&Fs.ie_version<15||Fs.ios&&Fs.webkit_version<604;function n3e(o){let e=o.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{o.focus(),t.remove(),bbe(o,t.value)},50)}function bbe(o,e){let{state:t}=o,s,a=1,l=t.toText(e),u=l.lines==t.selection.ranges.length;if(dse!=null&&t.selection.ranges.every(h=>h.empty)&&dse==l.toString()){let h=-1;s=t.changeByRange(b=>{let y=t.doc.lineAt(b.from);if(y.from==h)return{range:b};h=y.from;let C=t.toText((u?l.line(a++).text:e)+t.lineBreak);return{changes:{from:y.from,insert:C},range:Ln.cursor(b.from+C.length)}})}else u?s=t.changeByRange(h=>{let b=l.line(a++);return{changes:{from:h.from,to:h.to,insert:b.text},range:Ln.cursor(h.from+b.length)}}):s=t.replaceSelection(l);o.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}kv.scroll=o=>{o.inputState.lastScrollTop=o.scrollDOM.scrollTop,o.inputState.lastScrollLeft=o.scrollDOM.scrollLeft};yy.keydown=(o,e)=>(o.inputState.setSelectionOrigin("select"),e.keyCode==27&&(o.inputState.lastEscPress=Date.now()),!1);kv.touchstart=(o,e)=>{o.inputState.lastTouchTime=Date.now(),o.inputState.setSelectionOrigin("select.pointer")};kv.touchmove=o=>{o.inputState.setSelectionOrigin("select.pointer")};yy.mousedown=(o,e)=>{if(o.observer.flush(),o.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let s of o.state.facet(q1e))if(t=s(o,e),t)break;if(!t&&e.button==0&&(t=r3e(o,e)),t){let s=!o.hasFocus;o.inputState.startMouseSelection(new GEe(o,e,t,s)),s&&o.observer.ignore(()=>I1e(o.contentDOM));let a=o.inputState.mouseSelection;if(a)return a.start(e),!a.dragging}return!1};function xfe(o,e,t,s){if(s==1)return Ln.cursor(e,t);if(s==2)return FEe(o.state,e,t);{let a=Od.find(o.docView,e),l=o.state.doc.lineAt(a?a.posAtEnd:e),u=a?a.posAtStart:l.from,d=a?a.posAtEnd:l.to;return d<o.state.doc.length&&d==l.to&&d++,Ln.range(u,d)}}let vbe=(o,e)=>o>=e.top&&o<=e.bottom,Tfe=(o,e,t)=>vbe(e,t)&&o>=t.left&&o<=t.right;function o3e(o,e,t,s){let a=Od.find(o.docView,e);if(!a)return 1;let l=e-a.posAtStart;if(l==0)return 1;if(l==a.length)return-1;let u=a.coordsAt(l,-1);if(u&&Tfe(t,s,u))return-1;let d=a.coordsAt(l,1);return d&&Tfe(t,s,d)?1:u&&vbe(s,u)?-1:1}function Efe(o,e){let t=o.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:o3e(o,t,e.clientX,e.clientY)}}const s3e=Fs.ie&&Fs.ie_version<=11;let Afe=null,Dfe=0,Pfe=0;function Obe(o){if(!s3e)return o.detail;let e=Afe,t=Pfe;return Afe=o,Pfe=Date.now(),Dfe=!e||t>Date.now()-400&&Math.abs(e.clientX-o.clientX)<2&&Math.abs(e.clientY-o.clientY)<2?(Dfe+1)%3:1}function r3e(o,e){let t=Efe(o,e),s=Obe(e),a=o.state.selection;return{update(l){l.docChanged&&(t.pos=l.changes.mapPos(t.pos),a=a.map(l.changes))},get(l,u,d){let h=Efe(o,l),b,y=xfe(o,h.pos,h.bias,s);if(t.pos!=h.pos&&!u){let C=xfe(o,t.pos,t.bias,s),E=Math.min(C.from,y.from),R=Math.max(C.to,y.to);y=E<y.from?Ln.range(E,R):Ln.range(R,E)}return u?a.replaceRange(a.main.extend(y.from,y.to)):d&&s==1&&a.ranges.length>1&&(b=i3e(a,h.pos))?b:d?a.addRange(y):Ln.create([y])}}}function i3e(o,e){for(let t=0;t<o.ranges.length;t++){let{from:s,to:a}=o.ranges[t];if(s<=e&&a>=e)return Ln.create(o.ranges.slice(0,t).concat(o.ranges.slice(t+1)),o.mainIndex==t?0:o.mainIndex-(o.mainIndex>t?1:0))}return null}yy.dragstart=(o,e)=>{let{selection:{main:t}}=o.state,{mouseSelection:s}=o.inputState;return s&&(s.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",o.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function Mfe(o,e,t,s){if(!t)return;let a=o.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:l}=o.inputState,u=s&&l&&l.dragging&&JEe(o,e)?{from:l.dragging.from,to:l.dragging.to}:null,d={from:a,insert:t},h=o.state.changes(u?[u,d]:d);o.focus(),o.dispatch({changes:h,selection:{anchor:h.mapPos(a,-1),head:h.mapPos(a,1)},userEvent:u?"move.drop":"input.drop"})}yy.drop=(o,e)=>{if(!e.dataTransfer)return!1;if(o.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let s=Array(t.length),a=0,l=()=>{++a==t.length&&Mfe(o,e,s.filter(u=>u!=null).join(o.state.lineBreak),!1)};for(let u=0;u<t.length;u++){let d=new FileReader;d.onerror=l,d.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(d.result)||(s[u]=d.result),l()},d.readAsText(t[u])}return!0}else{let s=e.dataTransfer.getData("Text");if(s)return Mfe(o,e,s,!0),!0}return!1};yy.paste=(o,e)=>{if(o.state.readOnly)return!0;o.observer.flush();let t=pbe?null:e.clipboardData;return t?(bbe(o,t.getData("text/plain")||t.getData("text/uri-text")),!0):(n3e(o),!1)};function a3e(o,e){let t=o.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(),o.focus()},50)}function l3e(o){let e=[],t=[],s=!1;for(let a of o.selection.ranges)a.empty||(e.push(o.sliceDoc(a.from,a.to)),t.push(a));if(!e.length){let a=-1;for(let{from:l}of o.selection.ranges){let u=o.doc.lineAt(l);u.number>a&&(e.push(u.text),t.push({from:u.from,to:Math.min(o.doc.length,u.to+1)})),a=u.number}s=!0}return{text:e.join(o.lineBreak),ranges:t,linewise:s}}let dse=null;yy.copy=yy.cut=(o,e)=>{let{text:t,ranges:s,linewise:a}=l3e(o.state);if(!t&&!a)return!1;dse=a?t:null,e.type=="cut"&&!o.state.readOnly&&o.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let l=pbe?null:e.clipboardData;return l?(l.clearData(),l.setData("text/plain",t),!0):(a3e(o,t),!1)};const ybe=qw.define();function wbe(o,e){let t=[];for(let s of o.facet(J1e)){let a=s(o,e);a&&t.push(a)}return t?o.update({effects:t,annotations:ybe.of(!0)}):null}function _be(o){setTimeout(()=>{let e=o.hasFocus;if(e!=o.inputState.notifiedFocused){let t=wbe(o.state,e);t?o.dispatch(t):o.update([])}},10)}kv.focus=o=>{o.inputState.lastFocusTime=Date.now(),!o.scrollDOM.scrollTop&&(o.inputState.lastScrollTop||o.inputState.lastScrollLeft)&&(o.scrollDOM.scrollTop=o.inputState.lastScrollTop,o.scrollDOM.scrollLeft=o.inputState.lastScrollLeft),_be(o)};kv.blur=o=>{o.observer.clearSelectionRange(),_be(o)};kv.compositionstart=kv.compositionupdate=o=>{o.inputState.compositionFirstChange==null&&(o.inputState.compositionFirstChange=!0),o.inputState.composing<0&&(o.inputState.composing=0)};kv.compositionend=o=>{o.inputState.composing=-1,o.inputState.compositionEndedAt=Date.now(),o.inputState.compositionPendingKey=!0,o.inputState.compositionPendingChange=o.observer.pendingRecords().length>0,o.inputState.compositionFirstChange=null,Fs.chrome&&Fs.android?o.observer.flushSoon():o.inputState.compositionPendingChange?Promise.resolve().then(()=>o.observer.flush()):setTimeout(()=>{o.inputState.composing<0&&o.docView.hasComposition&&o.update([])},50)};kv.contextmenu=o=>{o.inputState.lastContextMenu=Date.now()};yy.beforeinput=(o,e)=>{var t;let s;if(Fs.chrome&&Fs.android&&(s=mbe.find(a=>a.inputType==e.inputType))&&(o.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 l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>a+10&&o.hasFocus&&(o.contentDOM.blur(),o.focus())},100)}return!1};const Rfe=new Set;function c3e(o){Rfe.has(o)||(Rfe.add(o),o.addEventListener("copy",()=>{}),o.addEventListener("cut",()=>{}))}const $fe=["pre-wrap","normal","pre-line","break-spaces"];class u3e{constructor(e){this.lineWrapping=e,this.doc=el.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 $fe.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,l,u){let d=$fe.indexOf(e)>-1,h=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=d;if(this.lineWrapping=d,this.lineHeight=t,this.charWidth=s,this.textHeight=a,this.lineLength=l,h){this.heightSamples={};for(let b=0;b<u.length;b++){let y=u[b];y<0?b++:this.heightSamples[Math.floor(y*10)]=!0}}return h}}class f3e{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class ly{constructor(e,t,s,a,l){this.from=e,this.length=t,this.top=s,this.height=a,this._content=l}get type(){return typeof this._content=="number"?$g.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 $C?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 ly(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Ic=function(o){return o[o.ByPos=0]="ByPos",o[o.ByHeight=1]="ByHeight",o[o.ByPosNoHeight=2]="ByPosNoHeight",o}(Ic||(Ic={}));const NH=.001;class Ng{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)>NH&&(e.heightChanged=!0),this.height=t)}replace(e,t,s){return Ng.of(s)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,s,a){let l=this,u=s.doc;for(let d=a.length-1;d>=0;d--){let{fromA:h,toA:b,fromB:y,toB:C}=a[d],E=l.lineAt(h,Ic.ByPosNoHeight,s.setDoc(t),0,0),R=E.to>=b?E:l.lineAt(b,Ic.ByPosNoHeight,s,0,0);for(C+=R.to-b,b=R.to;d>0&&E.from<=a[d-1].toA;)h=a[d-1].fromA,y=a[d-1].fromB,d--,h<E.from&&(E=l.lineAt(h,Ic.ByPosNoHeight,s,0,0));y+=E.from-h,h=E.from;let $=yre.build(s.setDoc(u),e,y,C);l=l.replace(h,b,$)}return l.updateHeight(s,0)}static empty(){return new B1(0,0)}static of(e){if(e.length==1)return e[0];let t=0,s=e.length,a=0,l=0;for(;;)if(t==s)if(a>l*2){let d=e[t-1];d.break?e.splice(--t,1,d.left,null,d.right):e.splice(--t,1,d.left,d.right),s+=1+d.break,a-=d.size}else if(l>a*2){let d=e[s];d.break?e.splice(s,1,d.left,null,d.right):e.splice(s,1,d.left,d.right),s+=2+d.break,l-=d.size}else break;else if(a<l){let d=e[t++];d&&(a+=d.size)}else{let d=e[--s];d&&(l+=d.size)}let u=0;return e[t-1]==null?(u=1,t--):e[t]==null&&(u=1,s++),new d3e(Ng.of(e.slice(0,t)),u,Ng.of(e.slice(s)))}}Ng.prototype.size=1;class Sbe extends Ng{constructor(e,t,s){super(e,t),this.deco=s}blockAt(e,t,s,a){return new ly(a,this.length,s,this.height,this.deco||0)}lineAt(e,t,s,a,l){return this.blockAt(0,s,a,l)}forEachLine(e,t,s,a,l,u){e<=l+this.length&&t>=l&&u(this.blockAt(0,s,a,l))}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 B1 extends Sbe{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,s,a){return new ly(a,this.length,s,this.height,this.breaks)}replace(e,t,s){let a=s[0];return s.length==1&&(a instanceof B1||a instanceof Wh&&a.flags&4)&&Math.abs(this.length-a.length)<10?(a instanceof Wh?a=new B1(a.length,this.height):a.height=this.height,this.outdated||(a.outdated=!1),a):Ng.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 Wh extends Ng{constructor(e){super(e,0)}heightMetrics(e,t){let s=e.doc.lineAt(t).number,a=e.doc.lineAt(t+this.length).number,l=a-s+1,u,d=0;if(e.lineWrapping){let h=Math.min(this.height,e.lineHeight*l);u=h/l,this.length>l+1&&(d=(this.height-h)/(this.length-l-1))}else u=this.height/l;return{firstLine:s,lastLine:a,perLine:u,perChar:d}}blockAt(e,t,s,a){let{firstLine:l,lastLine:u,perLine:d,perChar:h}=this.heightMetrics(t,a);if(t.lineWrapping){let b=a+Math.round(Math.max(0,Math.min(1,(e-s)/this.height))*this.length),y=t.doc.lineAt(b),C=d+y.length*h,E=Math.max(s,e-C/2);return new ly(y.from,y.length,E,C,0)}else{let b=Math.max(0,Math.min(u-l,Math.floor((e-s)/d))),{from:y,length:C}=t.doc.line(l+b);return new ly(y,C,s+d*b,d,0)}}lineAt(e,t,s,a,l){if(t==Ic.ByHeight)return this.blockAt(e,s,a,l);if(t==Ic.ByPosNoHeight){let{from:R,to:$}=s.doc.lineAt(e);return new ly(R,$-R,0,0,0)}let{firstLine:u,perLine:d,perChar:h}=this.heightMetrics(s,l),b=s.doc.lineAt(e),y=d+b.length*h,C=b.number-u,E=a+d*C+h*(b.from-l-C);return new ly(b.from,b.length,Math.max(a,Math.min(E,a+this.height-y)),y,0)}forEachLine(e,t,s,a,l,u){e=Math.max(e,l),t=Math.min(t,l+this.length);let{firstLine:d,perLine:h,perChar:b}=this.heightMetrics(s,l);for(let y=e,C=a;y<=t;){let E=s.doc.lineAt(y);if(y==e){let $=E.number-d;C+=h*$+b*(e-l-$)}let R=h+b*E.length;u(new ly(E.from,E.length,C,R,0)),C+=R,y=E.to+1}}replace(e,t,s){let a=this.length-t;if(a>0){let l=s[s.length-1];l instanceof Wh?s[s.length-1]=new Wh(l.length+a):s.push(null,new Wh(a-1))}if(e>0){let l=s[0];l instanceof Wh?s[0]=new Wh(e+l.length):s.unshift(new Wh(e-1),null)}return Ng.of(s)}decomposeLeft(e,t){t.push(new Wh(e-1),null)}decomposeRight(e,t){t.push(null,new Wh(this.length-e-1))}updateHeight(e,t=0,s=!1,a){let l=t+this.length;if(a&&a.from<=t+this.length&&a.more){let u=[],d=Math.max(t,a.from),h=-1;for(a.from>t&&u.push(new Wh(a.from-t-1).updateHeight(e,t));d<=l&&a.more;){let y=e.doc.lineAt(d).length;u.length&&u.push(null);let C=a.heights[a.index++];h==-1?h=C:Math.abs(C-h)>=NH&&(h=-2);let E=new B1(y,C);E.outdated=!1,u.push(E),d+=y+1}d<=l&&u.push(null,new Wh(l-d).updateHeight(e,d));let b=Ng.of(u);return(h<0||Math.abs(b.height-this.height)>=NH||Math.abs(h-this.heightMetrics(e,t).perLine)>=NH)&&(e.heightChanged=!0),b}else(s||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class d3e extends Ng{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 l=s+this.left.height;return e<l?this.left.blockAt(e,t,s,a):this.right.blockAt(e,t,l,a+this.left.length+this.break)}lineAt(e,t,s,a,l){let u=a+this.left.height,d=l+this.left.length+this.break,h=t==Ic.ByHeight?e<u:e<d,b=h?this.left.lineAt(e,t,s,a,l):this.right.lineAt(e,t,s,u,d);if(this.break||(h?b.to<d:b.from>d))return b;let y=t==Ic.ByPosNoHeight?Ic.ByPosNoHeight:Ic.ByPos;return h?b.join(this.right.lineAt(d,y,s,u,d)):this.left.lineAt(d,y,s,a,l).join(b)}forEachLine(e,t,s,a,l,u){let d=a+this.left.height,h=l+this.left.length+this.break;if(this.break)e<h&&this.left.forEachLine(e,t,s,a,l,u),t>=h&&this.right.forEachLine(e,t,s,d,h,u);else{let b=this.lineAt(h,Ic.ByPos,s,a,l);e<b.from&&this.left.forEachLine(e,b.from-1,s,a,l,u),b.to>=e&&b.from<=t&&u(b),t>b.to&&this.right.forEachLine(b.to+1,t,s,d,h,u)}}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 l=[];e>0&&this.decomposeLeft(e,l);let u=l.length;for(let d of s)l.push(d);if(e>0&&Nfe(l,u-1),t<this.length){let d=l.length;this.decomposeRight(t,l),Nfe(l,d)}return Ng.of(l)}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?Ng.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:l,right:u}=this,d=t+l.length+this.break,h=null;return a&&a.from<=t+l.length&&a.more?h=l=l.updateHeight(e,t,s,a):l.updateHeight(e,t,s),a&&a.from<=d+u.length&&a.more?h=u=u.updateHeight(e,d,s,a):u.updateHeight(e,d,s),h?this.balanced(l,u):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Nfe(o,e){let t,s;o[e]==null&&(t=o[e-1])instanceof Wh&&(s=o[e+1])instanceof Wh&&o.splice(e-1,3,new Wh(t.length+1+s.length))}const h3e=5;class yre{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 B1?a.length+=s-this.pos:(s>this.pos||!this.isCovered)&&this.nodes.push(new B1(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,l=s.widget?s.widget.lineBreaks:0;a<0&&(a=this.oracle.lineHeight);let u=t-e;s.block?this.addBlock(new Sbe(u,a,s)):(u||l||a>=h3e)&&this.addLineDeco(a,l,u)}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 B1(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let s=new Wh(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 B1)return e;let t=new B1(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 B1)&&!this.isCovered?this.nodes.push(new B1(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 B1&&a.updateHeight(this.oracle,s),s+=a?a.length:1;return this.nodes}static build(e,t,s,a){let l=new yre(s,e);return tl.spans(t,s,a,l,0),l.finish(s)}}function m3e(o,e,t){let s=new g3e;return tl.compare(o,e,t,s,0),s.changes}class g3e{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,s,a){(e<t||s&&s.heightRelevant||a&&a.heightRelevant)&&rse(e,t,this.changes,5)}}function p3e(o,e){let t=o.getBoundingClientRect(),s=o.ownerDocument,a=s.defaultView||window,l=Math.max(0,t.left),u=Math.min(a.innerWidth,t.right),d=Math.max(0,t.top),h=Math.min(a.innerHeight,t.bottom);for(let b=o.parentNode;b&&b!=s.body;)if(b.nodeType==1){let y=b,C=window.getComputedStyle(y);if((y.scrollHeight>y.clientHeight||y.scrollWidth>y.clientWidth)&&C.overflow!="visible"){let E=y.getBoundingClientRect();l=Math.max(l,E.left),u=Math.min(u,E.right),d=Math.max(d,E.top),h=b==o.parentNode?E.bottom:Math.min(h,E.bottom)}b=C.position=="absolute"||C.position=="fixed"?y.offsetParent:y.parentNode}else if(b.nodeType==11)b=b.host;else break;return{left:l-t.left,right:Math.max(l,u)-t.left,top:d-(t.top+e),bottom:Math.max(d,h)-(t.top+e)}}function b3e(o,e){let t=o.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class $ne{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],l=t[s];if(a.from!=l.from||a.to!=l.to||a.size!=l.size)return!1}return!0}draw(e,t){return Br.replace({widget:new v3e(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class v3e extends Gw{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 Ife{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=Bfe,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Cu.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(vre).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new u3e(t),this.stateDeco=e.facet(E6).filter(s=>typeof s!="function"),this.heightMap=Ng.empty().applyChanges(this.stateDeco,el.empty,this.heightOracle.setDoc(e.doc),[new Vb(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Br.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:l,to:u})=>a>=l&&a<=u)){let{from:l,to:u}=this.lineBlockAt(a);e.push(new WZ(l,u))}}this.viewports=e.sort((s,a)=>s.from-a.from),this.scaler=this.heightMap.height<=7e6?Bfe:new w3e(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:t6(e,this.scaler))})}update(e,t=null){this.state=e.state;let s=this.stateDeco;this.stateDeco=this.state.facet(E6).filter(y=>typeof y!="function");let a=e.changedRanges,l=Vb.extendWithRanges(a,m3e(s,this.stateDeco,e?e.changes:wd.empty(this.state.doc.length))),u=this.heightMap.height,d=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),l),this.heightMap.height!=u&&(e.flags|=2),d?(this.scrollAnchorPos=e.changes.mapPos(d.from,-1),this.scrollAnchorHeight=d.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let h=l.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<h.from||t.range.head>h.to)||!this.viewportIsAppropriate(h))&&(h=this.getViewport(0,t));let b=!e.changes.empty||e.flags&2||h.from!=this.viewport.from||h.to!=this.viewport.to;this.viewport=h,this.updateForViewport(),b&&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(tbe)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,s=window.getComputedStyle(t),a=this.heightOracle,l=s.whiteSpace;this.defaultTextDirection=s.direction=="rtl"?Cu.RTL:Cu.LTR;let u=this.heightOracle.mustRefreshForWrapping(l),d=t.getBoundingClientRect(),h=u||this.mustMeasureContent||this.contentDOMHeight!=d.height;this.contentDOMHeight=d.height,this.mustMeasureContent=!1;let b=0,y=0;if(d.width&&d.height){let te=d.width/t.offsetWidth,ne=d.height/t.offsetHeight;(te>.995&&te<1.005||!isFinite(te)||Math.abs(d.width-t.offsetWidth)<1)&&(te=1),(ne>.995&&ne<1.005||!isFinite(ne)||Math.abs(d.height-t.offsetHeight)<1)&&(ne=1),(this.scaleX!=te||this.scaleY!=ne)&&(this.scaleX=te,this.scaleY=ne,b|=8,u=h=!0)}let C=(parseInt(s.paddingTop)||0)*this.scaleY,E=(parseInt(s.paddingBottom)||0)*this.scaleY;(this.paddingTop!=C||this.paddingBottom!=E)&&(this.paddingTop=C,this.paddingBottom=E,b|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(a.lineWrapping&&(h=!0),this.editorWidth=e.scrollDOM.clientWidth,b|=8);let R=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=R&&(this.scrollAnchorHeight=-1,this.scrollTop=R),this.scrolledToBottom=L1e(e.scrollDOM);let $=(this.printing?b3e:p3e)(t,this.paddingTop),Q=$.top-this.pixelViewport.top,F=$.bottom-this.pixelViewport.bottom;this.pixelViewport=$;let U=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(U!=this.inView&&(this.inView=U,U&&(h=!0)),!this.inView&&!this.scrollTarget)return 0;let K=d.width;if((this.contentDOMWidth!=K||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=d.width,this.editorHeight=e.scrollDOM.clientHeight,b|=8),h){let te=e.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(te)&&(u=!0),u||a.lineWrapping&&Math.abs(K-this.contentDOMWidth)>a.charWidth){let{lineHeight:ne,charWidth:oe,textHeight:G}=e.docView.measureTextSize();u=ne>0&&a.refresh(l,ne,oe,G,K/oe,te),u&&(e.docView.minWidth=0,b|=8)}Q>0&&F>0?y=Math.max(Q,F):Q<0&&F<0&&(y=Math.min(Q,F)),a.heightChanged=!1;for(let ne of this.viewports){let oe=ne.from==this.viewport.from?te:e.docView.measureVisibleLineHeights(ne);this.heightMap=(u?Ng.empty().applyChanges(this.stateDeco,el.empty,this.heightOracle,[new Vb(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(a,0,u,new f3e(ne.from,oe))}a.heightChanged&&(b|=2)}let L=!this.viewportIsAppropriate(this.viewport,y)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return L&&(this.viewport=this.getViewport(y,this.scrollTarget)),this.updateForViewport(),(b&2||L)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps,e)),b|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),b}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,l=this.heightOracle,{visibleTop:u,visibleBottom:d}=this,h=new WZ(a.lineAt(u-s*1e3,Ic.ByHeight,l,0,0).from,a.lineAt(d+(1-s)*1e3,Ic.ByHeight,l,0,0).to);if(t){let{head:b}=t.range;if(b<h.from||b>h.to){let y=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),C=a.lineAt(b,Ic.ByPos,l,0,0),E;t.y=="center"?E=(C.top+C.bottom)/2-y/2:t.y=="start"||t.y=="nearest"&&b<h.from?E=C.top:E=C.bottom-y,h=new WZ(a.lineAt(E-1e3/2,Ic.ByHeight,l,0,0).from,a.lineAt(E+y+1e3/2,Ic.ByHeight,l,0,0).to)}}return h}mapViewport(e,t){let s=t.mapPos(e.from,-1),a=t.mapPos(e.to,1);return new WZ(this.heightMap.lineAt(s,Ic.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(a,Ic.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,Ic.ByPos,this.heightOracle,0,0),{bottom:l}=this.heightMap.lineAt(t,Ic.ByPos,this.heightOracle,0,0),{visibleTop:u,visibleBottom:d}=this;return(e==0||a<=u-Math.max(10,Math.min(-s,250)))&&(t==this.state.doc.length||l>=d+Math.max(10,Math.min(s,250)))&&a>u-2*1e3&&l<d+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 $ne(t.mapPos(a.from),t.mapPos(a.to),a.size));return s}ensureLineGaps(e,t){let s=this.heightOracle.lineWrapping,a=s?1e4:2e3,l=a>>1,u=a<<1;if(this.defaultTextDirection!=Cu.LTR&&!s)return[];let d=[],h=(b,y,C,E)=>{if(y-b<l)return;let R=this.state.selection.main,$=[R.from];R.empty||$.push(R.to);for(let F of $)if(F>b&&F<y){h(b,F-10,C,E),h(F+10,y,C,E);return}let Q=y3e(e,F=>F.from>=C.from&&F.to<=C.to&&Math.abs(F.from-b)<l&&Math.abs(F.to-y)<l&&!$.some(U=>F.from<U&&F.to>U));if(!Q){if(y<C.to&&t&&s&&t.visibleRanges.some(F=>F.from<=y&&F.to>=y)){let F=t.moveToLineBoundary(Ln.cursor(y),!1,!0).head;F>b&&(y=F)}Q=new $ne(b,y,this.gapSize(C,b,y,E))}d.push(Q)};for(let b of this.viewportLines){if(b.length<u)continue;let y=O3e(b.from,b.to,this.stateDeco);if(y.total<u)continue;let C=this.scrollTarget?this.scrollTarget.range.head:null,E,R;if(s){let $=a/this.heightOracle.lineLength*this.heightOracle.lineHeight,Q,F;if(C!=null){let U=YZ(y,C),K=((this.visibleBottom-this.visibleTop)/2+$)/b.height;Q=U-K,F=U+K}else Q=(this.visibleTop-b.top-$)/b.height,F=(this.visibleBottom-b.top+$)/b.height;E=UZ(y,Q),R=UZ(y,F)}else{let $=y.total*this.heightOracle.charWidth,Q=a*this.heightOracle.charWidth,F,U;if(C!=null){let K=YZ(y,C),L=((this.pixelViewport.right-this.pixelViewport.left)/2+Q)/$;F=K-L,U=K+L}else F=(this.pixelViewport.left-Q)/$,U=(this.pixelViewport.right+Q)/$;E=UZ(y,F),R=UZ(y,U)}E>b.from&&h(b.from,E,b,y),R<b.to&&h(R,b.to,b,y)}return d}gapSize(e,t,s,a){let l=YZ(a,s)-YZ(a,t);return this.heightOracle.lineWrapping?e.height*l:a.total*this.heightOracle.charWidth*l}updateLineGaps(e){$ne.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Br.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=[];tl.spans(e,this.viewport.from,this.viewport.to,{span(a,l){t.push({from:a,to:l})},point(){}},20);let s=t.length!=this.visibleRanges.length||this.visibleRanges.some((a,l)=>a.from!=t[l].from||a.to!=t[l].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)||t6(this.heightMap.lineAt(e,Ic.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return t6(this.heightMap.lineAt(this.scaler.fromDOM(e),Ic.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 t6(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 WZ{constructor(e,t){this.from=e,this.to=t}}function O3e(o,e,t){let s=[],a=o,l=0;return tl.spans(t,o,e,{span(){},point(u,d){u>a&&(s.push({from:a,to:u}),l+=u-a),a=d}},20),a<e&&(s.push({from:a,to:e}),l+=e-a),{total:l,ranges:s}}function UZ({total:o,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let s=Math.floor(o*t);for(let a=0;;a++){let{from:l,to:u}=e[a],d=u-l;if(s<=d)return l+s;s-=d}}function YZ(o,e){let t=0;for(let{from:s,to:a}of o.ranges){if(e<=a){t+=e-s;break}t+=a-s}return t/o.total}function y3e(o,e){for(let t of o)if(e(t))return t}const Bfe={toDOM(o){return o},fromDOM(o){return o},scale:1};class w3e{constructor(e,t,s){let a=0,l=0,u=0;this.viewports=s.map(({from:d,to:h})=>{let b=t.lineAt(d,Ic.ByPos,e,0,0).top,y=t.lineAt(h,Ic.ByPos,e,0,0).bottom;return a+=y-b,{from:d,to:h,top:b,bottom:y,domTop:0,domBottom:0}}),this.scale=(7e6-a)/(t.height-a);for(let d of this.viewports)d.domTop=u+(d.top-l)*this.scale,u=d.domBottom=d.domTop+(d.bottom-d.top),l=d.bottom}toDOM(e){for(let t=0,s=0,a=0;;t++){let l=t<this.viewports.length?this.viewports[t]:null;if(!l||e<l.top)return a+(e-s)*this.scale;if(e<=l.bottom)return l.domTop+(e-l.top);s=l.bottom,a=l.domBottom}}fromDOM(e){for(let t=0,s=0,a=0;;t++){let l=t<this.viewports.length?this.viewports[t]:null;if(!l||e<l.domTop)return s+(e-a)/this.scale;if(e<=l.domBottom)return l.top+(e-l.domTop);s=l.bottom,a=l.domBottom}}}function t6(o,e){if(e.scale==1)return o;let t=e.toDOM(o.top),s=e.toDOM(o.bottom);return new ly(o.from,o.length,t,s-t,Array.isArray(o._content)?o._content.map(a=>t6(a,e)):o._content)}const XZ=As.define({combine:o=>o.join(" ")}),hse=As.define({combine:o=>o.indexOf(!0)>-1}),mse=MC.newName(),Cbe=MC.newName(),kbe=MC.newName(),xbe={"&light":"."+Cbe,"&dark":"."+kbe};function gse(o,e,t){return new MC(e,{finish(s){return/&/.test(s)?s.replace(/&\w*/,a=>{if(a=="&")return o;if(!t||!t[a])throw new RangeError(`Unsupported selector: ${a}`);return t[a]}):o+" "+s}})}const _3e=gse("."+mse,{"&":{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"}},xbe),n6="\uFFFF";class S3e{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ra.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=n6}readRange(e,t){if(!e)return this;let s=e.parentNode;for(let a=e;;){this.findPointBefore(s,a);let l=this.text.length;this.readNode(a);let u=a.nextSibling;if(u==t)break;let d=Bc.get(a),h=Bc.get(u);(d&&h?d.breakAfter:(d?d.breakAfter:Lfe(a))||Lfe(u)&&(a.nodeName!="BR"||a.cmIgnore)&&this.text.length>l)&&this.lineBreak(),a=u}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 l=-1,u=1,d;if(this.lineSeparator?(l=t.indexOf(this.lineSeparator,s),u=this.lineSeparator.length):(d=a.exec(t))&&(l=d.index,u=d[0].length),this.append(t.slice(s,l<0?t.length:l)),l<0)break;if(this.lineBreak(),u>1)for(let h of this.points)h.node==e&&h.pos>this.text.length&&(h.pos-=u-1);s=l+u}}readNode(e){if(e.cmIgnore)return;let t=Bc.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+(C3e(e,s.node,s.offset)?t:0))}}function C3e(o,e,t){for(;;){if(!e||t<Vw(e))return!1;if(e==o)return!0;t=T6(e)+1,e=e.parentNode}}function Lfe(o){return o.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(o.nodeName)}class Ffe{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class k3e{constructor(e,t,s,a){this.typeOver=a,this.bounds=null,this.text="";let{impreciseHead:l,impreciseAnchor:u}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,s,0))){let d=l||u?[]:E3e(e),h=new S3e(d,e.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=A3e(d,this.bounds.from)}else{let d=e.observer.selectionRange,h=l&&l.node==d.focusNode&&l.offset==d.focusOffset||!Joe(e.contentDOM,d.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(d.focusNode,d.focusOffset),b=u&&u.node==d.anchorNode&&u.offset==d.anchorOffset||!Joe(e.contentDOM,d.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(d.anchorNode,d.anchorOffset);this.newSel=Ln.single(b,h)}}}function Tbe(o,e){let t,{newSel:s}=e,a=o.state.selection.main,l=o.inputState.lastKeyTime>Date.now()-100?o.inputState.lastKeyCode:-1;if(e.bounds){let{from:u,to:d}=e.bounds,h=a.from,b=null;(l===8||Fs.android&&e.text.length<d-u)&&(h=a.to,b="end");let y=T3e(o.state.doc.sliceString(u,d,n6),e.text,h-u,b);y&&(Fs.chrome&&l==13&&y.toB==y.from+2&&e.text.slice(y.from,y.toB)==n6+n6&&y.toB--,t={from:u+y.from,to:u+y.toA,insert:el.of(e.text.slice(y.from,y.toB).split(n6))})}else s&&(!o.hasFocus&&o.state.facet(oV)||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:o.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:o.state.doc.slice(a.from,t.from).append(t.insert).append(o.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())&&o.contentDOM.getAttribute("autocorrect")=="off"?(s&&t.insert.length==2&&(s=Ln.single(s.main.anchor-1,s.main.head-1)),t={from:a.from,to:a.to,insert:el.of([" "])}):Fs.chrome&&t&&t.from==t.to&&t.from==a.head&&t.insert.toString()==`
|
|
`&&o.lineWrapping&&(s&&(s=Ln.single(s.main.anchor-1,s.main.head-1)),t={from:a.from,to:a.to,insert:el.of([" "])}),t){if(Fs.ios&&o.inputState.flushIOSKey()||Fs.android&&(t.from==a.from&&t.to==a.to&&t.insert.length==1&&t.insert.lines==2&&_D(o.contentDOM,"Enter",13)||(t.from==a.from-1&&t.to==a.to&&t.insert.length==0||l==8&&t.insert.length<t.to-t.from&&t.to>a.head)&&_D(o.contentDOM,"Backspace",8)||t.from==a.from&&t.to==a.to+1&&t.insert.length==0&&_D(o.contentDOM,"Delete",46)))return!0;let u=t.insert.toString();o.inputState.composing>=0&&o.inputState.composing++;let d,h=()=>d||(d=x3e(o,t,s));return o.state.facet(K1e).some(b=>b(o,t.from,t.to,u,h))||o.dispatch(h()),!0}else if(s&&!s.main.eq(a)){let u=!1,d="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(u=!0),d=o.inputState.lastSelectionOrigin),o.dispatch({selection:s,scrollIntoView:u,userEvent:d}),!0}else return!1}function x3e(o,e,t){let s,a=o.state,l=a.selection.main;if(e.from>=l.from&&e.to<=l.to&&e.to-e.from>=(l.to-l.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&o.inputState.composing<0){let d=l.from<e.from?a.sliceDoc(l.from,e.from):"",h=l.to>e.to?a.sliceDoc(e.to,l.to):"";s=a.replaceSelection(o.state.toText(d+e.insert.sliceString(0,void 0,o.state.lineBreak)+h))}else{let d=a.changes(e),h=t&&t.main.to<=d.newLength?t.main:void 0;if(a.selection.ranges.length>1&&o.inputState.composing>=0&&e.to<=l.to&&e.to>=l.to-10){let b=o.state.sliceDoc(e.from,e.to),y,C=t&&fbe(o,t.main.head);if(C){let $=e.insert.length-(e.to-e.from);y={from:C.from,to:C.to-$}}else y=o.state.doc.lineAt(l.head);let E=l.to-e.to,R=l.to-l.from;s=a.changeByRange($=>{if($.from==l.from&&$.to==l.to)return{changes:d,range:h||$.map(d)};let Q=$.to-E,F=Q-b.length;if($.to-$.from!=R||o.state.sliceDoc(F,Q)!=b||$.to>=y.from&&$.from<=y.to)return{range:$};let U=a.changes({from:F,to:Q,insert:e.insert}),K=$.to-l.to;return{changes:U,range:h?Ln.range(Math.max(0,h.anchor+K),Math.max(0,h.head+K)):$.map(U)}})}else s={changes:d,selection:h&&a.selection.replaceRange(h)}}let u="input.type";return(o.composing||o.inputState.compositionPendingChange&&o.inputState.compositionEndedAt>Date.now()-50)&&(o.inputState.compositionPendingChange=!1,u+=".compose",o.inputState.compositionFirstChange&&(u+=".start",o.inputState.compositionFirstChange=!1)),a.update(s,{userEvent:u,scrollIntoView:!0})}function T3e(o,e,t,s){let a=Math.min(o.length,e.length),l=0;for(;l<a&&o.charCodeAt(l)==e.charCodeAt(l);)l++;if(l==a&&o.length==e.length)return null;let u=o.length,d=e.length;for(;u>0&&d>0&&o.charCodeAt(u-1)==e.charCodeAt(d-1);)u--,d--;if(s=="end"){let h=Math.max(0,l-Math.min(u,d));t-=u+h-l}if(u<l&&o.length<e.length){let h=t<=l&&t>=u?l-t:0;l-=h,d=l+(d-u),u=l}else if(d<l){let h=t<=l&&t>=d?l-t:0;l-=h,u=l+(u-d),d=l}return{from:l,toA:u,toB:d}}function E3e(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:t,anchorOffset:s,focusNode:a,focusOffset:l}=o.observer.selectionRange;return t&&(e.push(new Ffe(t,s)),(a!=t||l!=s)&&e.push(new Ffe(a,l))),e}function A3e(o,e){if(o.length==0)return null;let t=o[0].pos,s=o.length==2?o[1].pos:t;return t>-1&&s>-1?Ln.single(t+e,s+e):null}const D3e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Nne=Fs.ie&&Fs.ie_version<=11;class P3e{constructor(e){this.view=e,this.active=!1,this.selectionRange=new mEe,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()}),Nne&&(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(oV)?s.root.activeElement!=this.dom:!RH(s.dom,a))return;let l=a.anchorNode&&s.docView.nearest(a.anchorNode);if(l&&l.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Fs.ie&&Fs.ie_version<=11||Fs.android&&Fs.chrome)&&!s.state.selection.main.empty&&a.focusNode&&hz(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&&uEe(this.dom.ownerDocument)==this.dom&&M3e(this.view)||dz(e.root);if(!t||this.selectionRange.eq(t))return!1;let s=RH(this.dom,t);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&pEe(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,D3e),Nne&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){!this.active||(this.active=!1,this.observer.disconnect(),Nne&&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 l=this.delayedAndroidKey;l&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=l.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&l.force&&_D(this.dom,l.key,l.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 l of e){let u=this.readMutation(l);!u||(u.typeOver&&(a=!0),t==-1?{from:t,to:s}=u:(t=Math.min(u.from,t),s=Math.max(u.to,s)))}return{from:t,to:s,typeOver:a}}readChange(){let{from:e,to:t,typeOver:s}=this.processRecords(),a=this.selectionChanged&&RH(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 l=new k3e(this.view,e,t,s);return this.view.docView.domChanged={newSel:l.newSel?l.newSel.main:null},l}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=Tbe(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=Qfe(t,e.previousSibling||e.target.previousSibling,-1),a=Qfe(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 l of this.scrollTargets)l.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 Qfe(o,e,t){for(;e;){let s=Bc.get(e);if(s&&s.parent==o)return s;let a=e.parentNode;e=a!=o.dom?a:t>0?e.nextSibling:e.previousSibling}return null}function M3e(o){let e=null;function t(h){h.preventDefault(),h.stopImmediatePropagation(),e=h.getTargetRanges()[0]}if(o.contentDOM.addEventListener("beforeinput",t,!0),o.dom.ownerDocument.execCommand("indent"),o.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let s=e.startContainer,a=e.startOffset,l=e.endContainer,u=e.endOffset,d=o.docView.domAtPos(o.state.selection.main.anchor);return hz(d.node,d.offset,l,u)&&([s,a,l,u]=[l,u,s,a]),{anchorNode:s,anchorOffset:a,focusNode:l,focusOffset:u}}class is{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||gEe(e.parent)||document,this.viewState=new Ife(e.state||ra.create(e)),this.plugins=this.state.facet(JN).map(s=>new Pne(s));for(let s of this.plugins)s.update(this);this.observer=new P3e(this),this.inputState=new YEe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new vfe(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 _d?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,l=this.state;for(let E of e){if(E.startState!=l)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");l=E.state}if(this.destroyed){this.viewState.state=l;return}let u=this.hasFocus,d=0,h=null;e.some(E=>E.annotation(ybe))?(this.inputState.notifiedFocused=u,d=1):u!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=u,h=wbe(l,u),h||(d=1));let b=this.observer.delayedAndroidKey,y=null;if(b?(this.observer.clearDelayedAndroidKey(),y=this.observer.readChange(),(y&&!this.state.doc.eq(l.doc)||!this.state.selection.eq(l.selection))&&(y=null)):this.observer.clear(),l.facet(ra.phrases)!=this.state.facet(ra.phrases))return this.setState(l);a=gz.create(this,l,e),a.flags|=d;let C=this.viewState.scrollTarget;try{this.updateState=2;for(let E of e){if(C&&(C=C.map(E.changes)),E.scrollIntoView){let{main:R}=E.state.selection;C=new mz(R.empty?R:Ln.cursor(R.head,R.head>R.anchor?-1:1))}for(let R of E.effects)R.is(pfe)&&(C=R.value)}this.viewState.update(a,C),this.bidiCache=pz.update(this.bidiCache,a.changes),a.empty||(this.updatePlugins(a),this.inputState.update(a)),t=this.docView.update(a),this.state.facet(e6)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(E=>E.isUserEvent("select.pointer")))}finally{this.updateState=0}if(a.startState.facet(XZ)!=a.state.facet(XZ)&&(this.viewState.mustMeasureContent=!0),(t||s||C||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!a.empty)for(let E of this.state.facet(ise))E(a);(h||y)&&Promise.resolve().then(()=>{h&&this.state==h.startState&&this.dispatch(h),y&&!Tbe(this,y)&&b.force&&_D(this.contentDOM,b.key,b.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 Ife(e),this.plugins=e.facet(JN).map(s=>new Pne(s)),this.pluginMap.clear();for(let s of this.plugins)s.update(this);this.docView=new vfe(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(JN),s=e.state.facet(JN);if(t!=s){let a=[];for(let l of s){let u=t.indexOf(l);if(u<0)a.push(new Pne(l));else{let d=this.plugins[u];d.mustUpdate=e,a.push(d)}}for(let l of this.plugins)l.mustUpdate!=e&&l.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:l,scrollAnchorHeight:u}=this.viewState;Math.abs(a-this.viewState.scrollTop)>1&&(u=-1),this.viewState.scrollAnchorHeight=-1;try{for(let d=0;;d++){if(u<0)if(L1e(s))l=-1,u=this.viewState.heightMap.height;else{let R=this.viewState.scrollAnchorAt(a);l=R.from,u=R.top}this.updateState=1;let h=this.viewState.measure(this);if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(d>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let b=[];h&4||([this.measureRequests,b]=[b,this.measureRequests]);let y=b.map(R=>{try{return R.read(this)}catch($){return zb(this.state,$),Zfe}}),C=gz.create(this,this.state,[]),E=!1;C.flags|=h,t?t.flags|=h:t=C,this.updateState=2,C.empty||(this.updatePlugins(C),this.inputState.update(C),this.updateAttrs(),E=this.docView.update(C));for(let R=0;R<b.length;R++)if(y[R]!=Zfe)try{let $=b[R];$.write&&$.write(y[R],this)}catch($){zb(this.state,$)}if(E&&this.docView.updateSelection(!0),!C.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<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(l).top)-u;if($>1||$<-1){a=a+$,s.scrollTop=a/this.scaleY,u=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let d of this.state.facet(ise))d(t)}get themeClasses(){return mse+" "+(this.state.facet(hse)?kbe:Cbe)+" "+this.state.facet(XZ)}updateAttrs(){let e=Hfe(this,nbe,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(oV)?"true":"false",class:"cm-content",style:`${Fs.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Hfe(this,vre,t);let s=this.observer.ignore(()=>{let a=sse(this.contentDOM,this.contentAttrs,t),l=sse(this.dom,this.editorAttrs,e);return a||l});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(is.announce)){t&&(this.announceDOM.textContent=""),t=!1;let l=this.announceDOM.appendChild(document.createElement("div"));l.textContent=a.value}}mountStyles(){this.styleModules=this.state.facet(e6);let e=this.state.facet(is.cspNonce);MC.mount(this.root,this.styleModules.concat(_3e).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 Rne(this,e,Cfe(this,e,t,s))}moveByGroup(e,t){return Rne(this,e,Cfe(this,e,t,s=>WEe(this,e.head,s)))}moveToLineBoundary(e,t,s=!0){return VEe(this,e,t,s)}moveVertically(e,t,s){return Rne(this,e,UEe(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(),hbe(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),l=this.bidiSpans(a),u=l[kC.find(l,e-a.from,-1,t)];return gre(s,u.dir==Cu.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(ebe)||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>R3e)return cbe(e.length);let t=this.textDirectionAt(e.from),s;for(let l of this.bidiCache)if(l.from==e.from&&l.dir==t&&(l.fresh||lbe(l.isolates,s=bfe(this,e.from,e.to))))return l.order;s||(s=bfe(this,e.from,e.to));let a=DEe(e.text,t,s);return this.bidiCache.push(new pz(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(()=>{I1e(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 pfe.of(new mz(typeof e=="number"?Ln.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return kf.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return kf.define(()=>({}),{eventObservers:e})}static theme(e,t){let s=MC.newName(),a=[XZ.of(s),e6.of(gse(`.${s}`,e))];return t&&t.dark&&a.push(hse.of(!0)),a}static baseTheme(e){return QC.lowest(e6.of(gse("."+mse,e,xbe)))}static findFromDOM(e){var t;let s=e.querySelector(".cm-content"),a=s&&Bc.get(s)||Bc.get(e);return((t=a==null?void 0:a.rootView)===null||t===void 0?void 0:t.view)||null}}is.styleModule=e6;is.inputHandler=K1e;is.focusChangeEffect=J1e;is.perLineTextDirection=ebe;is.exceptionSink=G1e;is.updateListener=ise;is.editable=oV;is.mouseSelectionStyle=q1e;is.dragMovesSelection=j1e;is.clickAddsSelectionRange=X1e;is.decorations=E6;is.atomicRanges=Ore;is.bidiIsolatedRanges=obe;is.scrollMargins=sbe;is.darkTheme=hse;is.cspNonce=As.define({combine:o=>o.length?o[0]:""});is.contentAttributes=vre;is.editorAttributes=nbe;is.lineWrapping=is.contentAttributes.of({class:"cm-lineWrapping"});is.announce=bi.define();const R3e=4096,Zfe={};class pz{constructor(e,t,s,a,l,u){this.from=e,this.to=t,this.dir=s,this.isolates=a,this.fresh=l,this.order=u}static update(e,t){if(t.empty&&!e.some(l=>l.fresh))return e;let s=[],a=e.length?e[e.length-1].dir:Cu.LTR;for(let l=Math.max(0,e.length-10);l<e.length;l++){let u=e[l];u.dir==a&&!t.touchesRange(u.from,u.to)&&s.push(new pz(t.mapPos(u.from,1),t.mapPos(u.to,-1),u.dir,u.isolates,!1,u.order))}return s}}function Hfe(o,e,t){for(let s=o.state.facet(e),a=s.length-1;a>=0;a--){let l=s[a],u=typeof l=="function"?l(o):l;u&&ose(u,t)}return t}const $3e=Fs.mac?"mac":Fs.windows?"win":Fs.linux?"linux":"key";function N3e(o,e){const t=o.split(/-(?!$)/);let s=t[t.length-1];s=="Space"&&(s=" ");let a,l,u,d;for(let h=0;h<t.length-1;++h){const b=t[h];if(/^(cmd|meta|m)$/i.test(b))d=!0;else if(/^a(lt)?$/i.test(b))a=!0;else if(/^(c|ctrl|control)$/i.test(b))l=!0;else if(/^s(hift)?$/i.test(b))u=!0;else if(/^mod$/i.test(b))e=="mac"?d=!0:l=!0;else throw new Error("Unrecognized modifier name: "+b)}return a&&(s="Alt-"+s),l&&(s="Ctrl-"+s),d&&(s="Meta-"+s),u&&(s="Shift-"+s),s}function jZ(o,e,t){return e.altKey&&(o="Alt-"+o),e.ctrlKey&&(o="Ctrl-"+o),e.metaKey&&(o="Meta-"+o),t!==!1&&e.shiftKey&&(o="Shift-"+o),o}const I3e=QC.default(is.domEventHandlers({keydown(o,e){return Abe(Ebe(e.state),o,e,"editor")}})),wE=As.define({enables:I3e}),zfe=new WeakMap;function Ebe(o){let e=o.facet(wE),t=zfe.get(e);return t||zfe.set(e,t=F3e(e.reduce((s,a)=>s.concat(a),[]))),t}function B3e(o,e,t){return Abe(Ebe(o.state),e,o,t)}let wC=null;const L3e=4e3;function F3e(o,e=$3e){let t=Object.create(null),s=Object.create(null),a=(u,d)=>{let h=s[u];if(h==null)s[u]=d;else if(h!=d)throw new Error("Key binding "+u+" is used both as a regular binding and as a multi-stroke prefix")},l=(u,d,h,b,y)=>{var C,E;let R=t[u]||(t[u]=Object.create(null)),$=d.split(/ (?!$)/).map(U=>N3e(U,e));for(let U=1;U<$.length;U++){let K=$.slice(0,U).join(" ");a(K,!0),R[K]||(R[K]={preventDefault:!0,stopPropagation:!1,run:[L=>{let te=wC={view:L,prefix:K,scope:u};return setTimeout(()=>{wC==te&&(wC=null)},L3e),!0}]})}let Q=$.join(" ");a(Q,!1);let F=R[Q]||(R[Q]={preventDefault:!1,stopPropagation:!1,run:((E=(C=R._any)===null||C===void 0?void 0:C.run)===null||E===void 0?void 0:E.slice())||[]});h&&F.run.push(h),b&&(F.preventDefault=!0),y&&(F.stopPropagation=!0)};for(let u of o){let d=u.scope?u.scope.split(" "):["editor"];if(u.any)for(let b of d){let y=t[b]||(t[b]=Object.create(null));y._any||(y._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let C in y)y[C].run.push(u.any)}let h=u[e]||u.key;if(!!h)for(let b of d)l(b,h,u.run,u.preventDefault,u.stopPropagation),u.shift&&l(b,"Shift-"+h,u.shift,u.preventDefault,u.stopPropagation)}return t}function Abe(o,e,t,s){let a=cEe(e),l=Uh(a,0),u=Fb(l)==a.length&&a!=" ",d="",h=!1,b=!1,y=!1;wC&&wC.view==t&&wC.scope==s&&(d=wC.prefix+" ",gbe.indexOf(e.keyCode)<0&&(b=!0,wC=null));let C=new Set,E=F=>{if(F){for(let U of F.run)if(!C.has(U)&&(C.add(U),U(t,e)))return F.stopPropagation&&(y=!0),!0;F.preventDefault&&(F.stopPropagation&&(y=!0),b=!0)}return!1},R=o[s],$,Q;return R&&(E(R[d+jZ(a,e,!u)])?h=!0:u&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Fs.windows&&e.ctrlKey&&e.altKey)&&($=RC[e.keyCode])&&$!=a?(E(R[d+jZ($,e,!0)])||e.shiftKey&&(Q=k6[e.keyCode])!=a&&Q!=$&&E(R[d+jZ(Q,e,!1)]))&&(h=!0):u&&e.shiftKey&&E(R[d+jZ(a,e,!0)])&&(h=!0),!h&&E(R._any)&&(h=!0)),b&&(h=!0),h&&y&&e.stopPropagation(),h}class iI{constructor(e,t,s,a,l){this.className=e,this.left=t,this.top=s,this.width=a,this.height=l}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 l=Dbe(e);return[new iI(t,a.left-l.left,a.top-l.top,null,a.bottom-a.top)]}else return Q3e(e,t,s)}}function Dbe(o){let e=o.scrollDOM.getBoundingClientRect();return{left:(o.textDirection==Cu.LTR?e.left:e.right-o.scrollDOM.clientWidth*o.scaleX)-o.scrollDOM.scrollLeft*o.scaleX,top:e.top-o.scrollDOM.scrollTop*o.scaleY}}function Vfe(o,e,t){let s=Ln.cursor(e);return{from:Math.max(t.from,o.moveToLineBoundary(s,!1,!0).from),to:Math.min(t.to,o.moveToLineBoundary(s,!0,!0).from),type:$g.Text}}function Q3e(o,e,t){if(t.to<=o.viewport.from||t.from>=o.viewport.to)return[];let s=Math.max(t.from,o.viewport.from),a=Math.min(t.to,o.viewport.to),l=o.textDirection==Cu.LTR,u=o.contentDOM,d=u.getBoundingClientRect(),h=Dbe(o),b=u.querySelector(".cm-line"),y=b&&window.getComputedStyle(b),C=d.left+(y?parseInt(y.paddingLeft)+Math.min(0,parseInt(y.textIndent)):0),E=d.right-(y?parseInt(y.paddingRight):0),R=fse(o,s),$=fse(o,a),Q=R.type==$g.Text?R:null,F=$.type==$g.Text?$:null;if(Q&&(o.lineWrapping||R.widgetLineBreaks)&&(Q=Vfe(o,s,Q)),F&&(o.lineWrapping||$.widgetLineBreaks)&&(F=Vfe(o,a,F)),Q&&F&&Q.from==F.from)return K(L(t.from,t.to,Q));{let ne=Q?L(t.from,null,Q):te(R,!1),oe=F?L(null,t.to,F):te($,!0),G=[];return(Q||R).to<(F||$).from-(Q&&F?1:0)||R.widgetLineBreaks>1&&ne.bottom+o.defaultLineHeight/2<oe.top?G.push(U(C,ne.bottom,E,oe.top)):ne.bottom<oe.top&&o.elementAtHeight((ne.bottom+oe.top)/2).type==$g.Text&&(ne.bottom=oe.top=(ne.bottom+oe.top)/2),K(ne).concat(G).concat(K(oe))}function U(ne,oe,G,we){return new iI(e,ne-h.left,oe-h.top-.01,G-ne,we-oe+.01)}function K({top:ne,bottom:oe,horizontal:G}){let we=[];for(let ve=0;ve<G.length;ve+=2)we.push(U(G[ve],ne,G[ve+1],oe));return we}function L(ne,oe,G){let we=1e9,ve=-1e9,Re=[];function Oe(tt,ot,V,ut,Qe){let Bt=o.coordsAtPos(tt,tt==G.to?-2:2),Ct=o.coordsAtPos(V,V==G.from?2:-2);!Bt||!Ct||(we=Math.min(Bt.top,Ct.top,we),ve=Math.max(Bt.bottom,Ct.bottom,ve),Qe==Cu.LTR?Re.push(l&&ot?C:Bt.left,l&&ut?E:Ct.right):Re.push(!l&&ut?C:Ct.left,!l&&ot?E:Bt.right))}let ce=ne!=null?ne:G.from,Xe=oe!=null?oe:G.to;for(let tt of o.visibleRanges)if(tt.to>ce&&tt.from<Xe)for(let ot=Math.max(tt.from,ce),V=Math.min(tt.to,Xe);;){let ut=o.state.doc.lineAt(ot);for(let Qe of o.bidiSpans(ut)){let Bt=Qe.from+ut.from,Ct=Qe.to+ut.from;if(Bt>=V)break;Ct>ot&&Oe(Math.max(Bt,ot),ne==null&&Bt<=ce,Math.min(Ct,V),oe==null&&Ct>=Xe,Qe.dir)}if(ot=ut.to+1,ot>=V)break}return Re.length==0&&Oe(ce,ne==null,Xe,oe==null,o.textDirection),{top:we,bottom:ve,horizontal:Re}}function te(ne,oe){let G=d.top+(oe?ne.top:ne.bottom);return{top:G,bottom:G,horizontal:[]}}}function Z3e(o,e){return o.constructor==e.constructor&&o.eq(e)}class H3e{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(IH)!=e.state.facet(IH)&&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(IH);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)=>!Z3e(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 IH=As.define();function Pbe(o){return[kf.define(e=>new H3e(e,o)),IH.of(o)]}const Mbe=!Fs.ios,D6=As.define({combine(o){return Tv(o,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function z3e(o={}){return[D6.of(o),V3e,W3e,U3e,tbe.of(!0)]}function Rbe(o){return o.startState.facet(D6)!=o.state.facet(D6)}const V3e=Pbe({above:!0,markers(o){let{state:e}=o,t=e.facet(D6),s=[];for(let a of e.selection.ranges){let l=a==e.selection.main;if(a.empty?!l||Mbe:t.drawRangeCursor){let u=l?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",d=a.empty?a:Ln.cursor(a.head,a.head>a.anchor?-1:1);for(let h of iI.forRange(o,u,d))s.push(h)}}return s},update(o,e){o.transactions.some(s=>s.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Rbe(o);return t&&Wfe(o.state,e),o.docChanged||o.selectionSet||t},mount(o,e){Wfe(e.state,o)},class:"cm-cursorLayer"});function Wfe(o,e){e.style.animationDuration=o.facet(D6).cursorBlinkRate+"ms"}const W3e=Pbe({above:!1,markers(o){return o.state.selection.ranges.map(e=>e.empty?[]:iI.forRange(o,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(o,e){return o.docChanged||o.selectionSet||o.viewportChanged||Rbe(o)},class:"cm-selectionLayer"}),$be={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Mbe&&($be[".cm-line"].caretColor="transparent !important");const U3e=QC.highest(is.theme($be)),Nbe=bi.define({map(o,e){return o==null?null:e.mapPos(o)}}),o6=Uf.define({create(){return null},update(o,e){return o!=null&&(o=e.changes.mapPos(o)),e.effects.reduce((t,s)=>s.is(Nbe)?s.value:t,o)}}),Y3e=kf.fromClass(class{constructor(o){this.view=o,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(o){var e;let t=o.state.field(o6);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"),(o.startState.field(o6)!=t||o.docChanged||o.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:o}=this,e=o.state.field(o6),t=e!=null&&o.coordsAtPos(e);if(!t)return null;let s=o.scrollDOM.getBoundingClientRect();return{left:t.left-s.left+o.scrollDOM.scrollLeft*o.scaleX,top:t.top-s.top+o.scrollDOM.scrollTop*o.scaleY,height:t.bottom-t.top}}drawCursor(o){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;o?(this.cursor.style.left=o.left/e+"px",this.cursor.style.top=o.top/t+"px",this.cursor.style.height=o.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(o){this.view.state.field(o6)!=o&&this.view.dispatch({effects:Nbe.of(o)})}},{eventObservers:{dragover(o){this.setDropPos(this.view.posAtCoords({x:o.clientX,y:o.clientY}))},dragleave(o){(o.target==this.view.contentDOM||!this.view.contentDOM.contains(o.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function X3e(){return[o6,Y3e]}function Ufe(o,e,t,s,a){e.lastIndex=0;for(let l=o.iterRange(t,s),u=t,d;!l.next().done;u+=l.value.length)if(!l.lineBreak)for(;d=e.exec(l.value);)a(u+d.index,d)}function j3e(o,e){let t=o.visibleRanges;if(t.length==1&&t[0].from==o.viewport.from&&t[0].to==o.viewport.to)return t;let s=[];for(let{from:a,to:l}of t)a=Math.max(o.state.doc.lineAt(a).from,a-e),l=Math.min(o.state.doc.lineAt(l).to,l+e),s.length&&s[s.length-1].to>=a?s[s.length-1].to=l:s.push({from:a,to:l});return s}class q3e{constructor(e){const{regexp:t,decoration:s,decorate:a,boundary:l,maxLength:u=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=(d,h,b,y)=>a(y,b,b+d[0].length,d,h);else if(typeof s=="function")this.addMatch=(d,h,b,y)=>{let C=s(d,h,b);C&&y(b,b+d[0].length,C)};else if(s)this.addMatch=(d,h,b,y)=>y(b,b+d[0].length,s);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=l,this.maxLength=u}createDeco(e){let t=new PC,s=t.add.bind(t);for(let{from:a,to:l}of j3e(e,this.maxLength))Ufe(e.state.doc,this.regexp,a,l,(u,d)=>this.addMatch(d,e,u,s));return t.finish()}updateDeco(e,t){let s=1e9,a=-1;return e.docChanged&&e.changes.iterChanges((l,u,d,h)=>{h>e.view.viewport.from&&d<e.view.viewport.to&&(s=Math.min(d,s),a=Math.max(h,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 l of e.visibleRanges){let u=Math.max(l.from,s),d=Math.min(l.to,a);if(d>u){let h=e.state.doc.lineAt(u),b=h.to<d?e.state.doc.lineAt(d):h,y=Math.max(l.from,h.from),C=Math.min(l.to,b.to);if(this.boundary){for(;u>h.from;u--)if(this.boundary.test(h.text[u-1-h.from])){y=u;break}for(;d<b.to;d++)if(this.boundary.test(b.text[d-b.from])){C=d;break}}let E=[],R,$=(Q,F,U)=>E.push(U.range(Q,F));if(h==b)for(this.regexp.lastIndex=y-h.from;(R=this.regexp.exec(h.text))&&R.index<C-h.from;)this.addMatch(R,e,R.index+h.from,$);else Ufe(e.state.doc,this.regexp,y,C,(Q,F)=>this.addMatch(F,e,Q,$));t=t.update({filterFrom:y,filterTo:C,filter:(Q,F)=>Q<y||F>C,add:E})}}return t}}const pse=/x/.unicode!=null?"gu":"g",G3e=new RegExp(`[\0-\b
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,pse),K3e={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 Ine=null;function J3e(){var o;if(Ine==null&&typeof document<"u"&&document.body){let e=document.body.style;Ine=((o=e.tabSize)!==null&&o!==void 0?o:e.MozTabSize)!=null}return Ine||!1}const BH=As.define({combine(o){let e=Tv(o,{render:null,specialChars:G3e,addSpecialChars:null});return(e.replaceTabs=!J3e())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,pse)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,pse)),e}});function eAe(o={}){return[BH.of(o),tAe()]}let Yfe=null;function tAe(){return Yfe||(Yfe=kf.fromClass(class{constructor(o){this.view=o,this.decorations=Br.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(o.state.facet(BH)),this.decorations=this.decorator.createDeco(o)}makeDecorator(o){return new q3e({regexp:o.specialChars,decoration:(e,t,s)=>{let{doc:a}=t.state,l=Uh(e[0],0);if(l==9){let u=a.lineAt(s),d=t.state.tabSize,h=Cv(u.text,d,s-u.from);return Br.replace({widget:new rAe((d-h%d)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=Br.replace({widget:new sAe(o,l)}))},boundary:o.replaceTabs?void 0:/[^]/})}update(o){let e=o.state.facet(BH);o.startState.facet(BH)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(o.view)):this.decorations=this.decorator.updateDeco(o,this.decorations)}},{decorations:o=>o.decorations}))}const nAe="\u2022";function oAe(o){return o>=32?nAe:o==10?"\u2424":String.fromCharCode(9216+o)}class sAe extends Gw{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=oAe(this.code),s=e.state.phrase("Control character")+" "+(K3e[this.code]||"0x"+this.code.toString(16)),a=this.options.render&&this.options.render(this.code,s,t);if(a)return a;let l=document.createElement("span");return l.textContent=t,l.title=s,l.setAttribute("aria-label",s),l.className="cm-specialChar",l}ignoreEvent(){return!1}}class rAe extends Gw{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 iAe(){return lAe}const aAe=Br.line({class:"cm-activeLine"}),lAe=kf.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.docChanged||o.selectionSet)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=-1,t=[];for(let s of o.state.selection.ranges){let a=o.lineBlockAt(s.head);a.from>e&&(t.push(aAe.range(a.from)),e=a.from)}return Br.set(t)}},{decorations:o=>o.decorations}),bse=2e3;function cAe(o,e,t){let s=Math.min(e.line,t.line),a=Math.max(e.line,t.line),l=[];if(e.off>bse||t.off>bse||e.col<0||t.col<0){let u=Math.min(e.off,t.off),d=Math.max(e.off,t.off);for(let h=s;h<=a;h++){let b=o.doc.line(h);b.length<=d&&l.push(Ln.range(b.from+u,b.to+d))}}else{let u=Math.min(e.col,t.col),d=Math.max(e.col,t.col);for(let h=s;h<=a;h++){let b=o.doc.line(h),y=qoe(b.text,u,o.tabSize,!0);if(y<0)l.push(Ln.cursor(b.to));else{let C=qoe(b.text,d,o.tabSize);l.push(Ln.range(b.from+y,b.from+C))}}}return l}function uAe(o,e){let t=o.coordsAtPos(o.viewport.from);return t?Math.round(Math.abs((t.left-e)/o.defaultCharacterWidth)):-1}function Xfe(o,e){let t=o.posAtCoords({x:e.clientX,y:e.clientY},!1),s=o.state.doc.lineAt(t),a=t-s.from,l=a>bse?-1:a==s.length?uAe(o,e.clientX):Cv(s.text,o.state.tabSize,t-s.from);return{line:s.number,col:l,off:a}}function fAe(o,e){let t=Xfe(o,e),s=o.state.selection;return t?{update(a){if(a.docChanged){let l=a.changes.mapPos(a.startState.doc.line(t.line).from),u=a.state.doc.lineAt(l);t={line:u.number,col:t.col,off:Math.min(t.off,u.length)},s=s.map(a.changes)}},get(a,l,u){let d=Xfe(o,a);if(!d)return s;let h=cAe(o.state,t,d);return h.length?u?Ln.create(h.concat(s.ranges)):Ln.create(h):s}}:null}function dAe(o){let e=(o==null?void 0:o.eventFilter)||(t=>t.altKey&&t.button==0);return is.mouseSelectionStyle.of((t,s)=>e(s)?fAe(t,s):null)}const hAe={Alt:[18,o=>!!o.altKey],Control:[17,o=>!!o.ctrlKey],Shift:[16,o=>!!o.shiftKey],Meta:[91,o=>!!o.metaKey]},mAe={style:"cursor: crosshair"};function gAe(o={}){let[e,t]=hAe[o.key||"Alt"],s=kf.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,is.contentAttributes.of(a=>{var l;return!((l=a.plugin(s))===null||l===void 0)&&l.isDown?mAe:null})]}const qZ="-10000px";class Ibe{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(u=>u);if(s===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let l=[];for(let u=0;u<a.length;u++){let d=a[u],h=-1;if(!!d){for(let b=0;b<this.tooltips.length;b++){let y=this.tooltips[b];y&&y.create==d.create&&(h=b)}if(h<0)l[u]=this.createTooltipView(d);else{let b=l[u]=this.tooltipViews[h];b.update&&b.update(e)}}}for(let u of this.tooltipViews)l.indexOf(u)<0&&(u.dom.remove(),(t=u.destroy)===null||t===void 0||t.call(u));return this.input=s,this.tooltips=a,this.tooltipViews=l,!0}}function pAe(o){let{win:e}=o;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Bne=As.define({combine:o=>{var e,t,s;return{position:Fs.ios?"absolute":((e=o.find(a=>a.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=o.find(a=>a.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((s=o.find(a=>a.tooltipSpace))===null||s===void 0?void 0:s.tooltipSpace)||pAe}}}),jfe=new WeakMap,Bbe=kf.fromClass(class{constructor(o){this.view=o,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=o.state.facet(Bne);this.position=e.position,this.parent=e.parent,this.classes=o.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Ibe(o,sV,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(),o.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 o of this.manager.tooltipViews)this.intersectionObserver.observe(o.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(o){o.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(o);e&&this.observeIntersection();let t=e||o.geometryChanged,s=o.state.facet(Bne);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(o){let e=o.create(this.view);if(e.dom.classList.add("cm-tooltip"),o.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=qZ,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var o,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(o=t.destroy)===null||o===void 0||o.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let o=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:o,parent:this.parent?this.container.getBoundingClientRect():o,pos:this.manager.tooltips.map((a,l)=>{let u=this.manager.tooltipViews[l];return u.getCoords?u.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Bne).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:s}}writeMeasure(o){var e;if(o.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let d of this.manager.tooltipViews)d.dom.style.position="absolute"}let{editor:t,space:s,scaleX:a,scaleY:l}=o,u=[];for(let d=0;d<this.manager.tooltips.length;d++){let h=this.manager.tooltips[d],b=this.manager.tooltipViews[d],{dom:y}=b,C=o.pos[d],E=o.size[d];if(!C||C.bottom<=Math.max(t.top,s.top)||C.top>=Math.min(t.bottom,s.bottom)||C.right<Math.max(t.left,s.left)-.1||C.left>Math.min(t.right,s.right)+.1){y.style.top=qZ;continue}let R=h.arrow?b.dom.querySelector(".cm-tooltip-arrow"):null,$=R?7:0,Q=E.right-E.left,F=(e=jfe.get(b))!==null&&e!==void 0?e:E.bottom-E.top,U=b.offset||vAe,K=this.view.textDirection==Cu.LTR,L=E.width>s.right-s.left?K?s.left:s.right-E.width:K?Math.min(C.left-(R?14:0)+U.x,s.right-Q):Math.max(s.left,C.left-Q+(R?14:0)-U.x),te=!!h.above;!h.strictSide&&(te?C.top-(E.bottom-E.top)-U.y<s.top:C.bottom+(E.bottom-E.top)+U.y>s.bottom)&&te==s.bottom-C.bottom>C.top-s.top&&(te=!te);let ne=(te?C.top-s.top:s.bottom-C.bottom)-$;if(ne<F&&b.resize!==!1){if(ne<this.view.defaultLineHeight){y.style.top=qZ;continue}jfe.set(b,F),y.style.height=(F=ne)/l+"px"}else y.style.height&&(y.style.height="");let oe=te?C.top-F-$-U.y:C.bottom+$+U.y,G=L+Q;if(b.overlap!==!0)for(let we of u)we.left<G&&we.right>L&&we.top<oe+F&&we.bottom>oe&&(oe=te?we.top-F-2-$:we.bottom+$+2);if(this.position=="absolute"?(y.style.top=(oe-o.parent.top)/l+"px",y.style.left=(L-o.parent.left)/a+"px"):(y.style.top=oe/l+"px",y.style.left=L/a+"px"),R){let we=C.left+(K?U.x:-U.x)-(L+14-7);R.style.left=we/a+"px"}b.overlap!==!0&&u.push({left:L,top:oe,right:G,bottom:oe+F}),y.classList.toggle("cm-tooltip-above",te),y.classList.toggle("cm-tooltip-below",!te),b.positioned&&b.positioned(o.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 o of this.manager.tooltipViews)o.dom.style.top=qZ}},{eventObservers:{scroll(){this.maybeMeasure()}}}),bAe=is.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"}}}),vAe={x:0,y:0},sV=As.define({enables:[Bbe,bAe]}),bz=As.define();class wre{static create(e){return new wre(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ibe(e,bz,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 OAe=sV.compute([bz],o=>{let e=o.facet(bz).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:wre.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class yAe{constructor(e,t,s,a,l){this.view=e,this.source=t,this.field=s,this.setHover=a,this.hoverTime=l,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,l=1;if(s instanceof CC)a=s.posAtStart;else{if(a=e.posAtCoords(t),a==null)return;let d=e.coordsAtPos(a);if(!d||t.y<d.top||t.y>d.bottom||t.x<d.left-e.defaultCharacterWidth||t.x>d.right+e.defaultCharacterWidth)return;let h=e.bidiSpans(e.state.doc.lineAt(a)).find(y=>y.from<=a&&y.to>=a),b=h&&h.dir==Cu.RTL?-1:1;l=t.x<d.left?-b:b}let u=this.source(e,a,l);if(u!=null&&u.then){let d=this.pending={pos:a};u.then(h=>{this.pending==d&&(this.pending=null,h&&e.dispatch({effects:this.setHover.of(h)}))},h=>zb(e.state,h,"hover tooltip"))}else u&&e.dispatch({effects:this.setHover.of(u)})}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&&!qfe(this.lastMove.target)||this.pending){let{pos:a}=s||this.pending,l=(t=s==null?void 0:s.end)!==null&&t!==void 0?t:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!wAe(this.view,a,l,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&&!qfe(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 qfe(o){for(let e=o;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function wAe(o,e,t,s,a,l){let u=o.scrollDOM.getBoundingClientRect(),d=o.documentTop+o.documentPadding.top+o.contentHeight;if(u.left>s||u.right<s||u.top>a||Math.min(u.bottom,d)<a)return!1;let h=o.posAtCoords({x:s,y:a},!1);return h>=e&&h<=t}function _Ae(o,e={}){let t=bi.define(),s=Uf.define({create(){return null},update(a,l){if(a&&(e.hideOnChange&&(l.docChanged||l.selection)||e.hideOn&&e.hideOn(l,a)))return null;if(a&&l.docChanged){let u=l.changes.mapPos(a.pos,-1,Xh.TrackDel);if(u==null)return null;let d=Object.assign(Object.create(null),a);d.pos=u,a.end!=null&&(d.end=l.changes.mapPos(a.end)),a=d}for(let u of l.effects)u.is(t)&&(a=u.value),u.is(SAe)&&(a=null);return a},provide:a=>bz.from(a)});return[s,kf.define(a=>new yAe(a,o,s,t,e.hoverTime||300)),OAe]}function Lbe(o,e){let t=o.plugin(Bbe);if(!t)return null;let s=t.manager.tooltips.indexOf(e);return s<0?null:t.manager.tooltipViews[s]}const SAe=bi.define(),Gfe=As.define({combine(o){let e,t;for(let s of o)e=e||s.topContainer,t=t||s.bottomContainer;return{topContainer:e,bottomContainer:t}}});function P6(o,e){let t=o.plugin(Fbe),s=t?t.specs.indexOf(e):-1;return s>-1?t.panels[s]:null}const Fbe=kf.fromClass(class{constructor(o){this.input=o.state.facet(M6),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(o));let e=o.state.facet(Gfe);this.top=new GZ(o,!0,e.topContainer),this.bottom=new GZ(o,!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(o){let e=o.state.facet(Gfe);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new GZ(o.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new GZ(o.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=o.state.facet(M6);if(t!=this.input){let s=t.filter(h=>h),a=[],l=[],u=[],d=[];for(let h of s){let b=this.specs.indexOf(h),y;b<0?(y=h(o.view),d.push(y)):(y=this.panels[b],y.update&&y.update(o)),a.push(y),(y.top?l:u).push(y)}this.specs=s,this.panels=a,this.top.sync(l),this.bottom.sync(u);for(let h of d)h.dom.classList.add("cm-panel"),h.mount&&h.mount()}else for(let s of this.panels)s.update&&s.update(o)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:o=>is.scrollMargins.of(e=>{let t=e.plugin(o);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class GZ{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=Kfe(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Kfe(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 Kfe(o){let e=o.nextSibling;return o.remove(),e}const M6=As.define({enables:Fbe});class wy extends mE{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}wy.prototype.elementClass="";wy.prototype.toDOM=void 0;wy.prototype.mapMode=Xh.TrackBefore;wy.prototype.startSide=wy.prototype.endSide=-1;wy.prototype.point=!0;const LH=As.define(),CAe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>tl.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},m6=As.define();function Qbe(o){return[Zbe(),m6.of(Object.assign(Object.assign({},CAe),o))]}const vse=As.define({combine:o=>o.some(e=>e)});function Zbe(o){let e=[kAe];return o&&o.fixed===!1&&e.push(vse.of(!0)),e}const kAe=kf.fromClass(class{constructor(o){this.view=o,this.prevViewport=o.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=o.state.facet(m6).map(e=>new ede(o,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!o.state.facet(vse),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),o.scrollDOM.insertBefore(this.dom,o.contentDOM)}update(o){if(this.updateGutters(o)){let e=this.prevViewport,t=o.view.viewport,s=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(s<(t.to-t.from)*.8)}o.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(vse)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=o.view.viewport}syncGutters(o){let e=this.dom.nextSibling;o&&this.dom.remove();let t=tl.iter(this.view.state.facet(LH),this.view.viewport.from),s=[],a=this.gutters.map(l=>new xAe(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(s.length&&(s=[]),Array.isArray(l.type)){let u=!0;for(let d of l.type)if(d.type==$g.Text&&u){Ose(t,s,d.from);for(let h of a)h.line(this.view,d,s);u=!1}else if(d.widget)for(let h of a)h.widget(this.view,d)}else if(l.type==$g.Text){Ose(t,s,l.from);for(let u of a)u.line(this.view,l,s)}else if(l.widget)for(let u of a)u.widget(this.view,l);for(let l of a)l.finish();o&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(o){let e=o.startState.facet(m6),t=o.state.facet(m6),s=o.docChanged||o.heightChanged||o.viewportChanged||!tl.eq(o.startState.facet(LH),o.state.facet(LH),o.view.viewport.from,o.view.viewport.to);if(e==t)for(let a of this.gutters)a.update(o)&&(s=!0);else{s=!0;let a=[];for(let l of t){let u=e.indexOf(l);u<0?a.push(new ede(this.view,l)):(this.gutters[u].update(o),a.push(this.gutters[u]))}for(let l of this.gutters)l.dom.remove(),a.indexOf(l)<0&&l.destroy();for(let l of a)this.dom.appendChild(l.dom);this.gutters=a}return s}destroy(){for(let o of this.gutters)o.destroy();this.dom.remove()}},{provide:o=>is.scrollMargins.of(e=>{let t=e.plugin(o);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Cu.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Jfe(o){return Array.isArray(o)?o:[o]}function Ose(o,e,t){for(;o.value&&o.from<=t;)o.from==t&&e.push(o.value),o.next()}class xAe{constructor(e,t,s){this.gutter=e,this.height=s,this.i=0,this.cursor=tl.iter(e.markers,t.from)}addElement(e,t,s){let{gutter:a}=this,l=(t.top-this.height)/e.scaleY,u=t.height/e.scaleY;if(this.i==a.elements.length){let d=new Hbe(e,u,l,s);a.elements.push(d),a.dom.appendChild(d.dom)}else a.elements[this.i].update(e,u,l,s);this.height=t.bottom,this.i++}line(e,t,s){let a=[];Ose(this.cursor,a,t.from),s.length&&(a=a.concat(s));let l=this.gutter.config.lineMarker(e,t,a);l&&a.unshift(l);let u=this.gutter;a.length==0&&!u.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 ede{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 l=a.target,u;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let h=l.getBoundingClientRect();u=(h.top+h.bottom)/2}else u=a.clientY;let d=e.lineBlockAtHeight(u-e.documentTop);t.domEventHandlers[s](e,d,a)&&a.preventDefault()});this.markers=Jfe(t.markers(e)),t.initialSpacer&&(this.spacer=new Hbe(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=Jfe(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!tl.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 Hbe{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 l=0,u=0;;){let d=u,h=l<t.length?t[l++]:null,b=!1;if(h){let y=h.elementClass;y&&(s+=" "+y);for(let C=u;C<this.markers.length;C++)if(this.markers[C].compare(h)){d=C,b=!0;break}}else d=this.markers.length;for(;u<d;){let y=this.markers[u++];if(y.toDOM){y.destroy(a);let C=a.nextSibling;a.remove(),a=C}}if(!h)break;h.toDOM&&(b?a=a.nextSibling:this.dom.insertBefore(h.toDOM(e),a)),b&&u++}this.dom.className=s,this.markers=t}destroy(){this.setMarkers(null,[])}}function TAe(o,e){if(o.length!=e.length)return!1;for(let t=0;t<o.length;t++)if(!o[t].compare(e[t]))return!1;return!0}const EAe=As.define(),mD=As.define({combine(o){return Tv(o,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let s=Object.assign({},e);for(let a in t){let l=s[a],u=t[a];s[a]=l?(d,h,b)=>l(d,h,b)||u(d,h,b):u}return s}})}});class Lne extends wy{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Fne(o,e){return o.state.facet(mD).formatNumber(e,o.state)}const AAe=m6.compute([mD],o=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(EAe)},lineMarker(e,t,s){return s.some(a=>a.toDOM)?null:new Lne(Fne(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(mD)!=e.state.facet(mD),initialSpacer(e){return new Lne(Fne(e,tde(e.state.doc.lines)))},updateSpacer(e,t){let s=Fne(t.view,tde(t.view.state.doc.lines));return s==e.number?e:new Lne(s)},domEventHandlers:o.facet(mD).domEventHandlers}));function DAe(o={}){return[mD.of(o),Zbe(),AAe]}function tde(o){let e=9;for(;e<o;)e=e*10+9;return e}const PAe=new class extends wy{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},MAe=LH.compute(["selection"],o=>{let e=[],t=-1;for(let s of o.selection.ranges){let a=o.doc.lineAt(s.head).from;a>t&&(t=a,e.push(PAe.range(a)))}return tl.of(e)});function RAe(){return MAe}const zbe=1024;let $Ae=0;class Qb{constructor(e,t){this.from=e,this.to=t}}class ui{constructor(e={}){this.id=$Ae++,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=Sd.match(e)),t=>{let s=e(t);return s===void 0?null:[this,s]}}}ui.closedBy=new ui({deserialize:o=>o.split(" ")});ui.openedBy=new ui({deserialize:o=>o.split(" ")});ui.group=new ui({deserialize:o=>o.split(" ")});ui.contextHash=new ui({perNode:!0});ui.lookAhead=new ui({perNode:!0});ui.mounted=new ui({perNode:!0});class R6{constructor(e,t,s){this.tree=e,this.overlay=t,this.parser=s}static get(e){return e&&e.props&&e.props[ui.mounted.id]}}const NAe=Object.create(null);class Sd{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):NAe,s=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),a=new Sd(e.name||"",t,e.id,s);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(a)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[l[0].id]=l[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(ui.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(ui.group),l=-1;l<(a?a.length:0);l++){let u=t[l<0?s.name:a[l]];if(u)return u}}}}Sd.none=new Sd("",Object.create(null),0,8);class aI{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 l of e){let u=l(s);u&&(a||(a=Object.assign({},s.props)),a[u[0].id]=u[1])}t.push(a?new Sd(s.name,a,s.id,s.flags):s)}return new aI(t)}}const KZ=new WeakMap,nde=new WeakMap;var wc;(function(o){o[o.ExcludeBuffers=1]="ExcludeBuffers",o[o.IncludeAnonymous=2]="IncludeAnonymous",o[o.IgnoreMounts=4]="IgnoreMounts",o[o.IgnoreOverlays=8]="IgnoreOverlays"})(wc||(wc={}));class Cl{constructor(e,t,s,a,l){if(this.type=e,this.children=t,this.positions=s,this.length=a,this.props=null,l&&l.length){this.props=Object.create(null);for(let[u,d]of l)this.props[typeof u=="number"?u:u.id]=d}}toString(){let e=R6.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 vz(this.topNode,e)}cursorAt(e,t=0,s=0){let a=KZ.get(this)||this.topNode,l=new vz(a);return l.moveTo(e,t),KZ.set(this,l._tree),l}get topNode(){return new Ig(this,0,0,null)}resolve(e,t=0){let s=$6(KZ.get(this)||this.topNode,e,t,!1);return KZ.set(this,s),s}resolveInner(e,t=0){let s=$6(nde.get(this)||this.topNode,e,t,!0);return nde.set(this,s),s}resolveStack(e,t=0){return LAe(this,e,t)}iterate(e){let{enter:t,leave:s,from:a=0,to:l=this.length}=e,u=e.mode||0,d=(u&wc.IncludeAnonymous)>0;for(let h=this.cursor(u|wc.IncludeAnonymous);;){let b=!1;if(h.from<=l&&h.to>=a&&(!d&&h.type.isAnonymous||t(h)!==!1)){if(h.firstChild())continue;b=!0}for(;b&&s&&(d||!h.type.isAnonymous)&&s(h),!h.nextSibling();){if(!h.parent())return;b=!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:Cre(Sd.none,this.children,this.positions,0,this.children.length,0,this.length,(t,s,a)=>new Cl(this.type,t,s,a,this.propValues),e.makeTree||((t,s,a)=>new Cl(Sd.none,t,s,a)))}static build(e){return FAe(e)}}Cl.empty=new Cl(Sd.none,[],[],0);class _re{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 _re(this.buffer,this.index)}}class _E{constructor(e,t,s){this.buffer=e,this.length=t,this.set=s}get type(){return Sd.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],l=a.name;if(/\W/.test(l)&&!a.isError&&(l=JSON.stringify(l)),e+=4,s==e)return l;let u=[];for(;e<s;)u.push(this.childString(e)),e=this.buffer[e+3];return l+"("+u.join(",")+")"}findChild(e,t,s,a,l){let{buffer:u}=this,d=-1;for(let h=e;h!=t&&!(Vbe(l,a,u[h+1],u[h+2])&&(d=h,s>0));h=u[h+3]);return d}slice(e,t,s){let a=this.buffer,l=new Uint16Array(t-e),u=0;for(let d=e,h=0;d<t;){l[h++]=a[d++],l[h++]=a[d++]-s;let b=l[h++]=a[d++]-s;l[h++]=a[d++]-e,u=Math.max(u,b)}return new _E(l,u,this.set)}}function Vbe(o,e,t,s){switch(o){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 $6(o,e,t,s){for(var a;o.from==o.to||(t<1?o.from>=e:o.from>e)||(t>-1?o.to<=e:o.to<e);){let u=!s&&o instanceof Ig&&o.index<0?null:o.parent;if(!u)return o;o=u}let l=s?0:wc.IgnoreOverlays;if(s)for(let u=o,d=u.parent;d;u=d,d=u.parent)u instanceof Ig&&u.index<0&&((a=d.enter(e,t,l))===null||a===void 0?void 0:a.from)!=u.from&&(o=d);for(;;){let u=o.enter(e,t,l);if(!u)return o;o=u}}class Wbe{cursor(e=0){return new vz(this,e)}getChild(e,t=null,s=null){let a=ode(this,e,t,s);return a.length?a[0]:null}getChildren(e,t=null,s=null){return ode(this,e,t,s)}resolve(e,t=0){return $6(this,e,t,!1)}resolveInner(e,t=0){return $6(this,e,t,!0)}matchContext(e){return yse(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 Ig extends Wbe{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,l=0){for(let u=this;;){for(let{children:d,positions:h}=u._tree,b=t>0?d.length:-1;e!=b;e+=t){let y=d[e],C=h[e]+u.from;if(!!Vbe(a,s,C,C+y.length)){if(y instanceof _E){if(l&wc.ExcludeBuffers)continue;let E=y.findChild(0,y.buffer.length,t,s-C,a);if(E>-1)return new uy(new IAe(u,y,e,C),null,E)}else if(l&wc.IncludeAnonymous||!y.type.isAnonymous||Sre(y)){let E;if(!(l&wc.IgnoreMounts)&&(E=R6.get(y))&&!E.overlay)return new Ig(E.tree,C,e,u);let R=new Ig(y,C,e,u);return l&wc.IncludeAnonymous||!R.type.isAnonymous?R:R.nextChild(t<0?y.children.length-1:0,t,s,a)}}}if(l&wc.IncludeAnonymous||!u.type.isAnonymous||(u.index>=0?e=u.index+t:e=t<0?-1:u._parent._tree.children.length,u=u._parent,!u))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&wc.IgnoreOverlays)&&(a=R6.get(this._tree))&&a.overlay){let l=e-this.from;for(let{from:u,to:d}of a.overlay)if((t>0?u<=l:u<l)&&(t<0?d>=l:d>l))return new Ig(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 ode(o,e,t,s){let a=o.cursor(),l=[];if(!a.firstChild())return l;if(t!=null){for(;!a.type.is(t);)if(!a.nextSibling())return l}for(;;){if(s!=null&&a.type.is(s))return l;if(a.type.is(e)&&l.push(a.node),!a.nextSibling())return s==null?l:[]}}function yse(o,e,t=e.length-1){for(let s=o.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 IAe{constructor(e,t,s,a){this.parent=e,this.buffer=t,this.index=s,this.start=a}}class uy extends Wbe{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,l=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.context.start,s);return l<0?null:new uy(this.context,this,l)}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&wc.ExcludeBuffers)return null;let{buffer:a}=this.context,l=a.findChild(this.index+4,a.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return l<0?null:new uy(this.context,this,l)}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 uy(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 uy(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,l=s.buffer[this.index+3];if(l>a){let u=s.buffer[this.index+1];e.push(s.slice(a,l,u)),t.push(0)}return new Cl(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ube(o){if(!o.length)return null;if(o.length==1)return o[0];let e=0,t=o[0];for(let l=1;l<o.length;l++){let u=o[l];(u.from>t.from||u.to<t.to)&&(t=u,e=l)}let s=t instanceof Ig&&t.index<0?null:t.parent,a=o.slice();return s?a[e]=s:a.splice(e,1),new BAe(a,t)}class BAe{constructor(e,t){this.heads=e,this.node=t}get next(){return Ube(this.heads)}}function LAe(o,e,t){let s=o.resolveInner(e,t),a=null;for(let l=s instanceof Ig?s:s.context.parent;l;l=l.parent)if(l.index<0){let u=l.parent;(a||(a=[s])).push(u.resolve(e,t)),l=u}else{let u=R6.get(l.tree);if(u&&u.overlay&&u.overlay[0].from<=e&&u.overlay[u.overlay.length-1].to>=e){let d=new Ig(u.tree,u.overlay[0].from+l.from,0,null);(a||(a=[s])).push($6(d,e,t,!1))}}return a?Ube(a):s}class vz{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 Ig)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 Ig?(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,l=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.buffer.start,s);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}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&wc.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,s))}parent(){if(!this.buffer)return this.yieldNode(this.mode&wc.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&wc.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 l=0;l<this.index;l++)if(a.buffer.buffer[l+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 l=t+e,u=e<0?-1:s._tree.children.length;l!=u;l+=e){let d=s._tree.children[l];if(this.mode&wc.IncludeAnonymous||d instanceof _E||!d.type.isAnonymous||Sre(d))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,l=this.stack.length;l>=0;){for(let u=e;u;u=u._parent)if(u.index==a){if(a==this.index)return u;t=u,s=l+1;break e}a=this.stack[--l]}}for(let a=s;a<this.stack.length;a++)t=new uy(this.buffer,t,this.stack[a]);return this.bufferNode=new uy(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 yse(this.node,e);let{buffer:t}=this.buffer,{types:s}=t.set;for(let a=e.length-1,l=this.stack.length-1;a>=0;l--){if(l<0)return yse(this.node,e,a);let u=s[t.buffer[this.stack[l]]];if(!u.isAnonymous){if(e[a]&&e[a]!=u.name)return!1;a--}}return!0}}function Sre(o){return o.children.some(e=>e instanceof _E||!e.type.isAnonymous||Sre(e))}function FAe(o){var e;let{buffer:t,nodeSet:s,maxBufferLength:a=zbe,reused:l=[],minRepeatType:u=s.types.length}=o,d=Array.isArray(t)?new _re(t,t.length):t,h=s.types,b=0,y=0;function C(te,ne,oe,G,we){let{id:ve,start:Re,end:Oe,size:ce}=d,Xe=y;for(;ce<0;)if(d.next(),ce==-1){let Qe=l[ve];oe.push(Qe),G.push(Re-te);return}else if(ce==-3){b=ve;return}else if(ce==-4){y=ve;return}else throw new RangeError(`Unrecognized record size: ${ce}`);let tt=h[ve],ot,V,ut=Re-te;if(Oe-Re<=a&&(V=Q(d.pos-ne,we))){let Qe=new Uint16Array(V.size-V.skip),Bt=d.pos-V.size,Ct=Qe.length;for(;d.pos>Bt;)Ct=F(V.start,Qe,Ct);ot=new _E(Qe,Oe-V.start,s),ut=V.start-te}else{let Qe=d.pos-ce;d.next();let Bt=[],Ct=[],He=ve>=u?ve:-1,st=0,rn=Oe;for(;d.pos>Qe;)He>=0&&d.id==He&&d.size>=0?(d.end<=rn-a&&(R(Bt,Ct,Re,st,d.end,rn,He,Xe),st=Bt.length,rn=d.end),d.next()):C(Re,Qe,Bt,Ct,He);if(He>=0&&st>0&&st<Bt.length&&R(Bt,Ct,Re,st,Re,rn,He,Xe),Bt.reverse(),Ct.reverse(),He>-1&&st>0){let Et=E(tt);ot=Cre(tt,Bt,Ct,0,Bt.length,0,Oe-Re,Et,Et)}else ot=$(tt,Bt,Ct,Oe-Re,Xe-Oe)}oe.push(ot),G.push(ut)}function E(te){return(ne,oe,G)=>{let we=0,ve=ne.length-1,Re,Oe;if(ve>=0&&(Re=ne[ve])instanceof Cl){if(!ve&&Re.type==te&&Re.length==G)return Re;(Oe=Re.prop(ui.lookAhead))&&(we=oe[ve]+Re.length+Oe)}return $(te,ne,oe,G,we)}}function R(te,ne,oe,G,we,ve,Re,Oe){let ce=[],Xe=[];for(;te.length>G;)ce.push(te.pop()),Xe.push(ne.pop()+oe-we);te.push($(s.types[Re],ce,Xe,ve-we,Oe-ve)),ne.push(we-oe)}function $(te,ne,oe,G,we=0,ve){if(b){let Re=[ui.contextHash,b];ve=ve?[Re].concat(ve):[Re]}if(we>25){let Re=[ui.lookAhead,we];ve=ve?[Re].concat(ve):[Re]}return new Cl(te,ne,oe,G,ve)}function Q(te,ne){let oe=d.fork(),G=0,we=0,ve=0,Re=oe.end-a,Oe={size:0,start:0,skip:0};e:for(let ce=oe.pos-te;oe.pos>ce;){let Xe=oe.size;if(oe.id==ne&&Xe>=0){Oe.size=G,Oe.start=we,Oe.skip=ve,ve+=4,G+=4,oe.next();continue}let tt=oe.pos-Xe;if(Xe<0||tt<ce||oe.start<Re)break;let ot=oe.id>=u?4:0,V=oe.start;for(oe.next();oe.pos>tt;){if(oe.size<0)if(oe.size==-3)ot+=4;else break e;else oe.id>=u&&(ot+=4);oe.next()}we=V,G+=Xe,ve+=ot}return(ne<0||G==te)&&(Oe.size=G,Oe.start=we,Oe.skip=ve),Oe.size>4?Oe:void 0}function F(te,ne,oe){let{id:G,start:we,end:ve,size:Re}=d;if(d.next(),Re>=0&&G<u){let Oe=oe;if(Re>4){let ce=d.pos-(Re-4);for(;d.pos>ce;)oe=F(te,ne,oe)}ne[--oe]=Oe,ne[--oe]=ve-te,ne[--oe]=we-te,ne[--oe]=G}else Re==-3?b=G:Re==-4&&(y=G);return oe}let U=[],K=[];for(;d.pos>0;)C(o.start||0,o.bufferStart||0,U,K,-1);let L=(e=o.length)!==null&&e!==void 0?e:U.length?K[0]+U[0].length:0;return new Cl(h[o.topID],U.reverse(),K.reverse(),L)}const sde=new WeakMap;function FH(o,e){if(!o.isAnonymous||e instanceof _E||e.type!=o)return 1;let t=sde.get(e);if(t==null){t=1;for(let s of e.children){if(s.type!=o||!(s instanceof Cl)){t=1;break}t+=FH(o,s)}sde.set(e,t)}return t}function Cre(o,e,t,s,a,l,u,d,h){let b=0;for(let $=s;$<a;$++)b+=FH(o,e[$]);let y=Math.ceil(b*1.5/8),C=[],E=[];function R($,Q,F,U,K){for(let L=F;L<U;){let te=L,ne=Q[L],oe=FH(o,$[L]);for(L++;L<U;L++){let G=FH(o,$[L]);if(oe+G>=y)break;oe+=G}if(L==te+1){if(oe>y){let G=$[te];R(G.children,G.positions,0,G.children.length,Q[te]+K);continue}C.push($[te])}else{let G=Q[L-1]+$[L-1].length-ne;C.push(Cre(o,$,Q,te,L,ne,G,null,h))}E.push(ne+K-l)}}return R(e,t,s,a,0),(d||h)(C,E,u)}class Ybe{constructor(){this.map=new WeakMap}setBuffer(e,t,s){let a=this.map.get(e);a||this.map.set(e,a=new Map),a.set(t,s)}getBuffer(e,t){let s=this.map.get(e);return s&&s.get(t)}set(e,t){e instanceof uy?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ig&&this.map.set(e.tree,t)}get(e){return e instanceof uy?this.getBuffer(e.context.buffer,e.index):e instanceof Ig?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Qw{constructor(e,t,s,a,l=!1,u=!1){this.from=e,this.to=t,this.tree=s,this.offset=a,this.open=(l?1:0)|(u?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 Qw(0,e.length,e,0,!1,s)];for(let l of t)l.to>e.length&&a.push(l);return a}static applyChanges(e,t,s=128){if(!t.length)return e;let a=[],l=1,u=e.length?e[0]:null;for(let d=0,h=0,b=0;;d++){let y=d<t.length?t[d]:null,C=y?y.fromA:1e9;if(C-h>=s)for(;u&&u.from<C;){let E=u;if(h>=E.from||C<=E.to||b){let R=Math.max(E.from,h)-b,$=Math.min(E.to,C)-b;E=R>=$?null:new Qw(R,$,E.tree,E.offset+b,d>0,!!y)}if(E&&a.push(E),u.to>C)break;u=l<e.length?e[l++]:null}if(!y)break;h=y.toA,b=y.toA-y.toB}return a}}class kre{startParse(e,t,s){return typeof e=="string"&&(e=new QAe(e)),s=s?s.length?s.map(a=>new Qb(a.from,a.to)):[new Qb(0,0)]:[new Qb(0,e.length)],this.createParse(e,t||[],s)}parse(e,t,s){let a=this.startParse(e,t,s);for(;;){let l=a.advance();if(l)return l}}}class QAe{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)}}function Xbe(o){return(e,t,s,a)=>new HAe(e,o,t,s,a)}class rde{constructor(e,t,s,a,l){if(this.parser=e,this.parse=t,this.overlay=s,this.target=a,this.ranges=l,!l.length||l.some(u=>u.from>=u.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}}class ZAe{constructor(e,t,s,a,l,u,d){this.parser=e,this.predicate=t,this.mounts=s,this.index=a,this.start=l,this.target=u,this.prev=d,this.depth=0,this.ranges=[]}}const wse=new ui({perNode:!0});class HAe{constructor(e,t,s,a,l){this.nest=t,this.input=s,this.fragments=a,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let s=this.baseParse.advance();if(!s)return null;if(this.baseParse=null,this.baseTree=s,this.startInner(),this.stoppedAt!=null)for(let a of this.inner)a.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let s=this.baseTree;return this.stoppedAt!=null&&(s=new Cl(s.type,s.children,s.positions,s.length,s.propValues.concat([[wse,this.stoppedAt]]))),s}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let s=Object.assign(Object.create(null),e.target.props);s[ui.mounted.id]=new R6(t,e.overlay,e.parser),e.target.props=s}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].ranges[0].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new WAe(this.fragments),t=null,s=null,a=new vz(new Ig(this.baseTree,this.ranges[0].from,0,null),wc.IncludeAnonymous|wc.IgnoreMounts);e:for(let l,u;this.stoppedAt==null||a.from<this.stoppedAt;){let d=!0,h;if(e.hasNode(a)){if(t){let b=t.mounts.find(y=>y.frag.from<=a.from&&y.frag.to>=a.to&&y.mount.overlay);if(b)for(let y of b.mount.overlay){let C=y.from+b.pos,E=y.to+b.pos;C>=a.from&&E<=a.to&&!t.ranges.some(R=>R.from<E&&R.to>C)&&t.ranges.push({from:C,to:E})}}d=!1}else if(s&&(u=zAe(s.ranges,a.from,a.to)))d=u!=2;else if(!a.type.isAnonymous&&a.from<a.to&&(l=this.nest(a,this.input))){a.tree||VAe(a);let b=e.findMounts(a.from,l.parser);if(typeof l.overlay=="function")t=new ZAe(l.parser,l.overlay,b,this.inner.length,a.from,a.tree,t);else{let y=lde(this.ranges,l.overlay||[new Qb(a.from,a.to)]);y.length&&this.inner.push(new rde(l.parser,l.parser.startParse(this.input,cde(b,y),y),l.overlay?l.overlay.map(C=>new Qb(C.from-a.from,C.to-a.from)):null,a.tree,y)),l.overlay?y.length&&(s={ranges:y,depth:0,prev:s}):d=!1}}else t&&(h=t.predicate(a))&&(h===!0&&(h=new Qb(a.from,a.to)),h.from<h.to&&t.ranges.push(h));if(d&&a.firstChild())t&&t.depth++,s&&s.depth++;else for(;!a.nextSibling();){if(!a.parent())break e;if(t&&!--t.depth){let b=lde(this.ranges,t.ranges);b.length&&this.inner.splice(t.index,0,new rde(t.parser,t.parser.startParse(this.input,cde(t.mounts,b),b),t.ranges.map(y=>new Qb(y.from-t.start,y.to-t.start)),t.target,b)),t=t.prev}s&&!--s.depth&&(s=s.prev)}}}}function zAe(o,e,t){for(let s of o){if(s.from>=t)break;if(s.to>e)return s.from<=e&&s.to>=t?2:1}return 0}function ide(o,e,t,s,a,l){if(e<t){let u=o.buffer[e+1];s.push(o.slice(e,t,u)),a.push(u-l)}}function VAe(o){let{node:e}=o,t=0;do o.parent(),t++;while(!o.tree);let s=0,a=o.tree,l=0;for(;l=a.positions[s]+o.from,!(l<=e.from&&l+a.children[s].length>=e.to);s++);let u=a.children[s],d=u.buffer;function h(b,y,C,E,R){let $=b;for(;d[$+2]+l<=e.from;)$=d[$+3];let Q=[],F=[];ide(u,b,$,Q,F,E);let U=d[$+1],K=d[$+2],L=U+l==e.from&&K+l==e.to&&d[$]==e.type.id;return Q.push(L?e.toTree():h($+4,d[$+3],u.set.types[d[$]],U,K-U)),F.push(U-E),ide(u,d[$+3],y,Q,F,E),new Cl(C,Q,F,R)}a.children[s]=h(0,d.length,Sd.none,0,u.length);for(let b=0;b<=t;b++)o.childAfter(e.from)}class ade{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(wc.IncludeAnonymous|wc.IgnoreMounts)}moveTo(e){let{cursor:t}=this,s=e-this.offset;for(;!this.done&&t.from<s;)t.to>=e&&t.enter(s,1,wc.IgnoreOverlays|wc.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Cl)t=t.children[0];else break}return!1}}class WAe{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let s=this.curFrag=e[0];this.curTo=(t=s.tree.prop(wse))!==null&&t!==void 0?t:s.to,this.inner=new ade(s.tree,-s.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(wse))!==null&&e!==void 0?e:t.to,this.inner=new ade(t.tree,-t.offset)}}findMounts(e,t){var s;let a=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let u=(s=l.tree)===null||s===void 0?void 0:s.prop(ui.mounted);if(u&&u.parser==t)for(let d=this.fragI;d<this.fragments.length;d++){let h=this.fragments[d];if(h.from>=l.to)break;h.tree==this.curFrag.tree&&a.push({frag:h,pos:l.from-h.offset,mount:u})}}}return a}}function lde(o,e){let t=null,s=e;for(let a=1,l=0;a<o.length;a++){let u=o[a-1].to,d=o[a].from;for(;l<s.length;l++){let h=s[l];if(h.from>=d)break;h.to<=u||(t||(s=t=e.slice()),h.from<u?(t[l]=new Qb(h.from,u),h.to>d&&t.splice(l+1,0,new Qb(d,h.to))):h.to>d?t[l--]=new Qb(d,h.to):t.splice(l--,1))}}return s}function UAe(o,e,t,s){let a=0,l=0,u=!1,d=!1,h=-1e9,b=[];for(;;){let y=a==o.length?1e9:u?o[a].to:o[a].from,C=l==e.length?1e9:d?e[l].to:e[l].from;if(u!=d){let E=Math.max(h,t),R=Math.min(y,C,s);E<R&&b.push(new Qb(E,R))}if(h=Math.min(y,C),h==1e9)break;y==h&&(u?(u=!1,a++):u=!0),C==h&&(d?(d=!1,l++):d=!0)}return b}function cde(o,e){let t=[];for(let{pos:s,mount:a,frag:l}of o){let u=s+(a.overlay?a.overlay[0].from:0),d=u+a.tree.length,h=Math.max(l.from,u),b=Math.min(l.to,d);if(a.overlay){let y=a.overlay.map(E=>new Qb(E.from+s,E.to+s)),C=UAe(e,y,h,b);for(let E=0,R=h;;E++){let $=E==C.length,Q=$?b:C[E].from;if(Q>R&&t.push(new Qw(R,Q,a.tree,-u,l.from>=R||l.openStart,l.to<=Q||l.openEnd)),$)break;R=C[E].to}}else t.push(new Qw(h,b,a.tree,-u,l.from>=u||l.openStart,l.to<=d||l.openEnd))}return t}let YAe=0;class _v{constructor(e,t,s){this.set=e,this.base=t,this.modified=s,this.id=YAe++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new _v([],null,[]);if(t.set.push(t),e)for(let s of e.set)t.set.push(s);return t}static defineModifier(){let e=new Oz;return t=>t.modified.indexOf(e)>-1?t:Oz.get(t.base||t,t.modified.concat(e).sort((s,a)=>s.id-a.id))}}let XAe=0;class Oz{constructor(){this.instances=[],this.id=XAe++}static get(e,t){if(!t.length)return e;let s=t[0].instances.find(d=>d.base==e&&jAe(t,d.modified));if(s)return s;let a=[],l=new _v(a,e,t);for(let d of t)d.instances.push(l);let u=qAe(t);for(let d of e.set)if(!d.modified.length)for(let h of u)a.push(Oz.get(d,h));return l}}function jAe(o,e){return o.length==e.length&&o.every((t,s)=>t==e[s])}function qAe(o){let e=[[]];for(let t=0;t<o.length;t++)for(let s=0,a=e.length;s<a;s++)e.push(e[s].concat(o[t]));return e.sort((t,s)=>s.length-t.length)}function SE(o){let e=Object.create(null);for(let t in o){let s=o[t];Array.isArray(s)||(s=[s]);for(let a of t.split(" "))if(a){let l=[],u=2,d=a;for(let C=0;;){if(d=="..."&&C>0&&C+3==a.length){u=1;break}let E=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(d);if(!E)throw new RangeError("Invalid path: "+a);if(l.push(E[0]=="*"?"":E[0][0]=='"'?JSON.parse(E[0]):E[0]),C+=E[0].length,C==a.length)break;let R=a[C++];if(C==a.length&&R=="!"){u=0;break}if(R!="/")throw new RangeError("Invalid path: "+a);d=a.slice(C)}let h=l.length-1,b=l[h];if(!b)throw new RangeError("Invalid path: "+a);let y=new yz(s,u,h>0?l.slice(0,h):null);e[b]=y.sort(e[b])}}return jbe.add(e)}const jbe=new ui;class yz{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}}yz.empty=new yz([],2,null);function qbe(o,e){let t=Object.create(null);for(let l of o)if(!Array.isArray(l.tag))t[l.tag.id]=l.class;else for(let u of l.tag)t[u.id]=l.class;let{scope:s,all:a=null}=e||{};return{style:l=>{let u=a;for(let d of l)for(let h of d.set){let b=t[h.id];if(b){u=u?u+" "+b:b;break}}return u},scope:s}}function GAe(o,e){let t=null;for(let s of o){let a=s.style(e);a&&(t=t?t+" "+a:a)}return t}function KAe(o,e,t,s=0,a=o.length){let l=new JAe(s,Array.isArray(e)?e:[e],t);l.highlightRange(o.cursor(),s,a,"",l.highlighters),l.flush(a)}class JAe{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,l){let{type:u,from:d,to:h}=e;if(d>=s||h<=t)return;u.isTop&&(l=this.highlighters.filter(R=>!R.scope||R.scope(u)));let b=a,y=e4e(e)||yz.empty,C=GAe(l,y.tags);if(C&&(b&&(b+=" "),b+=C,y.mode==1&&(a+=(a?" ":"")+C)),this.startSpan(Math.max(t,d),b),y.opaque)return;let E=e.tree&&e.tree.prop(ui.mounted);if(E&&E.overlay){let R=e.node.enter(E.overlay[0].from+d,1),$=this.highlighters.filter(F=>!F.scope||F.scope(E.tree.type)),Q=e.firstChild();for(let F=0,U=d;;F++){let K=F<E.overlay.length?E.overlay[F]:null,L=K?K.from+d:h,te=Math.max(t,U),ne=Math.min(s,L);if(te<ne&&Q)for(;e.from<ne&&(this.highlightRange(e,te,ne,a,l),this.startSpan(Math.min(ne,e.to),b),!(e.to>=L||!e.nextSibling())););if(!K||L>s)break;U=K.to+d,U>t&&(this.highlightRange(R.cursor(),Math.max(t,K.from+d),Math.min(s,U),"",$),this.startSpan(Math.min(s,U),b))}Q&&e.parent()}else if(e.firstChild()){E&&(a="");do if(!(e.to<=t)){if(e.from>=s)break;this.highlightRange(e,t,s,a,l),this.startSpan(Math.min(s,e.to),b)}while(e.nextSibling());e.parent()}}}function e4e(o){let e=o.type.prop(jbe);for(;e&&e.context&&!o.matchContext(e.context);)e=e.next;return e||null}const qo=_v.define,JZ=qo(),vC=qo(),ude=qo(vC),fde=qo(vC),OC=qo(),eH=qo(OC),Qne=qo(OC),ry=qo(),KT=qo(ry),oy=qo(),sy=qo(),_se=qo(),ZN=qo(_se),tH=qo(),yt={comment:JZ,lineComment:qo(JZ),blockComment:qo(JZ),docComment:qo(JZ),name:vC,variableName:qo(vC),typeName:ude,tagName:qo(ude),propertyName:fde,attributeName:qo(fde),className:qo(vC),labelName:qo(vC),namespace:qo(vC),macroName:qo(vC),literal:OC,string:eH,docString:qo(eH),character:qo(eH),attributeValue:qo(eH),number:Qne,integer:qo(Qne),float:qo(Qne),bool:qo(OC),regexp:qo(OC),escape:qo(OC),color:qo(OC),url:qo(OC),keyword:oy,self:qo(oy),null:qo(oy),atom:qo(oy),unit:qo(oy),modifier:qo(oy),operatorKeyword:qo(oy),controlKeyword:qo(oy),definitionKeyword:qo(oy),moduleKeyword:qo(oy),operator:sy,derefOperator:qo(sy),arithmeticOperator:qo(sy),logicOperator:qo(sy),bitwiseOperator:qo(sy),compareOperator:qo(sy),updateOperator:qo(sy),definitionOperator:qo(sy),typeOperator:qo(sy),controlOperator:qo(sy),punctuation:_se,separator:qo(_se),bracket:ZN,angleBracket:qo(ZN),squareBracket:qo(ZN),paren:qo(ZN),brace:qo(ZN),content:ry,heading:KT,heading1:qo(KT),heading2:qo(KT),heading3:qo(KT),heading4:qo(KT),heading5:qo(KT),heading6:qo(KT),contentSeparator:qo(ry),list:qo(ry),quote:qo(ry),emphasis:qo(ry),strong:qo(ry),link:qo(ry),monospace:qo(ry),strikethrough:qo(ry),inserted:qo(),deleted:qo(),changed:qo(),invalid:qo(),meta:tH,documentMeta:qo(tH),annotation:qo(tH),processingInstruction:qo(tH),definition:_v.defineModifier(),constant:_v.defineModifier(),function:_v.defineModifier(),standard:_v.defineModifier(),local:_v.defineModifier(),special:_v.defineModifier()};qbe([{tag:yt.link,class:"tok-link"},{tag:yt.heading,class:"tok-heading"},{tag:yt.emphasis,class:"tok-emphasis"},{tag:yt.strong,class:"tok-strong"},{tag:yt.keyword,class:"tok-keyword"},{tag:yt.atom,class:"tok-atom"},{tag:yt.bool,class:"tok-bool"},{tag:yt.url,class:"tok-url"},{tag:yt.labelName,class:"tok-labelName"},{tag:yt.inserted,class:"tok-inserted"},{tag:yt.deleted,class:"tok-deleted"},{tag:yt.literal,class:"tok-literal"},{tag:yt.string,class:"tok-string"},{tag:yt.number,class:"tok-number"},{tag:[yt.regexp,yt.escape,yt.special(yt.string)],class:"tok-string2"},{tag:yt.variableName,class:"tok-variableName"},{tag:yt.local(yt.variableName),class:"tok-variableName tok-local"},{tag:yt.definition(yt.variableName),class:"tok-variableName tok-definition"},{tag:yt.special(yt.variableName),class:"tok-variableName2"},{tag:yt.definition(yt.propertyName),class:"tok-propertyName tok-definition"},{tag:yt.typeName,class:"tok-typeName"},{tag:yt.namespace,class:"tok-namespace"},{tag:yt.className,class:"tok-className"},{tag:yt.macroName,class:"tok-macroName"},{tag:yt.propertyName,class:"tok-propertyName"},{tag:yt.operator,class:"tok-operator"},{tag:yt.comment,class:"tok-comment"},{tag:yt.meta,class:"tok-meta"},{tag:yt.invalid,class:"tok-invalid"},{tag:yt.punctuation,class:"tok-punctuation"}]);var Zne;const iE=new ui;function xre(o){return As.define({combine:o?e=>e.concat(o):void 0})}const Tre=new ui;class Zb{constructor(e,t,s=[],a=""){this.data=e,this.name=a,ra.prototype.hasOwnProperty("tree")||Object.defineProperty(ra.prototype,"tree",{get(){return _c(this)}}),this.parser=t,this.extension=[NC.of(this),ra.languageData.of((l,u,d)=>{let h=dde(l,u,d),b=h.type.prop(iE);if(!b)return[];let y=l.facet(b),C=h.type.prop(Tre);if(C){let E=h.resolve(u-h.from,d);for(let R of C)if(R.test(E,l)){let $=l.facet(R.facet);return R.type=="replace"?$:$.concat(y)}}return y})].concat(s)}isActiveAt(e,t,s=-1){return dde(e,t,s).type.prop(iE)==this.data}findRegions(e){let t=e.facet(NC);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let s=[],a=(l,u)=>{if(l.prop(iE)==this.data){s.push({from:u,to:u+l.length});return}let d=l.prop(ui.mounted);if(d){if(d.tree.prop(iE)==this.data){if(d.overlay)for(let h of d.overlay)s.push({from:h.from+u,to:h.to+u});else s.push({from:u,to:u+l.length});return}else if(d.overlay){let h=s.length;if(a(d.tree,d.overlay[0].from+u),s.length>h)return}}for(let h=0;h<l.children.length;h++){let b=l.children[h];b instanceof Cl&&a(b,l.positions[h]+u)}};return a(_c(e),0),s}get allowsNesting(){return!0}}Zb.setState=bi.define();function dde(o,e,t){let s=o.facet(NC),a=_c(o).topNode;if(!s||s.allowsNesting)for(let l=a;l;l=l.enter(e,t,wc.ExcludeBuffers))l.type.isTop&&(a=l);return a}class pE extends Zb{constructor(e,t,s){super(e,t,[],s),this.parser=t}static define(e){let t=xre(e.languageData);return new pE(t,e.parser.configure({props:[iE.add(s=>s.isTop?t:void 0)]}),e.name)}configure(e,t){return new pE(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _c(o){let e=o.field(Zb.state,!1);return e?e.tree:Cl.empty}class t4e{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 HN=null;class N6{constructor(e,t,s=[],a,l,u,d,h){this.parser=e,this.state=t,this.fragments=s,this.tree=a,this.treeLen=l,this.viewport=u,this.skipped=d,this.scheduleOn=h,this.parse=null,this.tempSkipped=[]}static create(e,t,s){return new N6(e,t,[],Cl.empty,0,s,[],null)}startParse(){return this.parser.startParse(new t4e(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Cl.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(Qw.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(Qw.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=HN;HN=this;try{return e()}finally{HN=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=hde(e,t.from,t.to);return e}changes(e,t){let{fragments:s,tree:a,treeLen:l,viewport:u,skipped:d}=this;if(this.takeTree(),!e.empty){let h=[];if(e.iterChangedRanges((b,y,C,E)=>h.push({fromA:b,toA:y,fromB:C,toB:E})),s=Qw.applyChanges(s,h),a=Cl.empty,l=0,u={from:e.mapPos(u.from,-1),to:e.mapPos(u.to,1)},this.skipped.length){d=[];for(let b of this.skipped){let y=e.mapPos(b.from,1),C=e.mapPos(b.to,-1);y<C&&d.push({from:y,to:C})}}}return new N6(this.parser,t,s,a,l,u,d,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:l}=this.skipped[s];a<e.to&&l>e.from&&(this.fragments=hde(this.fragments,a,l),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 kre{createParse(t,s,a){let l=a[0].from,u=a[a.length-1].to;return{parsedPos:l,advance(){let h=HN;if(h){for(let b of a)h.tempSkipped.push(b);e&&(h.scheduleOn=h.scheduleOn?Promise.all([h.scheduleOn,e]):e)}return this.parsedPos=u,new Cl(Sd.none,[],[],u-l)},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 HN}}function hde(o,e,t){return Qw.applyChanges(o,[{fromA:e,toA:t,fromB:e,toB:t}])}class RD{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 RD(t)}static init(e){let t=Math.min(3e3,e.doc.length),s=N6.create(e.facet(NC).parser,e,{from:0,to:t});return s.work(20,t)||s.takeTree(),new RD(s)}}Zb.state=Uf.define({create:RD.init,update(o,e){for(let t of e.effects)if(t.is(Zb.setState))return t.value;return e.startState.facet(NC)!=e.state.facet(NC)?RD.init(e.state):o.apply(e)}});let Gbe=o=>{let e=setTimeout(()=>o(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Gbe=o=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(o,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Hne=typeof navigator<"u"&&((Zne=navigator.scheduling)===null||Zne===void 0?void 0:Zne.isInputPending)?()=>navigator.scheduling.isInputPending():null,n4e=kf.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(Zb.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(Zb.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Gbe(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,l=s.field(Zb.state);if(l.tree==l.context.tree&&l.context.isDone(a+1e5))return;let u=Date.now()+Math.min(this.chunkBudget,100,e&&!Hne?Math.max(25,e.timeRemaining()-5):1e9),d=l.context.treeLen<a&&s.doc.length>a+1e3,h=l.context.work(()=>Hne&&Hne()||Date.now()>u,a+(d?0:1e5));this.chunkBudget-=Date.now()-t,(h||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:Zb.setState.of(new RD(l.context))})),this.chunkBudget>0&&!(h&&!d)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>zb(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()}}}),NC=As.define({combine(o){return o.length?o[0]:null},enables:o=>[Zb.state,n4e,is.contentAttributes.compute([o],e=>{let t=e.facet(o);return t&&t.name?{"data-language":t.name}:{}})]});class $D{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class wz{constructor(e,t,s,a,l,u=void 0){this.name=e,this.alias=t,this.extensions=s,this.filename=a,this.loadFunc=l,this.support=u,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:s}=e;if(!t){if(!s)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(s)}return new wz(e.name,(e.alias||[]).concat(e.name).map(a=>a.toLowerCase()),e.extensions||[],e.filename,t,s)}static matchFilename(e,t){for(let a of e)if(a.filename&&a.filename.test(t))return a;let s=/\.([^.]+)$/.exec(t);if(s){for(let a of e)if(a.extensions.indexOf(s[1])>-1)return a}return null}static matchLanguageName(e,t,s=!0){t=t.toLowerCase();for(let a of e)if(a.alias.some(l=>l==t))return a;if(s)for(let a of e)for(let l of a.alias){let u=t.indexOf(l);if(u>-1&&(l.length>2||!/\w/.test(t[u-1])&&!/\w/.test(t[u+l.length])))return a}return null}}const o4e=As.define(),lI=As.define({combine:o=>{if(!o.length)return" ";let e=o[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(o[0]));return e}});function _z(o){let e=o.facet(lI);return e.charCodeAt(0)==9?o.tabSize*e.length:e.length}function I6(o,e){let t="",s=o.tabSize,a=o.facet(lI)[0];if(a==" "){for(;e>=s;)t+=" ",e-=s;a=" "}for(let l=0;l<e;l++)t+=a;return t}function Ere(o,e){o instanceof ra&&(o=new rV(o));for(let s of o.state.facet(o4e)){let a=s(o,e);if(a!==void 0)return a}let t=_c(o.state);return t.length>=e?s4e(o,t,e):null}class rV{constructor(e,t={}){this.state=e,this.options=t,this.unit=_z(e)}lineAt(e,t=1){let s=this.state.doc.lineAt(e),{simulateBreak:a,simulateDoubleBreak:l}=this.options;return a!=null&&a>=s.from&&a<=s.to?l&&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),l=this.countColumn(s,e-a),u=this.options.overrideIndentation?this.options.overrideIndentation(a):-1;return u>-1&&(l+=u-this.countColumn(s,s.search(/\S|$/))),l}countColumn(e,t=e.length){return Cv(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:s,from:a}=this.lineAt(e,t),l=this.options.overrideIndentation;if(l){let u=l(a);if(u>-1)return u}return this.countColumn(s,s.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const GD=new ui;function s4e(o,e,t){let s=e.resolveStack(t),a=s.node.enterUnfinishedNodesBefore(t);if(a!=s.node){let l=[];for(let u=a;u!=s.node;u=u.parent)l.push(u);for(let u=l.length-1;u>=0;u--)s={node:l[u],next:s}}return Kbe(s,o,t)}function Kbe(o,e,t){for(let s=o;s;s=s.next){let a=i4e(s.node);if(a)return a(Are.create(e,t,s))}return 0}function r4e(o){return o.pos==o.options.simulateBreak&&o.options.simulateDoubleBreak}function i4e(o){let e=o.type.prop(GD);if(e)return e;let t=o.firstChild,s;if(t&&(s=t.type.prop(ui.closedBy))){let a=o.lastChild,l=a&&s.indexOf(a.name)>-1;return u=>Jbe(u,!0,1,void 0,l&&!r4e(u)?a.from:void 0)}return o.parent==null?a4e:null}function a4e(){return 0}class Are extends rV{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 Are(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(l4e(s,e))break;t=this.state.doc.lineAt(s.from)}return this.lineIndent(t.from)}continue(){return Kbe(this.context.next,this.base,this.pos)}}function l4e(o,e){for(let t=e;t;t=t.parent)if(o==t)return!0;return!1}function c4e(o){let e=o.node,t=e.childAfter(e.from),s=e.lastChild;if(!t)return null;let a=o.options.simulateBreak,l=o.state.doc.lineAt(t.from),u=a==null||a<=l.from?l.to:Math.min(l.to,a);for(let d=t.to;;){let h=e.childAfter(d);if(!h||h==s)return null;if(!h.type.isSkipped)return h.from<u?t:null;d=h.to}}function u4e({closing:o,align:e=!0,units:t=1}){return s=>Jbe(s,e,t,o)}function Jbe(o,e,t,s,a){let l=o.textAfter,u=l.match(/^\s*/)[0].length,d=s&&l.slice(u,u+s.length)==s||a==o.pos+u,h=e?c4e(o):null;return h?d?o.column(h.from):o.column(h.to):o.baseIndent+(d?0:o.unit*t)}const f4e=o=>o.baseIndent;function SD({except:o,units:e=1}={}){return t=>{let s=o&&o.test(t.textAfter);return t.baseIndent+(s?0:e*t.unit)}}const d4e=200;function h4e(){return ra.transactionFilter.of(o=>{if(!o.docChanged||!o.isUserEvent("input.type")&&!o.isUserEvent("input.complete"))return o;let e=o.startState.languageDataAt("indentOnInput",o.startState.selection.main.head);if(!e.length)return o;let t=o.newDoc,{head:s}=o.newSelection.main,a=t.lineAt(s);if(s>a.from+d4e)return o;let l=t.sliceString(a.from,s);if(!e.some(b=>b.test(l)))return o;let{state:u}=o,d=-1,h=[];for(let{head:b}of u.selection.ranges){let y=u.doc.lineAt(b);if(y.from==d)continue;d=y.from;let C=Ere(u,y.from);if(C==null)continue;let E=/^\s*/.exec(y.text)[0],R=I6(u,C);E!=R&&h.push({from:y.from,to:y.from+E.length,insert:R})}return h.length?[o,{changes:h,sequential:!0}]:o})}const e0e=As.define(),KD=new ui;function Dre(o){let e=o.firstChild,t=o.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?o.to:t.from}:null}function m4e(o,e,t){let s=_c(o);if(s.length<t)return null;let a=s.resolveStack(t,1),l=null;for(let u=a;u;u=u.next){let d=u.node;if(d.to<=t||d.from>t)continue;if(l&&d.from<e)break;let h=d.type.prop(KD);if(h&&(d.to<s.length-50||s.length==o.doc.length||!g4e(d))){let b=h(d,o);b&&b.from<=t&&b.from>=e&&b.to>t&&(l=b)}}return l}function g4e(o){let e=o.lastChild;return e&&e.to==o.to&&e.type.isError}function Sz(o,e,t){for(let s of o.facet(e0e)){let a=s(o,e,t);if(a)return a}return m4e(o,e,t)}function t0e(o,e){let t=e.mapPos(o.from,1),s=e.mapPos(o.to,-1);return t>=s?void 0:{from:t,to:s}}const iV=bi.define({map:t0e}),cI=bi.define({map:t0e});function n0e(o){let e=[];for(let{head:t}of o.state.selection.ranges)e.some(s=>s.from<=t&&s.to>=t)||e.push(o.lineBlockAt(t));return e}const bE=Uf.define({create(){return Br.none},update(o,e){o=o.map(e.changes);for(let t of e.effects)if(t.is(iV)&&!p4e(o,t.value.from,t.value.to)){let{preparePlaceholder:s}=e.state.facet(Pre),a=s?Br.replace({widget:new S4e(s(e.state,t.value))}):mde;o=o.update({add:[a.range(t.value.from,t.value.to)]})}else t.is(cI)&&(o=o.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;o.between(s,s,(a,l)=>{a<s&&l>s&&(t=!0)}),t&&(o=o.update({filterFrom:s,filterTo:s,filter:(a,l)=>l<=s||a>=s}))}return o},provide:o=>is.decorations.from(o),toJSON(o,e){let t=[];return o.between(0,e.doc.length,(s,a)=>{t.push(s,a)}),t},fromJSON(o){if(!Array.isArray(o)||o.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<o.length;){let s=o[t++],a=o[t++];if(typeof s!="number"||typeof a!="number")throw new RangeError("Invalid JSON for fold state");e.push(mde.range(s,a))}return Br.set(e,!0)}});function Cz(o,e,t){var s;let a=null;return(s=o.field(bE,!1))===null||s===void 0||s.between(e,t,(l,u)=>{(!a||a.from>l)&&(a={from:l,to:u})}),a}function p4e(o,e,t){let s=!1;return o.between(e,e,(a,l)=>{a==e&&l==t&&(s=!0)}),s}function o0e(o,e){return o.field(bE,!1)?e:e.concat(bi.appendConfig.of(r0e()))}const b4e=o=>{for(let e of n0e(o)){let t=Sz(o.state,e.from,e.to);if(t)return o.dispatch({effects:o0e(o.state,[iV.of(t),s0e(o,t)])}),!0}return!1},v4e=o=>{if(!o.state.field(bE,!1))return!1;let e=[];for(let t of n0e(o)){let s=Cz(o.state,t.from,t.to);s&&e.push(cI.of(s),s0e(o,s,!1))}return e.length&&o.dispatch({effects:e}),e.length>0};function s0e(o,e,t=!0){let s=o.state.doc.lineAt(e.from).number,a=o.state.doc.lineAt(e.to).number;return is.announce.of(`${o.state.phrase(t?"Folded lines":"Unfolded lines")} ${s} ${o.state.phrase("to")} ${a}.`)}const O4e=o=>{let{state:e}=o,t=[];for(let s=0;s<e.doc.length;){let a=o.lineBlockAt(s),l=Sz(e,a.from,a.to);l&&t.push(iV.of(l)),s=(l?o.lineBlockAt(l.to):a).to+1}return t.length&&o.dispatch({effects:o0e(o.state,t)}),!!t.length},y4e=o=>{let e=o.state.field(bE,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,o.state.doc.length,(s,a)=>{t.push(cI.of({from:s,to:a}))}),o.dispatch({effects:t}),!0},w4e=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:b4e},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:v4e},{key:"Ctrl-Alt-[",run:O4e},{key:"Ctrl-Alt-]",run:y4e}],_4e={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Pre=As.define({combine(o){return Tv(o,_4e)}});function r0e(o){let e=[bE,x4e];return o&&e.push(Pre.of(o)),e}function i0e(o,e){let{state:t}=o,s=t.facet(Pre),a=u=>{let d=o.lineBlockAt(o.posAtDOM(u.target)),h=Cz(o.state,d.from,d.to);h&&o.dispatch({effects:cI.of(h)}),u.preventDefault()};if(s.placeholderDOM)return s.placeholderDOM(o,a,e);let l=document.createElement("span");return l.textContent=s.placeholderText,l.setAttribute("aria-label",t.phrase("folded code")),l.title=t.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=a,l}const mde=Br.replace({widget:new class extends Gw{toDOM(o){return i0e(o,null)}}});class S4e extends Gw{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return i0e(e,this.value)}}const C4e={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zne extends wy{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 k4e(o={}){let e=Object.assign(Object.assign({},C4e),o),t=new zne(e,!0),s=new zne(e,!1),a=kf.fromClass(class{constructor(u){this.from=u.viewport.from,this.markers=this.buildMarkers(u)}update(u){(u.docChanged||u.viewportChanged||u.startState.facet(NC)!=u.state.facet(NC)||u.startState.field(bE,!1)!=u.state.field(bE,!1)||_c(u.startState)!=_c(u.state)||e.foldingChanged(u))&&(this.markers=this.buildMarkers(u.view))}buildMarkers(u){let d=new PC;for(let h of u.viewportLineBlocks){let b=Cz(u.state,h.from,h.to)?s:Sz(u.state,h.from,h.to)?t:null;b&&d.add(h.from,h.from,b)}return d.finish()}}),{domEventHandlers:l}=e;return[a,Qbe({class:"cm-foldGutter",markers(u){var d;return((d=u.plugin(a))===null||d===void 0?void 0:d.markers)||tl.empty},initialSpacer(){return new zne(e,!1)},domEventHandlers:Object.assign(Object.assign({},l),{click:(u,d,h)=>{if(l.click&&l.click(u,d,h))return!0;let b=Cz(u.state,d.from,d.to);if(b)return u.dispatch({effects:cI.of(b)}),!0;let y=Sz(u.state,d.from,d.to);return y?(u.dispatch({effects:iV.of(y)}),!0):!1}})}),r0e()]}const x4e=is.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 aV{constructor(e,t){this.specs=e;let s;function a(d){let h=MC.newName();return(s||(s=Object.create(null)))["."+h]=d,h}const l=typeof t.all=="string"?t.all:t.all?a(t.all):void 0,u=t.scope;this.scope=u instanceof Zb?d=>d.prop(iE)==u.data:u?d=>d==u:void 0,this.style=qbe(e.map(d=>({tag:d.tag,class:d.class||a(Object.assign({},d,{tag:null}))})),{all:l}).style,this.module=s?new MC(s):null,this.themeType=t.themeType}static define(e,t){return new aV(e,t||{})}}const Sse=As.define(),a0e=As.define({combine(o){return o.length?[o[0]]:null}});function Vne(o){let e=o.facet(Sse);return e.length?e:o.facet(a0e)}function T4e(o,e){let t=[A4e],s;return o instanceof aV&&(o.module&&t.push(is.styleModule.of(o.module)),s=o.themeType),e!=null&&e.fallback?t.push(a0e.of(o)):s?t.push(Sse.computeN([is.darkTheme],a=>a.facet(is.darkTheme)==(s=="dark")?[o]:[])):t.push(Sse.of(o)),t}class E4e{constructor(e){this.markCache=Object.create(null),this.tree=_c(e.state),this.decorations=this.buildDeco(e,Vne(e.state))}update(e){let t=_c(e.state),s=Vne(e.state),a=s!=Vne(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 Br.none;let s=new PC;for(let{from:a,to:l}of e.visibleRanges)KAe(this.tree,t,(u,d,h)=>{s.add(u,d,this.markCache[h]||(this.markCache[h]=Br.mark({class:h})))},a,l);return s.finish()}}const A4e=QC.high(kf.fromClass(E4e,{decorations:o=>o.decorations})),D4e=aV.define([{tag:yt.meta,color:"#404740"},{tag:yt.link,textDecoration:"underline"},{tag:yt.heading,textDecoration:"underline",fontWeight:"bold"},{tag:yt.emphasis,fontStyle:"italic"},{tag:yt.strong,fontWeight:"bold"},{tag:yt.strikethrough,textDecoration:"line-through"},{tag:yt.keyword,color:"#708"},{tag:[yt.atom,yt.bool,yt.url,yt.contentSeparator,yt.labelName],color:"#219"},{tag:[yt.literal,yt.inserted],color:"#164"},{tag:[yt.string,yt.deleted],color:"#a11"},{tag:[yt.regexp,yt.escape,yt.special(yt.string)],color:"#e40"},{tag:yt.definition(yt.variableName),color:"#00f"},{tag:yt.local(yt.variableName),color:"#30a"},{tag:[yt.typeName,yt.namespace],color:"#085"},{tag:yt.className,color:"#167"},{tag:[yt.special(yt.variableName),yt.macroName],color:"#256"},{tag:yt.definition(yt.propertyName),color:"#00c"},{tag:yt.comment,color:"#940"},{tag:yt.invalid,color:"#f00"}]),P4e=is.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),l0e=1e4,c0e="()[]{}",u0e=As.define({combine(o){return Tv(o,{afterCursor:!0,brackets:c0e,maxScanDistance:l0e,renderMatch:$4e})}}),M4e=Br.mark({class:"cm-matchingBracket"}),R4e=Br.mark({class:"cm-nonmatchingBracket"});function $4e(o){let e=[],t=o.matched?M4e:R4e;return e.push(t.range(o.start.from,o.start.to)),o.end&&e.push(t.range(o.end.from,o.end.to)),e}const N4e=Uf.define({create(){return Br.none},update(o,e){if(!e.docChanged&&!e.selection)return o;let t=[],s=e.state.facet(u0e);for(let a of e.state.selection.ranges){if(!a.empty)continue;let l=fy(e.state,a.head,-1,s)||a.head>0&&fy(e.state,a.head-1,1,s)||s.afterCursor&&(fy(e.state,a.head,1,s)||a.head<e.state.doc.length&&fy(e.state,a.head+1,-1,s));l&&(t=t.concat(s.renderMatch(l,e.state)))}return Br.set(t,!0)},provide:o=>is.decorations.from(o)}),I4e=[N4e,P4e];function B4e(o={}){return[u0e.of(o),I4e]}const f0e=new ui;function Cse(o,e,t){let s=o.prop(e<0?ui.openedBy:ui.closedBy);if(s)return s;if(o.name.length==1){let a=t.indexOf(o.name);if(a>-1&&a%2==(e<0?1:0))return[t[a+e]]}return null}function kse(o){let e=o.type.prop(f0e);return e?e(o.node):o}function fy(o,e,t,s={}){let a=s.maxScanDistance||l0e,l=s.brackets||c0e,u=_c(o),d=u.resolveInner(e,t);for(let h=d;h;h=h.parent){let b=Cse(h.type,t,l);if(b&&h.from<h.to){let y=kse(h);if(y&&(t>0?e>=y.from&&e<y.to:e>y.from&&e<=y.to))return L4e(o,e,t,h,y,b,l)}}return F4e(o,e,t,u,d.type,a,l)}function L4e(o,e,t,s,a,l,u){let d=s.parent,h={from:a.from,to:a.to},b=0,y=d==null?void 0:d.cursor();if(y&&(t<0?y.childBefore(s.from):y.childAfter(s.to)))do if(t<0?y.to<=s.from:y.from>=s.to){if(b==0&&l.indexOf(y.type.name)>-1&&y.from<y.to){let C=kse(y);return{start:h,end:C?{from:C.from,to:C.to}:void 0,matched:!0}}else if(Cse(y.type,t,u))b++;else if(Cse(y.type,-t,u)){if(b==0){let C=kse(y);return{start:h,end:C&&C.from<C.to?{from:C.from,to:C.to}:void 0,matched:!1}}b--}}while(t<0?y.prevSibling():y.nextSibling());return{start:h,matched:!1}}function F4e(o,e,t,s,a,l,u){let d=t<0?o.sliceDoc(e-1,e):o.sliceDoc(e,e+1),h=u.indexOf(d);if(h<0||h%2==0!=t>0)return null;let b={from:t<0?e-1:e,to:t>0?e+1:e},y=o.doc.iterRange(e,t>0?o.doc.length:0),C=0;for(let E=0;!y.next().done&&E<=l;){let R=y.value;t<0&&(E+=R.length);let $=e+E*t;for(let Q=t>0?0:R.length-1,F=t>0?R.length:-1;Q!=F;Q+=t){let U=u.indexOf(R[Q]);if(!(U<0||s.resolveInner($+Q,1).type!=a))if(U%2==0==t>0)C++;else{if(C==1)return{start:b,end:{from:$+Q,to:$+Q+1},matched:U>>1==h>>1};C--}}t>0&&(E+=R.length)}return y.done?{start:b,matched:!1}:null}const Q4e=Object.create(null),gde=[Sd.none],pde=[],Z4e=Object.create(null);for(let[o,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"]])Z4e[o]=H4e(Q4e,e);function Wne(o,e){pde.indexOf(o)>-1||(pde.push(o),console.warn(e))}function H4e(o,e){let t=null;for(let l of e.split(".")){let u=o[l]||yt[l];u?typeof u=="function"?t?t=u(t):Wne(l,`Modifier ${l} used at start of tag`):t?Wne(l,`Tag ${l} used as modifier`):t=u:Wne(l,`Unknown highlighting tag ${l}`)}if(!t)return 0;let s=e.replace(/ /g,"_"),a=Sd.define({id:gde.length,name:s,props:[SE({[s]:t})]});return gde.push(a),a.id}const z4e=o=>{let{state:e}=o,t=e.doc.lineAt(e.selection.main.from),s=Rre(o.state,t.from);return s.line?V4e(o):s.block?U4e(o):!1};function Mre(o,e){return({state:t,dispatch:s})=>{if(t.readOnly)return!1;let a=o(e,t);return a?(s(t.update(a)),!0):!1}}const V4e=Mre(j4e,0),W4e=Mre(d0e,0),U4e=Mre((o,e)=>d0e(o,e,X4e(e)),0);function Rre(o,e){let t=o.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const zN=50;function Y4e(o,{open:e,close:t},s,a){let l=o.sliceDoc(s-zN,s),u=o.sliceDoc(a,a+zN),d=/\s*$/.exec(l)[0].length,h=/^\s*/.exec(u)[0].length,b=l.length-d;if(l.slice(b-e.length,b)==e&&u.slice(h,h+t.length)==t)return{open:{pos:s-d,margin:d&&1},close:{pos:a+h,margin:h&&1}};let y,C;a-s<=2*zN?y=C=o.sliceDoc(s,a):(y=o.sliceDoc(s,s+zN),C=o.sliceDoc(a-zN,a));let E=/^\s*/.exec(y)[0].length,R=/\s*$/.exec(C)[0].length,$=C.length-R-t.length;return y.slice(E,E+e.length)==e&&C.slice($,$+t.length)==t?{open:{pos:s+E+e.length,margin:/\s/.test(y.charAt(E+e.length))?1:0},close:{pos:a-R-t.length,margin:/\s/.test(C.charAt($-1))?1:0}}:null}function X4e(o){let e=[];for(let t of o.selection.ranges){let s=o.doc.lineAt(t.from),a=t.to<=s.to?s:o.doc.lineAt(t.to),l=e.length-1;l>=0&&e[l].to>s.from?e[l].to=a.to:e.push({from:s.from+/^\s*/.exec(s.text)[0].length,to:a.to})}return e}function d0e(o,e,t=e.selection.ranges){let s=t.map(l=>Rre(e,l.from).block);if(!s.every(l=>l))return null;let a=t.map((l,u)=>Y4e(e,s[u],l.from,l.to));if(o!=2&&!a.every(l=>l))return{changes:e.changes(t.map((l,u)=>a[u]?[]:[{from:l.from,insert:s[u].open+" "},{from:l.to,insert:" "+s[u].close}]))};if(o!=1&&a.some(l=>l)){let l=[];for(let u=0,d;u<a.length;u++)if(d=a[u]){let h=s[u],{open:b,close:y}=d;l.push({from:b.pos-h.open.length,to:b.pos+b.margin},{from:y.pos-y.margin,to:y.pos+h.close.length})}return{changes:l}}return null}function j4e(o,e,t=e.selection.ranges){let s=[],a=-1;for(let{from:l,to:u}of t){let d=s.length,h=1e9,b=Rre(e,l).line;if(!!b){for(let y=l;y<=u;){let C=e.doc.lineAt(y);if(C.from>a&&(l==u||u>C.from)){a=C.from;let E=/^\s*/.exec(C.text)[0].length,R=E==C.length,$=C.text.slice(E,E+b.length)==b?E:-1;E<C.text.length&&E<h&&(h=E),s.push({line:C,comment:$,token:b,indent:E,empty:R,single:!1})}y=C.to+1}if(h<1e9)for(let y=d;y<s.length;y++)s[y].indent<s[y].line.text.length&&(s[y].indent=h);s.length==d+1&&(s[d].single=!0)}}if(o!=2&&s.some(l=>l.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:d,token:h,indent:b,empty:y,single:C}of s)(C||!y)&&l.push({from:d.from+b,insert:h+" "});let u=e.changes(l);return{changes:u,selection:e.selection.map(u,1)}}else if(o!=1&&s.some(l=>l.comment>=0)){let l=[];for(let{line:u,comment:d,token:h}of s)if(d>=0){let b=u.from+d,y=b+h.length;u.text[y-u.from]==" "&&y++,l.push({from:b,to:y})}return{changes:l}}return null}const xse=qw.define(),q4e=qw.define(),G4e=As.define(),h0e=As.define({combine(o){return Tv(o,{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 K4e(o){let e=0;return o.iterChangedRanges((t,s)=>e=s),e}const m0e=Uf.define({create(){return dy.empty},update(o,e){let t=e.state.facet(h0e),s=e.annotation(xse);if(s){let h=e.docChanged?Ln.single(K4e(e.changes)):void 0,b=Fp.fromTransaction(e,h),y=s.side,C=y==0?o.undone:o.done;return b?C=kz(C,C.length,t.minDepth,b):C=b0e(C,e.startState.selection),new dy(y==0?s.rest:C,y==0?C:s.rest)}let a=e.annotation(q4e);if((a=="full"||a=="before")&&(o=o.isolate()),e.annotation(_d.addToHistory)===!1)return e.changes.empty?o:o.addMapping(e.changes.desc);let l=Fp.fromTransaction(e),u=e.annotation(_d.time),d=e.annotation(_d.userEvent);return l?o=o.addChanges(l,u,d,t,e):e.selection&&(o=o.addSelection(e.startState.selection,u,d,t.newGroupDelay)),(a=="full"||a=="after")&&(o=o.isolate()),o},toJSON(o){return{done:o.done.map(e=>e.toJSON()),undone:o.undone.map(e=>e.toJSON())}},fromJSON(o){return new dy(o.done.map(Fp.fromJSON),o.undone.map(Fp.fromJSON))}});function J4e(o={}){return[m0e,h0e.of(o),is.domEventHandlers({beforeinput(e,t){let s=e.inputType=="historyUndo"?g0e:e.inputType=="historyRedo"?Tse:null;return s?(e.preventDefault(),s(t)):!1}})]}function lV(o,e){return function({state:t,dispatch:s}){if(!e&&t.readOnly)return!1;let a=t.field(m0e,!1);if(!a)return!1;let l=a.pop(o,t,e);return l?(s(l),!0):!1}}const g0e=lV(0,!1),Tse=lV(1,!1),eDe=lV(0,!0),tDe=lV(1,!0);class Fp{constructor(e,t,s,a,l){this.changes=e,this.effects=t,this.mapped=s,this.startSelection=a,this.selectionsAfter=l}setSelAfter(e){return new Fp(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 Fp(e.changes&&wd.fromJSON(e.changes),[],e.mapped&&my.fromJSON(e.mapped),e.startSelection&&Ln.fromJSON(e.startSelection),e.selectionsAfter.map(Ln.fromJSON))}static fromTransaction(e,t){let s=Hb;for(let a of e.startState.facet(G4e)){let l=a(e);l.length&&(s=s.concat(l))}return!s.length&&e.changes.empty?null:new Fp(e.changes.invert(e.startState.doc),s,void 0,t||e.startState.selection,Hb)}static selection(e){return new Fp(void 0,Hb,void 0,void 0,e)}}function kz(o,e,t,s){let a=e+1>t+20?e-t-1:0,l=o.slice(a,e);return l.push(s),l}function nDe(o,e){let t=[],s=!1;return o.iterChangedRanges((a,l)=>t.push(a,l)),e.iterChangedRanges((a,l,u,d)=>{for(let h=0;h<t.length;){let b=t[h++],y=t[h++];d>=b&&u<=y&&(s=!0)}}),s}function oDe(o,e){return o.ranges.length==e.ranges.length&&o.ranges.filter((t,s)=>t.empty!=e.ranges[s].empty).length===0}function p0e(o,e){return o.length?e.length?o.concat(e):o:e}const Hb=[],sDe=200;function b0e(o,e){if(o.length){let t=o[o.length-1],s=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-sDe));return s.length&&s[s.length-1].eq(e)?o:(s.push(e),kz(o,o.length-1,1e9,t.setSelAfter(s)))}else return[Fp.selection([e])]}function rDe(o){let e=o[o.length-1],t=o.slice();return t[o.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Une(o,e){if(!o.length)return o;let t=o.length,s=Hb;for(;t;){let a=iDe(o[t-1],e,s);if(a.changes&&!a.changes.empty||a.effects.length){let l=o.slice(0,t);return l[t-1]=a,l}else e=a.mapped,t--,s=a.selectionsAfter}return s.length?[Fp.selection(s)]:Hb}function iDe(o,e,t){let s=p0e(o.selectionsAfter.length?o.selectionsAfter.map(d=>d.map(e)):Hb,t);if(!o.changes)return Fp.selection(s);let a=o.changes.map(e),l=e.mapDesc(o.changes,!0),u=o.mapped?o.mapped.composeDesc(l):l;return new Fp(a,bi.mapEffects(o.effects,e),u,o.startSelection.map(l),s)}const aDe=/^(input\.type|delete)($|\.)/;class dy{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 dy(this.done,this.undone):this}addChanges(e,t,s,a,l){let u=this.done,d=u[u.length-1];return d&&d.changes&&!d.changes.empty&&e.changes&&(!s||aDe.test(s))&&(!d.selectionsAfter.length&&t-this.prevTime<a.newGroupDelay&&a.joinToEvent(l,nDe(d.changes,e.changes))||s=="input.type.compose")?u=kz(u,u.length-1,a.minDepth,new Fp(e.changes.compose(d.changes),p0e(e.effects,d.effects),d.mapped,d.startSelection,Hb)):u=kz(u,u.length,a.minDepth,e),new dy(u,Hb,t,s)}addSelection(e,t,s,a){let l=this.done.length?this.done[this.done.length-1].selectionsAfter:Hb;return l.length>0&&t-this.prevTime<a&&s==this.prevUserEvent&&s&&/^select($|\.)/.test(s)&&oDe(l[l.length-1],e)?this:new dy(b0e(this.done,e),this.undone,t,s)}addMapping(e){return new dy(Une(this.done,e),Une(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 l=a[a.length-1];if(s&&l.selectionsAfter.length)return t.update({selection:l.selectionsAfter[l.selectionsAfter.length-1],annotations:xse.of({side:e,rest:rDe(a)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(l.changes){let u=a.length==1?Hb:a.slice(0,a.length-1);return l.mapped&&(u=Une(u,l.mapped)),t.update({changes:l.changes,selection:l.startSelection,effects:l.effects,annotations:xse.of({side:e,rest:u}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}dy.empty=new dy(Hb,Hb);const lDe=[{key:"Mod-z",run:g0e,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Tse,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Tse,preventDefault:!0},{key:"Mod-u",run:eDe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:tDe,preventDefault:!0}];function JD(o,e){return Ln.create(o.ranges.map(e),o.mainIndex)}function Cy(o,e){return o.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ev({state:o,dispatch:e},t){let s=JD(o.selection,t);return s.eq(o.selection)?!1:(e(Cy(o,s)),!0)}function cV(o,e){return Ln.cursor(e?o.to:o.from)}function v0e(o,e){return Ev(o,t=>t.empty?o.moveByChar(t,e):cV(t,e))}function Fm(o){return o.textDirectionAt(o.state.selection.main.head)==Cu.LTR}const O0e=o=>v0e(o,!Fm(o)),y0e=o=>v0e(o,Fm(o));function w0e(o,e){return Ev(o,t=>t.empty?o.moveByGroup(t,e):cV(t,e))}const cDe=o=>w0e(o,!Fm(o)),uDe=o=>w0e(o,Fm(o));function fDe(o,e,t){if(e.type.prop(t))return!0;let s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(o.sliceDoc(e.from,e.to)))||e.firstChild}function uV(o,e,t){let s=_c(o).resolveInner(e.head),a=t?ui.closedBy:ui.openedBy;for(let h=e.head;;){let b=t?s.childAfter(h):s.childBefore(h);if(!b)break;fDe(o,b,a)?s=b:h=t?b.to:b.from}let l=s.type.prop(a),u,d;return l&&(u=t?fy(o,s.from,1):fy(o,s.to,-1))&&u.matched?d=t?u.end.to:u.end.from:d=t?s.to:s.from,Ln.cursor(d,t?-1:1)}const dDe=o=>Ev(o,e=>uV(o.state,e,!Fm(o))),hDe=o=>Ev(o,e=>uV(o.state,e,Fm(o)));function _0e(o,e){return Ev(o,t=>{if(!t.empty)return cV(t,e);let s=o.moveVertically(t,e);return s.head!=t.head?s:o.moveToLineBoundary(t,e)})}const S0e=o=>_0e(o,!1),C0e=o=>_0e(o,!0);function k0e(o){let e=o.scrollDOM.clientHeight<o.scrollDOM.scrollHeight-2,t=0,s=0,a;if(e){for(let l of o.state.facet(is.scrollMargins)){let u=l(o);u!=null&&u.top&&(t=Math.max(u==null?void 0:u.top,t)),u!=null&&u.bottom&&(s=Math.max(u==null?void 0:u.bottom,s))}a=o.scrollDOM.clientHeight-t-s}else a=(o.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:s,selfScroll:e,height:Math.max(o.defaultLineHeight,a-5)}}function x0e(o,e){let t=k0e(o),{state:s}=o,a=JD(s.selection,u=>u.empty?o.moveVertically(u,e,t.height):cV(u,e));if(a.eq(s.selection))return!1;let l;if(t.selfScroll){let u=o.coordsAtPos(s.selection.main.head),d=o.scrollDOM.getBoundingClientRect(),h=d.top+t.marginTop,b=d.bottom-t.marginBottom;u&&u.top>h&&u.bottom<b&&(l=is.scrollIntoView(a.main.head,{y:"start",yMargin:u.top-h}))}return o.dispatch(Cy(s,a),{effects:l}),!0}const bde=o=>x0e(o,!1),Ese=o=>x0e(o,!0);function ZC(o,e,t){let s=o.lineBlockAt(e.head),a=o.moveToLineBoundary(e,t);if(a.head==e.head&&a.head!=(t?s.to:s.from)&&(a=o.moveToLineBoundary(e,t,!1)),!t&&a.head==s.from&&s.length){let l=/^\s*/.exec(o.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;l&&e.head!=s.from+l&&(a=Ln.cursor(s.from+l))}return a}const mDe=o=>Ev(o,e=>ZC(o,e,!0)),gDe=o=>Ev(o,e=>ZC(o,e,!1)),pDe=o=>Ev(o,e=>ZC(o,e,!Fm(o))),bDe=o=>Ev(o,e=>ZC(o,e,Fm(o))),vDe=o=>Ev(o,e=>Ln.cursor(o.lineBlockAt(e.head).from,1)),ODe=o=>Ev(o,e=>Ln.cursor(o.lineBlockAt(e.head).to,-1));function yDe(o,e,t){let s=!1,a=JD(o.selection,l=>{let u=fy(o,l.head,-1)||fy(o,l.head,1)||l.head>0&&fy(o,l.head-1,1)||l.head<o.doc.length&&fy(o,l.head+1,-1);if(!u||!u.end)return l;s=!0;let d=u.start.from==l.head?u.end.to:u.end.from;return t?Ln.range(l.anchor,d):Ln.cursor(d)});return s?(e(Cy(o,a)),!0):!1}const wDe=({state:o,dispatch:e})=>yDe(o,e,!1);function jb(o,e){let t=JD(o.state.selection,s=>{let a=e(s);return Ln.range(s.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return t.eq(o.state.selection)?!1:(o.dispatch(Cy(o.state,t)),!0)}function T0e(o,e){return jb(o,t=>o.moveByChar(t,e))}const E0e=o=>T0e(o,!Fm(o)),A0e=o=>T0e(o,Fm(o));function D0e(o,e){return jb(o,t=>o.moveByGroup(t,e))}const _De=o=>D0e(o,!Fm(o)),SDe=o=>D0e(o,Fm(o)),CDe=o=>jb(o,e=>uV(o.state,e,!Fm(o))),kDe=o=>jb(o,e=>uV(o.state,e,Fm(o)));function P0e(o,e){return jb(o,t=>o.moveVertically(t,e))}const M0e=o=>P0e(o,!1),R0e=o=>P0e(o,!0);function $0e(o,e){return jb(o,t=>o.moveVertically(t,e,k0e(o).height))}const vde=o=>$0e(o,!1),Ode=o=>$0e(o,!0),xDe=o=>jb(o,e=>ZC(o,e,!0)),TDe=o=>jb(o,e=>ZC(o,e,!1)),EDe=o=>jb(o,e=>ZC(o,e,!Fm(o))),ADe=o=>jb(o,e=>ZC(o,e,Fm(o))),DDe=o=>jb(o,e=>Ln.cursor(o.lineBlockAt(e.head).from)),PDe=o=>jb(o,e=>Ln.cursor(o.lineBlockAt(e.head).to)),yde=({state:o,dispatch:e})=>(e(Cy(o,{anchor:0})),!0),wde=({state:o,dispatch:e})=>(e(Cy(o,{anchor:o.doc.length})),!0),_de=({state:o,dispatch:e})=>(e(Cy(o,{anchor:o.selection.main.anchor,head:0})),!0),Sde=({state:o,dispatch:e})=>(e(Cy(o,{anchor:o.selection.main.anchor,head:o.doc.length})),!0),MDe=({state:o,dispatch:e})=>(e(o.update({selection:{anchor:0,head:o.doc.length},userEvent:"select"})),!0),RDe=({state:o,dispatch:e})=>{let t=dV(o).map(({from:s,to:a})=>Ln.range(s,Math.min(a+1,o.doc.length)));return e(o.update({selection:Ln.create(t),userEvent:"select"})),!0},$De=({state:o,dispatch:e})=>{let t=JD(o.selection,s=>{var a;let l=_c(o).resolveInner(s.head,1);for(;!(l.from<s.from&&l.to>=s.to||l.to>s.to&&l.from<=s.from||!(!((a=l.parent)===null||a===void 0)&&a.parent));)l=l.parent;return Ln.range(l.to,l.from)});return e(Cy(o,t)),!0},NDe=({state:o,dispatch:e})=>{let t=o.selection,s=null;return t.ranges.length>1?s=Ln.create([t.main]):t.main.empty||(s=Ln.create([Ln.cursor(t.main.head)])),s?(e(Cy(o,s)),!0):!1};function fV(o,e){if(o.state.readOnly)return!1;let t="delete.selection",{state:s}=o,a=s.changeByRange(l=>{let{from:u,to:d}=l;if(u==d){let h=e(u);h<u?(t="delete.backward",h=nH(o,h,!1)):h>u&&(t="delete.forward",h=nH(o,h,!0)),u=Math.min(u,h),d=Math.max(d,h)}else u=nH(o,u,!1),d=nH(o,d,!0);return u==d?{range:l}:{changes:{from:u,to:d},range:Ln.cursor(u)}});return a.changes.empty?!1:(o.dispatch(s.update(a,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?is.announce.of(s.phrase("Selection deleted")):void 0})),!0)}function nH(o,e,t){if(o instanceof is)for(let s of o.state.facet(is.atomicRanges).map(a=>a(o)))s.between(e,e,(a,l)=>{a<e&&l>e&&(e=t?l:a)});return e}const N0e=(o,e)=>fV(o,t=>{let{state:s}=o,a=s.doc.lineAt(t),l,u;if(!e&&t>a.from&&t<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,t-a.from))){if(l[l.length-1]==" ")return t-1;let d=Cv(l,s.tabSize),h=d%_z(s)||_z(s);for(let b=0;b<h&&l[l.length-1-b]==" ";b++)t--;u=t}else u=Bm(a.text,t-a.from,e,e)+a.from,u==t&&a.number!=(e?s.doc.lines:1)&&(u+=e?1:-1);return u}),Ase=o=>N0e(o,!1),I0e=o=>N0e(o,!0),B0e=(o,e)=>fV(o,t=>{let s=t,{state:a}=o,l=a.doc.lineAt(s),u=a.charCategorizer(s);for(let d=null;;){if(s==(e?l.to:l.from)){s==t&&l.number!=(e?a.doc.lines:1)&&(s+=e?1:-1);break}let h=Bm(l.text,s-l.from,e)+l.from,b=l.text.slice(Math.min(s,h)-l.from,Math.max(s,h)-l.from),y=u(b);if(d!=null&&y!=d)break;(b!=" "||s!=t)&&(d=y),s=h}return s}),L0e=o=>B0e(o,!1),IDe=o=>B0e(o,!0),F0e=o=>fV(o,e=>{let t=o.lineBlockAt(e).to;return e<t?t:Math.min(o.state.doc.length,e+1)}),BDe=o=>fV(o,e=>{let t=o.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),LDe=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let t=o.changeByRange(s=>({changes:{from:s.from,to:s.to,insert:el.of(["",""])},range:Ln.cursor(s.from)}));return e(o.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},FDe=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let t=o.changeByRange(s=>{if(!s.empty||s.from==0||s.from==o.doc.length)return{range:s};let a=s.from,l=o.doc.lineAt(a),u=a==l.from?a-1:Bm(l.text,a-l.from,!1)+l.from,d=a==l.to?a+1:Bm(l.text,a-l.from,!0)+l.from;return{changes:{from:u,to:d,insert:o.doc.slice(a,d).append(o.doc.slice(u,a))},range:Ln.cursor(d)}});return t.changes.empty?!1:(e(o.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dV(o){let e=[],t=-1;for(let s of o.selection.ranges){let a=o.doc.lineAt(s.from),l=o.doc.lineAt(s.to);if(!s.empty&&s.to==l.from&&(l=o.doc.lineAt(s.to-1)),t>=a.number){let u=e[e.length-1];u.to=l.to,u.ranges.push(s)}else e.push({from:a.from,to:l.to,ranges:[s]});t=l.number+1}return e}function Q0e(o,e,t){if(o.readOnly)return!1;let s=[],a=[];for(let l of dV(o)){if(t?l.to==o.doc.length:l.from==0)continue;let u=o.doc.lineAt(t?l.to+1:l.from-1),d=u.length+1;if(t){s.push({from:l.to,to:u.to},{from:l.from,insert:u.text+o.lineBreak});for(let h of l.ranges)a.push(Ln.range(Math.min(o.doc.length,h.anchor+d),Math.min(o.doc.length,h.head+d)))}else{s.push({from:u.from,to:l.from},{from:l.to,insert:o.lineBreak+u.text});for(let h of l.ranges)a.push(Ln.range(h.anchor-d,h.head-d))}}return s.length?(e(o.update({changes:s,scrollIntoView:!0,selection:Ln.create(a,o.selection.mainIndex),userEvent:"move.line"})),!0):!1}const QDe=({state:o,dispatch:e})=>Q0e(o,e,!1),ZDe=({state:o,dispatch:e})=>Q0e(o,e,!0);function Z0e(o,e,t){if(o.readOnly)return!1;let s=[];for(let a of dV(o))t?s.push({from:a.from,insert:o.doc.slice(a.from,a.to)+o.lineBreak}):s.push({from:a.to,insert:o.lineBreak+o.doc.slice(a.from,a.to)});return e(o.update({changes:s,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const HDe=({state:o,dispatch:e})=>Z0e(o,e,!1),zDe=({state:o,dispatch:e})=>Z0e(o,e,!0),VDe=o=>{if(o.state.readOnly)return!1;let{state:e}=o,t=e.changes(dV(e).map(({from:a,to:l})=>(a>0?a--:l<e.doc.length&&l++,{from:a,to:l}))),s=JD(e.selection,a=>o.moveVertically(a,!0)).map(t);return o.dispatch({changes:t,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0};function WDe(o,e){if(/\(\)|\[\]|\{\}/.test(o.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=_c(o).resolveInner(e),s=t.childBefore(e),a=t.childAfter(e),l;return s&&a&&s.to<=e&&a.from>=e&&(l=s.type.prop(ui.closedBy))&&l.indexOf(a.name)>-1&&o.doc.lineAt(s.to).from==o.doc.lineAt(a.from).from&&!/\S/.test(o.sliceDoc(s.to,a.from))?{from:s.to,to:a.from}:null}const UDe=H0e(!1),YDe=H0e(!0);function H0e(o){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let s=e.changeByRange(a=>{let{from:l,to:u}=a,d=e.doc.lineAt(l),h=!o&&l==u&&WDe(e,l);o&&(l=u=(u<=d.to?d:e.doc.lineAt(u)).to);let b=new rV(e,{simulateBreak:l,simulateDoubleBreak:!!h}),y=Ere(b,l);for(y==null&&(y=Cv(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));u<d.to&&/\s/.test(d.text[u-d.from]);)u++;h?{from:l,to:u}=h:l>d.from&&l<d.from+100&&!/\S/.test(d.text.slice(0,l))&&(l=d.from);let C=["",I6(e,y)];return h&&C.push(I6(e,b.lineIndent(d.from,-1))),{changes:{from:l,to:u,insert:el.of(C)},range:Ln.cursor(l+1+C[1].length)}});return t(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0}}function $re(o,e){let t=-1;return o.changeByRange(s=>{let a=[];for(let u=s.from;u<=s.to;){let d=o.doc.lineAt(u);d.number>t&&(s.empty||s.to>d.from)&&(e(d,a,s),t=d.number),u=d.to+1}let l=o.changes(a);return{changes:a,range:Ln.range(l.mapPos(s.anchor,1),l.mapPos(s.head,1))}})}const XDe=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let t=Object.create(null),s=new rV(o,{overrideIndentation:l=>{let u=t[l];return u==null?-1:u}}),a=$re(o,(l,u,d)=>{let h=Ere(s,l.from);if(h==null)return;/\S/.test(l.text)||(h=0);let b=/^\s*/.exec(l.text)[0],y=I6(o,h);(b!=y||d.from<l.from+b.length)&&(t[l.from]=h,u.push({from:l.from,to:l.from+b.length,insert:y}))});return a.changes.empty||e(o.update(a,{userEvent:"indent"})),!0},z0e=({state:o,dispatch:e})=>o.readOnly?!1:(e(o.update($re(o,(t,s)=>{s.push({from:t.from,insert:o.facet(lI)})}),{userEvent:"input.indent"})),!0),V0e=({state:o,dispatch:e})=>o.readOnly?!1:(e(o.update($re(o,(t,s)=>{let a=/^\s*/.exec(t.text)[0];if(!a)return;let l=Cv(a,o.tabSize),u=0,d=I6(o,Math.max(0,l-_z(o)));for(;u<a.length&&u<d.length&&a.charCodeAt(u)==d.charCodeAt(u);)u++;s.push({from:t.from+u,to:t.from+a.length,insert:d.slice(u)})}),{userEvent:"delete.dedent"})),!0),jDe=[{key:"Ctrl-b",run:O0e,shift:E0e,preventDefault:!0},{key:"Ctrl-f",run:y0e,shift:A0e},{key:"Ctrl-p",run:S0e,shift:M0e},{key:"Ctrl-n",run:C0e,shift:R0e},{key:"Ctrl-a",run:vDe,shift:DDe},{key:"Ctrl-e",run:ODe,shift:PDe},{key:"Ctrl-d",run:I0e},{key:"Ctrl-h",run:Ase},{key:"Ctrl-k",run:F0e},{key:"Ctrl-Alt-h",run:L0e},{key:"Ctrl-o",run:LDe},{key:"Ctrl-t",run:FDe},{key:"Ctrl-v",run:Ese}],qDe=[{key:"ArrowLeft",run:O0e,shift:E0e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cDe,shift:_De,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:pDe,shift:EDe,preventDefault:!0},{key:"ArrowRight",run:y0e,shift:A0e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:uDe,shift:SDe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:bDe,shift:ADe,preventDefault:!0},{key:"ArrowUp",run:S0e,shift:M0e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yde,shift:_de},{mac:"Ctrl-ArrowUp",run:bde,shift:vde},{key:"ArrowDown",run:C0e,shift:R0e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:wde,shift:Sde},{mac:"Ctrl-ArrowDown",run:Ese,shift:Ode},{key:"PageUp",run:bde,shift:vde},{key:"PageDown",run:Ese,shift:Ode},{key:"Home",run:gDe,shift:TDe,preventDefault:!0},{key:"Mod-Home",run:yde,shift:_de},{key:"End",run:mDe,shift:xDe,preventDefault:!0},{key:"Mod-End",run:wde,shift:Sde},{key:"Enter",run:UDe},{key:"Mod-a",run:MDe},{key:"Backspace",run:Ase,shift:Ase},{key:"Delete",run:I0e},{key:"Mod-Backspace",mac:"Alt-Backspace",run:L0e},{key:"Mod-Delete",mac:"Alt-Delete",run:IDe},{mac:"Mod-Backspace",run:BDe},{mac:"Mod-Delete",run:F0e}].concat(jDe.map(o=>({mac:o.key,run:o.run,shift:o.shift}))),GDe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:dDe,shift:CDe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:hDe,shift:kDe},{key:"Alt-ArrowUp",run:QDe},{key:"Shift-Alt-ArrowUp",run:HDe},{key:"Alt-ArrowDown",run:ZDe},{key:"Shift-Alt-ArrowDown",run:zDe},{key:"Escape",run:NDe},{key:"Mod-Enter",run:YDe},{key:"Alt-l",mac:"Ctrl-l",run:RDe},{key:"Mod-i",run:$De,preventDefault:!0},{key:"Mod-[",run:V0e},{key:"Mod-]",run:z0e},{key:"Mod-Alt-\\",run:XDe},{key:"Shift-Mod-k",run:VDe},{key:"Shift-Mod-\\",run:wDe},{key:"Mod-/",run:z4e},{key:"Alt-A",run:W4e}].concat(qDe),W0e={key:"Tab",run:z0e,shift:V0e};function yc(){var o=arguments[0];typeof o=="string"&&(o=document.createElement(o));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"?o.setAttribute(s,a):a!=null&&(o[s]=a)}e++}for(;e<arguments.length;e++)U0e(o,arguments[e]);return o}function U0e(o,e){if(typeof e=="string")o.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)o.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)U0e(o,e[t]);else throw new RangeError("Unsupported child node: "+e)}const Cde=typeof String.prototype.normalize=="function"?o=>o.normalize("NFKD"):o=>o;class ND{constructor(e,t,s=0,a=e.length,l,u){this.test=u,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=l?d=>l(Cde(d)):Cde,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 Uh(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=fre(e),s=this.bufferStart+this.bufferPos;this.bufferPos+=Fb(e);let a=this.normalize(t);for(let l=0,u=s;;l++){let d=a.charCodeAt(l),h=this.match(d,u);if(l==a.length-1){if(h)return this.value=h,this;break}u==s&&l<t.length&&t.charCodeAt(l)==d&&u++}}}match(e,t){let s=null;for(let a=0;a<this.matches.length;a+=2){let l=this.matches[a],u=!1;this.query.charCodeAt(l)==e&&(l==this.query.length-1?s={from:this.matches[a+1],to:t+1}:(this.matches[a]++,u=!0)),u||(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"&&(ND.prototype[Symbol.iterator]=function(){return this});const Y0e={from:-1,to:-1,match:/.*/.exec("")},Nre="gm"+(/x/.unicode==null?"":"u");class X0e{constructor(e,t,s,a=0,l=e.length){if(this.text=e,this.to=l,this.curLine="",this.done=!1,this.value=Y0e,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new j0e(e,t,s,a,l);this.re=new RegExp(t,Nre+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.iter=e.iter();let u=e.lineAt(a);this.curLineStart=u.from,this.matchPos=xz(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=xz(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 Yne=new WeakMap;class CD{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,s){let a=Yne.get(e);if(!a||a.from>=s||a.to<=t){let d=new CD(t,e.sliceString(t,s));return Yne.set(e,d),d}if(a.from==t&&a.to==s)return a;let{text:l,from:u}=a;return u>t&&(l=e.sliceString(t,u)+l,u=t),a.to<s&&(l+=e.sliceString(a.to,s)),Yne.set(e,new CD(u,l)),new CD(t,l.slice(t-u,s-u))}}class j0e{constructor(e,t,s,a,l){this.text=e,this.to=l,this.done=!1,this.value=Y0e,this.matchPos=xz(e,a),this.re=new RegExp(t,Nre+(s!=null&&s.ignoreCase?"i":"")),this.test=s==null?void 0:s.test,this.flat=CD.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=xz(this.text,a+(s==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=CD.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(X0e.prototype[Symbol.iterator]=j0e.prototype[Symbol.iterator]=function(){return this});function KDe(o){try{return new RegExp(o,Nre),!0}catch{return!1}}function xz(o,e){if(e>=o.length)return e;let t=o.lineAt(e),s;for(;e<t.to&&(s=t.text.charCodeAt(e-t.from))>=56320&&s<57344;)e++;return e}function Dse(o){let e=String(o.state.doc.lineAt(o.state.selection.main.head).number),t=yc("input",{class:"cm-textfield",name:"line",value:e}),s=yc("form",{class:"cm-gotoLine",onkeydown:l=>{l.keyCode==27?(l.preventDefault(),o.dispatch({effects:Tz.of(!1)}),o.focus()):l.keyCode==13&&(l.preventDefault(),a())},onsubmit:l=>{l.preventDefault(),a()}},yc("label",o.state.phrase("Go to line"),": ",t)," ",yc("button",{class:"cm-button",type:"submit"},o.state.phrase("go")));function a(){let l=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!l)return;let{state:u}=o,d=u.doc.lineAt(u.selection.main.head),[,h,b,y,C]=l,E=y?+y.slice(1):0,R=b?+b:d.number;if(b&&C){let F=R/100;h&&(F=F*(h=="-"?-1:1)+d.number/u.doc.lines),R=Math.round(u.doc.lines*F)}else b&&h&&(R=R*(h=="-"?-1:1)+d.number);let $=u.doc.line(Math.max(1,Math.min(u.doc.lines,R))),Q=Ln.cursor($.from+Math.max(0,Math.min(E,$.length)));o.dispatch({effects:[Tz.of(!1),is.scrollIntoView(Q.from,{y:"center"})],selection:Q}),o.focus()}return{dom:s}}const Tz=bi.define(),kde=Uf.define({create(){return!0},update(o,e){for(let t of e.effects)t.is(Tz)&&(o=t.value);return o},provide:o=>M6.from(o,e=>e?Dse:null)}),JDe=o=>{let e=P6(o,Dse);if(!e){let t=[Tz.of(!0)];o.state.field(kde,!1)==null&&t.push(bi.appendConfig.of([kde,ePe])),o.dispatch({effects:t}),e=P6(o,Dse)}return e&&e.dom.querySelector("input").select(),!0},ePe=is.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tPe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},q0e=As.define({combine(o){return Tv(o,tPe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function nPe(o){let e=[aPe,iPe];return o&&e.push(q0e.of(o)),e}const oPe=Br.mark({class:"cm-selectionMatch"}),sPe=Br.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function xde(o,e,t,s){return(t==0||o(e.sliceDoc(t-1,t))!=tu.Word)&&(s==e.doc.length||o(e.sliceDoc(s,s+1))!=tu.Word)}function rPe(o,e,t,s){return o(e.sliceDoc(t,t+1))==tu.Word&&o(e.sliceDoc(s-1,s))==tu.Word}const iPe=kf.fromClass(class{constructor(o){this.decorations=this.getDeco(o)}update(o){(o.selectionSet||o.docChanged||o.viewportChanged)&&(this.decorations=this.getDeco(o.view))}getDeco(o){let e=o.state.facet(q0e),{state:t}=o,s=t.selection;if(s.ranges.length>1)return Br.none;let a=s.main,l,u=null;if(a.empty){if(!e.highlightWordAroundCursor)return Br.none;let h=t.wordAt(a.head);if(!h)return Br.none;u=t.charCategorizer(a.head),l=t.sliceDoc(h.from,h.to)}else{let h=a.to-a.from;if(h<e.minSelectionLength||h>200)return Br.none;if(e.wholeWords){if(l=t.sliceDoc(a.from,a.to),u=t.charCategorizer(a.head),!(xde(u,t,a.from,a.to)&&rPe(u,t,a.from,a.to)))return Br.none}else if(l=t.sliceDoc(a.from,a.to).trim(),!l)return Br.none}let d=[];for(let h of o.visibleRanges){let b=new ND(t.doc,l,h.from,h.to);for(;!b.next().done;){let{from:y,to:C}=b.value;if((!u||xde(u,t,y,C))&&(a.empty&&y<=a.from&&C>=a.to?d.push(sPe.range(y,C)):(y>=a.to||C<=a.from)&&d.push(oPe.range(y,C)),d.length>e.maxMatches))return Br.none}}return Br.set(d)}},{decorations:o=>o.decorations}),aPe=is.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),lPe=({state:o,dispatch:e})=>{let{selection:t}=o,s=Ln.create(t.ranges.map(a=>o.wordAt(a.head)||Ln.cursor(a.head)),t.mainIndex);return s.eq(t)?!1:(e(o.update({selection:s})),!0)};function cPe(o,e){let{main:t,ranges:s}=o.selection,a=o.wordAt(t.head),l=a&&a.from==t.from&&a.to==t.to;for(let u=!1,d=new ND(o.doc,e,s[s.length-1].to);;)if(d.next(),d.done){if(u)return null;d=new ND(o.doc,e,0,Math.max(0,s[s.length-1].from-1)),u=!0}else{if(u&&s.some(h=>h.from==d.value.from))continue;if(l){let h=o.wordAt(d.value.from);if(!h||h.from!=d.value.from||h.to!=d.value.to)continue}return d.value}}const uPe=({state:o,dispatch:e})=>{let{ranges:t}=o.selection;if(t.some(l=>l.from===l.to))return lPe({state:o,dispatch:e});let s=o.sliceDoc(t[0].from,t[0].to);if(o.selection.ranges.some(l=>o.sliceDoc(l.from,l.to)!=s))return!1;let a=cPe(o,s);return a?(e(o.update({selection:o.selection.addRange(Ln.range(a.from,a.to),!1),effects:is.scrollIntoView(a.to)})),!0):!1},eP=As.define({combine(o){return Tv(o,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new _Pe(e),scrollToMatch:e=>is.scrollIntoView(e)})}});class G0e{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||KDe(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 mPe(this):new dPe(this)}getCursor(e,t=0,s){let a=e.doc?e:ra.create({doc:e});return s==null&&(s=a.doc.length),this.regexp?lD(this,a,t,s):aD(this,a,t,s)}}class K0e{constructor(e){this.spec=e}}function aD(o,e,t,s){return new ND(e.doc,o.unquoted,t,s,o.caseSensitive?void 0:a=>a.toLowerCase(),o.wholeWord?fPe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function fPe(o,e){return(t,s,a,l)=>((l>t||l+a.length<s)&&(l=Math.max(0,t-2),a=o.sliceString(l,Math.min(o.length,s+2))),(e(Ez(a,t-l))!=tu.Word||e(Az(a,t-l))!=tu.Word)&&(e(Az(a,s-l))!=tu.Word||e(Ez(a,s-l))!=tu.Word))}class dPe extends K0e{constructor(e){super(e)}nextMatch(e,t,s){let a=aD(this.spec,e,s,e.doc.length).nextOverlapping();return a.done&&(a=aD(this.spec,e,0,t).nextOverlapping()),a.done?null:a.value}prevMatchInRange(e,t,s){for(let a=s;;){let l=Math.max(t,a-1e4-this.spec.unquoted.length),u=aD(this.spec,e,l,a),d=null;for(;!u.nextOverlapping().done;)d=u.value;if(d)return d;if(l==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=aD(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 l=aD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(s+this.spec.unquoted.length,e.doc.length));for(;!l.next().done;)a(l.value.from,l.value.to)}}function lD(o,e,t,s){return new X0e(e.doc,o.search,{ignoreCase:!o.caseSensitive,test:o.wholeWord?hPe(e.charCategorizer(e.selection.main.head)):void 0},t,s)}function Ez(o,e){return o.slice(Bm(o,e,!1),e)}function Az(o,e){return o.slice(e,Bm(o,e))}function hPe(o){return(e,t,s)=>!s[0].length||(o(Ez(s.input,s.index))!=tu.Word||o(Az(s.input,s.index))!=tu.Word)&&(o(Az(s.input,s.index+s[0].length))!=tu.Word||o(Ez(s.input,s.index+s[0].length))!=tu.Word)}class mPe extends K0e{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 l=Math.max(t,s-a*1e4),u=lD(this.spec,e,l,s),d=null;for(;!u.next().done;)d=u.value;if(d&&(l==t||d.from>l+10))return d;if(l==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 l=lD(this.spec,e,Math.max(0,t-250),Math.min(s+250,e.doc.length));for(;!l.next().done;)a(l.value.from,l.value.to)}}const B6=bi.define(),Ire=bi.define(),xC=Uf.define({create(o){return new Xne(Pse(o).create(),null)},update(o,e){for(let t of e.effects)t.is(B6)?o=new Xne(t.value.create(),o.panel):t.is(Ire)&&(o=new Xne(o.query,t.value?Bre:null));return o},provide:o=>M6.from(o,e=>e.panel)});class Xne{constructor(e,t){this.query=e,this.panel=t}}const gPe=Br.mark({class:"cm-searchMatch"}),pPe=Br.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bPe=kf.fromClass(class{constructor(o){this.view=o,this.decorations=this.highlight(o.state.field(xC))}update(o){let e=o.state.field(xC);(e!=o.startState.field(xC)||o.docChanged||o.selectionSet||o.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:o,panel:e}){if(!e||!o.spec.valid)return Br.none;let{view:t}=this,s=new PC;for(let a=0,l=t.visibleRanges,u=l.length;a<u;a++){let{from:d,to:h}=l[a];for(;a<u-1&&h>l[a+1].from-2*250;)h=l[++a].to;o.highlight(t.state,d,h,(b,y)=>{let C=t.state.selection.ranges.some(E=>E.from==b&&E.to==y);s.add(b,y,C?pPe:gPe)})}return s.finish()}},{decorations:o=>o.decorations});function uI(o){return e=>{let t=e.state.field(xC,!1);return t&&t.query.spec.valid?o(e,t):tve(e)}}const Dz=uI((o,{query:e})=>{let{to:t}=o.state.selection.main,s=e.nextMatch(o.state,t,t);if(!s)return!1;let a=Ln.single(s.from,s.to),l=o.state.facet(eP);return o.dispatch({selection:a,effects:[Lre(o,s),l.scrollToMatch(a.main,o)],userEvent:"select.search"}),eve(o),!0}),Pz=uI((o,{query:e})=>{let{state:t}=o,{from:s}=t.selection.main,a=e.prevMatch(t,s,s);if(!a)return!1;let l=Ln.single(a.from,a.to),u=o.state.facet(eP);return o.dispatch({selection:l,effects:[Lre(o,a),u.scrollToMatch(l.main,o)],userEvent:"select.search"}),eve(o),!0}),vPe=uI((o,{query:e})=>{let t=e.matchAll(o.state,1e3);return!t||!t.length?!1:(o.dispatch({selection:Ln.create(t.map(s=>Ln.range(s.from,s.to))),userEvent:"select.search.matches"}),!0)}),OPe=({state:o,dispatch:e})=>{let t=o.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:s,to:a}=t.main,l=[],u=0;for(let d=new ND(o.doc,o.sliceDoc(s,a));!d.next().done;){if(l.length>1e3)return!1;d.value.from==s&&(u=l.length),l.push(Ln.range(d.value.from,d.value.to))}return e(o.update({selection:Ln.create(l,u),userEvent:"select.search.matches"})),!0},Tde=uI((o,{query:e})=>{let{state:t}=o,{from:s,to:a}=t.selection.main;if(t.readOnly)return!1;let l=e.nextMatch(t,s,s);if(!l)return!1;let u=[],d,h,b=[];if(l.from==s&&l.to==a&&(h=t.toText(e.getReplacement(l)),u.push({from:l.from,to:l.to,insert:h}),l=e.nextMatch(t,l.from,l.to),b.push(is.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(s).number)+"."))),l){let y=u.length==0||u[0].from>=l.to?0:l.to-l.from-h.length;d=Ln.single(l.from-y,l.to-y),b.push(Lre(o,l)),b.push(t.facet(eP).scrollToMatch(d.main,o))}return o.dispatch({changes:u,selection:d,effects:b,userEvent:"input.replace"}),!0}),yPe=uI((o,{query:e})=>{if(o.state.readOnly)return!1;let t=e.matchAll(o.state,1e9).map(a=>{let{from:l,to:u}=a;return{from:l,to:u,insert:e.getReplacement(a)}});if(!t.length)return!1;let s=o.state.phrase("replaced $ matches",t.length)+".";return o.dispatch({changes:t,effects:is.announce.of(s),userEvent:"input.replace.all"}),!0});function Bre(o){return o.state.facet(eP).createPanel(o)}function Pse(o,e){var t,s,a,l,u;let d=o.selection.main,h=d.empty||d.to>d.from+100?"":o.sliceDoc(d.from,d.to);if(e&&!h)return e;let b=o.facet(eP);return new G0e({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:b.literal)?h:h.replace(/\n/g,"\\n"),caseSensitive:(s=e==null?void 0:e.caseSensitive)!==null&&s!==void 0?s:b.caseSensitive,literal:(a=e==null?void 0:e.literal)!==null&&a!==void 0?a:b.literal,regexp:(l=e==null?void 0:e.regexp)!==null&&l!==void 0?l:b.regexp,wholeWord:(u=e==null?void 0:e.wholeWord)!==null&&u!==void 0?u:b.wholeWord})}function J0e(o){let e=P6(o,Bre);return e&&e.dom.querySelector("[main-field]")}function eve(o){let e=J0e(o);e&&e==o.root.activeElement&&e.select()}const tve=o=>{let e=o.state.field(xC,!1);if(e&&e.panel){let t=J0e(o);if(t&&t!=o.root.activeElement){let s=Pse(o.state,e.query.spec);s.valid&&o.dispatch({effects:B6.of(s)}),t.focus(),t.select()}}else o.dispatch({effects:[Ire.of(!0),e?B6.of(Pse(o.state,e.query.spec)):bi.appendConfig.of(CPe)]});return!0},nve=o=>{let e=o.state.field(xC,!1);if(!e||!e.panel)return!1;let t=P6(o,Bre);return t&&t.dom.contains(o.root.activeElement)&&o.focus(),o.dispatch({effects:Ire.of(!1)}),!0},wPe=[{key:"Mod-f",run:tve,scope:"editor search-panel"},{key:"F3",run:Dz,shift:Pz,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Dz,shift:Pz,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:nve,scope:"editor search-panel"},{key:"Mod-Shift-l",run:OPe},{key:"Alt-g",run:JDe},{key:"Mod-d",run:uPe,preventDefault:!0}];class _Pe{constructor(e){this.view=e;let t=this.query=e.state.field(xC).query.spec;this.commit=this.commit.bind(this),this.searchField=yc("input",{value:t.search,placeholder:D1(e,"Find"),"aria-label":D1(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yc("input",{value:t.replace,placeholder:D1(e,"Replace"),"aria-label":D1(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yc("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=yc("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=yc("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function s(a,l,u){return yc("button",{class:"cm-button",name:a,onclick:l,type:"button"},u)}this.dom=yc("div",{onkeydown:a=>this.keydown(a),class:"cm-search"},[this.searchField,s("next",()=>Dz(e),[D1(e,"next")]),s("prev",()=>Pz(e),[D1(e,"previous")]),s("select",()=>vPe(e),[D1(e,"all")]),yc("label",null,[this.caseField,D1(e,"match case")]),yc("label",null,[this.reField,D1(e,"regexp")]),yc("label",null,[this.wordField,D1(e,"by word")]),...e.state.readOnly?[]:[yc("br"),this.replaceField,s("replace",()=>Tde(e),[D1(e,"replace")]),s("replaceAll",()=>yPe(e),[D1(e,"replace all")])],yc("button",{name:"close",onclick:()=>nve(e),"aria-label":D1(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new G0e({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:B6.of(e)}))}keydown(e){B3e(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Pz:Dz)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Tde(this.view))}update(e){for(let t of e.transactions)for(let s of t.effects)s.is(B6)&&!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(eP).top}}function D1(o,e){return o.state.phrase(e)}const oH=30,sH=/[\s\.,:;?!]/;function Lre(o,{from:e,to:t}){let s=o.state.doc.lineAt(e),a=o.state.doc.lineAt(t).to,l=Math.max(s.from,e-oH),u=Math.min(a,t+oH),d=o.state.sliceDoc(l,u);if(l!=s.from){for(let h=0;h<oH;h++)if(!sH.test(d[h+1])&&sH.test(d[h])){d=d.slice(h);break}}if(u!=a){for(let h=d.length-1;h>d.length-oH;h--)if(!sH.test(d[h-1])&&sH.test(d[h])){d=d.slice(0,h);break}}return is.announce.of(`${o.state.phrase("current match")}. ${d} ${o.state.phrase("on line")} ${s.number}.`)}const SPe=is.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"}}),CPe=[xC,QC.low(bPe),SPe];class Fre{constructor(e,t,s){this.state=e,this.pos=t,this.explicit=s,this.abortListeners=[]}tokenBefore(e){let t=_c(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),l=a.search(sve(e,!1));return l<0?null:{from:s+l,to:this.pos,text:a.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Ede(o){let e=Object.keys(o).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function kPe(o){let e=Object.create(null),t=Object.create(null);for(let{label:a}of o){e[a[0]]=!0;for(let l=1;l<a.length;l++)t[a[l]]=!0}let s=Ede(e)+Ede(t)+"*$";return[new RegExp("^"+s),new RegExp(s)]}function ove(o){let e=o.map(a=>typeof a=="string"?{label:a}:a),[t,s]=e.every(a=>/^\w+$/.test(a.label))?[/\w*$/,/\w+$/]:kPe(e);return a=>{let l=a.matchBefore(s);return l||a.explicit?{from:l?l.from:a.pos,options:e,validFor:t}:null}}function xPe(o,e){return t=>{for(let s=_c(t.state).resolveInner(t.pos,-1);s;s=s.parent){if(o.indexOf(s.name)>-1)return null;if(s.type.isTop)break}return e(t)}}class Ade{constructor(e,t,s,a){this.completion=e,this.source=t,this.match=s,this.score=a}}function TC(o){return o.selection.main.from}function sve(o,e){var t;let{source:s}=o,a=e&&s[0]!="^",l=s[s.length-1]!="$";return!a&&!l?o:new RegExp(`${a?"^":""}(?:${s})${l?"$":""}`,(t=o.flags)!==null&&t!==void 0?t:o.ignoreCase?"i":"")}const rve=qw.define();function TPe(o,e,t,s){let{main:a}=o.selection,l=t-a.from,u=s-a.from;return Object.assign(Object.assign({},o.changeByRange(d=>d!=a&&t!=s&&o.sliceDoc(d.from+l,d.from+u)!=o.sliceDoc(t,s)?{range:d}:{changes:{from:d.from+l,to:s==a.from?d.to:d.from+u,insert:e},range:Ln.cursor(d.from+l+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Dde=new WeakMap;function EPe(o){if(!Array.isArray(o))return o;let e=Dde.get(o);return e||Dde.set(o,e=ove(o)),e}const Qre=bi.define(),L6=bi.define();class APe{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=Uh(e,t),a=Fb(s);this.chars.push(s);let l=e.slice(t,t+a),u=l.toUpperCase();this.folded.push(Uh(u==l?l.toLowerCase():u,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:l,byWord:u}=this;if(t.length==1){let K=Uh(e,0),L=Fb(K),te=L==e.length?0:-100;if(K!=t[0])if(K==s[0])te+=-200;else return!1;return this.ret(te,[0,L])}let d=e.indexOf(this.pattern);if(d==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let h=t.length,b=0;if(d<0){for(let K=0,L=Math.min(e.length,200);K<L&&b<h;){let te=Uh(e,K);(te==t[b]||te==s[b])&&(a[b++]=K),K+=Fb(te)}if(b<h)return!1}let y=0,C=0,E=!1,R=0,$=-1,Q=-1,F=/[a-z]/.test(e),U=!0;for(let K=0,L=Math.min(e.length,200),te=0;K<L&&C<h;){let ne=Uh(e,K);d<0&&(y<h&&ne==t[y]&&(l[y++]=K),R<h&&(ne==t[R]||ne==s[R]?(R==0&&($=K),Q=K+1,R++):R=0));let oe,G=ne<255?ne>=48&&ne<=57||ne>=97&&ne<=122?2:ne>=65&&ne<=90?1:0:(oe=fre(ne))!=oe.toLowerCase()?1:oe!=oe.toUpperCase()?2:0;(!K||G==1&&F||te==0&&G!=0)&&(t[C]==ne||s[C]==ne&&(E=!0)?u[C++]=K:u.length&&(U=!1)),te=G,K+=Fb(ne)}return C==h&&u[0]==0&&U?this.result(-100+(E?-200:0),u,e):R==h&&$==0?this.ret(-200-e.length+(Q==e.length?0:-100),[0,Q]):d>-1?this.ret(-700-e.length,[d,d+this.pattern.length]):R==h?this.ret(-200+-700-e.length,[$,Q]):C==h?this.result(-100+(E?-200:0)+-700+(U?0:-1100),u,e):t.length==2?!1:this.result((a[0]?-700:0)+-200+-1100,a,e)}result(e,t,s){let a=[],l=0;for(let u of t){let d=u+(this.astral?Fb(Uh(s,u)):1);l&&a[l-1]==u?a[l-1]=d:(a[l++]=u,a[l++]=d)}return this.ret(e-s.length,a)}}const Qp=As.define({combine(o){return Tv(o,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:DPe,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=>Pde(e(s),t(s)),optionClass:(e,t)=>s=>Pde(e(s),t(s)),addToOptions:(e,t)=>e.concat(t)})}});function Pde(o,e){return o?e?o+" "+e:o:e}function DPe(o,e,t,s,a,l){let u=o.textDirection==Cu.RTL,d=u,h=!1,b="top",y,C,E=e.left-a.left,R=a.right-e.right,$=s.right-s.left,Q=s.bottom-s.top;if(d&&E<Math.min($,R)?d=!1:!d&&R<Math.min($,E)&&(d=!0),$<=(d?E:R))y=Math.max(a.top,Math.min(t.top,a.bottom-Q))-e.top,C=Math.min(400,d?E:R);else{h=!0,C=Math.min(400,(u?e.right:a.right-e.left)-30);let K=a.bottom-e.bottom;K>=Q||K>e.top?y=t.bottom-e.top:(b="bottom",y=e.bottom-t.top)}let F=(e.bottom-e.top)/l.offsetHeight,U=(e.right-e.left)/l.offsetWidth;return{style:`${b}: ${y/F}px; max-width: ${C/U}px`,class:"cm-completionInfo-"+(h?u?"left-narrow":"right-narrow":d?"left":"right")}}function PPe(o){let e=o.addToOptions.slice();return o.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 l=document.createElement("span");l.className="cm-completionLabel";let u=t.displayLabel||t.label,d=0;for(let h=0;h<a.length;){let b=a[h++],y=a[h++];b>d&&l.appendChild(document.createTextNode(u.slice(d,b)));let C=l.appendChild(document.createElement("span"));C.appendChild(document.createTextNode(u.slice(b,y))),C.className="cm-completionMatchedText",d=y}return d<u.length&&l.appendChild(document.createTextNode(u.slice(d))),l},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 Mde(o,e,t){if(o<=t)return{from:0,to:o};if(e<0&&(e=0),e<=o>>1){let a=Math.floor(e/t);return{from:a*t,to:(a+1)*t}}let s=Math.floor((o-e)/t);return{from:o-(s+1)*t,to:o-s*t}}class MPe{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:h=>this.placeInfo(h),key:this},this.space=null,this.currentClass="";let a=e.state.field(t),{options:l,selected:u}=a.open,d=e.state.facet(Qp);this.optionContent=PPe(d),this.optionClass=d.optionClass,this.tooltipClass=d.tooltipClass,this.range=Mde(l.length,u,d.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",h=>{for(let b=h.target,y;b&&b!=this.dom;b=b.parentNode)if(b.nodeName=="LI"&&(y=/-(\d+)$/.exec(b.id))&&+y[1]<l.length){this.applyCompletion(e,l[+y[1]]),h.preventDefault();return}}),this.dom.addEventListener("focusout",h=>{let b=e.state.field(this.stateField,!1);b&&b.tooltip&&e.state.facet(Qp).closeOnBlur&&h.relatedTarget!=e.contentDOM&&e.dispatch({effects:L6.of(null)})}),this.list=this.dom.appendChild(this.createListBox(l,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 l=e.state.field(this.stateField),u=e.startState.field(this.stateField);this.updateTooltipClass(e.state),l!=u&&(this.updateSel(),((t=l.open)===null||t===void 0?void 0:t.disabled)!=((s=u.open)===null||s===void 0?void 0:s.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((a=l.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=Mde(t.options.length,t.selected,this.view.state.facet(Qp).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 l=typeof a=="string"?document.createTextNode(a):a(s);if(!l)return;"then"in l?l.then(u=>{u&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(u,s)}).catch(u=>zb(this.view.state,u,"completion info")):this.addInfoPane(l,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:l}=e;s.appendChild(a),this.infoDestroy=l||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&&$Pe(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(),l=this.space;if(!l){let u=this.dom.ownerDocument.defaultView||window;l={left:0,top:0,right:u.innerWidth,bottom:u.innerHeight}}return a.top>Math.min(l.bottom,t.bottom)-10||a.bottom<Math.max(l.top,t.top)+10?null:this.view.state.facet(Qp).positionInfo(this.view,t,a,s,l,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 l=null;for(let u=s.from;u<s.to;u++){let{completion:d,match:h}=e[u],{section:b}=d;if(b){let E=typeof b=="string"?b:b.name;if(E!=l&&(u>s.from||s.from==0))if(l=E,typeof b!="string"&&b.header)a.appendChild(b.header(b));else{let R=a.appendChild(document.createElement("completion-section"));R.textContent=E}}const y=a.appendChild(document.createElement("li"));y.id=t+"-"+u,y.setAttribute("role","option");let C=this.optionClass(d);C&&(y.className=C);for(let E of this.optionContent){let R=E(d,this.view.state,h);R&&y.appendChild(R)}}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 RPe(o,e){return t=>new MPe(t,o,e)}function $Pe(o,e){let t=o.getBoundingClientRect(),s=e.getBoundingClientRect(),a=t.height/o.offsetHeight;s.top<t.top?o.scrollTop-=(t.top-s.top)/a:s.bottom>t.bottom&&(o.scrollTop+=(s.bottom-t.bottom)/a)}function Rde(o){return(o.boost||0)*100+(o.apply?10:0)+(o.info?5:0)+(o.type?1:0)}function NPe(o,e){let t=[],s=null,a=h=>{t.push(h);let{section:b}=h.completion;if(b){s||(s=[]);let y=typeof b=="string"?b:b.name;s.some(C=>C.name==y)||s.push(typeof b=="string"?{name:y}:b)}};for(let h of o)if(h.hasResult()){let b=h.result.getMatch;if(h.result.filter===!1)for(let y of h.result.options)a(new Ade(y,h.source,b?b(y):[],1e9-t.length));else{let y=new APe(e.sliceDoc(h.from,h.to));for(let C of h.result.options)if(y.match(C.label)){let E=C.displayLabel?b?b(C,y.matched):[]:y.matched;a(new Ade(C,h.source,E,y.score+(C.boost||0)))}}}if(s){let h=Object.create(null),b=0,y=(C,E)=>{var R,$;return((R=C.rank)!==null&&R!==void 0?R:1e9)-(($=E.rank)!==null&&$!==void 0?$:1e9)||(C.name<E.name?-1:1)};for(let C of s.sort(y))b-=1e5,h[C.name]=b;for(let C of t){let{section:E}=C.completion;E&&(C.score+=h[typeof E=="string"?E:E.name])}}let l=[],u=null,d=e.facet(Qp).compareCompletions;for(let h of t.sort((b,y)=>y.score-b.score||d(b.completion,y.completion))){let b=h.completion;!u||u.label!=b.label||u.detail!=b.detail||u.type!=null&&b.type!=null&&u.type!=b.type||u.apply!=b.apply||u.boost!=b.boost?l.push(h):Rde(h.completion)>Rde(u)&&(l[l.length-1]=h),u=h.completion}return l}class gD{constructor(e,t,s,a,l,u){this.options=e,this.attrs=t,this.tooltip=s,this.timestamp=a,this.selected=l,this.disabled=u}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new gD(this.options,$de(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,s,a,l){let u=NPe(e,t);if(!u.length)return a&&e.some(h=>h.state==1)?new gD(a.options,a.attrs,a.tooltip,a.timestamp,a.selected,!0):null;let d=t.facet(Qp).selectOnOpen?0:-1;if(a&&a.selected!=d&&a.selected!=-1){let h=a.options[a.selected].completion;for(let b=0;b<u.length;b++)if(u[b].completion==h){d=b;break}}return new gD(u,$de(s,d),{pos:e.reduce((h,b)=>b.hasResult()?Math.min(h,b.from):h,1e8),create:RPe(L1,lve),above:l.aboveCursor},a?a.timestamp:Date.now(),d,!1)}map(e){return new gD(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Mz{constructor(e,t,s){this.active=e,this.id=t,this.open=s}static start(){return new Mz(LPe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,s=t.facet(Qp),l=(s.override||t.languageDataAt("autocomplete",TC(t)).map(EPe)).map(d=>(this.active.find(b=>b.source==d)||new Ip(d,this.active.some(b=>b.state!=0)?1:0)).update(e,s));l.length==this.active.length&&l.every((d,h)=>d==this.active[h])&&(l=this.active);let u=this.open;u&&e.docChanged&&(u=u.map(e.changes)),e.selection||l.some(d=>d.hasResult()&&e.changes.touchesRange(d.from,d.to))||!IPe(l,this.active)?u=gD.build(l,t,this.id,u,s):u&&u.disabled&&!l.some(d=>d.state==1)&&(u=null),!u&&l.every(d=>d.state!=1)&&l.some(d=>d.hasResult())&&(l=l.map(d=>d.hasResult()?new Ip(d.source,0):d));for(let d of e.effects)d.is(ave)&&(u=u&&u.setSelected(d.value,this.id));return l==this.active&&u==this.open?this:new Mz(l,this.id,u)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:BPe}}function IPe(o,e){if(o==e)return!0;for(let t=0,s=0;;){for(;t<o.length&&!o[t].hasResult;)t++;for(;s<e.length&&!e[s].hasResult;)s++;let a=t==o.length,l=s==e.length;if(a||l)return a==l;if(o[t++].result!=e[s++].result)return!1}}const BPe={"aria-autocomplete":"list"};function $de(o,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":o};return e>-1&&(t["aria-activedescendant"]=o+"-"+e),t}const LPe=[];function Mse(o){return o.isUserEvent("input.type")?"input":o.isUserEvent("delete.backward")?"delete":null}class Ip{constructor(e,t,s=-1){this.source=e,this.state=t,this.explicitPos=s}hasResult(){return!1}update(e,t){let s=Mse(e),a=this;s?a=a.handleUserEvent(e,s,t):e.docChanged?a=a.handleChange(e):e.selection&&a.state!=0&&(a=new Ip(a.source,0));for(let l of e.effects)if(l.is(Qre))a=new Ip(a.source,1,l.value?TC(e.state):-1);else if(l.is(L6))a=new Ip(a.source,0);else if(l.is(ive))for(let u of l.value)u.source==a.source&&(a=u);return a}handleUserEvent(e,t,s){return t=="delete"||!s.activateOnTyping?this.map(e.changes):new Ip(this.source,1)}handleChange(e){return e.changes.touchesRange(TC(e.startState))?new Ip(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ip(this.source,this.state,e.mapPos(this.explicitPos))}}class kD extends Ip{constructor(e,t,s,a,l){super(e,2,t),this.result=s,this.from=a,this.to=l}hasResult(){return!0}handleUserEvent(e,t,s){var a;let l=e.changes.mapPos(this.from),u=e.changes.mapPos(this.to,1),d=TC(e.state);if((this.explicitPos<0?d<=l:d<this.from)||d>u||t=="delete"&&TC(e.startState)==this.from)return new Ip(this.source,t=="input"&&s.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),b;return FPe(this.result.validFor,e.state,l,u)?new kD(this.source,h,this.result,l,u):this.result.update&&(b=this.result.update(this.result,l,u,new Fre(e.state,d,h>=0)))?new kD(this.source,h,b,b.from,(a=b.to)!==null&&a!==void 0?a:TC(e.state)):new Ip(this.source,1,h)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ip(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new kD(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function FPe(o,e,t,s){if(!o)return!1;let a=e.sliceDoc(t,s);return typeof o=="function"?o(a,t,s,e):sve(o,!0).test(a)}const ive=bi.define({map(o,e){return o.map(t=>t.map(e))}}),ave=bi.define(),L1=Uf.define({create(){return Mz.start()},update(o,e){return o.update(e)},provide:o=>[sV.from(o,e=>e.tooltip),is.contentAttributes.from(o,e=>e.attrs)]});function lve(o,e){const t=e.completion.apply||e.completion.label;let s=o.state.field(L1).active.find(a=>a.source==e.source);return s instanceof kD?(typeof t=="string"?o.dispatch(Object.assign(Object.assign({},TPe(o.state,t,s.from,s.to)),{annotations:rve.of(e.completion)})):t(o,e.completion,s.from,s.to),!0):!1}function rH(o,e="option"){return t=>{let s=t.state.field(L1,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<t.state.facet(Qp).interactionDelay)return!1;let a=1,l;e=="page"&&(l=Lbe(t,s.open.tooltip))&&(a=Math.max(2,Math.floor(l.dom.offsetHeight/l.dom.querySelector("li").offsetHeight)-1));let{length:u}=s.open.options,d=s.open.selected>-1?s.open.selected+a*(o?1:-1):o?0:u-1;return d<0?d=e=="page"?0:u-1:d>=u&&(d=e=="page"?u-1:0),t.dispatch({effects:ave.of(d)}),!0}}const QPe=o=>{let e=o.state.field(L1,!1);return o.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<o.state.facet(Qp).interactionDelay?!1:lve(o,e.open.options[e.open.selected])},ZPe=o=>o.state.field(L1,!1)?(o.dispatch({effects:Qre.of(!0)}),!0):!1,HPe=o=>{let e=o.state.field(L1,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(o.dispatch({effects:L6.of(null)}),!0)};class zPe{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Nde=50,VPe=50,WPe=1e3,UPe=kf.fromClass(class{constructor(o){this.view=o,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of o.state.field(L1).active)e.state==1&&this.startQuery(e)}update(o){let e=o.state.field(L1);if(!o.selectionSet&&!o.docChanged&&o.startState.field(L1)==e)return;let t=o.transactions.some(s=>(s.selection||s.docChanged)&&!Mse(s));for(let s=0;s<this.running.length;s++){let a=this.running[s];if(t||a.updates.length+o.transactions.length>VPe&&Date.now()-a.time>WPe){for(let l of a.context.abortListeners)try{l()}catch(u){zb(this.view.state,u)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...o.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(),Nde):-1,this.composing!=0)for(let s of o.transactions)Mse(s)=="input"?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:o}=this.view,e=o.field(L1);for(let t of e.active)t.state==1&&!this.running.some(s=>s.active.source==t.source)&&this.startQuery(t)}startQuery(o){let{state:e}=this.view,t=TC(e),s=new Fre(e,t,o.explicitPos==t),a=new zPe(o,s);this.running.push(a),Promise.resolve(o.source(s)).then(l=>{a.context.aborted||(a.done=l||null,this.scheduleAccept())},l=>{this.view.dispatch({effects:L6.of(null)}),zb(this.view.state,l)})}scheduleAccept(){this.running.every(o=>o.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Nde))}accept(){var o;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Qp);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 u=new kD(a.active.source,a.active.explicitPos,a.done,a.done.from,(o=a.done.to)!==null&&o!==void 0?o:TC(a.updates.length?a.updates[0].startState:this.view.state));for(let d of a.updates)u=u.update(d,t);if(u.hasResult()){e.push(u);continue}}let l=this.view.state.field(L1).active.find(u=>u.source==a.active.source);if(l&&l.state==1)if(a.done==null){let u=new Ip(a.active.source,0);for(let d of a.updates)u=u.update(d,t);u.state!=1&&e.push(u)}else this.startQuery(l)}e.length&&this.view.dispatch({effects:ive.of(e)})}},{eventHandlers:{blur(o){let e=this.view.state.field(L1,!1);if(e&&e.tooltip&&this.view.state.facet(Qp).closeOnBlur){let t=e.open&&Lbe(this.view,e.open.tooltip);(!t||!t.dom.contains(o.relatedTarget))&&this.view.dispatch({effects:L6.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Qre.of(!1)}),20),this.composing=0}}}),cve=is.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"}}});class YPe{constructor(e,t,s,a){this.field=e,this.line=t,this.from=s,this.to=a}}class Zre{constructor(e,t,s){this.field=e,this.from=t,this.to=s}map(e){let t=e.mapPos(this.from,-1,Xh.TrackDel),s=e.mapPos(this.to,1,Xh.TrackDel);return t==null||s==null?null:new Zre(this.field,t,s)}}class Hre{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let s=[],a=[t],l=e.doc.lineAt(t),u=/^\s*/.exec(l.text)[0];for(let h of this.lines){if(s.length){let b=u,y=/^\t*/.exec(h)[0].length;for(let C=0;C<y;C++)b+=e.facet(lI);a.push(t+b.length-y),h=b+h.slice(y)}s.push(h),t+=h.length+1}let d=this.fieldPositions.map(h=>new Zre(h.field,a[h.line]+h.from,a[h.line]+h.to));return{text:s,ranges:d}}static parse(e){let t=[],s=[],a=[],l;for(let u of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(u);){let d=l[1]?+l[1]:null,h=l[2]||l[3]||"",b=-1;for(let y=0;y<t.length;y++)(d!=null?t[y].seq==d:h?t[y].name==h:!1)&&(b=y);if(b<0){let y=0;for(;y<t.length&&(d==null||t[y].seq!=null&&t[y].seq<d);)y++;t.splice(y,0,{seq:d,name:h}),b=y;for(let C of a)C.field>=b&&C.field++}a.push(new YPe(b,s.length,l.index,l.index+h.length)),u=u.slice(0,l.index)+h+u.slice(l.index+l[0].length)}for(let d;d=/\\([{}])/.exec(u);){u=u.slice(0,d.index)+d[1]+u.slice(d.index+d[0].length);for(let h of a)h.line==s.length&&h.from>d.index&&(h.from--,h.to--)}s.push(u)}return new Hre(s,a)}}let XPe=Br.widget({widget:new class extends Gw{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),jPe=Br.mark({class:"cm-snippetField"});class tP{constructor(e,t){this.ranges=e,this.active=t,this.deco=Br.set(e.map(s=>(s.from==s.to?XPe:jPe).range(s.from,s.to)))}map(e){let t=[];for(let s of this.ranges){let a=s.map(e);if(!a)return null;t.push(a)}return new tP(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(s=>s.field==this.active&&s.from<=t.from&&s.to>=t.to))}}const fI=bi.define({map(o,e){return o&&o.map(e)}}),qPe=bi.define(),F6=Uf.define({create(){return null},update(o,e){for(let t of e.effects){if(t.is(fI))return t.value;if(t.is(qPe)&&o)return new tP(o.ranges,t.value)}return o&&e.docChanged&&(o=o.map(e.changes)),o&&e.selection&&!o.selectionInsideField(e.selection)&&(o=null),o},provide:o=>is.decorations.from(o,e=>e?e.deco:Br.none)});function zre(o,e){return Ln.create(o.filter(t=>t.field==e).map(t=>Ln.range(t.from,t.to)))}function GPe(o){let e=Hre.parse(o);return(t,s,a,l)=>{let{text:u,ranges:d}=e.instantiate(t.state,a),h={changes:{from:a,to:l,insert:el.of(u)},scrollIntoView:!0,annotations:s?rve.of(s):void 0};if(d.length&&(h.selection=zre(d,0)),d.length>1){let b=new tP(d,0),y=h.effects=[fI.of(b)];t.state.field(F6,!1)===void 0&&y.push(bi.appendConfig.of([F6,n5e,o5e,cve]))}t.dispatch(t.state.update(h))}}function uve(o){return({state:e,dispatch:t})=>{let s=e.field(F6,!1);if(!s||o<0&&s.active==0)return!1;let a=s.active+o,l=o>0&&!s.ranges.some(u=>u.field==a+o);return t(e.update({selection:zre(s.ranges,a),effects:fI.of(l?null:new tP(s.ranges,a)),scrollIntoView:!0})),!0}}const KPe=({state:o,dispatch:e})=>o.field(F6,!1)?(e(o.update({effects:fI.of(null)})),!0):!1,JPe=uve(1),e5e=uve(-1),t5e=[{key:"Tab",run:JPe,shift:e5e},{key:"Escape",run:KPe}],Ide=As.define({combine(o){return o.length?o[0]:t5e}}),n5e=QC.highest(wE.compute([Ide],o=>o.facet(Ide)));function $p(o,e){return Object.assign(Object.assign({},e),{apply:GPe(o)})}const o5e=is.domEventHandlers({mousedown(o,e){let t=e.state.field(F6,!1),s;if(!t||(s=e.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let a=t.ranges.find(l=>l.from<=s&&l.to>=s);return!a||a.field==t.active?!1:(e.dispatch({selection:zre(t.ranges,a.field),effects:fI.of(t.ranges.some(l=>l.field>a.field)?new tP(t.ranges,a.field):null),scrollIntoView:!0}),!0)}}),Q6={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},aE=bi.define({map(o,e){let t=e.mapPos(o,-1,Xh.TrackAfter);return t==null?void 0:t}}),Vre=new class extends mE{};Vre.startSide=1;Vre.endSide=-1;const fve=Uf.define({create(){return tl.empty},update(o,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)&&(o=tl.empty)}o=o.map(e.changes);for(let t of e.effects)t.is(aE)&&(o=o.update({add:[Vre.range(t.value,t.value+1)]}));return o}});function s5e(){return[i5e,fve]}const jne="()[]{}<>";function dve(o){for(let e=0;e<jne.length;e+=2)if(jne.charCodeAt(e)==o)return jne.charAt(e+1);return fre(o<128?o:o+1)}function hve(o,e){return o.languageDataAt("closeBrackets",e)[0]||Q6}const r5e=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),i5e=is.inputHandler.of((o,e,t,s)=>{if((r5e?o.composing:o.compositionStarted)||o.state.readOnly)return!1;let a=o.state.selection.main;if(s.length>2||s.length==2&&Fb(Uh(s,0))==1||e!=a.from||t!=a.to)return!1;let l=c5e(o.state,s);return l?(o.dispatch(l),!0):!1}),a5e=({state:o,dispatch:e})=>{if(o.readOnly)return!1;let s=hve(o,o.selection.main.head).brackets||Q6.brackets,a=null,l=o.changeByRange(u=>{if(u.empty){let d=u5e(o.doc,u.head);for(let h of s)if(h==d&&hV(o.doc,u.head)==dve(Uh(h,0)))return{changes:{from:u.head-h.length,to:u.head+h.length},range:Ln.cursor(u.head-h.length)}}return{range:a=u}});return a||e(o.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!a},l5e=[{key:"Backspace",run:a5e}];function c5e(o,e){let t=hve(o,o.selection.main.head),s=t.brackets||Q6.brackets;for(let a of s){let l=dve(Uh(a,0));if(e==a)return l==a?h5e(o,a,s.indexOf(a+a+a)>-1,t):f5e(o,a,l,t.before||Q6.before);if(e==l&&mve(o,o.selection.main.from))return d5e(o,a,l)}return null}function mve(o,e){let t=!1;return o.field(fve).between(0,o.doc.length,s=>{s==e&&(t=!0)}),t}function hV(o,e){let t=o.sliceString(e,e+2);return t.slice(0,Fb(Uh(t,0)))}function u5e(o,e){let t=o.sliceString(e-2,e);return Fb(Uh(t,0))==t.length?t:t.slice(1)}function f5e(o,e,t,s){let a=null,l=o.changeByRange(u=>{if(!u.empty)return{changes:[{insert:e,from:u.from},{insert:t,from:u.to}],effects:aE.of(u.to+e.length),range:Ln.range(u.anchor+e.length,u.head+e.length)};let d=hV(o.doc,u.head);return!d||/\s/.test(d)||s.indexOf(d)>-1?{changes:{insert:e+t,from:u.head},effects:aE.of(u.head+e.length),range:Ln.cursor(u.head+e.length)}:{range:a=u}});return a?null:o.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function d5e(o,e,t){let s=null,a=o.changeByRange(l=>l.empty&&hV(o.doc,l.head)==t?{changes:{from:l.head,to:l.head+t.length,insert:t},range:Ln.cursor(l.head+t.length)}:s={range:l});return s?null:o.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function h5e(o,e,t,s){let a=s.stringPrefixes||Q6.stringPrefixes,l=null,u=o.changeByRange(d=>{if(!d.empty)return{changes:[{insert:e,from:d.from},{insert:e,from:d.to}],effects:aE.of(d.to+e.length),range:Ln.range(d.anchor+e.length,d.head+e.length)};let h=d.head,b=hV(o.doc,h),y;if(b==e){if(Bde(o,h))return{changes:{insert:e+e,from:h},effects:aE.of(h+e.length),range:Ln.cursor(h+e.length)};if(mve(o,h)){let E=t&&o.sliceDoc(h,h+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:h,to:h+E.length,insert:E},range:Ln.cursor(h+E.length)}}}else{if(t&&o.sliceDoc(h-2*e.length,h)==e+e&&(y=Lde(o,h-2*e.length,a))>-1&&Bde(o,y))return{changes:{insert:e+e+e+e,from:h},effects:aE.of(h+e.length),range:Ln.cursor(h+e.length)};if(o.charCategorizer(h)(b)!=tu.Word&&Lde(o,h,a)>-1&&!m5e(o,h,e,a))return{changes:{insert:e+e,from:h},effects:aE.of(h+e.length),range:Ln.cursor(h+e.length)}}return{range:l=d}});return l?null:o.update(u,{scrollIntoView:!0,userEvent:"input.type"})}function Bde(o,e){let t=_c(o).resolveInner(e+1);return t.parent&&t.from==e}function m5e(o,e,t,s){let a=_c(o).resolveInner(e,-1),l=s.reduce((u,d)=>Math.max(u,d.length),0);for(let u=0;u<5;u++){let d=o.sliceDoc(a.from,Math.min(a.to,a.from+t.length+l)),h=d.indexOf(t);if(!h||h>-1&&s.indexOf(d.slice(0,h))>-1){let y=a.firstChild;for(;y&&y.from==a.from&&y.to-y.from>t.length+h;){if(o.sliceDoc(y.to-t.length,y.to)==t)return!1;y=y.firstChild}return!0}let b=a.to==e&&a.parent;if(!b)break;a=b}return!1}function Lde(o,e,t){let s=o.charCategorizer(e);if(s(o.sliceDoc(e-1,e))!=tu.Word)return e;for(let a of t){let l=e-a.length;if(o.sliceDoc(l,e)==a&&s(o.sliceDoc(l-1,l))!=tu.Word)return l}return-1}function gve(o={}){return[L1,Qp.of(o),UPe,g5e,cve]}const Wre=[{key:"Ctrl-Space",run:ZPe},{key:"Escape",run:HPe},{key:"ArrowDown",run:rH(!0)},{key:"ArrowUp",run:rH(!1)},{key:"PageDown",run:rH(!0,"page")},{key:"PageUp",run:rH(!1,"page")},{key:"Enter",run:QPe}],g5e=QC.highest(wE.computeN([Qp],o=>o.facet(Qp).defaultKeymap?[Wre]:[]));class p5e{constructor(e,t,s){this.from=e,this.to=t,this.diagnostic=s}}class oE{constructor(e,t,s){this.diagnostics=e,this.panel=t,this.selected=s}static init(e,t,s){let a=e,l=s.facet(lE).markerFilter;l&&(a=l(a));let u=Br.set(a.map(d=>d.from==d.to||d.from==d.to-1&&s.doc.lineAt(d.from).to==d.from?Br.widget({widget:new C5e(d),diagnostic:d}).range(d.from):Br.mark({attributes:{class:"cm-lintRange cm-lintRange-"+d.severity+(d.markClass?" "+d.markClass:"")},diagnostic:d}).range(d.from,d.to)),!0);return new oE(u,t,ID(u))}}function ID(o,e=null,t=0){let s=null;return o.between(t,1e9,(a,l,{spec:u})=>{if(!(e&&u.diagnostic!=e))return s=new p5e(a,l,u.diagnostic),!1}),s}function pve(o,e){let t=o.startState.doc.lineAt(e.pos);return!!(o.effects.some(s=>s.is(mV))||o.changes.touchesRange(t.from,t.to))}function bve(o,e){return o.field(Z1,!1)?e:e.concat(bi.appendConfig.of(kve))}function b5e(o,e){return{effects:bve(o,[mV.of(e)])}}const mV=bi.define(),Ure=bi.define(),vve=bi.define(),Z1=Uf.define({create(){return new oE(Br.none,null,null)},update(o,e){if(e.docChanged){let t=o.diagnostics.map(e.changes),s=null;if(o.selected){let a=e.changes.mapPos(o.selected.from,1);s=ID(t,o.selected.diagnostic,a)||ID(t,null,a)}o=new oE(t,o.panel,s)}for(let t of e.effects)t.is(mV)?o=oE.init(t.value,o.panel,e.state):t.is(Ure)?o=new oE(o.diagnostics,t.value?gV.open:null,o.selected):t.is(vve)&&(o=new oE(o.diagnostics,o.panel,t.value));return o},provide:o=>[M6.from(o,e=>e.panel),is.decorations.from(o,e=>e.diagnostics)]}),v5e=Br.mark({class:"cm-lintRange cm-lintRange-active"});function O5e(o,e,t){let{diagnostics:s}=o.state.field(Z1),a=[],l=2e8,u=0;s.between(e-(t<0?1:0),e+(t>0?1:0),(h,b,{spec:y})=>{e>=h&&e<=b&&(h==b||(e>h||t>0)&&(e<b||t<0))&&(a.push(y.diagnostic),l=Math.min(h,l),u=Math.max(b,u))});let d=o.state.facet(lE).tooltipFilter;return d&&(a=d(a)),a.length?{pos:l,end:u,above:o.state.doc.lineAt(l).to<u,create(){return{dom:Ove(o,a)}}}:null}function Ove(o,e){return yc("ul",{class:"cm-tooltip-lint"},e.map(t=>_ve(o,t,!1)))}const y5e=o=>{let e=o.state.field(Z1,!1);(!e||!e.panel)&&o.dispatch({effects:bve(o.state,[Ure.of(!0)])});let t=P6(o,gV.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Fde=o=>{let e=o.state.field(Z1,!1);return!e||!e.panel?!1:(o.dispatch({effects:Ure.of(!1)}),!0)},w5e=o=>{let e=o.state.field(Z1,!1);if(!e)return!1;let t=o.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:(o.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0)},yve=[{key:"Mod-Shift-m",run:y5e,preventDefault:!0},{key:"F8",run:w5e}],_5e=kf.fromClass(class{constructor(o){this.view=o,this.timeout=-1,this.set=!0;let{delay:e}=o.state.facet(lE);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let o=Date.now();if(o<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-o);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(lE);Promise.all(t.map(s=>Promise.resolve(s(this.view)))).then(s=>{let a=s.reduce((l,u)=>l.concat(u));this.view.state.doc==e.doc&&this.view.dispatch(b5e(this.view.state,a))},s=>{zb(this.view.state,s)})}}update(o){let e=o.state.facet(lE);(o.docChanged||e!=o.startState.facet(lE)||e.needsRefresh&&e.needsRefresh(o))&&(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)}}),lE=As.define({combine(o){return Object.assign({sources:o.map(e=>e.source)},Tv(o.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 S5e(o,e={}){return[lE.of({source:o,config:e}),_5e,kve]}function wve(o){let e=[];if(o)e:for(let{name:t}of o){for(let s=0;s<t.length;s++){let a=t[s];if(/[a-zA-Z]/.test(a)&&!e.some(l=>l.toLowerCase()==a.toLowerCase())){e.push(a);continue e}}e.push("")}return e}function _ve(o,e,t){var s;let a=t?wve(e.actions):[];return yc("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},yc("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(s=e.actions)===null||s===void 0?void 0:s.map((l,u)=>{let d=!1,h=E=>{if(E.preventDefault(),d)return;d=!0;let R=ID(o.state.field(Z1).diagnostics,e);R&&l.apply(o,R.from,R.to)},{name:b}=l,y=a[u]?b.indexOf(a[u]):-1,C=y<0?b:[b.slice(0,y),yc("u",b.slice(y,y+1)),b.slice(y+1)];return yc("button",{type:"button",class:"cm-diagnosticAction",onclick:h,onmousedown:h,"aria-label":` Action: ${b}${y<0?"":` (access key "${a[u]})"`}.`},C)}),e.source&&yc("div",{class:"cm-diagnosticSource"},e.source))}class C5e extends Gw{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return yc("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Qde{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=_ve(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class gV{constructor(e){this.view=e,this.items=[];let t=a=>{if(a.keyCode==27)Fde(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:l}=this.items[this.selectedIndex],u=wve(l.actions);for(let d=0;d<u.length;d++)if(u[d].toUpperCase().charCodeAt(0)==a.keyCode){let h=ID(this.view.state.field(Z1).diagnostics,l);h&&l.actions[d].apply(e,h.from,h.to)}}else return;a.preventDefault()},s=a=>{for(let l=0;l<this.items.length;l++)this.items[l].dom.contains(a.target)&&this.moveSelection(l)};this.list=yc("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:s}),this.dom=yc("div",{class:"cm-panel-lint"},this.list,yc("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Fde(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Z1).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(Z1),s=0,a=!1,l=null;for(e.between(0,this.view.state.doc.length,(u,d,{spec:h})=>{let b=-1,y;for(let C=s;C<this.items.length;C++)if(this.items[C].diagnostic==h.diagnostic){b=C;break}b<0?(y=new Qde(this.view,h.diagnostic),this.items.splice(s,0,y),a=!0):(y=this.items[b],b>s&&(this.items.splice(s,b-s),a=!0)),t&&y.diagnostic==t.diagnostic?y.dom.hasAttribute("aria-selected")||(y.dom.setAttribute("aria-selected","true"),l=y):y.dom.hasAttribute("aria-selected")&&y.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 Qde(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),a=!0),l?(this.list.setAttribute("aria-activedescendant",l.id),this.view.requestMeasure({key:this,read:()=>({sel:l.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:u,panel:d})=>{let h=d.height/this.list.offsetHeight;u.top<d.top?this.list.scrollTop-=(d.top-u.top)/h:u.bottom>d.bottom&&(this.list.scrollTop+=(u.bottom-d.bottom)/h)}})):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(Z1),s=ID(t.diagnostics,this.items[e].diagnostic);!s||this.view.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:vve.of(s)})}static open(e){return new gV(e)}}function QH(o,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(o)}</svg>')`}function iH(o){return QH(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${o}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const k5e=is.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:iH("#d11")},".cm-lintRange-warning":{backgroundImage:iH("orange")},".cm-lintRange-info":{backgroundImage:iH("#999")},".cm-lintRange-hint":{backgroundImage:iH("#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 Zde(o){return o=="error"?4:o=="warning"?3:o=="info"?2:1}class x5e extends wy{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,s)=>Zde(t)<Zde(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(pV).tooltipFilter;return a&&(s=a(s)),s.length&&(t.onmouseover=()=>E5e(e,t,s)),t}}function T5e(o,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 l=s.target;l;l=l.parentNode)if(l.nodeType==1&&l.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",t),o.state.field(Cve)&&o.dispatch({effects:Yre.of(null)})}};window.addEventListener("mousemove",t)}function E5e(o,e,t){function s(){let u=o.elementAtHeight(e.getBoundingClientRect().top+5-o.documentTop);o.coordsAtPos(u.from)&&o.dispatch({effects:Yre.of({pos:u.from,above:!1,create(){return{dom:Ove(o,t),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,T5e(o,e)}let{hoverTime:a}=o.state.facet(pV),l=setTimeout(s,a);e.onmouseout=()=>{clearTimeout(l),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(l),l=setTimeout(s,a)}}function A5e(o,e){let t=Object.create(null);for(let a of e){let l=o.lineAt(a.from);(t[l.from]||(t[l.from]=[])).push(a)}let s=[];for(let a in t)s.push(new x5e(t[a]).range(+a));return tl.of(s,!0)}const D5e=Qbe({class:"cm-gutter-lint",markers:o=>o.state.field(Sve)}),Sve=Uf.define({create(){return tl.empty},update(o,e){o=o.map(e.changes);let t=e.state.facet(pV).markerFilter;for(let s of e.effects)if(s.is(mV)){let a=s.value;t&&(a=t(a||[])),o=A5e(e.state.doc,a.slice(0))}return o}}),Yre=bi.define(),Cve=Uf.define({create(){return null},update(o,e){return o&&e.docChanged&&(o=pve(e,o)?null:Object.assign(Object.assign({},o),{pos:e.changes.mapPos(o.pos)})),e.effects.reduce((t,s)=>s.is(Yre)?s.value:t,o)},provide:o=>sV.from(o)}),P5e=is.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:QH('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:QH('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:QH('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),kve=[Z1,is.decorations.compute([Z1],o=>{let{selected:e,panel:t}=o.field(Z1);return!e||!t||e.from==e.to?Br.none:Br.set([v5e.range(e.from,e.to)])}),_Ae(O5e,{hideOn:pve}),k5e],pV=As.define({combine(o){return Tv(o,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function M5e(o={}){return[pV.of(o),Sve,D5e,P5e,Cve]}const Rz=(()=>[DAe(),RAe(),eAe(),J4e(),k4e(),z3e(),X3e(),ra.allowMultipleSelections.of(!0),h4e(),T4e(D4e,{fallback:!0}),B4e(),s5e(),gve(),dAe(),gAe(),iAe(),nPe(),wE.of([...l5e,...GDe,...wPe,...lDe,...w4e,...Wre,...yve])])();class $z{static create(e,t,s,a,l){let u=a+(a<<8)+e+(t<<4)|0;return new $z(e,t,s,u,l,[],[])}constructor(e,t,s,a,l,u,d){this.type=e,this.value=t,this.from=s,this.hash=a,this.end=l,this.children=u,this.positions=d,this.hashProp=[[ui.contextHash,a]]}addChild(e,t){e.prop(ui.contextHash)!=this.hash&&(e=new Cl(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let s=this.children.length-1;return s>=0&&(t=Math.max(t,this.positions[s]+this.children[s].length+this.from)),new Cl(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(a,l,u)=>new Cl(Sd.none,a,l,u,this.hashProp)})}}var Bo;(function(o){o[o.Document=1]="Document",o[o.CodeBlock=2]="CodeBlock",o[o.FencedCode=3]="FencedCode",o[o.Blockquote=4]="Blockquote",o[o.HorizontalRule=5]="HorizontalRule",o[o.BulletList=6]="BulletList",o[o.OrderedList=7]="OrderedList",o[o.ListItem=8]="ListItem",o[o.ATXHeading1=9]="ATXHeading1",o[o.ATXHeading2=10]="ATXHeading2",o[o.ATXHeading3=11]="ATXHeading3",o[o.ATXHeading4=12]="ATXHeading4",o[o.ATXHeading5=13]="ATXHeading5",o[o.ATXHeading6=14]="ATXHeading6",o[o.SetextHeading1=15]="SetextHeading1",o[o.SetextHeading2=16]="SetextHeading2",o[o.HTMLBlock=17]="HTMLBlock",o[o.LinkReference=18]="LinkReference",o[o.Paragraph=19]="Paragraph",o[o.CommentBlock=20]="CommentBlock",o[o.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",o[o.Escape=22]="Escape",o[o.Entity=23]="Entity",o[o.HardBreak=24]="HardBreak",o[o.Emphasis=25]="Emphasis",o[o.StrongEmphasis=26]="StrongEmphasis",o[o.Link=27]="Link",o[o.Image=28]="Image",o[o.InlineCode=29]="InlineCode",o[o.HTMLTag=30]="HTMLTag",o[o.Comment=31]="Comment",o[o.ProcessingInstruction=32]="ProcessingInstruction",o[o.URL=33]="URL",o[o.HeaderMark=34]="HeaderMark",o[o.QuoteMark=35]="QuoteMark",o[o.ListMark=36]="ListMark",o[o.LinkMark=37]="LinkMark",o[o.EmphasisMark=38]="EmphasisMark",o[o.CodeMark=39]="CodeMark",o[o.CodeText=40]="CodeText",o[o.CodeInfo=41]="CodeInfo",o[o.LinkTitle=42]="LinkTitle",o[o.LinkLabel=43]="LinkLabel"})(Bo||(Bo={}));class R5e{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class $5e{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return g6(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,s=0){for(let a=t;a<e;a++)s+=this.text.charCodeAt(a)==9?4-s%4:1;return s}findColumn(e){let t=0;for(let s=0;t<this.text.length&&s<e;t++)s+=this.text.charCodeAt(t)==9?4-s%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function Hde(o,e,t){if(t.pos==t.text.length||o!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let s=(o.type==Bo.OrderedList?qre:jre)(t,e,!1);return s>0&&(o.type!=Bo.BulletList||Xre(t,e,!1)<0)&&t.text.charCodeAt(t.pos+s-1)==o.value}const xve={[Bo.Blockquote](o,e,t){return t.next!=62?!1:(t.markers.push(ml(Bo.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(qb(t.text.charCodeAt(t.pos+1))?2:1)),o.end=e.lineStart+t.text.length,!0)},[Bo.ListItem](o,e,t){return t.indent<t.baseIndent+o.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+o.value),!0)},[Bo.OrderedList]:Hde,[Bo.BulletList]:Hde,[Bo.Document](){return!0}};function qb(o){return o==32||o==9||o==10||o==13}function g6(o,e=0){for(;e<o.length&&qb(o.charCodeAt(e));)e++;return e}function zde(o,e,t){for(;e>t&&qb(o.charCodeAt(e-1));)e--;return e}function Tve(o){if(o.next!=96&&o.next!=126)return-1;let e=o.pos+1;for(;e<o.text.length&&o.text.charCodeAt(e)==o.next;)e++;if(e<o.pos+3)return-1;if(o.next==96){for(let t=e;t<o.text.length;t++)if(o.text.charCodeAt(t)==96)return-1}return e}function Eve(o){return o.next!=62?-1:o.text.charCodeAt(o.pos+1)==32?2:1}function Xre(o,e,t){if(o.next!=42&&o.next!=45&&o.next!=95)return-1;let s=1;for(let a=o.pos+1;a<o.text.length;a++){let l=o.text.charCodeAt(a);if(l==o.next)s++;else if(!qb(l))return-1}return t&&o.next==45&&Pve(o)>-1&&o.depth==e.stack.length||s<3?-1:1}function Ave(o,e){for(let t=o.stack.length-1;t>=0;t--)if(o.stack[t].type==e)return!0;return!1}function jre(o,e,t){return(o.next==45||o.next==43||o.next==42)&&(o.pos==o.text.length-1||qb(o.text.charCodeAt(o.pos+1)))&&(!t||Ave(e,Bo.BulletList)||o.skipSpace(o.pos+2)<o.text.length)?1:-1}function qre(o,e,t){let s=o.pos,a=o.next;for(;a>=48&&a<=57;){s++;if(s==o.text.length)return-1;a=o.text.charCodeAt(s)}return s==o.pos||s>o.pos+9||a!=46&&a!=41||s<o.text.length-1&&!qb(o.text.charCodeAt(s+1))||t&&!Ave(e,Bo.OrderedList)&&(o.skipSpace(s+1)==o.text.length||s>o.pos+1||o.next!=49)?-1:s+1-o.pos}function Dve(o){if(o.next!=35)return-1;let e=o.pos+1;for(;e<o.text.length&&o.text.charCodeAt(e)==35;)e++;if(e<o.text.length&&o.text.charCodeAt(e)!=32)return-1;let t=e-o.pos;return t>6?-1:t}function Pve(o){if(o.next!=45&&o.next!=61||o.indent>=o.baseIndent+4)return-1;let e=o.pos+1;for(;e<o.text.length&&o.text.charCodeAt(e)==o.next;)e++;let t=e;for(;e<o.text.length&&qb(o.text.charCodeAt(e));)e++;return e==o.text.length?t:-1}const Rse=/^[ \t]*$/,Mve=/-->/,Rve=/\?>/,$se=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Mve],[/^\s*<\?/,Rve],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Rse],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Rse]];function $ve(o,e,t){if(o.next!=60)return-1;let s=o.text.slice(o.pos);for(let a=0,l=$se.length-(t?1:0);a<l;a++)if($se[a][0].test(s))return a;return-1}function Vde(o,e){let t=o.countIndent(e,o.pos,o.indent),s=o.countIndent(o.skipSpace(e),e,t);return s>=t+5?t+1:s}function JT(o,e,t){let s=o.length-1;s>=0&&o[s].to==e&&o[s].type==Bo.CodeText?o[s].to=t:o.push(ml(Bo.CodeText,e,t))}const aH={LinkReference:void 0,IndentedCode(o,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let s=e.findColumn(t),a=o.lineStart+s,l=o.lineStart+e.text.length,u=[],d=[];for(JT(u,a,l);o.nextLine()&&e.depth>=o.stack.length;)if(e.pos==e.text.length){JT(d,o.lineStart-1,o.lineStart);for(let h of e.markers)d.push(h)}else{if(e.indent<t)break;{if(d.length){for(let b of d)b.type==Bo.CodeText?JT(u,b.from,b.to):u.push(b);d=[]}JT(u,o.lineStart-1,o.lineStart);for(let b of e.markers)u.push(b);l=o.lineStart+e.text.length;let h=o.lineStart+e.findColumn(e.baseIndent+4);h<l&&JT(u,h,l)}}return d.length&&(d=d.filter(h=>h.type!=Bo.CodeText),d.length&&(e.markers=d.concat(e.markers))),o.addNode(o.buffer.writeElements(u,-a).finish(Bo.CodeBlock,l-a),a),!0},FencedCode(o,e){let t=Tve(e);if(t<0)return!1;let s=o.lineStart+e.pos,a=e.next,l=t-e.pos,u=e.skipSpace(t),d=zde(e.text,e.text.length,u),h=[ml(Bo.CodeMark,s,s+l)];u<d&&h.push(ml(Bo.CodeInfo,o.lineStart+u,o.lineStart+d));for(let b=!0;o.nextLine()&&e.depth>=o.stack.length;b=!1){let y=e.pos;if(e.indent-e.baseIndent<4)for(;y<e.text.length&&e.text.charCodeAt(y)==a;)y++;if(y-e.pos>=l&&e.skipSpace(y)==e.text.length){for(let C of e.markers)h.push(C);h.push(ml(Bo.CodeMark,o.lineStart+e.pos,o.lineStart+y)),o.nextLine();break}else{b||JT(h,o.lineStart-1,o.lineStart);for(let R of e.markers)h.push(R);let C=o.lineStart+e.basePos,E=o.lineStart+e.text.length;C<E&&JT(h,C,E)}}return o.addNode(o.buffer.writeElements(h,-s).finish(Bo.FencedCode,o.prevLineEnd()-s),s),!0},Blockquote(o,e){let t=Eve(e);return t<0?!1:(o.startContext(Bo.Blockquote,e.pos),o.addNode(Bo.QuoteMark,o.lineStart+e.pos,o.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(o,e){if(Xre(e,o,!1)<0)return!1;let t=o.lineStart+e.pos;return o.nextLine(),o.addNode(Bo.HorizontalRule,t),!0},BulletList(o,e){let t=jre(e,o,!1);if(t<0)return!1;o.block.type!=Bo.BulletList&&o.startContext(Bo.BulletList,e.basePos,e.next);let s=Vde(e,e.pos+1);return o.startContext(Bo.ListItem,e.basePos,s-e.baseIndent),o.addNode(Bo.ListMark,o.lineStart+e.pos,o.lineStart+e.pos+t),e.moveBaseColumn(s),null},OrderedList(o,e){let t=qre(e,o,!1);if(t<0)return!1;o.block.type!=Bo.OrderedList&&o.startContext(Bo.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let s=Vde(e,e.pos+t);return o.startContext(Bo.ListItem,e.basePos,s-e.baseIndent),o.addNode(Bo.ListMark,o.lineStart+e.pos,o.lineStart+e.pos+t),e.moveBaseColumn(s),null},ATXHeading(o,e){let t=Dve(e);if(t<0)return!1;let s=e.pos,a=o.lineStart+s,l=zde(e.text,e.text.length,s),u=l;for(;u>s&&e.text.charCodeAt(u-1)==e.next;)u--;(u==l||u==s||!qb(e.text.charCodeAt(u-1)))&&(u=e.text.length);let d=o.buffer.write(Bo.HeaderMark,0,t).writeElements(o.parser.parseInline(e.text.slice(s+t+1,u),a+t+1),-a);u<e.text.length&&d.write(Bo.HeaderMark,u-s,l-s);let h=d.finish(Bo.ATXHeading1-1+t,e.text.length-s);return o.nextLine(),o.addNode(h,a),!0},HTMLBlock(o,e){let t=$ve(e,o,!1);if(t<0)return!1;let s=o.lineStart+e.pos,a=$se[t][1],l=[],u=a!=Rse;for(;!a.test(e.text)&&o.nextLine();){if(e.depth<o.stack.length){u=!1;break}for(let b of e.markers)l.push(b)}u&&o.nextLine();let d=a==Mve?Bo.CommentBlock:a==Rve?Bo.ProcessingInstructionBlock:Bo.HTMLBlock,h=o.prevLineEnd();return o.addNode(o.buffer.writeElements(l,-s).finish(d,h-s),s),!0},SetextHeading:void 0};class N5e{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,s){if(this.stage==-1)return!1;let a=s.content+`
|
|
`+t.scrub(),l=this.advance(a);return l>-1&&l<a.length?this.complete(e,s,l):!1}finish(e,t){return(this.stage==2||this.stage==3)&&g6(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,s){return e.addLeafElement(t,ml(Bo.LinkReference,this.start,this.start+s,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(zve(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ml(Bo.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Zve(e,g6(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=g6(e,this.pos),s=0;if(t>this.pos){let a=Hve(e,t,this.start);if(a){let l=qne(e,a.to-this.start);l>0&&(this.nextStage(a),s=l)}}return s||(s=qne(e,this.pos)),s>0&&s<e.length?s:-1}else return qne(e,this.pos)}}}function qne(o,e){for(;e<o.length;e++){let t=o.charCodeAt(e);if(t==10)break;if(!qb(t))return-1}return e}class I5e{nextLine(e,t,s){let a=t.depth<e.stack.length?-1:Pve(t),l=t.next;if(a<0)return!1;let u=ml(Bo.HeaderMark,e.lineStart+t.pos,e.lineStart+a);return e.nextLine(),e.addLeafElement(s,ml(l==61?Bo.SetextHeading1:Bo.SetextHeading2,s.start,e.prevLineEnd(),[...e.parser.parseInline(s.content,s.start),u])),!0}finish(){return!1}}const B5e={LinkReference(o,e){return e.content.charCodeAt(0)==91?new N5e(e):null},SetextHeading(){return new I5e}},L5e=[(o,e)=>Dve(e)>=0,(o,e)=>Tve(e)>=0,(o,e)=>Eve(e)>=0,(o,e)=>jre(e,o,!0)>=0,(o,e)=>qre(e,o,!0)>=0,(o,e)=>Xre(e,o,!0)>=0,(o,e)=>$ve(e,o,!0)>=0],F5e={text:"",end:0};class Q5e{constructor(e,t,s,a){this.parser=e,this.input=t,this.ranges=a,this.line=new $5e,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=a[a.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=a[0].from,this.block=$z.create(Bo.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=s.length?new V5e(s,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(;e.depth<this.stack.length;)this.finishContext();for(let s of e.markers)this.addNode(s.type,s.from,s.to);if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let s of this.parser.blockParsers)if(s){let a=s(this,e);if(a!=!1){if(a==!0)return null;e.forward();continue e}}break}let t=new R5e(this.lineStart+e.pos,e.text.slice(e.pos));for(let s of this.parser.leafBlockParsers)if(s){let a=s(this,t);a&&t.parsers.push(a)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let s of this.parser.endLeafBlock)if(s(this,e,t))break e}for(let s of t.parsers)if(s.nextLine(this,e,t))return null;t.content+=`
|
|
`+e.scrub();for(let s of e.markers)t.marks.push(s)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Vve(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=F5e;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let s=this.absoluteLineStart,a=this.rangeI;for(;this.ranges[a].to<t.end;){a++;let l=this.ranges[a].from,u=this.lineChunkAt(l);t.end=l+u.length,t.text=t.text.slice(0,this.ranges[a-1].to-s)+u,s=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:s}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=s,e.reset(t);e.depth<this.stack.length;e.depth++){let a=this.stack[e.depth],l=this.parser.skipContextMarkup[a.type];if(!l)throw new Error("Unhandled block context "+Bo[a.type]);if(!l(a,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),s;if(this.input.lineChunks)s=t==`
|
|
`?"":t;else{let a=t.indexOf(`
|
|
`);s=a<0?t:t.slice(0,a)}return e+s.length>this.to?s.slice(0,this.to-e):s}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,s=0){this.block=$z.create(e,s,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,s=0){this.startContext(this.parser.getNodeType(e),t,s)}addNode(e,t,s){typeof e=="number"&&(e=new Cl(this.parser.nodeSet.types[e],BD,BD,(s!=null?s:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(Ise(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Nve(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let s of e.parsers)if(s.finish(this,e))return;let t=Ise(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Bo.Paragraph,e.content.length),e.start)}elt(e,t,s,a){return typeof e=="string"?ml(this.parser.getNodeType(e),t,s,a):new Lve(e,t)}get buffer(){return new Bve(this.parser.nodeSet)}}function Nve(o,e,t,s,a){let l=o[e].to,u=[],d=[],h=t.from+s;function b(y,C){for(;C?y>=l:y>l;){let E=o[e+1].from-l;s+=E,y+=E,e++,l=o[e].to}}for(let y=t.firstChild;y;y=y.nextSibling){b(y.from+s,!0);let C=y.from+s,E,R=a.get(y.tree);R?E=R:y.to+s>l?(E=Nve(o,e,y,s,a),b(y.to+s,!1)):E=y.toTree(),u.push(E),d.push(C-h)}return b(t.to+s,!1),new Cl(t.type,u,d,t.to+s-h,t.tree?t.tree.propValues:void 0)}class bV extends kre{constructor(e,t,s,a,l,u,d,h,b){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=s,this.blockNames=a,this.endLeafBlock=l,this.skipContextMarkup=u,this.inlineParsers=d,this.inlineNames=h,this.wrappers=b,this.nodeTypes=Object.create(null);for(let y of e.types)this.nodeTypes[y.name]=y.id}createParse(e,t,s){let a=new Q5e(this,e,t,s);for(let l of this.wrappers)a=l(a,e,t,s);return a}configure(e){let t=Nse(e);if(!t)return this;let{nodeSet:s,skipContextMarkup:a}=this,l=this.blockParsers.slice(),u=this.leafBlockParsers.slice(),d=this.blockNames.slice(),h=this.inlineParsers.slice(),b=this.inlineNames.slice(),y=this.endLeafBlock.slice(),C=this.wrappers;if(VN(t.defineNodes)){a=Object.assign({},a);let E=s.types.slice(),R;for(let $ of t.defineNodes){let{name:Q,block:F,composite:U,style:K}=typeof $=="string"?{name:$}:$;if(E.some(ne=>ne.name==Q))continue;U&&(a[E.length]=(ne,oe,G)=>U(oe,G,ne.value));let L=E.length,te=U?["Block","BlockContext"]:F?L>=Bo.ATXHeading1&&L<=Bo.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;E.push(Sd.define({id:L,name:Q,props:te&&[[ui.group,te]]})),K&&(R||(R={}),Array.isArray(K)||K instanceof _v?R[Q]=K:Object.assign(R,K))}s=new aI(E),R&&(s=s.extend(SE(R)))}if(VN(t.props)&&(s=s.extend(...t.props)),VN(t.remove))for(let E of t.remove){let R=this.blockNames.indexOf(E),$=this.inlineNames.indexOf(E);R>-1&&(l[R]=u[R]=void 0),$>-1&&(h[$]=void 0)}if(VN(t.parseBlock))for(let E of t.parseBlock){let R=d.indexOf(E.name);if(R>-1)l[R]=E.parse,u[R]=E.leaf;else{let $=E.before?lH(d,E.before):E.after?lH(d,E.after)+1:d.length-1;l.splice($,0,E.parse),u.splice($,0,E.leaf),d.splice($,0,E.name)}E.endLeaf&&y.push(E.endLeaf)}if(VN(t.parseInline))for(let E of t.parseInline){let R=b.indexOf(E.name);if(R>-1)h[R]=E.parse;else{let $=E.before?lH(b,E.before):E.after?lH(b,E.after)+1:b.length-1;h.splice($,0,E.parse),b.splice($,0,E.name)}}return t.wrap&&(C=C.concat(t.wrap)),new bV(s,l,u,d,y,a,h,b,C)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let s=new H5e(this,e,t);e:for(let a=t;a<s.end;){let l=s.char(a);for(let u of this.inlineParsers)if(u){let d=u(s,l,a);if(d>=0){a=d;continue e}}a++}return s.resolveMarkers(0)}}function VN(o){return o!=null&&o.length>0}function Nse(o){if(!Array.isArray(o))return o;if(o.length==0)return null;let e=Nse(o[0]);if(o.length==1)return e;let t=Nse(o.slice(1));if(!t||!e)return e||t;let s=(u,d)=>(u||BD).concat(d||BD),a=e.wrap,l=t.wrap;return{props:s(e.props,t.props),defineNodes:s(e.defineNodes,t.defineNodes),parseBlock:s(e.parseBlock,t.parseBlock),parseInline:s(e.parseInline,t.parseInline),remove:s(e.remove,t.remove),wrap:a?l?(u,d,h,b)=>a(l(u,d,h,b),d,h,b):a:l}}function lH(o,e){let t=o.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let Ive=[Sd.none];for(let o=1,e;e=Bo[o];o++)Ive[o]=Sd.define({id:o,name:e,props:o>=Bo.Escape?[]:[[ui.group,o in xve?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const BD=[];class Bve{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,s,a=0){return this.content.push(e,t,s,4+a*4),this}writeElements(e,t=0){for(let s of e)s.writeTo(this,t);return this}finish(e,t){return Cl.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}class Z6{constructor(e,t,s,a=BD){this.type=e,this.from=t,this.to=s,this.children=a}writeTo(e,t){let s=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-s)}toTree(e){return new Bve(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class Lve{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return BD}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function ml(o,e,t,s){return new Z6(o,e,t,s)}const Fve={resolve:"Emphasis",mark:"EmphasisMark"},Qve={resolve:"Emphasis",mark:"EmphasisMark"},WN={},Wde={};class Sv{constructor(e,t,s,a){this.type=e,this.from=t,this.to=s,this.side=a}}const Ude="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let H6=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H6=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch{}const Gne={Escape(o,e,t){if(e!=92||t==o.end-1)return-1;let s=o.char(t+1);for(let a=0;a<Ude.length;a++)if(Ude.charCodeAt(a)==s)return o.append(ml(Bo.Escape,t,t+2));return-1},Entity(o,e,t){if(e!=38)return-1;let s=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(o.slice(t+1,t+31));return s?o.append(ml(Bo.Entity,t,t+1+s[0].length)):-1},InlineCode(o,e,t){if(e!=96||t&&o.char(t-1)==96)return-1;let s=t+1;for(;s<o.end&&o.char(s)==96;)s++;let a=s-t,l=0;for(;s<o.end;s++)if(o.char(s)==96){if(l++,l==a&&o.char(s+1)!=96)return o.append(ml(Bo.InlineCode,t,s+1,[ml(Bo.CodeMark,t,t+a),ml(Bo.CodeMark,s+1-a,s+1)]))}else l=0;return-1},HTMLTag(o,e,t){if(e!=60||t==o.end-1)return-1;let s=o.slice(t+1,o.end),a=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(s);if(a)return o.append(ml(Bo.URL,t,t+1+a[0].length));let l=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);if(l)return o.append(ml(Bo.Comment,t,t+1+l[0].length));let u=/^\?[^]*?\?>/.exec(s);if(u)return o.append(ml(Bo.ProcessingInstruction,t,t+1+u[0].length));let d=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return d?o.append(ml(Bo.HTMLTag,t,t+1+d[0].length)):-1},Emphasis(o,e,t){if(e!=95&&e!=42)return-1;let s=t+1;for(;o.char(s)==e;)s++;let a=o.slice(t-1,t),l=o.slice(s,s+1),u=H6.test(a),d=H6.test(l),h=/\s|^$/.test(a),b=/\s|^$/.test(l),y=!b&&(!d||h||u),C=!h&&(!u||b||d),E=y&&(e==42||!C||u),R=C&&(e==42||!y||d);return o.append(new Sv(e==95?Fve:Qve,t,s,(E?1:0)|(R?2:0)))},HardBreak(o,e,t){if(e==92&&o.char(t+1)==10)return o.append(ml(Bo.HardBreak,t,t+2));if(e==32){let s=t+1;for(;o.char(s)==32;)s++;if(o.char(s)==10&&s>=t+2)return o.append(ml(Bo.HardBreak,t,s+1))}return-1},Link(o,e,t){return e==91?o.append(new Sv(WN,t,t+1,1)):-1},Image(o,e,t){return e==33&&o.char(t+1)==91?o.append(new Sv(Wde,t,t+2,1)):-1},LinkEnd(o,e,t){if(e!=93)return-1;for(let s=o.parts.length-1;s>=0;s--){let a=o.parts[s];if(a instanceof Sv&&(a.type==WN||a.type==Wde)){if(!a.side||o.skipSpace(a.to)==t&&!/[(\[]/.test(o.slice(t+1,t+2)))return o.parts[s]=null,-1;let l=o.takeContent(s),u=o.parts[s]=Z5e(o,l,a.type==WN?Bo.Link:Bo.Image,a.from,t+1);if(a.type==WN)for(let d=0;d<s;d++){let h=o.parts[d];h instanceof Sv&&h.type==WN&&(h.side=0)}return u.to}}return-1}};function Z5e(o,e,t,s,a){let{text:l}=o,u=o.char(a),d=a;if(e.unshift(ml(Bo.LinkMark,s,s+(t==Bo.Image?2:1))),e.push(ml(Bo.LinkMark,a-1,a)),u==40){let h=o.skipSpace(a+1),b=Zve(l,h-o.offset,o.offset),y;b&&(h=o.skipSpace(b.to),y=Hve(l,h-o.offset,o.offset),y&&(h=o.skipSpace(y.to))),o.char(h)==41&&(e.push(ml(Bo.LinkMark,a,a+1)),d=h+1,b&&e.push(b),y&&e.push(y),e.push(ml(Bo.LinkMark,h,d)))}else if(u==91){let h=zve(l,a-o.offset,o.offset,!1);h&&(e.push(h),d=h.to)}return ml(t,s,d,e)}function Zve(o,e,t){if(o.charCodeAt(e)==60){for(let a=e+1;a<o.length;a++){let l=o.charCodeAt(a);if(l==62)return ml(Bo.URL,e+t,a+1+t);if(l==60||l==10)return!1}return null}else{let a=0,l=e;for(let u=!1;l<o.length;l++){let d=o.charCodeAt(l);if(qb(d))break;if(u)u=!1;else if(d==40)a++;else if(d==41){if(!a)break;a--}else d==92&&(u=!0)}return l>e?ml(Bo.URL,e+t,l+t):l==o.length?null:!1}}function Hve(o,e,t){let s=o.charCodeAt(e);if(s!=39&&s!=34&&s!=40)return!1;let a=s==40?41:s;for(let l=e+1,u=!1;l<o.length;l++){let d=o.charCodeAt(l);if(u)u=!1;else{if(d==a)return ml(Bo.LinkTitle,e+t,l+1+t);d==92&&(u=!0)}}return null}function zve(o,e,t,s){for(let a=!1,l=e+1,u=Math.min(o.length,l+999);l<u;l++){let d=o.charCodeAt(l);if(a)a=!1;else{if(d==93)return s?!1:ml(Bo.LinkLabel,e+t,l+1+t);if(s&&!qb(d)&&(s=!1),d==91)return!1;d==92&&(a=!0)}}return null}class H5e{constructor(e,t,s){this.parser=e,this.text=t,this.offset=s,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,s,a,l){return this.append(new Sv(e,t,s,(a?1:0)|(l?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let s=e;s<this.parts.length;s++){let a=this.parts[s];if(!(a instanceof Sv&&a.type.resolve&&a.side&2))continue;let l=a.type==Fve||a.type==Qve,u=a.to-a.from,d,h=s-1;for(;h>=e;h--){let Q=this.parts[h];if(Q instanceof Sv&&Q.side&1&&Q.type==a.type&&!(l&&(a.side&1||Q.side&2)&&(Q.to-Q.from+u)%3==0&&((Q.to-Q.from)%3||u%3))){d=Q;break}}if(!d)continue;let b=a.type.resolve,y=[],C=d.from,E=a.to;if(l){let Q=Math.min(2,d.to-d.from,u);C=d.to-Q,E=a.from+Q,b=Q==1?"Emphasis":"StrongEmphasis"}d.type.mark&&y.push(this.elt(d.type.mark,C,d.to));for(let Q=h+1;Q<s;Q++)this.parts[Q]instanceof Z6&&y.push(this.parts[Q]),this.parts[Q]=null;a.type.mark&&y.push(this.elt(a.type.mark,a.from,E));let R=this.elt(b,C,E,y);this.parts[h]=l&&d.from!=C?new Sv(d.type,d.from,C,d.side):null,(this.parts[s]=l&&a.to!=E?new Sv(a.type,E,a.to,a.side):null)?this.parts.splice(s,0,R):this.parts[s]=R}let t=[];for(let s=e;s<this.parts.length;s++){let a=this.parts[s];a instanceof Z6&&t.push(a)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let s=this.parts[t];if(s instanceof Sv&&s.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return g6(this.text,e-this.offset)+this.offset}elt(e,t,s,a){return typeof e=="string"?ml(this.parser.getNodeType(e),t,s,a):new Lve(e,t)}}function Ise(o,e){if(!e.length)return o;if(!o.length)return e;let t=o.slice(),s=0;for(let a of e){for(;s<t.length&&t[s].to<a.to;)s++;if(s<t.length&&t[s].from<a.from){let l=t[s];l instanceof Z6&&(t[s]=new Z6(l.type,l.from,l.to,Ise(l.children,[a])))}else t.splice(s++,0,a)}return t}const z5e=[Bo.CodeBlock,Bo.ListItem,Bo.OrderedList,Bo.BulletList];class V5e{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let l=this.fragment.to;for(;l>0&&this.input.read(l-1,l)!=`
|
|
`;)l--;this.fragmentEnd=l?l-1:0}let s=this.cursor;s||(s=this.cursor=this.fragment.tree.cursor(),s.firstChild());let a=e+this.fragment.offset;for(;s.to<=a;)if(!s.parent())return!1;for(;;){if(s.from>=a)return this.fragment.from<=t;if(!s.childAfter(a))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ui.contextHash)==e}takeNodes(e){let t=this.cursor,s=this.fragment.offset,a=this.fragmentEnd-(this.fragment.openEnd?1:0),l=e.absoluteLineStart,u=l,d=e.block.children.length,h=u,b=d;for(;;){if(t.to-s>a){if(t.type.isAnonymous&&t.firstChild())continue;break}let y=Vve(t.from-s,e.ranges);if(t.to-s<=e.ranges[e.rangeI].to)e.addNode(t.tree,y);else{let C=new Cl(e.parser.nodeSet.types[Bo.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(C,t.tree),e.addNode(C,y)}if(t.type.is("Block")&&(z5e.indexOf(t.type.id)<0?(u=t.to-s,d=e.block.children.length):(u=h,d=b,h=t.to-s,b=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>d;)e.block.children.pop(),e.block.positions.pop();return u-l}}function Vve(o,e){let t=o;for(let s=1;s<e.length;s++){let a=e[s-1].to,l=e[s].from;a<o&&(t-=l-a)}return t}const W5e=SE({"Blockquote/...":yt.quote,HorizontalRule:yt.contentSeparator,"ATXHeading1/... SetextHeading1/...":yt.heading1,"ATXHeading2/... SetextHeading2/...":yt.heading2,"ATXHeading3/...":yt.heading3,"ATXHeading4/...":yt.heading4,"ATXHeading5/...":yt.heading5,"ATXHeading6/...":yt.heading6,"Comment CommentBlock":yt.comment,Escape:yt.escape,Entity:yt.character,"Emphasis/...":yt.emphasis,"StrongEmphasis/...":yt.strong,"Link/... Image/...":yt.link,"OrderedList/... BulletList/...":yt.list,"BlockQuote/...":yt.quote,"InlineCode CodeText":yt.monospace,URL:yt.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":yt.processingInstruction,"CodeInfo LinkLabel":yt.labelName,LinkTitle:yt.string,Paragraph:yt.content}),U5e=new bV(new aI(Ive).extend(W5e),Object.keys(aH).map(o=>aH[o]),Object.keys(aH).map(o=>B5e[o]),Object.keys(aH),L5e,xve,Object.keys(Gne).map(o=>Gne[o]),Object.keys(Gne),[]);function Y5e(o,e,t){let s=[];for(let a=o.firstChild,l=e;;a=a.nextSibling){let u=a?a.from:t;if(u>l&&s.push({from:l,to:u}),!a)break;l=a.to}return s}function X5e(o){let{codeParser:e,htmlParser:t}=o;return{wrap:Xbe((a,l)=>{let u=a.type.id;if(e&&(u==Bo.CodeBlock||u==Bo.FencedCode)){let d="";if(u==Bo.FencedCode){let b=a.node.getChild(Bo.CodeInfo);b&&(d=l.read(b.from,b.to))}let h=e(d);if(h)return{parser:h,overlay:b=>b.type.id==Bo.CodeText}}else if(t&&(u==Bo.HTMLBlock||u==Bo.HTMLTag))return{parser:t,overlay:Y5e(a.node,a.from,a.to)};return null})}}const j5e={resolve:"Strikethrough",mark:"StrikethroughMark"},q5e={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":yt.strikethrough}},{name:"StrikethroughMark",style:yt.processingInstruction}],parseInline:[{name:"Strikethrough",parse(o,e,t){if(e!=126||o.char(t+1)!=126||o.char(t+2)==126)return-1;let s=o.slice(t-1,t),a=o.slice(t+2,t+3),l=/\s|^$/.test(s),u=/\s|^$/.test(a),d=H6.test(s),h=H6.test(a);return o.addDelimiter(j5e,t,t+2,!u&&(!h||l||d),!l&&(!d||u||h))},after:"Emphasis"}]};function p6(o,e,t=0,s,a=0){let l=0,u=!0,d=-1,h=-1,b=!1,y=()=>{s.push(o.elt("TableCell",a+d,a+h,o.parser.parseInline(e.slice(d,h),a+d)))};for(let C=t;C<e.length;C++){let E=e.charCodeAt(C);E==124&&!b?((!u||d>-1)&&l++,u=!1,s&&(d>-1&&y(),s.push(o.elt("TableDelimiter",C+a,C+a+1))),d=h=-1):(b||E!=32&&E!=9)&&(d<0&&(d=C),h=C+1),b=!b&&E==92}return d>-1&&(l++,s&&y()),l}function Yde(o,e){for(let t=e;t<o.length;t++){let s=o.charCodeAt(t);if(s==124)return!0;s==92&&t++}return!1}const Wve=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Xde{constructor(){this.rows=null}nextLine(e,t,s){if(this.rows==null){this.rows=!1;let a;if((t.next==45||t.next==58||t.next==124)&&Wve.test(a=t.text.slice(t.pos))){let l=[];p6(e,s.content,0,l,s.start)==p6(e,a,t.pos)&&(this.rows=[e.elt("TableHeader",s.start,s.start+s.content.length,l),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let a=[];p6(e,t.text,t.pos,a,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,a))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const G5e={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":yt.heading}},"TableRow",{name:"TableCell",style:yt.content},{name:"TableDelimiter",style:yt.processingInstruction}],parseBlock:[{name:"Table",leaf(o,e){return Yde(e.content,0)?new Xde:null},endLeaf(o,e,t){if(t.parsers.some(a=>a instanceof Xde)||!Yde(e.text,e.basePos))return!1;let s=o.scanLine(o.absoluteLineEnd+1).text;return Wve.test(s)&&p6(o,e.text,e.basePos)==p6(o,s,e.basePos)},before:"SetextHeading"}]};class K5e{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const J5e={defineNodes:[{name:"Task",block:!0,style:yt.list},{name:"TaskMarker",style:yt.atom}],parseBlock:[{name:"TaskList",leaf(o,e){return/^\[[ xX]\][ \t]/.test(e.content)&&o.parentType().name=="ListItem"?new K5e:null},after:"SetextHeading"}]},jde=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,qde=/[\w-]+(\.\w+(\.\w+)?)(\/[^\s<]*)?/gy,Gde=/[\w.+-]+@[\w-]+\.[\w.-]+/gy,Kde=/\/[a-zA-Z\d@.]+/gy;function Jde(o,e,t,s){let a=0;for(let l=e;l<t;l++)o[l]==s&&a++;return a}function eMe(o,e){qde.lastIndex=e;let t=qde.exec(o);if(!t)return-1;let s=e+t[0].length;for(;;){let a=o[s-1],l;if(/[?!.,:*_~]/.test(a)||a==")"&&Jde(o,e,s,")")>Jde(o,e,s,"("))s--;else if(a==";"&&(l=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(o.slice(e,s))))s=e+l.index;else break}return s}function ehe(o,e){Gde.lastIndex=e;let t=Gde.exec(o);if(!t)return-1;let s=t[0][t[0].length-1];return s=="_"||s=="-"?-1:e+t[0].length-(s=="."?1:0)}const tMe={parseInline:[{name:"Autolink",parse(o,e,t){let s=t-o.offset;jde.lastIndex=s;let a=jde.exec(o.text),l=-1;return!a||(a[1]||a[2]?l=eMe(o.text,s+a[0].length):a[3]?l=ehe(o.text,s):(l=ehe(o.text,s+a[0].length),l>-1&&a[0]=="xmpp:"&&(Kde.lastIndex=l,a=Kde.exec(o.text),a&&(l=a.index+a[0].length))),l<0)?-1:(o.addElement(o.elt("URL",t,l+o.offset)),l+o.offset)}}]},nMe=[G5e,J5e,q5e,tMe];function Uve(o,e,t){return(s,a,l)=>{if(a!=o||s.char(l+1)==o)return-1;let u=[s.elt(t,l,l+1)];for(let d=l+1;d<s.end;d++){let h=s.char(d);if(h==o)return s.addElement(s.elt(e,l,d+1,u.concat(s.elt(t,d,d+1))));if(h==92&&u.push(s.elt("Escape",d,d+++2)),qb(h))break}return-1}}const oMe={defineNodes:[{name:"Superscript",style:yt.special(yt.content)},{name:"SuperscriptMark",style:yt.processingInstruction}],parseInline:[{name:"Superscript",parse:Uve(94,"Superscript","SuperscriptMark")}]},sMe={defineNodes:[{name:"Subscript",style:yt.special(yt.content)},{name:"SubscriptMark",style:yt.processingInstruction}],parseInline:[{name:"Subscript",parse:Uve(126,"Subscript","SubscriptMark")}]},rMe={defineNodes:[{name:"Emoji",style:yt.character}],parseInline:[{name:"Emoji",parse(o,e,t){let s;return e!=58||!(s=/^[a-zA-Z_0-9]+:/.exec(o.slice(t+1,o.end)))?-1:o.addElement(o.elt("Emoji",t,t+1+s[0].length))}}]};class Nz{constructor(e,t,s,a,l,u,d,h,b,y=0,C){this.p=e,this.stack=t,this.state=s,this.reducePos=a,this.pos=l,this.score=u,this.buffer=d,this.bufferBase=h,this.curContext=b,this.lookAhead=y,this.parent=C}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 Nz(e,[],t,s,s,0,[],0,a?new the(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:l}=this.p,u=l.dynamicPrecedence(a);if(u&&(this.score+=u),s==0){this.pushState(l.getGoto(this.state,a,!0),this.reducePos),a<l.minRepeatTerm&&this.storeNode(a,this.reducePos,this.reducePos,4,!0),this.reduceContext(a,this.reducePos);return}let d=this.stack.length-(s-1)*3-(e&262144?6:0),h=d?this.stack[d-2]:this.p.ranges[0].from,b=this.reducePos-h;b>=2e3&&!(!((t=this.p.parser.nodeSet.types[a])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=b):this.p.lastBigReductionSize<b&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=b));let y=d?this.stack[d-1]:0,C=this.bufferBase+this.buffer.length-y;if(a<l.minRepeatTerm||e&131072){let E=l.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(a,h,E,C+4,!0)}if(e&262144)this.state=this.stack[d];else{let E=this.stack[d-3];this.state=l.getGoto(E,a,!0)}for(;this.stack.length>d;)this.stack.pop();this.reduceContext(a,h)}storeNode(e,t,s,a=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let u=this,d=this.buffer.length;if(d==0&&u.parent&&(d=u.bufferBase-u.parent.bufferBase,u=u.parent),d>0&&u.buffer[d-4]==0&&u.buffer[d-1]>-1){if(t==s)return;if(u.buffer[d-2]>=t){u.buffer[d-2]=s;return}}}if(!l||this.pos==s)this.buffer.push(e,t,s,a);else{let u=this.buffer.length;if(u>0&&this.buffer[u-4]!=0)for(;u>0&&this.buffer[u-2]>s;)this.buffer[u]=this.buffer[u-4],this.buffer[u+1]=this.buffer[u-3],this.buffer[u+2]=this.buffer[u-2],this.buffer[u+3]=this.buffer[u-1],u-=4,a>4&&(a-=4);this.buffer[u]=e,this.buffer[u+1]=t,this.buffer[u+2]=s,this.buffer[u+3]=a}}shift(e,t,s,a){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let l=e,{parser:u}=this.p;(a>this.pos||t<=u.maxNode)&&(this.pos=a,u.stateFlag(l,1)||(this.reducePos=a)),this.pushState(l,s),this.shiftContext(t,s),t<=u.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 Nz(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 iMe(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 l=0,u;l<t.length;l+=2)(u=t[l+1])!=this.state&&this.p.parser.hasAction(u,e)&&a.push(t[l],u);if(this.stack.length<120)for(let l=0;a.length<4<<1&&l<t.length;l+=2){let u=t[l+1];a.some((d,h)=>h&1&&d==u)||a.push(t[l],u)}t=a}let s=[];for(let a=0;a<t.length&&s.length<4;a+=2){let l=t[a+1];if(l==this.state)continue;let u=this.split();u.pushState(l,this.pos),u.storeNode(0,u.pos,u.pos,4,!0),u.shiftContext(t[a],this.pos),u.score-=200,s.push(u)}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,l=this.stack.length-s*3;if(l<0||e.getGoto(this.stack[l],a,!1)<0){let u=this.findForcedReduction();if(u==null)return!1;t=u}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,l)=>{if(!t.includes(a))return t.push(a),e.allActions(a,u=>{if(!(u&393216))if(u&65536){let d=(u>>19)-l;if(d>1){let h=u&65535,b=this.stack.length-d*3;if(b>=0&&e.getGoto(this.stack[b],h,!1)>=0)return d<<19|65536|h}}else{let d=s(u,l+1);if(d!=null)return d}})};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 the(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 the{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class iMe{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 Iz{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 Iz(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 Iz(this.stack,this.pos,this.index)}}function s6(o,e=Uint16Array){if(typeof o!="string")return o;let t=null;for(let s=0,a=0;s<o.length;){let l=0;for(;;){let u=o.charCodeAt(s++),d=!1;if(u==126){l=65535;break}u>=92&&u--,u>=34&&u--;let h=u-32;if(h>=46&&(h-=46,d=!0),l+=h,d)break;l*=46}t?t[a++]=l:t=new e(l)}return t}class ZH{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nhe=new ZH;class aMe{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nhe,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,l=this.pos+e;for(;l<s.from;){if(!a)return null;let u=this.ranges[--a];l-=s.from-u.to,s=u}for(;t<0?l>s.to:l>=s.to;){if(a==this.ranges.length-1)return null;let u=this.ranges[++a];l+=u.from-s.to,s=u}return l}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 l=this.resolveOffset(e,1);if(l==null)return-1;if(s=l,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)a=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let u=this.rangeIndex,d=this.range;for(;d.to<=s;)d=this.ranges[++u];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>d.to&&(this.chunk2=this.chunk2.slice(0,d.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=nhe,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 xD{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:s}=t.p;Yve(this.data,e,t,this.id,s.data,s.tokenPrecTable)}}xD.prototype.contextual=xD.prototype.fallback=xD.prototype.extend=!1;class Bz{constructor(e,t,s){this.precTable=t,this.elseToken=s,this.data=typeof e=="string"?s6(e):e}token(e,t){let s=e.pos,a=0;for(;;){let l=e.next<0,u=e.resolveOffset(1,1);if(Yve(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||a++,u==null)break;e.reset(u,e.token)}a&&(e.reset(s,e.token),e.acceptToken(this.elseToken,a))}}Bz.prototype.contextual=xD.prototype.fallback=xD.prototype.extend=!1;class ky{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Yve(o,e,t,s,a,l){let u=0,d=1<<s,{dialect:h}=t.p.parser;e:for(;(d&o[u])!=0;){let b=o[u+1];for(let R=u+3;R<b;R+=2)if((o[R+1]&d)>0){let $=o[R];if(h.allows($)&&(e.token.value==-1||e.token.value==$||lMe($,e.token.value,a,l))){e.acceptToken($);break}}let y=e.next,C=0,E=o[u+2];if(e.next<0&&E>C&&o[b+E*3-3]==65535&&o[b+E*3-3]==65535){u=o[b+E*3-1];continue e}for(;C<E;){let R=C+E>>1,$=b+R+(R<<1),Q=o[$],F=o[$+1]||65536;if(y<Q)E=R;else if(y>=F)C=R+1;else{u=o[$+2],e.advance();continue e}}break}}function ohe(o,e,t){for(let s=e,a;(a=o[s])!=65535;s++)if(a==t)return s-e;return-1}function lMe(o,e,t,s){let a=ohe(t,s,e);return a<0||ohe(t,s,o)<a}const P1=typeof process<"u"&&process.env&&/\bparse\b/.test({}.LOG);let Kne=null;function she(o,e,t){let s=o.cursor(wc.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(o.length,Math.max(s.from+1,e+25));if(t<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return t<0?0:o.length}}class cMe{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?she(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?she(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 l=s.children[a],u=this.start[t]+s.positions[a];if(u>e)return this.nextStart=u,null;if(l instanceof Cl){if(u==e){if(u<this.safeFrom)return null;let d=u+l.length;if(d<=this.safeTo){let h=l.prop(ui.lookAhead);if(!h||d+h<this.fragment.to)return l}}this.index[t]++,u+l.length>=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(u),this.index.push(0))}else this.index[t]++,this.nextStart=u+l.length}}}class uMe{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(s=>new ZH)}getActions(e){let t=0,s=null,{parser:a}=e.p,{tokenizers:l}=a,u=a.stateSlot(e.state,3),d=e.curContext?e.curContext.hash:0,h=0;for(let b=0;b<l.length;b++){if((1<<b&u)==0)continue;let y=l[b],C=this.tokens[b];if(!(s&&!y.fallback)&&((y.contextual||C.start!=e.pos||C.mask!=u||C.context!=d)&&(this.updateCachedToken(C,y,e),C.mask=u,C.context=d),C.lookAhead>C.end+25&&(h=Math.max(C.lookAhead,h)),C.value!=0)){let E=t;if(C.extended>-1&&(t=this.addActions(e,C.extended,C.end,t)),t=this.addActions(e,C.value,C.end,t),!y.extend&&(s=C,t>E))break}}for(;this.actions.length>t;)this.actions.pop();return h&&e.setLookAhead(h),!s&&e.pos==this.stream.end&&(s=new ZH,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 ZH,{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:l}=s.p;for(let u=0;u<l.specialized.length;u++)if(l.specialized[u]==e.value){let d=l.specializers[u](this.stream.read(e.start,e.end),s);if(d>=0&&s.p.parser.dialect.allows(d>>1)){(d&1)==0?e.value=d>>1:e.extended=d>>1;break}}}else e.value=0,e.end=this.stream.clipPos(a+1)}putAction(e,t,s,a){for(let l=0;l<a;l+=3)if(this.actions[l]==e)return a;return this.actions[a++]=e,this.actions[a++]=t,this.actions[a++]=s,a}addActions(e,t,s,a){let{state:l}=e,{parser:u}=e.p,{data:d}=u;for(let h=0;h<2;h++)for(let b=u.stateSlot(l,h?2:1);;b+=3){if(d[b]==65535)if(d[b+1]==1)b=Bw(d,b+2);else{a==0&&d[b+1]==2&&(a=this.putAction(Bw(d,b+2),t,s,a));break}d[b]==t&&(a=this.putAction(Bw(d,b+1),t,s,a))}return a}}class fMe{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 aMe(t,a),this.tokens=new uMe(e,this.stream),this.topTerm=e.top[1];let{from:l}=a[0];this.stacks=[Nz.start(this,e.top[0],l)],this.fragments=s.length&&this.stream.end-l>e.bufferLength*4?new cMe(s,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,s=this.stacks=[],a,l;if(this.bigReductionCount>300&&e.length==1){let[u]=e;for(;u.forceReduce()&&u.stack.length&&u.stack[u.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let u=0;u<e.length;u++){let d=e[u];for(;;){if(this.tokens.mainToken=null,d.pos>t)s.push(d);else{if(this.advanceStack(d,s,e))continue;{a||(a=[],l=[]),a.push(d);let h=this.tokens.getMainToken(d);l.push(h.value,h.end)}}break}}if(!s.length){let u=a&&hMe(a);if(u)return P1&&console.log("Finish with "+this.stackID(u)),this.stackToTree(u);if(this.parser.strict)throw P1&&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 u=this.stoppedAt!=null&&a[0].pos>this.stoppedAt?a[0]:this.runRecovery(a,l,s);if(u)return P1&&console.log("Force-finish "+this.stackID(u)),this.stackToTree(u.forceAll())}if(this.recovering){let u=this.recovering==1?1:this.recovering*3;if(s.length>u)for(s.sort((d,h)=>h.score-d.score);s.length>u;)s.pop();s.some(d=>d.reducePos>t)&&this.recovering--}else if(s.length>1){e:for(let u=0;u<s.length-1;u++){let d=s[u];for(let h=u+1;h<s.length;h++){let b=s[h];if(d.sameState(b)||d.buffer.length>500&&b.buffer.length>500)if((d.score-b.score||d.buffer.length-b.buffer.length)>0)s.splice(h--,1);else{s.splice(u--,1);continue e}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let u=1;u<s.length;u++)s[u].pos<this.minStackPos&&(this.minStackPos=s[u].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:l}=this,u=P1?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&a>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let b=e.curContext&&e.curContext.tracker.strict,y=b?e.curContext.hash:0;for(let C=this.fragments.nodeAt(a);C;){let E=this.parser.nodeSet.types[C.type.id]==C.type?l.getGoto(e.state,C.type.id):-1;if(E>-1&&C.length&&(!b||(C.prop(ui.contextHash)||0)==y))return e.useNode(C,E),P1&&console.log(u+this.stackID(e)+` (via reuse of ${l.getName(C.type.id)})`),!0;if(!(C instanceof Cl)||C.children.length==0||C.positions[0]>0)break;let R=C.children[0];if(R instanceof Cl&&C.positions[0]==0)C=R;else break}}let d=l.stateSlot(e.state,4);if(d>0)return e.reduce(d),P1&&console.log(u+this.stackID(e)+` (via always-reduce ${l.getName(d&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let h=this.tokens.getActions(e);for(let b=0;b<h.length;){let y=h[b++],C=h[b++],E=h[b++],R=b==h.length||!s,$=R?e:e.split(),Q=this.tokens.mainToken;if($.apply(y,C,Q?Q.start:$.pos,E),P1&&console.log(u+this.stackID($)+` (via ${(y&65536)==0?"shift":`reduce of ${l.getName(y&65535)}`} for ${l.getName(C)} @ ${a}${$==e?"":", split"})`),R)return!0;$.pos>a?t.push($):s.push($)}return!1}advanceFully(e,t){let s=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>s)return rhe(e,t),!0}}runRecovery(e,t,s){let a=null,l=!1;for(let u=0;u<e.length;u++){let d=e[u],h=t[u<<1],b=t[(u<<1)+1],y=P1?this.stackID(d)+" -> ":"";if(d.deadEnd&&(l||(l=!0,d.restart(),P1&&console.log(y+this.stackID(d)+" (restarted)"),this.advanceFully(d,s))))continue;let C=d.split(),E=y;for(let R=0;C.forceReduce()&&R<10&&(P1&&console.log(E+this.stackID(C)+" (via force-reduce)"),!this.advanceFully(C,s));R++)P1&&(E=this.stackID(C)+" -> ");for(let R of d.recoverByInsert(h))P1&&console.log(y+this.stackID(R)+" (via recover-insert)"),this.advanceFully(R,s);this.stream.end>d.pos?(b==d.pos&&(b++,h=0),d.recoverByDelete(h,b),P1&&console.log(y+this.stackID(d)+` (via recover-delete ${this.parser.getName(h)})`),rhe(d,s)):(!a||a.score<d.score)&&(a=d)}return a}stackToTree(e){return e.close(),Cl.build({buffer:Iz.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=(Kne||(Kne=new WeakMap)).get(e);return t||Kne.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function rhe(o,e){for(let t=0;t<e.length;t++){let s=e[t];if(s.pos==o.pos&&s.sameState(o)){e[t].score<o.score&&(e[t]=o);return}}e.push(o)}class dMe{constructor(e,t,s){this.source=e,this.flags=t,this.disabled=s}allows(e){return!this.disabled||this.disabled[e]==0}}const Jne=o=>o;class Xve{constructor(e){this.start=e.start,this.shift=e.shift||Jne,this.reduce=e.reduce||Jne,this.reuse=e.reuse||Jne,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class vE extends kre{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 d=0;d<e.repeatNodeCount;d++)t.push("");let s=Object.keys(e.topRules).map(d=>e.topRules[d][1]),a=[];for(let d=0;d<t.length;d++)a.push([]);function l(d,h,b){a[d].push([h,h.deserialize(String(b))])}if(e.nodeProps)for(let d of e.nodeProps){let h=d[0];typeof h=="string"&&(h=ui[h]);for(let b=1;b<d.length;){let y=d[b++];if(y>=0)l(y,h,d[b++]);else{let C=d[b+-y];for(let E=-y;E>0;E--)l(d[b++],h,C);b++}}}this.nodeSet=new aI(t.map((d,h)=>Sd.define({name:h>=this.minRepeatTerm?void 0:d,id:h,props:a[h],top:s.indexOf(h)>-1,error:h==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(h)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=zbe;let u=s6(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let d=0;d<this.specializerSpecs.length;d++)this.specialized[d]=this.specializerSpecs[d].term;this.specializers=this.specializerSpecs.map(ihe),this.states=s6(e.states,Uint32Array),this.data=s6(e.stateData),this.goto=s6(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(d=>typeof d=="number"?new xD(u,d):d),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 fMe(this,e,t,s);for(let l of this.wrappers)a=l(a,e,t,s);return a}getGoto(e,t,s=!1){let a=this.goto;if(t>=a[0])return-1;for(let l=a[t+1];;){let u=a[l++],d=u&1,h=a[l++];if(d&&s)return h;for(let b=l+(u>>1);l<b;l++)if(a[l]==e)return h;if(d)return-1}}hasAction(e,t){let s=this.data;for(let a=0;a<2;a++)for(let l=this.stateSlot(e,a?2:1),u;;l+=3){if((u=s[l])==65535)if(s[l+1]==1)u=s[l=Bw(s,l+2)];else{if(s[l+1]==2)return Bw(s,l+2);break}if(u==t||u==0)return Bw(s,l+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 l=this.stateSlot(e,1);a==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=Bw(this.data,l+2);else break;a=t(Bw(this.data,l+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=Bw(this.data,s+2);else break;if((this.data[s+2]&1)==0){let a=this.data[s+1];t.some((l,u)=>u&1&&l==a)||t.push(this.data[s],a)}}return t}configure(e){let t=Object.assign(Object.create(vE.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(l=>l.from==s);return a?a.to:s})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((s,a)=>{let l=e.specializers.find(d=>d.from==s.external);if(!l)return s;let u=Object.assign(Object.assign({},s),{external:l.to});return t.specializers[a]=ihe(u),u})),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 l of e.split(" ")){let u=t.indexOf(l);u>=0&&(s[u]=!0)}let a=null;for(let l=0;l<t.length;l++)if(!s[l])for(let u=this.dialects[t[l]],d;(d=this.data[u++])!=65535;)(a||(a=new Uint8Array(this.maxTerm+1)))[d]=1;return new dMe(e,s,a)}static deserialize(e){return new vE(e)}}function Bw(o,e){return o[e]|o[e+1]<<16}function hMe(o){let e=null;for(let t of o){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 ihe(o){if(o.external){let e=o.extend?1:0;return(t,s)=>o.external(t,s)<<1|e}return o.get}const mMe=54,gMe=1,pMe=55,bMe=2,vMe=56,OMe=3,ahe=4,yMe=5,Lz=6,jve=7,qve=8,Gve=9,Kve=10,wMe=11,_Me=12,SMe=13,eoe=57,CMe=14,lhe=58,Jve=20,kMe=22,eOe=23,xMe=24,Bse=26,tOe=27,TMe=28,EMe=31,AMe=34,DMe=36,PMe=37,MMe=0,RMe=1,$Me={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},NMe={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},che={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function IMe(o){return o==45||o==46||o==58||o>=65&&o<=90||o==95||o>=97&&o<=122||o>=161}function nOe(o){return o==9||o==10||o==13||o==32}let uhe=null,fhe=null,dhe=0;function Lse(o,e){let t=o.pos+e;if(dhe==t&&fhe==o)return uhe;let s=o.peek(e);for(;nOe(s);)s=o.peek(++e);let a="";for(;IMe(s);)a+=String.fromCharCode(s),s=o.peek(++e);return fhe=o,dhe=t,uhe=a?a.toLowerCase():s==BMe||s==LMe?void 0:null}const oOe=60,Fz=62,Gre=47,BMe=63,LMe=33,FMe=45;function hhe(o,e){this.name=o,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t<o.length;t++)this.hash+=(this.hash<<4)+o.charCodeAt(t)+(o.charCodeAt(t)<<8)}const QMe=[Lz,Kve,jve,qve,Gve],ZMe=new Xve({start:null,shift(o,e,t,s){return QMe.indexOf(e)>-1?new hhe(Lse(s,1)||"",o):o},reduce(o,e){return e==Jve&&o?o.parent:o},reuse(o,e,t,s){let a=e.type.id;return a==Lz||a==DMe?new hhe(Lse(s,1)||"",o):o},hash(o){return o?o.hash:0},strict:!1}),HMe=new ky((o,e)=>{if(o.next!=oOe){o.next<0&&e.context&&o.acceptToken(eoe);return}o.advance();let t=o.next==Gre;t&&o.advance();let s=Lse(o,0);if(s===void 0)return;if(!s)return o.acceptToken(t?CMe:Lz);let a=e.context?e.context.name:null;if(t){if(s==a)return o.acceptToken(wMe);if(a&&NMe[a])return o.acceptToken(eoe,-2);if(e.dialectEnabled(MMe))return o.acceptToken(_Me);for(let l=e.context;l;l=l.parent)if(l.name==s)return;o.acceptToken(SMe)}else{if(s=="script")return o.acceptToken(jve);if(s=="style")return o.acceptToken(qve);if(s=="textarea")return o.acceptToken(Gve);if($Me.hasOwnProperty(s))return o.acceptToken(Kve);a&&che[a]&&che[a][s]?o.acceptToken(eoe,-1):o.acceptToken(Lz)}},{contextual:!0}),zMe=new ky(o=>{for(let e=0,t=0;;t++){if(o.next<0){t&&o.acceptToken(lhe);break}if(o.next==FMe)e++;else if(o.next==Fz&&e>=2){t>3&&o.acceptToken(lhe,-2);break}else e=0;o.advance()}});function VMe(o){for(;o;o=o.parent)if(o.name=="svg"||o.name=="math")return!0;return!1}const WMe=new ky((o,e)=>{if(o.next==Gre&&o.peek(1)==Fz){let t=e.dialectEnabled(RMe)||VMe(e.context);o.acceptToken(t?yMe:ahe,2)}else o.next==Fz&&o.acceptToken(ahe,1)});function Kre(o,e,t){let s=2+o.length;return new ky(a=>{for(let l=0,u=0,d=0;;d++){if(a.next<0){d&&a.acceptToken(e);break}if(l==0&&a.next==oOe||l==1&&a.next==Gre||l>=2&&l<s&&a.next==o.charCodeAt(l-2))l++,u++;else if((l==2||l==s)&&nOe(a.next))u++;else if(l==s&&a.next==Fz){d>u?a.acceptToken(e,-u):a.acceptToken(t,-(u-2));break}else if((a.next==10||a.next==13)&&d){a.acceptToken(e,1);break}else l=u=0;a.advance()}})}const UMe=Kre("script",mMe,gMe),YMe=Kre("style",pMe,bMe),XMe=Kre("textarea",vMe,OMe),jMe=SE({"Text RawText":yt.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":yt.angleBracket,TagName:yt.tagName,"MismatchedCloseTag/TagName":[yt.tagName,yt.invalid],AttributeName:yt.attributeName,"AttributeValue UnquotedAttributeValue":yt.attributeValue,Is:yt.definitionOperator,"EntityReference CharacterReference":yt.character,Comment:yt.blockComment,ProcessingInst:yt.processingInstruction,DoctypeDecl:yt.documentMeta}),qMe=vE.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ZMe,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[jMe],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebhSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXhSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vchS`P!a`!cpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WihSkWc!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QchSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[UMe,YMe,XMe,WMe,HMe,zMe,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function sOe(o,e){let t=Object.create(null);for(let s of o.getChildren(eOe)){let a=s.getChild(xMe),l=s.getChild(Bse)||s.getChild(tOe);a&&(t[e.read(a.from,a.to)]=l?l.type.id==Bse?e.read(l.from+1,l.to-1):e.read(l.from,l.to):"")}return t}function mhe(o,e){let t=o.getChild(kMe);return t?e.read(t.from,t.to):" "}function toe(o,e,t){let s;for(let a of t)if(!a.attrs||a.attrs(s||(s=sOe(o.node.parent.firstChild,e))))return{parser:a.parser};return null}function rOe(o=[],e=[]){let t=[],s=[],a=[],l=[];for(let d of o)(d.tag=="script"?t:d.tag=="style"?s:d.tag=="textarea"?a:l).push(d);let u=e.length?Object.create(null):null;for(let d of e)(u[d.name]||(u[d.name]=[])).push(d);return Xbe((d,h)=>{let b=d.type.id;if(b==TMe)return toe(d,h,t);if(b==EMe)return toe(d,h,s);if(b==AMe)return toe(d,h,a);if(b==Jve&&l.length){let y=d.node,C=y.firstChild,E=C&&mhe(C,h),R;if(E){for(let $ of l)if($.tag==E&&(!$.attrs||$.attrs(R||(R=sOe(y,h))))){let Q=y.lastChild;return{parser:$.parser,overlay:[{from:C.to,to:Q.type.id==PMe?Q.from:y.to}]}}}}if(u&&b==eOe){let y=d.node,C;if(C=y.firstChild){let E=u[h.read(C.from,C.to)];if(E)for(let R of E){if(R.tagName&&R.tagName!=mhe(y.parent,h))continue;let $=y.lastChild;if($.type.id==Bse){let Q=$.from+1,F=$.lastChild,U=$.to-(F&&F.isError?0:1);if(U>Q)return{parser:R.parser,overlay:[{from:Q,to:U}]}}else if($.type.id==tOe)return{parser:R.parser,overlay:[{from:$.from,to:$.to}]}}}}return null})}const GMe=96,ghe=1,KMe=97,JMe=98,phe=2,iOe=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],eRe=58,tRe=40,aOe=95,nRe=91,HH=45,oRe=46,sRe=35,rRe=37;function Qz(o){return o>=65&&o<=90||o>=97&&o<=122||o>=161}function iRe(o){return o>=48&&o<=57}const aRe=new ky((o,e)=>{for(let t=!1,s=0,a=0;;a++){let{next:l}=o;if(Qz(l)||l==HH||l==aOe||t&&iRe(l))!t&&(l!=HH||a>0)&&(t=!0),s===a&&l==HH&&s++,o.advance();else{t&&o.acceptToken(l==tRe?KMe:s==2&&e.canShift(phe)?phe:JMe);break}}}),lRe=new ky(o=>{if(iOe.includes(o.peek(-1))){let{next:e}=o;(Qz(e)||e==aOe||e==sRe||e==oRe||e==nRe||e==eRe||e==HH)&&o.acceptToken(GMe)}}),cRe=new ky(o=>{if(!iOe.includes(o.peek(-1))){let{next:e}=o;if(e==rRe&&(o.advance(),o.acceptToken(ghe)),Qz(e)){do o.advance();while(Qz(o.next));o.acceptToken(ghe)}}}),uRe=SE({"AtKeyword import charset namespace keyframes media supports":yt.definitionKeyword,"from to selector":yt.keyword,NamespaceName:yt.namespace,KeyframeName:yt.labelName,KeyframeRangeName:yt.operatorKeyword,TagName:yt.tagName,ClassName:yt.className,PseudoClassName:yt.constant(yt.className),IdName:yt.labelName,"FeatureName PropertyName":yt.propertyName,AttributeName:yt.attributeName,NumberLiteral:yt.number,KeywordQuery:yt.keyword,UnaryQueryOp:yt.operatorKeyword,"CallTag ValueName":yt.atom,VariableName:yt.variableName,Callee:yt.operatorKeyword,Unit:yt.unit,"UniversalSelector NestingSelector":yt.definitionOperator,MatchOp:yt.compareOperator,"ChildOp SiblingOp, LogicOp":yt.logicOperator,BinOp:yt.arithmeticOperator,Important:yt.modifier,Comment:yt.blockComment,ColorLiteral:yt.color,"ParenthesizedContent StringLiteral":yt.string,":":yt.punctuation,"PseudoOp #":yt.derefOperator,"; ,":yt.separator,"( )":yt.paren,"[ ]":yt.squareBracket,"{ }":yt.brace}),fRe={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},dRe={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hRe={__proto__:null,not:128,only:128},mRe=vE.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<<HaO8rQWO,5;ZOOQP1G/U1G/UOOQS-E8T-E8TO${QdO'#EWO8zQWO,5;WOOQT1G.u1G.uOOQP<<Ha<<HaOOQS7+$k7+$kO9SQdO7+%ZOOQO7+%b7+%bOOQO,5:i,5:iO3QQdO'#E^O6tQWO,5:wOOQS,5:w,5:wOOQS-E8Z-E8ZOOQS1G0S1G0SO9ZQtO,5:tOOQS-E8W-E8WOOQO<<Hm<<HmOOQPAN={AN={O:XQdO,5:rOOQO-E8U-E8UOOQO<<Hu<<HuOOQO,5:x,5:xOOQO-E8[-E8[OOQS1G0c1G0c",stateData:":k~O#WOS#XQQ~OUYOXYO]VO^VOtWOxXO!YaO!ZZO!g[O!i]O!k^O!n_O!t`O#URO#_TO~OQfOUYOXYO]VO^VOtWOxXO!YaO!ZZO!g[O!i]O!k^O!n_O!t`O#UeO#_TO~O#R#dP~P!ZO#XjO~O#UlO~O]qO^qOpoOtrOxsO|tO!PvO#SuO#_nO~O!RwO~P#pO`}O#TzO#UyO~O#U!OO~O#U!QO~OQ!ZOb!TOf!ZOh!ZOn!YO#T!WO#U!SO#b!UO~Ob!]O!b!_O!e!`O#U![O!R#eP~Oh!eOn!YO#U!dO~Oh!gO#U!gO~Ob!]O!b!_O!e!`O#U![O~O!W#eP~P%gO]WX]!UX^WXpWXtWXxWX|WX!PWX!RWX#SWX#_WX~O]!lO~O!W!mO#R#dX!Q#dX~O#R#dX!Q#dX~P!ZO#Y!pO#Z!pO#[!rO~OUYOXYO]VO^VOtWOxXO#URO#_TO~OpoO!RwO~O`!yO#TzO#UyO~O!Q#dP~P!ZOb#QO~Ob#RO~Ov#SOz#TO~OP#VObgXjgX!WgX!bgX!egX#UgXagXQgXfgXhgXngXpgX!VgX#RgX#TgX#bgXvgX!QgX~Ob!]Oj#WO!b!_O!e!`O#U![O!W#eP~Ob#ZO~Ob!]O!b!_O!e!`O#U#[O~Op#`O!`#_O!R#eX!W#eX~Ob#cO~Oj#WO!W#eO~O!W#fO~Oh#gOn!YO~O!R#hO~O!RwO!`#_O~O!RwO!W#kO~O!W!}X#R!}X!Q!}X~P!ZO!W!mO#R#da!Q#da~O#Y!pO#Z!pO#[#rO~O]qO^qOtrOxsO|tO!PvO#SuO#_nO~Op!{a!R!{aa!{a~P.QOv#tOz#uO~O]qO^qOtrOxsO#_nO~Op{i|{i!P{i!R{i#S{ia{i~P/ROp}i|}i!P}i!R}i#S}ia}i~P/ROp!Oi|!Oi!P!Oi!R!Oi#S!Oia!Oi~P/RO!Q#vO~Oa#cP~P(^Oa#`P~P${Oa#}Oj#WO~O!W$PO~Oh$QOo$QO~O]!^Xa![X!`![X~O]$RO~Oa$SO!`#_O~Op#`O!R#ea!W#ea~O!`#_Op!aa!R!aa!W!aaa!aa~O!W$XO~O!Q$`O#U$ZO#b$YO~Oj#WOp$bO!V$dO!W!Ti#R!Ti!Q!Ti~P${O!W!}a#R!}a!Q!}a~P!ZO!W!mO#R#di!Q#di~Oa#cX~P#pOa$hO~Oj#WOQ!yXa!yXb!yXf!yXh!yXn!yXp!yX#T!yX#U!yX#b!yX~Op$jOa#`X~P${Oa$lO~Oj#WOv$mO~Oa$nO~O!`#_Op#Oa!R#Oa!W#Oa~Oa$pO~P.QOP#VOpgX!RgX~O#b$YOp!qX!R!qX~Op$rO!RwO~O!Q$vO#U$ZO#b$YO~Oj#WOQ!|Xb!|Xf!|Xh!|Xn!|Xp!|X!V!|X!W!|X#R!|X#T!|X#U!|X#b!|X!Q!|X~Op$bO!V$yO!W!Tq#R!Tq!Q!Tq~P${Oj#WOv$zO~OpoOa#ca~Op$jOa#`a~Oa$}O~P${Oj#WOQ!|ab!|af!|ah!|an!|ap!|a!V!|a!W!|a#R!|a#T!|a#U!|a#b!|a!Q!|a~Oa!zap!za~P${O#Wo#X#bj!P#b~",goto:"-Y#gPPP#hP#kP#t$TP#t$d#tPP$jPPP$p$y$yP%]P$yP$y%w&ZPPP&s&y#tP'PP#tP'VP#tP#t#tPPP']'r(PPP#kPP(W(W(b(WP(WP(W(WP#kP#kP#kP(e#kP(h(k(n(u#kP#kP(z)Q)a)o)u*P*V*a*g*mPPPPPPPPPP*s*|P+i+lP,b,e,k,tRkQ_bOPdhw!m#nkYOPdhotuvw!m#Q#c#nkSOPdhotuvw!m#Q#c#nQmTR!snQ{VR!wqQ!w}Q#Y!XR#s!yq!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${p!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${U$]#h$_$rR$q$[q!XZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${p!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${Q!e^R#g!fQ|VR!xqQ!w|R#s!xQ!PWR!zrQ!RXR!{sQxUQ!vpQ#d!bQ#j!iQ#k!jQ$t$^R%Q$sSgPwQ!ohQ#m!mR$e#nZfPhw!m#na!a[`a!V!]!_#_#`R#]!]R!f^R!h_R#i!hS$^#h$_R%O$rV$[#h$_$rQ!qjR#q!qQdOShPwU!kdh#nR#n!mQ#z#RU$i#z$o${Q$o$RR${$jQ$k#zR$|$kQpUS!up$gR$g#wQ$c#lR$x$cQ!ngS#o!n#pR#p!oQ#a!^R$V#aQ$_#hR$u$_Q$s$^R%P$s_cOPdhw!m#n^UOPdhw!m#nQ!toQ!|tQ!}uQ#OvQ#w#QR$W#cR#{#RQ!VZQ!c]Q#U!TQ#l!l[#y#R#z$R$j$o${Q#|#TQ$O#WS$a#l$cQ$f#uR$w$bR#x#QQiPR#PwQ!b[Q!jaR#X!VU!^[a!VQ!i`Q#^!]Q#b!_Q$T#_R$U#`",nodeNames:"\u26A0 Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent , PseudoClassName ArgList IdSelector # IdName ] AttributeSelector [ AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:114,nodeProps:[["openedBy",17,"(",48,"{"],["closedBy",18,")",49,"}"]],propSources:[uRe],skippedNodes:[0,3,85],repeatNodeCount:10,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#W~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#W~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^l)sUo`Oy%^z#a%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!V[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYtQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QSzSo`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!PQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l<cYo`Oy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=WUo`Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=qUo`#b[Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l>[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[lRe,cRe,aRe,1,2,3,4,new Bz("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:o=>fRe[o]||-1},{term:56,get:o=>dRe[o]||-1},{term:98,get:o=>hRe[o]||-1}],tokenPrec:1169});let noe=null;function ooe(){if(!noe&&typeof document=="object"&&document.body){let{style:o}=document.body,e=[],t=new Set;for(let s in o)s!="cssText"&&s!="cssFloat"&&typeof o[s]=="string"&&(/[A-Z]/.test(s)&&(s=s.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),t.has(s)||(e.push(s),t.add(s)));noe=e.sort().map(s=>({type:"property",label:s}))}return noe||[]}const bhe=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(o=>({type:"class",label:o})),vhe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(o=>({type:"keyword",label:o})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(o=>({type:"constant",label:o}))),gRe=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(o=>({type:"type",label:o})),gC=/^(\w[\w-]*|-\w[\w-]*|)$/,pRe=/^-(-[\w-]*)?$/;function bRe(o,e){var t;if((o.name=="("||o.type.isError)&&(o=o.parent||o),o.name!="ArgList")return!1;let s=(t=o.parent)===null||t===void 0?void 0:t.firstChild;return(s==null?void 0:s.name)!="Callee"?!1:e.sliceString(s.from,s.to)=="var"}const Ohe=new Ybe,vRe=["Declaration"];function ORe(o){for(let e=o;;){if(e.type.isTop)return e;if(!(e=e.parent))return o}}function lOe(o,e,t){if(e.to-e.from>4096){let s=Ohe.get(e);if(s)return s;let a=[],l=new Set,u=e.cursor(wc.IncludeAnonymous);if(u.firstChild())do for(let d of lOe(o,u.node,t))l.has(d.label)||(l.add(d.label),a.push(d));while(u.nextSibling());return Ohe.set(e,a),a}else{let s=[],a=new Set;return e.cursor().iterate(l=>{var u;if(t(l)&&l.matchContext(vRe)&&((u=l.node.nextSibling)===null||u===void 0?void 0:u.name)==":"){let d=o.sliceString(l.from,l.to);a.has(d)||(a.add(d),s.push({label:d,type:"variable"}))}}),s}}const yRe=o=>e=>{let{state:t,pos:s}=e,a=_c(t).resolveInner(s,-1),l=a.type.isError&&a.from==a.to-1&&t.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(l||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:ooe(),validFor:gC};if(a.name=="ValueName")return{from:a.from,options:vhe,validFor:gC};if(a.name=="PseudoClassName")return{from:a.from,options:bhe,validFor:gC};if(o(a)||(e.explicit||l)&&bRe(a,t.doc))return{from:o(a)||l?a.from:s,options:lOe(t.doc,ORe(a),o),validFor:pRe};if(a.name=="TagName"){for(let{parent:h}=a;h;h=h.parent)if(h.name=="Block")return{from:a.from,options:ooe(),validFor:gC};return{from:a.from,options:gRe,validFor:gC}}if(!e.explicit)return null;let u=a.resolve(s),d=u.childBefore(s);return d&&d.name==":"&&u.name=="PseudoClassSelector"?{from:s,options:bhe,validFor:gC}:d&&d.name==":"&&u.name=="Declaration"||u.name=="ArgList"?{from:s,options:vhe,validFor:gC}:u.name=="Block"||u.name=="Styles"?{from:s,options:ooe(),validFor:gC}:null},wRe=yRe(o=>o.name=="VariableName"),Zz=pE.define({name:"css",parser:mRe.configure({props:[GD.add({Declaration:SD()}),KD.add({"Block KeyframeList":Dre})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _Re(){return new $D(Zz,Zz.data.of({autocomplete:wRe}))}const SRe=304,yhe=1,CRe=2,kRe=305,xRe=307,TRe=308,ERe=3,ARe=4,DRe=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],cOe=125,PRe=59,whe=47,MRe=42,RRe=43,$Re=45,NRe=new Xve({start:!1,shift(o,e){return e==ERe||e==ARe||e==xRe?o:e==TRe},strict:!1}),IRe=new ky((o,e)=>{let{next:t}=o;(t==cOe||t==-1||e.context)&&o.acceptToken(kRe)},{contextual:!0,fallback:!0}),BRe=new ky((o,e)=>{let{next:t}=o,s;DRe.indexOf(t)>-1||t==whe&&((s=o.peek(1))==whe||s==MRe)||t!=cOe&&t!=PRe&&t!=-1&&!e.context&&o.acceptToken(SRe)},{contextual:!0}),LRe=new ky((o,e)=>{let{next:t}=o;if((t==RRe||t==$Re)&&(o.advance(),t==o.next)){o.advance();let s=!e.context&&e.canShift(yhe);o.acceptToken(s?yhe:CRe)}},{contextual:!0}),FRe=SE({"get set async static":yt.modifier,"for while do if else switch try catch finally return throw break continue default case":yt.controlKeyword,"in of await yield void typeof delete instanceof":yt.operatorKeyword,"let var const using function class extends":yt.definitionKeyword,"import export from":yt.moduleKeyword,"with debugger as new":yt.keyword,TemplateString:yt.special(yt.string),super:yt.atom,BooleanLiteral:yt.bool,this:yt.self,null:yt.null,Star:yt.modifier,VariableName:yt.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":yt.function(yt.variableName),VariableDefinition:yt.definition(yt.variableName),Label:yt.labelName,PropertyName:yt.propertyName,PrivatePropertyName:yt.special(yt.propertyName),"CallExpression/MemberExpression/PropertyName":yt.function(yt.propertyName),"FunctionDeclaration/VariableDefinition":yt.function(yt.definition(yt.variableName)),"ClassDeclaration/VariableDefinition":yt.definition(yt.className),PropertyDefinition:yt.definition(yt.propertyName),PrivatePropertyDefinition:yt.definition(yt.special(yt.propertyName)),UpdateOp:yt.updateOperator,"LineComment Hashbang":yt.lineComment,BlockComment:yt.blockComment,Number:yt.number,String:yt.string,Escape:yt.escape,ArithOp:yt.arithmeticOperator,LogicOp:yt.logicOperator,BitOp:yt.bitwiseOperator,CompareOp:yt.compareOperator,RegExp:yt.regexp,Equals:yt.definitionOperator,Arrow:yt.function(yt.punctuation),": Spread":yt.punctuation,"( )":yt.paren,"[ ]":yt.squareBracket,"{ }":yt.brace,"InterpolationStart InterpolationEnd":yt.special(yt.brace),".":yt.derefOperator,", ;":yt.separator,"@":yt.meta,TypeName:yt.typeName,TypeDefinition:yt.definition(yt.typeName),"type enum interface implements namespace module declare":yt.definitionKeyword,"abstract global Privacy readonly override":yt.modifier,"is keyof unique infer":yt.operatorKeyword,JSXAttributeValue:yt.attributeValue,JSXText:yt.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":yt.angleBracket,"JSXIdentifier JSXNameSpacedName":yt.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":yt.attributeName,"JSXBuiltin/JSXIdentifier":yt.standard(yt.tagName)}),QRe={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},ZRe={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},HRe={__proto__:null,"<":139},zRe=vE.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO<dQSO'#G}O={QSO'#CcO>]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-E<b-E<bO9ZQSO,5=WO!$UQSO,5=WO!$ZQUO,5;TO!&^Q,UO'#EeO!'qQSO,5;TO!)ZQ,UO'#DqO!)bQUO'#DvO!)lQWO,5;^O!)tQWO,5;^O%[QUO,5;^OOQQ'#FP'#FPOOQQ'#FR'#FRO%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_OOQQ'#FV'#FVO!*SQUO,5;pOOQ(CY,5;u,5;uOOQ(CY,5;v,5;vO!,VQSO,5;vOOQ(CY,5;w,5;wO%[QUO'#IhO!,_Q(C[O,5<dO!&^Q,UO,5;_O!,|Q,UO,5;_O%[QUO,5;sO!-TQ#tO'#FfO!.QQ#tO'#JyO!-lQ#tO'#JyO!.XQ#tO'#JyOOQO'#Jy'#JyO!.mQ#tO,5<OOOOO,5<[,5<[O!/OQUO'#FrOOOO'#Ig'#IgO7YO&jO,5;{O!/VQ#tO'#FtOOQ(CY,5;{,5;{O!/vQ7[O'#CsOOQ(CY'#Cw'#CwO!0ZQSO'#CwO!0`O07`O'#C{O!0|Q,UO,5<aO!1TQSO,5<cO!2jQMhO'#GRO!2wQSO'#GSO!2|QSO'#GSO!3RQMhO'#GWO!4QQWO'#G[O!4sQ7[O'#J`OOQ(CY'#J`'#J`O!4}QSO'#J_O!5]QSO'#J^O!5eQSO'#CrOOQ(CY'#Cu'#CuOOQ(CY'#DP'#DPOOQ(CY'#DR'#DRO1SQSO'#DTO!'vQ,UO'#FyO!'vQ,UO'#F{O!5mQSO'#F}O!5rQSO'#GOO!2|QSO'#GUO!'vQ,UO'#GZO!5wQSO'#EkO!6fQSO,5<bOOQ(CW'#Cp'#CpO!6nQSO'#ElO!7hQWO'#EmOOQ(CW'#Js'#JsO!7oQ(C[O'#KSO9eQ(C[O,5=[O`QUO,5>lOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-E<T-E<TO!9qQ(CjO,5:ZO!<_Q(CjO,5:gO%[QUO,5:gO!>xQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-E<U-E<UOOQ(CY1G.n1G.nOOOO-E<V-E<VO#(QQ`O,59xOOOO-E<X-E<XOOQ(CY1G/b1G/bO#(VQbO,5>vO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-E<Y-E<YO#(nQSO,5@RO#(vQbO,5@RO#(}QSO,5@`OOQ(CY1G/h1G/hO%[QUO,5@aO#)VQSO'#IbOOQO-E<`-E<`O#(}QSO,5@`OOQ(CW1G0r1G0rOOQ(CY1G/s1G/sOOQ(CY1G0V1G0VO%[QUO,5@^O#)kQ(C[O,5@^O#)|Q(C[O,5@^O#*TQSO,5@]O9TQSO,5@]O#*]QSO,5@]O#*kQSO'#IeO#*TQSO,5@]OOQ(CW1G0q1G0qO!)lQWO,5:rO!)wQWO,5:rOOQO,5:t,5:tO#+]QSO,5:tO#+eQ,UO1G2rO9ZQSO1G2rOOQ(CY1G0o1G0oO#+sQ(CjO1G0oO#,xQ(ChO,5;POOQ(CY'#GQ'#GQO#-fQ(CjO'#J`O!$ZQUO1G0oO#/nQ,UO'#JjO#/xQSO,5:]O#/}QbO'#JkO%[QUO'#JkO#0XQSO,5:bOOQ(CY'#DY'#DYOOQ(CY1G0x1G0xO%[QUO1G0xOOQ(CY1G1b1G1bO#0^QSO1G0xO#2uQ(CjO1G0yO#2|Q(CjO1G0yO#5gQ(CjO1G0yO#5nQ(CjO1G0yO#7xQ(CjO1G0yO#8`Q(CjO1G0yO#;YQ(CjO1G0yO#;aQ(CjO1G0yO#=zQ(CjO1G0yO#>RQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-E<f-E<fO#FSQ(CjO1G0yOOQ(CY1G0y1G0yO#H_Q(CjO1G1_O#IRQ#tO,5<SO#IZQ#tO,5<TO#IcQ#tO'#FkO#IzQSO'#FjOOQO'#Jz'#JzOOQO'#If'#IfO#JPQ#tO1G1jOOQ(CY1G1j1G1jOOOO1G1u1G1uO#JbQ$IUO'#JeO#JlQSO,5<^O!*SQUO,5<^OOOO-E<e-E<eOOQ(CY1G1g1G1gO#JqQWO'#JyOOQ(CY,5<`,5<`O#JyQWO,5<`OOQ(CY,59c,59cO!&^Q,UO'#C}OOOO'#IY'#IYO#KOO07`O,59gOOQ(CY,59g,59gO%[QUO1G1{O!5rQSO'#IjO#KZQ,UO,5<tOOQ(CY,5<q,5<qOOQO'#Gg'#GgO!'vQ,UO,5=QOOQO'#Gi'#GiO!'vQ,UO,5=SO!&^Q,UO,5=UOOQO1G1}1G1}O#KbQ`O'#CpO#KuQ`O,5<mO#K|QSO'#J}O9ZQSO'#J}O#L[QSO,5<oO!'vQ,UO,5<nO#LaQSO'#GTO#LlQSO,5<nO#LqQ`O'#GQO#MOQ`O'#KOO#MYQSO'#KOO!&^Q,UO'#KOO#M_QSO,5<rO#MdQWO'#G]O!3{QWO'#G]O#MuQSO'#G_O#MzQSO'#GaO!2|QSO'#GdO#NPQ(C[O'#IlO#N[QWO,5<vOOQ(CY,5<v,5<vO#NcQWO'#G]O#NqQWO'#G^O#NyQWO'#G^OOQ(CY,5=V,5=VO!'vQ,UO,5?yO!'vQ,UO,5?yO$ OQSO'#ImO$ ZQSO,5?xO$ cQSO,59^O$!SQ,UO,59oOOQ(CY,59o,59oO$!uQ,UO,5<eO$#hQ,UO,5<gO@[QSO,5<iOOQ(CY,5<j,5<jO$#rQSO,5<pO$#wQ,UO,5<uO$$XQSO'#JqO!$ZQUO1G1|O$$^QSO1G1|O9TQSO'#JtO9TQSO'#EnO%[QUO'#EnO9TQSO'#IoO$$cQ(C[O,5@nOOQQ1G2v1G2vOOQQ1G4W1G4WOOQ(CY1G/u1G/uO!,VQSO1G/uO$&hQ(CjO1G0ROOQQ1G2r1G2rO!&^Q,UO1G2rO%[QUO1G2rO$'XQSO1G2rO$'dQ,UO'#EeOOQ(CW,5?v,5?vO$'nQ(C[O,5?vOOQQ1G.s1G.sO!@YQ(C[O1G.sO!@eQWO1G.sO!@mQ,UO1G.sO$(PQSO1G0oO$(UQSO'#CgO$(aQSO'#KWO$(iQSO,5=tO$(nQSO'#KWO$(sQSO'#KWO$)OQSO'#IuO$)^QSO,5@qO$)fQbO1G1dOOQ(CY1G1f1G1fO9ZQSO1G3_O@[QSO1G3_O$)mQSO1G3_O$)rQSO1G3_OOQQ1G3_1G3_O!BhQSO1G2}O!&^Q,UO1G2zO$)wQSO1G2zOOQQ1G2{1G2{O!&^Q,UO1G2{O$)|QSO1G2{O$*UQWO'#GyOOQQ1G2}1G2}O!3{QWO'#IqO!BmQ`O1G3QOOQQ1G3Q1G3QOOQQ,5=k,5=kO$*^Q,UO,5=mO9ZQSO,5=mO#MzQSO,5=oO9OQSO,5=oO!@eQWO,5=oO!@mQ,UO,5=oO9{Q,UO,5=oO$*lQSO'#KUO$*wQSO,5=pOOQQ1G.i1G.iO$*|Q(C[O1G.iO@[QSO1G.iO$+XQSO1G.iO9eQ(C[O1G.iO$-^QbO,5@sO$-nQSO,5@sO9TQSO,5@sO$-yQUO,5=wO$.QQSO,5=wOOQQ1G3a1G3aO`QUO1G3aOOQQ1G3g1G3gOOQQ1G3i1G3iO>eQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-E<S-E<SPOOO1G.f1G.fOOOO1G/d1G/dO$9jQ`O,5<dO$9rQbO1G4bOOQO1G4h1G4hO%[QUO,5>vO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-E<c-E<cOOQO1G0^1G0^OOQO1G0`1G0`O!,YQSO1G0`OOQQ7+(^7+(^O!&^Q,UO7+(^O%[QUO7+(^O$<VQSO7+(^O$<bQ,UO7+(^O$<pQ(CjO,59oO$>xQ(CjO,5<eO$ATQ(CjO,5<gO$C`Q(CjO,5<uOOQ(CY7+&Z7+&ZO$EqQ(CjO7+&ZO$FeQ,UO'#I^O$FoQSO,5@UOOQ(CY1G/w1G/wO$FwQUO'#I_O$GUQSO,5@VO$G^QbO,5@VOOQ(CY1G/|1G/|O$GhQSO7+&dOOQ(CY7+&d7+&dO$GmQ$IUO,5:cO%[QUO7+&vO$GwQ$IUO,5:ZO$HUQ$IUO,5:gO$H`Q$IUO,5:iOOQ(CY7+&|7+&|OOQO1G1n1G1nOOQO1G1o1G1oO$HjQ#tO,5<VO!*SQUO,5<UOOQO-E<d-E<dOOQ(CY7+'U7+'UOOOO7+'a7+'aOOOO1G1x1G1xO$HuQSO1G1xOOQ(CY1G1z1G1zO$HzQ`O,59iOOOO-E<W-E<WOOQ(CY1G/R1G/RO$IRQ(CjO7+'gOOQ(CY,5?U,5?UO$IuQ`O,5?UOOQ(CY1G2`1G2`P!&^Q,UO'#IjPOQ(CY-E<h-E<hO$JeQ,UO1G2lO$KWQ,UO1G2nO$KbQ`O1G2pOOQ(CY1G2X1G2XO$KiQSO'#IiO$KwQSO,5@iO$KwQSO,5@iO$LPQSO,5@iO$L[QSO,5@iOOQO1G2Z1G2ZO$LjQ,UO1G2YO!'vQ,UO1G2YO$LzQMhO'#IkO$M[QSO,5@jO!&^Q,UO,5@jO$MdQ`O,5@jOOQ(CY1G2^1G2^OOQ(CW,5<w,5<wOOQ(CW,5<x,5<xO$$XQSO,5<xOCXQSO,5<xO!@eQWO,5<wOOQO'#G`'#G`O$MnQSO,5<yOOQ(CW,5<{,5<{O$$XQSO,5=OOOQO,5?W,5?WOOQO-E<j-E<jOOQ(CY1G2b1G2bO!3{QWO,5<wO$MvQSO,5<xO#MuQSO,5<yO!3{QWO,5<xO$NRQ,UO1G5eO$N]Q,UO1G5eOOQO,5?X,5?XOOQO-E<k-E<kOOQO1G.x1G.xO!7cQWO,59qO%[QUO,59qO$NjQSO1G2TO!'vQ,UO1G2[O$NoQ(CjO7+'hOOQ(CY7+'h7+'hO!$ZQUO7+'hO% cQSO,5;YOOQ(CW,5?Z,5?ZOOQ(CW-E<m-E<mOOQ(CY7+%a7+%aO% hQ`O'#KPO#$}QSO7+(^O% rQbO7+(^O$<YQSO7+(^O% yQ(ChO'#CgO%!^Q(ChO,5<|O%#OQSO,5<|OOQ(CW1G5b1G5bOOQQ7+$_7+$_O!@YQ(C[O7+$_O!@eQWO7+$_O!$ZQUO7+&ZO%#TQSO'#ItO%#iQSO,5@rOOQO1G3`1G3`O9ZQSO,5@rO%#iQSO,5@rO%#qQSO,5@rOOQO,5?a,5?aOOQO-E<s-E<sOOQ(CY7+'O7+'OO%#vQSO7+(yO9eQ(C[O7+(yO9ZQSO7+(yO@[QSO7+(yOOQQ7+(i7+(iO%#{Q(ChO7+(fO!&^Q,UO7+(fO%$VQ`O7+(gOOQQ7+(g7+(gO!&^Q,UO7+(gO%$^QSO'#KTO%$iQSO,5=eOOQO,5?],5?]OOQO-E<o-E<oOOQQ7+(l7+(lO%%xQWO'#HSOOQQ1G3X1G3XO!&^Q,UO1G3XO%[QUO1G3XO%&PQSO1G3XO%&[Q,UO1G3XO9eQ(C[O1G3ZO#MzQSO1G3ZO9OQSO1G3ZO!@eQWO1G3ZO!@mQ,UO1G3ZO%&jQSO'#IsO%&uQSO,5@pO%&}QWO,5@pOOQ(CW1G3[1G3[OOQQ7+$T7+$TO@[QSO7+$TO9eQ(C[O7+$TO%'YQSO7+$TO%[QUO1G6_O%[QUO1G6`O%'_Q(C[O1G6_O%'iQUO1G3cO%'pQSO1G3cO%'uQUO1G3cOOQQ7+({7+({O9eQ(C[O7+)VO`QUO7+)XOOQQ'#KZ'#KZOOQQ'#Iv'#IvO%'|QUO,5>WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E<Z-E<ZOOQO,5>},5>}OOQO-E<a-E<aO!@eQWO1G/nOOQO-E<^-E<^OOQ(CY1G0Y1G0YOOQ(CY7+%r7+%rO#$}QSO7+%rOOQ(CY7+&Y7+&YO>jQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<<KxO% rQbO<<KxO%*vQSO<<KxOOQQ<<Kx<<KxO!&^Q,UO<<KxO%[QUO<<KxO%+OQSO<<KxO%+ZQ(CjO1G2lO%-fQ(CjO1G2nO%/qQ(CjO1G2YO%2SQ,UO,5>xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<<JO<<JOO%2pQ$IUO1G0oO%4zQ$IUO1G0yO%5RQ$IUO1G0yO%7VQ$IUO1G0yO%7^Q$IUO1G0yO%9RQ$IUO1G0yO%9iQ$IUO1G0yO%;|Q$IUO1G0yO%<TQ$IUO1G0yO%>XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<<JbO%ApQ$IUO1G0yO%CfQ$IUO'#J`O%EiQ$IUO1G1_O%EvQ$IUO1G0RO!*SQUO'#FmOOQO'#J{'#J{OOQO1G1q1G1qO%FQQSO1G1pO%FVQ$IUO,5?SOOOO7+'d7+'dOOOO1G/T1G/TOOQ(CY1G4p1G4pO!'vQ,UO7+([O%FaQSO,5?TO9ZQSO,5?TOOQO-E<g-E<gO%FoQSO1G6TO%FoQSO1G6TO%FwQSO1G6TO%GSQ,UO7+'tO%GdQ`O,5?VO%GnQSO,5?VO!&^Q,UO,5?VOOQO-E<i-E<iO%GsQ`O1G6UO%G}QSO1G6UOOQ(CW1G2d1G2dO$$XQSO1G2dOOQ(CW1G2c1G2cO%HVQSO1G2eO!&^Q,UO1G2eOOQ(CW1G2j1G2jO!@eQWO1G2cOCXQSO1G2dO%H[QSO1G2eO%HdQSO1G2dO!'vQ,UO7++POOQ(CY1G/]1G/]O%HoQSO1G/]OOQ(CY7+'o7+'oO%HtQ,UO7+'vO%IUQ(CjO<<KSOOQ(CY<<KS<<KSO%IxQSO1G0tO!&^Q,UO'#InO%I}QSO,5@kO!&^Q,UO1G2hOOQQ<<Gy<<GyO!@YQ(C[O<<GyO%JVQ(CjO<<IuOOQ(CY<<Iu<<IuOOQO,5?`,5?`O%JyQSO,5?`O$(sQSO,5?`OOQO-E<r-E<rO%KOQSO1G6^O%KOQSO1G6^O9ZQSO1G6^O@[QSO<<LeOOQQ<<Le<<LeO%KWQSO<<LeO9eQ(C[O<<LeOOQQ<<LQ<<LQO%#{Q(ChO<<LQOOQQ<<LR<<LRO%$VQ`O<<LRO%K]QWO'#IpO%KhQSO,5@oO!*SQUO,5@oOOQQ1G3P1G3PO%KpQUO'#JiOOQO'#Ir'#IrO9eQ(C[O'#IrO%KzQWO,5=nOOQQ,5=n,5=nO%LRQWO'#EaO%LgQSO7+(sO%LlQSO7+(sOOQQ7+(s7+(sO!&^Q,UO7+(sO%[QUO7+(sO%LtQSO7+(sOOQQ7+(u7+(uO9eQ(C[O7+(uO#MzQSO7+(uO9OQSO7+(uO!@eQWO7+(uO%MPQSO,5?_OOQO-E<q-E<qOOQO'#HV'#HVO%M[QSO1G6[O9eQ(C[O<<GoOOQQ<<Go<<GoO@[QSO<<GoO%MdQSO7++yO%MiQSO7++zO%[QUO7++yO%[QUO7++zOOQQ7+(}7+(}O%MnQSO7+(}O%MsQUO7+(}O%MzQSO7+(}OOQQ<<Lq<<LqOOQQ<<Ls<<LsOOQQ-E<t-E<tOOQQ1G3r1G3rO%NPQSO,5>XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<<I^<<I^OOQ(CY<<It<<ItO>jQSO<<ItOOQO<<Im<<ImO$9`Q(CjO<<ImO%[QUO<<ImOOQO<<Ia<<IaO!@YQ(C[O<<IaO%NeQ(C[O<<ImO%NpQ(CjO<= OO& QQSO<<N}OOQO7+*V7+*VO9TQSO7+*VOOQQANAdANAdO& YQSOANAdO!&^Q,UOANAdO#$}QSOANAdO% rQbOANAdO%[QUOANAdO& bQ(CjO7+'tO&#sQ(CjO7+'vO&&UQbO1G4eO&&`Q$IUO7+&ZO&&mQ$IUO,59oO&(pQ$IUO,5<eO&*sQ$IUO,5<gO&,vQ$IUO,5<uO&.lQ$IUO7+'gO&.yQ$IUO7+'hO&/WQSO,5<XOOQO7+'[7+'[O&/]Q,UO<<KvOOQO1G4o1G4oO&/dQSO1G4oO&/oQSO1G4oO&/}QSO7++oO&/}QSO7++oO!&^Q,UO1G4qO&0VQ`O1G4qO&0aQSO7++pOOQ(CW7+(O7+(OO$$XQSO7+(PO&0iQ`O7+(POOQ(CW7+'}7+'}O$$XQSO7+(OO&0pQSO7+(PO!&^Q,UO7+(POCXQSO7+(OO&0uQ,UO<<NkOOQ(CY7+$w7+$wO&1PQ`O,5?YOOQO-E<l-E<lO&1ZQ(ChO7+(SOOQQAN=eAN=eO9ZQSO1G4zOOQO1G4z1G4zO&1kQSO1G4zO&1pQSO7++xO&1pQSO7++xO9eQ(C[OANBPO@[QSOANBPOOQQANBPANBPOOQQANAlANAlOOQQANAmANAmO&1xQSO,5?[OOQO-E<n-E<nO&2TQ$IUO1G6ZO&4eQbO'#CgOOQO,5?^,5?^OOQO-E<p-E<pOOQQ1G3Y1G3YO%KpQUO,5<yOOQQ<<L_<<L_O!&^Q,UO<<L_O%LgQSO<<L_O&4oQSO<<L_O%[QUO<<L_OOQQ<<La<<LaO9eQ(C[O<<LaO#MzQSO<<LaO9OQSO<<LaO&4wQWO1G4yO&5SQSO7++vOOQQAN=ZAN=ZO9eQ(C[OAN=ZOOQQ<= e<= eOOQQ<= f<= fO&5[QSO<= eO&5aQSO<= fOOQQ<<Li<<LiO&5fQSO<<LiO&5kQUO<<LiOOQQ1G3s1G3sO>jQSO7+)dO&5rQSO<<IzO&5}Q$IUO<<IzOOQO<<Ht<<HtOOQ(CYAN?`AN?`OOQOAN?XAN?XO$9`Q(CjOAN?XOOQOAN>{AN>{O%[QUOAN?XOOQO<<Mq<<MqOOQQG27OG27OO!&^Q,UOG27OO#$}QSOG27OO&6XQSOG27OO% rQbOG27OO&6aQ$IUO<<JbO&6nQ$IUO1G2YO&8dQ$IUO1G2lO&:gQ$IUO1G2nO&<jQ$IUO<<KSO&<wQ$IUO<<IuOOQO1G1s1G1sO!'vQ,UOANAbOOQO7+*Z7+*ZO&=UQSO7+*ZO&=aQSO<= ZO&=iQ`O7+*]OOQ(CW<<Kk<<KkO$$XQSO<<KkOOQ(CW<<Kj<<KjO&=sQ`O<<KkO$$XQSO<<KjOOQO7+*f7+*fO9ZQSO7+*fO&=zQSO<= dOOQQG27kG27kO9eQ(C[OG27kO!*SQUO1G4vO&>SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<<MO<<MOO!*SQUOAN?fOOQOG24sG24sO$9`Q(CjOG24sO#$}QSOLD,jOOQQLD,jLD,jO!&^Q,UOLD,jO&>iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<<Mu<<MuOOQ(CWANAVANAVO$$XQSOANAVOOQ(CWANAUANAUOOQO<<NQ<<NQOOQQLD-VLD-VO&BmQ$IUO7+*bOOQQG27eG27eO%LgQSOG27eO!&^Q,UOG27eOOQQG27gG27gO9eQ(C[OG27gOOQQG27oG27oO&BwQ$IUOG25QOOQOLD*_LD*_OOQQ!$(!U!$(!UO#$}QSO!$(!UO!&^Q,UO!$(!UO&CRQ(CjOG26|OOQ(CWG26qG26qOOQQLD-PLD-PO%LgQSOLD-POOQQLD-RLD-ROOQQ!)9Ep!)9EpO#$}QSO!)9EpOOQQ!$(!k!$(!kOOQQ!.K;[!.K;[O&EdQ$IUOG26|O!*SQUO'#DwO1PQSO'#EUO&GYQbO'#JeO!*SQUO'#DoO&GaQUO'#D{O&GhQbO'#CgO&JOQbO'#CgO!*SQUO'#D}O&J`QUO,5;TO!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO'#IhO&LcQSO,5<dO&LkQ,UO,5;_O&NOQ,UO,5;_O!*SQUO,5;sO1SQSO'#DTO1SQSO'#DTO!&^Q,UO'#FyO&LkQ,UO'#FyO!&^Q,UO'#F{O&LkQ,UO'#F{O!&^Q,UO'#GZO&LkQ,UO'#GZO!*SQUO,5:gO!*SQUO,5@aO&J`QUO1G0oO&NVQ$IUO'#CgO!*SQUO1G1{O!&^Q,UO,5=QO&LkQ,UO,5=QO!&^Q,UO,5=SO&LkQ,UO,5=SO!&^Q,UO,5<nO&LkQ,UO,5<nO&J`QUO1G1|O!*SQUO7+&vO!&^Q,UO1G2YO&LkQ,UO1G2YO!&^Q,UO1G2[O&LkQ,UO1G2[O&J`QUO7+'hO&J`QUO7+&ZO!&^Q,UOANAbO&LkQ,UOANAbO&NaQSO'#EiO&NfQSO'#EiO&NnQSO'#FXO&NsQSO'#EsO&NxQSO'#JuO' TQSO'#JsO' `QSO,5;TO' eQ,UO,5<aO' lQSO'#GSO' qQSO'#GSO' vQSO,5<bO'!OQSO,5;TO'!WQ$IUO1G1[O'!_QSO,5<nO'!dQSO,5<nO'!iQSO,5<pO'!nQSO,5<pO'!sQSO1G1|O'!xQSO1G0oO'!}Q,UO<<KvO'#UQ,UO<<KvO7hQ,UO'#FwO9OQSO'#FvOAVQSO'#EhO!*SQUO,5;pO!2|QSO'#GSO!2|QSO'#GSO!2|QSO'#GUO!2|QSO'#GUO!'vQ,UO7+([O!'vQ,UO7+([O$KbQ`O1G2pO$KbQ`O1G2pO!&^Q,UO,5=UO!&^Q,UO,5=U",stateData:"'$_~O'oOS'pOSROS'qRQ~OPYOQYOW!VO_qObzOcyOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!YXO!duO!iZO!lYO!mYO!nYO!pvO!rwO!uxO!y]O#q!PO$R|O$VfO%a}O%c!QO%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO%r!UO&O!WO&U!XO&W!YO&Y!ZO&[![O&_!]O&e!^O&k!_O&m!`O&o!aO&q!bO&s!cO'vSO'xTO'{UO(TVO(c[O(piO~OUtO~P`OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~O_!vOm!nO}!oO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!wO#Q!pO#R!pO#U!yO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O'q!zO~OPZXYZX_ZXlZXzZX{ZX}ZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX'mZX(TZX(dZX(kZX(lZX~O!b${X~P(qO]!|O'x#OO'y!|O'z#OO~O]#PO'z#OO'{#OO'|#PO~Or#RO!P#SO(U#SO(V#UO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v9vO'xTO'{UO(TVO(c[O(piO~O!V#YO!W#VO!T(ZP!T(hP~P+}O!X#bO~P`OPYOQYOb!jOc!iOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'xTO'{UO(TVO(c[O(piO~Oj#lO!V#hO!y]O#c#kO#d#hO'v9wO!h(eP~P.iO!i#nO'v#mO~O!u#rO!y]O%a#sO~O#e#tO~O!b#uO#e#tO~OP$]OY$dOl$QOz#yO{#zO}#{O!W$aO!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O_(XX'm(XX'k(XX!h(XX!T(XX!Y(XX%b(XX!b(XX~P1qO#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#p(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX!Y(YX%b(YX~O_(YX!g(YX'm(YX'k(YX!T(YX!h(YXp(YX!b(YX~P4XO#Y$eO~O$X$gO$Z$fO$b$lO~O!Y$mO$VfO$e$nO$g$pO~Oj%SOl$tOm$sOn$sOt%TOv%UOx%VO}${O!Y$|O!d%[O!i$xO#d%]O$R%YO$n%WO$p%XO$s%ZO'v$rO'xTO'{UO(P%RO(T$uOe(QP~O!i%^O~O}%aO!Y%bO'v%`O~O!b%fO~O_%gO'm%gO~O'w!lO~P%[O%g%nO~P%[O!i%^O'v%`O'w!lO(P%RO~Oc%uO!i%^O'v%`O~O#p$SO~Oz%zO!Y%wO!i%yO%c%}O'v%`O'w!lO'xTO'{UO^(yP~O!u#rO~O%l&PO}(uX!Y(uX'v(uX~O'v&QO~O!r&VO#q!PO%c!QO%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO~Ob&[Oc&ZO!u&XO%a&YO%t&WO~P;rOb&_OcyO!Y&^O!r&VO!uxO!y]O#q!PO%a}O%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO%r!UO~O`&bO#Y&eO%c&`O'w!lO~P<wO!i&fO!r&jO~O!i#nO~O!YXO~O_%gO'l&rO'm%gO~O_%gO'l&uO'm%gO~O_%gO'l&wO'm%gO~O'kZX!TZXpZX!hZX&SZX!YZX%bZX!bZX~P(qO!]'UO!^&}O!_&}O'w!lO'xTO'{UO~Om&{O}&zO!V'OO(W&yO!X([P!X(jP~P@OOh'XO!Y'VO'v%`O~Oc'^O!i%^O'v%`O~Oz%zO!i%yO~Om!nO}!oO!y9rO!}!pO#O!pO#Q!pO#R!pO'w!lO'xTO'{UO(W!mO(c!sO~O!]'dO!^'cO!_'cO#P!pO#U'eO#V'eO~PAjO_%gO!b#uO!i%^O'm%gO(P%RO(d'gO~O!m'kO#Y'iO~PBxOm!nO}!oO'xTO'{UO(W!mO(c!sO~O!YXOm(aX}(aX!](aX!^(aX!_(aX!y(aX!}(aX#O(aX#P(aX#Q(aX#R(aX#U(aX#V(aX'w(aX'x(aX'{(aX(W(aX(c(aX~O!^'cO!_'cO'w!lO~PChO'r'oO's'oO't'qO~O]!|O'x'sO'y!|O'z'sO~O]#PO'z'sO'{'sO'|#PO~Or#RO!P#SO(U#SO(V'wO~O!V'yO!T'OX!T'UX!W'OX!W'UX~P+}O!W'{O!T(ZX~OP$]OY$dOl$QOz#yO{#zO}#{O!W'{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O!T(ZX~PG[O!T(QO~O!T(gX!W(gX!b(gX!h(gX(d(gX~O#Y(gX#e#^X!X(gX~PIbO#Y(RO!T(iX!W(iX~O!W(SO!T(hX~O!T(VO~O#Y$eO~PIbO!X(WO~P`Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!kaY!kal!ka!W!ka!f!ka!m!ka#h!ka#i!ka#j!ka#k!ka#l!ka#m!ka#n!ka#o!ka#p!ka#r!ka#t!ka#v!ka#w!ka(d!ka(k!ka(l!ka~O_!ka'm!ka'k!ka!T!ka!h!kap!ka!Y!ka%b!ka!b!ka~PJxO!h(XO~O!b#uO#Y(YO(d'gO!W(fX_(fX'm(fX~O!h(fX~PMhO}%aO!Y%bO!y]O#c(_O#d(^O'v%`O~O!W(`O!h(eX~O!h(bO~O}%aO!Y%bO#d(^O'v%`O~OP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!g(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#p(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O!b#uO!h(YX~P! UOz(cO{(dO!g#wO!i#xO!y!xa}!xa~O!u!xa%a!xa!Y!xa#c!xa#d!xa'v!xa~P!#YO!u(hO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!YXO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~Oj%SOl$tOm$sOn$sOt%TOv%UOx:[O}${O!Y$|O!d;fO!i$xO#d:bO$R%YO$n:^O$p:`O$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#e(nO~Oj%SOl$tOm$sOn$sOt%TOv%UOx%VO}${O!Y$|O!d%[O!i$xO#d%]O$R%YO$n%WO$p%XO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~Oe(^P~P!'vO!V(rO!h(_P~P%[O(W(tO(c[O~O}(vO!i#xO(W(tO(c[O~OP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!Y!eO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O{)XO!i#xO~O!W$aO_$la'm$la'k$la!h$la!T$la!Y$la%b$la!b$la~O#q)]O~P!&^Oz)`O!b)_O!Y$YX$U$YX$X$YX$Z$YX$b$YX~O!b)_O!Y(mX$U(mX$X(mX$Z(mX$b(mX~Oz)`O~P!-lOz)`O!Y(mX$U(mX$X(mX$Z(mX$b(mX~O!Y)bO$U)fO$X)aO$Z)aO$b)gO~O!V)jO~P!*SO$X$gO$Z$fO$b)nO~Oh$tXz$tX}$tX!g$tX(k$tX(l$tX~OegXe$tXhgX!WgX#YgX~P!/bOm)pO~Or)qO(U)rO(V)tO~Oh)}Oz)vO})wO(k)yO(l){O~Oe)uO~P!0kOe*OO~Oj%SOl$tOm$sOn$sOt%TOv%UOx:[O}${O!Y$|O!d;fO!i$xO#d:bO$R%YO$n:^O$p:`O$s%ZO'xTO'{UO(P%RO(T$uO~O!V*SO'v*PO!h(qP~P!1YO#e*UO~O!i*VO~O!V*[O'v*XO!T(rP~P!1YOl*hO}*`O!]*fO!^*_O!_*_O!i*VO#U*gO%X*bO'w!lO(W!mO~O!X*eO~P!3`O!g#wOh(SXz(SX}(SX(k(SX(l(SX!W(SX#Y(SX~Oe(SX#z(SX~P!4XOh*kO#Y*jOe(RX!W(RX~O!W*lOe(QX~O'v&QOe(QP~O!i*sO~O'v(lO~Oj*wO}%aO!V#hO!Y%bO!y]O#c#kO#d#hO'v%`O!h(eP~O!b#uO#e*xO~O}%aO!V*zO!W(SO!Y%bO'v%`O!T(hP~Om'RO}*|O!V*{O'xTO'{UO(W(tO~O!X(jP~P!7SO!W*}O_(vX'm(vX~OP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O_!ca!W!ca'm!ca'k!ca!T!ca!h!cap!ca!Y!ca%b!ca!b!ca~P!7zOz#yO{#zO}#{O!g#wO!i#xO(TVOP!oaY!oal!oa!W!oa!f!oa!m!oa#h!oa#i!oa#j!oa#k!oa#l!oa#m!oa#n!oa#o!oa#p!oa#r!oa#t!oa#v!oa#w!oa(d!oa(k!oa(l!oa~O_!oa'm!oa'k!oa!T!oa!h!oap!oa!Y!oa%b!oa!b!oa~P!:eOz#yO{#zO}#{O!g#wO!i#xO(TVOP!qaY!qal!qa!W!qa!f!qa!m!qa#h!qa#i!qa#j!qa#k!qa#l!qa#m!qa#n!qa#o!qa#p!qa#r!qa#t!qa#v!qa#w!qa(d!qa(k!qa(l!qa~O_!qa'm!qa'k!qa!T!qa!h!qap!qa!Y!qa%b!qa!b!qa~P!=OOh+WO!Y'VO%b+VO(P%RO~O!b+YO_(OX!Y(OX'm(OX!W(OX~O_%gO!YXO'm%gO~O!i%^O(P%RO~O!i%^O'v%`O(P%RO~O!b#uO#e(nO~O%c+fO'v+bO'xTO'{UO!X(zP~O!W+gO^(yX~OY+kO~O^+lO~O!Y%wO'v%`O'w!lO^(yP~O#Y+qO(P%RO~Oh+tO!Y$|O(P%RO~O!Y+vO~Oz+xO!YXO~O%g%nO~O!u+}O~Oc,SO~O'v#mO!X(xP~Oc%uO~O%c!QO'v&QO~P<wOY,YO^,XO~OPYOQYObzOcyOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!duO!iZO!lYO!mYO!nYO!pvO!uxO!y]O$VfO%a}O'xTO'{UO(TVO(c[O(piO~O!Y!eO!r!gO$R!kO'v!dO~P!CuO^,XO_%gO'm%gO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~O_,_O!rwO#q!OO%e!OO%f!OO%g!OO~P!F_O!i&fO~O&U,eO~O!Y,gO~O&g,iO&i,jOP&daQ&daW&da_&dab&dac&daj&dal&dam&dan&dat&dav&dax&da}&da!R&da!S&da!Y&da!d&da!i&da!l&da!m&da!n&da!p&da!r&da!u&da!y&da#q&da$R&da$V&da%a&da%c&da%e&da%f&da%g&da%j&da%l&da%o&da%p&da%r&da&O&da&U&da&W&da&Y&da&[&da&_&da&e&da&k&da&m&da&o&da&q&da&s&da'k&da'v&da'x&da'{&da(T&da(c&da(p&da!X&da&]&da`&da&b&da~O'v,oO~O!W|X!W!`X!X|X!X!`X!b|X!b!`X!i!`X#Y|X(P!`X~O!b,tO#Y,sO!W#bX!W(]X!X#bX!X(]X!b(]X!i(]X(P(]X~O!b,vO!i%^O(P%RO!W![X!X![X~Om!nO}!oO'xTO'{UO(W!mO~OP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!Y!eO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'xTO'{UO(TVO(c[O(p;`O~O'v:gO~P# eO!W,zO!X([X~O!X,|O~O!b,tO#Y,sO!W#bX!X#bX~O!W,}O!X(jX~O!X-PO~O!^-QO!_-QO'w!lO~P# SO!X-TO~P'_Oh-WO!Y'VO~O!T-]O~Om!xa!]!xa!^!xa!_!xa!}!xa#O!xa#P!xa#Q!xa#R!xa#U!xa#V!xa'w!xa'x!xa'{!xa(W!xa(c!xa~P!#YO!m-bO#Y-`O~PBxO!^-dO!_-dO'w!lO~PChO_%gO#Y-`O'm%gO~O_%gO!b#uO#Y-`O'm%gO~O_%gO!b#uO!m-bO#Y-`O'm%gO(d'gO~O'r'oO's'oO't-iO~Op-jO~O!T'Oa!W'Oa~P!7zO!V-nO!T'OX!W'OX~P%[O!W'{O!T(Za~O!T(Za~PG[O!W(SO!T(ha~O}%aO!V-rO!Y%bO'v%`O!T'UX!W'UX~O#Y-tO!W(fa!h(fa_(fa'm(fa~O!b#uO~P#)kO!W(`O!h(ea~O}%aO!Y%bO#d-xO'v%`O~Oj-}O}%aO!V-zO!Y%bO!y]O#c-|O#d-zO'v%`O!W'XX!h'XX~O{.RO!i#xO~Oh.UO!Y'VO%b.TO(P%RO~O_#]i!W#]i'm#]i'k#]i!T#]i!h#]ip#]i!Y#]i%b#]i!b#]i~P!7zOh;lOz)vO})wO(k)yO(l){O~O#e#Xa_#Xa#Y#Xa'm#Xa!W#Xa!h#Xa!Y#Xa!T#Xa~P#,gO#e(SXP(SXY(SX_(SXl(SX{(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX'm(SX(T(SX(d(SX!h(SX!T(SX'k(SXp(SX!Y(SX%b(SX!b(SX~P!4XO!W._Oe(^X~P!0kOe.aO~O!W.bO!h(_X~P!7zO!h.eO~O!T.gO~OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gi_#gil#gi!W#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O#h#gi~P#0cO#h$OO~P#0cOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO(TVOY#gi_#gi!W#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~Ol#gi~P#3TOl$QO~P#3TOP$]Ol$QOz#yO{#zO}#{O!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO(TVO_#gi!W#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P#5uOY$dO!f$SO#m$SO#n$SO#o$cO#p$SO~P#5uOP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO(TVO_#gi!W#gi#t#gi#v#gi#w#gi'm#gi(d#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O(k#gi~P#8vO(k#|O~P#8vOP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO(TVO(k#|O_#gi!W#gi#v#gi#w#gi'm#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O(l#gi~P#;hO(l#}O~P#;hOP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO(TVO(k#|O(l#}O~O_#gi!W#gi#w#gi'm#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#>YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!<OPPP!<VFhPPPPPPPPPPP!?dP!@uPPFh!BSPFhPFhFhFhFhPFh!CfPP!FnP!IrP!Iv!JQ!JU!JUP!FkP!JY!JYP!M^P!MbFhFh!Mh#!k?WP?WP?W?WP##v?W?W#%r?W#(R?W#)w?W?W#*f#,d#,d#,h#,p#,d#,xP#,dP?W#-b?W#.k?W?W5YPPP#/wPPP#0b#0bP#0bP#0x#0bPP#1OP#0uP#0u#1c#0u#1}#2T5V)S#2W)SP#2_#2_#2_P)SP)SP)SP)SPP)SP#2e#2hP#2h)SP#2lP#2oP)SP)SP)SP)SP)SP)S)SPP#2u#2{#3W#3^#3d#3j#3p#4O#4U#4[#4f#4l#4v#5V#5]#5}#6a#6g#6m#6{#7b#8s#9R#9X#9_#9e#9k#9u#9{#:R#:]#:o#:uPPPPPPPPPP#:{PPPPPPP#;p#>wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"\u26A0 ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:NRe,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[FRe],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$<m#p#q$=c#q#r$>s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__US$e&j'yp'|!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]US$e&j'|!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S#%|C}i$e&j(c!L^'yp'|!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr#%|EoP;=`<%lCr(CSFRk$e&j'yp'|!b(W!LY'v&;d$X#tOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$e&j'yp'|!b$X#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv(CSJPP;=`<%lEr%#SJ_`$e&j'yp'|!b#j$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SKl_$e&j#|$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfLva(l%<v$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SNW`$e&j#v$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b! c_'{$)`$e&j'ypOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b*Q!!i_$e&j'ypOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b)`!#mX$e&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h#t!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y#t!$oP;=`<%l!$Y)`!$uP;=`<%l!#h*Q!%R]$`#t$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r$f!&PZ'ypOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z$f!&yU$`#t'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r$f!'`P;=`<%l!%z*Q!'fP;=`<%l!!b(*Q!'t_!i(!b$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'l!)O_!hM|$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h!*[b$e&j'yp'|!b'w#)d#k$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S!+o`$e&j'yp'|!b#h$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&-O!,|`$e&j'yp'|!bl&%`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&C[!.Z_!W&;l$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!/ec$e&j'yp'|!bz'<nOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!0ya$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!2Z_!VMt$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!3eg$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!5Vg$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!6wc$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!8_c$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!9uf$e&j'yp'|!b#i$IdOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpxz!;Zz{#,f{!P!;Z!P!Q#-{!Q!^!;Z!^!_#'Z!_!`#5k!`!a#7Q!a!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(r!;fb$e&j'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(Q!<w`$e&j'|!b!SSOY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eb!Q!^!<n!^!_!GY!_!}!<n!}#O!Ja#O#P!Dj#P#o!<n#o#p!GY#p;'S!<n;'S;=`!Kj<%lO!<n&n!>Q^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!<n#Q#o!Ja#o#p!Ic#p;'S!Ja;'S;=`!Kd<%lO!Ja(Q!KgP;=`<%l!Ja(Q!KmP;=`<%l!<n'`!Ky`$e&j'yp!SSOY!KpYZ&cZr!Kprs!=ys!P!Kp!P!Q!L{!Q!^!Kp!^!_!Ns!_!}!Kp!}#O##z#O#P!Dj#P#o!Kp#o#p!Ns#p;'S!Kp;'S;=`#%T<%lO!Kp'`!MUi$e&j'yp!SSOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#Z(r#Z#[!L{#[#](r#]#^!L{#^#a(r#a#b!L{#b#g(r#g#h!L{#h#i(r#i#j!L{#j#m(r#m#n!L{#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rt!NzZ'yp!SSOY!NsZr!Nsrs!@Ys!P!Ns!P!Q# m!Q!}!Ns!}#O#!|#O#P!Bb#P;'S!Ns;'S;=`##t<%lO!Nst# tb'yp!SSOY)rZr)rs#O)r#P#Z)r#Z#[# m#[#])r#]#^# m#^#a)r#a#b# m#b#g)r#g#h# m#h#i)r#i#j# m#j#m)r#m#n# m#n;'S)r;'S;=`*Z<%lO)rt##RX'ypOY#!|Zr#!|rs!Acs#O#!|#O#P!A{#P#Q!Ns#Q;'S#!|;'S;=`##n<%lO#!|t##qP;=`<%l#!|t##wP;=`<%l!Ns'`#$R^$e&j'ypOY##zYZ&cZr##zrs!Bws!^##z!^!_#!|!_#O##z#O#P!Cr#P#Q!Kp#Q#o##z#o#p#!|#p;'S##z;'S;=`#$}<%lO##z'`#%QP;=`<%l##z'`#%WP;=`<%l!Kp(r#%fk$e&j'yp'|!b!SSOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#Z%Z#Z#[#%Z#[#]%Z#]#^#%Z#^#a%Z#a#b#%Z#b#g%Z#g#h#%Z#h#i%Z#i#j#%Z#j#m%Z#m#n#%Z#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#W#'d]'yp'|!b!SSOY#'ZZr#'Zrs!GYsw#'Zwx!Nsx!P#'Z!P!Q#(]!Q!}#'Z!}#O#)w#O#P!Bb#P;'S#'Z;'S;=`#*w<%lO#'Z#W#(fe'yp'|!b!SSOY*gZr*grs'}sw*gwx)rx#O*g#P#Z*g#Z#[#(]#[#]*g#]#^#(]#^#a*g#a#b#(]#b#g*g#g#h#(]#h#i*g#i#j#(]#j#m*g#m#n#(]#n;'S*g;'S;=`+Z<%lO*g#W#*OZ'yp'|!bOY#)wZr#)wrs!Icsw#)wwx#!|x#O#)w#O#P!A{#P#Q#'Z#Q;'S#)w;'S;=`#*q<%lO#)w#W#*tP;=`<%l#)w#W#*zP;=`<%l#'Z(r#+W`$e&j'yp'|!bOY#*}YZ&cZr#*}rs!Jasw#*}wx##zx!^#*}!^!_#)w!_#O#*}#O#P!Cr#P#Q!;Z#Q#o#*}#o#p#)w#p;'S#*};'S;=`#,Y<%lO#*}(r#,]P;=`<%l#*}(r#,cP;=`<%l!;Z(CS#,sb$e&j'yp'|!b'q(;d!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(CS#.W_$e&j'yp'|!bR(;dOY#-{YZ&cZr#-{rs#/Vsw#-{wx#2gx!^#-{!^!_#4f!_#O#-{#O#P#0X#P#o#-{#o#p#4f#p;'S#-{;'S;=`#5e<%lO#-{(Bb#/`]$e&j'|!bR(;dOY#/VYZ&cZw#/Vwx#0Xx!^#/V!^!_#1j!_#O#/V#O#P#0X#P#o#/V#o#p#1j#p;'S#/V;'S;=`#2a<%lO#/V(AO#0`X$e&jR(;dOY#0XYZ&cZ!^#0X!^!_#0{!_#o#0X#o#p#0{#p;'S#0X;'S;=`#1d<%lO#0X(;d#1QSR(;dOY#0{Z;'S#0{;'S;=`#1^<%lO#0{(;d#1aP;=`<%l#0{(AO#1gP;=`<%l#0X(<v#1qW'|!bR(;dOY#1jZw#1jwx#0{x#O#1j#O#P#0{#P;'S#1j;'S;=`#2Z<%lO#1j(<v#2^P;=`<%l#1j(Bb#2dP;=`<%l#/V(Ap#2p]$e&j'ypR(;dOY#2gYZ&cZr#2grs#0Xs!^#2g!^!_#3i!_#O#2g#O#P#0X#P#o#2g#o#p#3i#p;'S#2g;'S;=`#4`<%lO#2g(<U#3pW'ypR(;dOY#3iZr#3irs#0{s#O#3i#O#P#0{#P;'S#3i;'S;=`#4Y<%lO#3i(<U#4]P;=`<%l#3i(Ap#4cP;=`<%l#2g(=h#4oY'yp'|!bR(;dOY#4fZr#4frs#1jsw#4fwx#3ix#O#4f#O#P#0{#P;'S#4f;'S;=`#5_<%lO#4f(=h#5bP;=`<%l#4f(CS#5hP;=`<%l#-{%#W#5xb$e&j#|$Id'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z+h#7_b$U#t$e&j'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z$/l#8rp$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#:v![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#:v#S#U%Z#U#V#>Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#<v#c#d#AY#d#l%Z#l#m#D[#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#;Rk$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#:v![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#:v#S#X%Z#X#Y!4|#Y#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#=R_$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Acc$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#Bn!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#Bn#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Bye$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#Bn!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#Bn#S#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Deg$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#E|![!^%Z!^!_*g!_!c%Z!c!i#E|!i#O%Z#O#P&c#P#R%Z#R#S#E|#S#T%Z#T#Z#E|#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#FXi$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#E|![!^%Z!^!_*g!_!c%Z!c!i#E|!i#O%Z#O#P&c#P#R%Z#R#S#E|#S#T%Z#T#Z#E|#Z#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#HT_!b$b$e&j#z%<f'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#I___l$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS#Jm^(P!*v!f'.r'yp'|!b$V)d(pSOY*gZr*grs'}sw*gwx)rx!P*g!P!Q#Ki!Q!^*g!^!_#L_!_!`#NP!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#KrX$g&j'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#LhZ#l$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#MZ!`#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#MdX#|$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#NYX#m$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g%Gh$ Qa#Y%?x$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$!V!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#W$!b_#e$Ih$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh$#paeBf#m$Id$b#|$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$$u!`!a$&P!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$%Q_#m$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$&[a#l$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$'a!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$'l`#l$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h$(yc(d$Ip$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P$*U!P!^%Z!^!_*g!_!a%Z!a!b$+`!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+`$*a_{'#p$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$+k`$e&j#w$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&^$,x_!y!Ln$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(@^$.S_}(8n$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/WZ$e&jO!^$/y!^!_$0a!_#i$/y#i#j$0f#j#l$/y#l#m$2X#m#o$/y#o#p$0a#p;'S$/y;'S;=`$4d<%lO$/y(n$0QT]#S$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0fO]#S(n$0k[$e&jO!Q&c!Q![$1a![!^&c!_!c&c!c!i$1a!i#T&c#T#Z$1a#Z#o&c#o#p$3w#p;'S&c;'S;=`&w<%lO&c(n$1fZ$e&jO!Q&c!Q![$2X![!^&c!_!c&c!c!i$2X!i#T&c#T#Z$2X#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2^Z$e&jO!Q&c!Q![$3P![!^&c!_!c&c!c!i$3P!i#T&c#T#Z$3P#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3UZ$e&jO!Q&c!Q![$/y![!^&c!_!c&c!c!i$/y!i#T&c#T#Z$/y#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$3zR!Q![$4T!c!i$4T#T#Z$4T#S$4WS!Q![$4T!c!i$4T#T#Z$4T#q#r$0a(n$4gP;=`<%l$/y!2r$4u_!T!+S$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$6P`#t$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&,v$7^_$e&j'yp'|!b(T&%WOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$8lk$e&j'yp'|!b(W!LY'v&;d$Z#tOY%ZYZ&cZr%Zrs&}st%Ztu$8]uw%Zwx(rx}%Z}!O$:a!O!Q%Z!Q![$8]![!^%Z!^!_*g!_!c%Z!c!}$8]!}#O%Z#O#P&c#P#R%Z#R#S$8]#S#T%Z#T#o$8]#o#p*g#p$g%Z$g;'S$8];'S;=`$<g<%lO$8]+d$:lk$e&j'yp'|!b$Z#tOY%ZYZ&cZr%Zrs&}st%Ztu$:auw%Zwx(rx}%Z}!O$:a!O!Q%Z!Q![$:a![!^%Z!^!_*g!_!c%Z!c!}$:a!}#O%Z#O#P&c#P#R%Z#R#S$:a#S#T%Z#T#o$:a#o#p*g#p$g%Z$g;'S$:a;'S;=`$<a<%lO$:a+d$<dP;=`<%l$:a(CS$<jP;=`<%l$8]!5p$<vX!Y!3l'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g%Df$=na(k%<v$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+`#q;'S%Z;'S;=`+a<%lO%Z%#`$?Q_!X$I`p`$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(r$@[_!nS$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$Al|$e&j'yp'|!b'o(;d(W!LY'v&;d$X#tOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(CS$Dwk$e&j'yp'|!b'p(;d(W!LY'v&;d$X#tOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[BRe,LRe,2,3,4,5,6,7,8,9,10,11,12,13,IRe,new Bz("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOr~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!P~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(V~~",141,328),new Bz("j~RQYZXz{^~^O's~~aP!P!Qd~iO't~~",25,310)],topRules:{Script:[0,5],SingleExpression:[1,268],SingleClassItem:[2,269]},dialects:{jsx:12801,ts:12803},dynamicPrecedences:{67:1,77:1,79:1,164:1,192:1},specialized:[{term:314,get:o=>QRe[o]||-1},{term:330,get:o=>ZRe[o]||-1},{term:68,get:o=>HRe[o]||-1}],tokenPrec:12827}),uOe=[$p("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),$p("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),$p("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),$p("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),$p("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),$p(`try {
|
|
\${}
|
|
} catch (\${error}) {
|
|
\${}
|
|
}`,{label:"try",detail:"/ catch block",type:"keyword"}),$p("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),$p(`if (\${}) {
|
|
\${}
|
|
} else {
|
|
\${}
|
|
}`,{label:"if",detail:"/ else block",type:"keyword"}),$p(`class \${name} {
|
|
constructor(\${params}) {
|
|
\${}
|
|
}
|
|
}`,{label:"class",detail:"definition",type:"keyword"}),$p('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),$p('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],VRe=uOe.concat([$p("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),$p("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),$p("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),_he=new Ybe,fOe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function UN(o){return(e,t)=>{let s=e.node.getChild("VariableDefinition");return s&&t(s,o),!0}}const WRe=["FunctionDeclaration"],URe={FunctionDeclaration:UN("function"),ClassDeclaration:UN("class"),ClassExpression:()=>!0,EnumDeclaration:UN("constant"),TypeAliasDeclaration:UN("type"),NamespaceDeclaration:UN("namespace"),VariableDefinition(o,e){o.matchContext(WRe)||e(o,"variable")},TypeDefinition(o,e){e(o,"type")},__proto__:null};function dOe(o,e){let t=_he.get(e);if(t)return t;let s=[],a=!0;function l(u,d){let h=o.sliceString(u.from,u.to);s.push({label:h,type:d})}return e.cursor(wc.IncludeAnonymous).iterate(u=>{if(a)a=!1;else if(u.name){let d=URe[u.name];if(d&&d(u,l)||fOe.has(u.name))return!1}else if(u.to-u.from>8192){for(let d of dOe(o,u.node))s.push(d);return!1}}),_he.set(e,s),s}const She=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,hOe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function YRe(o){let e=_c(o.state).resolveInner(o.pos,-1);if(hOe.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&She.test(o.state.sliceDoc(e.from,e.to));if(!t&&!o.explicit)return null;let s=[];for(let a=e;a;a=a.parent)fOe.has(a.name)&&(s=s.concat(dOe(o.state.doc,a)));return{options:s,from:t?e.from:o.pos,validFor:She}}const gy=pE.define({name:"javascript",parser:zRe.configure({props:[GD.add({IfStatement:SD({except:/^\s*({|else\b)/}),TryStatement:SD({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:f4e,SwitchBody:o=>{let e=o.textAfter,t=/^\s*\}/.test(e),s=/^\s*(case|default)\b/.test(e);return o.baseIndent+(t?0:s?1:2)*o.unit},Block:u4e({closing:"}"}),ArrowFunction:o=>o.baseIndent+o.unit,"TemplateString BlockComment":()=>null,"Statement Property":SD({except:/^{/}),JSXElement(o){let e=/^\s*<\//.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},JSXEscape(o){let e=/\s*\}/.test(o.textAfter);return o.lineIndent(o.node.from)+(e?0:o.unit)},"JSXOpenTag JSXSelfClosingTag"(o){return o.column(o.node.from)+o.unit}}),KD.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Dre,BlockComment(o){return{from:o.from+2,to:o.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),mOe={test:o=>/^JSX/.test(o.name),facet:xre({commentTokens:{block:{open:"{/*",close:"*/}"}}})},gOe=gy.configure({dialect:"ts"},"typescript"),pOe=gy.configure({dialect:"jsx",props:[Tre.add(o=>o.isTop?[mOe]:void 0)]}),bOe=gy.configure({dialect:"jsx ts",props:[Tre.add(o=>o.isTop?[mOe]:void 0)]},"typescript");let vOe=o=>({label:o,type:"keyword"});const OOe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(vOe),XRe=OOe.concat(["declare","implements","private","protected","public"].map(vOe));function jRe(o={}){let e=o.jsx?o.typescript?bOe:pOe:o.typescript?gOe:gy,t=o.typescript?VRe.concat(XRe):uOe.concat(OOe);return new $D(e,[gy.data.of({autocomplete:xPe(hOe,ove(t))}),gy.data.of({autocomplete:YRe}),o.jsx?KRe:[]])}function qRe(o){for(;;){if(o.name=="JSXOpenTag"||o.name=="JSXSelfClosingTag"||o.name=="JSXFragmentTag")return o;if(o.name=="JSXEscape"||!o.parent)return null;o=o.parent}}function Che(o,e,t=o.length){for(let s=e==null?void 0:e.firstChild;s;s=s.nextSibling)if(s.name=="JSXIdentifier"||s.name=="JSXBuiltin"||s.name=="JSXNamespacedName"||s.name=="JSXMemberExpression")return o.sliceString(s.from,Math.min(s.to,t));return""}const GRe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KRe=is.inputHandler.of((o,e,t,s,a)=>{if((GRe?o.composing:o.compositionStarted)||o.state.readOnly||e!=t||s!=">"&&s!="/"||!gy.isActiveAt(o.state,e,-1))return!1;let l=a(),{state:u}=l,d=u.changeByRange(h=>{var b;let{head:y}=h,C=_c(u).resolveInner(y-1,-1),E;if(C.name=="JSXStartTag"&&(C=C.parent),!(u.doc.sliceString(y-1,y)!=s||C.name=="JSXAttributeValue"&&C.to>y)){if(s==">"&&C.name=="JSXFragmentTag")return{range:h,changes:{from:y,insert:"</>"}};if(s=="/"&&C.name=="JSXStartCloseTag"){let R=C.parent,$=R.parent;if($&&R.from==y-2&&((E=Che(u.doc,$.firstChild,y))||((b=$.firstChild)===null||b===void 0?void 0:b.name)=="JSXFragmentTag")){let Q=`${E}>`;return{range:Ln.cursor(y+Q.length,-1),changes:{from:y,insert:Q}}}}else if(s==">"){let R=qRe(C);if(R&&!/^\/?>|^<\//.test(u.doc.sliceString(y,y+2))&&(E=Che(u.doc,R,y)))return{range:h,changes:{from:y,insert:`</${E}>`}}}}return{range:h}});return d.changes.empty?!1:(o.dispatch([l,u.update(d,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),YN=["_blank","_self","_top","_parent"],soe=["ascii","utf-8","utf-16","latin1","latin1"],roe=["get","post","put","delete"],ioe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],M1=["true","false"],zs={},JRe={a:{attrs:{href:null,ping:null,type:null,media:null,target:YN,hreflang:null}},abbr:zs,address:zs,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:zs,aside:zs,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:zs,base:{attrs:{href:null,target:YN}},bdi:zs,bdo:zs,blockquote:{attrs:{cite:null}},body:zs,br:zs,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ioe,formmethod:roe,formnovalidate:["novalidate"],formtarget:YN,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:zs,center:zs,cite:zs,code:zs,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:zs,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:zs,div:zs,dl:zs,dt:zs,em:zs,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:zs,figure:zs,footer:zs,form:{attrs:{action:null,name:null,"accept-charset":soe,autocomplete:["on","off"],enctype:ioe,method:roe,novalidate:["novalidate"],target:YN}},h1:zs,h2:zs,h3:zs,h4:zs,h5:zs,h6:zs,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:zs,hgroup:zs,hr:zs,html:{attrs:{manifest:null}},i:zs,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ioe,formmethod:roe,formnovalidate:["novalidate"],formtarget:YN,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:zs,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:zs,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:zs,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:soe,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:zs,noscript:zs,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:zs,param:{attrs:{name:null,value:null}},pre:zs,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:zs,rt:zs,ruby:zs,samp:zs,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:soe}},section:zs,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:zs,source:{attrs:{src:null,type:null,media:null}},span:zs,strong:zs,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:zs,summary:zs,sup:zs,table:zs,tbody:zs,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:zs,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:zs,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:zs,time:{attrs:{datetime:null}},title:zs,tr:zs,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:zs,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:zs},yOe={accesskey:null,class:null,contenteditable:M1,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:M1,autocorrect:M1,autocapitalize:M1,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":M1,"aria-autocomplete":["inline","list","both","none"],"aria-busy":M1,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":M1,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":M1,"aria-hidden":M1,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":M1,"aria-multiselectable":M1,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":M1,"aria-relevant":null,"aria-required":M1,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},wOe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(o=>"on"+o);for(let o of wOe)yOe[o]=null;class z6{constructor(e,t){this.tags=Object.assign(Object.assign({},JRe),e),this.globalAttrs=Object.assign(Object.assign({},yOe),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}z6.default=new z6;function LD(o,e,t=o.length){if(!e)return"";let s=e.firstChild,a=s&&s.getChild("TagName");return a?o.sliceString(a.from,Math.min(a.to,t)):""}function FD(o,e=!1){for(;o;o=o.parent)if(o.name=="Element")if(e)e=!1;else return o;return null}function _Oe(o,e,t){let s=t.tags[LD(o,FD(e))];return(s==null?void 0:s.children)||t.allTags}function Jre(o,e){let t=[];for(let s=FD(e);s&&!s.type.isTop;s=FD(s.parent)){let a=LD(o,s);if(a&&s.lastChild.name=="CloseTag")break;a&&t.indexOf(a)<0&&(e.name=="EndTag"||e.from>=s.firstChild.to)&&t.push(a)}return t}const SOe=/^[:\-\.\w\u00b7-\uffff]*$/;function khe(o,e,t,s,a){let l=/\s*>/.test(o.sliceDoc(a,a+5))?"":">",u=FD(t,!0);return{from:s,to:a,options:_Oe(o.doc,u,e).map(d=>({label:d,type:"type"})).concat(Jre(o.doc,t).map((d,h)=>({label:"/"+d,apply:"/"+d+l,type:"type",boost:99-h}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function xhe(o,e,t,s){let a=/\s*>/.test(o.sliceDoc(s,s+5))?"":">";return{from:t,to:s,options:Jre(o.doc,e).map((l,u)=>({label:l,apply:l+a,type:"type",boost:99-u})),validFor:SOe}}function e$e(o,e,t,s){let a=[],l=0;for(let u of _Oe(o.doc,t,e))a.push({label:"<"+u,type:"type"});for(let u of Jre(o.doc,t))a.push({label:"</"+u+">",type:"type",boost:99-l++});return{from:s,to:s,options:a,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function t$e(o,e,t,s,a){let l=FD(t),u=l?e.tags[LD(o.doc,l)]:null,d=u&&u.attrs?Object.keys(u.attrs):[],h=u&&u.globalAttrs===!1?d:d.length?d.concat(e.globalAttrNames):e.globalAttrNames;return{from:s,to:a,options:h.map(b=>({label:b,type:"property"})),validFor:SOe}}function n$e(o,e,t,s,a){var l;let u=(l=t.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),d=[],h;if(u){let b=o.sliceDoc(u.from,u.to),y=e.globalAttrs[b];if(!y){let C=FD(t),E=C?e.tags[LD(o.doc,C)]:null;y=(E==null?void 0:E.attrs)&&E.attrs[b]}if(y){let C=o.sliceDoc(s,a).toLowerCase(),E='"',R='"';/^['"]/.test(C)?(h=C[0]=='"'?/^[^"]*$/:/^[^']*$/,E="",R=o.sliceDoc(a,a+1)==C[0]?"":C[0],C=C.slice(1),s++):h=/^[^\s<>='"]*$/;for(let $ of y)d.push({label:$,apply:E+$+R,type:"constant"})}}return{from:s,to:a,options:d,validFor:h}}function COe(o,e){let{state:t,pos:s}=e,a=_c(t).resolveInner(s,-1),l=a.resolve(s);for(let u=s,d;l==a&&(d=a.childBefore(u));){let h=d.lastChild;if(!h||!h.type.isError||h.from<h.to)break;l=a=d,u=h.from}return a.name=="TagName"?a.parent&&/CloseTag$/.test(a.parent.name)?xhe(t,a,a.from,s):khe(t,o,a,a.from,s):a.name=="StartTag"?khe(t,o,a,s,s):a.name=="StartCloseTag"||a.name=="IncompleteCloseTag"?xhe(t,a,s,s):e.explicit&&(a.name=="OpenTag"||a.name=="SelfClosingTag")||a.name=="AttributeName"?t$e(t,o,a,a.name=="AttributeName"?a.from:s,s):a.name=="Is"||a.name=="AttributeValue"||a.name=="UnquotedAttributeValue"?n$e(t,o,a,a.name=="Is"?s:a.from,s):e.explicit&&(l.name=="Element"||l.name=="Text"||l.name=="Document")?e$e(t,o,a,s):null}function o$e(o){return COe(z6.default,o)}function s$e(o){let{extraTags:e,extraGlobalAttributes:t}=o,s=t||e?new z6(e,t):z6.default;return a=>COe(s,a)}const r$e=gy.parser.configure({top:"SingleExpression"}),kOe=[{tag:"script",attrs:o=>o.type=="text/typescript"||o.lang=="ts",parser:gOe.parser},{tag:"script",attrs:o=>o.type=="text/babel"||o.type=="text/jsx",parser:pOe.parser},{tag:"script",attrs:o=>o.type=="text/typescript-jsx",parser:bOe.parser},{tag:"script",attrs:o=>o.type=="importmap"||o.type=="speculationrules",parser:r$e},{tag:"script",attrs(o){return!o.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(o.type)},parser:gy.parser},{tag:"style",attrs(o){return(!o.lang||o.lang=="css")&&(!o.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(o.type))},parser:Zz.parser}],xOe=[{name:"style",parser:Zz.parser.configure({top:"Styles"})}].concat(wOe.map(o=>({name:o,parser:gy.parser}))),TOe=pE.define({name:"html",parser:qMe.configure({props:[GD.add({Element(o){let e=/^(\s*)(<\/)?/.exec(o.textAfter);return o.node.to<=o.pos+e[0].length?o.continue():o.lineIndent(o.node.from)+(e[2]?0:o.unit)},"OpenTag CloseTag SelfClosingTag"(o){return o.column(o.node.from)+o.unit},Document(o){if(o.pos+/\s*/.exec(o.textAfter)[0].length<o.node.to)return o.continue();let e=null,t;for(let s=o.node;;){let a=s.lastChild;if(!a||a.name!="Element"||a.to!=s.to)break;e=s=a}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?o.lineIndent(e.from)+o.unit:null}}),KD.add({Element(o){let e=o.firstChild,t=o.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:o.to}}}),f0e.add({"OpenTag CloseTag":o=>o.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),zH=TOe.configure({wrap:rOe(kOe,xOe)});function i$e(o={}){let e="",t;o.matchClosingTags===!1&&(e="noMatch"),o.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(o.nestedLanguages&&o.nestedLanguages.length||o.nestedAttributes&&o.nestedAttributes.length)&&(t=rOe((o.nestedLanguages||[]).concat(kOe),(o.nestedAttributes||[]).concat(xOe)));let s=t?TOe.configure({wrap:t,dialect:e}):e?zH.configure({dialect:e}):zH;return new $D(s,[zH.data.of({autocomplete:s$e(o)}),o.autoCloseTags!==!1?a$e:[],jRe().support,_Re().support])}const The=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),a$e=is.inputHandler.of((o,e,t,s,a)=>{if(o.composing||o.state.readOnly||e!=t||s!=">"&&s!="/"||!zH.isActiveAt(o.state,e,-1))return!1;let l=a(),{state:u}=l,d=u.changeByRange(h=>{var b,y,C;let E=u.doc.sliceString(h.from-1,h.to)==s,{head:R}=h,$=_c(u).resolveInner(R-1,-1),Q;if(($.name=="TagName"||$.name=="StartTag")&&($=$.parent),E&&s==">"&&$.name=="OpenTag"){if(((y=(b=$.parent)===null||b===void 0?void 0:b.lastChild)===null||y===void 0?void 0:y.name)!="CloseTag"&&(Q=LD(u.doc,$.parent,R))&&!The.has(Q)){let F=R+(u.doc.sliceString(R,R+1)===">"?1:0),U=`</${Q}>`;return{range:h,changes:{from:R,to:F,insert:U}}}}else if(E&&s=="/"&&$.name=="IncompleteCloseTag"){let F=$.parent;if($.from==R-2&&((C=F.lastChild)===null||C===void 0?void 0:C.name)!="CloseTag"&&(Q=LD(u.doc,F,R))&&!The.has(Q)){let U=R+(u.doc.sliceString(R,R+1)===">"?1:0),K=`${Q}>`;return{range:Ln.cursor(R+K.length,-1),changes:{from:R,to:U,insert:K}}}}return{range:h}});return d.changes.empty?!1:(o.dispatch([l,u.update(d,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),EOe=xre({commentTokens:{block:{open:"<!--",close:"-->"}}}),AOe=new ui,DOe=U5e.configure({props:[KD.add(o=>!o.is("Block")||o.is("Document")||Fse(o)!=null?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),AOe.add(Fse),GD.add({Document:()=>null}),iE.add({Document:EOe})]});function Fse(o){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(o.name);return e?+e[1]:void 0}function l$e(o,e){let t=o;for(;;){let s=t.nextSibling,a;if(!s||(a=Fse(s.type))!=null&&a<=e)break;t=s}return t.to}const c$e=e0e.of((o,e,t)=>{for(let s=_c(o).resolveInner(t,-1);s&&!(s.from<e);s=s.parent){let a=s.type.prop(AOe);if(a==null)continue;let l=l$e(s,a);if(l>t)return{from:t,to:l}}return null});function eie(o){return new Zb(EOe,o,[c$e],"markdown")}const u$e=eie(DOe),f$e=DOe.configure([nMe,sMe,oMe,rMe]),POe=eie(f$e);function d$e(o,e){return t=>{if(t&&o){let s=null;if(t=/\S*/.exec(t)[0],typeof o=="function"?s=o(t):s=wz.matchLanguageName(o,t,!0),s instanceof wz)return s.support?s.support.language.parser:N6.getSkippingParser(s.load());if(s)return s.parser}return e?e.parser:null}}class cH{constructor(e,t,s,a,l,u,d){this.node=e,this.from=t,this.to=s,this.spaceBefore=a,this.spaceAfter=l,this.type=u,this.item=d}blank(e,t=!0){let s=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;s.length<e;)s+=" ";return s}else{for(let a=this.to-this.from-s.length-this.spaceAfter.length;a>0;a--)s+=" ";return s+(t?this.spaceAfter:"")}}marker(e,t){let s=this.node.name=="OrderedList"?String(+ROe(this.item,e)[2]+t):"";return this.spaceBefore+s+this.type+this.spaceAfter}}function MOe(o,e){let t=[];for(let a=o;a&&a.name!="Document";a=a.parent)(a.name=="ListItem"||a.name=="Blockquote"||a.name=="FencedCode")&&t.push(a);let s=[];for(let a=t.length-1;a>=0;a--){let l=t[a],u,d=e.lineAt(l.from),h=l.from-d.from;if(l.name=="FencedCode")s.push(new cH(l,h,h,"","","",null));else if(l.name=="Blockquote"&&(u=/^ *>( ?)/.exec(d.text.slice(h))))s.push(new cH(l,h,h+u[0].length,"",u[1],">",null));else if(l.name=="ListItem"&&l.parent.name=="OrderedList"&&(u=/^( *)\d+([.)])( *)/.exec(d.text.slice(h)))){let b=u[3],y=u[0].length;b.length>=4&&(b=b.slice(0,b.length-4),y-=4),s.push(new cH(l.parent,h,h+y,u[1],b,u[2],l))}else if(l.name=="ListItem"&&l.parent.name=="BulletList"&&(u=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(d.text.slice(h)))){let b=u[4],y=u[0].length;b.length>4&&(b=b.slice(0,b.length-4),y-=4);let C=u[2];u[3]&&(C+=u[3].replace(/[xX]/," ")),s.push(new cH(l.parent,h,h+y,u[1],b,C,l))}}return s}function ROe(o,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(o.from,o.from+10))}function aoe(o,e,t,s=0){for(let a=-1,l=o;;){if(l.name=="ListItem"){let d=ROe(l,e),h=+d[2];if(a>=0){if(h!=a+1)return;t.push({from:l.from+d[1].length,to:l.from+d[0].length,insert:String(a+2+s)})}a=h}let u=l.nextSibling;if(!u)break;l=u}}function Qse(o,e){let t=/^[ \t]*/.exec(o)[0].length;if(!t||e.facet(lI)!=" ")return o;let s=Cv(o,4,t),a="";for(let l=s;l>0;)l>=4?(a+=" ",l-=4):(a+=" ",l--);return a+o.slice(t)}const h$e=({state:o,dispatch:e})=>{let t=_c(o),{doc:s}=o,a=null,l=o.changeByRange(u=>{if(!u.empty||!POe.isActiveAt(o,u.from))return a={range:u};let d=u.from,h=s.lineAt(d),b=MOe(t.resolveInner(d,-1),s);for(;b.length&&b[b.length-1].from>d-h.from;)b.pop();if(!b.length)return a={range:u};let y=b[b.length-1];if(y.to-y.spaceAfter.length>d-h.from)return a={range:u};let C=d>=y.to-y.spaceAfter.length&&!/\S/.test(h.text.slice(y.to));if(y.item&&C)if(y.node.firstChild.to>=d||h.from>0&&!/[^\s>]/.test(s.lineAt(h.from-1).text)){let F=b.length>1?b[b.length-2]:null,U,K="";F&&F.item?(U=h.from+F.from,K=F.marker(s,1)):U=h.from+(F?F.to:0);let L=[{from:U,to:d,insert:K}];return y.node.name=="OrderedList"&&aoe(y.item,s,L,-2),F&&F.node.name=="OrderedList"&&aoe(F.item,s,L),{range:Ln.cursor(U+K.length),changes:L}}else{let F="";for(let U=0,K=b.length-2;U<=K;U++)F+=b[U].blank(U<K?Cv(h.text,4,b[U+1].from)-F.length:null,U<K);return F=Qse(F,o),{range:Ln.cursor(d+F.length+1),changes:{from:h.from,insert:F+o.lineBreak}}}if(y.node.name=="Blockquote"&&C&&h.from){let F=s.lineAt(h.from-1),U=/>\s*$/.exec(F.text);if(U&&U.index==y.from){let K=o.changes([{from:F.from+U.index,to:F.to},{from:h.from+y.from,to:h.to}]);return{range:u.map(K),changes:K}}}let E=[];y.node.name=="OrderedList"&&aoe(y.item,s,E);let R=y.item&&y.item.from<h.from,$="";if(!R||/^[\s\d.)\-+*>]*/.exec(h.text)[0].length>=y.to)for(let F=0,U=b.length-1;F<=U;F++)$+=F==U&&!R?b[F].marker(s,1):b[F].blank(F<U?Cv(h.text,4,b[F+1].from)-$.length:null);let Q=d;for(;Q>h.from&&/\s/.test(h.text.charAt(Q-h.from-1));)Q--;return $=Qse($,o),E.push({from:Q,to:d,insert:o.lineBreak+$}),{range:Ln.cursor(Q+$.length+1),changes:E}});return a?!1:(e(o.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)};function Ehe(o){return o.name=="QuoteMark"||o.name=="ListMark"}function m$e(o,e){let t=o.resolveInner(e,-1),s=e;Ehe(t)&&(s=t.from,t=t.parent);for(let a;a=t.childBefore(s);)if(Ehe(a))s=a.from;else if(a.name=="OrderedList"||a.name=="BulletList")t=a.lastChild,s=t.to;else break;return t}const g$e=({state:o,dispatch:e})=>{let t=_c(o),s=null,a=o.changeByRange(l=>{let u=l.from,{doc:d}=o;if(l.empty&&POe.isActiveAt(o,l.from)){let h=d.lineAt(u),b=MOe(m$e(t,u),d);if(b.length){let y=b[b.length-1],C=y.to-y.spaceAfter.length+(y.spaceAfter?1:0);if(u-h.from>C&&!/\S/.test(h.text.slice(C,u-h.from)))return{range:Ln.cursor(h.from+C),changes:{from:h.from+C,to:u}};if(u-h.from==C&&(!y.item||h.from<=y.item.from||!/\S/.test(h.text.slice(0,y.to)))){let E=h.from+y.from;if(y.item&&y.node.from<y.item.from&&/\S/.test(h.text.slice(y.from,y.to))){let R=y.blank(Cv(h.text,4,y.to)-Cv(h.text,4,y.from));return E==h.from&&(R=Qse(R,o)),{range:Ln.cursor(E+R.length),changes:{from:E,to:h.from+y.to,insert:R}}}if(E<u)return{range:Ln.cursor(E),changes:{from:E,to:u}}}}}return s={range:l}});return s?!1:(e(o.update(a,{scrollIntoView:!0,userEvent:"delete"})),!0)},p$e=[{key:"Enter",run:h$e},{key:"Backspace",run:g$e}],Zse=i$e({matchClosingTags:!1});function Ahe(o={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:s=!0,base:{parser:a}=u$e,completeHTMLTags:l=!0}=o;if(!(a instanceof bV))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=o.extensions?[o.extensions]:[],d=[Zse.support],h;t instanceof $D?(d.push(t.support),h=t.language):t&&(h=t);let b=e||h?d$e(e,h):void 0;u.push(X5e({codeParser:b,htmlParser:Zse.language.parser})),s&&d.push(QC.high(wE.of(p$e)));let y=eie(a.configure(u));return l&&d.push(y.data.of({autocomplete:b$e})),new $D(y,d)}function b$e(o){let{state:e,pos:t}=o,s=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!s)return null;let a=_c(e).resolveInner(t,-1);for(;a&&!a.type.isTop;){if(a.name=="CodeBlock"||a.name=="FencedCode"||a.name=="ProcessingInstructionBlock"||a.name=="CommentBlock"||a.name=="Link"||a.name=="Image")return null;a=a.parent}return{from:t-s[0].length,to:t,options:v$e(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let loe=null;function v$e(){if(loe)return loe;let o=o$e(new Fre(ra.create({extensions:Zse}),0,!0));return loe=o?o.options:[]}function O$e(o){let e,t;return{c(){e=re("div"),Z(e,"class",t="is-editable-"+o[0])},m(s,a){Te(s,e,a),o[3](e)},p(s,[a]){a&1&&t!==(t="is-editable-"+s[0])&&Z(e,"class",t)},i:un,o:un,d(s){s&&ke(e),o[3](null)}}}function y$e(o,e,t){let s,a,{value:l}=e,{editable:u=!0}=e;W1(()=>{let h=new DC,b=new DC,y=ra.create({doc:l,extensions:[Rz,wE.of([W0e,...yve,...Wre]),h.of(Ahe()),Ahe(),gve(),b.of(ra.tabSize.of(4)),Rz,is.editable.of(u),is.updateListener.of(function(C){C.docChanged&&t(2,l=C.state.doc.toString())}),is.lineWrapping,is.contentAttributes.of({spellcheck:"true"})]});a=new is({state:y,parent:s})}),ore(()=>{a&&a.destroy()});function d(h){Ro[h?"unshift":"push"](()=>{s=h,t(1,s)})}return o.$$set=h=>{"value"in h&&t(2,l=h.value),"editable"in h&&t(0,u=h.editable)},[u,s,l,d]}class $Oe extends uo{constructor(e){super(),co(this,e,y$e,O$e,lo,{value:2,editable:0})}}function w$e(o){let e,t,s,a;function l(d){o[1](d)}let u={};return o[0].value!==void 0&&(u.value=o[0].value),t=new $Oe({props:u}),Ro.push(()=>er(t,"value",l)),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","mb-3")},m(d,h){Te(d,e,h),Kt(t,e,null),a=!0},p(d,[h]){const b={};!s&&h&1&&(s=!0,b.value=d[0].value,lr(()=>s=!1)),t.$set(b)},i(d){a||(xe(t.$$.fragment,d),a=!0)},o(d){Be(t.$$.fragment,d),a=!1},d(d){d&&ke(e),Jt(t)}}}function _$e(o,e,t){let{block:s}=e;function a(l){o.$$.not_equal(s.value,l)&&(s.value=l,t(0,s))}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class S$e extends uo{constructor(e){super(),co(this,e,_$e,w$e,lo,{block:0})}}function Dhe(o,e,t){const s=o.slice();return s[11]=e[t],s}function Phe(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[C$e]},$$scope:{ctx:o}}}),e.$on("update",o[3]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Mhe(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[2]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function C$e(o){let e=[],t=new Map,s,a,l=o[0];const u=d=>d[11].id;for(let d=0;d<l.length;d+=1){let h=Dhe(o,l,d),b=u(h);t.set(b,e[d]=Mhe(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){h&5&&(l=d[0],mo(),e=Jd(e,h,u,1,d,l,t,s.parentNode,xv,Mhe,s,Dhe),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function k$e(o){let e,t,s,a,l;t=new eI({props:{buttonClass:"mt-2",recordId:null,schemas:o[1]}}),t.$on("insert",o[4]),t.$on("save",o[4]);let u=o[0].length>0&&Phe(o);return{c(){e=re("div"),en(t.$$.fragment),s=Ze(),u&&u.c(),a=Rs(),Z(e,"class","inline-card-wrapper")},m(d,h){Te(d,e,h),Kt(t,e,null),Te(d,s,h),u&&u.m(d,h),Te(d,a,h),l=!0},p(d,[h]){d[0].length>0?u?(u.p(d,h),h&1&&xe(u,1)):(u=Phe(d),u.c(),xe(u,1),u.m(a.parentNode,a)):u&&(mo(),Be(u,1,1,()=>{u=null}),go())},i(d){l||(xe(t.$$.fragment,d),xe(u),l=!0)},o(d){Be(t.$$.fragment,d),Be(u),l=!1},d(d){d&&ke(e),Jt(t),d&&ke(s),u&&u.d(d),d&&ke(a)}}}function x$e(o,e,t){let s;const a=Ur("channel");let{block:l}=e,{record:u}=e,{field:d}=e,{graph:h}=e,b=d.name+":"+l.id,y=a.schemas.filter($=>l.meta.collections.includes($.name));function C($){var Q;$.preventDefault(),t(5,h.edges=h.edges.filter(F=>!(F.target===$.detail&&F.field===b)),h),t(6,l.value=(Q=h.edges.filter(F=>F.field===b))!=null?Q:[],l)}function E($){t(5,h.edges=qD($.detail.source,$.detail.target,h.edges,b,s),h)}function R($){$.preventDefault(),t(5,h=K6(h,u,$.detail.records,b,$.detail.action))}return o.$$set=$=>{"block"in $&&t(6,l=$.block),"record"in $&&t(7,u=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(5,h=$.graph)},o.$$.update=()=>{var $;o.$$.dirty&160&&t(0,s=($=h.edges.filter(Q=>Q.field===b).map(Q=>h.records.find(F=>F.id===Q.target&&u.id===Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[s,y,C,E,R,h,l,u,d]}class T$e extends uo{constructor(e){super(),co(this,e,x$e,k$e,lo,{block:6,record:7,field:8,graph:5})}}function Rhe(o,e,t){const s=o.slice();return s[16]=e[t],s}function $he(o,e,t){const s=o.slice();return s[19]=e[t],s}function E$e(o){let e,t,s,a,l=o[3],u=[];for(let d=0;d<l.length;d+=1)u[d]=Nhe($he(o,l,d));return{c(){e=re("div"),t=re("button"),t.textContent="Browse",s=Ze(),a=re("ul");for(let d=0;d<u.length;d+=1)u[d].c();Z(t,"class","btn btn-outline-primary btn-sm"),Z(t,"type","button"),Z(t,"data-bs-toggle","dropdown"),Z(t,"aria-expanded","false"),Z(a,"class","dropdown-menu"),Z(e,"class","dropdown d-inline-block")},m(d,h){Te(d,e,h),X(e,t),X(e,s),X(e,a);for(let b=0;b<u.length;b+=1)u[b]&&u[b].m(a,null)},p(d,h){if(h&40){l=d[3];let b;for(b=0;b<l.length;b+=1){const y=$he(d,l,b);u[b]?u[b].p(y,h):(u[b]=Nhe(y),u[b].c(),u[b].m(a,null))}for(;b<u.length;b+=1)u[b].d(1);u.length=l.length}},d(d){d&&ke(e),ia(u,d)}}}function A$e(o){let e,t,s;return{c(){e=re("button"),e.textContent="Browse",Z(e,"class","btn btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[11]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function Nhe(o){let e,t,s=o[19].label+"",a,l,u,d;function h(...b){return o[12](o[19],...b)}return{c(){e=re("li"),t=re("a"),a=Ht(s),l=Ze(),Z(t,"class","dropdown-item"),Z(t,"href","/")},m(b,y){Te(b,e,y),X(e,t),X(t,a),X(e,l),u||(d=mn(t,"click",h),u=!0)},p(b,y){o=b},d(b){b&&ke(e),u=!1,d()}}}function Ihe(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[D$e]},$$scope:{ctx:o}}}),e.$on("update",o[6]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&4194308&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Bhe(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[16],hasDelete:!0}}),s.$on("remove",e[4]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&4&&(h.record=e[16]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function D$e(o){let e=[],t=new Map,s,a,l=o[2];const u=d=>d[16].id;for(let d=0;d<l.length;d+=1){let h=Rhe(o,l,d),b=u(h);t.set(b,e[d]=Bhe(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){h&20&&(l=d[2],mo(),e=Jd(e,h,u,1,d,l,t,s.parentNode,xv,Bhe,s,Rhe),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function P$e(o){let e,t,s,a,l;function u(C,E){return C[0].meta.collections.length===1?A$e:E$e}let d=u(o),h=d(o),b=o[2].length>0&&Ihe(o),y={};return a=new are({props:y}),o[13](a),a.$on("insert",o[7]),{c(){e=re("div"),h.c(),t=Ze(),b&&b.c(),s=Ze(),en(a.$$.fragment),Z(e,"class","mb-0")},m(C,E){Te(C,e,E),h.m(e,null),Te(C,t,E),b&&b.m(C,E),Te(C,s,E),Kt(a,C,E),l=!0},p(C,[E]){d===(d=u(C))&&h?h.p(C,E):(h.d(1),h=d(C),h&&(h.c(),h.m(e,null))),C[2].length>0?b?(b.p(C,E),E&4&&xe(b,1)):(b=Ihe(C),b.c(),xe(b,1),b.m(s.parentNode,s)):b&&(mo(),Be(b,1,1,()=>{b=null}),go());const R={};a.$set(R)},i(C){l||(xe(b),xe(a.$$.fragment,C),l=!0)},o(C){Be(b),Be(a.$$.fragment,C),l=!1},d(C){C&&ke(e),h.d(),C&&ke(t),b&&b.d(C),C&&ke(s),o[13](null),Jt(a,C)}}}function M$e(o,e,t){let s;const a=Ur("channel");let{block:l}=e,{record:u}=e,{field:d}=e,{graph:h}=e,b,y=d.name+":"+l.id,C=a.schemas.filter(L=>l.meta.collections.includes(L.name));function E(L){var te;L.preventDefault(),t(8,h.edges=h.edges.filter(ne=>!(ne.target===L.detail&&ne.field===y)),h),t(0,l.value=(te=h.edges.filter(ne=>ne.field===y))!=null?te:[],l)}function R(L,te){L.preventDefault(),b.open(te)}function $(L){t(8,h.edges=qD(L.detail.source,L.detail.target,h.edges,y,s),h)}function Q(L){L.preventDefault(),b.close(),t(8,h=K6(h,u,L.detail.records,y,L.detail.action))}const F=L=>R(L,C[0].name),U=(L,te)=>R(te,L.name);function K(L){Ro[L?"unshift":"push"](()=>{b=L,t(1,b)})}return o.$$set=L=>{"block"in L&&t(0,l=L.block),"record"in L&&t(9,u=L.record),"field"in L&&t(10,d=L.field),"graph"in L&&t(8,h=L.graph)},o.$$.update=()=>{var L;o.$$.dirty&768&&t(2,s=(L=h.edges.filter(te=>te.field===y).map(te=>h.records.find(ne=>ne.id===te.target&&u.id===te.source)).filter(te=>!!(te!=null&&te.id)))!=null?L:[])},[l,b,s,C,E,R,$,Q,h,u,d,F,U,K]}class R$e extends uo{constructor(e){super(),co(this,e,M$e,P$e,lo,{block:0,record:9,field:10,graph:8})}}function Lhe(o,e,t){const s=o.slice();return s[25]=e[t],s}function Fhe(o){let e,t=o[25].label+"",s,a,l,u;function d(...h){return o[15](o[25],...h)}return{c(){e=re("button"),s=Ht(t),a=Ze(),Z(e,"class","dropdown-item")},m(h,b){Te(h,e,b),X(e,s),X(e,a),l||(u=mn(e,"click",d),l=!0)},p(h,b){o=h},d(h){h&&ke(e),l=!1,u()}}}function $$e(o){let e,t,s,a;function l(h){o[22](h)}function u(h){o[23](h)}let d={record:o[2],field:o[3]};return o[0]!==void 0&&(d.graph=o[0]),o[1]!==void 0&&(d.block=o[1]),e=new T$e({props:d}),Ro.push(()=>er(e,"graph",l)),Ro.push(()=>er(e,"block",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.record=h[2]),b&8&&(y.field=h[3]),!t&&b&1&&(t=!0,y.graph=h[0],lr(()=>t=!1)),!s&&b&2&&(s=!0,y.block=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function N$e(o){let e,t,s,a;function l(h){o[20](h)}function u(h){o[21](h)}let d={record:o[2],field:o[3]};return o[0]!==void 0&&(d.graph=o[0]),o[1]!==void 0&&(d.block=o[1]),e=new R$e({props:d}),Ro.push(()=>er(e,"graph",l)),Ro.push(()=>er(e,"block",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.record=h[2]),b&8&&(y.field=h[3]),!t&&b&1&&(t=!0,y.graph=h[0],lr(()=>t=!1)),!s&&b&2&&(s=!0,y.block=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function I$e(o){let e,t,s;function a(u){o[19](u)}let l={};return o[1]!==void 0&&(l.block=o[1]),e=new S$e({props:l}),Ro.push(()=>er(e,"block",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};!t&&d&2&&(t=!0,h.block=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function B$e(o){let e,t,s;function a(u){o[18](u)}let l={};return o[1]!==void 0&&(l.block=o[1]),e=new zTe({props:l}),Ro.push(()=>er(e,"block",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};!t&&d&2&&(t=!0,h.block=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function L$e(o){let e,t,s;function a(u){o[17](u)}let l={};return o[1]!==void 0&&(l.block=o[1]),e=new NTe({props:l}),Ro.push(()=>er(e,"block",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};!t&&d&2&&(t=!0,h.block=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function F$e(o){let e,t,s;function a(u){o[16](u)}let l={};return o[1]!==void 0&&(l.block=o[1]),e=new MTe({props:l}),Ro.push(()=>er(e,"block",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};!t&&d&2&&(t=!0,h.block=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function Q$e(o){let e,t,s,a=o[1].meta.label+"",l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt,ot,V,ut,Qe,Bt,Ct,He;b=new Fa({props:{icon:"ellipsis"}});let st=o[4].fields,rn=[];for(let mt=0;mt<st.length;mt+=1)rn[mt]=Fhe(Lhe(o,st,mt));const Et=[F$e,L$e,B$e,I$e,N$e,$$e],Cn=[];function je(mt,he){return mt[1].meta.info.name==="heading"?0:mt[1].meta.info.name==="textarea"?1:mt[1].meta.info.name==="rich"?2:mt[1].meta.info.name==="markdown"?3:mt[1].meta.info.name==="file"?4:mt[1].meta.info.name==="reference"?5:-1}return~(ut=je(o))&&(Qe=Cn[ut]=Et[ut](o)),{c(){e=re("div"),t=re("div"),s=re("span"),l=Ht(a),u=Ze(),d=re("div"),h=re("button"),en(b.$$.fragment),y=Ze(),C=re("div"),E=re("h6"),R=Ht("Block id: "),$=re("input"),F=Ht(`
|
|
Block name: `),U=re("input"),L=Ze(),te=re("div"),te.innerHTML='<hr class="dropdown-divider"/>',ne=Ze(),oe=re("h6"),oe.textContent="Actions",G=Ze(),we=re("button"),we.textContent="Move up",ve=Ze(),Re=re("button"),Re.textContent="Move down",Oe=Ze(),ce=re("button"),ce.textContent="Delete",Xe=Ze(),tt=re("h6"),tt.textContent="Insert after",ot=Ze();for(let mt=0;mt<rn.length;mt+=1)rn[mt].c();V=Ze(),Qe&&Qe.c(),Z(s,"class","text-muted d-block fs-6 mb-1"),Z(h,"class","btn btn-link btn-sm"),Z(h,"type","button"),Z(h,"data-bs-toggle","dropdown"),Z(h,"aria-expanded","false"),Z($,"class","form-control-plaintext"),$.readOnly=!0,$.value=Q=o[1].id,Z(U,"class","form-control-plaintext"),U.readOnly=!0,U.value=K=o[1].meta.name,Z(E,"class","dropdown-header"),Z(oe,"class","dropdown-header"),Z(we,"class","dropdown-item"),Vo(we,"d-none",o[9](o[1].id)),Z(Re,"class","dropdown-item"),Vo(Re,"d-none",o[10](o[1].id)),Z(ce,"class","dropdown-item text-danger"),Z(tt,"class","dropdown-header"),Z(C,"class","dropdown-menu"),Z(d,"class","dropdown d-inline-block"),Z(t,"class","d-flex justify-content-between"),Z(e,"class","card block-editor-field d-flex svelte-1tnln3c")},m(mt,he){Te(mt,e,he),X(e,t),X(t,s),X(s,l),X(t,u),X(t,d),X(d,h),Kt(b,h,null),X(d,y),X(d,C),X(C,E),X(E,R),X(E,$),X(E,F),X(E,U),X(C,L),X(C,te),X(C,ne),X(C,oe),X(C,G),X(C,we),X(C,ve),X(C,Re),X(C,Oe),X(C,ce),X(C,Xe),X(C,tt),X(C,ot);for(let Zo=0;Zo<rn.length;Zo+=1)rn[Zo]&&rn[Zo].m(C,null);X(e,V),~ut&&Cn[ut].m(e,null),Bt=!0,Ct||(He=[mn(we,"click",o[12]),mn(Re,"click",o[13]),mn(ce,"click",o[14])],Ct=!0)},p(mt,[he]){if((!Bt||he&2)&&a!==(a=mt[1].meta.label+"")&&Fn(l,a),(!Bt||he&2&&Q!==(Q=mt[1].id)&&$.value!==Q)&&($.value=Q),(!Bt||he&2&&K!==(K=mt[1].meta.name)&&U.value!==K)&&(U.value=K),(!Bt||he&514)&&Vo(we,"d-none",mt[9](mt[1].id)),(!Bt||he&1026)&&Vo(Re,"d-none",mt[10](mt[1].id)),he&50){st=mt[4].fields;let Kn;for(Kn=0;Kn<st.length;Kn+=1){const so=Lhe(mt,st,Kn);rn[Kn]?rn[Kn].p(so,he):(rn[Kn]=Fhe(so),rn[Kn].c(),rn[Kn].m(C,null))}for(;Kn<rn.length;Kn+=1)rn[Kn].d(1);rn.length=st.length}let Zo=ut;ut=je(mt),ut===Zo?~ut&&Cn[ut].p(mt,he):(Qe&&(mo(),Be(Cn[Zo],1,1,()=>{Cn[Zo]=null}),go()),~ut?(Qe=Cn[ut],Qe?Qe.p(mt,he):(Qe=Cn[ut]=Et[ut](mt),Qe.c()),xe(Qe,1),Qe.m(e,null)):Qe=null)},i(mt){Bt||(xe(b.$$.fragment,mt),xe(Qe),Bt=!0)},o(mt){Be(b.$$.fragment,mt),Be(Qe),Bt=!1},d(mt){mt&&ke(e),Jt(b),ia(rn,mt),~ut&&Cn[ut].d(),Ct=!1,vi(He)}}}function Z$e(o,e,t){const s=Ur("channel");let{record:a}=e,{blockData:l}=e,{field:u}=e,{graph:d}=e,{block:h}=e,b=s.schemas.find(ce=>ce.name===u.schema);function y(ce,Xe,tt){ce.preventDefault(),t(11,l=m1e(l,Xe,tt))}function C(ce,Xe){ce.preventDefault(),t(11,l=l.filter(tt=>tt.id!==Xe))}function E(ce,Xe){ce.preventDefault();let tt=Lc.exports.findIndex(l,V=>V.id===Xe),ot=l[tt];t(11,l[tt]=l[tt-1],l),t(11,l[tt-1]=ot,l)}function R(ce,Xe){ce.preventDefault();let tt=Lc.exports.findIndex(l,V=>V.id===Xe),ot=l[tt];t(11,l[tt]=l[tt+1],l),t(11,l[tt+1]=ot,l)}function $(ce){return Lc.exports.findIndex(l,Xe=>Xe.id===ce)===0}function Q(ce){return Lc.exports.findIndex(l,Xe=>Xe.id===ce)===l.length-1}const F=ce=>E(ce,h.id),U=ce=>R(ce,h.id),K=ce=>C(ce,h.id),L=(ce,Xe)=>y(Xe,ce,h.id);function te(ce){h=ce,t(1,h)}function ne(ce){h=ce,t(1,h)}function oe(ce){h=ce,t(1,h)}function G(ce){h=ce,t(1,h)}function we(ce){d=ce,t(0,d)}function ve(ce){h=ce,t(1,h)}function Re(ce){d=ce,t(0,d)}function Oe(ce){h=ce,t(1,h)}return o.$$set=ce=>{"record"in ce&&t(2,a=ce.record),"blockData"in ce&&t(11,l=ce.blockData),"field"in ce&&t(3,u=ce.field),"graph"in ce&&t(0,d=ce.graph),"block"in ce&&t(1,h=ce.block)},[d,h,a,u,b,y,C,E,R,$,Q,l,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe]}class H$e extends uo{constructor(e){super(),co(this,e,Z$e,Q$e,lo,{record:2,blockData:11,field:3,graph:0,block:1})}}function Qhe(o,e,t){const s=o.slice();return s[10]=e[t],s[11]=e,s[12]=t,s}function Zhe(o,e){let t,s,a,l,u,d,h,b=un,y;function C(Q){e[6](Q,e[10],e[11],e[12])}function E(Q){e[7](Q)}function R(Q){e[8](Q)}let $={record:e[2],field:e[3]};return e[10]!==void 0&&($.block=e[10]),e[0]!==void 0&&($.blockData=e[0]),e[1]!==void 0&&($.graph=e[1]),s=new H$e({props:$}),Ro.push(()=>er(s,"block",C)),Ro.push(()=>er(s,"blockData",E)),Ro.push(()=>er(s,"graph",R)),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),d=Ze(),Z(t,"class","block-field-wrapper"),this.first=t},m(Q,F){Te(Q,t,F),Kt(s,t,null),X(t,d),y=!0},p(Q,F){e=Q;const U={};F&4&&(U.record=e[2]),F&8&&(U.field=e[3]),!a&&F&1&&(a=!0,U.block=e[10],lr(()=>a=!1)),!l&&F&1&&(l=!0,U.blockData=e[0],lr(()=>l=!1)),!u&&F&2&&(u=!0,U.graph=e[1],lr(()=>u=!1)),s.$set(U)},r(){h=t.getBoundingClientRect()},f(){Tpe(t),b()},a(){b(),b=xpe(t,h,h1e,{delay:250,duration:250,easing:Mpe})},i(Q){y||(xe(s.$$.fragment,Q),y=!0)},o(Q){Be(s.$$.fragment,Q),y=!1},d(Q){Q&&ke(t),Jt(s)}}}function z$e(o){let e,t,s,a,l,u=[],d=new Map,h;function b(R){o[5](R)}let y={blockSchema:o[4]};o[0]!==void 0&&(y.blockData=o[0]),s=new ATe({props:y}),Ro.push(()=>er(s,"blockData",b));let C=o[0];const E=R=>R[10].id;for(let R=0;R<C.length;R+=1){let $=Qhe(o,C,R),Q=E($);d.set(Q,u[R]=Zhe(Q,$))}return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),l=Ze();for(let R=0;R<u.length;R+=1)u[R].c();Z(t,"class","inline-card-wrapper"),Z(e,"class","")},m(R,$){Te(R,e,$),X(e,t),Kt(s,t,null),X(e,l);for(let Q=0;Q<u.length;Q+=1)u[Q]&&u[Q].m(e,null);h=!0},p(R,[$]){const Q={};if(!a&&$&1&&(a=!0,Q.blockData=R[0],lr(()=>a=!1)),s.$set(Q),$&15){C=R[0],mo();for(let F=0;F<u.length;F+=1)u[F].r();u=Jd(u,$,E,1,R,C,d,e,Dpe,Zhe,null,Qhe);for(let F=0;F<u.length;F+=1)u[F].a();go()}},i(R){if(!h){xe(s.$$.fragment,R);for(let $=0;$<C.length;$+=1)xe(u[$]);h=!0}},o(R){Be(s.$$.fragment,R);for(let $=0;$<u.length;$+=1)Be(u[$]);h=!1},d(R){R&&ke(e),Jt(s);for(let $=0;$<u.length;$+=1)u[$].d()}}}function V$e(o,e,t){const s=Ur("channel");let{record:a}=e,{field:l}=e,{value:u=[]}=e,{graph:d}=e,h=s.schemas.find(R=>R.name===l.schema);function b(R){u=R,t(0,u)}function y(R,$,Q,F){Q[F]=R,t(0,u)}function C(R){u=R,t(0,u)}function E(R){d=R,t(1,d)}return o.$$set=R=>{"record"in R&&t(2,a=R.record),"field"in R&&t(3,l=R.field),"value"in R&&t(0,u=R.value),"graph"in R&&t(1,d=R.graph)},[u,d,a,l,h,b,y,C,E]}class W$e extends uo{constructor(e){super(),co(this,e,V$e,z$e,lo,{record:2,field:3,value:0,graph:1})}}function Hhe(o){let e,t;return{c(){e=re("div"),t=Ht(o[4]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&16&&Fn(t,s[4])},d(s){s&&ke(e)}}}function U$e(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[4]&&Hhe(o);return{c(){e=re("div"),t=re("div"),s=re("div"),a=re("input"),u=Ze(),d=re("input"),b=Ze(),E&&E.c(),Z(a,"type","color"),Z(a,"id",o[3]),Z(a,"class","form-control form-control-color"),a.disabled=l=o[1].readonly&&!o[2],rs(s,"width","64px"),Z(d,"type","text"),Z(d,"id",o[3]),Z(d,"class","form-control"),d.readOnly=h=o[1].readonly&&!o[2],Vo(d,"is-invalid",o[4]),Z(t,"class","input-group "),Z(e,"class","mb-0")},m(R,$){Te(R,e,$),X(e,t),X(t,s),X(s,a),ar(a,o[0]),X(t,u),X(t,d),ar(d,o[0]),X(e,b),E&&E.m(e,null),y||(C=[mn(a,"input",o[6]),mn(d,"input",o[7])],y=!0)},p(R,[$]){$&8&&Z(a,"id",R[3]),$&6&&l!==(l=R[1].readonly&&!R[2])&&(a.disabled=l),$&1&&ar(a,R[0]),$&8&&Z(d,"id",R[3]),$&6&&h!==(h=R[1].readonly&&!R[2])&&(d.readOnly=h),$&1&&d.value!==R[0]&&ar(d,R[0]),$&16&&Vo(d,"is-invalid",R[4]),R[4]?E?E.p(R,$):(E=Hhe(R),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},i:un,o:un,d(R){R&&ke(e),E&&E.d(),y=!1,vi(C)}}}function Y$e(o,e,t){let s,{field:a}=e,{value:l}=e,{isCreateMode:u}=e,{validationErrors:d}=e,{id:h}=e;function b(){l=this.value,t(0,l)}function y(){l=this.value,t(0,l)}return o.$$set=C=>{"field"in C&&t(1,a=C.field),"value"in C&&t(0,l=C.value),"isCreateMode"in C&&t(2,u=C.isCreateMode),"validationErrors"in C&&t(5,d=C.validationErrors),"id"in C&&t(3,h=C.id)},o.$$.update=()=>{o.$$.dirty&34&&t(4,s=Lm(d,a.name))},[l,a,u,h,s,d,b,y]}class X$e extends uo{constructor(e){super(),co(this,e,Y$e,U$e,lo,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function zhe(o){let e,t,s,a,l,u,d,h,b,y,C;return b=nre(o[7][0]),{c(){e=re("div"),t=re("input"),l=Ze(),u=re("label"),d=Ht("Don't Know"),Z(t,"class","form-check-input"),Z(t,"id",s=o[1]+"-3"),Z(t,"type","radio"),t.__value=null,t.value=t.__value,t.disabled=a=o[2].readonly&&!o[3],Vo(t,"is-invalid",o[4]),Z(u,"class","form-check-label"),Z(u,"for",h=o[1]+"-3"),Z(e,"class","form-check form-check-inline"),b.p(t)},m(E,R){Te(E,e,R),X(e,t),t.checked=t.__value===o[0],X(e,l),X(e,u),X(u,d),y||(C=mn(t,"change",o[9]),y=!0)},p(E,R){R&2&&s!==(s=E[1]+"-3")&&Z(t,"id",s),R&12&&a!==(a=E[2].readonly&&!E[3])&&(t.disabled=a),R&1&&(t.checked=t.__value===E[0]),R&16&&Vo(t,"is-invalid",E[4]),R&2&&h!==(h=E[1]+"-3")&&Z(u,"for",h)},d(E){E&&ke(e),b.r(),y=!1,C()}}}function Vhe(o){let e,t;return{c(){e=re("div"),t=Ht(o[4]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&16&&Fn(t,s[4])},d(s){s&&ke(e)}}}function j$e(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve=o[2].nullable&&zhe(o),Re=o[4]&&Vhe(o);return oe=nre(o[7][0]),{c(){e=re("div"),t=re("div"),s=re("input"),u=Ze(),d=re("label"),h=Ht("Yes"),y=Ze(),C=re("div"),E=re("input"),Q=Ze(),F=re("label"),U=Ht("No"),L=Ze(),ve&&ve.c(),te=Ze(),Re&&Re.c(),ne=Rs(),Z(s,"class","form-check-input"),Z(s,"type","radio"),Z(s,"id",a=o[1]+"-1"),s.__value=!0,s.value=s.__value,s.disabled=l=o[2].readonly&&!o[3],Vo(s,"is-invalid",o[4]),Z(d,"class","form-check-label"),Z(d,"for",b=o[1]+"-1"),Z(t,"class","form-check form-check-inline"),Z(E,"class","form-check-input"),Z(E,"type","radio"),Z(E,"id",R=o[1]+"-2"),E.__value=!1,E.value=E.__value,E.disabled=$=o[2].readonly&&!o[3],Vo(E,"is-invalid",o[4]),Z(F,"class","form-check-label"),Z(F,"for",K=o[1]+"-2"),Z(C,"class","form-check form-check-inline"),oe.p(s,E)},m(Oe,ce){Te(Oe,e,ce),X(e,t),X(t,s),s.checked=s.__value===o[0],X(t,u),X(t,d),X(d,h),X(e,y),X(e,C),X(C,E),E.checked=E.__value===o[0],X(C,Q),X(C,F),X(F,U),X(e,L),ve&&ve.m(e,null),Te(Oe,te,ce),Re&&Re.m(Oe,ce),Te(Oe,ne,ce),G||(we=[mn(s,"change",o[6]),mn(E,"change",o[8])],G=!0)},p(Oe,[ce]){ce&2&&a!==(a=Oe[1]+"-1")&&Z(s,"id",a),ce&12&&l!==(l=Oe[2].readonly&&!Oe[3])&&(s.disabled=l),ce&1&&(s.checked=s.__value===Oe[0]),ce&16&&Vo(s,"is-invalid",Oe[4]),ce&2&&b!==(b=Oe[1]+"-1")&&Z(d,"for",b),ce&2&&R!==(R=Oe[1]+"-2")&&Z(E,"id",R),ce&12&&$!==($=Oe[2].readonly&&!Oe[3])&&(E.disabled=$),ce&1&&(E.checked=E.__value===Oe[0]),ce&16&&Vo(E,"is-invalid",Oe[4]),ce&2&&K!==(K=Oe[1]+"-2")&&Z(F,"for",K),Oe[2].nullable?ve?ve.p(Oe,ce):(ve=zhe(Oe),ve.c(),ve.m(e,null)):ve&&(ve.d(1),ve=null),Oe[4]?Re?Re.p(Oe,ce):(Re=Vhe(Oe),Re.c(),Re.m(ne.parentNode,ne)):Re&&(Re.d(1),Re=null)},i:un,o:un,d(Oe){Oe&&ke(e),ve&&ve.d(),Oe&&ke(te),Re&&Re.d(Oe),Oe&&ke(ne),oe.r(),G=!1,vi(we)}}}function q$e(o,e,t){let s,{id:a}=e,{field:l}=e,{value:u}=e,{isCreateMode:d}=e,{validationErrors:h}=e;const b=[[]];function y(){u=this.__value,t(0,u)}function C(){u=this.__value,t(0,u)}function E(){u=this.__value,t(0,u)}return o.$$set=R=>{"id"in R&&t(1,a=R.id),"field"in R&&t(2,l=R.field),"value"in R&&t(0,u=R.value),"isCreateMode"in R&&t(3,d=R.isCreateMode),"validationErrors"in R&&t(5,h=R.validationErrors)},o.$$.update=()=>{o.$$.dirty&36&&t(4,s=Lm(h,l.name))},[u,a,l,d,s,h,y,b,C,E]}class G$e extends uo{constructor(e){super(),co(this,e,q$e,j$e,lo,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function K$e(o){let e,t,s,a;return{c(){e=re("input"),Z(e,"type","number"),Z(e,"id",o[4]),Z(e,"class","form-control"),Z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[3],Vo(e,"is-invalid",o[7])},m(l,u){Te(l,e,u),ar(e,o[0]),s||(a=[mn(e,"change",o[9]),mn(e,"input",o[16])],s=!0)},p(l,u){u&16&&Z(e,"id",l[4]),u&10&&t!==(t=l[1].readonly&&!l[3])&&(e.readOnly=t),u&1&&GH(e.value)!==l[0]&&ar(e,l[0]),u&128&&Vo(e,"is-invalid",l[7])},i:un,o:un,d(l){l&&ke(e),s=!1,vi(a)}}}function J$e(o){let e,t,s,a,l,u,d,h,b,y,C=o[1].optionsFrom&&Whe(o),E=o[0]&&Uhe(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("ul"),C&&C.c(),u=Ze(),E&&E.c(),d=Rs(),Z(t,"type","number"),Z(t,"id",o[4]),Z(t,"placeholder","Search for options"),Z(t,"class","form-control dropdown-toggle"),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[3],Vo(t,"is-invalid",o[7]),Z(l,"class","dropdown-menu w-100"),Z(e,"class","dropdown")},m(R,$){Te(R,e,$),X(e,t),ar(t,o[8]),X(e,a),X(e,l),C&&C.m(l,null),Te(R,u,$),E&&E.m(R,$),Te(R,d,$),h=!0,b||(y=[mn(t,"keyup",function(){Ub(o[5].update)&&o[5].update.apply(this,arguments)}),mn(t,"focus",function(){Ub(o[5].update)&&o[5].update.apply(this,arguments)}),mn(t,"input",o[11])],b=!0)},p(R,$){o=R,(!h||$&16)&&Z(t,"id",o[4]),(!h||$&10&&s!==(s=o[1].readonly&&!o[3]))&&(t.readOnly=s),$&256&&GH(t.value)!==o[8]&&ar(t,o[8]),(!h||$&128)&&Vo(t,"is-invalid",o[7]),o[1].optionsFrom?C?(C.p(o,$),$&2&&xe(C,1)):(C=Whe(o),C.c(),xe(C,1),C.m(l,null)):C&&(mo(),Be(C,1,1,()=>{C=null}),go()),o[0]?E?E.p(o,$):(E=Uhe(o),E.c(),E.m(d.parentNode,d)):E&&(E.d(1),E=null)},i(R){h||(xe(C),h=!0)},o(R){Be(C),h=!1},d(R){R&&ke(e),C&&C.d(),R&&ke(u),E&&E.d(R),R&&ke(d),b=!1,vi(y)}}}function Whe(o){let e,t,s,a;function l(h){o[13](h)}function u(h){o[14](h)}let d={field:o[1],schemas:o[2]};return o[0]!==void 0&&(d.value=o[0]),o[8]!==void 0&&(d.search=o[8]),e=new eV({props:d}),o[12](e),Ro.push(()=>er(e,"value",l)),Ro.push(()=>er(e,"search",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),b&4&&(y.schemas=h[2]),!t&&b&1&&(t=!0,y.value=h[0],lr(()=>t=!1)),!s&&b&256&&(s=!0,y.search=h[8],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){o[12](null),Jt(e,h)}}}function Uhe(o){let e,t,s,a,l,u,d;return{c(){e=re("span"),t=re("div"),s=Ht(o[0]),a=Ze(),l=re("button"),Z(l,"type","button"),Z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),Z(l,"aria-label","Close"),Z(t,"class","d-flex align-items-center "),Z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Te(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),u||(d=mn(l,"click",ku(o[15])),u=!0)},p(h,b){b&1&&Fn(s,h[0])},d(h){h&&ke(e),u=!1,d()}}}function Yhe(o){let e,t;return{c(){e=re("div"),t=Ht(o[7]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&128&&Fn(t,s[7])},d(s){s&&ke(e)}}}function eNe(o){let e,t,s,a,l;const u=[J$e,K$e],d=[];function h(y,C){return y[6]?0:1}t=h(o),s=d[t]=u[t](o);let b=o[7]&&Yhe(o);return{c(){e=re("div"),s.c(),a=Ze(),b&&b.c(),Z(e,"class","mb-0")},m(y,C){Te(y,e,C),d[t].m(e,null),X(e,a),b&&b.m(e,null),l=!0},p(y,[C]){let E=t;t=h(y),t===E?d[t].p(y,C):(mo(),Be(d[E],1,1,()=>{d[E]=null}),go(),s=d[t],s?s.p(y,C):(s=d[t]=u[t](y),s.c()),xe(s,1),s.m(e,a)),y[7]?b?b.p(y,C):(b=Yhe(y),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(y){l||(xe(s),l=!0)},o(y){Be(s),l=!1},d(y){y&&ke(e),d[t].d(),b&&b.d()}}}function tNe(o,e,t){let s,a,l,{field:u}=e,{value:d}=e,{schemas:h}=e,{validationErrors:b}=e,{isCreateMode:y}=e,{id:C}=e,E;function R(ne){const oe=ne.currentTarget.value,G=$(oe);t(0,d=isNaN(G)?null:G)}function $(ne){return parseFloat(ne).toFixed(u.decimals)}function Q(){s=GH(this.value),t(8,s)}function F(ne){Ro[ne?"unshift":"push"](()=>{E=ne,t(5,E)})}function U(ne){d=ne,t(0,d)}function K(ne){s=ne,t(8,s)}const L=ne=>t(0,d="");function te(){d=GH(this.value),t(0,d)}return o.$$set=ne=>{"field"in ne&&t(1,u=ne.field),"value"in ne&&t(0,d=ne.value),"schemas"in ne&&t(2,h=ne.schemas),"validationErrors"in ne&&t(10,b=ne.validationErrors),"isCreateMode"in ne&&t(3,y=ne.isCreateMode),"id"in ne&&t(4,C=ne.id)},o.$$.update=()=>{o.$$.dirty&1026&&t(7,a=Lm(b,u.name)),o.$$.dirty&10&&t(6,l=u.optionsFrom&&!(u.readonly&&!y))},t(8,s=""),[d,u,h,y,C,E,l,a,s,R,b,Q,F,U,K,L,te]}class nNe extends uo{constructor(e){super(),co(this,e,tNe,eNe,lo,{field:1,value:0,schemas:2,validationErrors:10,isCreateMode:3,id:4})}}function Xhe(o){let e,t=o[1].help+"",s;return{c(){e=re("small"),s=Ht(t),Z(e,"class","text-primary opacity-50")},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&2&&t!==(t=a[1].help+"")&&Fn(s,t)},d(a){a&&ke(e)}}}function oNe(o){let e,t,s,a=o[1].label+"",l,u,d,h,b=o[1].name+"",y,C,E,R,$,Q,F,U=o[1].help&&Xhe(o);return{c(){e=re("div"),t=re("div"),s=re("label"),l=Ht(a),u=Ze(),d=re("a"),h=re("code"),y=Ht(b),E=Ze(),R=re("input"),$=Ze(),U&&U.c(),Z(s,"for",o[4]),Z(s,"class","form-label"),Z(h,"class","text-primary opacity-50"),Z(d,"class","text-decoration-none"),Z(d,"href",C=o[3]+"/schemas/"+o[2].name+"/fields/edit/"+o[1].name),Z(t,"class","d-flex justify-content-between"),Z(R,"type","url"),Z(R,"id",o[4]),Z(R,"class","form-control"),Z(R,"placeholder","https://www.example.com"),Z(e,"class","mb-0")},m(K,L){Te(K,e,L),X(e,t),X(t,s),X(s,l),X(t,u),X(t,d),X(d,h),X(h,y),X(e,E),X(e,R),ar(R,o[0]),X(e,$),U&&U.m(e,null),Q||(F=mn(R,"input",o[5]),Q=!0)},p(K,[L]){L&2&&a!==(a=K[1].label+"")&&Fn(l,a),L&2&&b!==(b=K[1].name+"")&&Fn(y,b),L&6&&C!==(C=K[3]+"/schemas/"+K[2].name+"/fields/edit/"+K[1].name)&&Z(d,"href",C),L&1&&R.value!==K[0]&&ar(R,K[0]),K[1].help?U?U.p(K,L):(U=Xhe(K),U.c(),U.m(e,null)):U&&(U.d(1),U=null)},i:un,o:un,d(K){K&&ke(e),U&&U.d(),Q=!1,F()}}}function sNe(o,e,t){const s=Ur("channelurl");let{field:a}=e,{value:l}=e,{schema:u}=e,d=Lc.exports.uniqueId();function h(){l=this.value,t(0,l)}return o.$$set=b=>{"field"in b&&t(1,a=b.field),"value"in b&&t(0,l=b.value),"schema"in b&&t(2,u=b.schema)},[l,a,u,s,d,h]}class rNe extends uo{constructor(e){super(),co(this,e,sNe,oNe,lo,{field:1,value:0,schema:2})}}var coe=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],TD={_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(o){return typeof console<"u"&&console.warn(o)},getWeek:function(o){var e=new Date(o.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},V6={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(o){var e=o%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},Np=function(o,e){return e===void 0&&(e=2),("000"+o).slice(e*-1)},Bb=function(o){return o===!0?1:0};function jhe(o,e){var t;return function(){var s=this,a=arguments;clearTimeout(t),t=setTimeout(function(){return o.apply(s,a)},e)}}var uoe=function(o){return o instanceof Array?o:[o]};function Mg(o,e,t){if(t===!0)return o.classList.add(e);o.classList.remove(e)}function dl(o,e,t){var s=window.document.createElement(o);return e=e||"",t=t||"",s.className=e,t!==void 0&&(s.textContent=t),s}function uH(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function NOe(o,e){if(e(o))return o;if(o.parentNode)return NOe(o.parentNode,e)}function fH(o,e){var t=dl("div","numInputWrapper"),s=dl("input","numInput "+o),a=dl("span","arrowUp"),l=dl("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?s.type="number":(s.type="text",s.pattern="\\d*"),e!==void 0)for(var u in e)s.setAttribute(u,e[u]);return t.appendChild(s),t.appendChild(a),t.appendChild(l),t}function R1(o){try{if(typeof o.composedPath=="function"){var e=o.composedPath();return e[0]}return o.target}catch{return o.target}}var foe=function(){},Hz=function(o,e,t){return t.months[e?"shorthand":"longhand"][o]},iNe={D:foe,F:function(o,e,t){o.setMonth(t.months.longhand.indexOf(e))},G:function(o,e){o.setHours((o.getHours()>=12?12:0)+parseFloat(e))},H:function(o,e){o.setHours(parseFloat(e))},J:function(o,e){o.setDate(parseFloat(e))},K:function(o,e,t){o.setHours(o.getHours()%12+12*Bb(new RegExp(t.amPM[1],"i").test(e)))},M:function(o,e,t){o.setMonth(t.months.shorthand.indexOf(e))},S:function(o,e){o.setSeconds(parseFloat(e))},U:function(o,e){return new Date(parseFloat(e)*1e3)},W:function(o,e,t){var s=parseInt(e),a=new Date(o.getFullYear(),0,2+(s-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+t.firstDayOfWeek),a},Y:function(o,e){o.setFullYear(parseFloat(e))},Z:function(o,e){return new Date(e)},d:function(o,e){o.setDate(parseFloat(e))},h:function(o,e){o.setHours((o.getHours()>=12?12:0)+parseFloat(e))},i:function(o,e){o.setMinutes(parseFloat(e))},j:function(o,e){o.setDate(parseFloat(e))},l:foe,m:function(o,e){o.setMonth(parseFloat(e)-1)},n:function(o,e){o.setMonth(parseFloat(e)-1)},s:function(o,e){o.setSeconds(parseFloat(e))},u:function(o,e){return new Date(parseFloat(e))},w:foe,y:function(o,e){o.setFullYear(2e3+parseFloat(e))}},sE={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})"},b6={Z:function(o){return o.toISOString()},D:function(o,e,t){return e.weekdays.shorthand[b6.w(o,e,t)]},F:function(o,e,t){return Hz(b6.n(o,e,t)-1,!1,e)},G:function(o,e,t){return Np(b6.h(o,e,t))},H:function(o){return Np(o.getHours())},J:function(o,e){return e.ordinal!==void 0?o.getDate()+e.ordinal(o.getDate()):o.getDate()},K:function(o,e){return e.amPM[Bb(o.getHours()>11)]},M:function(o,e){return Hz(o.getMonth(),!0,e)},S:function(o){return Np(o.getSeconds())},U:function(o){return o.getTime()/1e3},W:function(o,e,t){return t.getWeek(o)},Y:function(o){return Np(o.getFullYear(),4)},d:function(o){return Np(o.getDate())},h:function(o){return o.getHours()%12?o.getHours()%12:12},i:function(o){return Np(o.getMinutes())},j:function(o){return o.getDate()},l:function(o,e){return e.weekdays.longhand[o.getDay()]},m:function(o){return Np(o.getMonth()+1)},n:function(o){return o.getMonth()+1},s:function(o){return o.getSeconds()},u:function(o){return o.getTime()},w:function(o){return o.getDay()},y:function(o){return String(o.getFullYear()).substring(2)}},IOe=function(o){var e=o.config,t=e===void 0?TD:e,s=o.l10n,a=s===void 0?V6:s,l=o.isMobile,u=l===void 0?!1:l;return function(d,h,b){var y=b||a;return t.formatDate!==void 0&&!u?t.formatDate(d,h,y):h.split("").map(function(C,E,R){return b6[C]&&R[E-1]!=="\\"?b6[C](d,y,t):C!=="\\"?C:""}).join("")}},Hse=function(o){var e=o.config,t=e===void 0?TD:e,s=o.l10n,a=s===void 0?V6:s;return function(l,u,d,h){if(!(l!==0&&!l)){var b=h||a,y,C=l;if(l instanceof Date)y=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)y=new Date(l);else if(typeof l=="string"){var E=u||(t||TD).dateFormat,R=String(l).trim();if(R==="today")y=new Date,d=!0;else if(t&&t.parseDate)y=t.parseDate(l,E);else if(/Z$/.test(R)||/GMT$/.test(R))y=new Date(l);else{for(var $=void 0,Q=[],F=0,U=0,K="";F<E.length;F++){var L=E[F],te=L==="\\",ne=E[F-1]==="\\"||te;if(sE[L]&&!ne){K+=sE[L];var oe=new RegExp(K).exec(l);oe&&($=!0)&&Q[L!=="Y"?"push":"unshift"]({fn:iNe[L],val:oe[++U]})}else te||(K+=".")}y=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),Q.forEach(function(G){var we=G.fn,ve=G.val;return y=we(y,ve,b)||y}),y=$?y:void 0}}if(!(y instanceof Date&&!isNaN(y.getTime()))){t.errorHandler(new Error("Invalid date provided: "+C));return}return d===!0&&y.setHours(0,0,0,0),y}}};function N1(o,e,t){return t===void 0&&(t=!0),t!==!1?new Date(o.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):o.getTime()-e.getTime()}var aNe=function(o,e,t){return o>Math.min(e,t)&&o<Math.max(e,t)},doe=function(o,e,t){return o*3600+e*60+t},lNe=function(o){var e=Math.floor(o/3600),t=(o-e*3600)/60;return[e,t,o-e*3600-t*60]},cNe={DAY:864e5};function hoe(o){var e=o.defaultHour,t=o.defaultMinute,s=o.defaultSeconds;if(o.minDate!==void 0){var a=o.minDate.getHours(),l=o.minDate.getMinutes(),u=o.minDate.getSeconds();e<a&&(e=a),e===a&&t<l&&(t=l),e===a&&t===l&&s<u&&(s=o.minDate.getSeconds())}if(o.maxDate!==void 0){var d=o.maxDate.getHours(),h=o.maxDate.getMinutes();e=Math.min(e,d),e===d&&(t=Math.min(h,t)),e===d&&t===h&&(s=o.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:s}}typeof Object.assign!="function"&&(Object.assign=function(o){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!o)throw TypeError("Cannot convert undefined or null to object");for(var s=function(d){d&&Object.keys(d).forEach(function(h){return o[h]=d[h]})},a=0,l=e;a<l.length;a++){var u=l[a];s(u)}return o});var $m=globalThis&&globalThis.__assign||function(){return $m=Object.assign||function(o){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)&&(o[a]=e[a])}return o},$m.apply(this,arguments)},qhe=globalThis&&globalThis.__spreadArrays||function(){for(var o=0,e=0,t=arguments.length;e<t;e++)o+=arguments[e].length;for(var s=Array(o),a=0,e=0;e<t;e++)for(var l=arguments[e],u=0,d=l.length;u<d;u++,a++)s[a]=l[u];return s},uNe=300;function fNe(o,e){var t={config:$m($m({},TD),Cf.defaultConfig),l10n:V6};t.parseDate=Hse({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=Q,t._setHoursFromDate=E,t._positionCalendar=bn,t.changeMonth=He,t.changeYear=mt,t.clear=st,t.close=rn,t.onMouseOver=Yo,t._createElement=dl,t.createDay=oe,t.destroy=Et,t.isEnabled=he,t.jumpToDate=K,t.updateValue=ln,t.open=kt,t.redraw=zn,t.set=Mr,t.setDate=tr,t.toggle=$o;function s(){t.utils={getDaysInMonth:function(ze,et){return ze===void 0&&(ze=t.currentMonth),et===void 0&&(et=t.currentYear),ze===1&&(et%4===0&&et%100!==0||et%400===0)?29:t.l10n.daysInMonth[ze]}}}function a(){t.element=t.input=o,t.isOpen=!1,pt(),Gt(),dr(),wa(),s(),t.isMobile||ne(),U(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&E(t.config.noCalendar?t.latestSelectedDateObj:void 0),ln(!1)),d();var ze=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&ze&&bn(),Po("onReady")}function l(){var ze;return((ze=t.calendarContainer)===null||ze===void 0?void 0:ze.getRootNode()).activeElement||document.activeElement}function u(ze){return ze.bind(t)}function d(){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 et=(t.days.offsetWidth+1)*ze.showMonths;t.daysContainer.style.width=et+"px",t.calendarContainer.style.width=et+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function h(ze){if(t.selectedDates.length===0){var et=t.config.minDate===void 0||N1(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),Tt=hoe(t.config);et.setHours(Tt.hours,Tt.minutes,Tt.seconds,et.getMilliseconds()),t.selectedDates=[et],t.latestSelectedDateObj=et}ze!==void 0&&ze.type!=="blur"&&Qi(ze);var Wt=t._input.value;C(),ln(),t._input.value!==Wt&&t._debouncedChange()}function b(ze,et){return ze%12+12*Bb(et===t.l10n.amPM[1])}function y(ze){switch(ze%24){case 0:case 12:return 12;default:return ze%12}}function C(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var ze=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,et=(parseInt(t.minuteElement.value,10)||0)%60,Tt=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(ze=b(ze,t.amPM.textContent));var Wt=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&N1(t.latestSelectedDateObj,t.config.minDate,!0)===0,Yn=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&N1(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 po=doe(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),wo=doe(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),fn=doe(ze,et,Tt);if(fn>wo&&fn<po){var os=lNe(po);ze=os[0],et=os[1],Tt=os[2]}}else{if(Yn){var xo=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;ze=Math.min(ze,xo.getHours()),ze===xo.getHours()&&(et=Math.min(et,xo.getMinutes())),et===xo.getMinutes()&&(Tt=Math.min(Tt,xo.getSeconds()))}if(Wt){var fs=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;ze=Math.max(ze,fs.getHours()),ze===fs.getHours()&&et<fs.getMinutes()&&(et=fs.getMinutes()),et===fs.getMinutes()&&(Tt=Math.max(Tt,fs.getSeconds()))}}R(ze,et,Tt)}}function E(ze){var et=ze||t.latestSelectedDateObj;et&&et instanceof Date&&R(et.getHours(),et.getMinutes(),et.getSeconds())}function R(ze,et,Tt){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(ze%24,et,Tt||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Np(t.config.time_24hr?ze:(12+ze)%12+12*Bb(ze%12===0)),t.minuteElement.value=Np(et),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Bb(ze>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Np(Tt)))}function $(ze){var et=R1(ze),Tt=parseInt(et.value)+(ze.delta||0);(Tt/1e3>1||ze.key==="Enter"&&!/[^\d]/.test(Tt.toString()))&&mt(Tt)}function Q(ze,et,Tt,Wt){if(et instanceof Array)return et.forEach(function(Yn){return Q(ze,Yn,Tt,Wt)});if(ze instanceof Array)return ze.forEach(function(Yn){return Q(Yn,et,Tt,Wt)});ze.addEventListener(et,Tt,Wt),t._handlers.push({remove:function(){return ze.removeEventListener(et,Tt,Wt)}})}function F(){Po("onChange")}function U(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(Tt){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+Tt+"]"),function(Wt){return Q(Wt,"click",t[Tt])})}),t.isMobile){qr();return}var ze=jhe(as,50);if(t._debouncedChange=jhe(F,uNe),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&Q(t.daysContainer,"mouseover",function(Tt){t.config.mode==="range"&&Yo(R1(Tt))}),Q(t._input,"keydown",so),t.calendarContainer!==void 0&&Q(t.calendarContainer,"keydown",so),!t.config.inline&&!t.config.static&&Q(window,"resize",ze),window.ontouchstart!==void 0?Q(window.document,"touchstart",je):Q(window.document,"mousedown",je),Q(window.document,"focus",je,{capture:!0}),t.config.clickOpens===!0&&(Q(t._input,"focus",t.open),Q(t._input,"click",t.open)),t.daysContainer!==void 0&&(Q(t.monthNav,"click",vs),Q(t.monthNav,["keyup","increment"],$),Q(t.daysContainer,"click",oo)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var et=function(Tt){return R1(Tt).select()};Q(t.timeContainer,["increment"],h),Q(t.timeContainer,"blur",h,{capture:!0}),Q(t.timeContainer,"click",L),Q([t.hourElement,t.minuteElement],["focus","click"],et),t.secondElement!==void 0&&Q(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&Q(t.amPM,"click",function(Tt){h(Tt)})}t.config.allowInput&&Q(t._input,"blur",Kn)}function K(ze,et){var Tt=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,Yn=t.currentMonth;try{Tt!==void 0&&(t.currentYear=Tt.getFullYear(),t.currentMonth=Tt.getMonth())}catch(po){po.message="Invalid date supplied: "+Tt,t.config.errorHandler(po)}et&&t.currentYear!==Wt&&(Po("onYearChange"),Xe()),et&&(t.currentYear!==Wt||t.currentMonth!==Yn)&&Po("onMonthChange"),t.redraw()}function L(ze){var et=R1(ze);~et.className.indexOf("arrow")&&te(ze,et.classList.contains("arrowUp")?1:-1)}function te(ze,et,Tt){var Wt=ze&&R1(ze),Yn=Tt||Wt&&Wt.parentNode&&Wt.parentNode.firstChild,po=Rr("increment");po.delta=et,Yn&&Yn.dispatchEvent(po)}function ne(){var ze=window.document.createDocumentFragment();if(t.calendarContainer=dl("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(ze.appendChild(V()),t.innerContainer=dl("div","flatpickr-innerContainer"),t.config.weekNumbers){var et=Ct(),Tt=et.weekWrapper,Wt=et.weekNumbers;t.innerContainer.appendChild(Tt),t.weekNumbers=Wt,t.weekWrapper=Tt}t.rContainer=dl("div","flatpickr-rContainer"),t.rContainer.appendChild(Qe()),t.daysContainer||(t.daysContainer=dl("div","flatpickr-days"),t.daysContainer.tabIndex=-1),ce(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),ze.appendChild(t.innerContainer)}t.config.enableTime&&ze.appendChild(ut()),Mg(t.calendarContainer,"rangeMode",t.config.mode==="range"),Mg(t.calendarContainer,"animate",t.config.animate===!0),Mg(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(ze);var Yn=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&&(!Yn&&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 po=dl("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(po,t.element),po.appendChild(t.element),t.altInput&&po.appendChild(t.altInput),po.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function oe(ze,et,Tt,Wt){var Yn=he(et,!0),po=dl("span",ze,et.getDate().toString());return po.dateObj=et,po.$i=Wt,po.setAttribute("aria-label",t.formatDate(et,t.config.ariaDateFormat)),ze.indexOf("hidden")===-1&&N1(et,t.now)===0&&(t.todayDateElem=po,po.classList.add("today"),po.setAttribute("aria-current","date")),Yn?(po.tabIndex=-1,Ls(et)&&(po.classList.add("selected"),t.selectedDateElem=po,t.config.mode==="range"&&(Mg(po,"startRange",t.selectedDates[0]&&N1(et,t.selectedDates[0],!0)===0),Mg(po,"endRange",t.selectedDates[1]&&N1(et,t.selectedDates[1],!0)===0),ze==="nextMonthDay"&&po.classList.add("inRange")))):po.classList.add("flatpickr-disabled"),t.config.mode==="range"&&aa(et)&&!Ls(et)&&po.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(et)+"</span>"),Po("onDayCreate",po),po}function G(ze){ze.focus(),t.config.mode==="range"&&Yo(ze)}function we(ze){for(var et=ze>0?0:t.config.showMonths-1,Tt=ze>0?t.config.showMonths:-1,Wt=et;Wt!=Tt;Wt+=ze)for(var Yn=t.daysContainer.children[Wt],po=ze>0?0:Yn.children.length-1,wo=ze>0?Yn.children.length:-1,fn=po;fn!=wo;fn+=ze){var os=Yn.children[fn];if(os.className.indexOf("hidden")===-1&&he(os.dateObj))return os}}function ve(ze,et){for(var Tt=ze.className.indexOf("Month")===-1?ze.dateObj.getMonth():t.currentMonth,Wt=et>0?t.config.showMonths:-1,Yn=et>0?1:-1,po=Tt-t.currentMonth;po!=Wt;po+=Yn)for(var wo=t.daysContainer.children[po],fn=Tt-t.currentMonth===po?ze.$i+et:et<0?wo.children.length-1:0,os=wo.children.length,xo=fn;xo>=0&&xo<os&&xo!=(et>0?os:-1);xo+=Yn){var fs=wo.children[xo];if(fs.className.indexOf("hidden")===-1&&he(fs.dateObj)&&Math.abs(ze.$i-xo)>=Math.abs(et))return G(fs)}t.changeMonth(Yn),Re(we(Yn),0)}function Re(ze,et){var Tt=l(),Wt=Zo(Tt||document.body),Yn=ze!==void 0?ze:Wt?Tt:t.selectedDateElem!==void 0&&Zo(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Zo(t.todayDateElem)?t.todayDateElem:we(et>0?1:-1);Yn===void 0?t._input.focus():Wt?ve(Yn,et):G(Yn)}function Oe(ze,et){for(var Tt=(new Date(ze,et,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Wt=t.utils.getDaysInMonth((et-1+12)%12,ze),Yn=t.utils.getDaysInMonth(et,ze),po=window.document.createDocumentFragment(),wo=t.config.showMonths>1,fn=wo?"prevMonthDay hidden":"prevMonthDay",os=wo?"nextMonthDay hidden":"nextMonthDay",xo=Wt+1-Tt,fs=0;xo<=Wt;xo++,fs++)po.appendChild(oe("flatpickr-day "+fn,new Date(ze,et-1,xo),xo,fs));for(xo=1;xo<=Yn;xo++,fs++)po.appendChild(oe("flatpickr-day",new Date(ze,et,xo),xo,fs));for(var kr=Yn+1;kr<=42-Tt&&(t.config.showMonths===1||fs%7!==0);kr++,fs++)po.appendChild(oe("flatpickr-day "+os,new Date(ze,et+1,kr%Yn),kr,fs));var Lr=dl("div","dayContainer");return Lr.appendChild(po),Lr}function ce(){if(t.daysContainer!==void 0){uH(t.daysContainer),t.weekNumbers&&uH(t.weekNumbers);for(var ze=document.createDocumentFragment(),et=0;et<t.config.showMonths;et++){var Tt=new Date(t.currentYear,t.currentMonth,1);Tt.setMonth(t.currentMonth+et),ze.appendChild(Oe(Tt.getFullYear(),Tt.getMonth()))}t.daysContainer.appendChild(ze),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Yo()}}function Xe(){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 et=0;et<12;et++)if(!!ze(et)){var Tt=dl("option","flatpickr-monthDropdown-month");Tt.value=new Date(t.currentYear,et).getMonth().toString(),Tt.textContent=Hz(et,t.config.shorthandCurrentMonth,t.l10n),Tt.tabIndex=-1,t.currentMonth===et&&(Tt.selected=!0),t.monthsDropdownContainer.appendChild(Tt)}}}function tt(){var ze=dl("div","flatpickr-month"),et=window.document.createDocumentFragment(),Tt;t.config.showMonths>1||t.config.monthSelectorType==="static"?Tt=dl("span","cur-month"):(t.monthsDropdownContainer=dl("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),Q(t.monthsDropdownContainer,"change",function(wo){var fn=R1(wo),os=parseInt(fn.value,10);t.changeMonth(os-t.currentMonth),Po("onMonthChange")}),Xe(),Tt=t.monthsDropdownContainer);var Wt=fH("cur-year",{tabindex:"-1"}),Yn=Wt.getElementsByTagName("input")[0];Yn.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Yn.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Yn.setAttribute("max",t.config.maxDate.getFullYear().toString()),Yn.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var po=dl("div","flatpickr-current-month");return po.appendChild(Tt),po.appendChild(Wt),et.appendChild(po),ze.appendChild(et),{container:ze,yearElement:Yn,monthElement:Tt}}function ot(){uH(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var ze=t.config.showMonths;ze--;){var et=tt();t.yearElements.push(et.yearElement),t.monthElements.push(et.monthElement),t.monthNav.appendChild(et.container)}t.monthNav.appendChild(t.nextMonthNav)}function V(){return t.monthNav=dl("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dl("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dl("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,ot(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(ze){t.__hidePrevMonthArrow!==ze&&(Mg(t.prevMonthNav,"flatpickr-disabled",ze),t.__hidePrevMonthArrow=ze)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(ze){t.__hideNextMonthArrow!==ze&&(Mg(t.nextMonthNav,"flatpickr-disabled",ze),t.__hideNextMonthArrow=ze)}}),t.currentYearElement=t.yearElements[0],bs(),t.monthNav}function ut(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var ze=hoe(t.config);t.timeContainer=dl("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var et=dl("span","flatpickr-time-separator",":"),Tt=fH("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=Tt.getElementsByTagName("input")[0];var Wt=fH("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Wt.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Np(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?ze.hours:y(ze.hours)),t.minuteElement.value=Np(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(Tt),t.timeContainer.appendChild(et),t.timeContainer.appendChild(Wt),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Yn=fH("flatpickr-second");t.secondElement=Yn.getElementsByTagName("input")[0],t.secondElement.value=Np(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(dl("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Yn)}return t.config.time_24hr||(t.amPM=dl("span","flatpickr-am-pm",t.l10n.amPM[Bb((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 Qe(){t.weekdayContainer?uH(t.weekdayContainer):t.weekdayContainer=dl("div","flatpickr-weekdays");for(var ze=t.config.showMonths;ze--;){var et=dl("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(et)}return Bt(),t.weekdayContainer}function Bt(){if(!!t.weekdayContainer){var ze=t.l10n.firstDayOfWeek,et=qhe(t.l10n.weekdays.shorthand);ze>0&&ze<et.length&&(et=qhe(et.splice(ze,et.length),et.splice(0,ze)));for(var Tt=t.config.showMonths;Tt--;)t.weekdayContainer.children[Tt].innerHTML=`
|
|
<span class='flatpickr-weekday'>
|
|
`+et.join("</span><span class='flatpickr-weekday'>")+`
|
|
</span>
|
|
`}}function Ct(){t.calendarContainer.classList.add("hasWeeks");var ze=dl("div","flatpickr-weekwrapper");ze.appendChild(dl("span","flatpickr-weekday",t.l10n.weekAbbreviation));var et=dl("div","flatpickr-weeks");return ze.appendChild(et),{weekWrapper:ze,weekNumbers:et}}function He(ze,et){et===void 0&&(et=!0);var Tt=et?ze:ze-t.currentMonth;Tt<0&&t._hidePrevMonthArrow===!0||Tt>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Tt,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Po("onYearChange"),Xe()),ce(),Po("onMonthChange"),bs())}function st(ze,et){if(ze===void 0&&(ze=!0),et===void 0&&(et=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,et===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Tt=hoe(t.config),Wt=Tt.hours,Yn=Tt.minutes,po=Tt.seconds;R(Wt,Yn,po)}t.redraw(),ze&&Po("onChange")}function rn(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Po("onClose")}function Et(){t.config!==void 0&&Po("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 et=t.calendarContainer.parentNode;if(et.lastChild&&et.removeChild(et.lastChild),et.parentNode){for(;et.firstChild;)et.parentNode.insertBefore(et.firstChild,et);et.parentNode.removeChild(et)}}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(Tt){try{delete t[Tt]}catch{}})}function Cn(ze){return t.calendarContainer.contains(ze)}function je(ze){if(t.isOpen&&!t.config.inline){var et=R1(ze),Tt=Cn(et),Wt=et===t.input||et===t.altInput||t.element.contains(et)||ze.path&&ze.path.indexOf&&(~ze.path.indexOf(t.input)||~ze.path.indexOf(t.altInput)),Yn=!Wt&&!Tt&&!Cn(ze.relatedTarget),po=!t.config.ignoredFocusElements.some(function(wo){return wo.contains(et)});Yn&&po&&(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&&h(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function mt(ze){if(!(!ze||t.config.minDate&&ze<t.config.minDate.getFullYear()||t.config.maxDate&&ze>t.config.maxDate.getFullYear())){var et=ze,Tt=t.currentYear!==et;t.currentYear=et||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)),Tt&&(t.redraw(),Po("onYearChange"),Xe())}}function he(ze,et){var Tt;et===void 0&&(et=!0);var Wt=t.parseDate(ze,void 0,et);if(t.config.minDate&&Wt&&N1(Wt,t.config.minDate,et!==void 0?et:!t.minDateHasTime)<0||t.config.maxDate&&Wt&&N1(Wt,t.config.maxDate,et!==void 0?et:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Wt===void 0)return!1;for(var Yn=!!t.config.enable,po=(Tt=t.config.enable)!==null&&Tt!==void 0?Tt:t.config.disable,wo=0,fn=void 0;wo<po.length;wo++){if(fn=po[wo],typeof fn=="function"&&fn(Wt))return Yn;if(fn instanceof Date&&Wt!==void 0&&fn.getTime()===Wt.getTime())return Yn;if(typeof fn=="string"){var os=t.parseDate(fn,void 0,!0);return os&&os.getTime()===Wt.getTime()?Yn:!Yn}else if(typeof fn=="object"&&Wt!==void 0&&fn.from&&fn.to&&Wt.getTime()>=fn.from.getTime()&&Wt.getTime()<=fn.to.getTime())return Yn}return!Yn}function Zo(ze){return t.daysContainer!==void 0?ze.className.indexOf("hidden")===-1&&ze.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(ze):!1}function Kn(ze){var et=ze.target===t._input,Tt=t._input.value.trimEnd()!==_a();et&&Tt&&!(ze.relatedTarget&&Cn(ze.relatedTarget))&&t.setDate(t._input.value,!0,ze.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function so(ze){var et=R1(ze),Tt=t.config.wrap?o.contains(et):et===t._input,Wt=t.config.allowInput,Yn=t.isOpen&&(!Wt||!Tt),po=t.config.inline&&Tt&&!Wt;if(ze.keyCode===13&&Tt){if(Wt)return t.setDate(t._input.value,!0,et===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),et.blur();t.open()}else if(Cn(et)||Yn||po){var wo=!!t.timeContainer&&t.timeContainer.contains(et);switch(ze.keyCode){case 13:wo?(ze.preventDefault(),h(),ps()):oo(ze);break;case 27:ze.preventDefault(),ps();break;case 8:case 46:Tt&&!t.config.allowInput&&(ze.preventDefault(),t.clear());break;case 37:case 39:if(!wo&&!Tt){ze.preventDefault();var fn=l();if(t.daysContainer!==void 0&&(Wt===!1||fn&&Zo(fn))){var os=ze.keyCode===39?1:-1;ze.ctrlKey?(ze.stopPropagation(),He(os),Re(we(1),0)):Re(void 0,os)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:ze.preventDefault();var xo=ze.keyCode===40?1:-1;t.daysContainer&&et.$i!==void 0||et===t.input||et===t.altInput?ze.ctrlKey?(ze.stopPropagation(),mt(t.currentYear-xo),Re(we(1),0)):wo||Re(void 0,xo*7):et===t.currentYearElement?mt(t.currentYear-xo):t.config.enableTime&&(!wo&&t.hourElement&&t.hourElement.focus(),h(ze),t._debouncedChange());break;case 9:if(wo){var fs=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Vs){return Vs}),kr=fs.indexOf(et);if(kr!==-1){var Lr=fs[kr+(ze.shiftKey?-1:1)];ze.preventDefault(),(Lr||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(et)&&ze.shiftKey&&(ze.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&et===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],C(),ln();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],C(),ln();break}(Tt||Cn(et))&&Po("onKeyDown",ze)}function Yo(ze,et){if(et===void 0&&(et="flatpickr-day"),!(t.selectedDates.length!==1||ze&&(!ze.classList.contains(et)||ze.classList.contains("flatpickr-disabled")))){for(var Tt=ze?ze.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Wt=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Yn=Math.min(Tt,t.selectedDates[0].getTime()),po=Math.max(Tt,t.selectedDates[0].getTime()),wo=!1,fn=0,os=0,xo=Yn;xo<po;xo+=cNe.DAY)he(new Date(xo),!0)||(wo=wo||xo>Yn&&xo<po,xo<Wt&&(!fn||xo>fn)?fn=xo:xo>Wt&&(!os||xo<os)&&(os=xo));var fs=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+et));fs.forEach(function(kr){var Lr=kr.dateObj,Vs=Lr.getTime(),Yr=fn>0&&Vs<fn||os>0&&Vs>os;if(Yr){kr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Zi){kr.classList.remove(Zi)});return}else if(wo&&!Yr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Zi){kr.classList.remove(Zi)}),ze!==void 0&&(ze.classList.add(Tt<=t.selectedDates[0].getTime()?"startRange":"endRange"),Wt<Tt&&Vs===Wt?kr.classList.add("startRange"):Wt>Tt&&Vs===Wt&&kr.classList.add("endRange"),Vs>=fn&&(os===0||Vs<=os)&&aNe(Vs,Wt,Tt)&&kr.classList.add("inRange"))})}}function as(){t.isOpen&&!t.config.static&&!t.config.inline&&bn()}function kt(ze,et){if(et===void 0&&(et=t._positionElement),t.isMobile===!0){if(ze){ze.preventDefault();var Tt=R1(ze);Tt&&Tt.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Po("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"),Po("onOpen"),bn(et)),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 jt(ze){return function(et){var Tt=t.config["_"+ze+"Date"]=t.parseDate(et,t.config.dateFormat),Wt=t.config["_"+(ze==="min"?"max":"min")+"Date"];Tt!==void 0&&(t[ze==="min"?"minDateHasTime":"maxDateHasTime"]=Tt.getHours()>0||Tt.getMinutes()>0||Tt.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Yn){return he(Yn)}),!t.selectedDates.length&&ze==="min"&&E(Tt),ln()),t.daysContainer&&(zn(),Tt!==void 0?t.currentYearElement[ze]=Tt.getFullYear().toString():t.currentYearElement.removeAttribute(ze),t.currentYearElement.disabled=!!Wt&&Tt!==void 0&&Wt.getFullYear()===Tt.getFullYear())}}function pt(){var ze=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],et=$m($m({},JSON.parse(JSON.stringify(o.dataset||{}))),e),Tt={};t.config.parseDate=et.parseDate,t.config.formatDate=et.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(fs){t.config._enable=Xs(fs)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(fs){t.config._disable=Xs(fs)}});var Wt=et.mode==="time";if(!et.dateFormat&&(et.enableTime||Wt)){var Yn=Cf.defaultConfig.dateFormat||TD.dateFormat;Tt.dateFormat=et.noCalendar||Wt?"H:i"+(et.enableSeconds?":S":""):Yn+" H:i"+(et.enableSeconds?":S":"")}if(et.altInput&&(et.enableTime||Wt)&&!et.altFormat){var po=Cf.defaultConfig.altFormat||TD.altFormat;Tt.altFormat=et.noCalendar||Wt?"h:i"+(et.enableSeconds?":S K":" K"):po+(" h:i"+(et.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:jt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:jt("max")});var wo=function(fs){return function(kr){t.config[fs==="min"?"_minTime":"_maxTime"]=t.parseDate(kr,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:wo("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:wo("max")}),et.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,Tt,et);for(var fn=0;fn<ze.length;fn++)t.config[ze[fn]]=t.config[ze[fn]]===!0||t.config[ze[fn]]==="true";coe.filter(function(fs){return t.config[fs]!==void 0}).forEach(function(fs){t.config[fs]=uoe(t.config[fs]||[]).map(u)}),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 fn=0;fn<t.config.plugins.length;fn++){var os=t.config.plugins[fn](t)||{};for(var xo in os)coe.indexOf(xo)>-1?t.config[xo]=uoe(os[xo]).map(u).concat(t.config[xo]):typeof et[xo]>"u"&&(t.config[xo]=os[xo])}et.altInputClass||(t.config.altInputClass=Ne().className+" "+t.config.altInputClass),Po("onParseConfig")}function Ne(){return t.config.wrap?o.querySelector("[data-input]"):o}function Gt(){typeof t.config.locale!="object"&&typeof Cf.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=$m($m({},Cf.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Cf.l10ns[t.config.locale]:void 0),sE.D="("+t.l10n.weekdays.shorthand.join("|")+")",sE.l="("+t.l10n.weekdays.longhand.join("|")+")",sE.M="("+t.l10n.months.shorthand.join("|")+")",sE.F="("+t.l10n.months.longhand.join("|")+")",sE.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var ze=$m($m({},e),JSON.parse(JSON.stringify(o.dataset||{})));ze.time_24hr===void 0&&Cf.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=IOe(t),t.parseDate=Hse({config:t.config,l10n:t.l10n})}function bn(ze){if(typeof t.config.position=="function")return void t.config.position(t,ze);if(t.calendarContainer!==void 0){Po("onPreCalendarPosition");var et=ze||t._positionElement,Tt=Array.prototype.reduce.call(t.calendarContainer.children,function(Go,ei){return Go+ei.offsetHeight},0),Wt=t.calendarContainer.offsetWidth,Yn=t.config.position.split(" "),po=Yn[0],wo=Yn.length>1?Yn[1]:null,fn=et.getBoundingClientRect(),os=window.innerHeight-fn.bottom,xo=po==="above"||po!=="below"&&os<Tt&&fn.top>Tt,fs=window.pageYOffset+fn.top+(xo?-Tt-2:et.offsetHeight+2);if(Mg(t.calendarContainer,"arrowTop",!xo),Mg(t.calendarContainer,"arrowBottom",xo),!t.config.inline){var kr=window.pageXOffset+fn.left,Lr=!1,Vs=!1;wo==="center"?(kr-=(Wt-fn.width)/2,Lr=!0):wo==="right"&&(kr-=Wt-fn.width,Vs=!0),Mg(t.calendarContainer,"arrowLeft",!Lr&&!Vs),Mg(t.calendarContainer,"arrowCenter",Lr),Mg(t.calendarContainer,"arrowRight",Vs);var Yr=window.document.body.offsetWidth-(window.pageXOffset+fn.right),Zi=kr+Wt>window.document.body.offsetWidth,Qa=Yr+Wt>window.document.body.offsetWidth;if(Mg(t.calendarContainer,"rightMost",Zi),!t.config.static)if(t.calendarContainer.style.top=fs+"px",!Zi)t.calendarContainer.style.left=kr+"px",t.calendarContainer.style.right="auto";else if(!Qa)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Yr+"px";else{var Oi=At();if(Oi===void 0)return;var Ge=window.document.body.offsetWidth,qe=Math.max(0,Ge/2-Wt/2),Nt=".flatpickr-calendar.centerMost:before",Ut=".flatpickr-calendar.centerMost:after",bo=Oi.cssRules.length,Lo="{left:"+fn.left+"px;right:auto;}";Mg(t.calendarContainer,"rightMost",!1),Mg(t.calendarContainer,"centerMost",!0),Oi.insertRule(Nt+","+Ut+Lo,bo),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function At(){for(var ze=null,et=0;et<document.styleSheets.length;et++){var Tt=document.styleSheets[et];if(!!Tt.cssRules){try{Tt.cssRules}catch{continue}ze=Tt;break}}return ze!=null?ze:An()}function An(){var ze=document.createElement("style");return document.head.appendChild(ze),ze.sheet}function zn(){t.config.noCalendar||t.isMobile||(Xe(),bs(),ce())}function ps(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function oo(ze){ze.preventDefault(),ze.stopPropagation();var et=function(fs){return fs.classList&&fs.classList.contains("flatpickr-day")&&!fs.classList.contains("flatpickr-disabled")&&!fs.classList.contains("notAllowed")},Tt=NOe(R1(ze),et);if(Tt!==void 0){var Wt=Tt,Yn=t.latestSelectedDateObj=new Date(Wt.dateObj.getTime()),po=(Yn.getMonth()<t.currentMonth||Yn.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Wt,t.config.mode==="single")t.selectedDates=[Yn];else if(t.config.mode==="multiple"){var wo=Ls(Yn);wo?t.selectedDates.splice(parseInt(wo),1):t.selectedDates.push(Yn)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Yn,t.selectedDates.push(Yn),N1(Yn,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(fs,kr){return fs.getTime()-kr.getTime()}));if(C(),po){var fn=t.currentYear!==Yn.getFullYear();t.currentYear=Yn.getFullYear(),t.currentMonth=Yn.getMonth(),fn&&(Po("onYearChange"),Xe()),Po("onMonthChange")}if(bs(),ce(),ln(),!po&&t.config.mode!=="range"&&t.config.showMonths===1?G(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 os=t.config.mode==="single"&&!t.config.enableTime,xo=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(os||xo)&&ps()}F()}}var Ss={locale:[Gt,Bt],showMonths:[ot,d,Qe],minDate:[K],maxDate:[K],positionElement:[Ns],clickOpens:[function(){t.config.clickOpens===!0?(Q(t._input,"focus",t.open),Q(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Mr(ze,et){if(ze!==null&&typeof ze=="object"){Object.assign(t.config,ze);for(var Tt in ze)Ss[Tt]!==void 0&&Ss[Tt].forEach(function(Wt){return Wt()})}else t.config[ze]=et,Ss[ze]!==void 0?Ss[ze].forEach(function(Wt){return Wt()}):coe.indexOf(ze)>-1&&(t.config[ze]=uoe(et));t.redraw(),ln(!0)}function $s(ze,et){var Tt=[];if(ze instanceof Array)Tt=ze.map(function(Wt){return t.parseDate(Wt,et)});else if(ze instanceof Date||typeof ze=="number")Tt=[t.parseDate(ze,et)];else if(typeof ze=="string")switch(t.config.mode){case"single":case"time":Tt=[t.parseDate(ze,et)];break;case"multiple":Tt=ze.split(t.config.conjunction).map(function(Wt){return t.parseDate(Wt,et)});break;case"range":Tt=ze.split(t.l10n.rangeSeparator).map(function(Wt){return t.parseDate(Wt,et)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(ze)));t.selectedDates=t.config.allowInvalidPreload?Tt:Tt.filter(function(Wt){return Wt instanceof Date&&he(Wt,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Wt,Yn){return Wt.getTime()-Yn.getTime()})}function tr(ze,et,Tt){if(et===void 0&&(et=!1),Tt===void 0&&(Tt=t.config.dateFormat),ze!==0&&!ze||ze instanceof Array&&ze.length===0)return t.clear(et);$s(ze,Tt),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),K(void 0,et),E(),t.selectedDates.length===0&&t.clear(!1),ln(et),et&&Po("onChange")}function Xs(ze){return ze.slice().map(function(et){return typeof et=="string"||typeof et=="number"||et instanceof Date?t.parseDate(et,void 0,!0):et&&typeof et=="object"&&et.from&&et.to?{from:t.parseDate(et.from,void 0),to:t.parseDate(et.to,void 0)}:et}).filter(function(et){return et})}function wa(){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&&$s(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 dr(){if(t.input=Ne(),!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=dl(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 qr(){var ze=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=dl("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{}Q(t.mobileInput,"change",function(et){t.setDate(R1(et).value,!1,t.mobileFormatStr),Po("onChange"),Po("onClose")})}function $o(ze){if(t.isOpen===!0)return t.close();t.open(ze)}function Po(ze,et){if(t.config!==void 0){var Tt=t.config[ze];if(Tt!==void 0&&Tt.length>0)for(var Wt=0;Tt[Wt]&&Wt<Tt.length;Wt++)Tt[Wt](t.selectedDates,t.input.value,t,et);ze==="onChange"&&(t.input.dispatchEvent(Rr("change")),t.input.dispatchEvent(Rr("input")))}}function Rr(ze){var et=document.createEvent("Event");return et.initEvent(ze,!0,!0),et}function Ls(ze){for(var et=0;et<t.selectedDates.length;et++){var Tt=t.selectedDates[et];if(Tt instanceof Date&&N1(Tt,ze)===0)return""+et}return!1}function aa(ze){return t.config.mode!=="range"||t.selectedDates.length<2?!1:N1(ze,t.selectedDates[0])>=0&&N1(ze,t.selectedDates[1])<=0}function bs(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(ze,et){var Tt=new Date(t.currentYear,t.currentMonth,1);Tt.setMonth(t.currentMonth+et),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[et].textContent=Hz(Tt.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=Tt.getMonth().toString(),ze.value=Tt.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 _a(ze){var et=ze||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(Tt){return t.formatDate(Tt,et)}).filter(function(Tt,Wt,Yn){return t.config.mode!=="range"||t.config.enableTime||Yn.indexOf(Tt)===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=_a(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=_a(t.config.altFormat)),ze!==!1&&Po("onValueUpdate")}function vs(ze){var et=R1(ze),Tt=t.prevMonthNav.contains(et),Wt=t.nextMonthNav.contains(et);Tt||Wt?He(Tt?-1:1):t.yearElements.indexOf(et)>=0?et.select():et.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):et.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Qi(ze){ze.preventDefault();var et=ze.type==="keydown",Tt=R1(ze),Wt=Tt;t.amPM!==void 0&&Tt===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Bb(t.amPM.textContent===t.l10n.amPM[0])]);var Yn=parseFloat(Wt.getAttribute("min")),po=parseFloat(Wt.getAttribute("max")),wo=parseFloat(Wt.getAttribute("step")),fn=parseInt(Wt.value,10),os=ze.delta||(et?ze.which===38?1:-1:0),xo=fn+wo*os;if(typeof Wt.value<"u"&&Wt.value.length===2){var fs=Wt===t.hourElement,kr=Wt===t.minuteElement;xo<Yn?(xo=po+xo+Bb(!fs)+(Bb(fs)&&Bb(!t.amPM)),kr&&te(void 0,-1,t.hourElement)):xo>po&&(xo=Wt===t.hourElement?xo-po-Bb(!t.amPM):Yn,kr&&te(void 0,1,t.hourElement)),t.amPM&&fs&&(wo===1?xo+fn===23:Math.abs(xo-fn)>wo)&&(t.amPM.textContent=t.l10n.amPM[Bb(t.amPM.textContent===t.l10n.amPM[0])]),Wt.value=Np(xo)}}return a(),t}function ED(o,e){for(var t=Array.prototype.slice.call(o).filter(function(u){return u instanceof HTMLElement}),s=[],a=0;a<t.length;a++){var l=t[a];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=fNe(l,e||{}),s.push(l._flatpickr)}catch(u){console.error(u)}}return s.length===1?s[0]:s}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(o){return ED(this,o)},HTMLElement.prototype.flatpickr=function(o){return ED([this],o)});var Cf=function(o,e){return typeof o=="string"?ED(window.document.querySelectorAll(o),e):o instanceof Node?ED([o],e):ED(o,e)};Cf.defaultConfig={};Cf.l10ns={en:$m({},V6),default:$m({},V6)};Cf.localize=function(o){Cf.l10ns.default=$m($m({},Cf.l10ns.default),o)};Cf.setDefaults=function(o){Cf.defaultConfig=$m($m({},Cf.defaultConfig),o)};Cf.parseDate=Hse({});Cf.formatDate=IOe({});Cf.compareDates=N1;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(o){return ED(this,o)});Date.prototype.fp_incr=function(o){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof o=="string"?parseInt(o,10):o))};typeof window<"u"&&(window.flatpickr=Cf);function dNe(o){let e,t,s,a;return{c(){e=re("input"),Z(e,"type","text"),Z(e,"id",o[2]),Z(e,"class","form-control"),Z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[3],Vo(e,"is-invalid",o[8])},m(l,u){Te(l,e,u),ar(e,o[0]),o[19](e),s||(a=mn(e,"input",o[18]),s=!0)},p(l,u){u&4&&Z(e,"id",l[2]),u&10&&t!==(t=l[1].readonly&&!l[3])&&(e.readOnly=t),u&1&&e.value!==l[0]&&ar(e,l[0]),u&256&&Vo(e,"is-invalid",l[8])},i:un,o:un,d(l){l&&ke(e),o[19](null),s=!1,a()}}}function hNe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R;u=new Fa({props:{icon:"calendar"}});let $=o[1].optionsFrom&&Ghe(o),Q=o[0]&&Khe(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("button"),en(u.$$.fragment),d=Ze(),h=re("ul"),$&&$.c(),b=Ze(),Q&&Q.c(),y=Rs(),Z(t,"type","search"),Z(t,"id",o[2]),Z(t,"class","form-control dropdown-toggle"),Z(t,"placeholder","Search for options"),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[3],Vo(t,"is-invalid",o[8]),Z(l,"class","btn btn-light ms-1"),Z(h,"class","dropdown-menu w-100"),Z(e,"class","dropdown d-flex")},m(F,U){Te(F,e,U),X(e,t),ar(t,o[9]),o[12](t),X(e,a),X(e,l),Kt(u,l,null),X(e,d),X(e,h),$&&$.m(h,null),Te(F,b,U),Q&&Q.m(F,U),Te(F,y,U),C=!0,E||(R=[mn(t,"keyup",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"focus",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"input",o[11]),mn(l,"click",ku(o[13]))],E=!0)},p(F,U){o=F,(!C||U&4)&&Z(t,"id",o[2]),(!C||U&10&&s!==(s=o[1].readonly&&!o[3]))&&(t.readOnly=s),U&512&&t.value!==o[9]&&ar(t,o[9]),(!C||U&256)&&Vo(t,"is-invalid",o[8]),o[1].optionsFrom?$?($.p(o,U),U&2&&xe($,1)):($=Ghe(o),$.c(),xe($,1),$.m(h,null)):$&&(mo(),Be($,1,1,()=>{$=null}),go()),o[0]?Q?Q.p(o,U):(Q=Khe(o),Q.c(),Q.m(y.parentNode,y)):Q&&(Q.d(1),Q=null)},i(F){C||(xe(u.$$.fragment,F),xe($),C=!0)},o(F){Be(u.$$.fragment,F),Be($),C=!1},d(F){F&&ke(e),o[12](null),Jt(u),$&&$.d(),F&&ke(b),Q&&Q.d(F),F&&ke(y),E=!1,vi(R)}}}function Ghe(o){let e,t,s,a;function l(h){o[15](h)}function u(h){o[16](h)}let d={field:o[1]};return o[0]!==void 0&&(d.value=o[0]),o[9]!==void 0&&(d.search=o[9]),e=new eV({props:d}),o[14](e),Ro.push(()=>er(e,"value",l)),Ro.push(()=>er(e,"search",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),!t&&b&1&&(t=!0,y.value=h[0],lr(()=>t=!1)),!s&&b&512&&(s=!0,y.search=h[9],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){o[14](null),Jt(e,h)}}}function Khe(o){let e,t,s,a,l,u,d;return{c(){e=re("span"),t=re("div"),s=Ht(o[0]),a=Ze(),l=re("button"),Z(l,"type","button"),Z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),Z(l,"aria-label","Close"),Z(t,"class","d-flex align-items-center "),Z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Te(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),u||(d=mn(l,"click",ku(o[17])),u=!0)},p(h,b){b&1&&Fn(s,h[0])},d(h){h&&ke(e),u=!1,d()}}}function Jhe(o){let e,t;return{c(){e=re("div"),t=Ht(o[8]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&256&&Fn(t,s[8])},d(s){s&&ke(e)}}}function mNe(o){let e,t,s,a,l;const u=[hNe,dNe],d=[];function h(y,C){return y[7]?0:1}t=h(o),s=d[t]=u[t](o);let b=o[8]&&Jhe(o);return{c(){e=re("div"),s.c(),a=Ze(),b&&b.c(),Z(e,"class","mb-0")},m(y,C){Te(y,e,C),d[t].m(e,null),X(e,a),b&&b.m(e,null),l=!0},p(y,[C]){let E=t;t=h(y),t===E?d[t].p(y,C):(mo(),Be(d[E],1,1,()=>{d[E]=null}),go(),s=d[t],s?s.p(y,C):(s=d[t]=u[t](y),s.c()),xe(s,1),s.m(e,a)),y[8]?b?b.p(y,C):(b=Jhe(y),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(y){l||(xe(s),l=!0)},o(y){Be(s),l=!1},d(y){y&&ke(e),d[t].d(),b&&b.d()}}}function gNe(o,e,t){let s,a,l,{field:u}=e,{value:d}=e,{id:h}=e,{isCreateMode:b}=e,{validationErrors:y}=e,C,E,R,$={enableTime:!1,allowInput:!0,dateFormat:"Y-m-d"};u.min&&($.minDate=u.min),u.max&&($.maxDate=u.max),W1(()=>{(!u.readonly||b)&&(a&&($.clickOpens=!1),t(6,R=Cf(E,$)))});function Q(){s=this.value,t(9,s)}function F(we){Ro[we?"unshift":"push"](()=>{E=we,t(5,E)})}const U=we=>R.open();function K(we){Ro[we?"unshift":"push"](()=>{C=we,t(4,C)})}function L(we){d=we,t(0,d)}function te(we){s=we,t(9,s)}const ne=we=>t(0,d="");function oe(){d=this.value,t(0,d)}function G(we){Ro[we?"unshift":"push"](()=>{E=we,t(5,E)})}return o.$$set=we=>{"field"in we&&t(1,u=we.field),"value"in we&&t(0,d=we.value),"id"in we&&t(2,h=we.id),"isCreateMode"in we&&t(3,b=we.isCreateMode),"validationErrors"in we&&t(10,y=we.validationErrors)},o.$$.update=()=>{o.$$.dirty&10&&t(7,a=u.optionsFrom&&!(u.readonly&&!b)),o.$$.dirty&1026&&t(8,l=Lm(y,u.name))},t(9,s=""),[d,u,h,b,C,E,R,a,l,s,y,Q,F,U,K,L,te,ne,oe,G]}class pNe extends uo{constructor(e){super(),co(this,e,gNe,mNe,lo,{field:1,value:0,id:2,isCreateMode:3,validationErrors:10})}}var dH,bNe=new Uint8Array(16);function vNe(){if(!dH&&(dH=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!dH))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return dH(bNe)}const ONe=/^(?:[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 yNe(o){return typeof o=="string"&&ONe.test(o)}var zh=[];for(var moe=0;moe<256;++moe)zh.push((moe+256).toString(16).substr(1));function wNe(o){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(zh[o[e+0]]+zh[o[e+1]]+zh[o[e+2]]+zh[o[e+3]]+"-"+zh[o[e+4]]+zh[o[e+5]]+"-"+zh[o[e+6]]+zh[o[e+7]]+"-"+zh[o[e+8]]+zh[o[e+9]]+"-"+zh[o[e+10]]+zh[o[e+11]]+zh[o[e+12]]+zh[o[e+13]]+zh[o[e+14]]+zh[o[e+15]]).toLowerCase();if(!yNe(t))throw TypeError("Stringified UUID is invalid");return t}function _Ne(o,e,t){o=o||{};var s=o.random||(o.rng||vNe)();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 wNe(s)}function SNe(o){let e,t,s,a,l;return t=new Fa({props:{icon:"dice"}}),{c(){e=re("button"),en(t.$$.fragment),Z(e,"class","btn btn-primary ms-2"),Z(e,"title","Generate a new UUIDv4")},m(u,d){Te(u,e,d),Kt(t,e,null),s=!0,a||(l=mn(e,"click",o[4]),a=!0)},p:un,i(u){s||(xe(t.$$.fragment,u),s=!0)},o(u){Be(t.$$.fragment,u),s=!1},d(u){u&&ke(e),Jt(t),a=!1,l()}}}function eme(o){let e,t;return{c(){e=re("div"),t=Ht(o[2]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&4&&Fn(t,s[2])},d(s){s&&ke(e)}}}function CNe(o){let e,t,s,a,l,u,d,h,b=!o[3]&&SNe(o),y=o[2]&&eme(o);return{c(){e=re("div"),t=re("div"),s=re("input"),a=Ze(),b&&b.c(),l=Ze(),y&&y.c(),Z(s,"type","text"),Z(s,"id",o[1]),Z(s,"class","form-control"),Z(s,"autocomplete","off"),s.readOnly=o[3],Vo(s,"is-invalid",o[2]),Z(t,"class","d-flex justify-content-between"),Z(e,"class","mb-0")},m(C,E){Te(C,e,E),X(e,t),X(t,s),ar(s,o[0]),X(t,a),b&&b.m(t,null),X(e,l),y&&y.m(e,null),u=!0,d||(h=mn(s,"input",o[8]),d=!0)},p(C,[E]){(!u||E&2)&&Z(s,"id",C[1]),E&1&&s.value!==C[0]&&ar(s,C[0]),(!u||E&4)&&Vo(s,"is-invalid",C[2]),C[3]||b.p(C,E),C[2]?y?y.p(C,E):(y=eme(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(C){u||(xe(b),u=!0)},o(C){Be(b),u=!1},d(C){C&&ke(e),b&&b.d(),y&&y.d(),d=!1,h()}}}function kNe(o,e,t){let s;Ur("channelurl");let{validationErrors:a}=e,{field:l}=e,{value:u}=e,{id:d}=e,{isCreateMode:h}=e,b=l.readonly&&!h;function y(E){E.preventDefault(),t(0,u=_Ne())}function C(){u=this.value,t(0,u)}return o.$$set=E=>{"validationErrors"in E&&t(5,a=E.validationErrors),"field"in E&&t(6,l=E.field),"value"in E&&t(0,u=E.value),"id"in E&&t(1,d=E.id),"isCreateMode"in E&&t(7,h=E.isCreateMode)},o.$$.update=()=>{o.$$.dirty&96&&t(2,s=Lm(a,l.name))},[u,d,s,b,y,a,l,h,C]}class xNe extends uo{constructor(e){super(),co(this,e,kNe,CNe,lo,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function tme(o,e,t){const s=o.slice();return s[14]=e[t],s}function nme(o,e,t){const s=o.slice();return s[17]=e[t],s}function TNe(o){let e,t,s,a,l=o[3],u=[];for(let d=0;d<l.length;d+=1)u[d]=ome(nme(o,l,d));return{c(){e=re("div"),t=re("button"),t.textContent="Browse",s=Ze(),a=re("ul");for(let d=0;d<u.length;d+=1)u[d].c();Z(t,"class","btn btn-outline-primary btn-sm"),Z(t,"type","button"),Z(t,"data-bs-toggle","dropdown"),Z(t,"aria-expanded","false"),Z(a,"class","dropdown-menu"),Z(e,"class","dropdown d-inline-block")},m(d,h){Te(d,e,h),X(e,t),X(e,s),X(e,a);for(let b=0;b<u.length;b+=1)u[b]&&u[b].m(a,null)},p(d,h){if(h&40){l=d[3];let b;for(b=0;b<l.length;b+=1){const y=nme(d,l,b);u[b]?u[b].p(y,h):(u[b]=ome(y),u[b].c(),u[b].m(a,null))}for(;b<u.length;b+=1)u[b].d(1);u.length=l.length}},d(d){d&&ke(e),ia(u,d)}}}function ENe(o){let e,t,s;return{c(){e=re("button"),e.textContent="Browse",Z(e,"class","btn btn-outline-primary")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[10]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function ome(o){let e,t,s=o[17].label+"",a,l,u,d;function h(...b){return o[11](o[17],...b)}return{c(){e=re("li"),t=re("a"),a=Ht(s),l=Ze(),Z(t,"class","dropdown-item"),Z(t,"href","/")},m(b,y){Te(b,e,y),X(e,t),X(t,a),X(e,l),u||(d=mn(t,"click",h),u=!0)},p(b,y){o=b},d(b){b&&ke(e),u=!1,d()}}}function sme(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[ANe]},$$scope:{ctx:o}}}),e.$on("update",o[6]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1048580&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function rme(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[14],hasDelete:!0}}),s.$on("remove",e[4]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&4&&(h.record=e[14]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function ANe(o){let e=[],t=new Map,s,a,l=o[2];const u=d=>d[14].id;for(let d=0;d<l.length;d+=1){let h=tme(o,l,d),b=u(h);t.set(b,e[d]=rme(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){h&20&&(l=d[2],mo(),e=Jd(e,h,u,1,d,l,t,s.parentNode,xv,rme,s,tme),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function DNe(o){let e,t,s,a,l;function u(C,E){return C[0].collections.length===1?ENe:TNe}let d=u(o),h=d(o),b=o[2].length>0&&sme(o),y={};return a=new are({props:y}),o[12](a),a.$on("insert",o[7]),{c(){e=re("div"),h.c(),t=Ze(),b&&b.c(),s=Ze(),en(a.$$.fragment),Z(e,"class","mb-0")},m(C,E){Te(C,e,E),h.m(e,null),Te(C,t,E),b&&b.m(C,E),Te(C,s,E),Kt(a,C,E),l=!0},p(C,[E]){d===(d=u(C))&&h?h.p(C,E):(h.d(1),h=d(C),h&&(h.c(),h.m(e,null))),C[2].length>0?b?(b.p(C,E),E&4&&xe(b,1)):(b=sme(C),b.c(),xe(b,1),b.m(s.parentNode,s)):b&&(mo(),Be(b,1,1,()=>{b=null}),go());const R={};a.$set(R)},i(C){l||(xe(b),xe(a.$$.fragment,C),l=!0)},o(C){Be(b),Be(a.$$.fragment,C),l=!1},d(C){C&&ke(e),h.d(),C&&ke(t),b&&b.d(C),C&&ke(s),o[12](null),Jt(a,C)}}}function PNe(o,e,t){let s;const a=Ur("channel");let{field:l}=e,{record:u}=e,{graph:d}=e,h,b=a.schemas.filter(U=>l.collections.includes(U.name));function y(U){U.preventDefault(),t(8,d.edges=d.edges.filter(K=>!(K.target===U.detail&&K.field===l.name)),d)}function C(U,K){U.preventDefault(),h.open(K)}async function E(U){t(8,d.edges=await qD(U.detail.source,U.detail.target,d.edges,l.name,s),d)}function R(U){var oe;U.preventDefault(),h.close();const K=U.detail.records,L=U.detail.action;let te=K.map(G=>({target:G.id,source:u.id,sourceSchema:u.schema,targetSchema:G.schema,field:l.name,rank:""})),ne=(oe=d.edges)!=null?oe:[];L==="replace"&&(ne=ne.filter(G=>G.field!==l.name)),t(8,d.records=Lc.exports.uniqBy([...d.records,...K],G=>G.id),d),t(8,d.edges=Lc.exports.uniqBy([...ne,...te],G=>G.target+G.field),d)}const $=U=>C(U,b[0].name),Q=(U,K)=>C(K,U.name);function F(U){Ro[U?"unshift":"push"](()=>{h=U,t(1,h)})}return o.$$set=U=>{"field"in U&&t(0,l=U.field),"record"in U&&t(9,u=U.record),"graph"in U&&t(8,d=U.graph)},o.$$.update=()=>{var U;o.$$.dirty&769&&t(2,s=(U=d==null?void 0:d.edges.filter(K=>K.field===l.name).map(K=>d.records.find(L=>L.id===K.target&&u.id===K.source)).filter(K=>!!(K!=null&&K.id)))!=null?U:[])},[l,h,s,b,y,C,E,R,d,u,$,Q,F]}class MNe extends uo{constructor(e){super(),co(this,e,PNe,DNe,lo,{field:0,record:9,graph:8})}}function ime(o){let e,t;return{c(){e=re("div"),t=Ht(o[5]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&32&&Fn(t,s[5])},d(s){s&&ke(e)}}}function RNe(o){let e,t,s,a,l,u,d=o[5]&&ime(o);return{c(){e=re("div"),t=re("textarea"),a=Ze(),d&&d.c(),Z(t,"id",o[3]),Z(t,"class","form-control svelte-1er4ovm"),Z(t,"rows","2"),t.readOnly=s=o[1].readonly&&!o[2],Vo(t,"is-invalid",o[5]),Z(e,"class","mb-0")},m(h,b){Te(h,e,b),X(e,t),ar(t,o[0]),o[8](t),X(e,a),d&&d.m(e,null),l||(u=[mn(t,"input",o[7]),mn(t,"input",zse),mn(t,"focus",zse)],l=!0)},p(h,[b]){b&8&&Z(t,"id",h[3]),b&6&&s!==(s=h[1].readonly&&!h[2])&&(t.readOnly=s),b&1&&ar(t,h[0]),b&32&&Vo(t,"is-invalid",h[5]),h[5]?d?d.p(h,b):(d=ime(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:un,o:un,d(h){h&&ke(e),o[8](null),d&&d.d(),l=!1,vi(u)}}}function zse(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function $Ne(o,e,t){let s,{field:a}=e,{value:l}=e,{isCreateMode:u}=e,{validationErrors:d}=e,h,{id:b}=e;W1(()=>{zse(h)});function y(){l=this.value,t(0,l)}function C(E){Ro[E?"unshift":"push"](()=>{h=E,t(4,h)})}return o.$$set=E=>{"field"in E&&t(1,a=E.field),"value"in E&&t(0,l=E.value),"isCreateMode"in E&&t(2,u=E.isCreateMode),"validationErrors"in E&&t(6,d=E.validationErrors),"id"in E&&t(3,b=E.id)},o.$$.update=()=>{o.$$.dirty&66&&t(5,s=Lm(d,a.name))},[l,a,u,b,h,s,d,y,C]}class BOe extends uo{constructor(e){super(),co(this,e,$Ne,RNe,lo,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function NNe(o){let e,t,s,a;return{c(){e=re("input"),Z(e,"type","text"),Z(e,"id",o[3]),Z(e,"class","form-control"),Z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[2],Vo(e,"is-invalid",o[8])},m(l,u){Te(l,e,u),ar(e,o[0]),o[20](e),s||(a=mn(e,"input",o[19]),s=!0)},p(l,u){u&8&&Z(e,"id",l[3]),u&6&&t!==(t=l[1].readonly&&!l[2])&&(e.readOnly=t),u&1&&e.value!==l[0]&&ar(e,l[0]),u&256&&Vo(e,"is-invalid",l[8])},i:un,o:un,d(l){l&&ke(e),o[20](null),s=!1,a()}}}function INe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R;u=new Fa({props:{icon:"calendar"}});let $=o[1].optionsFrom&&ame(o),Q=o[0]&&lme(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("button"),en(u.$$.fragment),d=Ze(),h=re("ul"),$&&$.c(),b=Ze(),Q&&Q.c(),y=Rs(),Z(t,"type","search"),Z(t,"id",o[3]),Z(t,"class","form-control dropdown-toggle"),Z(t,"placeholder","Search for options"),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],Vo(t,"is-invalid",o[8]),Z(l,"class","btn btn-light ms-1"),Z(h,"class","dropdown-menu w-100"),Z(e,"class","dropdown d-flex")},m(F,U){Te(F,e,U),X(e,t),ar(t,o[9]),o[13](t),X(e,a),X(e,l),Kt(u,l,null),X(e,d),X(e,h),$&&$.m(h,null),Te(F,b,U),Q&&Q.m(F,U),Te(F,y,U),C=!0,E||(R=[mn(t,"keyup",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"focus",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),mn(t,"input",o[12]),mn(l,"click",ku(o[14]))],E=!0)},p(F,U){o=F,(!C||U&8)&&Z(t,"id",o[3]),(!C||U&6&&s!==(s=o[1].readonly&&!o[2]))&&(t.readOnly=s),U&512&&t.value!==o[9]&&ar(t,o[9]),(!C||U&256)&&Vo(t,"is-invalid",o[8]),o[1].optionsFrom?$?($.p(o,U),U&2&&xe($,1)):($=ame(o),$.c(),xe($,1),$.m(h,null)):$&&(mo(),Be($,1,1,()=>{$=null}),go()),o[0]?Q?Q.p(o,U):(Q=lme(o),Q.c(),Q.m(y.parentNode,y)):Q&&(Q.d(1),Q=null)},i(F){C||(xe(u.$$.fragment,F),xe($),C=!0)},o(F){Be(u.$$.fragment,F),Be($),C=!1},d(F){F&&ke(e),o[13](null),Jt(u),$&&$.d(),F&&ke(b),Q&&Q.d(F),F&&ke(y),E=!1,vi(R)}}}function ame(o){let e,t,s,a;function l(h){o[16](h)}function u(h){o[17](h)}let d={field:o[1]};return o[0]!==void 0&&(d.value=o[0]),o[9]!==void 0&&(d.search=o[9]),e=new eV({props:d}),o[15](e),Ro.push(()=>er(e,"value",l)),Ro.push(()=>er(e,"search",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),!t&&b&1&&(t=!0,y.value=h[0],lr(()=>t=!1)),!s&&b&512&&(s=!0,y.search=h[9],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){o[15](null),Jt(e,h)}}}function lme(o){let e,t,s,a,l,u,d;return{c(){e=re("span"),t=re("div"),s=Ht(o[0]),a=Ze(),l=re("button"),Z(l,"type","button"),Z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),Z(l,"aria-label","Close"),Z(t,"class","d-flex align-items-center "),Z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Te(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),u||(d=mn(l,"click",ku(o[18])),u=!0)},p(h,b){b&1&&Fn(s,h[0])},d(h){h&&ke(e),u=!1,d()}}}function cme(o){let e,t;return{c(){e=re("div"),t=Ht(o[8]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&256&&Fn(t,s[8])},d(s){s&&ke(e)}}}function BNe(o){let e,t,s,a,l,u,d;const h=[INe,NNe],b=[];function y(E,R){return E[7]?0:1}t=y(o),s=b[t]=h[t](o);let C=o[8]&&cme(o);return{c(){e=re("div"),s.c(),a=Ze(),l=re("small"),l.textContent=`Dates are displayed according to your timezone: ${o[10]}`,u=Ze(),C&&C.c(),Z(l,"class","text-primary opacity-50"),Z(e,"class","mb-0")},m(E,R){Te(E,e,R),b[t].m(e,null),X(e,a),X(e,l),X(e,u),C&&C.m(e,null),d=!0},p(E,[R]){let $=t;t=y(E),t===$?b[t].p(E,R):(mo(),Be(b[$],1,1,()=>{b[$]=null}),go(),s=b[t],s?s.p(E,R):(s=b[t]=h[t](E),s.c()),xe(s,1),s.m(e,a)),E[8]?C?C.p(E,R):(C=cme(E),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i(E){d||(xe(s),d=!0)},o(E){Be(s),d=!1},d(E){E&&ke(e),b[t].d(),C&&C.d()}}}function LNe(o,e,t){let s,a,l,{field:u}=e,{value:d}=e,{isCreateMode:h}=e,{validationErrors:b}=e;const y=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:C}=e,E,R,$,Q={enableTime:!1,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};u.min&&(Q.minDate=u.min),u.max&&(Q.maxDate=u.max),W1(()=>{(!u.readonly||h)&&(a&&(Q.clickOpens=!1),t(6,$=Cf(R,Q)))});function F(){s=this.value,t(9,s)}function U(ve){Ro[ve?"unshift":"push"](()=>{R=ve,t(5,R)})}const K=ve=>$.open();function L(ve){Ro[ve?"unshift":"push"](()=>{E=ve,t(4,E)})}function te(ve){d=ve,t(0,d)}function ne(ve){s=ve,t(9,s)}const oe=ve=>t(0,d="");function G(){d=this.value,t(0,d)}function we(ve){Ro[ve?"unshift":"push"](()=>{R=ve,t(5,R)})}return o.$$set=ve=>{"field"in ve&&t(1,u=ve.field),"value"in ve&&t(0,d=ve.value),"isCreateMode"in ve&&t(2,h=ve.isCreateMode),"validationErrors"in ve&&t(11,b=ve.validationErrors),"id"in ve&&t(3,C=ve.id)},o.$$.update=()=>{o.$$.dirty&6&&t(7,a=u.optionsFrom&&!(u.readonly&&!h)),o.$$.dirty&2050&&t(8,l=Lm(b,u.name))},t(9,s=""),[d,u,h,C,E,R,$,a,l,s,y,b,F,U,K,L,te,ne,oe,G,we]}class FNe extends uo{constructor(e){super(),co(this,e,LNe,BNe,lo,{field:1,value:0,isCreateMode:2,validationErrors:11,id:3})}}function ume(o){let e,t;return{c(){e=re("div"),t=Ht(o[2]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&4&&Fn(t,s[2])},d(s){s&&ke(e)}}}function QNe(o){let e,t,s,a,l;function u(b){o[7](b)}let d={additionalConfig:o[3],schema:o[1]};o[0]!==void 0&&(d.value=o[0]),t=new b1e({props:d}),Ro.push(()=>er(t,"value",u));let h=o[2]&&ume(o);return{c(){e=re("div"),en(t.$$.fragment),a=Ze(),h&&h.c(),Z(e,"class","mb-0")},m(b,y){Te(b,e,y),Kt(t,e,null),X(e,a),h&&h.m(e,null),l=!0},p(b,[y]){const C={};y&2&&(C.schema=b[1]),!s&&y&1&&(s=!0,C.value=b[0],lr(()=>s=!1)),t.$set(C),b[2]?h?h.p(b,y):(h=ume(b),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(b){l||(xe(t.$$.fragment,b),l=!0)},o(b){Be(t.$$.fragment,b),l=!1},d(b){b&&ke(e),Jt(t),h&&h.d()}}}function ZNe(o,e,t){let s,{value:a}=e,{field:l}=e,{isCreateMode:u}=e,{schema:d}=e,{validationErrors:h}=e,b={readonly:l.readonly&&!u};function y(C){a=C,t(0,a)}return o.$$set=C=>{"value"in C&&t(0,a=C.value),"field"in C&&t(4,l=C.field),"isCreateMode"in C&&t(5,u=C.isCreateMode),"schema"in C&&t(1,d=C.schema),"validationErrors"in C&&t(6,h=C.validationErrors)},o.$$.update=()=>{o.$$.dirty&80&&t(2,s=Lm(h,l.name))},[a,d,s,b,l,u,h,y]}class HNe extends uo{constructor(e){super(),co(this,e,ZNe,QNe,lo,{value:0,field:4,isCreateMode:5,schema:1,validationErrors:6})}}const zNe=SE({String:yt.string,Number:yt.number,"True False":yt.bool,PropertyName:yt.propertyName,Null:yt.null,",":yt.separator,"[ ]":yt.squareBracket,"{ }":yt.brace}),VNe=vE.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:[zNe],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}),WNe=()=>o=>{try{JSON.parse(o.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=UNe(e,o.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function UNe(o,e){let t;return(t=o.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=o.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const YNe=pE.define({name:"json",parser:VNe.configure({props:[GD.add({Object:SD({except:/^\s*\}/}),Array:SD({except:/^\s*\]/})}),KD.add({"Object Array":Dre})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function fme(){return new $D(YNe)}function XNe(o){let e,t;return{c(){e=re("div"),Z(e,"class",t="is-editable-"+o[0])},m(s,a){Te(s,e,a),o[3](e)},p(s,[a]){a&1&&t!==(t="is-editable-"+s[0])&&Z(e,"class",t)},i:un,o:un,d(s){s&&ke(e),o[3](null)}}}function jNe(o,e,t){let s,a,{value:l}=e,{editable:u=!0}=e;W1(()=>{let h=new DC,b=new DC,y=ra.create({doc:JSON.stringify(l,null,4),extensions:[Rz,wE.of([W0e]),h.of(fme()),fme(),b.of(ra.tabSize.of(4)),M5e(),Rz,is.editable.of(u),is.updateListener.of(function(C){C.docChanged&&t(2,l=C.state.doc.toString())}),S5e(WNe())]});a=new is({state:y,parent:s})}),ore(()=>{a&&a.destroy()});function d(h){Ro[h?"unshift":"push"](()=>{s=h,t(1,s)})}return o.$$set=h=>{"value"in h&&t(2,l=h.value),"editable"in h&&t(0,u=h.editable)},[u,s,l,d]}class qNe extends uo{constructor(e){super(),co(this,e,jNe,XNe,lo,{value:2,editable:0})}}function dme(o){let e,t;return{c(){e=re("div"),t=Ht(o[3]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&8&&Fn(t,s[3])},d(s){s&&ke(e)}}}function GNe(o){let e,t,s,a,l;function u(b){o[5](b)}let d={editable:!o[1].readonly||o[2]};o[0]!==void 0&&(d.value=o[0]),t=new qNe({props:d}),Ro.push(()=>er(t,"value",u));let h=o[3]&&dme(o);return{c(){e=re("div"),en(t.$$.fragment),a=Ze(),h&&h.c(),Z(e,"class","mb-3")},m(b,y){Te(b,e,y),Kt(t,e,null),X(e,a),h&&h.m(e,null),l=!0},p(b,[y]){const C={};y&6&&(C.editable=!b[1].readonly||b[2]),!s&&y&1&&(s=!0,C.value=b[0],lr(()=>s=!1)),t.$set(C),b[3]?h?h.p(b,y):(h=dme(b),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(b){l||(xe(t.$$.fragment,b),l=!0)},o(b){Be(t.$$.fragment,b),l=!1},d(b){b&&ke(e),Jt(t),h&&h.d()}}}function KNe(o,e,t){let s,{value:a}=e,{field:l}=e,{isCreateMode:u}=e,{validationErrors:d}=e;function h(b){a=b,t(0,a)}return o.$$set=b=>{"value"in b&&t(0,a=b.value),"field"in b&&t(1,l=b.field),"isCreateMode"in b&&t(2,u=b.isCreateMode),"validationErrors"in b&&t(4,d=b.validationErrors)},o.$$.update=()=>{o.$$.dirty&18&&t(3,s=Lm(d,l.name))},[a,l,u,s,d,h]}class JNe extends uo{constructor(e){super(),co(this,e,KNe,GNe,lo,{value:0,field:1,isCreateMode:2,validationErrors:4})}}function hme(o){let e,t;return{c(){e=re("div"),t=Ht(o[3]),Z(e,"class","invalid-feedback d-block")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&8&&Fn(t,s[3])},d(s){s&&ke(e)}}}function e6e(o){let e,t,s,a,l;function u(b){o[5](b)}let d={editable:!o[1].readonly||o[2]};o[0]!==void 0&&(d.value=o[0]),t=new $Oe({props:d}),Ro.push(()=>er(t,"value",u));let h=o[3]&&hme(o);return{c(){e=re("div"),en(t.$$.fragment),a=Ze(),h&&h.c(),Z(e,"class","mb-3")},m(b,y){Te(b,e,y),Kt(t,e,null),X(e,a),h&&h.m(e,null),l=!0},p(b,[y]){const C={};y&6&&(C.editable=!b[1].readonly||b[2]),!s&&y&1&&(s=!0,C.value=b[0],lr(()=>s=!1)),t.$set(C),b[3]?h?h.p(b,y):(h=hme(b),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(b){l||(xe(t.$$.fragment,b),l=!0)},o(b){Be(t.$$.fragment,b),l=!1},d(b){b&&ke(e),Jt(t),h&&h.d()}}}function t6e(o,e,t){let s,{value:a}=e,{field:l}=e,{isCreateMode:u}=e,{validationErrors:d}=e;function h(b){a=b,t(0,a)}return o.$$set=b=>{"value"in b&&t(0,a=b.value),"field"in b&&t(1,l=b.field),"isCreateMode"in b&&t(2,u=b.isCreateMode),"validationErrors"in b&&t(4,d=b.validationErrors)},o.$$.update=()=>{o.$$.dirty&18&&t(3,s=Lm(d,l.name))},[a,l,u,s,d,h]}class n6e extends uo{constructor(e){super(),co(this,e,t6e,e6e,lo,{value:0,field:1,isCreateMode:2,validationErrors:4})}}function mme(o){let e,t=o[0].help+"",s;return{c(){e=re("small"),s=Ht(t),Z(e,"class","text-primary opacity-50")},m(a,l){Te(a,e,l),X(e,s)},p(a,l){l&1&&t!==(t=a[0].help+"")&&Fn(s,t)},d(a){a&&ke(e)}}}function o6e(o){let e,t,s,a,l=o[0].label+"",u,d,h,b,y,C=o[0].name+"",E,R=o[0].help&&mme(o);return{c(){e=re("div"),t=re("div"),s=re("div"),a=re("label"),u=Ht(l),d=Ze(),R&&R.c(),h=Ze(),b=re("span"),y=re("code"),E=Ht(C),Z(a,"for",o[1]),Z(a,"class","form-label"),Z(y,"class","text-primary opacity-50"),Z(b,"tabindex","-1"),Z(b,"class","text-decoration-none"),Z(t,"class","d-flex justify-content-between"),Z(e,"class","mb-1")},m($,Q){Te($,e,Q),X(e,t),X(t,s),X(s,a),X(a,u),X(s,d),R&&R.m(s,null),X(t,h),X(t,b),X(b,y),X(y,E)},p($,[Q]){Q&1&&l!==(l=$[0].label+"")&&Fn(u,l),Q&2&&Z(a,"for",$[1]),$[0].help?R?R.p($,Q):(R=mme($),R.c(),R.m(s,null)):R&&(R.d(1),R=null),Q&1&&C!==(C=$[0].name+"")&&Fn(E,C)},i:un,o:un,d($){$&&ke(e),R&&R.d()}}}function s6e(o,e,t){let{field:s}=e,{id:a}=e;return o.$$set=l=>{"field"in l&&t(0,s=l.field),"id"in l&&t(1,a=l.id)},[s,a]}class r6e extends uo{constructor(e){super(),co(this,e,s6e,o6e,lo,{field:0,id:1})}}function gme(o,e,t){const s=o.slice();return s[2]=e[t],s[19]=t,s}function pme(o,e,t){const s=o.slice();return s[1]=e[t],s[19]=t,s}function bme(o,e,t){const s=o.slice();return s[1]=e[t],s}function vme(o){let e,t;return{c(){e=re("div"),t=Ht(o[5]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&32&&Fn(t,s[5])},d(s){s&&ke(e)}}}function Ome(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[3],R=[];for(let $=0;$<E.length;$+=1)R[$]=yme(bme(o,E,$));return y=new oI({props:{isTable:!0,$$slots:{default:[i6e]},$$scope:{ctx:o}}}),y.$on("update",o[12]),{c(){e=re("div"),t=re("table"),s=re("thead"),a=re("tr"),l=re("th"),u=Ze();for(let $=0;$<R.length;$+=1)R[$].c();d=Ze(),h=re("th"),b=Ze(),en(y.$$.fragment),Z(s,"class","table-light"),Z(t,"class",""),Z(e,"class","lx-table rounded")},m($,Q){Te($,e,Q),X(e,t),X(t,s),X(s,a),X(a,l),X(a,u);for(let F=0;F<R.length;F+=1)R[F]&&R[F].m(a,null);X(a,d),X(a,h),X(t,b),Kt(y,t,null),C=!0},p($,Q){if(Q&8){E=$[3];let U;for(U=0;U<E.length;U+=1){const K=bme($,E,U);R[U]?R[U].p(K,Q):(R[U]=yme(K),R[U].c(),R[U].m(a,d))}for(;U<R.length;U+=1)R[U].d(1);R.length=E.length}const F={};Q&8388633&&(F.$$scope={dirty:Q,ctx:$}),y.$set(F)},i($){C||(xe(y.$$.fragment,$),C=!0)},o($){Be(y.$$.fragment,$),C=!1},d($){$&&ke(e),ia(R,$),Jt(y)}}}function yme(o){let e,t=o[1].label+"",s,a,l;return{c(){e=re("th"),s=Ht(t),Z(e,"class",a="field-ui-"+o[1].ui),Z(e,"scope","col"),Z(e,"title",l=o[1].help),Z(e,"data-bs-toggle","tooltip"),Z(e,"data-bs-placement","top")},m(u,d){Te(u,e,d),X(e,s)},p(u,d){d&8&&t!==(t=u[1].label+"")&&Fn(s,t),d&8&&a!==(a="field-ui-"+u[1].ui)&&Z(e,"class",a),d&8&&l!==(l=u[1].help)&&Z(e,"title",l)},d(u){u&&ke(e)}}}function wme(o){let e,t,s,a;return t=new Gpe({props:{record:o[2],graph:o[0],schema:o[8],field:o[1]}}),{c(){e=re("td"),en(t.$$.fragment),Z(e,"class",s="field-ui-"+o[1].ui)},m(l,u){Te(l,e,u),Kt(t,e,null),a=!0},p(l,u){const d={};u&16&&(d.record=l[2]),u&1&&(d.graph=l[0]),u&8&&(d.field=l[1]),t.$set(d),(!a||u&8&&s!==(s="field-ui-"+l[1].ui))&&Z(e,"class",s)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function _me(o){let e,t,s,a,l;t=new Fa({props:{icon:"circle-chevron-up"}});function u(...d){return o[16](o[2],...d)}return{c(){e=re("button"),en(t.$$.fragment),Z(e,"title","Send item to top"),Z(e,"class","to-top-button text-dark btn btn-sm btn-link")},m(d,h){Te(d,e,h),Kt(t,e,null),s=!0,a||(l=mn(e,"click",u),a=!0)},p(d,h){o=d},i(d){s||(xe(t.$$.fragment,d),s=!0)},o(d){Be(t.$$.fragment,d),s=!1},d(d){d&&ke(e),Jt(t),a=!1,l()}}}function Sme(o){let e,t,s,a,l;t=new Fa({props:{icon:"circle-chevron-down"}});function u(...d){return o[17](o[2],...d)}return{c(){e=re("button"),en(t.$$.fragment),Z(e,"title","Send item to bottom"),Z(e,"class","to-top-button text-dark btn btn-sm btn-link")},m(d,h){Te(d,e,h),Kt(t,e,null),s=!0,a||(l=mn(e,"click",u),a=!0)},p(d,h){o=d},i(d){s||(xe(t.$$.fragment,d),s=!0)},o(d){Be(t.$$.fragment,d),s=!1},d(d){d&&ke(e),Jt(t),a=!1,l()}}}function Cme(o,e){let t,s,a,l,u,d=qu(e[6].schemas,e[2])+"",h,b,y,C,E,R,$,Q,F,U,K,L,te,ne=e[3],oe=[];for(let Oe=0;Oe<ne.length;Oe+=1)oe[Oe]=wme(pme(e,ne,Oe));const G=Oe=>Be(oe[Oe],1,1,()=>{oe[Oe]=null});$=new Fa({props:{icon:"trash-can"}});function we(...Oe){return e[15](e[2],...Oe)}let ve=e[4].length>30&&e[19]>0&&_me(e),Re=e[4].length>30&&e[19]+1<e[4].length&&Sme(e);return{key:o,first:null,c(){t=re("tr"),s=re("td"),a=re("div"),l=re("div"),u=re("a"),h=Ht(d),y=Ze();for(let Oe=0;Oe<oe.length;Oe+=1)oe[Oe].c();C=Ze(),E=re("td"),R=re("button"),en($.$$.fragment),Q=Ze(),ve&&ve.c(),F=Ze(),Re&&Re.c(),U=Ze(),Z(u,"class","me-2 text-decoration-none text-dark fs-6"),Z(u,"href",b=e[6].lucentUrl+"/records/"+e[2].id),Z(u,"target","_blank"),Z(l,"class","d-flex align-items-center"),Z(a,"class",""),Z(s,"class",""),Z(R,"class","trash-button text-dark btn btn-sm btn-link"),this.first=t},m(Oe,ce){Te(Oe,t,ce),X(t,s),X(s,a),X(a,l),X(l,u),X(u,h),X(t,y);for(let Xe=0;Xe<oe.length;Xe+=1)oe[Xe]&&oe[Xe].m(t,null);X(t,C),X(t,E),X(E,R),Kt($,R,null),X(E,Q),ve&&ve.m(E,null),X(E,F),Re&&Re.m(E,null),X(t,U),K=!0,L||(te=mn(R,"click",we),L=!0)},p(Oe,ce){if(e=Oe,(!K||ce&16)&&d!==(d=qu(e[6].schemas,e[2])+"")&&Fn(h,d),(!K||ce&16&&b!==(b=e[6].lucentUrl+"/records/"+e[2].id))&&Z(u,"href",b),ce&281){ne=e[3];let Xe;for(Xe=0;Xe<ne.length;Xe+=1){const tt=pme(e,ne,Xe);oe[Xe]?(oe[Xe].p(tt,ce),xe(oe[Xe],1)):(oe[Xe]=wme(tt),oe[Xe].c(),xe(oe[Xe],1),oe[Xe].m(t,C))}for(mo(),Xe=ne.length;Xe<oe.length;Xe+=1)G(Xe);go()}e[4].length>30&&e[19]>0?ve?(ve.p(e,ce),ce&16&&xe(ve,1)):(ve=_me(e),ve.c(),xe(ve,1),ve.m(E,F)):ve&&(mo(),Be(ve,1,1,()=>{ve=null}),go()),e[4].length>30&&e[19]+1<e[4].length?Re?(Re.p(e,ce),ce&16&&xe(Re,1)):(Re=Sme(e),Re.c(),xe(Re,1),Re.m(E,null)):Re&&(mo(),Be(Re,1,1,()=>{Re=null}),go())},i(Oe){if(!K){for(let ce=0;ce<ne.length;ce+=1)xe(oe[ce]);xe($.$$.fragment,Oe),xe(ve),xe(Re),K=!0}},o(Oe){oe=oe.filter(Boolean);for(let ce=0;ce<oe.length;ce+=1)Be(oe[ce]);Be($.$$.fragment,Oe),Be(ve),Be(Re),K=!1},d(Oe){Oe&&ke(t),ia(oe,Oe),Jt($),ve&&ve.d(),Re&&Re.d(),L=!1,te()}}}function i6e(o){let e=[],t=new Map,s,a,l=o[4];const u=d=>d[2].id;for(let d=0;d<l.length;d+=1){let h=gme(o,l,d),b=u(h);t.set(b,e[d]=Cme(b,h))}return{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),a=!0},p(d,h){h&3929&&(l=d[4],mo(),e=Jd(e,h,u,1,d,l,t,s.parentNode,xv,Cme,s,gme),go())},i(d){if(!a){for(let h=0;h<l.length;h+=1)xe(e[h]);a=!0}},o(d){for(let h=0;h<e.length;h+=1)Be(e[h]);a=!1},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s)}}}function a6e(o){let e,t,s,a,l,u,d=o[5]&&vme(o);s=new eI({props:{buttonClass:"mt-2",recordId:null,schemas:o[7]}}),s.$on("insert",o[13]),s.$on("save",o[13]);let h=o[4].length>0&&Ome(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[5]?d?d.p(b,y):(d=vme(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[4].length>0?h?(h.p(b,y),y&16&&xe(h,1)):(h=Ome(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function l6e(o,e,t){let s,a,l;const u=Ur("channel");let{field:d}=e,{record:h}=e,{graph:b}=e,{validationErrors:y}=e,C=u.schemas.filter(ne=>d.collections.includes(ne.name)),E=u.schemas.filter(ne=>d.collections.includes(ne.name))[0];function R(ne,oe){ne.preventDefault(),t(0,b.edges=b.edges.filter(G=>!(G.source===h.id&&G.target===oe&&G.field===d.name)),b)}function $(ne,oe){ne.preventDefault();let G=b.edges.find(we=>we.source===h.id&&we.target===oe&&we.field===d.name);R(ne,oe),t(0,b.edges=[G,...b.edges],b)}function Q(ne,oe){ne.preventDefault();let G=b.edges.find(we=>we.source===h.id&&we.target===oe&&we.field===d.name);R(ne,oe),t(0,b.edges=[...b.edges,G],b)}function F(ne){t(0,b.edges=qD(ne.detail.source,ne.detail.target,b.edges,d.name,a),b)}function U(ne){ne.preventDefault(),t(0,b=K6(b,h,ne.detail.records,d.name,ne.detail.action))}const K=(ne,oe)=>R(oe,ne.id),L=(ne,oe)=>$(oe,ne.id),te=(ne,oe)=>Q(oe,ne.id);return o.$$set=ne=>{"field"in ne&&t(1,d=ne.field),"record"in ne&&t(2,h=ne.record),"graph"in ne&&t(0,b=ne.graph),"validationErrors"in ne&&t(14,y=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&16386&&t(5,s=Lm(y,d.name)),o.$$.dirty&7&&t(4,a=(ne=b.edges.filter(oe=>oe.field===d.name).map(oe=>b.records.find(G=>G.id===oe.target&&h.id===oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},t(3,l=[]),[b,d,h,l,a,s,u,C,E,R,$,Q,F,U,y,K,L,te]}class c6e extends uo{constructor(e){super(),co(this,e,l6e,a6e,lo,{field:1,record:2,graph:0,validationErrors:14})}}function kme(o,e,t){const s=o.slice();return s[2]=e[t],s}function xme(o,e,t){const s=o.slice();return s[22]=e[t],s}function Tme(o){let e,t;return{c(){e=re("div"),t=Ht(o[6]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&64&&Fn(t,s[6])},d(s){s&&ke(e)}}}function Eme(o){let e=[],t=new Map,s,a=o[4];const l=d=>d[22].id;for(let d=0;d<a.length;d+=1){let h=xme(o,a,d),b=l(h);t.set(b,e[d]=Dme(b,h))}let u=null;return a.length||(u=Ame()),{c(){for(let d=0;d<e.length;d+=1)e[d].c();s=Rs(),u&&u.c()},m(d,h){for(let b=0;b<e.length;b+=1)e[b]&&e[b].m(d,h);Te(d,s,h),u&&u.m(d,h)},p(d,h){h&1168&&(a=d[4],e=Jd(e,h,l,1,d,a,t,s.parentNode,XD,Dme,s,xme),a.length?u&&(u.d(1),u=null):u||(u=Ame(),u.c(),u.m(s.parentNode,s)))},d(d){for(let h=0;h<e.length;h+=1)e[h].d(d);d&&ke(s),u&&u.d(d)}}}function Ame(o){let e;return{c(){e=Ht("Start typing...")},m(t,s){Te(t,e,s)},d(t){t&&ke(e)}}}function Dme(o,e){let t,s,a=qu(e[7].schemas,e[22])+"",l,u,d,h;function b(...C){return e[15](e[22],...C)}function y(...C){return e[16](e[22],...C)}return{key:o,first:null,c(){t=re("div"),s=re("span"),l=Ht(a),u=Ze(),Z(s,"class","dropdown-item"),this.first=t},m(C,E){Te(C,t,E),X(t,s),X(s,l),X(t,u),d||(h=[mn(t,"click",b),mn(t,"keypress",y)],d=!0)},p(C,E){e=C,E&16&&a!==(a=qu(e[7].schemas,e[22])+"")&&Fn(l,a)},d(C){C&&ke(t),d=!1,vi(h)}}}function Pme(o){let e,t,s,a,l,u,d;return{c(){e=re("div"),t=re("span"),s=Ht('Add "'),a=Ht(o[3]),l=Ht('"'),Z(t,"class","dropdown-item")},m(h,b){Te(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),u||(d=[mn(e,"click",o[17]),mn(e,"keypress",o[18])],u=!0)},p(h,b){b&8&&Fn(a,h[3])},d(h){h&&ke(e),u=!1,vi(d)}}}function Mme(o){let e,t=[],s=new Map,a=o[5];const l=u=>u[2].id;for(let u=0;u<a.length;u+=1){let d=kme(o,a,u),h=l(d);s.set(h,t[u]=Rme(h,d))}return{c(){e=re("div");for(let u=0;u<t.length;u+=1)t[u].c();Z(e,"class","d-flex")},m(u,d){Te(u,e,d);for(let h=0;h<t.length;h+=1)t[h]&&t[h].m(e,null)},p(u,d){d&416&&(a=u[5],t=Jd(t,d,l,1,u,a,s,e,XD,Rme,null,kme))},d(u){u&&ke(e);for(let d=0;d<t.length;d+=1)t[d].d()}}}function Rme(o,e){let t,s,a=qu(e[7].schemas,e[2])+"",l,u,d,h,b,y;function C(...E){return e[19](e[2],...E)}return{key:o,first:null,c(){t=re("span"),s=re("div"),l=Ht(a),u=Ze(),d=re("button"),h=Ze(),Z(d,"type","button"),Z(d,"class","btn-close btn-sm ms-1"),rs(d,"font-size","10px"),Z(d,"aria-label","Close"),Z(s,"class","d-flex align-items-center "),Z(t,"class","badge rounded-pill bg-light text-dark fs-6 mt-3"),this.first=t},m(E,R){Te(E,t,R),X(t,s),X(s,l),X(s,u),X(s,d),X(t,h),b||(y=mn(d,"click",ku(C)),b=!0)},p(E,R){e=E,R&32&&a!==(a=qu(e[7].schemas,e[2])+"")&&Fn(l,a)},d(E){E&&ke(t),b=!1,y()}}}function u6e(o){let e,t,s,a,l,u,d,h,b,y,C,E=o[6]&&Tme(o),R=o[4]&&Eme(o),$=o[3]&&Pme(o),Q=o[5].length>0&&Mme(o);return{c(){E&&E.c(),e=Ze(),t=re("input"),l=Ze(),u=re("div"),R&&R.c(),d=Ze(),$&&$.c(),h=Ze(),Q&&Q.c(),b=Rs(),Z(t,"type","search"),Z(t,"id",o[1]),Z(t,"class","form-control dropdown-toggle"),Z(t,"placeholder",s="Search for "+o[0].label),Z(t,"data-bs-toggle","dropdown"),Z(t,"autocomplete","off"),t.readOnly=a=o[0].readonly&&!isCreateMode,Vo(t,"is-invalid",o[6]),Z(u,"class","dropdown-menu w-100")},m(F,U){E&&E.m(F,U),Te(F,e,U),Te(F,t,U),ar(t,o[3]),Te(F,l,U),Te(F,u,U),R&&R.m(u,null),X(u,d),$&&$.m(u,null),Te(F,h,U),Q&&Q.m(F,U),Te(F,b,U),y||(C=[mn(t,"keyup",o[11]),mn(t,"input",o[14])],y=!0)},p(F,[U]){F[6]?E?E.p(F,U):(E=Tme(F),E.c(),E.m(e.parentNode,e)):E&&(E.d(1),E=null),U&2&&Z(t,"id",F[1]),U&1&&s!==(s="Search for "+F[0].label)&&Z(t,"placeholder",s),U&1&&a!==(a=F[0].readonly&&!isCreateMode)&&(t.readOnly=a),U&8&&t.value!==F[3]&&ar(t,F[3]),U&64&&Vo(t,"is-invalid",F[6]),F[4]?R?R.p(F,U):(R=Eme(F),R.c(),R.m(u,d)):R&&(R.d(1),R=null),F[3]?$?$.p(F,U):($=Pme(F),$.c(),$.m(u,null)):$&&($.d(1),$=null),F[5].length>0?Q?Q.p(F,U):(Q=Mme(F),Q.c(),Q.m(b.parentNode,b)):Q&&(Q.d(1),Q=null)},i:un,o:un,d(F){E&&E.d(F),F&&ke(e),F&&ke(t),F&&ke(l),F&&ke(u),R&&R.d(),$&&$.d(),F&&ke(h),Q&&Q.d(F),F&&ke(b),y=!1,vi(C)}}}function f6e(o,e,t){let s,a,l;const u=Ur("channel");let{field:d}=e,{id:h}=e,{record:b}=e,{graph:y}=e,{validationErrors:C}=e,E="";function R(G,we){G.preventDefault(),t(12,y.edges=y.edges.filter(ve=>!(ve.target===we&&ve.field===d.name)),y)}function $(G,we){G.preventDefault(),axios.post(u.lucentUrl+"/records",{isCreateMode:!0,record:{schema:d.collections[0],status:"published",data:{[d.searchField]:we}}}).then(ve=>{t(4,l=[]),Q(G,ve.data.records[0]),console.log(ve)}).catch(ve=>{t(4,l=[]),console.log(ve)})}function Q(G,we){G.preventDefault(),t(12,y=K6(y,b,[we],d.name,G.detail.action))}const F=Lc.exports.debounce(G=>{axios.get(u.lucentUrl+"/records/suggestions",{params:{schema:d.collections[0],field:d.searchField,value:E,ui:"text"}}).then(we=>{t(4,l=we.data)}).catch(we=>{t(4,l=[]),console.log(we)})},500);function U(){E=this.value,t(3,E)}const K=(G,we)=>Q(we,G),L=(G,we)=>Q(we,G),te=G=>$(G,E),ne=G=>$(G,E),oe=(G,we)=>R(we,G.id);return o.$$set=G=>{"field"in G&&t(0,d=G.field),"id"in G&&t(1,h=G.id),"record"in G&&t(2,b=G.record),"graph"in G&&t(12,y=G.graph),"validationErrors"in G&&t(13,C=G.validationErrors)},o.$$.update=()=>{var G;o.$$.dirty&8193&&t(6,s=Lm(C,d.name)),o.$$.dirty&4101&&t(5,a=(G=y.edges.filter(we=>we.field===d.name).map(we=>y.records.find(ve=>ve.id==we.target&&b.id==we.source)).filter(we=>!!(we!=null&&we.id)))!=null?G:[])},t(4,l=[]),[d,h,b,E,l,a,s,u,R,$,Q,F,y,C,U,K,L,te,ne,oe]}class d6e extends uo{constructor(e){super(),co(this,e,f6e,u6e,lo,{field:0,id:1,record:2,graph:12,validationErrors:13})}}function h6e(o){let e,t,s,a;function l(h){o[19](h)}var u=o[7];function d(h){let b={schema:h[3],field:h[2],validationErrors:h[5],isCreateMode:h[6],id:h[8]};return h[0][h[2].name]!==void 0&&(b.value=h[0][h[2].name]),{props:b}}return u&&(e=EC(u,d(o)),Ro.push(()=>er(e,"value",l))),{c(){e&&en(e.$$.fragment),s=Rs()},m(h,b){e&&Kt(e,h,b),Te(h,s,b),a=!0},p(h,b){const y={};if(b&8&&(y.schema=h[3]),b&4&&(y.field=h[2]),b&32&&(y.validationErrors=h[5]),b&64&&(y.isCreateMode=h[6]),!t&&b&5&&(t=!0,y.value=h[0][h[2].name],lr(()=>t=!1)),u!==(u=h[7])){if(e){mo();const C=e;Be(C.$$.fragment,1,0,()=>{Jt(C,1)}),go()}u?(e=EC(u,d(h)),Ro.push(()=>er(e,"value",l)),en(e.$$.fragment),xe(e.$$.fragment,1),Kt(e,s.parentNode,s)):e=null}else u&&e.$set(y)},i(h){a||(e&&xe(e.$$.fragment,h),a=!0)},o(h){e&&Be(e.$$.fragment,h),a=!1},d(h){h&&ke(s),e&&Jt(e,h)}}}function m6e(o){let e,t,s;function a(u){o[18](u)}let l={field:o[2],validationErrors:o[5],isCreateMode:o[6],id:o[8]};return o[0][o[2].name]!==void 0&&(l.value=o[0][o[2].name]),e=new BOe({props:l}),Ro.push(()=>er(e,"value",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),d&64&&(h.isCreateMode=u[6]),!t&&d&5&&(t=!0,h.value=u[0][u[2].name],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function g6e(o){let e,t,s;function a(u){o[17](u)}let l={field:o[2],id:o[8],validationErrors:o[5],isCreateMode:o[6]};return o[0][o[2].name]!==void 0&&(l.value=o[0][o[2].name]),e=new Ype({props:l}),Ro.push(()=>er(e,"value",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),d&64&&(h.isCreateMode=u[6]),!t&&d&5&&(t=!0,h.value=u[0][u[2].name],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function p6e(o){let e,t,s;function a(u){o[16](u)}let l={field:o[2],id:o[8],validationErrors:o[5],isCreateMode:o[6]};return o[0][o[2].name]!==void 0&&(l.value=o[0][o[2].name]),e=new Upe({props:l}),Ro.push(()=>er(e,"value",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),d&64&&(h.isCreateMode=u[6]),!t&&d&5&&(t=!0,h.value=u[0][u[2].name],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function b6e(o){let e,t,s,a;function l(h){o[14](h)}function u(h){o[15](h)}let d={record:o[4],id:o[8],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(d.graph=o[1]),o[0][o[2].name]!==void 0&&(d.value=o[0][o[2].name]),e=new W$e({props:d}),Ro.push(()=>er(e,"graph",l)),Ro.push(()=>er(e,"value",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&16&&(y.record=h[4]),b&4&&(y.field=h[2]),b&32&&(y.validationErrors=h[5]),!t&&b&2&&(t=!0,y.graph=h[1],lr(()=>t=!1)),!s&&b&5&&(s=!0,y.value=h[0][h[2].name],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function v6e(o){let e,t,s;function a(u){o[13](u)}let l={record:o[4],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(l.graph=o[1]),e=new MNe({props:l}),Ro.push(()=>er(e,"graph",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&16&&(h.record=u[4]),d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),!t&&d&2&&(t=!0,h.graph=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function O6e(o){let e,t,s;function a(u){o[12](u)}let l={id:o[8],record:o[4],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(l.graph=o[1]),e=new fTe({props:l}),Ro.push(()=>er(e,"graph",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&16&&(h.record=u[4]),d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),!t&&d&2&&(t=!0,h.graph=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function y6e(o){let e,t,s;function a(u){o[11](u)}let l={id:o[8],record:o[4],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(l.graph=o[1]),e=new d6e({props:l}),Ro.push(()=>er(e,"graph",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&16&&(h.record=u[4]),d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),!t&&d&2&&(t=!0,h.graph=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function w6e(o){let e,t,s;function a(u){o[10](u)}let l={id:o[8],record:o[4],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(l.graph=o[1]),e=new c6e({props:l}),Ro.push(()=>er(e,"graph",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&16&&(h.record=u[4]),d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),!t&&d&2&&(t=!0,h.graph=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function _6e(o){let e,t,s;function a(u){o[9](u)}let l={record:o[4],field:o[2],validationErrors:o[5]};return o[1]!==void 0&&(l.graph=o[1]),e=new xTe({props:l}),Ro.push(()=>er(e,"graph",a)),{c(){en(e.$$.fragment)},m(u,d){Kt(e,u,d),s=!0},p(u,d){const h={};d&16&&(h.record=u[4]),d&4&&(h.field=u[2]),d&32&&(h.validationErrors=u[5]),!t&&d&2&&(t=!0,h.graph=u[1],lr(()=>t=!1)),e.$set(h)},i(u){s||(xe(e.$$.fragment,u),s=!0)},o(u){Be(e.$$.fragment,u),s=!1},d(u){Jt(e,u)}}}function S6e(o){let e,t,s,a,l,u;t=new r6e({props:{schema:o[3],field:o[2],id:o[8]}});const d=[_6e,w6e,y6e,O6e,v6e,b6e,p6e,g6e,m6e,h6e],h=[];function b(y,C){return y[2].info.name==="reference"&&y[2].layout==="inline"?0:y[2].info.name==="reference"&&y[2].layout==="table"?1:y[2].info.name==="reference"&&y[2].layout==="tags"?2:y[2].info.name==="reference"?3:y[2].info.name==="file"?4:y[2].info.name==="block"?5:y[2].info.name==="text"?6:y[2].info.name==="slug"?7:y[2].info.name==="textarea"?8:9}return a=b(o),l=h[a]=d[a](o),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),l.c(),Z(e,"class","card editor-field")},m(y,C){Te(y,e,C),Kt(t,e,null),X(e,s),h[a].m(e,null),u=!0},p(y,[C]){const E={};C&8&&(E.schema=y[3]),C&4&&(E.field=y[2]),t.$set(E);let R=a;a=b(y),a===R?h[a].p(y,C):(mo(),Be(h[R],1,1,()=>{h[R]=null}),go(),l=h[a],l?l.p(y,C):(l=h[a]=d[a](y),l.c()),xe(l,1),l.m(e,null))},i(y){u||(xe(t.$$.fragment,y),xe(l),u=!0)},o(y){Be(t.$$.fragment,y),Be(l),u=!1},d(y){y&&ke(e),Jt(t),h[a].d()}}}function C6e(o,e,t){const s={text:Upe,slug:Ype,textarea:BOe,rich:HNe,color:X$e,checkbox:G$e,number:nNe,url:rNe,date:pNe,datetime:FNe,uuid:xNe,json:JNe,markdown:n6e};let{field:a}=e,{data:l}=e,{schema:u}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,{isCreateMode:y}=e,C=s[a.info.name];const E=`field-${a.name}-${d.id}`;function R(we){h=we,t(1,h)}function $(we){h=we,t(1,h)}function Q(we){h=we,t(1,h)}function F(we){h=we,t(1,h)}function U(we){h=we,t(1,h)}function K(we){h=we,t(1,h)}function L(we){o.$$.not_equal(l[a.name],we)&&(l[a.name]=we,t(0,l))}function te(we){o.$$.not_equal(l[a.name],we)&&(l[a.name]=we,t(0,l))}function ne(we){o.$$.not_equal(l[a.name],we)&&(l[a.name]=we,t(0,l))}function oe(we){o.$$.not_equal(l[a.name],we)&&(l[a.name]=we,t(0,l))}function G(we){o.$$.not_equal(l[a.name],we)&&(l[a.name]=we,t(0,l))}return o.$$set=we=>{"field"in we&&t(2,a=we.field),"data"in we&&t(0,l=we.data),"schema"in we&&t(3,u=we.schema),"record"in we&&t(4,d=we.record),"graph"in we&&t(1,h=we.graph),"validationErrors"in we&&t(5,b=we.validationErrors),"isCreateMode"in we&&t(6,y=we.isCreateMode)},[l,h,a,u,d,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G]}class LOe extends uo{constructor(e){super(),co(this,e,C6e,S6e,lo,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function $me(o,e,t){const s=o.slice();return s[5]=e[t][0],s[6]=e[t][1],s}function Nme(o,e,t){const s=o.slice();return s[9]=e[t],s}function Ime(o,e,t){const s=o.slice();return s[5]=e[t][0],s[6]=e[t][1],s}function Bme(o,e,t){const s=o.slice();return s[9]=e[t],s}function k6e(o){let e,t,s;return t=new G6({props:{graph:o[0],record:o[9]}}),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","ms-2 mb-2")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p(a,l){const u={};l&1&&(u.graph=a[0]),t.$set(u)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function x6e(o){let e,t,s;return t=new Xw({props:{record:o[9],size:"small"}}),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","ms-2 mb-2"),rs(e,"max-height","64px")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},p:un,i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function Lme(o){let e,t,s,a;const l=[x6e,k6e],u=[];function d(h,b){var y;return(y=h[9]._file)!=null&&y.path?0:1}return e=d(o),t=u[e]=l[e](o),{c(){t.c(),s=Rs()},m(h,b){u[e].m(h,b),Te(h,s,b),a=!0},p(h,b){t.p(h,b)},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function Fme(o){let e,t,s,a=o[6].schema.label+"",l,u,d,h,b,y=o[6].field.label+"",C,E,R,$;d=new Fa({props:{icon:"angle-right",width:"12",height:"12"}});let Q=o[6].nodes,F=[];for(let K=0;K<Q.length;K+=1)F[K]=Lme(Bme(o,Q,K));const U=K=>Be(F[K],1,1,()=>{F[K]=null});return{c(){e=re("div"),t=re("div"),s=re("span"),l=Ht(a),u=Ze(),en(d.$$.fragment),h=Ze(),b=re("span"),C=Ht(y),E=Ze(),R=re("div");for(let K=0;K<F.length;K+=1)F[K].c();Z(t,"class","text-center mb-3 d-flex justify-content-center align-items-center text-uppercase "),Z(R,"class","d-flex justify-content-center text-center flex-wrap"),Z(e,"class","lx-card mt-3")},m(K,L){Te(K,e,L),X(e,t),X(t,s),X(s,l),X(t,u),Kt(d,t,null),X(t,h),X(t,b),X(b,C),X(e,E),X(e,R);for(let te=0;te<F.length;te+=1)F[te]&&F[te].m(R,null);$=!0},p(K,L){if(L&5){Q=K[6].nodes;let te;for(te=0;te<Q.length;te+=1){const ne=Bme(K,Q,te);F[te]?(F[te].p(ne,L),xe(F[te],1)):(F[te]=Lme(ne),F[te].c(),xe(F[te],1),F[te].m(R,null))}for(mo(),te=Q.length;te<F.length;te+=1)U(te);go()}},i(K){if(!$){xe(d.$$.fragment,K);for(let L=0;L<Q.length;L+=1)xe(F[L]);$=!0}},o(K){Be(d.$$.fragment,K),F=F.filter(Boolean);for(let L=0;L<F.length;L+=1)Be(F[L]);$=!1},d(K){K&&ke(e),Jt(d),ia(F,K)}}}function T6e(o){let e,t,s;return t=new Fa({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","text-center my-4")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function E6e(o){let e,t,s;return t=new Fa({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=re("div"),en(t.$$.fragment),Z(e,"class","text-center my-4")},m(a,l){Te(a,e,l),Kt(t,e,null),s=!0},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Be(t.$$.fragment,a),s=!1},d(a){a&&ke(e),Jt(t)}}}function A6e(o){let e,t,s,a;return t=new G6({props:{graph:o[0],record:o[9]}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),Z(e,"class","ms-2 mb-2")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p(l,u){const d={};u&1&&(d.graph=l[0]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function D6e(o){let e,t,s,a;return t=new Xw({props:{record:o[9],size:"small",showFilename:!0}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),Z(e,"class","ms-2 mb-2"),rs(e,"max-width","64px"),rs(e,"overflow","hidden"),rs(e,"white-space","nowrap"),rs(e,"text-overflow","ellipsis")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p:un,i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function Qme(o){let e,t,s,a;const l=[D6e,A6e],u=[];function d(h,b){return h[6].field.info.ui==="file"?0:1}return e=d(o),t=u[e]=l[e](o),{c(){t.c(),s=Rs()},m(h,b){u[e].m(h,b),Te(h,s,b),a=!0},p(h,b){t.p(h,b)},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function Zme(o){let e,t,s=o[6].field.label+"",a,l,u,d,h,b=o[6].nodes,y=[];for(let E=0;E<b.length;E+=1)y[E]=Qme(Nme(o,b,E));const C=E=>Be(y[E],1,1,()=>{y[E]=null});return{c(){e=re("div"),t=re("div"),a=Ht(s),l=Ze(),u=re("div");for(let E=0;E<y.length;E+=1)y[E].c();d=Ze(),Z(t,"class","text-center mb-5 d-block"),Z(u,"class","d-flex justify-content-center text-center flex-wrap"),Z(e,"class","lx-card mt-3")},m(E,R){Te(E,e,R),X(e,t),X(t,a),X(e,l),X(e,u);for(let $=0;$<y.length;$+=1)y[$]&&y[$].m(u,null);X(e,d),h=!0},p(E,R){if(R&9){b=E[6].nodes;let $;for($=0;$<b.length;$+=1){const Q=Nme(E,b,$);y[$]?(y[$].p(Q,R),xe(y[$],1)):(y[$]=Qme(Q),y[$].c(),xe(y[$],1),y[$].m(u,null))}for(mo(),$=b.length;$<y.length;$+=1)C($);go()}},i(E){if(!h){for(let R=0;R<b.length;R+=1)xe(y[R]);h=!0}},o(E){y=y.filter(Boolean);for(let R=0;R<y.length;R+=1)Be(y[R]);h=!1},d(E){E&&ke(e),ia(y,E)}}}function P6e(o){let e,t=Object.entries(o[2]).length>0,s,a,l,u,d=Object.entries(o[3]).length>0,h,b,y,C=Object.entries(o[2]),E=[];for(let L=0;L<C.length;L+=1)E[L]=Fme(Ime(o,C,L));const R=L=>Be(E[L],1,1,()=>{E[L]=null});let $=t&&T6e();l=new J6({props:{graph:o[0],record:o[1]}});let Q=d&&E6e(),F=Object.entries(o[3]),U=[];for(let L=0;L<F.length;L+=1)U[L]=Zme($me(o,F,L));const K=L=>Be(U[L],1,1,()=>{U[L]=null});return{c(){for(let L=0;L<E.length;L+=1)E[L].c();e=Ze(),$&&$.c(),s=Ze(),a=re("div"),en(l.$$.fragment),u=Ze(),Q&&Q.c(),h=Ze();for(let L=0;L<U.length;L+=1)U[L].c();b=Rs(),rs(a,"max-width","400px"),rs(a,"margin","0 auto")},m(L,te){for(let ne=0;ne<E.length;ne+=1)E[ne]&&E[ne].m(L,te);Te(L,e,te),$&&$.m(L,te),Te(L,s,te),Te(L,a,te),Kt(l,a,null),Te(L,u,te),Q&&Q.m(L,te),Te(L,h,te);for(let ne=0;ne<U.length;ne+=1)U[ne]&&U[ne].m(L,te);Te(L,b,te),y=!0},p(L,[te]){if(te&5){C=Object.entries(L[2]);let oe;for(oe=0;oe<C.length;oe+=1){const G=Ime(L,C,oe);E[oe]?(E[oe].p(G,te),xe(E[oe],1)):(E[oe]=Fme(G),E[oe].c(),xe(E[oe],1),E[oe].m(e.parentNode,e))}for(mo(),oe=C.length;oe<E.length;oe+=1)R(oe);go()}const ne={};if(te&1&&(ne.graph=L[0]),te&2&&(ne.record=L[1]),l.$set(ne),te&9){F=Object.entries(L[3]);let oe;for(oe=0;oe<F.length;oe+=1){const G=$me(L,F,oe);U[oe]?(U[oe].p(G,te),xe(U[oe],1)):(U[oe]=Zme(G),U[oe].c(),xe(U[oe],1),U[oe].m(b.parentNode,b))}for(mo(),oe=F.length;oe<U.length;oe+=1)K(oe);go()}},i(L){if(!y){for(let te=0;te<C.length;te+=1)xe(E[te]);xe($),xe(l.$$.fragment,L),xe(Q);for(let te=0;te<F.length;te+=1)xe(U[te]);y=!0}},o(L){E=E.filter(Boolean);for(let te=0;te<E.length;te+=1)Be(E[te]);Be($),Be(l.$$.fragment,L),Be(Q),U=U.filter(Boolean);for(let te=0;te<U.length;te+=1)Be(U[te]);y=!1},d(L){ia(E,L),L&&ke(e),$&&$.d(L),L&&ke(s),L&&ke(a),Jt(l),L&&ke(u),Q&&Q.d(L),L&&ke(h),ia(U,L),L&&ke(b)}}}function Hme(o,e){return e.includes(":")&&(e=e.split(":")[0]),o.fields.find(t=>t.name===e)}function M6e(o,e,t){const s=Ur("channel");let{graph:a}=e,{record:l}=e,u=a.parentEdges.filter(h=>h.source!==l.id&&h.depth===1).reduce((h,b)=>{let y=s.schemas.find($=>$.name===b.sourceSchema),C=Hme(y,b.field),E=b.sourceSchema+C,R=a.records.find($=>$.id===b.source);return h[E]||(h[E]={field:C,schema:y,nodes:[]}),R&&(h[E].nodes.push(R),h[E].nodes=Lc.exports.uniqBy(h[E].nodes,"id")),h},{}),d=a.edges.filter(h=>h.source===l.id&&h.depth===1).reduce((h,b)=>{let y=s.schemas.find($=>$.name===l.schema),C=Hme(y,b.field),E=C.name+b.targetSchema;h[E]||(h[E]={field:C,nodes:[]});let R=a.records.find($=>$.id===b.target);return R&&(h[E].nodes.push(R),h[E].nodes=Lc.exports.uniqBy(h[E].nodes,"id")),h},{});return o.$$set=h=>{"graph"in h&&t(0,a=h.graph),"record"in h&&t(1,l=h.record)},[a,l,u,d]}class R6e extends uo{constructor(e){super(),co(this,e,M6e,P6e,lo,{graph:0,record:1})}}function zme(o,e,t){const s=o.slice();return s[4]=e[t],s}function $6e(o){var l;let e,t=((l=JSON.stringify(o[1]))!=null?l:"")+"",s,a;return{c(){e=re("div"),s=Ht(t),Z(e,"class",a=o[3]+" field-content svelte-md34ba")},m(u,d){Te(u,e,d),X(e,s)},p(u,d){var h;d&2&&t!==(t=((h=JSON.stringify(u[1]))!=null?h:"")+"")&&Fn(s,t),d&8&&a!==(a=u[3]+" field-content svelte-md34ba")&&Z(e,"class",a)},i:un,o:un,d(u){u&&ke(e)}}}function N6e(o){var a;let e,t=((a=o[1])!=null?a:"")+"",s;return{c(){e=re("div"),Z(e,"class",s=o[3]+" field-content svelte-md34ba")},m(l,u){Te(l,e,u),e.innerHTML=t},p(l,u){var d;u&2&&t!==(t=((d=l[1])!=null?d:"")+"")&&(e.innerHTML=t),u&8&&s!==(s=l[3]+" field-content svelte-md34ba")&&Z(e,"class",s)},i:un,o:un,d(l){l&&ke(e)}}}function I6e(o){var l;let e,t=((l=JSON.stringify(o[1],null,2))!=null?l:"")+"",s,a;return{c(){e=re("div"),s=Ht(t),Z(e,"class",a=o[3]+" field-content svelte-md34ba"),rs(e,"white-space","break-spaces")},m(u,d){Te(u,e,d),X(e,s)},p(u,d){var h;d&2&&t!==(t=((h=JSON.stringify(u[1],null,2))!=null?h:"")+"")&&Fn(s,t),d&8&&a!==(a=u[3]+" field-content svelte-md34ba")&&Z(e,"class",a)},i:un,o:un,d(u){u&&ke(e)}}}function B6e(o){let e,t,s,a,l=o[2][o[0].name],u=[];for(let h=0;h<l.length;h+=1)u[h]=Vme(zme(o,l,h));const d=h=>Be(u[h],1,1,()=>{u[h]=null});return{c(){e=re("div"),t=re("div");for(let h=0;h<u.length;h+=1)u[h].c();Z(t,"class","d-flex align-items-center text-center flex-wrap"),Z(e,"class",s=o[3]+" field-content svelte-md34ba")},m(h,b){Te(h,e,b),X(e,t);for(let y=0;y<u.length;y+=1)u[y]&&u[y].m(t,null);a=!0},p(h,b){if(b&5){l=h[2][h[0].name];let y;for(y=0;y<l.length;y+=1){const C=zme(h,l,y);u[y]?(u[y].p(C,b),xe(u[y],1)):(u[y]=Vme(C),u[y].c(),xe(u[y],1),u[y].m(t,null))}for(mo(),y=l.length;y<u.length;y+=1)d(y);go()}(!a||b&8&&s!==(s=h[3]+" field-content svelte-md34ba"))&&Z(e,"class",s)},i(h){if(!a){for(let b=0;b<l.length;b+=1)xe(u[b]);a=!0}},o(h){u=u.filter(Boolean);for(let b=0;b<u.length;b+=1)Be(u[b]);a=!1},d(h){h&&ke(e),ia(u,h)}}}function L6e(o){let e,t,s,a;return t=new G6({props:{record:o[4]}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),Z(e,"class","ms-2 ")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p(l,u){const d={};u&5&&(d.record=l[4]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function F6e(o){let e,t,s,a;return t=new Xw({props:{record:o[4],size:"small",showFilename:!0}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),Z(e,"class","ms-2 "),rs(e,"max-width","64px"),rs(e,"overflow","hidden"),rs(e,"white-space","nowrap"),rs(e,"text-overflow","ellipsis")},m(l,u){Te(l,e,u),Kt(t,e,null),X(e,s),a=!0},p(l,u){const d={};u&5&&(d.record=l[4]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Be(t.$$.fragment,l),a=!1},d(l){l&&ke(e),Jt(t)}}}function Vme(o){let e,t,s,a;const l=[F6e,L6e],u=[];function d(h,b){var y;return(y=h[4]._file)!=null&&y.path?0:1}return e=d(o),t=u[e]=l[e](o),{c(){t.c(),s=Rs()},m(h,b){u[e].m(h,b),Te(h,s,b),a=!0},p(h,b){let y=e;e=d(h),e===y?u[e].p(h,b):(mo(),Be(u[y],1,1,()=>{u[y]=null}),go(),t=u[e],t?t.p(h,b):(t=u[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function Q6e(o){let e,t,s,a,l,u;const d=[B6e,I6e,N6e,$6e],h=[];function b(y,C){return C&1&&(e=null),C&1&&(t=null),e==null&&(e=!!["reference","file"].includes(y[0].info.name)),e?0:(t==null&&(t=!!["json","block"].includes(y[0].info.name)),t?1:y[0].info.name==="rich"?2:3)}return s=b(o,-1),a=h[s]=d[s](o),{c(){a.c(),l=Rs()},m(y,C){h[s].m(y,C),Te(y,l,C),u=!0},p(y,[C]){let E=s;s=b(y,C),s===E?h[s].p(y,C):(mo(),Be(h[E],1,1,()=>{h[E]=null}),go(),a=h[s],a?a.p(y,C):(a=h[s]=d[s](y),a.c()),xe(a,1),a.m(l.parentNode,l))},i(y){u||(xe(a),u=!0)},o(y){Be(a),u=!1},d(y){h[s].d(y),y&&ke(l)}}}function Z6e(o,e,t){let{field:s}=e,{side:a}=e,{edges:l}=e,{colorClass:u}=e;return o.$$set=d=>{"field"in d&&t(0,s=d.field),"side"in d&&t(1,a=d.side),"edges"in d&&t(2,l=d.edges),"colorClass"in d&&t(3,u=d.colorClass)},[s,a,l,u]}class Wme extends uo{constructor(e){super(),co(this,e,Z6e,Q6e,lo,{field:0,side:1,edges:2,colorClass:3})}}function H6e(o){let e,t,s,a=o[0].rank+"",l,u,d,h,b,y=o[0].target+"",C,E;return{c(){e=re("div"),t=re("span"),s=Ht("Rank: "),l=Ht(a),u=Ze(),d=re("span"),d.textContent="id:",h=Ze(),b=re("a"),C=Ht(y),Z(t,"class","me-3"),Z(b,"href",E=o[1].lucentUrl+"/records/"+o[0].target),Z(b,"target","_blank")},m(R,$){Te(R,e,$),X(e,t),X(t,s),X(t,l),X(e,u),X(e,d),X(e,h),X(e,b),X(b,C)},p(R,[$]){$&1&&a!==(a=R[0].rank+"")&&Fn(l,a),$&1&&y!==(y=R[0].target+"")&&Fn(C,y),$&1&&E!==(E=R[1].lucentUrl+"/records/"+R[0].target)&&Z(b,"href",E)},i:un,o:un,d(R){R&&ke(e)}}}function z6e(o,e,t){const s=Ur("channel");let{edge:a}=e;return o.$$set=l=>{"edge"in l&&t(0,a=l.edge)},[a,s]}class FOe extends uo{constructor(e){super(),co(this,e,z6e,H6e,lo,{edge:0})}}function Ume(o,e,t){const s=o.slice();return s[16]=e[t][0],s[17]=e[t][1],s}function Yme(o,e,t){const s=o.slice();return s[20]=e[t],s}function Xme(o,e,t){const s=o.slice();return s[20]=e[t],s}function jme(o,e,t){const s=o.slice();return s[16]=e[t],s}function qme(o,e,t){const s=o.slice();return s[27]=e[t],s}function V6e(o){let e;return{c(){e=re("div"),e.innerHTML="<span>Revisions are not enabled for this Schema</span>",Z(e,"class","card-body")},m(t,s){Te(t,e,s)},p:un,i:un,o:un,d(t){t&&ke(e)}}}function W6e(o){let e,t,s,a,l=o[8],u=[];for(let h=0;h<l.length;h+=1)u[h]=Kme(qme(o,l,h));const d=h=>Be(u[h],1,1,()=>{u[h]=null});return{c(){e=re("div"),e.textContent="Revisions",t=Ze();for(let h=0;h<u.length;h+=1)u[h].c();s=Rs(),Z(e,"class","header-small mb-3")},m(h,b){Te(h,e,b),Te(h,t,b);for(let y=0;y<u.length;y+=1)u[y]&&u[y].m(h,b);Te(h,s,b),a=!0},p(h,b){if(b&803){l=h[8];let y;for(y=0;y<l.length;y+=1){const C=qme(h,l,y);u[y]?(u[y].p(C,b),xe(u[y],1)):(u[y]=Kme(C),u[y].c(),xe(u[y],1),u[y].m(s.parentNode,s))}for(mo(),y=l.length;y<u.length;y+=1)d(y);go()}},i(h){if(!a){for(let b=0;b<l.length;b+=1)xe(u[b]);a=!0}},o(h){u=u.filter(Boolean);for(let b=0;b<u.length;b+=1)Be(u[b]);a=!1},d(h){h&&ke(e),h&&ke(t),ia(u,h),h&&ke(s)}}}function Gme(o){let e,t,s,a=o[27]._sys.version+"",l,u,d,h,b,y=cy(o[27]._sys.updatedAt)+"",C,E,R,$,Q,F,U,K,L,te;h=new vy({props:{name:Lp(o[1],o[27]._sys.updatedBy),side:24}});function ne(...oe){return o[12](o[27],...oe)}return{c(){var oe,G;e=re("div"),t=re("div"),s=Ht("version "),l=Ht(a),u=Ze(),d=re("div"),en(h.$$.fragment),b=Ze(),C=Ht(y),E=Ze(),R=re("div"),$=re("button"),Q=Ht("Compare"),U=Ze(),Z(t,"class","col-2"),Z(d,"class","col-5"),$.disabled=F=o[27]._sys.version===((oe=o[5])==null?void 0:oe._sys.version),Z($,"class","btn btn-sm btn-outline-primary"),Z(R,"class","col-3 text-center"),Z(e,"class","row p-2 rounded svelte-4o2asb"),Vo(e,"active",o[27]._sys.version===((G=o[5])==null?void 0:G._sys.version))},m(oe,G){Te(oe,e,G),X(e,t),X(t,s),X(t,l),X(e,u),X(e,d),Kt(h,d,null),X(d,b),X(d,C),X(e,E),X(e,R),X(R,$),X($,Q),X(e,U),K=!0,L||(te=mn($,"click",ne),L=!0)},p(oe,G){var ve,Re;o=oe,(!K||G&256)&&a!==(a=o[27]._sys.version+"")&&Fn(l,a);const we={};G&258&&(we.name=Lp(o[1],o[27]._sys.updatedBy)),h.$set(we),(!K||G&256)&&y!==(y=cy(o[27]._sys.updatedAt)+"")&&Fn(C,y),(!K||G&288&&F!==(F=o[27]._sys.version===((ve=o[5])==null?void 0:ve._sys.version)))&&($.disabled=F),(!K||G&288)&&Vo(e,"active",o[27]._sys.version===((Re=o[5])==null?void 0:Re._sys.version))},i(oe){K||(xe(h.$$.fragment,oe),K=!0)},o(oe){Be(h.$$.fragment,oe),K=!1},d(oe){oe&&ke(e),Jt(h),L=!1,te()}}}function Kme(o){let e,t,s=o[27]._sys.version!=o[0]._sys.version&&Gme(o);return{c(){s&&s.c(),e=Rs()},m(a,l){s&&s.m(a,l),Te(a,e,l),t=!0},p(a,l){a[27]._sys.version!=a[0]._sys.version?s?(s.p(a,l),l&257&&xe(s,1)):(s=Gme(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(mo(),Be(s,1,1,()=>{s=null}),go())},i(a){t||(xe(s),t=!0)},o(a){Be(s),t=!1},d(a){s&&s.d(a),a&&ke(e)}}}function Jme(o){let e,t,s,a,l,u,d,h;const b=[Y6e,U6e],y=[];function C(Q,F){return Q[6].length>0?0:1}t=C(o),s=y[t]=b[t](o);let E=Object.entries(o[7]),R=[];for(let Q=0;Q<E.length;Q+=1)R[Q]=ige(Ume(o,E,Q));const $=Q=>Be(R[Q],1,1,()=>{R[Q]=null});return{c(){e=re("div"),s.c(),a=Ze(),l=re("div"),u=re("p"),u.textContent="Record References",d=Ze();for(let Q=0;Q<R.length;Q+=1)R[Q].c();Z(u,"class","text-center fw-bold mb-3 mt-5"),Z(l,"class","mt-3"),Z(e,"class","mt-4")},m(Q,F){Te(Q,e,F),y[t].m(e,null),X(e,a),X(e,l),X(l,u),X(l,d);for(let U=0;U<R.length;U+=1)R[U]&&R[U].m(l,null);h=!0},p(Q,F){let U=t;if(t=C(Q),t===U?y[t].p(Q,F):(mo(),Be(y[U],1,1,()=>{y[U]=null}),go(),s=y[t],s?s.p(Q,F):(s=y[t]=b[t](Q),s.c()),xe(s,1),s.m(e,a)),F&128){E=Object.entries(Q[7]);let K;for(K=0;K<E.length;K+=1){const L=Ume(Q,E,K);R[K]?(R[K].p(L,F),xe(R[K],1)):(R[K]=ige(L),R[K].c(),xe(R[K],1),R[K].m(l,null))}for(mo(),K=E.length;K<R.length;K+=1)$(K);go()}},i(Q){if(!h){xe(s);for(let F=0;F<E.length;F+=1)xe(R[F]);h=!0}},o(Q){Be(s),R=R.filter(Boolean);for(let F=0;F<R.length;F+=1)Be(R[F]);h=!1},d(Q){Q&&ke(e),y[t].d(),ia(R,Q)}}}function U6e(o){let e;return{c(){e=re("div"),e.innerHTML="<span>Nothing will change</span>",Z(e,"class","lx-card text-center")},m(t,s){Te(t,e,s)},p:un,i:un,o:un,d(t){t&&ke(e)}}}function Y6e(o){let e,t,s,a,l=o[5]._sys.version+"",u,d,h,b,y,C,E,R=o[4]&&ege(o),$=o[6],Q=[];for(let U=0;U<$.length;U+=1)Q[U]=tge(jme(o,$,U));const F=U=>Be(Q[U],1,1,()=>{Q[U]=null});return{c(){e=re("p"),e.textContent="If you choose to rollback to this revision",t=Ze(),s=re("button"),a=Ht("Rollback to version "),u=Ht(l),d=Ze(),R&&R.c(),h=Ze(),b=re("div");for(let U=0;U<Q.length;U+=1)Q[U].c();Z(e,"class","text-center fw-bold mb-3 mt-5"),Z(s,"class","btn btn-primary mb-5 d-block mx-auto"),Z(b,"class","mt-3")},m(U,K){Te(U,e,K),Te(U,t,K),Te(U,s,K),X(s,a),X(s,u),Te(U,d,K),R&&R.m(U,K),Te(U,h,K),Te(U,b,K);for(let L=0;L<Q.length;L+=1)Q[L]&&Q[L].m(b,null);y=!0,C||(E=mn(s,"click",o[10]),C=!0)},p(U,K){if((!y||K&32)&&l!==(l=U[5]._sys.version+"")&&Fn(u,l),U[4]?R?R.p(U,K):(R=ege(U),R.c(),R.m(h.parentNode,h)):R&&(R.d(1),R=null),K&97){$=U[6];let L;for(L=0;L<$.length;L+=1){const te=jme(U,$,L);Q[L]?(Q[L].p(te,K),xe(Q[L],1)):(Q[L]=tge(te),Q[L].c(),xe(Q[L],1),Q[L].m(b,null))}for(mo(),L=$.length;L<Q.length;L+=1)F(L);go()}},i(U){if(!y){for(let K=0;K<$.length;K+=1)xe(Q[K]);y=!0}},o(U){Q=Q.filter(Boolean);for(let K=0;K<Q.length;K+=1)Be(Q[K]);y=!1},d(U){U&&ke(e),U&&ke(t),U&&ke(s),U&&ke(d),R&&R.d(U),U&&ke(h),U&&ke(b),ia(Q,U),C=!1,E()}}}function ege(o){let e,t;return{c(){e=re("span"),t=Ht(o[4]),Z(e,"class","d-block text-danger mt-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&16&&Fn(t,s[4])},d(s){s&&ke(e)}}}function tge(o){let e,t,s,a,l,u,d,h=o[16].label+"",b,y,C,E,R,$,Q,F;return s=new Wme({props:{field:o[16],side:o[0].data[o[16].name],colorClass:"text-danger"}}),C=new Fa({props:{icon:"angle-right",width:"12",height:"12"}}),$=new Wme({props:{edges:o[5]._edges,field:o[16],side:o[5].data[o[16].name],colorClass:"text-success"}}),{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),l=re("div"),u=re("div"),d=re("span"),b=Ht(h),y=Ze(),en(C.$$.fragment),E=Ze(),R=re("div"),en($.$$.fragment),Q=Ze(),Z(t,"class","col-5"),Z(d,"class","me-1"),Z(u,"class","h-100 d-flex align-items-center justify-content-center text-secondary"),Z(l,"class","col-2"),Z(R,"class","col-5"),Z(e,"class","lx-card row p-4 mb-4 w-100"),rs(e,"overflow","hidden")},m(U,K){Te(U,e,K),X(e,t),Kt(s,t,null),X(e,a),X(e,l),X(l,u),X(u,d),X(d,b),X(u,y),Kt(C,u,null),X(e,E),X(e,R),Kt($,R,null),Te(U,Q,K),F=!0},p(U,K){const L={};K&64&&(L.field=U[16]),K&65&&(L.side=U[0].data[U[16].name]),s.$set(L),(!F||K&64)&&h!==(h=U[16].label+"")&&Fn(b,h);const te={};K&32&&(te.edges=U[5]._edges),K&64&&(te.field=U[16]),K&96&&(te.side=U[5].data[U[16].name]),$.$set(te)},i(U){F||(xe(s.$$.fragment,U),xe(C.$$.fragment,U),xe($.$$.fragment,U),F=!0)},o(U){Be(s.$$.fragment,U),Be(C.$$.fragment,U),Be($.$$.fragment,U),F=!1},d(U){U&&ke(e),Jt(s),Jt(C),Jt($),U&&ke(Q)}}}function nge(o){let e;return{c(){e=re("p"),e.textContent="No references"},m(t,s){Te(t,e,s)},p:un,d(t){t&&ke(e)}}}function oge(o){let e,t;return e=new FOe({props:{edge:o[20]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&128&&(l.edge=s[20]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function sge(o){let e;return{c(){e=re("p"),e.textContent="No references"},m(t,s){Te(t,e,s)},p:un,d(t){t&&ke(e)}}}function rge(o){let e,t;return e=new FOe({props:{edge:o[20]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&128&&(l.edge=s[20]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function ige(o){let e,t,s=o[16]+"",a,l,u,d,h,b,y,C,E,R,$,Q=o[17].record,F=[];for(let G=0;G<Q.length;G+=1)F[G]=oge(Xme(o,Q,G));const U=G=>Be(F[G],1,1,()=>{F[G]=null});let K=null;Q.length||(K=nge());let L=o[17].revision,te=[];for(let G=0;G<L.length;G+=1)te[G]=rge(Yme(o,L,G));const ne=G=>Be(te[G],1,1,()=>{te[G]=null});let oe=null;return L.length||(oe=sge()),{c(){e=re("div"),t=re("div"),a=Ht(s),l=Ht(":"),u=Ze(),d=re("div"),h=re("p"),h.textContent="Record",b=Ze();for(let G=0;G<F.length;G+=1)F[G].c();K&&K.c(),y=Ze(),C=re("p"),C.textContent="Revision",E=Ze();for(let G=0;G<te.length;G+=1)te[G].c();oe&&oe.c(),R=Ze(),Z(t,"class","col-4"),Z(h,"class","mb-2 text-danger"),Z(C,"class","mt-4 mb-2 text-success"),Z(d,"class","col-8"),Z(e,"class","lx-card row p-4 mb-4 w-100"),rs(e,"overflow","hidden")},m(G,we){Te(G,e,we),X(e,t),X(t,a),X(t,l),X(e,u),X(e,d),X(d,h),X(d,b);for(let ve=0;ve<F.length;ve+=1)F[ve]&&F[ve].m(d,null);K&&K.m(d,null),X(d,y),X(d,C),X(d,E);for(let ve=0;ve<te.length;ve+=1)te[ve]&&te[ve].m(d,null);oe&&oe.m(d,null),X(e,R),$=!0},p(G,we){if((!$||we&128)&&s!==(s=G[16]+"")&&Fn(a,s),we&128){Q=G[17].record;let ve;for(ve=0;ve<Q.length;ve+=1){const Re=Xme(G,Q,ve);F[ve]?(F[ve].p(Re,we),xe(F[ve],1)):(F[ve]=oge(Re),F[ve].c(),xe(F[ve],1),F[ve].m(d,y))}for(mo(),ve=Q.length;ve<F.length;ve+=1)U(ve);go(),!Q.length&&K?K.p(G,we):Q.length?K&&(K.d(1),K=null):(K=nge(),K.c(),K.m(d,y))}if(we&128){L=G[17].revision;let ve;for(ve=0;ve<L.length;ve+=1){const Re=Yme(G,L,ve);te[ve]?(te[ve].p(Re,we),xe(te[ve],1)):(te[ve]=rge(Re),te[ve].c(),xe(te[ve],1),te[ve].m(d,null))}for(mo(),ve=L.length;ve<te.length;ve+=1)ne(ve);go(),!L.length&&oe?oe.p(G,we):L.length?oe&&(oe.d(1),oe=null):(oe=sge(),oe.c(),oe.m(d,null))}},i(G){if(!$){for(let we=0;we<Q.length;we+=1)xe(F[we]);for(let we=0;we<L.length;we+=1)xe(te[we]);$=!0}},o(G){F=F.filter(Boolean);for(let we=0;we<F.length;we+=1)Be(F[we]);te=te.filter(Boolean);for(let we=0;we<te.length;we+=1)Be(te[we]);$=!1},d(G){G&&ke(e),ia(F,G),K&&K.d(),ia(te,G),oe&&oe.d()}}}function X6e(o){let e,t,s,a,l,u,d,h=o[0].id+"",b,y,C,E,R,$=o[0]._sys.version+"",Q,F,U,K,L,te,ne,oe=cy(o[0]._sys.createdAt)+"",G,we,ve,Re,Oe,ce,Xe,tt=cy(o[0]._sys.updatedAt)+"",ot,V,ut,Qe,Bt,Ct,He,st=o[2].revisions+"",rn,Et,Cn,je,mt,he,Zo,Kn,so;te=new vy({props:{name:Lp(o[1],o[0]._sys.createdBy),side:24}}),ce=new vy({props:{name:Lp(o[1],o[0]._sys.updatedBy),side:24}});const Yo=[W6e,V6e],as=[];function kt(pt,Ne){return pt[2].revisions>0?0:1}mt=kt(o),he=as[mt]=Yo[mt](o);let jt=o[5]&&Jme(o);return{c(){e=re("div"),t=re("div"),s=re("div"),a=re("div"),l=re("span"),l.textContent="record id",u=Ze(),d=re("small"),b=Ht(h),y=Ze(),C=re("div"),E=re("span"),E.textContent="current version",R=Ze(),Q=Ht($),F=Ze(),U=re("div"),K=re("span"),K.textContent="created",L=Ze(),en(te.$$.fragment),ne=Ze(),G=Ht(oe),we=Ze(),ve=re("div"),Re=re("span"),Re.textContent="updated",Oe=Ze(),en(ce.$$.fragment),Xe=Ze(),ot=Ht(tt),V=Ze(),ut=re("div"),Qe=re("span"),Qe.textContent="Rules for this schema",Bt=Ze(),Ct=re("small"),He=Ht("Each record maintains the last "),rn=Ht(st),Et=Ht(`
|
|
versions`),Cn=Ze(),je=re("div"),he.c(),Zo=Ze(),Kn=re("div"),jt&&jt.c(),Z(l,"class","label text-end text-muted svelte-4o2asb"),Z(E,"class","label text-end text-muted svelte-4o2asb"),Z(K,"class","label text-end text-muted svelte-4o2asb"),Z(Re,"class","label text-end text-muted svelte-4o2asb"),Z(s,"class","col-8"),Z(Qe,"class","label d-block text-muted svelte-4o2asb"),Z(ut,"class","col-4"),Z(t,"class","row"),Z(e,"class","lx-card "),Z(je,"class","lx-card mt-4")},m(pt,Ne){Te(pt,e,Ne),X(e,t),X(t,s),X(s,a),X(a,l),X(a,u),X(a,d),X(d,b),X(s,y),X(s,C),X(C,E),X(C,R),X(C,Q),X(s,F),X(s,U),X(U,K),X(U,L),Kt(te,U,null),X(U,ne),X(U,G),X(s,we),X(s,ve),X(ve,Re),X(ve,Oe),Kt(ce,ve,null),X(ve,Xe),X(ve,ot),X(t,V),X(t,ut),X(ut,Qe),X(ut,Bt),X(ut,Ct),X(Ct,He),X(Ct,rn),X(Ct,Et),Te(pt,Cn,Ne),Te(pt,je,Ne),as[mt].m(je,null),Te(pt,Zo,Ne),Te(pt,Kn,Ne),jt&&jt.m(Kn,null),o[13](Kn),so=!0},p(pt,[Ne]){(!so||Ne&1)&&h!==(h=pt[0].id+"")&&Fn(b,h),(!so||Ne&1)&&$!==($=pt[0]._sys.version+"")&&Fn(Q,$);const Gt={};Ne&3&&(Gt.name=Lp(pt[1],pt[0]._sys.createdBy)),te.$set(Gt),(!so||Ne&1)&&oe!==(oe=cy(pt[0]._sys.createdAt)+"")&&Fn(G,oe);const bn={};Ne&3&&(bn.name=Lp(pt[1],pt[0]._sys.updatedBy)),ce.$set(bn),(!so||Ne&1)&&tt!==(tt=cy(pt[0]._sys.updatedAt)+"")&&Fn(ot,tt),(!so||Ne&4)&&st!==(st=pt[2].revisions+"")&&Fn(rn,st);let At=mt;mt=kt(pt),mt===At?as[mt].p(pt,Ne):(mo(),Be(as[At],1,1,()=>{as[At]=null}),go(),he=as[mt],he?he.p(pt,Ne):(he=as[mt]=Yo[mt](pt),he.c()),xe(he,1),he.m(je,null)),pt[5]?jt?(jt.p(pt,Ne),Ne&32&&xe(jt,1)):(jt=Jme(pt),jt.c(),xe(jt,1),jt.m(Kn,null)):jt&&(mo(),Be(jt,1,1,()=>{jt=null}),go())},i(pt){so||(xe(te.$$.fragment,pt),xe(ce.$$.fragment,pt),xe(he),xe(jt),so=!0)},o(pt){Be(te.$$.fragment,pt),Be(ce.$$.fragment,pt),Be(he),Be(jt),so=!1},d(pt){pt&&ke(e),Jt(te),Jt(ce),pt&&ke(Cn),pt&&ke(je),as[mt].d(),pt&&ke(Zo),pt&&ke(Kn),jt&&jt.d(),o[13](null)}}}function j6e(o,e,t){let s,a,l,u;const d=Ur("channel");let{record:h}=e,{graph:b}=e,{users:y}=e,{schema:C}=e,E,R="";axios.get(`${d.lucentUrl}/records/${h.id}/revisions`).then(L=>{t(8,s=L.data)}).catch(L=>{console.log(L)});function $(L,te){t(7,u=b.edges.filter(ne=>ne.depth===1).reduce((ne,oe)=>(ne[oe.field]||(ne[oe.field]={record:[],revision:[]}),ne[oe.field].record.push(oe),ne),{})),t(7,u=te._edges.reduce((ne,oe)=>(ne[oe.field]||(ne[oe.field]={record:[],revision:[]}),ne[oe.field].revision.push(oe),ne),u))}function Q(L,te){L.preventDefault(),t(5,l=te),t(6,a=C.fields.filter(ne=>!Lc.exports.isEqual(l.data[ne.name],h.data[ne.name]))),$(a,te),E.scrollIntoView()}function F(L){L.preventDefault(),t(4,R=""),axios.post(`${d.lucentUrl}/records/${h.id}/rollback/${l._sys.version}`).then(te=>{window.location.reload()}).catch(te=>{const ne=te.response.data.error;t(4,R=ne.fieldLabel+": "+ne.message)})}const U=(L,te)=>Q(te,L);function K(L){Ro[L?"unshift":"push"](()=>{E=L,t(3,E)})}return o.$$set=L=>{"record"in L&&t(0,h=L.record),"graph"in L&&t(11,b=L.graph),"users"in L&&t(1,y=L.users),"schema"in L&&t(2,C=L.schema)},t(8,s=[]),t(6,a=[]),t(5,l=null),t(7,u={}),[h,y,C,E,R,l,a,u,s,Q,F,b,U,K]}class q6e extends uo{constructor(e){super(),co(this,e,j6e,X6e,lo,{record:0,graph:11,users:1,schema:2})}}const{window:G6e}=q2e;function age(o,e,t){const s=o.slice();return s[23]=e[t],s}function lge(o){let e,t,s,a,l,u;function d(E){o[15](E)}let h={record:o[0],schema:o[2]};o[0].status!==void 0&&(h.status=o[0].status),s=new zpe({props:h}),Ro.push(()=>er(s,"status",d));function b(E,R){if(E[4])return J6e;if(E[10])return K6e}let y=b(o),C=y&&y(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),l=Ze(),C&&C.c(),Z(t,"class","d-flex mt-3 mb-3 align-items-center justify-content-center"),Z(e,"class","shadow-lg "),rs(e,"position","fixed"),rs(e,"bottom","0"),rs(e,"left","0px"),rs(e,"width","100%"),rs(e,"background","rgb(206, 223, 210)"),rs(e,"z-index","1050")},m(E,R){Te(E,e,R),X(e,t),Kt(s,t,null),X(t,l),C&&C.m(t,null),u=!0},p(E,R){const $={};R&1&&($.record=E[0]),R&4&&($.schema=E[2]),!a&&R&1&&(a=!0,$.status=E[0].status,lr(()=>a=!1)),s.$set($),y===(y=b(E))&&C?C.p(E,R):(C&&C.d(1),C=y&&y(E),C&&(C.c(),C.m(t,null)))},i(E){u||(xe(s.$$.fragment,E),u=!0)},o(E){Be(s.$$.fragment,E),u=!1},d(E){E&&ke(e),Jt(s),C&&C.d()}}}function K6e(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Save`,Z(e,"type","button"),Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[13]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function J6e(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
Create`,Z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Te(a,e,l),t||(s=mn(e,"click",o[13]),t=!0)},p:un,d(a){a&&ke(e),t=!1,s()}}}function eIe(o){let e,t;return e=new q6e({props:{record:o[0],graph:o[1],users:o[6],schema:o[2]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.record=s[0]),a&2&&(l.graph=s[1]),a&64&&(l.users=s[6]),a&4&&(l.schema=s[2]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function tIe(o){let e,t;return e=new R6e({props:{graph:o[1],record:o[0]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&2&&(l.graph=s[1]),a&1&&(l.record=s[0]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function nIe(o){let e,t,s=[],a=new Map,l,u;e=new Vpe({props:{record:o[0],schema:o[2]}});let d=o[11];const h=b=>b[23].name;for(let b=0;b<d.length;b+=1){let y=age(o,d,b),C=h(y);a.set(C,s[b]=uge(C,y))}return{c(){en(e.$$.fragment),t=Ze();for(let b=0;b<s.length;b+=1)s[b].c();l=Rs()},m(b,y){Kt(e,b,y),Te(b,t,y);for(let C=0;C<s.length;C+=1)s[C]&&s[C].m(b,y);Te(b,l,y),u=!0},p(b,y){const C={};y&1&&(C.record=b[0]),y&4&&(C.schema=b[2]),e.$set(C),y&2455&&(d=b[11],mo(),s=Jd(s,y,h,1,b,d,a,l.parentNode,xv,uge,l,age),go())},i(b){if(!u){xe(e.$$.fragment,b);for(let y=0;y<d.length;y+=1)xe(s[y]);u=!0}},o(b){Be(e.$$.fragment,b);for(let y=0;y<s.length;y+=1)Be(s[y]);u=!1},d(b){Jt(e,b),b&&ke(t);for(let y=0;y<s.length;y+=1)s[y].d(b);b&&ke(l)}}}function cge(o){let e,t,s,a;function l(h){o[17](h)}function u(h){o[18](h)}let d={field:o[23],schema:o[2],record:o[0],validationErrors:o[7],isCreateMode:o[4]};return o[0].data!==void 0&&(d.data=o[0].data),o[1]!==void 0&&(d.graph=o[1]),e=new LOe({props:d}),Ro.push(()=>er(e,"data",l)),Ro.push(()=>er(e,"graph",u)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.schema=h[2]),b&1&&(y.record=h[0]),b&128&&(y.validationErrors=h[7]),b&16&&(y.isCreateMode=h[4]),!t&&b&1&&(t=!0,y.data=h[0].data,lr(()=>t=!1)),!s&&b&2&&(s=!0,y.graph=h[1],lr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Be(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function uge(o,e){let t,s,a,l=e[8]===e[23].group&&cge(e);return{key:o,first:null,c(){t=Rs(),l&&l.c(),s=Rs(),this.first=t},m(u,d){Te(u,t,d),l&&l.m(u,d),Te(u,s,d),a=!0},p(u,d){e=u,e[8]===e[23].group?l?(l.p(e,d),d&256&&xe(l,1)):(l=cge(e),l.c(),xe(l,1),l.m(s.parentNode,s)):l&&(mo(),Be(l,1,1,()=>{l=null}),go())},i(u){a||(xe(l),a=!0)},o(u){Be(l),a=!1},d(u){u&&ke(t),l&&l.d(u),u&&ke(s)}}}function oIe(o){let e,t,s,a,l,u,d=!["_graph","_info"].includes(o[8])&&o[5],h,b,y,C,E,R,$,Q,F,U,K,L,te;t=new VSe({props:{managerRecords:o[3],graph:o[1]}});function ne(Xe){o[14](Xe)}let oe={schema:o[2],record:o[0],isCreateMode:o[4],graph:o[1]};o[8]!==void 0&&(oe.activeContentTab=o[8]),a=new jSe({props:oe}),Ro.push(()=>er(a,"activeContentTab",ne));let G=d&&lge(o);b=new X6({props:{message:o[9]}});function we(Xe){o[16](Xe)}let ve={schema:o[2],isCreateMode:o[4]};o[8]!==void 0&&(ve.active=o[8]),E=new Wpe({props:ve}),Ro.push(()=>er(E,"active",we));const Re=[nIe,tIe,eIe],Oe=[];function ce(Xe,tt){return tt&256&&(Q=null),Q==null&&(Q=!["_graph","_info"].includes(Xe[8])),Q?0:Xe[8]==="_graph"?1:Xe[8]==="_info"?2:-1}return~(F=ce(o,-1))&&(U=Oe[F]=Re[F](o)),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),en(a.$$.fragment),u=Ze(),G&&G.c(),h=Ze(),en(b.$$.fragment),y=Ze(),C=re("div"),en(E.$$.fragment),$=Ze(),U&&U.c(),Z(C,"class","mt-4"),rs(C,"margin-bottom","150px"),Z(e,"class","wrapper-normal transparent")},m(Xe,tt){Te(Xe,e,tt),Kt(t,e,null),X(e,s),Kt(a,e,null),X(e,u),G&&G.m(e,null),X(e,h),Kt(b,e,null),X(e,y),X(e,C),Kt(E,C,null),X(C,$),~F&&Oe[F].m(C,null),K=!0,L||(te=mn(G6e,"beforeunload",o[12]),L=!0)},p(Xe,[tt]){const ot={};tt&8&&(ot.managerRecords=Xe[3]),tt&2&&(ot.graph=Xe[1]),t.$set(ot);const V={};tt&4&&(V.schema=Xe[2]),tt&1&&(V.record=Xe[0]),tt&16&&(V.isCreateMode=Xe[4]),tt&2&&(V.graph=Xe[1]),!l&&tt&256&&(l=!0,V.activeContentTab=Xe[8],lr(()=>l=!1)),a.$set(V),tt&288&&(d=!["_graph","_info"].includes(Xe[8])&&Xe[5]),d?G?(G.p(Xe,tt),tt&288&&xe(G,1)):(G=lge(Xe),G.c(),xe(G,1),G.m(e,h)):G&&(mo(),Be(G,1,1,()=>{G=null}),go());const ut={};tt&512&&(ut.message=Xe[9]),b.$set(ut);const Qe={};tt&4&&(Qe.schema=Xe[2]),tt&16&&(Qe.isCreateMode=Xe[4]),!R&&tt&256&&(R=!0,Qe.active=Xe[8],lr(()=>R=!1)),E.$set(Qe);let Bt=F;F=ce(Xe,tt),F===Bt?~F&&Oe[F].p(Xe,tt):(U&&(mo(),Be(Oe[Bt],1,1,()=>{Oe[Bt]=null}),go()),~F?(U=Oe[F],U?U.p(Xe,tt):(U=Oe[F]=Re[F](Xe),U.c()),xe(U,1),U.m(C,null)):U=null)},i(Xe){K||(xe(t.$$.fragment,Xe),xe(a.$$.fragment,Xe),xe(G),xe(b.$$.fragment,Xe),xe(E.$$.fragment,Xe),xe(U),K=!0)},o(Xe){Be(t.$$.fragment,Xe),Be(a.$$.fragment,Xe),Be(G),Be(b.$$.fragment,Xe),Be(E.$$.fragment,Xe),Be(U),K=!1},d(Xe){Xe&&ke(e),Jt(t),Jt(a),G&&G.d(),Jt(b),Jt(E),~F&&Oe[F].d(),L=!1,te()}}}function sIe(o,e,t){let s,a,l;const u=Ur("channel");let{schema:d}=e,{record:h}=e,{graph:b={records:[],edges:[]}}=e,{recordHistory:y}=e,{isCreateMode:C}=e,{isWritable:E=!1}=e,{users:R}=e,$,Q="",F=d.fields.filter(Re=>Re.name!=="id");W1(()=>{U()});function U(){$={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}Epe(()=>{t(10,s=L())});function K(Re){return s?Re.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Re.returnValue,"...")}function L(){return C?!1:!Lc.exports.isEqual($,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function te(Re){return Re.preventDefault(),console.log("SAVE: Attempt"),t(7,a=null),t(9,l=""),new Promise(function(Oe,ce){var Xe;if(!s&&!C){Oe(null);return}if(!h){Oe(null);return}t(1,b.edges=(Xe=b.edges)==null?void 0:Xe.filter(tt=>!tt._isTrashed&&tt.source===h.id),b),axios.post(u.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:C}).then(function(tt){var ot;if(console.log("SAVE: SAVED"),C)window.location=u.lucentUrl+"/records/"+h.id;else{if(t(0,h=(ot=tt.data.records[0])!=null?ot:null),!h){t(10,s=!1),window.location=u.lucentUrl;return}t(1,b=tt.data),U()}Oe(null)}).catch(function(tt){tt.response&&(typeof tt.response.data.error=="string"?t(9,l=tt.response.data.error):(t(7,a=tt.response.data.error),console.log(a))),Oe(null)})})}function ne(Re){Q=Re,t(8,Q)}function oe(Re){o.$$.not_equal(h.status,Re)&&(h.status=Re,t(0,h))}function G(Re){Q=Re,t(8,Q)}function we(Re){o.$$.not_equal(h.data,Re)&&(h.data=Re,t(0,h))}function ve(Re){b=Re,t(1,b)}return o.$$set=Re=>{"schema"in Re&&t(2,d=Re.schema),"record"in Re&&t(0,h=Re.record),"graph"in Re&&t(1,b=Re.graph),"recordHistory"in Re&&t(3,y=Re.recordHistory),"isCreateMode"in Re&&t(4,C=Re.isCreateMode),"isWritable"in Re&&t(5,E=Re.isWritable),"users"in Re&&t(6,R=Re.users)},o.$$.update=()=>{o.$$.dirty&128&&t(9,l=a?`Record submission failed. ${Object.entries(a).length} error(s)`:null)},t(10,s=!1),t(7,a=null),[h,b,d,y,C,E,R,a,Q,l,s,F,K,te,ne,oe,G,we,ve]}class rIe extends uo{constructor(e){super(),co(this,e,sIe,oIe,lo,{schema:2,record:0,graph:1,recordHistory:3,isCreateMode:4,isWritable:5,users:6})}}function fge(o,e,t){const s=o.slice();return s[3]=e[t],s}function dge(o){let e,t=o[3].label+"",s,a;return{c(){var l;e=re("a"),s=Ht(t),Z(e,"class","list-group-item list-group-item-action"),Z(e,"aria-current","page"),Z(e,"href",a=o[2].lucentUrl+"/content/"+o[3].name),Vo(e,"active",o[3].name===((l=o[1])==null?void 0:l.name))},m(l,u){Te(l,e,u),X(e,s)},p(l,u){var d;u&1&&t!==(t=l[3].label+"")&&Fn(s,t),u&1&&a!==(a=l[2].lucentUrl+"/content/"+l[3].name)&&Z(e,"href",a),u&3&&Vo(e,"active",l[3].name===((d=l[1])==null?void 0:d.name))},d(l){l&&ke(e)}}}function iIe(o){let e,t=o[0],s=[];for(let a=0;a<t.length;a+=1)s[a]=dge(fge(o,t,a));return{c(){e=re("div");for(let a=0;a<s.length;a+=1)s[a].c();Z(e,"class","list-group list-group-flush")},m(a,l){Te(a,e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null)},p(a,[l]){if(l&7){t=a[0];let u;for(u=0;u<t.length;u+=1){const d=fge(a,t,u);s[u]?s[u].p(d,l):(s[u]=dge(d),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=t.length}},i:un,o:un,d(a){a&&ke(e),ia(s,a)}}}function aIe(o,e,t){const s=Ur("channel");let{schemas:a}=e,{schema:l}=e;return o.$$set=u=>{"schemas"in u&&t(0,a=u.schemas),"schema"in u&&t(1,l=u.schema)},[a,l,s]}class tie extends uo{constructor(e){super(),co(this,e,aIe,iIe,lo,{schemas:0,schema:1})}}function lIe(o){let e,t;return{c(){e=re("a"),t=Ht("Build website"),Z(e,"href",o[4].lucentUrl+"/build-report"),Z(e,"class","btn btn-outline-primary btn-sm d-")},m(s,a){Te(s,e,a),X(e,t)},p:un,d(s){s&&ke(e)}}}function cIe(o){let e,t,s,a,l,u,d,h,b;return h=new tie({props:{schemas:o[8],schema:o[0]}}),{c(){e=re("div"),t=re("h2"),s=re("button"),a=Ht("Other"),l=Ze(),u=re("div"),d=re("div"),en(h.$$.fragment),Z(s,"class","accordion-button"),Z(s,"type","button"),Z(s,"data-bs-toggle","collapse"),Z(s,"data-bs-target","#panelsStayOpen-collapseOther"),Z(s,"aria-expanded",o[3]),Z(s,"aria-controls","panelsStayOpen-collapseOther"),Vo(s,"collapsed",!o[3]),Z(t,"class","accordion-header"),Z(t,"id","panelsStayOpen-headingOther"),Z(d,"class","accordion-body"),Z(u,"id","panelsStayOpen-collapseOther"),Z(u,"class","accordion-collapse collapse"),Z(u,"aria-labelledby","panelsStayOpen-headingOther"),Vo(u,"show",o[3]),Z(e,"class","accordion-item")},m(y,C){Te(y,e,C),X(e,t),X(t,s),X(s,a),X(e,l),X(e,u),X(u,d),Kt(h,d,null),b=!0},p(y,C){(!b||C&8)&&Z(s,"aria-expanded",y[3]),(!b||C&8)&&Vo(s,"collapsed",!y[3]);const E={};C&1&&(E.schema=y[0]),h.$set(E),(!b||C&8)&&Vo(u,"show",y[3])},i(y){b||(xe(h.$$.fragment,y),b=!0)},o(y){Be(h.$$.fragment,y),b=!1},d(y){y&&ke(e),Jt(h)}}}function uIe(o){let e,t,s,a,l,u,d,h,b;return h=new tie({props:{schemas:o[7],schema:o[0]}}),{c(){e=re("div"),t=re("h2"),s=re("button"),a=Ht("Filesystem"),l=Ze(),u=re("div"),d=re("div"),en(h.$$.fragment),Z(s,"class","accordion-button "),Z(s,"type","button"),Z(s,"data-bs-toggle","collapse"),Z(s,"data-bs-target","#panelsStayOpen-collapseFS"),Z(s,"aria-expanded",o[2]),Z(s,"aria-controls","panelsStayOpen-collapseFS"),Vo(s,"collapsed",!o[2]),Z(t,"class","accordion-header"),Z(t,"id","panelsStayOpen-headingFS"),Z(d,"class","accordion-body"),Z(u,"id","panelsStayOpen-collapseFS"),Z(u,"class","accordion-collapse collapse"),Z(u,"aria-labelledby","panelsStayOpen-headingFS"),Vo(u,"show",o[2]),Z(e,"class","accordion-item")},m(y,C){Te(y,e,C),X(e,t),X(t,s),X(s,a),X(e,l),X(e,u),X(u,d),Kt(h,d,null),b=!0},p(y,C){(!b||C&4)&&Z(s,"aria-expanded",y[2]),(!b||C&4)&&Vo(s,"collapsed",!y[2]);const E={};C&1&&(E.schema=y[0]),h.$set(E),(!b||C&4)&&Vo(u,"show",y[2])},i(y){b||(xe(h.$$.fragment,y),b=!0)},o(y){Be(h.$$.fragment,y),b=!1},d(y){y&&ke(e),Jt(h)}}}function fIe(o){let e,t,s,a,l,u,d=o[4].name+"",h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt,ot,V,ut,Qe=o[4].generateCommand&&lIe(o);F=new vy({props:{side:"28",name:o[6].name}}),ce=new tie({props:{schemas:o[5].filter(dIe),schema:o[0]}});let Bt=o[8].length>0&&cIe(o),Ct=o[7].length>0&&uIe(o);return{c(){e=re("nav"),t=re("div"),s=re("button"),s.textContent="\xAB Content",a=Ze(),l=re("div"),u=re("a"),h=Ht(d),b=Ze(),y=re("a"),C=Ht("Members"),E=Ze(),Qe&&Qe.c(),R=Ze(),$=re("div"),Q=re("a"),en(F.$$.fragment),U=Ze(),K=re("div"),L=re("div"),te=re("button"),te.textContent="\xAB close",ne=Ze(),oe=re("div"),G=re("div"),we=re("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>',ve=Ze(),Re=re("div"),Oe=re("div"),en(ce.$$.fragment),Xe=Ze(),Bt&&Bt.c(),tt=Ze(),Ct&&Ct.c(),Z(s,"class","btn btn-primary btn-sm d-xxl-none"),Z(u,"class","nav-item"),Z(u,"href",o[4].lucentUrl),Z(y,"class","nav-item"),Z(y,"href",o[4].lucentUrl+"/members"),Z(l,"class","d-flex align-items-center "),Z(Q,"class","nav-item"),Z(Q,"href",o[4].lucentUrl+"/profile"),Z(e,"class","lx-nav"),Z(te,"class","btn btn-primary btn-sm d-xxl-none mb-4"),Z(we,"class","accordion-header"),Z(we,"id","panelsStayOpen-headingMain"),Z(Oe,"class","accordion-body"),Z(Re,"id","panelsStayOpen-collapseMain"),Z(Re,"class","accordion-collapse collapse show"),Z(Re,"aria-labelledby","panelsStayOpen-headingMain"),Z(G,"class","accordion-item"),Z(oe,"class","accordion"),Z(L,"class","offcanvas-body"),Z(K,"class","offcanvas offcanvas-start d-xxl-block show border-0 bg-light-subtle"),rs(K,"padding-top","36px "),Z(K,"data-bs-scroll","true"),Z(K,"data-bs-backdrop","false"),Z(K,"tabindex","-1"),Z(K,"aria-labelledby","offcanvasScrollingLabel"),Vo(K,"d-none",!o[1])},m(He,st){Te(He,e,st),X(e,t),X(t,s),X(e,a),X(e,l),X(l,u),X(u,h),X(l,b),X(l,y),X(y,C),X(l,E),Qe&&Qe.m(l,null),X(e,R),X(e,$),X($,Q),Kt(F,Q,null),Te(He,U,st),Te(He,K,st),X(K,L),X(L,te),X(L,ne),X(L,oe),X(oe,G),X(G,we),X(G,ve),X(G,Re),X(Re,Oe),Kt(ce,Oe,null),X(oe,Xe),Bt&&Bt.m(oe,null),X(oe,tt),Ct&&Ct.m(oe,null),ot=!0,V||(ut=[mn(s,"click",o[9]),mn(te,"click",o[10])],V=!0)},p(He,[st]){He[4].generateCommand&&Qe.p(He,st);const rn={};st&1&&(rn.schema=He[0]),ce.$set(rn),He[8].length>0&&Bt.p(He,st),He[7].length>0&&Ct.p(He,st),(!ot||st&2)&&Vo(K,"d-none",!He[1])},i(He){ot||(xe(F.$$.fragment,He),xe(ce.$$.fragment,He),xe(Bt),xe(Ct),ot=!0)},o(He){Be(F.$$.fragment,He),Be(ce.$$.fragment,He),Be(Bt),Be(Ct),ot=!1},d(He){He&&ke(e),Qe&&Qe.d(),Jt(F),He&&ke(U),He&&ke(K),Jt(ce),Bt&&Bt.d(),Ct&&Ct.d(),V=!1,vi(ut)}}}const dIe=o=>o.isEntry;function hIe(o,e,t){let{schema:s}=e;const a=Ur("channel"),l=Ur("readableSchemas"),u=Ur("user");let d=!1;const h=l.filter($=>$.type==="files"),b=l.filter($=>!$.isEntry&&$.type==="collection");let y=!1,C=!1;s&&(y=h.filter($=>$.name===s.name).length>0,C=b.filter($=>$.name===s.name).length>0);const E=$=>t(1,d=!0),R=$=>t(1,d=!1);return o.$$set=$=>{"schema"in $&&t(0,s=$.schema)},[s,d,y,C,a,l,u,h,b,E,R]}class mIe extends uo{constructor(e){super(),co(this,e,hIe,fIe,lo,{schema:0})}}function gIe(o){let e,t=qu(o[3].schemas,o[2],o[1])+"",s,a;return{c(){e=re("a"),s=Ht(t),Z(e,"href",a=o[3].lucentUrl+"/records/"+o[2].id),Z(e,"class","text-decoration-none text-dark d-block")},m(l,u){Te(l,e,u),X(e,s)},p(l,u){u&6&&t!==(t=qu(l[3].schemas,l[2],l[1])+"")&&Fn(s,t),u&4&&a!==(a=l[3].lucentUrl+"/records/"+l[2].id)&&Z(e,"href",a)},i:un,o:un,d(l){l&&ke(e)}}}function pIe(o){let e,t;return e=new Xw({props:{record:o[2],size:"tiny"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&4&&(l.record=s[2]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function bIe(o){let e,t,s,a,l,u,d=o[4].label+"",h,b,y,C,E,R,$,Q,F,U,K;const L=[pIe,gIe],te=[];function ne(oe,G){return oe[4].type==="files"?0:1}return t=ne(o),s=te[t]=L[t](o),C=new ire({props:{status:o[2].status}}),Q=new vy({props:{name:Lp(o[0],o[2]._sys.updatedBy),side:24}}),{c(){e=re("td"),s.c(),a=Ze(),l=re("td"),u=re("a"),h=Ht(d),b=Ze(),y=re("td"),en(C.$$.fragment),E=Ze(),R=re("td"),$=re("div"),en(Q.$$.fragment),F=Ze(),U=re("div"),U.textContent=`${o[5]}`,Z(u,"class","text-decoration-none lx-small-text"),Z(u,"href",o[3].lucentUrl+"/content/"+o[4].name),Z(y,"class","text-center"),Z(U,"class","ms-2"),Z($,"class","d-flex")},m(oe,G){Te(oe,e,G),te[t].m(e,null),Te(oe,a,G),Te(oe,l,G),X(l,u),X(u,h),Te(oe,b,G),Te(oe,y,G),Kt(C,y,null),Te(oe,E,G),Te(oe,R,G),X(R,$),Kt(Q,$,null),X($,F),X($,U),K=!0},p(oe,[G]){s.p(oe,G);const we={};G&4&&(we.status=oe[2].status),C.$set(we);const ve={};G&5&&(ve.name=Lp(oe[0],oe[2]._sys.updatedBy)),Q.$set(ve)},i(oe){K||(xe(s),xe(C.$$.fragment,oe),xe(Q.$$.fragment,oe),K=!0)},o(oe){Be(s),Be(C.$$.fragment,oe),Be(Q.$$.fragment,oe),K=!1},d(oe){oe&&ke(e),te[t].d(),oe&&ke(a),oe&&ke(l),oe&&ke(b),oe&&ke(y),Jt(C),oe&&ke(E),oe&&ke(R),Jt(Q)}}}function vIe(o,e,t){const s=Ur("channel");let{users:a}=e,{graph:l}=e,{record:u}=e,d=s.schemas.find(b=>b.name===u.schema),h=Fpe(Jz(u._sys.updatedAt),{addSuffix:!0});return o.$$set=b=>{"users"in b&&t(0,a=b.users),"graph"in b&&t(1,l=b.graph),"record"in b&&t(2,u=b.record)},[a,l,u,s,d,h]}class OIe extends uo{constructor(e){super(),co(this,e,vIe,bIe,lo,{users:0,graph:1,record:2})}}function hge(o,e,t){const s=o.slice();return s[4]=e[t],s}function mge(o){let e,t,s,a,l=[],u=new Map,d,h=o[0];const b=y=>y[4].id;for(let y=0;y<h.length;y+=1){let C=hge(o,h,y),E=b(C);u.set(E,l[y]=gge(E,C))}return{c(){e=re("div"),t=re("div"),s=re("table"),a=re("tbody");for(let y=0;y<l.length;y+=1)l[y].c();Z(s,"class",""),Z(t,"class","lx-table p-0"),Z(e,"class","lx-card mb-4")},m(y,C){Te(y,e,C),X(e,t),X(t,s),X(s,a);for(let E=0;E<l.length;E+=1)l[E]&&l[E].m(a,null);d=!0},p(y,C){C&7&&(h=y[0],mo(),l=Jd(l,C,b,1,y,h,u,a,xv,gge,null,hge),go())},i(y){if(!d){for(let C=0;C<h.length;C+=1)xe(l[C]);d=!0}},o(y){for(let C=0;C<l.length;C+=1)Be(l[C]);d=!1},d(y){y&&ke(e);for(let C=0;C<l.length;C+=1)l[C].d()}}}function gge(o,e){let t,s,a,l;return s=new OIe({props:{graph:e[1],record:e[4],users:e[2]}}),{key:o,first:null,c(){t=re("tr"),en(s.$$.fragment),a=Ze(),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&2&&(h.graph=e[1]),d&1&&(h.record=e[4]),d&4&&(h.users=e[2]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function yIe(o){let e,t,s,a,l=o[0].length>0&&mge(o);return{c(){e=re("div"),t=re("h3"),t.textContent="Latest Content changes",s=Ze(),l&&l.c(),Z(t,"class","header-small mb-4 mt-5"),Z(e,"class","wrapper-normal transparent")},m(u,d){Te(u,e,d),X(e,t),X(e,s),l&&l.m(e,null),a=!0},p(u,[d]){u[0].length>0?l?(l.p(u,d),d&1&&xe(l,1)):(l=mge(u),l.c(),xe(l,1),l.m(e,null)):l&&(mo(),Be(l,1,1,()=>{l=null}),go())},i(u){a||(xe(l),a=!0)},o(u){Be(l),a=!1},d(u){u&&ke(e),l&&l.d()}}}function wIe(o,e,t){const s=Ur("channel");let a=[],l=null,u=[];return W1(()=>{axios.get(s.lucentUrl+"/home/records").then(d=>{t(0,a=d.data.records),t(1,l=d.data.graph),t(2,u=d.data.users)}).catch(d=>{console.log(d)})}),[a,l,u]}class _Ie extends uo{constructor(e){super(),co(this,e,wIe,yIe,lo,{})}}function pge(o){let e;return{c(){e=re("span"),e.textContent="Build in progress",Z(e,"class","badge text-bg-warning")},m(t,s){Te(t,e,s)},d(t){t&&ke(e)}}}function bge(o){let e;return{c(){e=re("span"),e.textContent="Build completed",Z(e,"class","badge text-bg-info")},m(t,s){Te(t,e,s)},d(t){t&&ke(e)}}}function SIe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F=o[1]&&pge(),U=!o[1]&&o[2]&&bge();return{c(){e=re("div"),t=re("div"),s=re("h3"),a=Ht(o[0]),l=Ze(),u=re("button"),d=Ht("Start Build"),h=Ze(),b=re("div"),F&&F.c(),y=Ze(),U&&U.c(),C=Ze(),E=re("pre"),R=Ht(o[2]),Z(s,"class","header-small mb-5"),Z(u,"class","btn btn-outline-primary btn-sm mb-3"),u.disabled=o[1],Z(b,"class","mb-3"),Z(t,"class","lx-card mt-5"),Z(e,"class","wrapper-tiny transparent mb-5")},m(K,L){Te(K,e,L),X(e,t),X(t,s),X(s,a),X(t,l),X(t,u),X(u,d),X(t,h),X(t,b),F&&F.m(b,null),X(b,y),U&&U.m(b,null),X(t,C),X(t,E),X(E,R),$||(Q=mn(u,"click",o[3]),$=!0)},p(K,[L]){L&1&&Fn(a,K[0]),L&2&&(u.disabled=K[1]),K[1]?F||(F=pge(),F.c(),F.m(b,y)):F&&(F.d(1),F=null),!K[1]&&K[2]?U||(U=bge(),U.c(),U.m(b,null)):U&&(U.d(1),U=null),L&4&&Fn(R,K[2])},i:un,o:un,d(K){K&&ke(e),F&&F.d(),U&&U.d(),$=!1,Q()}}}function CIe(o,e,t){let s;const a=Ur("channel");let{title:l}=e,u=!1;function d(){const b=new EventSource(a.lucentUrl+"/build-report-source");b.onmessage=function(y){t(1,u=!0);const C=JSON.parse(y.data);C.date,t(2,s=C.logs)},b.onerror=y=>{console.log(y),b.close(),t(1,u=!1)}}function h(b){b.preventDefault(),t(1,u=!0),axios.post(a.lucentUrl+"/build").then(y=>{d()})}return W1(()=>{d()}),o.$$set=b=>{"title"in b&&t(0,l=b.title)},t(2,s=""),[l,u,s,h]}class kIe extends uo{constructor(e){super(),co(this,e,CIe,SIe,lo,{title:0})}}function xIe(o){let e,t,s,a,l;e=new mIe({props:{schema:o[2].schema}});const u=[{title:o[0]},o[2]];var d=o[3][o[1]];function h(b){let y={};for(let C=0;C<u.length;C+=1)y=Y6(y,u[C]);return{props:y}}return d&&(s=EC(d,h())),{c(){en(e.$$.fragment),t=Ze(),s&&en(s.$$.fragment),a=Rs()},m(b,y){Kt(e,b,y),Te(b,t,y),s&&Kt(s,b,y),Te(b,a,y),l=!0},p(b,[y]){const C={};y&4&&(C.schema=b[2].schema),e.$set(C);const E=y&5?Gz(u,[y&1&&{title:b[0]},y&4&&Kz(b[2])]):{};if(y&2&&d!==(d=b[3][b[1]])){if(s){mo();const R=s;Be(R.$$.fragment,1,0,()=>{Jt(R,1)}),go()}d?(s=EC(d,h()),en(s.$$.fragment),xe(s.$$.fragment,1),Kt(s,a.parentNode,a)):s=null}else d&&s.$set(E)},i(b){l||(xe(e.$$.fragment,b),s&&xe(s.$$.fragment,b),l=!0)},o(b){Be(e.$$.fragment,b),s&&Be(s.$$.fragment,b),l=!1},d(b){Jt(e,b),b&&ke(t),b&&ke(a),s&&Jt(s,b)}}}function TIe(o,e,t){const s={members:Wwe,recordEdit:rIe,recordNotFound:Xwe,contentIndex:Jpe,homeIndex:_Ie,buildReport:kIe};let{title:a}=e,{view:l}=e,{user:u}=e,{data:d}=e,{channel:h}=e,{axios:b}=e,{readableSchemas:y}=e;return dD("axios",b),dD("channel",h),dD("readableSchemas",h.schemas.filter(C=>y.includes(C.name))),dD("user",u),o.$$set=C=>{"title"in C&&t(0,a=C.title),"view"in C&&t(1,l=C.view),"user"in C&&t(4,u=C.user),"data"in C&&t(2,d=C.data),"channel"in C&&t(5,h=C.channel),"axios"in C&&t(6,b=C.axios),"readableSchemas"in C&&t(7,y=C.readableSchemas)},[a,l,d,s,u,h,b,y]}class EIe extends uo{constructor(e){super(),co(this,e,TIe,xIe,lo,{title:0,view:1,user:4,data:2,channel:5,axios:6,readableSchemas:7})}}var Bg="top",H1="bottom",z1="right",Lg="left",vV="auto",nP=[Bg,H1,z1,Lg],OE="start",QD="end",QOe="clippingParents",nie="viewport",cD="popper",ZOe="reference",Vse=nP.reduce(function(o,e){return o.concat([e+"-"+OE,e+"-"+QD])},[]),oie=[].concat(nP,[vV]).reduce(function(o,e){return o.concat([e,e+"-"+OE,e+"-"+QD])},[]),HOe="beforeRead",zOe="read",VOe="afterRead",WOe="beforeMain",UOe="main",YOe="afterMain",XOe="beforeWrite",jOe="write",qOe="afterWrite",GOe=[HOe,zOe,VOe,WOe,UOe,YOe,XOe,jOe,qOe];function _y(o){return o?(o.nodeName||"").toLowerCase():null}function V1(o){if(o==null)return window;if(o.toString()!=="[object Window]"){var e=o.ownerDocument;return e&&e.defaultView||window}return o}function yE(o){var e=V1(o).Element;return o instanceof e||o instanceof Element}function Wb(o){var e=V1(o).HTMLElement;return o instanceof e||o instanceof HTMLElement}function sie(o){if(typeof ShadowRoot>"u")return!1;var e=V1(o).ShadowRoot;return o instanceof e||o instanceof ShadowRoot}function AIe(o){var e=o.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},a=e.attributes[t]||{},l=e.elements[t];!Wb(l)||!_y(l)||(Object.assign(l.style,s),Object.keys(a).forEach(function(u){var d=a[u];d===!1?l.removeAttribute(u):l.setAttribute(u,d===!0?"":d)}))})}function DIe(o){var e=o.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],l=e.attributes[s]||{},u=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),d=u.reduce(function(h,b){return h[b]="",h},{});!Wb(a)||!_y(a)||(Object.assign(a.style,d),Object.keys(l).forEach(function(h){a.removeAttribute(h)}))})}}const rie={name:"applyStyles",enabled:!0,phase:"write",fn:AIe,effect:DIe,requires:["computeStyles"]};function py(o){return o.split("-")[0]}var dE=Math.max,zz=Math.min,ZD=Math.round;function Wse(){var o=navigator.userAgentData;return o!=null&&o.brands&&Array.isArray(o.brands)?o.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function KOe(){return!/^((?!chrome|android).)*safari/i.test(Wse())}function HD(o,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=o.getBoundingClientRect(),a=1,l=1;e&&Wb(o)&&(a=o.offsetWidth>0&&ZD(s.width)/o.offsetWidth||1,l=o.offsetHeight>0&&ZD(s.height)/o.offsetHeight||1);var u=yE(o)?V1(o):window,d=u.visualViewport,h=!KOe()&&t,b=(s.left+(h&&d?d.offsetLeft:0))/a,y=(s.top+(h&&d?d.offsetTop:0))/l,C=s.width/a,E=s.height/l;return{width:C,height:E,top:y,right:b+C,bottom:y+E,left:b,x:b,y}}function iie(o){var e=HD(o),t=o.offsetWidth,s=o.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:o.offsetLeft,y:o.offsetTop,width:t,height:s}}function JOe(o,e){var t=e.getRootNode&&e.getRootNode();if(o.contains(e))return!0;if(t&&sie(t)){var s=e;do{if(s&&o.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Yw(o){return V1(o).getComputedStyle(o)}function PIe(o){return["table","td","th"].indexOf(_y(o))>=0}function HC(o){return((yE(o)?o.ownerDocument:o.document)||window.document).documentElement}function OV(o){return _y(o)==="html"?o:o.assignedSlot||o.parentNode||(sie(o)?o.host:null)||HC(o)}function vge(o){return!Wb(o)||Yw(o).position==="fixed"?null:o.offsetParent}function MIe(o){var e=/firefox/i.test(Wse()),t=/Trident/i.test(Wse());if(t&&Wb(o)){var s=Yw(o);if(s.position==="fixed")return null}var a=OV(o);for(sie(a)&&(a=a.host);Wb(a)&&["html","body"].indexOf(_y(a))<0;){var l=Yw(a);if(l.transform!=="none"||l.perspective!=="none"||l.contain==="paint"||["transform","perspective"].indexOf(l.willChange)!==-1||e&&l.willChange==="filter"||e&&l.filter&&l.filter!=="none")return a;a=a.parentNode}return null}function dI(o){for(var e=V1(o),t=vge(o);t&&PIe(t)&&Yw(t).position==="static";)t=vge(t);return t&&(_y(t)==="html"||_y(t)==="body"&&Yw(t).position==="static")?e:t||MIe(o)||e}function aie(o){return["top","bottom"].indexOf(o)>=0?"x":"y"}function v6(o,e,t){return dE(o,zz(e,t))}function RIe(o,e,t){var s=v6(o,e,t);return s>t?t:s}function eye(){return{top:0,right:0,bottom:0,left:0}}function tye(o){return Object.assign({},eye(),o)}function nye(o,e){return e.reduce(function(t,s){return t[s]=o,t},{})}var $Ie=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tye(typeof e!="number"?e:nye(e,nP))};function NIe(o){var e,t=o.state,s=o.name,a=o.options,l=t.elements.arrow,u=t.modifiersData.popperOffsets,d=py(t.placement),h=aie(d),b=[Lg,z1].indexOf(d)>=0,y=b?"height":"width";if(!(!l||!u)){var C=$Ie(a.padding,t),E=iie(l),R=h==="y"?Bg:Lg,$=h==="y"?H1:z1,Q=t.rects.reference[y]+t.rects.reference[h]-u[h]-t.rects.popper[y],F=u[h]-t.rects.reference[h],U=dI(l),K=U?h==="y"?U.clientHeight||0:U.clientWidth||0:0,L=Q/2-F/2,te=C[R],ne=K-E[y]-C[$],oe=K/2-E[y]/2+L,G=v6(te,oe,ne),we=h;t.modifiersData[s]=(e={},e[we]=G,e.centerOffset=G-oe,e)}}function IIe(o){var e=o.state,t=o.options,s=t.element,a=s===void 0?"[data-popper-arrow]":s;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!JOe(e.elements.popper,a)||(e.elements.arrow=a))}const oye={name:"arrow",enabled:!0,phase:"main",fn:NIe,effect:IIe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function zD(o){return o.split("-")[1]}var BIe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function LIe(o,e){var t=o.x,s=o.y,a=e.devicePixelRatio||1;return{x:ZD(t*a)/a||0,y:ZD(s*a)/a||0}}function Oge(o){var e,t=o.popper,s=o.popperRect,a=o.placement,l=o.variation,u=o.offsets,d=o.position,h=o.gpuAcceleration,b=o.adaptive,y=o.roundOffsets,C=o.isFixed,E=u.x,R=E===void 0?0:E,$=u.y,Q=$===void 0?0:$,F=typeof y=="function"?y({x:R,y:Q}):{x:R,y:Q};R=F.x,Q=F.y;var U=u.hasOwnProperty("x"),K=u.hasOwnProperty("y"),L=Lg,te=Bg,ne=window;if(b){var oe=dI(t),G="clientHeight",we="clientWidth";if(oe===V1(t)&&(oe=HC(t),Yw(oe).position!=="static"&&d==="absolute"&&(G="scrollHeight",we="scrollWidth")),oe=oe,a===Bg||(a===Lg||a===z1)&&l===QD){te=H1;var ve=C&&oe===ne&&ne.visualViewport?ne.visualViewport.height:oe[G];Q-=ve-s.height,Q*=h?1:-1}if(a===Lg||(a===Bg||a===H1)&&l===QD){L=z1;var Re=C&&oe===ne&&ne.visualViewport?ne.visualViewport.width:oe[we];R-=Re-s.width,R*=h?1:-1}}var Oe=Object.assign({position:d},b&&BIe),ce=y===!0?LIe({x:R,y:Q},V1(t)):{x:R,y:Q};if(R=ce.x,Q=ce.y,h){var Xe;return Object.assign({},Oe,(Xe={},Xe[te]=K?"0":"",Xe[L]=U?"0":"",Xe.transform=(ne.devicePixelRatio||1)<=1?"translate("+R+"px, "+Q+"px)":"translate3d("+R+"px, "+Q+"px, 0)",Xe))}return Object.assign({},Oe,(e={},e[te]=K?Q+"px":"",e[L]=U?R+"px":"",e.transform="",e))}function FIe(o){var e=o.state,t=o.options,s=t.gpuAcceleration,a=s===void 0?!0:s,l=t.adaptive,u=l===void 0?!0:l,d=t.roundOffsets,h=d===void 0?!0:d,b={placement:py(e.placement),variation:zD(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,Oge(Object.assign({},b,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:h})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Oge(Object.assign({},b,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const lie={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:FIe,data:{}};var hH={passive:!0};function QIe(o){var e=o.state,t=o.instance,s=o.options,a=s.scroll,l=a===void 0?!0:a,u=s.resize,d=u===void 0?!0:u,h=V1(e.elements.popper),b=[].concat(e.scrollParents.reference,e.scrollParents.popper);return l&&b.forEach(function(y){y.addEventListener("scroll",t.update,hH)}),d&&h.addEventListener("resize",t.update,hH),function(){l&&b.forEach(function(y){y.removeEventListener("scroll",t.update,hH)}),d&&h.removeEventListener("resize",t.update,hH)}}const cie={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:QIe,data:{}};var ZIe={left:"right",right:"left",bottom:"top",top:"bottom"};function VH(o){return o.replace(/left|right|bottom|top/g,function(e){return ZIe[e]})}var HIe={start:"end",end:"start"};function yge(o){return o.replace(/start|end/g,function(e){return HIe[e]})}function uie(o){var e=V1(o),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function fie(o){return HD(HC(o)).left+uie(o).scrollLeft}function zIe(o,e){var t=V1(o),s=HC(o),a=t.visualViewport,l=s.clientWidth,u=s.clientHeight,d=0,h=0;if(a){l=a.width,u=a.height;var b=KOe();(b||!b&&e==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}return{width:l,height:u,x:d+fie(o),y:h}}function VIe(o){var e,t=HC(o),s=uie(o),a=(e=o.ownerDocument)==null?void 0:e.body,l=dE(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),u=dE(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),d=-s.scrollLeft+fie(o),h=-s.scrollTop;return Yw(a||t).direction==="rtl"&&(d+=dE(t.clientWidth,a?a.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}function die(o){var e=Yw(o),t=e.overflow,s=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+s)}function sye(o){return["html","body","#document"].indexOf(_y(o))>=0?o.ownerDocument.body:Wb(o)&&die(o)?o:sye(OV(o))}function O6(o,e){var t;e===void 0&&(e=[]);var s=sye(o),a=s===((t=o.ownerDocument)==null?void 0:t.body),l=V1(s),u=a?[l].concat(l.visualViewport||[],die(s)?s:[]):s,d=e.concat(u);return a?d:d.concat(O6(OV(u)))}function Use(o){return Object.assign({},o,{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height})}function WIe(o,e){var t=HD(o,!1,e==="fixed");return t.top=t.top+o.clientTop,t.left=t.left+o.clientLeft,t.bottom=t.top+o.clientHeight,t.right=t.left+o.clientWidth,t.width=o.clientWidth,t.height=o.clientHeight,t.x=t.left,t.y=t.top,t}function wge(o,e,t){return e===nie?Use(zIe(o,t)):yE(e)?WIe(e,t):Use(VIe(HC(o)))}function UIe(o){var e=O6(OV(o)),t=["absolute","fixed"].indexOf(Yw(o).position)>=0,s=t&&Wb(o)?dI(o):o;return yE(s)?e.filter(function(a){return yE(a)&&JOe(a,s)&&_y(a)!=="body"}):[]}function YIe(o,e,t,s){var a=e==="clippingParents"?UIe(o):[].concat(e),l=[].concat(a,[t]),u=l[0],d=l.reduce(function(h,b){var y=wge(o,b,s);return h.top=dE(y.top,h.top),h.right=zz(y.right,h.right),h.bottom=zz(y.bottom,h.bottom),h.left=dE(y.left,h.left),h},wge(o,u,s));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function rye(o){var e=o.reference,t=o.element,s=o.placement,a=s?py(s):null,l=s?zD(s):null,u=e.x+e.width/2-t.width/2,d=e.y+e.height/2-t.height/2,h;switch(a){case Bg:h={x:u,y:e.y-t.height};break;case H1:h={x:u,y:e.y+e.height};break;case z1:h={x:e.x+e.width,y:d};break;case Lg:h={x:e.x-t.width,y:d};break;default:h={x:e.x,y:e.y}}var b=a?aie(a):null;if(b!=null){var y=b==="y"?"height":"width";switch(l){case OE:h[b]=h[b]-(e[y]/2-t[y]/2);break;case QD:h[b]=h[b]+(e[y]/2-t[y]/2);break}}return h}function VD(o,e){e===void 0&&(e={});var t=e,s=t.placement,a=s===void 0?o.placement:s,l=t.strategy,u=l===void 0?o.strategy:l,d=t.boundary,h=d===void 0?QOe:d,b=t.rootBoundary,y=b===void 0?nie:b,C=t.elementContext,E=C===void 0?cD:C,R=t.altBoundary,$=R===void 0?!1:R,Q=t.padding,F=Q===void 0?0:Q,U=tye(typeof F!="number"?F:nye(F,nP)),K=E===cD?ZOe:cD,L=o.rects.popper,te=o.elements[$?K:E],ne=YIe(yE(te)?te:te.contextElement||HC(o.elements.popper),h,y,u),oe=HD(o.elements.reference),G=rye({reference:oe,element:L,strategy:"absolute",placement:a}),we=Use(Object.assign({},L,G)),ve=E===cD?we:oe,Re={top:ne.top-ve.top+U.top,bottom:ve.bottom-ne.bottom+U.bottom,left:ne.left-ve.left+U.left,right:ve.right-ne.right+U.right},Oe=o.modifiersData.offset;if(E===cD&&Oe){var ce=Oe[a];Object.keys(Re).forEach(function(Xe){var tt=[z1,H1].indexOf(Xe)>=0?1:-1,ot=[Bg,H1].indexOf(Xe)>=0?"y":"x";Re[Xe]+=ce[ot]*tt})}return Re}function XIe(o,e){e===void 0&&(e={});var t=e,s=t.placement,a=t.boundary,l=t.rootBoundary,u=t.padding,d=t.flipVariations,h=t.allowedAutoPlacements,b=h===void 0?oie:h,y=zD(s),C=y?d?Vse:Vse.filter(function($){return zD($)===y}):nP,E=C.filter(function($){return b.indexOf($)>=0});E.length===0&&(E=C);var R=E.reduce(function($,Q){return $[Q]=VD(o,{placement:Q,boundary:a,rootBoundary:l,padding:u})[py(Q)],$},{});return Object.keys(R).sort(function($,Q){return R[$]-R[Q]})}function jIe(o){if(py(o)===vV)return[];var e=VH(o);return[yge(o),e,yge(e)]}function qIe(o){var e=o.state,t=o.options,s=o.name;if(!e.modifiersData[s]._skip){for(var a=t.mainAxis,l=a===void 0?!0:a,u=t.altAxis,d=u===void 0?!0:u,h=t.fallbackPlacements,b=t.padding,y=t.boundary,C=t.rootBoundary,E=t.altBoundary,R=t.flipVariations,$=R===void 0?!0:R,Q=t.allowedAutoPlacements,F=e.options.placement,U=py(F),K=U===F,L=h||(K||!$?[VH(F)]:jIe(F)),te=[F].concat(L).reduce(function(Et,Cn){return Et.concat(py(Cn)===vV?XIe(e,{placement:Cn,boundary:y,rootBoundary:C,padding:b,flipVariations:$,allowedAutoPlacements:Q}):Cn)},[]),ne=e.rects.reference,oe=e.rects.popper,G=new Map,we=!0,ve=te[0],Re=0;Re<te.length;Re++){var Oe=te[Re],ce=py(Oe),Xe=zD(Oe)===OE,tt=[Bg,H1].indexOf(ce)>=0,ot=tt?"width":"height",V=VD(e,{placement:Oe,boundary:y,rootBoundary:C,altBoundary:E,padding:b}),ut=tt?Xe?z1:Lg:Xe?H1:Bg;ne[ot]>oe[ot]&&(ut=VH(ut));var Qe=VH(ut),Bt=[];if(l&&Bt.push(V[ce]<=0),d&&Bt.push(V[ut]<=0,V[Qe]<=0),Bt.every(function(Et){return Et})){ve=Oe,we=!1;break}G.set(Oe,Bt)}if(we)for(var Ct=$?3:1,He=function(Cn){var je=te.find(function(mt){var he=G.get(mt);if(he)return he.slice(0,Cn).every(function(Zo){return Zo})});if(je)return ve=je,"break"},st=Ct;st>0;st--){var rn=He(st);if(rn==="break")break}e.placement!==ve&&(e.modifiersData[s]._skip=!0,e.placement=ve,e.reset=!0)}}const iye={name:"flip",enabled:!0,phase:"main",fn:qIe,requiresIfExists:["offset"],data:{_skip:!1}};function _ge(o,e,t){return t===void 0&&(t={x:0,y:0}),{top:o.top-e.height-t.y,right:o.right-e.width+t.x,bottom:o.bottom-e.height+t.y,left:o.left-e.width-t.x}}function Sge(o){return[Bg,z1,H1,Lg].some(function(e){return o[e]>=0})}function GIe(o){var e=o.state,t=o.name,s=e.rects.reference,a=e.rects.popper,l=e.modifiersData.preventOverflow,u=VD(e,{elementContext:"reference"}),d=VD(e,{altBoundary:!0}),h=_ge(u,s),b=_ge(d,a,l),y=Sge(h),C=Sge(b);e.modifiersData[t]={referenceClippingOffsets:h,popperEscapeOffsets:b,isReferenceHidden:y,hasPopperEscaped:C},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":y,"data-popper-escaped":C})}const aye={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:GIe};function KIe(o,e,t){var s=py(o),a=[Lg,Bg].indexOf(s)>=0?-1:1,l=typeof t=="function"?t(Object.assign({},e,{placement:o})):t,u=l[0],d=l[1];return u=u||0,d=(d||0)*a,[Lg,z1].indexOf(s)>=0?{x:d,y:u}:{x:u,y:d}}function JIe(o){var e=o.state,t=o.options,s=o.name,a=t.offset,l=a===void 0?[0,0]:a,u=oie.reduce(function(y,C){return y[C]=KIe(C,e.rects,l),y},{}),d=u[e.placement],h=d.x,b=d.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=b),e.modifiersData[s]=u}const lye={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:JIe};function eBe(o){var e=o.state,t=o.name;e.modifiersData[t]=rye({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const hie={name:"popperOffsets",enabled:!0,phase:"read",fn:eBe,data:{}};function tBe(o){return o==="x"?"y":"x"}function nBe(o){var e=o.state,t=o.options,s=o.name,a=t.mainAxis,l=a===void 0?!0:a,u=t.altAxis,d=u===void 0?!1:u,h=t.boundary,b=t.rootBoundary,y=t.altBoundary,C=t.padding,E=t.tether,R=E===void 0?!0:E,$=t.tetherOffset,Q=$===void 0?0:$,F=VD(e,{boundary:h,rootBoundary:b,padding:C,altBoundary:y}),U=py(e.placement),K=zD(e.placement),L=!K,te=aie(U),ne=tBe(te),oe=e.modifiersData.popperOffsets,G=e.rects.reference,we=e.rects.popper,ve=typeof Q=="function"?Q(Object.assign({},e.rects,{placement:e.placement})):Q,Re=typeof ve=="number"?{mainAxis:ve,altAxis:ve}:Object.assign({mainAxis:0,altAxis:0},ve),Oe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ce={x:0,y:0};if(!!oe){if(l){var Xe,tt=te==="y"?Bg:Lg,ot=te==="y"?H1:z1,V=te==="y"?"height":"width",ut=oe[te],Qe=ut+F[tt],Bt=ut-F[ot],Ct=R?-we[V]/2:0,He=K===OE?G[V]:we[V],st=K===OE?-we[V]:-G[V],rn=e.elements.arrow,Et=R&&rn?iie(rn):{width:0,height:0},Cn=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eye(),je=Cn[tt],mt=Cn[ot],he=v6(0,G[V],Et[V]),Zo=L?G[V]/2-Ct-he-je-Re.mainAxis:He-he-je-Re.mainAxis,Kn=L?-G[V]/2+Ct+he+mt+Re.mainAxis:st+he+mt+Re.mainAxis,so=e.elements.arrow&&dI(e.elements.arrow),Yo=so?te==="y"?so.clientTop||0:so.clientLeft||0:0,as=(Xe=Oe==null?void 0:Oe[te])!=null?Xe:0,kt=ut+Zo-as-Yo,jt=ut+Kn-as,pt=v6(R?zz(Qe,kt):Qe,ut,R?dE(Bt,jt):Bt);oe[te]=pt,ce[te]=pt-ut}if(d){var Ne,Gt=te==="x"?Bg:Lg,bn=te==="x"?H1:z1,At=oe[ne],An=ne==="y"?"height":"width",zn=At+F[Gt],ps=At-F[bn],oo=[Bg,Lg].indexOf(U)!==-1,Ss=(Ne=Oe==null?void 0:Oe[ne])!=null?Ne:0,Mr=oo?zn:At-G[An]-we[An]-Ss+Re.altAxis,$s=oo?At+G[An]+we[An]-Ss-Re.altAxis:ps,tr=R&&oo?RIe(Mr,At,$s):v6(R?Mr:zn,At,R?$s:ps);oe[ne]=tr,ce[ne]=tr-At}e.modifiersData[s]=ce}}const cye={name:"preventOverflow",enabled:!0,phase:"main",fn:nBe,requiresIfExists:["offset"]};function oBe(o){return{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}}function sBe(o){return o===V1(o)||!Wb(o)?uie(o):oBe(o)}function rBe(o){var e=o.getBoundingClientRect(),t=ZD(e.width)/o.offsetWidth||1,s=ZD(e.height)/o.offsetHeight||1;return t!==1||s!==1}function iBe(o,e,t){t===void 0&&(t=!1);var s=Wb(e),a=Wb(e)&&rBe(e),l=HC(e),u=HD(o,a,t),d={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(s||!s&&!t)&&((_y(e)!=="body"||die(l))&&(d=sBe(e)),Wb(e)?(h=HD(e,!0),h.x+=e.clientLeft,h.y+=e.clientTop):l&&(h.x=fie(l))),{x:u.left+d.scrollLeft-h.x,y:u.top+d.scrollTop-h.y,width:u.width,height:u.height}}function aBe(o){var e=new Map,t=new Set,s=[];o.forEach(function(l){e.set(l.name,l)});function a(l){t.add(l.name);var u=[].concat(l.requires||[],l.requiresIfExists||[]);u.forEach(function(d){if(!t.has(d)){var h=e.get(d);h&&a(h)}}),s.push(l)}return o.forEach(function(l){t.has(l.name)||a(l)}),s}function lBe(o){var e=aBe(o);return GOe.reduce(function(t,s){return t.concat(e.filter(function(a){return a.phase===s}))},[])}function cBe(o){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(o())})})),e}}function uBe(o){var e=o.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 Cge={placement:"bottom",modifiers:[],strategy:"absolute"};function kge(){for(var o=arguments.length,e=new Array(o),t=0;t<o;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function yV(o){o===void 0&&(o={});var e=o,t=e.defaultModifiers,s=t===void 0?[]:t,a=e.defaultOptions,l=a===void 0?Cge:a;return function(d,h,b){b===void 0&&(b=l);var y={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cge,l),modifiersData:{},elements:{reference:d,popper:h},attributes:{},styles:{}},C=[],E=!1,R={state:y,setOptions:function(U){var K=typeof U=="function"?U(y.options):U;Q(),y.options=Object.assign({},l,y.options,K),y.scrollParents={reference:yE(d)?O6(d):d.contextElement?O6(d.contextElement):[],popper:O6(h)};var L=lBe(uBe([].concat(s,y.options.modifiers)));return y.orderedModifiers=L.filter(function(te){return te.enabled}),$(),R.update()},forceUpdate:function(){if(!E){var U=y.elements,K=U.reference,L=U.popper;if(!!kge(K,L)){y.rects={reference:iBe(K,dI(L),y.options.strategy==="fixed"),popper:iie(L)},y.reset=!1,y.placement=y.options.placement,y.orderedModifiers.forEach(function(Re){return y.modifiersData[Re.name]=Object.assign({},Re.data)});for(var te=0;te<y.orderedModifiers.length;te++){if(y.reset===!0){y.reset=!1,te=-1;continue}var ne=y.orderedModifiers[te],oe=ne.fn,G=ne.options,we=G===void 0?{}:G,ve=ne.name;typeof oe=="function"&&(y=oe({state:y,options:we,name:ve,instance:R})||y)}}}},update:cBe(function(){return new Promise(function(F){R.forceUpdate(),F(y)})}),destroy:function(){Q(),E=!0}};if(!kge(d,h))return R;R.setOptions(b).then(function(F){!E&&b.onFirstUpdate&&b.onFirstUpdate(F)});function $(){y.orderedModifiers.forEach(function(F){var U=F.name,K=F.options,L=K===void 0?{}:K,te=F.effect;if(typeof te=="function"){var ne=te({state:y,name:U,instance:R,options:L}),oe=function(){};C.push(ne||oe)}})}function Q(){C.forEach(function(F){return F()}),C=[]}return R}}var fBe=yV(),dBe=[cie,hie,lie,rie],hBe=yV({defaultModifiers:dBe}),mBe=[cie,hie,lie,rie,lye,iye,cye,oye,aye],mie=yV({defaultModifiers:mBe});const uye=Object.freeze(Object.defineProperty({__proto__:null,popperGenerator:yV,detectOverflow:VD,createPopperBase:fBe,createPopper:mie,createPopperLite:hBe,top:Bg,bottom:H1,right:z1,left:Lg,auto:vV,basePlacements:nP,start:OE,end:QD,clippingParents:QOe,viewport:nie,popper:cD,reference:ZOe,variationPlacements:Vse,placements:oie,beforeRead:HOe,read:zOe,afterRead:VOe,beforeMain:WOe,main:UOe,afterMain:YOe,beforeWrite:XOe,write:jOe,afterWrite:qOe,modifierPhases:GOe,applyStyles:rie,arrow:oye,computeStyles:lie,eventListeners:cie,flip:iye,hide:aye,offset:lye,popperOffsets:hie,preventOverflow:cye},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 pC=new Map,goe={set(o,e,t){pC.has(o)||pC.set(o,new Map);const s=pC.get(o);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(o,e){return pC.has(o)&&pC.get(o).get(e)||null},remove(o,e){if(!pC.has(o))return;const t=pC.get(o);t.delete(e),t.size===0&&pC.delete(o)}},gBe=1e6,pBe=1e3,Yse="transitionend",fye=o=>(o&&window.CSS&&window.CSS.escape&&(o=o.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),o),bBe=o=>o==null?`${o}`:Object.prototype.toString.call(o).match(/\s([a-z]+)/i)[1].toLowerCase(),vBe=o=>{do o+=Math.floor(Math.random()*gBe);while(document.getElementById(o));return o},OBe=o=>{if(!o)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(o);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))*pBe)},dye=o=>{o.dispatchEvent(new Event(Yse))},Zw=o=>!o||typeof o!="object"?!1:(typeof o.jquery<"u"&&(o=o[0]),typeof o.nodeType<"u"),IC=o=>Zw(o)?o.jquery?o[0]:o:typeof o=="string"&&o.length>0?document.querySelector(fye(o)):null,oP=o=>{if(!Zw(o)||o.getClientRects().length===0)return!1;const e=getComputedStyle(o).getPropertyValue("visibility")==="visible",t=o.closest("details:not([open])");if(!t)return e;if(t!==o){const s=o.closest("summary");if(s&&s.parentNode!==t||s===null)return!1}return e},BC=o=>!o||o.nodeType!==Node.ELEMENT_NODE||o.classList.contains("disabled")?!0:typeof o.disabled<"u"?o.disabled:o.hasAttribute("disabled")&&o.getAttribute("disabled")!=="false",hye=o=>{if(!document.documentElement.attachShadow)return null;if(typeof o.getRootNode=="function"){const e=o.getRootNode();return e instanceof ShadowRoot?e:null}return o instanceof ShadowRoot?o:o.parentNode?hye(o.parentNode):null},Vz=()=>{},hI=o=>{o.offsetHeight},mye=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,poe=[],yBe=o=>{document.readyState==="loading"?(poe.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of poe)e()}),poe.push(o)):o()},Yb=()=>document.documentElement.dir==="rtl",Gb=o=>{yBe(()=>{const e=mye();if(e){const t=o.NAME,s=e.fn[t];e.fn[t]=o.jQueryInterface,e.fn[t].Constructor=o,e.fn[t].noConflict=()=>(e.fn[t]=s,o.jQueryInterface)}})},Bp=(o,e=[],t=o)=>typeof o=="function"?o(...e):t,gye=(o,e,t=!0)=>{if(!t){Bp(o);return}const s=5,a=OBe(e)+s;let l=!1;const u=({target:d})=>{d===e&&(l=!0,e.removeEventListener(Yse,u),Bp(o))};e.addEventListener(Yse,u),setTimeout(()=>{l||dye(e)},a)},gie=(o,e,t,s)=>{const a=o.length;let l=o.indexOf(e);return l===-1?!t&&s?o[a-1]:o[0]:(l+=t?1:-1,s&&(l=(l+a)%a),o[Math.max(0,Math.min(l,a-1))])},wBe=/[^.]*(?=\..*)\.|.*/,_Be=/\..*/,SBe=/::\d+$/,boe={};let xge=1;const pye={mouseenter:"mouseover",mouseleave:"mouseout"},CBe=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 bye(o,e){return e&&`${e}::${xge++}`||o.uidEvent||xge++}function vye(o){const e=bye(o);return o.uidEvent=e,boe[e]=boe[e]||{},boe[e]}function kBe(o,e){return function t(s){return pie(s,{delegateTarget:o}),t.oneOff&&ao.off(o,s.type,e),e.apply(o,[s])}}function xBe(o,e,t){return function s(a){const l=o.querySelectorAll(e);for(let{target:u}=a;u&&u!==this;u=u.parentNode)for(const d of l)if(d===u)return pie(a,{delegateTarget:u}),s.oneOff&&ao.off(o,a.type,e,t),t.apply(u,[a])}}function Oye(o,e,t=null){return Object.values(o).find(s=>s.callable===e&&s.delegationSelector===t)}function yye(o,e,t){const s=typeof e=="string",a=s?t:e||t;let l=wye(o);return CBe.has(l)||(l=o),[s,a,l]}function Tge(o,e,t,s,a){if(typeof e!="string"||!o)return;let[l,u,d]=yye(e,t,s);e in pye&&(u=($=>function(Q){if(!Q.relatedTarget||Q.relatedTarget!==Q.delegateTarget&&!Q.delegateTarget.contains(Q.relatedTarget))return $.call(this,Q)})(u));const h=vye(o),b=h[d]||(h[d]={}),y=Oye(b,u,l?t:null);if(y){y.oneOff=y.oneOff&&a;return}const C=bye(u,e.replace(wBe,"")),E=l?xBe(o,t,u):kBe(o,u);E.delegationSelector=l?t:null,E.callable=u,E.oneOff=a,E.uidEvent=C,b[C]=E,o.addEventListener(d,E,l)}function Xse(o,e,t,s,a){const l=Oye(e[t],s,a);!l||(o.removeEventListener(t,l,Boolean(a)),delete e[t][l.uidEvent])}function TBe(o,e,t,s){const a=e[t]||{};for(const[l,u]of Object.entries(a))l.includes(s)&&Xse(o,e,t,u.callable,u.delegationSelector)}function wye(o){return o=o.replace(_Be,""),pye[o]||o}const ao={on(o,e,t,s){Tge(o,e,t,s,!1)},one(o,e,t,s){Tge(o,e,t,s,!0)},off(o,e,t,s){if(typeof e!="string"||!o)return;const[a,l,u]=yye(e,t,s),d=u!==e,h=vye(o),b=h[u]||{},y=e.startsWith(".");if(typeof l<"u"){if(!Object.keys(b).length)return;Xse(o,h,u,l,a?t:null);return}if(y)for(const C of Object.keys(h))TBe(o,h,C,e.slice(1));for(const[C,E]of Object.entries(b)){const R=C.replace(SBe,"");(!d||e.includes(R))&&Xse(o,h,u,E.callable,E.delegationSelector)}},trigger(o,e,t){if(typeof e!="string"||!o)return null;const s=mye(),a=wye(e),l=e!==a;let u=null,d=!0,h=!0,b=!1;l&&s&&(u=s.Event(e,t),s(o).trigger(u),d=!u.isPropagationStopped(),h=!u.isImmediatePropagationStopped(),b=u.isDefaultPrevented());const y=pie(new Event(e,{bubbles:d,cancelable:!0}),t);return b&&y.preventDefault(),h&&o.dispatchEvent(y),y.defaultPrevented&&u&&u.preventDefault(),y}};function pie(o,e={}){for(const[t,s]of Object.entries(e))try{o[t]=s}catch{Object.defineProperty(o,t,{configurable:!0,get(){return s}})}return o}function Ege(o){if(o==="true")return!0;if(o==="false")return!1;if(o===Number(o).toString())return Number(o);if(o===""||o==="null")return null;if(typeof o!="string")return o;try{return JSON.parse(decodeURIComponent(o))}catch{return o}}function voe(o){return o.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Hw={setDataAttribute(o,e,t){o.setAttribute(`data-bs-${voe(e)}`,t)},removeDataAttribute(o,e){o.removeAttribute(`data-bs-${voe(e)}`)},getDataAttributes(o){if(!o)return{};const e={},t=Object.keys(o.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]=Ege(o.dataset[s])}return e},getDataAttribute(o,e){return Ege(o.getAttribute(`data-bs-${voe(e)}`))}};class mI{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=Zw(t)?Hw.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof s=="object"?s:{},...Zw(t)?Hw.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[s,a]of Object.entries(t)){const l=e[s],u=Zw(l)?"element":bBe(l);if(!new RegExp(a).test(u))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${u}" but expected type "${a}".`)}}}const EBe="5.3.2";class Av extends mI{constructor(e,t){super(),e=IC(e),e&&(this._element=e,this._config=this._getConfig(t),goe.set(this._element,this.constructor.DATA_KEY,this))}dispose(){goe.remove(this._element,this.constructor.DATA_KEY),ao.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,s=!0){gye(e,t,s)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return goe.get(IC(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return EBe}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 Ooe=o=>{let e=o.getAttribute("data-bs-target");if(!e||e==="#"){let t=o.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?fye(t.trim()):null}return e},Or={find(o,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,o))},findOne(o,e=document.documentElement){return Element.prototype.querySelector.call(e,o)},children(o,e){return[].concat(...o.children).filter(t=>t.matches(e))},parents(o,e){const t=[];let s=o.parentNode.closest(e);for(;s;)t.push(s),s=s.parentNode.closest(e);return t},prev(o,e){let t=o.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(o,e){let t=o.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(o){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,o).filter(t=>!BC(t)&&oP(t))},getSelectorFromElement(o){const e=Ooe(o);return e&&Or.findOne(e)?e:null},getElementFromSelector(o){const e=Ooe(o);return e?Or.findOne(e):null},getMultipleElementsFromSelector(o){const e=Ooe(o);return e?Or.find(e):[]}},wV=(o,e="hide")=>{const t=`click.dismiss${o.EVENT_KEY}`,s=o.NAME;ao.on(document,t,`[data-bs-dismiss="${s}"]`,function(a){if(["A","AREA"].includes(this.tagName)&&a.preventDefault(),BC(this))return;const l=Or.getElementFromSelector(this)||this.closest(`.${s}`);o.getOrCreateInstance(l)[e]()})},ABe="alert",DBe="bs.alert",_ye=`.${DBe}`,PBe=`close${_ye}`,MBe=`closed${_ye}`,RBe="fade",$Be="show";class _V extends Av{static get NAME(){return ABe}close(){if(ao.trigger(this._element,PBe).defaultPrevented)return;this._element.classList.remove($Be);const t=this._element.classList.contains(RBe);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),ao.trigger(this._element,MBe),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=_V.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)}})}}wV(_V,"close");Gb(_V);const NBe="button",IBe="bs.button",BBe=`.${IBe}`,LBe=".data-api",FBe="active",Age='[data-bs-toggle="button"]',QBe=`click${BBe}${LBe}`;class SV extends Av{static get NAME(){return NBe}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(FBe))}static jQueryInterface(e){return this.each(function(){const t=SV.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}ao.on(document,QBe,Age,o=>{o.preventDefault();const e=o.target.closest(Age);SV.getOrCreateInstance(e).toggle()});Gb(SV);const ZBe="swipe",sP=".bs.swipe",HBe=`touchstart${sP}`,zBe=`touchmove${sP}`,VBe=`touchend${sP}`,WBe=`pointerdown${sP}`,UBe=`pointerup${sP}`,YBe="touch",XBe="pen",jBe="pointer-event",qBe=40,GBe={endCallback:null,leftCallback:null,rightCallback:null},KBe={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Wz extends mI{constructor(e,t){super(),this._element=e,!(!e||!Wz.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return GBe}static get DefaultType(){return KBe}static get NAME(){return ZBe}dispose(){ao.off(this._element,sP)}_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(),Bp(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<=qBe)return;const t=e/this._deltaX;this._deltaX=0,t&&Bp(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(ao.on(this._element,WBe,e=>this._start(e)),ao.on(this._element,UBe,e=>this._end(e)),this._element.classList.add(jBe)):(ao.on(this._element,HBe,e=>this._start(e)),ao.on(this._element,zBe,e=>this._move(e)),ao.on(this._element,VBe,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===XBe||e.pointerType===YBe)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const JBe="carousel",e8e="bs.carousel",zC=`.${e8e}`,Sye=".data-api",t8e="ArrowLeft",n8e="ArrowRight",o8e=500,XN="next",oD="prev",uD="left",WH="right",s8e=`slide${zC}`,yoe=`slid${zC}`,r8e=`keydown${zC}`,i8e=`mouseenter${zC}`,a8e=`mouseleave${zC}`,l8e=`dragstart${zC}`,c8e=`load${zC}${Sye}`,u8e=`click${zC}${Sye}`,Cye="carousel",mH="active",f8e="slide",d8e="carousel-item-end",h8e="carousel-item-start",m8e="carousel-item-next",g8e="carousel-item-prev",kye=".active",xye=".carousel-item",p8e=kye+xye,b8e=".carousel-item img",v8e=".carousel-indicators",O8e="[data-bs-slide], [data-bs-slide-to]",y8e='[data-bs-ride="carousel"]',w8e={[t8e]:WH,[n8e]:uD},_8e={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},S8e={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class gI extends Av{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Or.findOne(v8e,this._element),this._addEventListeners(),this._config.ride===Cye&&this.cycle()}static get Default(){return _8e}static get DefaultType(){return S8e}static get NAME(){return JBe}next(){this._slide(XN)}nextWhenVisible(){!document.hidden&&oP(this._element)&&this.next()}prev(){this._slide(oD)}pause(){this._isSliding&&dye(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){ao.one(this._element,yoe,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){ao.one(this._element,yoe,()=>this.to(e));return}const s=this._getItemIndex(this._getActive());if(s===e)return;const a=e>s?XN:oD;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&&ao.on(this._element,r8e,e=>this._keydown(e)),this._config.pause==="hover"&&(ao.on(this._element,i8e,()=>this.pause()),ao.on(this._element,a8e,()=>this._maybeEnableCycle())),this._config.touch&&Wz.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const s of Or.find(b8e,this._element))ao.on(s,l8e,a=>a.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(uD)),rightCallback:()=>this._slide(this._directionToOrder(WH)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),o8e+this._config.interval))}};this._swipeHelper=new Wz(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=w8e[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=Or.findOne(kye,this._indicatorsElement);t.classList.remove(mH),t.removeAttribute("aria-current");const s=Or.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);s&&(s.classList.add(mH),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===XN,l=t||gie(this._getItems(),s,a,this._config.wrap);if(l===s)return;const u=this._getItemIndex(l),d=R=>ao.trigger(this._element,R,{relatedTarget:l,direction:this._orderToDirection(e),from:this._getItemIndex(s),to:u});if(d(s8e).defaultPrevented||!s||!l)return;const b=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(u),this._activeElement=l;const y=a?h8e:d8e,C=a?m8e:g8e;l.classList.add(C),hI(l),s.classList.add(y),l.classList.add(y);const E=()=>{l.classList.remove(y,C),l.classList.add(mH),s.classList.remove(mH,C,y),this._isSliding=!1,d(yoe)};this._queueCallback(E,s,this._isAnimated()),b&&this.cycle()}_isAnimated(){return this._element.classList.contains(f8e)}_getActive(){return Or.findOne(p8e,this._element)}_getItems(){return Or.find(xye,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Yb()?e===uD?oD:XN:e===uD?XN:oD}_orderToDirection(e){return Yb()?e===oD?uD:WH:e===oD?WH:uD}static jQueryInterface(e){return this.each(function(){const t=gI.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]()}})}}ao.on(document,u8e,O8e,function(o){const e=Or.getElementFromSelector(this);if(!e||!e.classList.contains(Cye))return;o.preventDefault();const t=gI.getOrCreateInstance(e),s=this.getAttribute("data-bs-slide-to");if(s){t.to(s),t._maybeEnableCycle();return}if(Hw.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});ao.on(window,c8e,()=>{const o=Or.find(y8e);for(const e of o)gI.getOrCreateInstance(e)});Gb(gI);const C8e="collapse",k8e="bs.collapse",pI=`.${k8e}`,x8e=".data-api",T8e=`show${pI}`,E8e=`shown${pI}`,A8e=`hide${pI}`,D8e=`hidden${pI}`,P8e=`click${pI}${x8e}`,woe="show",pD="collapse",gH="collapsing",M8e="collapsed",R8e=`:scope .${pD} .${pD}`,$8e="collapse-horizontal",N8e="width",I8e="height",B8e=".collapse.show, .collapse.collapsing",jse='[data-bs-toggle="collapse"]',L8e={parent:null,toggle:!0},F8e={parent:"(null|element)",toggle:"boolean"};class W6 extends Av{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const s=Or.find(jse);for(const a of s){const l=Or.getSelectorFromElement(a),u=Or.find(l).filter(d=>d===this._element);l!==null&&u.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 L8e}static get DefaultType(){return F8e}static get NAME(){return C8e}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(B8e).filter(d=>d!==this._element).map(d=>W6.getOrCreateInstance(d,{toggle:!1}))),e.length&&e[0]._isTransitioning||ao.trigger(this._element,T8e).defaultPrevented)return;for(const d of e)d.hide();const s=this._getDimension();this._element.classList.remove(pD),this._element.classList.add(gH),this._element.style[s]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const a=()=>{this._isTransitioning=!1,this._element.classList.remove(gH),this._element.classList.add(pD,woe),this._element.style[s]="",ao.trigger(this._element,E8e)},u=`scroll${s[0].toUpperCase()+s.slice(1)}`;this._queueCallback(a,this._element,!0),this._element.style[s]=`${this._element[u]}px`}hide(){if(this._isTransitioning||!this._isShown()||ao.trigger(this._element,A8e).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,hI(this._element),this._element.classList.add(gH),this._element.classList.remove(pD,woe);for(const a of this._triggerArray){const l=Or.getElementFromSelector(a);l&&!this._isShown(l)&&this._addAriaAndCollapsedClass([a],!1)}this._isTransitioning=!0;const s=()=>{this._isTransitioning=!1,this._element.classList.remove(gH),this._element.classList.add(pD),ao.trigger(this._element,D8e)};this._element.style[t]="",this._queueCallback(s,this._element,!0)}_isShown(e=this._element){return e.classList.contains(woe)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=IC(e.parent),e}_getDimension(){return this._element.classList.contains($8e)?N8e:I8e}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(jse);for(const t of e){const s=Or.getElementFromSelector(t);s&&this._addAriaAndCollapsedClass([t],this._isShown(s))}}_getFirstLevelChildren(e){const t=Or.find(R8e,this._config.parent);return Or.find(e,this._config.parent).filter(s=>!t.includes(s))}_addAriaAndCollapsedClass(e,t){if(!!e.length)for(const s of e)s.classList.toggle(M8e,!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=W6.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e]()}})}}ao.on(document,P8e,jse,function(o){(o.target.tagName==="A"||o.delegateTarget&&o.delegateTarget.tagName==="A")&&o.preventDefault();for(const e of Or.getMultipleElementsFromSelector(this))W6.getOrCreateInstance(e,{toggle:!1}).toggle()});Gb(W6);const Dge="dropdown",Q8e="bs.dropdown",CE=`.${Q8e}`,bie=".data-api",Z8e="Escape",Pge="Tab",H8e="ArrowUp",Mge="ArrowDown",z8e=2,V8e=`hide${CE}`,W8e=`hidden${CE}`,U8e=`show${CE}`,Y8e=`shown${CE}`,Tye=`click${CE}${bie}`,Eye=`keydown${CE}${bie}`,X8e=`keyup${CE}${bie}`,fD="show",j8e="dropup",q8e="dropend",G8e="dropstart",K8e="dropup-center",J8e="dropdown-center",cE='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',eLe=`${cE}.${fD}`,UH=".dropdown-menu",tLe=".navbar",nLe=".navbar-nav",oLe=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",sLe=Yb()?"top-end":"top-start",rLe=Yb()?"top-start":"top-end",iLe=Yb()?"bottom-end":"bottom-start",aLe=Yb()?"bottom-start":"bottom-end",lLe=Yb()?"left-start":"right-start",cLe=Yb()?"right-start":"left-start",uLe="top",fLe="bottom",dLe={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},hLe={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class by extends Av{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=Or.next(this._element,UH)[0]||Or.prev(this._element,UH)[0]||Or.findOne(UH,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return dLe}static get DefaultType(){return hLe}static get NAME(){return Dge}toggle(){return this._isShown()?this.hide():this.show()}show(){if(BC(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!ao.trigger(this._element,U8e,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(nLe))for(const s of[].concat(...document.body.children))ao.on(s,"mouseover",Vz);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(fD),this._element.classList.add(fD),ao.trigger(this._element,Y8e,e)}}hide(){if(BC(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(!ao.trigger(this._element,V8e,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))ao.off(s,"mouseover",Vz);this._popper&&this._popper.destroy(),this._menu.classList.remove(fD),this._element.classList.remove(fD),this._element.setAttribute("aria-expanded","false"),Hw.removeDataAttribute(this._menu,"popper"),ao.trigger(this._element,W8e,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!Zw(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Dge.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof uye>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:Zw(this._config.reference)?e=IC(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=mie(e,this._menu,t)}_isShown(){return this._menu.classList.contains(fD)}_getPlacement(){const e=this._parent;if(e.classList.contains(q8e))return lLe;if(e.classList.contains(G8e))return cLe;if(e.classList.contains(K8e))return uLe;if(e.classList.contains(J8e))return fLe;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(j8e)?t?rLe:sLe:t?aLe:iLe}_detectNavbar(){return this._element.closest(tLe)!==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")&&(Hw.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Bp(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const s=Or.find(oLe,this._menu).filter(a=>oP(a));!s.length||gie(s,t,e===Mge,!s.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=by.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===z8e||e.type==="keyup"&&e.key!==Pge)return;const t=Or.find(eLe);for(const s of t){const a=by.getInstance(s);if(!a||a._config.autoClose===!1)continue;const l=e.composedPath(),u=l.includes(a._menu);if(l.includes(a._element)||a._config.autoClose==="inside"&&!u||a._config.autoClose==="outside"&&u||a._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Pge||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const d={relatedTarget:a._element};e.type==="click"&&(d.clickEvent=e),a._completeHide(d)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s=e.key===Z8e,a=[H8e,Mge].includes(e.key);if(!a&&!s||t&&!s)return;e.preventDefault();const l=this.matches(cE)?this:Or.prev(this,cE)[0]||Or.next(this,cE)[0]||Or.findOne(cE,e.delegateTarget.parentNode),u=by.getOrCreateInstance(l);if(a){e.stopPropagation(),u.show(),u._selectMenuItem(e);return}u._isShown()&&(e.stopPropagation(),u.hide(),l.focus())}}ao.on(document,Eye,cE,by.dataApiKeydownHandler);ao.on(document,Eye,UH,by.dataApiKeydownHandler);ao.on(document,Tye,by.clearMenus);ao.on(document,X8e,by.clearMenus);ao.on(document,Tye,cE,function(o){o.preventDefault(),by.getOrCreateInstance(this).toggle()});Gb(by);const Aye="backdrop",mLe="fade",Rge="show",$ge=`mousedown.bs.${Aye}`,gLe={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},pLe={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Dye extends mI{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return gLe}static get DefaultType(){return pLe}static get NAME(){return Aye}show(e){if(!this._config.isVisible){Bp(e);return}this._append();const t=this._getElement();this._config.isAnimated&&hI(t),t.classList.add(Rge),this._emulateAnimation(()=>{Bp(e)})}hide(e){if(!this._config.isVisible){Bp(e);return}this._getElement().classList.remove(Rge),this._emulateAnimation(()=>{this.dispose(),Bp(e)})}dispose(){!this._isAppended||(ao.off(this._element,$ge),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(mLe),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=IC(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),ao.on(e,$ge,()=>{Bp(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){gye(e,this._getElement(),this._config.isAnimated)}}const bLe="focustrap",vLe="bs.focustrap",Uz=`.${vLe}`,OLe=`focusin${Uz}`,yLe=`keydown.tab${Uz}`,wLe="Tab",_Le="forward",Nge="backward",SLe={autofocus:!0,trapElement:null},CLe={autofocus:"boolean",trapElement:"element"};class Pye extends mI{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return SLe}static get DefaultType(){return CLe}static get NAME(){return bLe}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),ao.off(document,Uz),ao.on(document,OLe,e=>this._handleFocusin(e)),ao.on(document,yLe,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){!this._isActive||(this._isActive=!1,ao.off(document,Uz))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const s=Or.focusableChildren(t);s.length===0?t.focus():this._lastTabNavDirection===Nge?s[s.length-1].focus():s[0].focus()}_handleKeydown(e){e.key===wLe&&(this._lastTabNavDirection=e.shiftKey?Nge:_Le)}}const Ige=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Bge=".sticky-top",pH="padding-right",Lge="margin-right";class qse{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,pH,t=>t+e),this._setElementAttributes(Ige,pH,t=>t+e),this._setElementAttributes(Bge,Lge,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,pH),this._resetElementAttributes(Ige,pH),this._resetElementAttributes(Bge,Lge)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const a=this.getWidth(),l=u=>{if(u!==this._element&&window.innerWidth>u.clientWidth+a)return;this._saveInitialAttribute(u,t);const d=window.getComputedStyle(u).getPropertyValue(t);u.style.setProperty(t,`${s(Number.parseFloat(d))}px`)};this._applyManipulationCallback(e,l)}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&Hw.setDataAttribute(e,t,s)}_resetElementAttributes(e,t){const s=a=>{const l=Hw.getDataAttribute(a,t);if(l===null){a.style.removeProperty(t);return}Hw.removeDataAttribute(a,t),a.style.setProperty(t,l)};this._applyManipulationCallback(e,s)}_applyManipulationCallback(e,t){if(Zw(e)){t(e);return}for(const s of Or.find(e,this._element))t(s)}}const kLe="modal",xLe="bs.modal",Xb=`.${xLe}`,TLe=".data-api",ELe="Escape",ALe=`hide${Xb}`,DLe=`hidePrevented${Xb}`,Mye=`hidden${Xb}`,Rye=`show${Xb}`,PLe=`shown${Xb}`,MLe=`resize${Xb}`,RLe=`click.dismiss${Xb}`,$Le=`mousedown.dismiss${Xb}`,NLe=`keydown.dismiss${Xb}`,ILe=`click${Xb}${TLe}`,Fge="modal-open",BLe="fade",Qge="show",_oe="modal-static",LLe=".modal.show",FLe=".modal-dialog",QLe=".modal-body",ZLe='[data-bs-toggle="modal"]',HLe={backdrop:!0,focus:!0,keyboard:!0},zLe={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class WD extends Av{constructor(e,t){super(e,t),this._dialog=Or.findOne(FLe,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new qse,this._addEventListeners()}static get Default(){return HLe}static get DefaultType(){return zLe}static get NAME(){return kLe}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||ao.trigger(this._element,Rye,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Fge),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||ao.trigger(this._element,ALe).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Qge),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){ao.off(window,Xb),ao.off(this._dialog,Xb),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Dye({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Pye({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=Or.findOne(QLe,this._dialog);t&&(t.scrollTop=0),hI(this._element),this._element.classList.add(Qge);const s=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,ao.trigger(this._element,PLe,{relatedTarget:e})};this._queueCallback(s,this._dialog,this._isAnimated())}_addEventListeners(){ao.on(this._element,NLe,e=>{if(e.key===ELe){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),ao.on(window,MLe,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),ao.on(this._element,$Le,e=>{ao.one(this._element,RLe,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(Fge),this._resetAdjustments(),this._scrollBar.reset(),ao.trigger(this._element,Mye)})}_isAnimated(){return this._element.classList.contains(BLe)}_triggerBackdropTransition(){if(ao.trigger(this._element,DLe).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,s=this._element.style.overflowY;s==="hidden"||this._element.classList.contains(_oe)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(_oe),this._queueCallback(()=>{this._element.classList.remove(_oe),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=Yb()?"paddingLeft":"paddingRight";this._element.style[a]=`${t}px`}if(!s&&e){const a=Yb()?"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=WD.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof s[e]>"u")throw new TypeError(`No method named "${e}"`);s[e](t)}})}}ao.on(document,ILe,ZLe,function(o){const e=Or.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&o.preventDefault(),ao.one(e,Rye,a=>{a.defaultPrevented||ao.one(e,Mye,()=>{oP(this)&&this.focus()})});const t=Or.findOne(LLe);t&&WD.getInstance(t).hide(),WD.getOrCreateInstance(e).toggle(this)});wV(WD);Gb(WD);const VLe="offcanvas",WLe="bs.offcanvas",Kw=`.${WLe}`,$ye=".data-api",ULe=`load${Kw}${$ye}`,YLe="Escape",Zge="show",Hge="showing",zge="hiding",XLe="offcanvas-backdrop",Nye=".offcanvas.show",jLe=`show${Kw}`,qLe=`shown${Kw}`,GLe=`hide${Kw}`,Vge=`hidePrevented${Kw}`,Iye=`hidden${Kw}`,KLe=`resize${Kw}`,JLe=`click${Kw}${$ye}`,e7e=`keydown.dismiss${Kw}`,t7e='[data-bs-toggle="offcanvas"]',n7e={backdrop:!0,keyboard:!0,scroll:!1},o7e={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class LC extends Av{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return n7e}static get DefaultType(){return o7e}static get NAME(){return VLe}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||ao.trigger(this._element,jLe,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new qse().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Hge);const s=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(Zge),this._element.classList.remove(Hge),ao.trigger(this._element,qLe,{relatedTarget:e})};this._queueCallback(s,this._element,!0)}hide(){if(!this._isShown||ao.trigger(this._element,GLe).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(zge),this._backdrop.hide();const t=()=>{this._element.classList.remove(Zge,zge),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new qse().reset(),ao.trigger(this._element,Iye)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){ao.trigger(this._element,Vge);return}this.hide()},t=Boolean(this._config.backdrop);return new Dye({className:XLe,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new Pye({trapElement:this._element})}_addEventListeners(){ao.on(this._element,e7e,e=>{if(e.key===YLe){if(this._config.keyboard){this.hide();return}ao.trigger(this._element,Vge)}})}static jQueryInterface(e){return this.each(function(){const t=LC.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)}})}}ao.on(document,JLe,t7e,function(o){const e=Or.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&o.preventDefault(),BC(this))return;ao.one(e,Iye,()=>{oP(this)&&this.focus()});const t=Or.findOne(Nye);t&&t!==e&&LC.getInstance(t).hide(),LC.getOrCreateInstance(e).toggle(this)});ao.on(window,ULe,()=>{for(const o of Or.find(Nye))LC.getOrCreateInstance(o).show()});ao.on(window,KLe,()=>{for(const o of Or.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(o).position!=="fixed"&&LC.getOrCreateInstance(o).hide()});wV(LC);Gb(LC);const s7e=/^aria-[\w-]*$/i,Bye={"*":["class","dir","id","lang","role",s7e],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:[]},r7e=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),i7e=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,a7e=(o,e)=>{const t=o.nodeName.toLowerCase();return e.includes(t)?r7e.has(t)?Boolean(i7e.test(o.nodeValue)):!0:e.filter(s=>s instanceof RegExp).some(s=>s.test(t))};function l7e(o,e,t){if(!o.length)return o;if(t&&typeof t=="function")return t(o);const a=new window.DOMParser().parseFromString(o,"text/html"),l=[].concat(...a.body.querySelectorAll("*"));for(const u of l){const d=u.nodeName.toLowerCase();if(!Object.keys(e).includes(d)){u.remove();continue}const h=[].concat(...u.attributes),b=[].concat(e["*"]||[],e[d]||[]);for(const y of h)a7e(y,b)||u.removeAttribute(y.nodeName)}return a.body.innerHTML}const c7e="TemplateFactory",u7e={allowList:Bye,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},f7e={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},d7e={entry:"(string|element|function|null)",selector:"(string|element)"};class h7e extends mI{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return u7e}static get DefaultType(){return f7e}static get NAME(){return c7e}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,l]of Object.entries(this._config.content))this._setContent(e,l,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},d7e)}_setContent(e,t,s){const a=Or.findOne(s,e);if(!!a){if(t=this._resolvePossibleFunction(t),!t){a.remove();return}if(Zw(t)){this._putElementInTemplate(IC(t),a);return}if(this._config.html){a.innerHTML=this._maybeSanitize(t);return}a.textContent=t}}_maybeSanitize(e){return this._config.sanitize?l7e(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Bp(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const m7e="tooltip",g7e=new Set(["sanitize","allowList","sanitizeFn"]),Soe="fade",p7e="modal",bH="show",b7e=".tooltip-inner",Wge=`.${p7e}`,Uge="hide.bs.modal",jN="hover",Coe="focus",v7e="click",O7e="manual",y7e="hide",w7e="hidden",_7e="show",S7e="shown",C7e="inserted",k7e="click",x7e="focusin",T7e="focusout",E7e="mouseenter",A7e="mouseleave",D7e={AUTO:"auto",TOP:"top",RIGHT:Yb()?"left":"right",BOTTOM:"bottom",LEFT:Yb()?"right":"left"},P7e={allowList:Bye,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"},M7e={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 kE extends Av{constructor(e,t){if(typeof uye>"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 P7e}static get DefaultType(){return M7e}static get NAME(){return m7e}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),ao.off(this._element.closest(Wge),Uge,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=ao.trigger(this._element,this.constructor.eventName(_7e)),s=(hye(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:l}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(l.append(a),ao.trigger(this._element,this.constructor.eventName(C7e))),this._popper=this._createPopper(a),a.classList.add(bH),"ontouchstart"in document.documentElement)for(const d of[].concat(...document.body.children))ao.on(d,"mouseover",Vz);const u=()=>{ao.trigger(this._element,this.constructor.eventName(S7e)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(u,this.tip,this._isAnimated())}hide(){if(!this._isShown()||ao.trigger(this._element,this.constructor.eventName(y7e)).defaultPrevented)return;if(this._getTipElement().classList.remove(bH),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))ao.off(a,"mouseover",Vz);this._activeTrigger[v7e]=!1,this._activeTrigger[Coe]=!1,this._activeTrigger[jN]=!1,this._isHovered=null;const s=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),ao.trigger(this._element,this.constructor.eventName(w7e)))};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(Soe,bH),t.classList.add(`bs-${this.constructor.NAME}-auto`);const s=vBe(this.constructor.NAME).toString();return t.setAttribute("id",s),this._isAnimated()&&t.classList.add(Soe),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new h7e({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[b7e]: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(Soe)}_isShown(){return this.tip&&this.tip.classList.contains(bH)}_createPopper(e){const t=Bp(this._config.placement,[this,e,this._element]),s=D7e[t.toUpperCase()];return mie(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 Bp(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,...Bp(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")ao.on(this._element,this.constructor.eventName(k7e),this._config.selector,s=>{this._initializeOnDelegatedTarget(s).toggle()});else if(t!==O7e){const s=t===jN?this.constructor.eventName(E7e):this.constructor.eventName(x7e),a=t===jN?this.constructor.eventName(A7e):this.constructor.eventName(T7e);ao.on(this._element,s,this._config.selector,l=>{const u=this._initializeOnDelegatedTarget(l);u._activeTrigger[l.type==="focusin"?Coe:jN]=!0,u._enter()}),ao.on(this._element,a,this._config.selector,l=>{const u=this._initializeOnDelegatedTarget(l);u._activeTrigger[l.type==="focusout"?Coe:jN]=u._element.contains(l.relatedTarget),u._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},ao.on(this._element.closest(Wge),Uge,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=Hw.getDataAttributes(this._element);for(const s of Object.keys(t))g7e.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:IC(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=kE.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Gb(kE);const R7e="popover",$7e=".popover-header",N7e=".popover-body",I7e={...kE.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"},B7e={...kE.DefaultType,content:"(null|string|element|function)"};class vie extends kE{static get Default(){return I7e}static get DefaultType(){return B7e}static get NAME(){return R7e}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[$7e]:this._getTitle(),[N7e]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=vie.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Gb(vie);const L7e="scrollspy",F7e="bs.scrollspy",Oie=`.${F7e}`,Q7e=".data-api",Z7e=`activate${Oie}`,Yge=`click${Oie}`,H7e=`load${Oie}${Q7e}`,z7e="dropdown-item",sD="active",V7e='[data-bs-spy="scroll"]',koe="[href]",W7e=".nav, .list-group",Xge=".nav-link",U7e=".nav-item",Y7e=".list-group-item",X7e=`${Xge}, ${U7e} > ${Xge}, ${Y7e}`,j7e=".dropdown",q7e=".dropdown-toggle",G7e={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},K7e={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class CV extends Av{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 G7e}static get DefaultType(){return K7e}static get NAME(){return L7e}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=IC(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||(ao.off(this._config.target,Yge),ao.on(this._config.target,Yge,koe,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=u=>this._targetLinks.get(`#${u.target.id}`),s=u=>{this._previousScrollData.visibleEntryTop=u.target.offsetTop,this._process(t(u))},a=(this._rootElement||document.documentElement).scrollTop,l=a>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=a;for(const u of e){if(!u.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(u));continue}const d=u.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(l&&d){if(s(u),!a)return;continue}!l&&!d&&s(u)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=Or.find(koe,this._config.target);for(const t of e){if(!t.hash||BC(t))continue;const s=Or.findOne(decodeURI(t.hash),this._element);oP(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(sD),this._activateParents(e),ao.trigger(this._element,Z7e,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(z7e)){Or.findOne(q7e,e.closest(j7e)).classList.add(sD);return}for(const t of Or.parents(e,W7e))for(const s of Or.prev(t,X7e))s.classList.add(sD)}_clearActiveClass(e){e.classList.remove(sD);const t=Or.find(`${koe}.${sD}`,e);for(const s of t)s.classList.remove(sD)}static jQueryInterface(e){return this.each(function(){const t=CV.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]()}})}}ao.on(window,H7e,()=>{for(const o of Or.find(V7e))CV.getOrCreateInstance(o)});Gb(CV);const J7e="tab",eFe="bs.tab",xE=`.${eFe}`,tFe=`hide${xE}`,nFe=`hidden${xE}`,oFe=`show${xE}`,sFe=`shown${xE}`,rFe=`click${xE}`,iFe=`keydown${xE}`,aFe=`load${xE}`,lFe="ArrowLeft",jge="ArrowRight",cFe="ArrowUp",qge="ArrowDown",xoe="Home",Gge="End",uE="active",Kge="fade",Toe="show",uFe="dropdown",Lye=".dropdown-toggle",fFe=".dropdown-menu",Eoe=`:not(${Lye})`,dFe='.list-group, .nav, [role="tablist"]',hFe=".nav-item, .list-group-item",mFe=`.nav-link${Eoe}, .list-group-item${Eoe}, [role="tab"]${Eoe}`,Fye='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Aoe=`${mFe}, ${Fye}`,gFe=`.${uE}[data-bs-toggle="tab"], .${uE}[data-bs-toggle="pill"], .${uE}[data-bs-toggle="list"]`;class UD extends Av{constructor(e){super(e),this._parent=this._element.closest(dFe),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),ao.on(this._element,iFe,t=>this._keydown(t)))}static get NAME(){return J7e}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),s=t?ao.trigger(t,tFe,{relatedTarget:e}):null;ao.trigger(e,oFe,{relatedTarget:t}).defaultPrevented||s&&s.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(uE),this._activate(Or.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(Toe);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),ao.trigger(e,sFe,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(Kge))}_deactivate(e,t){if(!e)return;e.classList.remove(uE),e.blur(),this._deactivate(Or.getElementFromSelector(e));const s=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(Toe);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),ao.trigger(e,nFe,{relatedTarget:t})};this._queueCallback(s,e,e.classList.contains(Kge))}_keydown(e){if(![lFe,jge,cFe,qge,xoe,Gge].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(a=>!BC(a));let s;if([xoe,Gge].includes(e.key))s=t[e.key===xoe?0:t.length-1];else{const a=[jge,qge].includes(e.key);s=gie(t,e.target,a,!0)}s&&(s.focus({preventScroll:!0}),UD.getOrCreateInstance(s).show())}_getChildren(){return Or.find(Aoe,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=Or.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(uFe))return;const a=(l,u)=>{const d=Or.findOne(l,s);d&&d.classList.toggle(u,t)};a(Lye,uE),a(fFe,Toe),s.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,s){e.hasAttribute(t)||e.setAttribute(t,s)}_elemIsActive(e){return e.classList.contains(uE)}_getInnerElement(e){return e.matches(Aoe)?e:Or.findOne(Aoe,e)}_getOuterElement(e){return e.closest(hFe)||e}static jQueryInterface(e){return this.each(function(){const t=UD.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ao.on(document,rFe,Fye,function(o){["A","AREA"].includes(this.tagName)&&o.preventDefault(),!BC(this)&&UD.getOrCreateInstance(this).show()});ao.on(window,aFe,()=>{for(const o of Or.find(gFe))UD.getOrCreateInstance(o)});Gb(UD);const pFe="toast",bFe="bs.toast",VC=`.${bFe}`,vFe=`mouseover${VC}`,OFe=`mouseout${VC}`,yFe=`focusin${VC}`,wFe=`focusout${VC}`,_Fe=`hide${VC}`,SFe=`hidden${VC}`,CFe=`show${VC}`,kFe=`shown${VC}`,xFe="fade",Jge="hide",vH="show",OH="showing",TFe={animation:"boolean",autohide:"boolean",delay:"number"},EFe={animation:!0,autohide:!0,delay:5e3};class kV extends Av{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return EFe}static get DefaultType(){return TFe}static get NAME(){return pFe}show(){if(ao.trigger(this._element,CFe).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(xFe);const t=()=>{this._element.classList.remove(OH),ao.trigger(this._element,kFe),this._maybeScheduleHide()};this._element.classList.remove(Jge),hI(this._element),this._element.classList.add(vH,OH),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||ao.trigger(this._element,_Fe).defaultPrevented)return;const t=()=>{this._element.classList.add(Jge),this._element.classList.remove(OH,vH),ao.trigger(this._element,SFe)};this._element.classList.add(OH),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(vH),super.dispose()}isShown(){return this._element.classList.contains(vH)}_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(){ao.on(this._element,vFe,e=>this._onInteraction(e,!0)),ao.on(this._element,OFe,e=>this._onInteraction(e,!1)),ao.on(this._element,yFe,e=>this._onInteraction(e,!0)),ao.on(this._element,wFe,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=kV.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}wV(kV);Gb(kV);Zp.escape=function(o){return o};function AFe(){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return new kE(e)})}const DFe={account:Iwe,channel:EIe};let yH=[],PFe=function(){yH.map(t=>t.$destroy()),yH=[];const o=document.body.querySelectorAll(".lucent-component");if(o.length===0)return;const e=function(t){const s=t.attributes["data-layout"].value,[a,l]=Object.entries(DFe).find(([b,y])=>s===b);if(!l)return[];const u=document.getElementById("json-"+s).innerHTML,d=JSON.parse(u);d.axios=X2e;const h={target:t,props:d};yH=[...yH,new l(h)]};Array.from(o).map(e)};document.addEventListener("DOMContentLoaded",PFe);document.addEventListener("DOMContentLoaded",AFe);
|